-
Notifications
You must be signed in to change notification settings - Fork 626
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
Make metro-minify-terser the default minifier #871
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Summary: `uglify-es` has not been published for 4 years and is marked deprecated [on npm](https://www.npmjs.com/package/uglify-es). Increasingly it does not support syntax that we would otherwise be able to pass through untranspiled. `terser` - is a fork of `uglify-es` that is currently the most downloaded JS minifier ([`terser`](https://www.npmjs.com/package/terser) vs [`uglify-js`](https://www.npmjs.com/package/uglify-js)). Changelog: **[Breaking]** Switch default minifier from `uglify-es` to `terser` Reviewed By: huntie Differential Revision: D34647616 fbshipit-source-id: 8e0e0d5ff9f7db621563921edd268f5022e1723b
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
labels
Sep 20, 2022
This pull request was exported from Phabricator. Differential Revision: D34647616 |
facebook-github-bot
pushed a commit
that referenced
this pull request
Sep 21, 2022
…form Summary: Context: `Math.pow(a, b)` throws when `a` or `b` is a BigInt, while `a ** b` evaluates to a BigInt in that case. This makes [`babel/plugin-transform-exponentiation-operator`](https://babeljs.io/docs/en/babel-plugin-transform-exponentiation-operator) unsafe in code that uses BigInts. See also facebook/react-native#34656, facebook/react-native#34603. Here we remove the plugin from the React Native Babel preset. This is safe to do because: 1. Hermes supports the `**` operator [natively](facebook/hermes@ae0bc93). 2. JSC on iOS has supported the `**` operator natively since version 10.3 (source: [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation#browser_compatibility)), and React Native targets iOS 12.4+. 3. The version of JSC React Native uses on Android ([jsc-android@v250230.2.1](https://github.com/react-native-community/jsc-android-buildscripts/releases/tag/v250230.2.1)) is based on [WebKit commit 250230](https://commits.webkit.org/250230@main) which [supports](https://github.com/WebKit/WebKit/blob/1d27863e32855c7fe51d5de1aae0589f11a428be/Source/JavaScriptCore/features.json#L170-L185) the `**` operator. 4. Metro now uses Terser as the default minifier (#871) which includes support for modern language features such as the `**` operator. Changelog: * **[Fix]** Remove exponentiation operator transform from `metro-react-native-babel-preset`. NOTE: This is a fix and not a breaking change because `metro-react-native-babel-preset` is *already* meant for use only with current React Native versions, where the `**` operator is supported natively (as shown above). Reviewed By: huntie Differential Revision: D39683437 fbshipit-source-id: 67d84e7a9eecf27e40b7d7b9d4b3666a4201fec1
robhogan
added a commit
to robhogan/metro
that referenced
this pull request
Jun 24, 2023
Summary: `metro-minify-terser` has been Metro's default JS minifier since Metro [0.73.0](https://github.com/facebook/metro/releases/tag/v0.73.0) (facebook#871). However, we have continued to publish the deprecated `metro-minify-uglify` and included it in `metro`'s dependencies for a time for convenience. (Consequently, package managers have displayed a confusing warning for the use of the deprecated `uglify-es`, even when it isn't actually used.) This PR removes `metro-minify-uglify` from the main branch and from `metro`'s dependencies. If any critical patches are required in future, they may be published from the `0.76.x` branch. Users wishing to use `metro-minify-uglify` as of the latest version published may still do so by adding `metro-minify-uglify@^0.76.0` to their project's dependencies and configuring [`transformer.minifierPath`](https://facebook.github.io/metro/docs/configuration/#minifierpath): ``` minifierPath: require.resolve('metro-minify-uglify') ``` Changelog: ``` - **[Breaking]**: Remove `metro-minify-uglify` from `metro` dependencies. ``` Differential Revision: D47000809 fbshipit-source-id: 3720c00c02cfa02e9c5c36f842708d16a48bccb5
facebook-github-bot
pushed a commit
that referenced
this pull request
Jun 26, 2023
Summary: Pull Request resolved: #1013 `metro-minify-terser` has been Metro's default JS minifier since Metro [0.73.0](https://github.com/facebook/metro/releases/tag/v0.73.0) (#871). However, we have continued to publish the deprecated `metro-minify-uglify` and included it in `metro`'s dependencies for a time for convenience. (Consequently, package managers have displayed a confusing warning for the use of the deprecated `uglify-es`, even when it isn't actually used.) This PR removes `metro-minify-uglify` from the main branch and from `metro`'s dependencies. If any critical patches are required in future, they may be published from the `0.76.x` branch. Users wishing to use `metro-minify-uglify` as of the latest version published may still do so by adding `metro-minify-uglify@^0.76.0` to their project's dependencies and configuring [`transformer.minifierPath`](https://facebook.github.io/metro/docs/configuration/#minifierpath): ``` minifierPath: require.resolve('metro-minify-uglify') ``` Changelog: ``` - **[Breaking]**: Remove `metro-minify-uglify` from `metro` dependencies. ``` Reviewed By: motiz88 Differential Revision: D47000809 fbshipit-source-id: aa3ab28ba6fc1cb35415247ef07aace952aa47f8
21 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
uglify-es
has not been published for 4 years and is marked deprecated on npm. Increasingly it does not support syntax that we would otherwise be able to pass through untranspiled.terser
- is a fork ofuglify-es
that is currently the most downloaded JS minifier (terser
vsuglify-js
).Changelog:
[Breaking] Switch default minifier from
uglify-es
toterser
Reviewed By: huntie
Differential Revision: D34647616