Skip to content

Commit

Permalink
docs: Proofread blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
amannn committed Nov 19, 2024
1 parent 5a7f7be commit bfcd251
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions docs/src/pages/blog/next-intl-4-0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,18 @@ import StayUpdated from '@/components/StayUpdated.mdx';

(this post is still a draft)

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.
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.

Here's what's new in `[email protected]`:

1. [**Modernized build output**](#modernized-build-output)
2. [**Revamped augmented types**](#revamped-augmented-types)
3. [**Strictly-typed locale**](#strictly-typed-locale)
4. [**Strictly-typed ICU arguments**](#strictly-typed-icu-arguments)
5. [**GDPR compliance**](#gdpr-compliance)
1. [**Revamped augmented types**](#revamped-augmented-types)
2. [**Strictly-typed locale**](#strictly-typed-locale)
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)

## Modernized build output

The build output of `next-intl` has been modernized and now leverages the following optimizations:

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.
2. **Modern JSX transform:** The peer dependency for React has been bumped to v17 in order to use the more efficient, modern JSX transform.
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.

With these changes, the bundle size of `next-intl` has been reduced by ~7% ([all details](https://github.com/amannn/next-intl/pull/1470)).
Please also have a look at the [other breaking changes](#other-breaking-changes) before you [upgrade](#upgrade-now).

## Revamped augmented types

Expand Down Expand Up @@ -112,7 +102,7 @@ Note that strictly-typing the `Locale` is optional and can be used as desired in

How type-safe can your app be?

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.
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.

Check it out:

Expand Down Expand Up @@ -180,7 +170,17 @@ As part of this change, disabling a cookie now requires you to set [`localeCooki

Learn more in the [locale cookie](/docs/routing#locale-cookie) docs.

## Preparation for upcoming Next.js features
## Modernized build output

The build output of `next-intl` has been modernized and now leverages the following optimizations:

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.
2. **Modern JSX transform:** The peer dependency for React has been bumped to v17 in order to use the more efficient, modern JSX transform.
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.

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

## 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 [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`.

Expand All @@ -203,7 +203,7 @@ async function Component() {
}
```

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`.
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!

## Other breaking changes

Expand All @@ -219,15 +219,15 @@ If things go well, I think this will finally fill in the [missing piece](https:/

For a smooth upgrade, please initially upgrade to the latest v3.x version and check for deprecation warnings.

Once all warnings are resolved, you can upgrade by running:
Afterwards, you can upgrade by running:

```
npm install next-intl@v4
```

## Thank you

I want to sincerely thank everyone who has helped to make `next-intl` what it is today. A special thank you goes to <PartnerContentLink href="https://crowdin.com/">Crowdin</PartnerContentLink>, the primary sponsor of `next-intl`, enabling me to regularly dedicate time for this project.
I want to sincerely thank everyone who has helped to make `next-intl` what it is today. 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.

—Jan

Expand Down

0 comments on commit bfcd251

Please sign in to comment.