Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issues with new versions of @babel/parser #968

Closed
ehmicky opened this issue Jan 27, 2022 · 2 comments
Closed

Performance issues with new versions of @babel/parser #968

ehmicky opened this issue Jan 27, 2022 · 2 comments
Assignees
Labels
Ecosystem: Dev Foundations type: bug code to address defects in shipped code

Comments

@ehmicky
Copy link
Contributor

ehmicky commented Jan 27, 2022

Some builds are experiencing a big slowdown when we upgrade @babel/parser from 7.16.8 to 7.16.10 (note: there is no 7.16.9 release).

We are currently unable to reproduce this locally. However, @eduardoboucas and I are able to reproduce this in production using the following Netlify site.

The only PR introduced by that release is babel/babel#14130, so it appears to be the reason. Two bugs related to that PR are open, which could be the root cause, but we are not sure yet: babel/babel#14182, babel/babel#14175

From extensive debugging, we are certain that the problem comes from this specific package and this specific version. We also know the problem comes from @babel/parser as a direct dependency of @netlify/zip-it-and-ship-it (see this and that), as opposed to as an indirect dependency through precinct (see this and that) and node-source-walker (see this and that).

The problem only impacts our legacy bundler, not the nft nor esbuild bundlers.

We have made a PR, now released, which pins the version of @babel/parser to 7.16.8 as a way to mitigate the problem: #966

However, this is not a long-term solution because it prevents us from upgrading @babel/parser in the future, which we might need to do for compatibility with the latest JavaScript syntax, or for security fixes. I see several possible long-term solutions there:

  1. Keep the old version of @babel/parser until we fully deprecate the legacy bundler.
  2. Follow the existing bug reports and new versions of @babel/parser hoping they fix this problem.
  3. Find the reason why this new version of @babel/parser is creating an issue with our code in this repository. Only 4 files are using this, so it might be doable, or at least worth some investigation.

@eduardoboucas @Skn0tt @minivan What are your thoughts on this?

@ehmicky ehmicky added type: bug code to address defects in shipped code action_item action item for an incident labels Jan 27, 2022
@eduardoboucas
Copy link
Member

I think we should keep the old version of @babel/parser for the time being, unless we find a strong reason to upgrade (like a bug or a missing feature).

@nicolo-ribaudo
Copy link

This might have been fixed in Babel 7.17.0 by babel/babel#14174.

@danez danez added Ecosystem: Dev Foundations and removed action_item action item for an incident labels May 15, 2023
@danez danez self-assigned this May 15, 2023
@danez danez closed this as completed Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ecosystem: Dev Foundations type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

4 participants