question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update metro-react-native-babel-preset to remove unnecessary plugins with new JSC

See original GitHub issue

Do you want to request a feature or report a bug?

(This is more of an improvement request. I’m happy to help with the corresponding implementation.)

Since 0.59.0-rc0, react-native added support for a modern JSC for Android. This is super great because it means that a lot of the babel transforms/plugins used in the preset are no longer required.

List of unnecessary babel plugins:

  • @babel/plugin-transform-block-scoping
  • @babel/plugin-transform-computed-properties
  • @babel/plugin-transform-destructuring
  • @babel/plugin-transform-function-name
  • @babel/plugin-transform-literals
  • @babel/plugin-transform-parameters
  • @babel/plugin-transform-shorthand-properties
  • @babel/plugin-transform-regenerator (Only required for iOS 10)
  • @babel/plugin-transform-arrow-functions
  • @babel/plugin-transform-classes
  • @babel/plugin-transform-for-of
  • @babel/plugin-transform-spread
  • @babel/plugin-transform-template-literals
  • @babel/plugin-transform-exponentiation-operator (Only required for iOS 10)
  • @babel/plugin-transform-object-assign

A more thorough research of how I discovered these is available in this twitter thread.

What is the current behavior?

Currently all the above plugins are applied on the JS source, some selectively, some always.

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.

This is not a bug but is a potential opportunity for bundle size improvements.

What is the expected behavior?

It would be great if we remove plugins which are already supported in the minimum JSC version available on iOS and Android.

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.

N/A

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
lf94commented, Apr 27, 2022

Please fix this damn problem. I’m almost at the point where I have to fork metro to be productive. That’s terrible.

Is there something coming down the pipe that’s going to replace metro? Someone from Facebook, please respond. I know you’re reading!

2reactions
FilipMaslovariccommented, Feb 3, 2022

@ariccio I think you’re barking up the wrong tree 😦.

This issue may be open, but it seems like it’s definitely stale and hasn’t been caught by a bot.

If you look at all the linked issues that seem to take the stuff being discussed further, they have been shuttered due to FB being dead silent about this, sadly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Karan on Twitter: "Fix: Use the new terser minifier which is a ...
Update metro-react-native-babel-preset to remove unnecessary plugins with new JSC · Issue #359 ·... Do you want to request a feature or report a...
Read more >
How & Why You Should Remove Unused WordPress Plugins
Learn about how and why you should uninstall and remove unused WordPress ... Keep in mind – most plugins work by adding new...
Read more >
Unused Plugins - If You Don't Use It, Remove It - Patchstack
You should remove unused plugins and themes regularly. Simply disabling them is not enough - and I'll explain why.
Read more >
How to uninstall a WordPress plugin (completely) - Zapier
Developers have to regularly update plugins to keep them compliant with the latest version of WordPress. Sometimes plugins get abandoned by ...
Read more >
How to Remove Unused WordPress Plugins #shorts - YouTube
If you're unsure how to remove unused WordPress plugins, here's how you can do it! Start your online journey with Hostinger web hosting ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found