Repository navigation
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/63574 |
JLHwung
commented
Nov 17, 2026
| babelPlugins.proposalFunctionSent, | ||
| babelPlugins.proposalThrowExpressions, | ||
| babelPlugins.syntaxModuleBlocks, | ||
| babelPlugins.proposalBytesModules, |
Contributor
Author
There was a problem hiding this comment.
I am not quite willing to create a preset-stage-2.7.ts so this is what we got. 🤷🏻
|
commit: |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
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.
What changed in this PR
Adds bytes-module and text-module support to Babel Standalone so these proposals can be used in the Babel REPL.
Changes:
- Registers both proposal plugins and adds their workspace dependencies.
- Includes text modules in stage-3 and bytes modules in stage-2.
- Adds tests for transforming text and bytes imports through those presets.
| 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
`@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
JLHwung
force-pushed
the
jlhwung/standalone-add-bytes-text-modules
branch
from
November 20, 2026 18:51
00c5254 to
043b9c7
Compare
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.