-
Notifications
You must be signed in to change notification settings - Fork 16
fix: bump swc_core version and fix compat with swc_common #925
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11 files reviewed, 1 comment
pie575
approved these changes
Dec 29, 2025
Contributor
pie575
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swag 👍
Merged
ErnestM1234
pushed a commit
that referenced
this pull request
Dec 29, 2025
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Patch Changes - [#925](#925) [`6df7670`](6df7670) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - fix: deprecate swc plugin for nextjs versions earlier than 16.1 ## @generaltranslation/[email protected] ### Patch Changes - Updated dependencies \[[`6df7670`](6df7670)]: - [email protected] <!-- greptile_comment --> <h3>Greptile Summary</h3> Standard automated release PR generated by Changesets action to publish version 6.12.4 of `gt-next` and version 10.0.4 of `@generaltranslation/gt-next-lint`. **Changes:** - Deleted changeset file `.changeset/easy-eels-walk.md` (consumed by the release process) - Bumped `gt-next` from 6.12.3 to 6.12.4 with changelog entry referencing PR #925 - Bumped `@generaltranslation/gt-next-lint` from 10.0.3 to 10.0.4 as a dependent package **Context from PR #925:** The underlying fix adds Next.js 16.1+ compatibility by upgrading to `swc_core` 49.0.0 and deprecating SWC plugin support for Next.js versions < 16.1.0. The issue identified in PR #925's review (missing `SWC_PLUGIN_SUPPORT` import causing template literal interpolation failure) has been resolved - the constant is now properly imported and used in `packages/next/src/errors/createErrors.ts:185`. <details open><summary><h3>Confidence Score: 5/5</h3></summary> - This release PR is safe to merge with no issues found - This is a standard automated release PR following the Changesets workflow. All version bumps are correct (patch versions), changelogs are properly formatted, and the consumed changeset file is correctly deleted. The underlying fix from PR #925 has been verified to be complete with no remaining issues. - No files require special attention </details> <details><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | .changeset/easy-eels-walk.md | Changeset file deleted (standard behavior for release PRs) | | packages/next/CHANGELOG.md | Added version 6.12.4 changelog entry with reference to PR #925 | | packages/next/package.json | Version bumped from 6.12.3 to 6.12.4 | | packages/next-lint/CHANGELOG.md | Added version 10.0.4 changelog entry with dependency update reference | | packages/next-lint/package.json | Version bumped from 10.0.3 to 10.0.4 | </details> </details> <details><summary><h3>Sequence Diagram</h3></summary> ```mermaid sequenceDiagram participant Dev as Developer participant Actions as GitHub Actions participant Changesets as Changesets Action participant NPM as NPM Registry Dev->>Actions: Merge PR #925 to main Actions->>Changesets: Trigger release workflow Changesets->>Changesets: Read .changeset/easy-eels-walk.md Changesets->>Changesets: Calculate version bumps Note over Changesets: gt-next: 6.12.3 → 6.12.4<br/>gt-next-lint: 10.0.3 → 10.0.4 Changesets->>Changesets: Update package.json versions Changesets->>Changesets: Update CHANGELOG.md files Changesets->>Changesets: Delete consumed changeset Changesets->>Dev: Create PR #926 for review alt When PR #926 is merged Dev->>Actions: Merge release PR Actions->>Changesets: Publish packages Changesets->>NPM: Publish [email protected] Changesets->>NPM: Publish @generaltranslation/[email protected] NPM->>Dev: Packages available end ``` </details> <!-- greptile_other_comments_section --> <!-- /greptile_comment --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
What
Greptile Summary
This PR upgrades the SWC plugin to support Next.js 16.1+ by migrating to
swc_coreversion 49.0.0 and deprecating support for older Next.js versions.Key changes:
swc_corefrom older version to 49.0.0 with forced exactswc_commonversion 18.0.0SWC_PLUGIN_SUPPORTconstant from 15.2.0 to 16.1.0, effectively deprecating the plugin for Next.js < 16.1JSXAttrValue::Strinstead ofJSXAttrValue::Lit(Lit::Str(...))to_string()toto_string_lossy().into_owned()for proper handling of non-UTF8 sequences.into()conversions forAtomvaluesIssue found:
swcPluginCompatibilityChangeWarning- the constant reference${SWC_PLUGIN_SUPPORT}is not being replaced with the actual version valueConfidence Score: 4/5
createErrors.tswhere the warning message contains${SWC_PLUGIN_SUPPORT}that won't be interpolated at runtime, showing the literal string instead of version "16.1.0". This needs to be fixed before merge.Important Files Changed
swc_coreto 49.0.0 with forced exactswc_commonversion 18.0.0 for Next.js 16.1+ compatibilitySWC_PLUGIN_SUPPORTfrom 15.2.0 to 16.1.0, deprecating plugin for older Next.js versionsswcPluginCompatibilityChangeWarningbut missingSWC_PLUGIN_SUPPORTimportto_string_lossy().into_owned()and changed JSX attribute API fromJSXAttrValue::LittoJSXAttrValue::StrJSXAttrValue::Strinstead ofJSXAttrValue::Lit)Sequence Diagram
sequenceDiagram participant User as Developer participant NextConfig as withGT Config participant Validator as validateCompiler participant SWCPlugin as SWC Plugin (Rust) participant NextJS as Next.js 16.1+ User->>NextConfig: Initialize gt-next NextConfig->>Validator: Check compiler compatibility alt Next.js < 16.1.0 Validator->>Validator: swcPluginCompatible = false Validator->>User: Warn: SWC plugin disabled for Next.js < 16.1 Validator->>NextConfig: Set compiler type = 'none' else Next.js >= 16.1.0 Validator->>Validator: swcPluginCompatible = true Validator->>NextConfig: Keep compiler type = 'swc' NextConfig->>SWCPlugin: Load plugin with swc_core 49.0.0 SWCPlugin->>NextJS: Transform JSX/code using new API Note over SWCPlugin,NextJS: Uses JSXAttrValue::Str<br/>instead of JSXAttrValue::Lit<br/>to_string_lossy() for strings NextJS->>User: Build succeeds end