Skip to content

Commit 7487e5e

Browse files
committed
docs: Update v4 beta blog post
1 parent 46d568c commit 7487e5e

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

docs/src/pages/blog/next-intl-4-0.mdx

+17-14
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Here's what's new in `next-intl@4.0`:
2222
7. [**Stricter config for `domains`**](#domains-config)
2323
8. [**Preparation for upcoming Next.js features**](#nextjs-future)
2424

25-
Please also have a look at the [other breaking changes](#other-breaking-changes) listed below before you upgrade.
25+
Please also have a look at the [other changes](#other-changes) listed below before you upgrade.
2626

2727
## Revamped augmented types
2828

@@ -119,7 +119,7 @@ t('message', {});
119119
t('message', {});
120120
// ^? {page: number, total: number}
121121

122-
// "You have {count, plural, =0 {no followers yet} =1 {one follower} other {# followers}}."
122+
// "You have {count, plural, =0 {no followers yet} one {one follower} other {# followers}}."
123123
t('message', {});
124124
// ^? {count: number}
125125

@@ -128,8 +128,8 @@ t('message', {});
128128
// ^? {country: 'US' | 'CA' | (string & {})}
129129

130130
// "Please refer to the <link>guidelines</link>."
131-
t('message', {});
132-
// ^? {link: (chunks: ReactNode) => ReactNode}
131+
t.rich('message', {});
132+
// ^? {link: (chunks: ReactNode) => ReactNode}
133133
```
134134

135135
With this type inference in place, you can now use autocompletion in your IDE to get suggestions for the available arguments of a given ICU message and catch potential errors early.
@@ -154,7 +154,7 @@ Due to a current limitation in TypeScript, this feature is opt-in for now. Pleas
154154

155155
In order to comply with the current GDPR regulations, the following changes have been made and are relevant to you if you're using the `next-intl` middleware for i18n routing:
156156

157-
1. The locale cookie has been changed to a session cookie that expires when a browser is closed.
157+
1. The locale cookie now defaults to a session cookie that expires when a browser is closed.
158158
2. The locale cookie is now only set when a user switches to a locale that doesn't match the `accept-language` header.
159159

160160
If you want to increase the cookie expiration, e.g. because you're informing users about the usage of cookies or if GDPR doesn't apply to your app, you can use the `maxAge` attribute to do so:
@@ -188,13 +188,13 @@ The build output of `next-intl` has been modernized and now leverages the follow
188188
2. **Modern JSX transform:** The peer dependency for React has been bumped to v17 in order to use the more efficient, modern JSX transform.
189189
3. **Modern syntax:** Syntax is now compiled down to the Browserslist `defaults` query, which is a shortcut for ">0.5%, last 2 versions, Firefox ESR, not dead"—a baseline that is considered a reasonable target for modern apps.
190190

191-
With these changes, the bundle size of `next-intl` has been reduced by ~7% ([all details](https://github.com/amannn/next-intl/pull/1470)).
191+
With these changes, the bundle size of `next-intl` has been reduced by ~7% ([PR #1470](https://github.com/amannn/next-intl/pull/1470)).
192192

193193
## Improved inheritance of `NextIntlClientProvider` [#nextintlclientprovider-inheritance]
194194

195195
Previously, [`NextIntlClientProvider`](/docs/usage/configuration#nextintlclientprovider) would conservatively inherit only a subset from `i18n/request.ts`.
196196

197-
To improve the getting started experience, the provider now also inherits:
197+
To improve the getting started experience, the provider by default now also inherits:
198198

199199
- `messages` ([PR #1682](https://github.com/amannn/next-intl/pull/1682))
200200
- `formats` ([PR #1191](https://github.com/amannn/next-intl/pull/1191))
@@ -210,6 +210,8 @@ Due to this, you can now remove these props from `NextIntlClientProvider` if you
210210
</NextIntlClientProvider>
211211
```
212212

213+
If you don't want to inherit these props, you can either opt-out via `messages={null}` and `formats={null}`, or by passing a specific value for these props.
214+
213215
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.
214216

215217
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)).
@@ -280,15 +282,16 @@ While the mentioned Next.js features are still under development and may change,
280282

281283
I'm particularly excited about the announcement of `rootParams`, as it seems like this will finally fill in the [missing piece](https://github.com/vercel/next.js/discussions/58862) that enables apps with i18n routing to support static rendering without workarounds like `setRequestLocale`. I hope to have more to share on this soon!
282284

283-
## Other breaking changes
285+
## Other changes
284286

285287
1. Return type-safe messages from `useMessages` and `getMessages` (see [PR #1489](https://github.com/amannn/next-intl/pull/1489))
286288
2. Require locale to be returned from `getRequestConfig` (see [PR #1486](https://github.com/amannn/next-intl/pull/1486))
287-
3. Disallow passing `null`, `undefined` or `boolean` as an ICU argument (see [PR #1561](https://github.com/amannn/next-intl/pull/1561))
288-
4. Bump minimum required TypeScript version to 5 for projects using TypeScript (see [PR #1481](https://github.com/amannn/next-intl/pull/1481))
289-
5. Return `x-default` alternate link also for sub pages when using `localePrefix: 'always'` and update middleware matcher suggestion in docs (see [PR #1720](https://github.com/amannn/next-intl/pull/1720))
290-
6. Remove deprecated APIs (see [PR #1479](https://github.com/amannn/next-intl/pull/1479))
291-
7. Remove deprecated APIs pt. 2 (see [PR #1482](https://github.com/amannn/next-intl/pull/1482))
289+
3. Allow to declare `pathnames` partially for convenience (see [PR #1743](https://github.com/amannn/next-intl/pull/1743))
290+
4. Disallow passing `null`, `undefined` or `boolean` as an ICU argument (see [PR #1561](https://github.com/amannn/next-intl/pull/1561))
291+
5. Bump minimum required TypeScript version to 5 for projects using TypeScript (see [PR #1481](https://github.com/amannn/next-intl/pull/1481))
292+
6. Return `x-default` alternate link also for sub pages when using `localePrefix: 'always'` and update middleware matcher suggestion to `/((?!api|_next|_vercel|.*\\..*).*)` (see [PR #1720](https://github.com/amannn/next-intl/pull/1720))
293+
7. Remove deprecated APIs (see [PR #1479](https://github.com/amannn/next-intl/pull/1479))
294+
8. Remove deprecated APIs pt. 2 (see [PR #1482](https://github.com/amannn/next-intl/pull/1482))
292295

293296
## Upgrade now
294297

@@ -308,7 +311,7 @@ I'd love to hear about your experiences with `next-intl@4.0`! Join the conversat
308311

309312
I want to sincerely thank everyone who has helped to make `next-intl` what it is today.
310313

311-
A special thank you goes to <PartnerContentLink href="https://crowdin.com/">Crowdin</PartnerContentLink>, the primary sponsor of `next-intl`, enabling me to regularly work on this project and provide it as a free and open-source library for everyone.
314+
A special thank you goes to <PartnerContentLink href="https://crowdin.com/">Crowdin</PartnerContentLink>, the sponsor partner of `next-intl`, enabling me to regularly work on this project and provide it as a free and open-source library for everyone.
312315

313316
—Jan
314317

0 commit comments

Comments
 (0)