Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: compat-data for transform-parameters ios version looks like not correct #16254

Closed
1 task
JiangWeixian opened this issue Feb 1, 2024 · 4 comments
Closed
1 task
Labels
i: question outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: compat-data

Comments

@JiangWeixian
Copy link

JiangWeixian commented Feb 1, 2024

馃捇

  • Would you like to work on a fix?

How are you using Babel?

Programmatic API (babel.transform, babel.parse)

Input code

It requires safari_ios > 16.3, but in caniuse, this version is support function rest parameters

image

Configuration file name

No response

Configuration

No response

Current and expected behavior

I use swc-loader transform code, but it use compat-data.json from babel.

Environment

Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000
Binaries:
Node: 18.19.0
npm: 10.2.3
Yarn: N/A
pnpm: 8.10.5

Possible solution

No response

Additional context

No response

@babel-bot
Copy link
Collaborator

Hey @JiangWeixian! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@liuxingbaoyu
Copy link
Member

liuxingbaoyu commented Feb 1, 2024

This is introduced at #13842, and the related compatibility data is https://github.com/compat-table/compat-table/blob/1a1ccdc02b8b2158ab39a6146d8a7308f43c830b/data-es6.js#L16866-L16910.
I don't quite understand the context here, maybe other members have ideas.

@JLHwung
Copy link
Contributor

JLHwung commented Feb 1, 2024

The compat-data we use is from https://github.com/kangax/compat-table, it is more granular than caniuse.

The Safari < 16.3 is affected by a bug https://bugs.webkit.org/show_bug.cgi?id=220517, where Safari will throw on such code:

let b = function a({ test: a }) { console.log(a); };

Please enable the https://swc.rs/docs/configuration/compilation#envbugfixes option. If this option is not enabled, Babel will transform parameters even if your source code may not be affected by this bug. I believe swc will behave the same.

@JiangWeixian
Copy link
Author

@JLHwung thanks

@JLHwung JLHwung closed this as completed Feb 2, 2024
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: question outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: compat-data
Projects
None yet
Development

No branches or pull requests

4 participants