Repository navigation
Update terser to v5, support async minifiers - #606
janicduplessis wants to merge 1 commit into
Conversation
| * comment and run Flow. */ | ||
| const result = terser.minify(code, options); | ||
|
|
||
| if (result.error) { |
There was a problem hiding this comment.
Terser will now throw an error so there is no need for additional handling anymore.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@cpojer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
We have a big integration with Metro and Buck internally that relies on this code being sync and changing every Flow to be async is a ton of work I unfortunately won't be able to get to. The good news is that with Hermes we shouldn't need a minifier, so we may be able to clean up our internal integration soon. |
|
I see, so you are using the metro-minify-terser package directly? What about landing the changes in metro-transform-worker only so it supports async minifiers? This would make it easy then to just publish a terser-v5 minify plugin. |
|
No, we don't actually use terser but we use the API synchronously in |
|
Ah ok, the function in transform-worker is already async, but I guess it works since there are no await in it currently. Alright in this case let's just keep this open and we can revisit later when the internal infra changes. |
|
Is there any hope to merging this? Our app is using terser and we've ran into a couple of terser bugs that it impossible to minify our app |
Summary: **Summary** Update terser to the latest version that supports more modern js syntax like optional chaining. The main breaking change in v5 is that minify is now async. To support this I also needed to add async minifier support in metro-transform-worker. **Test plan** - Run tests - Test building my app bundle with minifier terser and untransformed optional chaining Pull Request resolved: react#606 Reviewed By: feedthejim Differential Revision: D24883529 Pulled By: rh389 fbshipit-source-id: c9ed893535337ecc1ce16e433e3d689c2037be0a
Summary: **Summary** Update terser to the latest version that supports more modern js syntax like optional chaining. The main breaking change in v5 is that minify is now async. To support this I also needed to add async minifier support in metro-transform-worker. **Test plan** - Run tests - Test building my app bundle with minifier terser and untransformed optional chaining Pull Request resolved: react#606 Reviewed By: feedthejim Differential Revision: D24883529 Pulled By: rh389 fbshipit-source-id: c9ed893535337ecc1ce16e433e3d689c2037be0a
Summary: **Summary** Update terser to the latest version that supports more modern js syntax like optional chaining. The main breaking change in v5 is that minify is now async. To support this I also needed to add async minifier support in metro-transform-worker. **Test plan** - Run tests - Test building my app bundle with minifier terser and untransformed optional chaining Pull Request resolved: react#606 Reviewed By: feedthejim Differential Revision: D24883529 Pulled By: rh389 fbshipit-source-id: c9ed893535337ecc1ce16e433e3d689c2037be0a
Summary
Update terser to the latest version that supports more modern js syntax like optional chaining. The main breaking change in v5 is that minify is now async. To support this I also needed to add async minifier support in metro-transform-worker.
Test plan