Skip to content

feat!: use SWC Next for stripping and remove transform mode - #507

Draft
kdy1 wants to merge 3 commits into
nodejs:mainfrom
kdy1:kdy1/try-swc-next
Draft

kdy1 wants to merge 3 commits into
nodejs:mainfrom
kdy1:kdy1/try-swc-next

Conversation

@kdy1

@kdy1 kdy1 commented Oct 30, 2026

Copy link
Copy Markdown
Member

Summary

Switch TypeScript type stripping from swc_ts_fast_strip to the SWC Next crates published on crates.io, pinned to 0.4.1. Preserve fixed-width stripping, the transformSync API, and the existing Node.js REPL helpers.

Remove mode: "transform", the amaro/transform loader, transformation-only options, and their dependencies and tests. Requests for the removed mode now fail instead of falling back to stripping. This is a breaking change, consistent with the removal of transformation support in nodejs/node#61803.

The adapters preserve Amaro's diagnostic codes and location fields, while messages and highlighted ranges come from SWC Next. Existing SWC crates remain for REPL helpers and diagnostic formatting.

Validation

Existing local validation of the reviewed changes at 8da62c210:

  • cargo test --manifest-path crates/amaro/Cargo.toml --locked: 18 passed.
  • wasm-pack build crates/amaro --out-name wasm --release --target nodejs -- --locked: passed.
  • npm run build, npm run typecheck, and npm run ci: passed.
  • npm test: 99 passed, including removed-mode rejection, loader behavior, source positions, and REPL helpers.

Draft status

Additional bug analysis of the related swc-next components is currently in progress to look for potential upstream bugs. This PR remains a draft while that analysis continues; the passing tests above do not establish complete compatibility or prove that swc-next is free of bugs.

AI assistance and human review

AI was used to prepare these changes. Human-reviewed by @kdy1.

  • Harness: T3 Code (Codex harness)
  • Model: gpt-6.1-sol
  • Reasoning Effort: medium

@marco-ippolito

Copy link
Copy Markdown
Member

Amazingg work, does this boost the performance?

@kdy1

kdy1 commented Oct 31, 2026

Copy link
Copy Markdown
Member Author
image

It's currently mixed, so I'll optimize the swc-next first

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants