amannn / next-intl

🌐 Internationalization (i18n) for Next.js
https://next-intl-docs.vercel.app
MIT License
2.58k stars 236 forks source link

fix: Lazy init message formatter for improved tree shaking in case `useTranslations` is only used in Server Components #1279

Closed amannn closed 2 months ago

amannn commented 2 months ago

Fixes a regression of https://github.com/amannn/next-intl/pull/1193.

In case you're only using useTranslations in Server Components, this will no longer bundle intl-messageformat on the client side (even if you're using other functionality like useFormatter there).

vercel[bot] commented 2 months ago

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 Aug 22, 2024 3:10pm
next-intl-example-app-router ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 3:10pm
next-intl-example-app-router-without-i18n-routing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 3:10pm