mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #366] [MERGED] feat(next-intl): auto-detect config without createNextIntlPlugin #514
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#514
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/366
Author: @NathanDrake2406
Created: 3/9/2026
Status: ✅ Merged
Merged: 3/9/2026
Merged by: @james-elicx
Base:
main← Head:feat/next-intl-auto-detect📝 Commits (3)
e2c687cfix: resolve NEXT_DATA type conflict with next package types52bae0ffeat(next-intl): auto-detect next-intl config without createNextIntlPluginb9292a0fix: address review feedback📊 Changes
10 files changed (+356 additions, -57 deletions)
View changed files
📝
packages/vinext/src/check.ts(+1 -1)📝
packages/vinext/src/client/entry.ts(+2 -1)➕
packages/vinext/src/client/vinext-next-data.ts(+22 -0)📝
packages/vinext/src/config/next-config.ts(+102 -8)📝
packages/vinext/src/global.d.ts(+6 -36)📝
packages/vinext/src/shims/link.tsx(+2 -1)📝
pnpm-lock.yaml(+0 -3)📝
tests/fixtures/ecosystem/next-intl/next.config.mjs(+2 -5)📝
tests/fixtures/ecosystem/next-intl/package.json(+0 -1)📝
tests/next-config.test.ts(+219 -1)📄 Description
Summary
next-intlin project dependencies and register thenext-intl/configalias automatically — nocreateNextIntlPlugin()wrapper neededi18n/request.{ts,tsx,js,jsx}thensrc/i18n/request.{ts,tsx,js,jsx}, matching next-intl's own discovery ordernext-intl/plugin, telling users the wrapper is unnecessaryNEXT_DATAtype conflict:next/dist/client/index.d.tsdeclaresWindow.__NEXT_DATA__: NEXT_DATAwhich conflicted with our inline type inglobal.d.tsCloses #202
How it works
detectNextIntlConfig(root, resolved)runs at the end ofresolveNextConfig()— even when raw config isnull(nonext.configfile at all). It:next-intl/configalias already exists (explicit wins)createRequire(root).resolve('next-intl')to check installationi18n/request.{ts,tsx,js,jsx}andsrc/i18n/request.{ts,tsx,js,jsx}resolved.aliases["next-intl/config"]to the absolute pathtrailingSlashis true, injects_next_intl_trailing_slashenv varTest plan
pnpm run typecheck— passes (0 errors)pnpm run lint— passes (0 errors, 0 warnings)pnpm test tests/next-config.test.ts— 38 tests pass (10 new for detection logic)pnpm test tests/ecosystem.test.ts— next-intl fixture renders/enand/deSSR correctly WITHOUTnextinstalled and WITHOUTcreateNextIntlPluginpnpm test tests/shims.test.ts— 576 tests pass (no regressions)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.