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.

question: it is not clear why @babel/runtime is included in the deps of 10-alpha

See original GitHub issue

Two years ago in #397 babel-runtime has been removed by @zerkalica with a reason to reduce end user bundle size, but in august last year in #833 @babel/runtime has been re-added by @TrySound with a readded with the same reasoning of reducing end user bundle size.

I dont understand re-addition of it and I dont claim it is wrong. I perhaps need more details behind this reasoning and how that was meant to work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
NeoLegendscommented, Jan 11, 2019

Two years ago in #397 babel-runtime has been removed by @zerkalica with a reason to reduce end user bundle size, but in august last year in #833 @babel/runtime has been re-added by @TrySound with a readded with the same reasoning of reducing end user bundle size.

To be fair, I think the reasons provided in #397 were unreasonable in the sense there must have been some issue with tree shaking. The author of the issue claimed that the full 34kb of core-js were imported into his bundle, but in that example only a few helpers / core-js functions were required. With proper tree-shaking applied, the size-penalty would have been much less than that.

After all, the imports from babel-runtime should not be any different than the one babel inlines into the source files (except for loose mode, obviously). This implies that there should, with proper tree shaking, never be a negative (with negative meaning a bigger bundle) difference when extracting helpers into babel-runtime.

I’m very much in favor of extracting the helpers to reduce duplication.

1reaction
TrySoundcommented, Jan 8, 2019

@iamstarkov We do not add any polyfills. Current babel runtime allows to share helpers like _extends, _inheris, _createClass between many packages so they are not duplicated dozens of times in user bundle. These helpers also cherry-picked like @babel/runtime/esm/helpers/extends which prevents appearing unnecessary code in user bundles.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do @babel/runtime / @babel/plugin-transform-runtime in CLI ...
The short answer is yes: @babel/runtime (and @babel/plugin-transform-runtime ) is intended to be treated as a dependency.
Read more >
babel/runtime
babel /runtime` is a library that contains Babel modular runtime helpers. ... This is meant to be used as a runtime dependency along...
Read more >
@babel/runtime | Yarn - Package Manager
Intro. Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain...
Read more >
Cannot find module 'babel-runtime/helpers/asyncToGenerator'
I am using Debian's provided yarn, and nvm for node.
Read more >
How I solved and debugged my Webpack issue through trial ...
js ) and one of the source files contains an error, the stack trace will simply point to bundle.js . This isn't always...
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