GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add bytes-modules and text-modules to standalone by JLHwung · Pull Request #18643 · babel/babel

Conversation

@JLHwung

@JLHwung JLHwung commented Nov 17, 2026

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature? Yes
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
Need backport? No
License MIT

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
@JLHwung
JLHwung requested a review from nicolo-ribaudo November 17, 2026 03:27
@JLHwung JLHwung added the PR: New Feature 🚀 A type of pull request used for our changelog categories label Nov 17, 2026
@babel-bot

babel-bot commented Nov 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JLHwung
JLHwung commented Nov 17, 2026
View reviewed changes
Comment thread packages/babel-standalone/src/preset-stage-2.ts
babelPlugins.proposalFunctionSent,
babelPlugins.proposalThrowExpressions,
babelPlugins.syntaxModuleBlocks,
babelPlugins.proposalBytesModules,

@JLHwung JLHwung Nov 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Open in StackBlitz

commit: 043b9c7

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@liuxingbaoyu
liuxingbaoyu requested a balanced review from Copilot November 17, 2026 14:46
Copilot started reviewing on behalf of liuxingbaoyu November 17, 2026 14:47
View session
@liuxingbaoyu
liuxingbaoyu self-requested a review November 17, 2026 14:48
Copilot AI reviewed Nov 17, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

🟡 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.

1 open issue
  • High severity Text/bytes preset plugins break AMD/SystemJS modules without matching imports · New
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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/babel-standalone/src/preset-stage-3.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JLHwung JLHwung added this to the v8.2.0 milestone Nov 17, 2026
@JLHwung JLHwung mentioned this pull request Nov 17, 2026
fix(json, text, bytes modules): keep both default and namespace imports #18648
Merged
JLHwung added 3 commits November 20, 2026 13:49
@JLHwung
Add bytes and text modules plugins to @babel/standalone
570a54c
`@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
@JLHwung
Enable bytes and text modules in standalone stage presets
6b6d3c7
Add `proposal-bytes-modules` to `stage-2` and `proposal-text-modules`
to `stage-3`.

Assisted-by: Claude Opus 5.5
@JLHwung
Only check the module format when a matching import is found
043b9c7
`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
JLHwung force-pushed the jlhwung/standalone-add-bytes-text-modules branch from 00c5254 to 043b9c7 Compare November 20, 2026 18:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@nicolo-ribaudo nicolo-ribaudo Awaiting requested review from nicolo-ribaudo
@liuxingbaoyu liuxingbaoyu Awaiting requested review from liuxingbaoyu

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

PR: New Feature 🚀 A type of pull request used for our changelog categories

Projects

None yet

Milestone

v8.2.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@JLHwung @babel-bot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.