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!: next-intl@4 #1412

Draft
wants to merge 88 commits into
base: main
Choose a base branch
from
Draft

feat!: next-intl@4 #1412

wants to merge 88 commits into from

Conversation

amannn
Copy link
Owner

@amannn amannn commented Oct 9, 2024

Changes

TODO

Related

Resolves #1153
Resolves #1452
Resolves #410
Resolves #779
Resolves #1464

amannn and others added 20 commits June 20, 2024 16:08
This reverts commit 47239f9.
…currently active pathname for localized pathnames
# Conflicts:
#	packages/next-intl/src/middleware/utils.test.tsx
#	packages/next-intl/src/shared/utils.test.tsx
…is rendered from a Server Component (#1191)

This should ease the transition from Server to Client Components, as you
don't have to manually pass this prop anymore. If you've previously
passed this prop manually, you can remove this assignment now.

If this is not desired (e.g. because you have a large `formats` object
that you don't want to pass to the client side), you can manually
opt-out via `formats={{}}` on `NextIntlClientProvider` in order to not
provide any formats on the client side.

**BREAKING CHANGE:** There's a very rare chance where this can break
existing behavior. If you're rendering `NextIntlClientProvider` in a
Server Component, you rely on static rendering, but you're not using
`unstable_setRequestLocale` (i.e. you're using hooks like
`useTranslations` exclusively in Client Components), this can opt your
page into dynamic rendering. If this affects you, please provide the
`formats` prop explicitly to `NextIntlClientProvider`.
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 Jan 17, 2025 0:28am
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 17, 2025 0:28am
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 17, 2025 0:28am

@amannn amannn changed the title next-intl@4 feat!: next-intl@4 Oct 9, 2024
@amannn amannn added v4 and removed v4 labels Oct 9, 2024
If you have nested providers, previously only the configuration of the
innermost one would be applied.

With this change, configuration is now passed from one provider to the
next, while allowing to override individual props.

**BREAKING CHANGE:** There's a very rare chance that this change affects
your app, but in case you've previously relied on providers not
inheriting from each other, you now have to reset props manually in case
you want to retain the prev. behavior.
# Conflicts:
#	packages/next-intl/.size-limit.ts
Initially, I planned to add an expiration of 5 hours to the locale
cookie for `next-intl@4` to comply with GDPR regulations. However, this
has the implication that if the browser remains open for longer than 5
hours, the cookie can be reset in the middle of a session.

Due to this, it seems more reasonable to not set an expiration at all,
turning the cookie into a session cookie. Session cookies expiry only
when a browser is closed. On mobile, this can be even more beneficial,
as browsers are rarely closed (the browser can clear cookies though if
memory is constrained).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment