Skip to content

feat: inline React Compiler SWC adapter#11773

Closed
kdy1 wants to merge 1 commit intoswc-project:mainfrom
kdy1:kdy1/inline-react-compiler-swc
Closed

feat: inline React Compiler SWC adapter#11773
kdy1 wants to merge 1 commit intoswc-project:mainfrom
kdy1:kdy1/inline-react-compiler-swc

Conversation

@kdy1
Copy link
Copy Markdown
Member

@kdy1 kdy1 commented Apr 7, 2026

Summary

  • vendor the React Compiler Rust crates from facebook/react#36173 and pin the import to commit 72adadf3097cd60e1f320d609e53f19eaf3e81cc
  • inline the upstream react_compiler_swc adapter into swc_ecma_react_compiler and keep fast_check::is_required as a compatibility shim
  • expose transform/transformSync from the node binding and @swc/react-compiler, plus fixture and smoke-test coverage

Testing

  • git submodule update --init --recursive
  • cargo fmt --all
  • cargo clippy --all --all-targets -- -D warnings
  • cargo test -p react_compiler -p react_compiler_ast -p react_compiler_diagnostics -p react_compiler_hir -p react_compiler_inference -p react_compiler_lowering -p react_compiler_optimization -p react_compiler_reactive_scopes -p react_compiler_ssa -p react_compiler_typeinference -p react_compiler_utils -p react_compiler_validation -p swc_ecma_react_compiler -p binding_react_compiler_node
  • cargo test -p swc_ecma_react_compiler --test fixture -- --ignored
  • yarn workspace @swc/react-compiler test

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 7, 2026

⚠️ No Changeset found

Latest commit: b41ffe4

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

@socket-security
Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm js-beautify is 100.0% likely obfuscated

Confidence: 1.00

Location: Package overview

From: package.jsonnpm/js-beautify@1.14.7

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/js-beautify@1.14.7. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Binary Sizes

File Size
swc.linux-x64-gnu.node 28M (29074376 bytes)

Commit: b9d6b9f

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 7, 2026

Merging this PR will not alter performance

✅ 219 untouched benchmarks


Comparing kdy1:kdy1/inline-react-compiler-swc (b41ffe4) with main (236eff0)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (87dee57) during the generation of this report, so 236eff0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@kdy1 kdy1 closed this Apr 7, 2026
@kdy1 kdy1 deleted the kdy1/inline-react-compiler-swc branch April 7, 2026 17:29
@github-actions github-actions bot added this to the Planned milestone Apr 7, 2026
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.

1 participant