Skip to content
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

feat: Deprecate defaultTranslationValues #1411

Merged
merged 5 commits into from
Oct 11, 2024

Conversation

amannn
Copy link
Owner

@amannn amannn commented Oct 9, 2024

defaultTranslationValues allow to share global values to be used in messages across your app. The most common case are shared rich text elements (e.g. b: (chunks) => <b>{chunks}</b>).

However, over time this feature has shown drawbacks:

  1. We can't serialize them automatically across the RSC boundary (see Fully serializable config #611)
  2. They get in the way of type-safe arguments (see Type-safe arguments #410)

Due to this, the feature will be deprecated and the docs will suggest a better alternative for common tags in rich text that doesn't have the limitations mentioned above (updated docs). Shared values don't get a direct replacement from next-intl, but should be handled as part of your app logic (e.g. a shared module, React Context, etc.).

Note: #410 can not be implemented immediately as part of this, as long as defaultTranslationValues are still available (even if deprecated). Instead, this feature could be added as part of the next major release.

Contributes to #611

Copy link

vercel bot commented Oct 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-intl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 7:51am
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 7:51am
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 11, 2024 7:51am

…ulttranslationvalues

# Conflicts:
#	examples/example-app-router-playground/src/app/[locale]/page.tsx
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