Skip to content

Migrate away from vite-plugin-swc#408

Merged
yamcodes merged 1 commit intomainfrom
switch-to-plugin-react
Nov 21, 2025
Merged

Migrate away from vite-plugin-swc#408
yamcodes merged 1 commit intomainfrom
switch-to-plugin-react

Conversation

@yamcodes
Copy link
Owner

@yamcodes yamcodes commented Nov 21, 2025

  • Removed @swc/core from onlyBuiltDependencies in package.json.
  • Updated @vitejs/plugin-react-swc to @vitejs/plugin-react version 5.1.1 in apps/www/package.json.
  • Adjusted vitest.config.ts to use the new @vitejs/plugin-react and updated Babel plugin configuration for styled-jsx.

These changes streamline the build process and ensure compatibility with the latest plugin versions.


We are migrating away from vite-plugin-swc due to unstable compatibility issues, see similar: lingui/js-lingui#2141

Summary by CodeRabbit

  • Chores
    • Updated development build tool configuration to optimize the build pipeline.
    • Refined dependency management for improved build performance.

✏️ Tip: You can customize this high-level summary in your review settings.

- Removed `@swc/core` from `onlyBuiltDependencies` in `package.json`.
- Updated `@vitejs/plugin-react-swc` to `@vitejs/plugin-react` version `5.1.1` in `apps/www/package.json`.
- Adjusted `vitest.config.ts` to use the new `@vitejs/plugin-react` and updated Babel plugin configuration for styled-jsx.

These changes streamline the build process and ensure compatibility with the latest plugin versions.
@changeset-bot
Copy link

changeset-bot bot commented Nov 21, 2025

⚠️ No Changeset found

Latest commit: b56da9a

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@vercel
Copy link

vercel bot commented Nov 21, 2025

Deployment failed with the following error:

Resource is limited - try again in 58 seconds (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/yamcodes?upgradeToPro=build-rate-limit

@github-actions github-actions bot added the www Improvements or additions to arkenv.js.org label Nov 21, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

Walkthrough

Migration from SWC-based React/Vite plugin to Babel-based alternative with styled-jsx Babel integration. Updates devDependencies in apps/www by replacing @vitejs/plugin-react-swc with @vitejs/plugin-react, removes @swc/plugin-styled-jsx, and removes @swc/core from pnpm configuration.

Changes

Cohort / File(s) Summary
React plugin and styled-jsx dependency migration
apps/www/package.json
Removed @swc/plugin-styled-jsx@10.0.0; replaced @vitejs/plugin-react-swc with @vitejs/plugin-react@5.1.1
Vite/Vitest React plugin configuration
apps/www/vitest.config.ts
Updated import from @vitejs/plugin-react-swc to @vitejs/plugin-react; modified plugin configuration to use Babel-based styled-jsx integration (babel: { plugins: ["styled-jsx/babel"] })
pnpm prebuilt dependencies configuration
package.json
Removed @swc/core from onlyBuiltDependencies list

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Cohort 1 (package.json): Straightforward dependency replacement; verify version compatibility of @vitejs/plugin-react@5.1.1
  • Cohort 2 (vitest.config.ts): Confirm Babel plugin configuration equivalence with previous SWC setup and that styled-jsx Babel plugin is compatible
  • Cohort 3 (root package.json): Verify @swc/core removal doesn't break other parts of the build chain

Possibly related PRs

Suggested labels

www, @arkenv/vite-plugin, arkenv

Poem

🐰 From SWC's swift gait to Babel's steady stride,
styled-jsx finds a new home by its side,
Configuration dances, plugins realign,
The build chain hops forward—all systems align! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Migrate away from vite-plugin-swc' accurately describes the main objective of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch switch-to-plugin-react

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 239f39f and b56da9a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • apps/www/package.json (1 hunks)
  • apps/www/vitest.config.ts (1 hunks)
  • package.json (0 hunks)
💤 Files with no reviewable changes (1)
  • package.json
🧰 Additional context used
🧬 Code graph analysis (1)
apps/www/vitest.config.ts (1)
apps/playgrounds/vite/vite.config.ts (1)
  • env (19-39)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-e2e (a11y)
  • GitHub Check: test-e2e (e2e)
🔇 Additional comments (2)
apps/www/vitest.config.ts (1)

1-11: LGTM! Migration correctly implemented.

The migration from @vitejs/plugin-react-swc to @vitejs/plugin-react with Babel-based styled-jsx configuration is correctly implemented. The styled-jsx/babel plugin is the standard approach for integrating styled-jsx with Babel-based tooling.

apps/www/package.json (1)

61-61: Compatibility verified—no action needed.

@vitejs/plugin-react v5.1.1 is compatible with React 19, including support for React Compiler integrations. The migration from SWC to the Babel-based plugin is safe for React 19.2.0.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yamcodes yamcodes merged commit 299d5ab into main Nov 21, 2025
13 of 14 checks passed
@yamcodes yamcodes deleted the switch-to-plugin-react branch November 21, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant