FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Lazy top-level initializations for module transforms by guybedford · Pull Request #16629 · babel/babel · GitHub

/ babel Public

Lazy top-level initializations for module transforms - #16629

Merged
nicolo-ribaudo merged 5 commits into
babel:mainfrom
guybedford:lazy-module-transforms
Jul 12, 2024
Merged

nicolo-ribaudo merged 5 commits into
babel:mainfrom
guybedford:lazy-module-transforms

Conversation

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues? N/A, can post one if needed
Patch: Bug Fix? Mostly a refactoring
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? N/A
Documentation PR Link N/A
Any Dependency Changes? No
License MIT

There is a cyclic dependency between babel-helper-module-transforms and babel-core, which is not currently supported in jspm.io for running Babel when it is transpiled into ESM since CJS cycles behave differently to ESM cycles in allowing bindings defined before the require to be available.

With this minor refactoring in hoisting I've verified that this gets Babel to work correctly on jspm.io again.

There may be even be some minor top-level initialization performance benefits here as well in only initializing used features.

babel-bot commented Jul 11, 2024
edited
Loading

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57327

nicolo-ribaudo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Jul 11, 2024
nicolo-ribaudo force-pushed the lazy-module-transforms branch from c4c1df0 to 607b490 Compare July 11, 2024 08:13
Guy Bedford and others added 2 commits July 11, 2024 18:45

nicolo-ribaudo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks! It's unfortunate that we cannot easily add a test for this, but hopefully once we release Babel 8 (as native ESM) this problem won't risk happening anymore.

nicolo-ribaudo merged commit 7525e8a into babel:main Jul 12, 2024
github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 13, 2024
github-actions Bot locked as resolved and limited conversation to collaborators Oct 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL