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.

Increased bundle size after upgrading past 7.6

See original GitHub issue

v7 Regression

Potential Commit/PR that introduced the regression https://github.com/babel/babel/pull/10161

Description When we recently upgraded from 7.5 to 7.8 we experienced a bundle size increase from ~3,4 MB to 3.5 MB minified (+90 KB difference)

When we checked the bundle diff, we found that a function _getRequireWildcardCache is being re-defined for every module in our application and adds quite a bunch of code in total.

Searching for the function, we found that it’s a new feature in babel 7.6. Here’s a blog post where @ifsnow , who built this feature explains it nicely: https://www.notion.so/Improving-Babel-Import-performance-makes-React-Native-faster-4ab20915a599481ab8fbb4993db38709 (thanks for the explanation by the way)

But what we find now is that besides the performance improvement we’re hoping to get, we’re seeing this regression in bundle size.

Is that to be expected? Is it possible to opt-out of this optimization?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
nicolo-ribaudocommented, Jan 16, 2020

If you are also using preset-env, I suggest using it’s useBuiltIns: usage option rather than plugin-transform-runtime’s corejs. This is because preset-env only includes polyfills for your target environments, while transform-runtime polyfills everything.

1reaction
nicolo-ribaudocommented, Jan 15, 2020

If you are already using @babel/plugin-transform-runtime, this is probably what is happening: the helper has been updated, so Babel must inline it to ensure that you are using the new version (just in case your @babel/runtime is old). You can prevent this by passing a "version": "^7.6.0" (or whatever you are using) to tell “Hey Babel, I’m already using a version which includes the new feature. You don’t need to inline it!”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Increased bundle size after upgrading to MUI v5 in Gatsby
I updated MUI in my Gatsby project to v5, but the bundle size has increased by about 10 KB. I know it's not...
Read more >
What's New in Webpack 5 - Frontend Digest
After bundle size, the thing that can improve your app loading time the most is caching. With caching, returning visitors to your application...
Read more >
What's new in IBM Control Desk version 7.6.1
To upgrade, you must install IBM Control Desk version 7.6.1 in a separate location and then configure IBM Control Desk to access the...
Read more >
Upgrading your build from Gradle 6.x to the latest
Gradle will automatically clean up previous lock files when migrating them over to ... Gradle no longer embeds a copy of groovy-all that...
Read more >
CI Metrics | Kibana Guide [8.5] - Elastic
In order to prevent the page load bundles from growing unexpectedly large we limit the page load asset size metric for each plugin....
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