-
-
Notifications
You must be signed in to change notification settings - Fork 350
Open
Labels
Description
Context
- SWC plugins require a compatible
swc_coreruntime. Old plugins only work with specificswc_coreversions. - Latest
swc_coreis backward-compatible, but no stable Next.js release uses it yet. Only@swc/coreworks reliably with backward-compatible plugins.
Current approach
next-intluses a JS loader bridge with@swc/coreto call SWC plugins from Next.js.- Example:
next-intldepends on"@swc/core": "^1.15.2"; plugin compiled withswc_core = "47.0.3"— safe for now. - This avoids breaking changes if Next.js upgrades
swc_coreand drops support for older versions.
Why no direct Next.js integration yet
- Backward-compatible
swc_coreexists in Next.js canary builds, but no stable release yet. swcPluginsconfig is still experimental; full backward compatibility isn’t guaranteed.- Upgrading Next.js patch could require
next-intlto upgradeswc_core, dropping support for older Next.js versions. - Minor breaking changes for SWC plugins are expected currently
Conclusion
- The JS loader bridge is a temporary, safe solution.
- We’ll remove it once Next.js stabilizes backward-compatible SWC plugins and the
swcPluginsconfig.
References
- fix: SWC plugin direct integration #2182
- https://blog.swc.rs/2025-11-4-wasm-backward-compatibility
- https://plugins.swc.rs/versions/range/768
Thanks to @kdy1 for the input here!
Reactions are currently unavailable