Skip to content

Conversation

@fi3ework
Copy link
Member

Summary

used a script to map SWC https://github.com/swc-project/swc/blob/main/crates/swc_ecma_preset_env/data/@babel/compat-data/data/plugins.json with https://github.com/swc-project/swc/blob/main/crates/swc_ecma_preset_env/src/lib.rs#L829-L847.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 23, 2025 03:49
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 PR aligns the ECMAScript version to browserslist mappings with SWC's implementation by updating browser version requirements across different ES versions. The changes remove .0.0 version suffixes, update browser version requirements to match SWC's data, and refactor es6 and es2023 to reference their equivalent ES versions using getters.

Key changes:

  • Updated browser version mappings for es5 through es2022 to match SWC's compatibility data
  • Simplified version format by removing .0.0 suffixes (e.g., 51.0.051)
  • Added getter properties for es6 (points to es2015) and es2023 (points to es2022)

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/utils/syntax.ts Updated ESX_TO_BROWSERSLIST mappings with SWC-aligned versions, simplified version format, and added getters for es6 and es2023
packages/core/tests/syntax.test.ts Refactored compareSemver helper function and updated test snapshots to reflect new browserslist expressions
packages/core/tests/config.test.ts Updated test snapshot to match new browserslist format for es2015
tests/integration/cli/build/build.test.ts Updated snapshot to reflect var to const transpilation change
tests/integration/syntax/snapshots/index.test.ts.snap Updated snapshot showing changes in transpilation output for default parameters and variable declarations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@netlify
Copy link

netlify bot commented Oct 23, 2025

Deploy Preview for rslib ready!

Name Link
🔨 Latest commit fd7e4b0
🔍 Latest deploy log https://app.netlify.com/projects/rslib/deploys/68f9a5ddd0931f0008654060
😎 Deploy Preview https://deploy-preview-1287--rslib.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Timeless0911 Timeless0911 merged commit eb47e13 into main Oct 23, 2025
15 checks passed
@Timeless0911 Timeless0911 deleted the bswc branch October 23, 2025 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants