Skip to content

Conversation

@jankapunkt
Copy link
Collaborator

The new SWC compiler in Meteor 3.3 is throwing errors with Blaze, because of the usage of arguments.
This PR attempts to replace all arguments with spread operator ...args

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This draft PR migrates Blaze from using the arguments object to the ES6 spread operator (...args) to ensure compatibility with Meteor 3.3's new SWC compiler. The changes are systematic and comprehensive, affecting the core Spacebars runtime, Blaze templating engine, HTML visitors, and related test files.

Key Changes

  • Replaced all arguments object usage with spread operator parameters (...args) across Spacebars, Blaze, HTMLjs, and observe-sequence packages
  • Eliminated Array.prototype.slice.call(arguments) patterns in favor of using spread parameters directly as arrays
  • Updated function signatures to use rest parameters and destructuring where appropriate

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/spacebars/spacebars-runtime.js Converted mustache implementation functions and helper functions to use spread operators
packages/spacebars-tests/templating_tests.js Updated test helper to use spread operator
packages/spacebars-tests/template_tests.js Updated test functions and fixed variable naming collision (tmpl4→tmpl5)
packages/spacebars-tests/old_templates_tests.js Updated test functions to use spread operator
packages/spacebars-compiler/templatetag.js Converted TemplateTag constructor to use spread operator
packages/spacebars-compiler/optimizer.js Updated TreeTransformer visitAttributes to use spread operator
packages/observe-sequence/observe_sequence_tests.js Converted ArraySubclass constructor to use spread operator
packages/observe-sequence/observe_sequence.js Updated warn function to use spread operator
packages/htmljs/visitors.js Converted visitor methods to use spread operators with proper destructuring
packages/blaze/view.js Updated event handler to use spread operator
packages/blaze/template.js Converted event map handler to use spread operator
packages/blaze/preamble.js Updated Blaze._bind to use spread operator
packages/blaze/exceptions.js Updated exception wrapper to use spread operator
packages/blaze/events.js Converted event handler to use spread operator
packages/blaze/attrs.js Updated UrlHandler update method to use spread operator
packages/blaze-hot/update-templates.js Updated constructView override to use spread operator

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jankapunkt
Copy link
Collaborator Author

We can continue with this, once #486 is merged

@jankapunkt jankapunkt added this to the 3.1 milestone Dec 17, 2025
@jankapunkt jankapunkt marked this pull request as ready for review December 17, 2025 07:33
@jankapunkt jankapunkt changed the title DRAFT: SWC Compatibility Feature: SWC Compatibility Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants