Skip to content

chore:Remove swc_bundler#11936

Draft
hardfist wants to merge 13 commits into
swc-project:mainfrom
hardfist:remove-swc-bundler
Draft

chore:Remove swc_bundler#11936
hardfist wants to merge 13 commits into
swc-project:mainfrom
hardfist:remove-swc-bundler

Conversation

@hardfist

Copy link
Copy Markdown
Collaborator

Description:

Removes swc_bundler and swc_node_bundler from the workspace, along with the Node binding and @swc/core bundle / spack APIs that depended on them. This also removes related features, CI/publish wiring, package tests, and lockfile references.

While validating the removal, this PR fixes test failures that surfaced in the full workspace run:

  • Flow type-only import handling and parser rejection for reserved type-only import bindings.
  • npm wasm plugin resolution through node_modules.
  • styled-components plugin fixture dependency.
  • CLI hardlink fixture temp location.
  • JSX AST fixture expectation.
  • Deno transform fixture stack size.
  • _using_ctx helper expectation.
  • HTML fixture generation race in ordinary test runs.
  • swc_ecma_quote doctests.

Verification:

  • git submodule update --init --recursive
  • pnpm install --frozen-lockfile
  • cargo fmt --all --check
  • cargo clippy --all --all-targets -- -D warnings
  • cargo test --all
  • (cd packages/core && pnpm build:dev && pnpm test)
  • rg -n "swc_bundler|swc_node_bundler|bundler_node|swc_core/bundler" Cargo.toml Cargo.lock crates bindings packages scripts .github --glob '!target' --glob '!node_modules'

BREAKING CHANGE:

swc_bundler, swc_node_bundler, and the @swc/core bundle / spack APIs have been removed.

Related issue (if exists):

None.

@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3597e10

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hardfist hardfist changed the title Remove swc_bundler chore:Remove swc_bundler Jun 12, 2026
@codspeed-hq

codspeed-hq Bot commented Jun 12, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 2.68%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 188 untouched benchmarks
⏩ 120 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation es/lints/libs/three 49.2 ms 50.5 ms -2.68%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing hardfist:remove-swc-bundler (3597e10) with main (a71c8eb)

Open in CodSpeed

Footnotes

  1. 120 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@hardfist
hardfist marked this pull request as ready for review June 12, 2026 11:02
@hardfist
hardfist requested review from a team as code owners June 12, 2026 11:02
@hardfist
hardfist marked this pull request as draft June 12, 2026 11:04
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

swc/crates/swc/src/lib.rs

Lines 285 to 287 in 3597e10

match classify_flow_script_like_module_body(&module) {
FlowScriptLikeModuleKind::Script => {}
FlowScriptLikeModuleKind::RuntimeModule(..) => return Ok(Program::Module(module)),

P2 Badge Downgrade stripped Flow script modules before printing

When a Flow file is parsed with isModule: false but only has type-only imports/exports, flow_strip_script_like_module calls this after the Flow transform has removed those declarations. At that point the module body contains only statements, and classify_flow_script_like_module_body classifies that as RuntimeModule, so this new early return keeps the AST as Program::Module instead of converting it back to Script; with experimental.emitSourceMapScopes enabled the emitted top-level scope is then recorded as a module rather than the original global script scope for inputs like /** @flow */ import type {T} from './t'; const x = 1;.


const { createRequire } = require('node:module')

P2 Badge Keep the native loader compatible with declared Node engines

For users running the still-declared @swc/core engine range (node >=10), the generated loader now fails before it can load any binding because Node 10 does not understand the node:-prefixed core module specifier used here, and the same file also contains newer syntax such as optional chaining. Either the loader needs to keep using Node-10-compatible CommonJS syntax or the package engines need to be raised, otherwise supported Node 10 installations cannot even require('@swc/core').

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kdy1 kdy1 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.

Note: This requires v2 because of the API removal

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants