-
- Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(es/preset-env): Update polyfill data #11013
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
Conversation
🦋 Changeset detectedLatest commit: fad1121 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
Co-authored-by: magic-akari <7829098+magic-akari@users.noreply.github.com>
Co-authored-by: magic-akari <7829098+magic-akari@users.noreply.github.com>
Co-authored-by: magic-akari <7829098+magic-akari@users.noreply.github.com>
Co-authored-by: magic-akari <7829098+magic-akari@users.noreply.github.com>
@babel/compat-data and core-js-compat to their latest versions. 2. Run the script located at crates/swc_ecma_preset_env/scripts/copy-data.js. 3. Execute the test suite to check for any issues and determine whethe...
lixiaoyan left a comment
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.
In addition to toArray, take/drop are also missing from the database.
| "esnext.iterator.find", | ||
| "esnext.iterator.constructor", |
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.
Those two lines should be removed
| "pure": "instance/find", | ||
| "global": [ | ||
| "es.array.find", | ||
| "es.iterator.find", |
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.
map/filter/flatMap/reduce/forEach/some/every are also affected; they should be updated as well.
| @copilot Reflect the review from @lixiaoyan |
…modules Co-authored-by: kdy1 <29931815+kdy1@users.noreply.github.com>
I've reflected @lixiaoyan's review feedback by adding the missing standard ES iterator modules to all iterator helper methods in builtin.json. Based on their comment pointing to Babel's database update, I added |
| @kdy1 I suppose that |
| Is |
| @magic-akari I believe there are no scripts to sync it from Babel's |
lixiaoyan left a comment
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.
LGTM
| We're currently facing an issue where, for example, the |
|
|
Co-authored-by: magic-akari <7829098+magic-akari@users.noreply.github.com>
Co-authored-by: magic-akari <7829098+magic-akari@users.noreply.github.com>
Test case for issue #10516 has been added and test snapshots updated successfully. ✅ Added: Complete test case at Both test cases now properly demonstrate that Completed in commit a43e66f. |
Co-authored-by: magic-akari <7829098+magic-akari@users.noreply.github.com>
Test case for issue #10796 has been added at |
This PR adds comprehensive test cases for two polyfill-related issues and fixes an invalid test snapshot.
Issue #10516: Missing DOM Collections forEach Polyfill
The existing test for issue #9544 was invalid because it was missing the required
web.dom-collections.for-each.jspolyfill import when usingforEachon DOM collections likedocument.querySelectorAll('div').forEach().Problem: Test output was incomplete
Expected: Should include DOM collections polyfill
Issue #10796: Missing Promise.withResolvers Polyfill
Promise.withResolvers()is not being properly polyfilled when targeting older browsers.Problem: Missing ES2023 polyfill for Chrome 40
Changes Made
1. Added Test Case for Issue #10516
crates/swc/tests/fixture/issues-10xxx/10516/document.querySelectorAll('div').forEach(el => { console.log(el); })2. Added Test Case for Issue #10796
crates/swc/tests/fixture/issues-10xxx/10796/Promise.withResolvers()es.promise.with-resolvers.jspolyfill3. Fixed Invalid Test Case #9544
web.dom-collections.for-each.jspolyfillBoth test cases now properly demonstrate SWC's polyfill behavior for features that require additional imports when targeting older browsers.
shippedProposalsis not enabled #11010Iterator#toArray()/take()/drop()#11011✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.