-
-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into canary
- Loading branch information
Showing
8 changed files
with
93 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,8 @@ Here's what's new in `[email protected]`: | |
3. [**Strictly-typed ICU arguments**](#strictly-typed-icu-arguments) | ||
4. [**GDPR compliance**](#gdpr-compliance) | ||
5. [**Modernized build output**](#modernized-build-output) | ||
6. [**Preparation for upcoming Next.js features**](#nextjs-future) | ||
6. [**Improved inheritance in `NextIntlClientProvider`**](#nextintlclientprovider-inheritance) | ||
7. [**Preparation for upcoming Next.js features**](#nextjs-future) | ||
|
||
Please also have a look at the [other breaking changes](#other-breaking-changes) listed below before you upgrade. | ||
|
||
|
@@ -188,6 +189,30 @@ The build output of `next-intl` has been modernized and now leverages the follow | |
|
||
With these changes, the bundle size of `next-intl` has been reduced by ~7% ([all details](https://github.com/amannn/next-intl/pull/1470)). | ||
|
||
## Improved inheritance of `NextIntlClientProvider` [#nextintlclientprovider-inheritance] | ||
|
||
Previously, [`NextIntlClientProvider`](/docs/usage/configuration#nextintlclientprovider) would conservatively inherit only a subset from `i18n/request.ts`. | ||
|
||
To improve the getting started experience, the provider now also inherits: | ||
|
||
- `messages` ([PR #1682](https://github.com/amannn/next-intl/pull/1682)) | ||
- `formats` ([PR #1191](https://github.com/amannn/next-intl/pull/1191)) | ||
|
||
Due to this, you can now remove these props from `NextIntlClientProvider` if you've previously passed them manually: | ||
|
||
```diff | ||
<NextIntlClientProvider | ||
- messages={messages} | ||
- formats={formats} | ||
> | ||
{/* ... */} | ||
</NextIntlClientProvider> | ||
``` | ||
|
||
With this, `NextIntlClientProvider` now inherits all of your configuration, with the minor exception of [error handling functions](/docs/usage/configuration#error-handling). Since functions are not serializable, they cannot be passed across the server/client boundary. However, [an alternative](https://github.com/amannn/next-intl/issues/1285) for this is also on the horizon. | ||
|
||
To make it easier to work with error handling functions on the client side, `NextIntlClientProvider` can now also be used in a nested fashion and will inherit the configuration from a parent provider ([PR #1413](https://github.com/amannn/next-intl/pull/1413)). | ||
|
||
## Preparation for upcoming Next.js features [#nextjs-future] | ||
|
||
To ensure that the sails of `next-intl` are set for a steady course in the upcoming future, I've investigated the implications of upcoming Next.js features like [`ppr`](https://nextjs.org/docs/app/api-reference/next-config-js/ppr), [`dynamicIO`](https://nextjs.org/docs/canary/app/api-reference/config/next-config-js/dynamicIO) and [`rootParams`](https://github.com/vercel/next.js/pull/72837) for `next-intl`. | ||
|
@@ -205,13 +230,11 @@ I'm particularly excited about the announcement of `rootParams`, as it seems lik | |
## Other breaking changes | ||
|
||
1. Return type-safe messages from `useMessages` and `getMessages` (see [PR #1489](https://github.com/amannn/next-intl/pull/1489)) | ||
2. Inherit context in case nested `NextIntlClientProvider` instances are present (see [PR #1413](https://github.com/amannn/next-intl/pull/1413)) | ||
3. Automatically inherit formats when `NextIntlClientProvider` is rendered from a Server Component (see [PR #1191](https://github.com/amannn/next-intl/pull/1191)) | ||
4. Require locale to be returned from `getRequestConfig` (see [PR #1486](https://github.com/amannn/next-intl/pull/1486)) | ||
5. Disallow passing `null`, `undefined` or `boolean` as an ICU argument (see [PR #1561](https://github.com/amannn/next-intl/pull/1561)) | ||
6. Bump minimum required TypeScript version to 5 for projects using TypeScript (see [PR #1481](https://github.com/amannn/next-intl/pull/1481)) | ||
7. Remove deprecated APIs (see [PR #1479](https://github.com/amannn/next-intl/pull/1479)) | ||
8. Remove deprecated APIs pt. 2 (see [PR #1482](https://github.com/amannn/next-intl/pull/1482)) | ||
2. Require locale to be returned from `getRequestConfig` (see [PR #1486](https://github.com/amannn/next-intl/pull/1486)) | ||
3. Disallow passing `null`, `undefined` or `boolean` as an ICU argument (see [PR #1561](https://github.com/amannn/next-intl/pull/1561)) | ||
4. Bump minimum required TypeScript version to 5 for projects using TypeScript (see [PR #1481](https://github.com/amannn/next-intl/pull/1481)) | ||
5. Remove deprecated APIs (see [PR #1479](https://github.com/amannn/next-intl/pull/1479)) | ||
6. Remove deprecated APIs pt. 2 (see [PR #1482](https://github.com/amannn/next-intl/pull/1482)) | ||
|
||
## Upgrade now | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Binary file not shown.