You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/src/pages/blog/next-intl-4-0.mdx
+22-22
Original file line number
Diff line number
Diff line change
@@ -11,28 +11,18 @@ import StayUpdated from '@/components/StayUpdated.mdx';
11
11
12
12
(this post is still a draft)
13
13
14
-
After a year of feature development, this release mostly aims to clean up the API surface to ensure `next-intl` remains lean—there should be no big surprises. Many significant improvements have already been shipped in [minor versions](/blog/next-intl-3-22) previously.
15
-
16
-
However, this release also comes with a series of improvements that you might find useful.
14
+
After a year of feature development, this release mostly aims to clean up the API surface to ensure `next-intl` remains lean—there should be no big surprises. Many significant improvements have already been shipped in [minor versions](/blog/next-intl-3-22) previously. However, this release also comes with a series of improvements that you might find useful.
6.[**Preparation for upcoming Next.js features**](#nextjs-future)
26
24
27
-
## Modernized build output
28
-
29
-
The build output of `next-intl` has been modernized and now leverages the following optimizations:
30
-
31
-
1.**ESM-only:** To enable enhanced tree-shaking and align with the modern JavaScript ecosystem, `next-intl` is now ESM-only. The only exception is `next-intl/plugin` which is published both as CommonJS as well as ESM, due to `next.config.js` still being popular.
32
-
2.**Modern JSX transform:** The peer dependency for React has been bumped to v17 in order to use the more efficient, modern JSX transform.
33
-
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.
34
-
35
-
With these changes, the bundle size of `next-intl` has been reduced by ~7% ([all details](https://github.com/amannn/next-intl/pull/1470)).
25
+
Please also have a look at the [other breaking changes](#other-breaking-changes) before you [upgrade](#upgrade-now).
36
26
37
27
## Revamped augmented types
38
28
@@ -112,7 +102,7 @@ Note that strictly-typing the `Locale` is optional and can be used as desired in
112
102
113
103
How type-safe can your app be?
114
104
115
-
The quest to bring type safety to the last corner of `next-intl` has led me down a rabbit hole with the discovery of an ICU parser by [Marco Schumacher](https://github.com/schummar)—written entirely in types. Marco kindly published his implementation for usage in `next-intl` with me only adding support for rich tags on top.
105
+
The quest to bring type safety to the last corner of `next-intl` has led me down a rabbit hole with the discovery of an ICU parser by [Marco Schumacher](https://github.com/schummar)—written entirely in types. Marco kindly published his implementation for usage in `next-intl`, with me only adding support for rich tags on top.
116
106
117
107
Check it out:
118
108
@@ -180,7 +170,17 @@ As part of this change, disabling a cookie now requires you to set [`localeCooki
180
170
181
171
Learn more in the [locale cookie](/docs/routing#locale-cookie) docs.
182
172
183
-
## Preparation for upcoming Next.js features
173
+
## Modernized build output
174
+
175
+
The build output of `next-intl` has been modernized and now leverages the following optimizations:
176
+
177
+
1.**ESM-only:** To enable enhanced tree-shaking and align with the modern JavaScript ecosystem, `next-intl` is now ESM-only. The only exception is `next-intl/plugin` which is published both as CommonJS as well as ESM, due to `next.config.js` still being popular.
178
+
2.**Modern JSX transform:** The peer dependency for React has been bumped to v17 in order to use the more efficient, modern JSX transform.
179
+
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.
180
+
181
+
With these changes, the bundle size of `next-intl` has been reduced by ~7% ([all details](https://github.com/amannn/next-intl/pull/1470)).
182
+
183
+
## Preparation for upcoming Next.js features [#nextjs-future]
184
184
185
185
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 [Partial Prerendering](https://nextjs.org/docs/app/api-reference/next-config-js/ppr) and [`dynamicIO`](https://nextjs.org/docs/canary/app/api-reference/config/next-config-js/dynamicIO) for `next-intl`.
186
186
@@ -203,7 +203,7 @@ async function Component() {
203
203
}
204
204
```
205
205
206
-
If things go well, I think 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`.
206
+
If things go well, I think 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!
207
207
208
208
## Other breaking changes
209
209
@@ -219,15 +219,15 @@ If things go well, I think this will finally fill in the [missing piece](https:/
219
219
220
220
For a smooth upgrade, please initially upgrade to the latest v3.x version and check for deprecation warnings.
221
221
222
-
Once all warnings are resolved, you can upgrade by running:
222
+
Afterwards, you can upgrade by running:
223
223
224
224
```
225
225
npm install next-intl@v4
226
226
```
227
227
228
228
## Thank you
229
229
230
-
I want to sincerely thank everyone who has helped to make `next-intl` what it is today. A special thank you goes to <PartnerContentLinkhref="https://crowdin.com/">Crowdin</PartnerContentLink>, the primary sponsor of `next-intl`, enabling me to regularly dedicate time for this project.
230
+
I want to sincerely thank everyone who has helped to make `next-intl` what it is today. A special thank you goes to <PartnerContentLinkhref="https://crowdin.com/">Crowdin</PartnerContentLink>, the primary sponsor of `next-intl`, enabling me to regularly work on this project.
0 commit comments