You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uses Acorn to parse compiled files and create a tree of scopes. Then,
only apply renames in scopes when appropriate. This is far better than
what we were doing before when we were just looking for nearby renames.
This is not very fast for large bundled files. I initially worked on
building a fork of https://github.com/guybedford/es-module-lexer that
would scan for blocks. This worked in many cases, but failed for cases
when there's no BlockStatement. For example, `for (const foo of bar) foo()`
would not detect a 'scope' around `foo()`. This is not great, especially
with minified code where such patterns are common.
Instead, we'll parse large bundles (>512KB) in a one-off worker_thread.
We also some work in our build process to vendor acorn and acorn-loose
to avoid duplicating it in the worker thread code.
0 commit comments