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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Babel plugins: remove outdated proposals #1074

Merged
merged 3 commits into from
Jul 13, 2021
Merged

Babel plugins: remove outdated proposals #1074

merged 3 commits into from
Jul 13, 2021

Conversation

samouri
Copy link
Member

@samouri samouri commented Jul 12, 2021

summary

We recently started receiving a new warning during worker-dom build:

Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the "loose" mode option was set to "true" for @babel/plugin-proposal-class-properties.
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
        ["@babel/plugin-proposal-private-methods", { "loose": true }]
to the "plugins" section of your Babel config.

This PR fixes that warnings by removing our explicit inclusion of two proposals which are automatically configured by preset-env anyway.


I also made an unrelated changes: migrate from rollup-plugin-babel to @rollup/plugin-babel (new location for the same package)

testing done

I checked via diff and the output binaries are byte for byte identical.

cc @jridgewell since this is a change to babel config.

@samouri samouri self-assigned this Jul 12, 2021
@samouri samouri marked this pull request as ready for review July 12, 2021 10:39
@samouri samouri requested a review from jridgewell July 12, 2021 10:40
- Also updates the browserlist to be more succint.
- Also migrates from rollup-plugin-babel --> @rollup/plugin-babel
@@ -28,10 +28,11 @@ const walk = require('acorn-walk');
* - allowPostMessage Should we allow postMessage to/from the Worker?
*/
export function babelPlugin({ transpileToES5, allowConsole = false, allowPostMessage = true }) {
const targets = transpileToES5 ? { browsers: ['last 2 versions', 'ie >= 11', 'safari >= 7'] } : { esmodules: true };
const targets = transpileToES5 ? { browsers: ['ie >= 11', 'safari >= 8'] } : { esmodules: true };
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this means we're only targeting Safari 9 and Edge 12 in our matrix, which means, eg, a Chrome bug won't be transpiled down appropriately.

Copy link
Member Author

Choose a reason for hiding this comment

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

WDYT of "> 1.0%"

@samouri samouri merged commit d2baf04 into main Jul 13, 2021
@samouri samouri deleted the babel-updates branch July 13, 2021 14:47
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