-
-
Notifications
You must be signed in to change notification settings - Fork 116
Feature: SWC Compatibility #480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
argumentsobject 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>
|
We can continue with this, once #486 is merged |
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
argumentswith spread operator...args