GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: add bytes-modules and text-modules to standalone by JLHwung · Pull Request #18643 · babel/babel Conversation
Contributor
In this PR we add the bytes-modules and text-modules to babel-standalone, such that it can work on Babel REPL. We should have added in 8.1 but somehow we missed that.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/63574 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| babelPlugins.proposalFunctionSent, | ||
| babelPlugins.proposalThrowExpressions, | ||
| babelPlugins.syntaxModuleBlocks, | ||
| babelPlugins.proposalBytesModules, |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I am not quite willing to create a preset-stage-2.7.ts so this is what we got. 🤷🏻
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
commit: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The added stage-2 and stage-3 plugins break AMD/SystemJS transforms even for ordinary modules without text or bytes imports because the shared visitor resolves its helper prematurely.
Adds bytes-module and text-module support to Babel Standalone so these proposals can be used in the Babel REPL.
Changes:
| File | Description |
|---|---|
yarn.lock |
Records the new standalone workspace dependencies. |
packages/babel-standalone/tsconfig.json |
Adds project references for both plugins. |
packages/babel-standalone/test/preset-stage-1.test.js |
Tests text and bytes imports through stage presets. |
packages/babel-standalone/src/preset-stage-3.ts |
Enables text modules in stage-3. |
packages/babel-standalone/src/preset-stage-2.ts |
Enables bytes modules in stage-2. |
packages/babel-standalone/src/generated/plugins.ts |
Imports, exports, and registers both plugins. |
packages/babel-standalone/scripts/pluginConfig.json |
Includes both plugins in registry generation. |
packages/babel-standalone/package.json |
Declares both plugin dependencies. |
Review effort: Balanced
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
`@babel/plugin-proposal-bytes-modules` and `@babel/plugin-proposal-text-modules` were not included in standalone, so the REPL had to fetch them from an external bundler and failed with "Plugin ... could not be loaded". Assisted-by: Claude Opus 5.5
Add `proposal-bytes-modules` to `stage-2` and `proposal-text-modules` to `stage-3`. Assisted-by: Claude Opus 5.5
`createImportTypeAsDefaultPlugin` resolved its helper, which throws for AMD/SystemJS output, before looking for imports with a matching `type`. Every module compiled to AMD or SystemJS therefore failed with the JSON, text or bytes modules plugin enabled, which also broke the standalone `stage-2` and `stage-3` presets now that they include these plugins. Assisted-by: Claude Opus 5.5
00c5254 to
043b9c7
Compare
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.