Skip to content

feat: react-compiler example introduce @swc/react-compiler #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

GiveMe-A-Name
Copy link
Contributor

@GiveMe-A-Name GiveMe-A-Name commented Jun 27, 2025

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the @swc/react-compiler check into the React examples, updating Rspack configs to conditionally route JSX/TSX files through Babel only when needed.

  • Add isReactCompilerRequiredSync check and node:fs import to Rspack configs
  • Change swc-loader option from sourceMap to sourceMaps
  • Update package.json to include @swc/react-compiler

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

File Description
rspack/react-compiler-babel/rspack.config.js Import @swc/react-compiler, update loader options, add Babel rule
rspack/react-compiler-babel/package.json Add @swc/react-compiler dependency
rspack/react-compiler-babel-ts/rspack.config.js Mirror above changes for TS example
rspack/react-compiler-babel-ts/package.json Add @swc/react-compiler dependency
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@GiveMe-A-Name GiveMe-A-Name marked this pull request as draft June 27, 2025 08:23
@GiveMe-A-Name GiveMe-A-Name force-pushed the feat/swc-react-compiler branch from 8985833 to be86d66 Compare June 27, 2025 08:32
GiveMe-A-Name and others added 2 commits June 27, 2025 16:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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