Skip to content

fix: use React.cache for per-request namespace isolation in RSC template#96

Merged
aralroca merged 1 commit intomainfrom
fix-build-locale
Mar 22, 2026
Merged

fix: use React.cache for per-request namespace isolation in RSC template#96
aralroca merged 1 commit intomainfrom
fix-build-locale

Conversation

@aralroca
Copy link
Copy Markdown
Owner

Replace globalThis namespace merge with i18nRequestStore from next-translate. During static builds, each locale render now gets its own namespace accumulator via React.cache, preventing cross-locale pollution where namespaces from one locale leaked into another.

Replace globalThis namespace merge with i18nRequestStore from
next-translate. During static builds, each locale render now gets its
own namespace accumulator via React.cache, preventing cross-locale
pollution where namespaces from one locale leaked into another.
@aralroca aralroca merged commit 2e75fad into main Mar 22, 2026
4 checks passed
@aralroca aralroca deleted the fix-build-locale branch March 22, 2026 19:46
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8573461bef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/templateAppDir.ts
import ${INTERNAL_CONFIG_KEY} from '@next-translate-root/${configFileName}'
import AppDirI18nProvider from 'next-translate/AppDirI18nProvider'
import __loadNamespaces from 'next-translate/loadNamespaces'
import { getRequestNamespaces as __getRequestNamespaces } from 'next-translate/i18nRequestStore'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid importing an entry point missing from supported runtimes

This template now emits next-translate/i18nRequestStore, but package.json still advertises next-translate >= 2.4.1 as a supported peer. The published 2.4.1 package does not ship that subpath, so projects on the currently-allowed peer range will start failing module resolution as soon as an App Router server page is transformed by this plugin. Please either raise the minimum supported next-translate version here or add a fallback for older runtimes.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Which version should we use? 3.1.1? @codex

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

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.

1 participant