Next.js: Enhancement: remove regenerator runtime from any code that'll end up on the client

Created on 12 Mar 2019  ·  6Comments  ·  Source: vercel/next.js

Feature request

NextJS currently bundles regenerator-runtime in its distribution: 10k (minified) of JS that it doesn't need to. This is bad:

  • mobile clients, especially lower powered ones in emerging markets, struggle to parse giant chunks of JS
  • Next.js as a SSR framework is often picked by precisely the teams that care about performance
  • browsers are considering limits on JS due to the performance impact of too much JS

Therefore Next.js should remove this dependency. It's well worth the payoff for library code to avoid async and use promises directly.

Describe alternatives you've considered

As it's part of the distribution, it's unreasonably hard to remove as an end-user of Next.js.

Additional context

  • I'm seeing regenerator-runtime end up in client-side built code in router/index.js and lib/utils.js.
  • #1291 mentioned this'd be coming after preset env support.

Most helpful comment

One can never have too many Tims 🚀

All 6 comments

Still wondering why the issue templates are not being used 🤔


Just for context this issue entails the Next.js codebase itself, not the bundling of user code 🕵️

Still wondering why the issue templates are not being used

@tim-phillips my bad, fixed.

Too many Tim’s

One can never have too many Tims 🚀

Is it possible to manually configure Next.js to use native async support? I'm experimenting, but can't figure out how to do so.

Closing in favor of #7563

Was this page helpful?
0 / 5 - 0 ratings