-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: next-intl@4
#1412
base: main
Are you sure you want to change the base?
feat!: next-intl@4
#1412
Commits on Jun 20, 2024
-
Configuration menu - View commit details
-
Copy full SHA for a8fb0e3 - Browse repository at this point
Copy the full SHA a8fb0e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf3f8b0 - Browse repository at this point
Copy the full SHA cf3f8b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fd9b20 - Browse repository at this point
Copy the full SHA 4fd9b20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 47239f9 - Browse repository at this point
Copy the full SHA 47239f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d60a72 - Browse repository at this point
Copy the full SHA 0d60a72View commit details -
Configuration menu - View commit details
-
Copy full SHA for c459669 - Browse repository at this point
Copy the full SHA c459669View commit details
Commits on Jun 26, 2024
-
fix: Prefer more specific routes in
usePathname
when detecting the ……currently active pathname for localized pathnames
Configuration menu - View commit details
-
Copy full SHA for 8d3ab38 - Browse repository at this point
Copy the full SHA 8d3ab38View commit details -
Configuration menu - View commit details
-
Copy full SHA for 605c9a6 - Browse repository at this point
Copy the full SHA 605c9a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for cb15046 - Browse repository at this point
Copy the full SHA cb15046View commit details
Commits on Jul 11, 2024
-
Merge remote-tracking branch 'origin/main' into canary
# Conflicts: # packages/next-intl/src/middleware/utils.test.tsx # packages/next-intl/src/shared/utils.test.tsx
Configuration menu - View commit details
-
Copy full SHA for 11262b8 - Browse repository at this point
Copy the full SHA 11262b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7976376 - Browse repository at this point
Copy the full SHA 7976376View commit details -
Configuration menu - View commit details
-
Copy full SHA for b352c10 - Browse repository at this point
Copy the full SHA b352c10View commit details -
Configuration menu - View commit details
-
Copy full SHA for cba448a - Browse repository at this point
Copy the full SHA cba448aView commit details
Commits on Jul 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0c670b2 - Browse repository at this point
Copy the full SHA 0c670b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5dc7f53 - Browse repository at this point
Copy the full SHA 5dc7f53View commit details -
Configuration menu - View commit details
-
Copy full SHA for 11dcbcc - Browse repository at this point
Copy the full SHA 11dcbccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b074da - Browse repository at this point
Copy the full SHA 1b074daView commit details
Commits on Jul 15, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e98682b - Browse repository at this point
Copy the full SHA e98682bView commit details
Commits on Aug 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7c6f533 - Browse repository at this point
Copy the full SHA 7c6f533View commit details
Commits on Aug 26, 2024
-
feat!: Automatically inherit
formats
whenNextIntlClientProvider
……is rendered from a Server Component (#1191) This should ease the transition from Server to Client Components, as you don't have to manually pass this prop anymore. If you've previously passed this prop manually, you can remove this assignment now. If this is not desired (e.g. because you have a large `formats` object that you don't want to pass to the client side), you can manually opt-out via `formats={{}}` on `NextIntlClientProvider` in order to not provide any formats on the client side. **BREAKING CHANGE:** There's a very rare chance where this can break existing behavior. If you're rendering `NextIntlClientProvider` in a Server Component, you rely on static rendering, but you're not using `unstable_setRequestLocale` (i.e. you're using hooks like `useTranslations` exclusively in Client Components), this can opt your page into dynamic rendering. If this affects you, please provide the `formats` prop explicitly to `NextIntlClientProvider`.
Configuration menu - View commit details
-
Copy full SHA for 8b4c7c4 - Browse repository at this point
Copy the full SHA 8b4c7c4View commit details
Commits on Oct 9, 2024
-
feat!: Inherit context between providers (#1413)
If you have nested providers, previously only the configuration of the innermost one would be applied. With this change, configuration is now passed from one provider to the next, while allowing to override individual props. **BREAKING CHANGE:** There's a very rare chance that this change affects your app, but in case you've previously relied on providers not inheriting from each other, you now have to reset props manually in case you want to retain the prev. behavior.
Configuration menu - View commit details
-
Copy full SHA for d80d691 - Browse repository at this point
Copy the full SHA d80d691View commit details -
Merge remote-tracking branch 'origin/canary' into HEAD
# Conflicts: # packages/next-intl/.size-limit.ts
Configuration menu - View commit details
-
Copy full SHA for 8158de4 - Browse repository at this point
Copy the full SHA 8158de4View commit details
Commits on Oct 24, 2024
-
Merge remote-tracking branch 'origin/canary' into v4
# Conflicts: # docs/src/pages/docs/usage/configuration.mdx # packages/next-intl/.size-limit.ts # packages/use-intl/.size-limit.ts
Configuration menu - View commit details
-
Copy full SHA for 7dd54c1 - Browse repository at this point
Copy the full SHA 7dd54c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for ccaef97 - Browse repository at this point
Copy the full SHA ccaef97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 25a0dc8 - Browse repository at this point
Copy the full SHA 25a0dc8View commit details
Commits on Oct 29, 2024
-
feat!: Make package ESM-only, target modern browsers, use modern JSX …
…transform (#1470) **Changes** 1. `next-intl` as well as its base library `use-intl` are now ESM-only. With this, the library is now ~7% smaller and provides full support for tree shaking. Most tools support ESM out-of-the-box, but some might require additional configuration (e.g. Jest might benefit from [`next/jest`](https://nextjs.org/docs/app/building-your-application/testing/jest#manual-setup)). The only exception is `next-intl/plugin` which is provided both as ESM as well as CommonJS due to `next.config.js` still being popular. 2. Syntax is compiled down to the Browserslist [`defaults`](https://github.com/browserslist/browserslist/blob/065c69b0e1e6ad679263d03e22c605830bbc52e5/index.js#L460) query, which is a shortcut for `> 0.5%, last 2 versions, Firefox ESR, not dead`. The `defaults` query was thoroughly designed by the Browserslist community and is considered a reasonable default for modern apps. If you target outdated browsers, you can use [`transpilePackages`](https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages) in combination with a [`browserslist`](https://nextjs.org/docs/architecture/supported-browsers) config in Next.js to compile `next-intl` for older browsers. 3. The minimum React version is 17 now (which supports the modern JSX transform)
Configuration menu - View commit details
-
Copy full SHA for 9f4754c - Browse repository at this point
Copy the full SHA 9f4754cView commit details -
feat!: Remove deprecated APIs (#1479)
**Changes** - Removed deprecated `defaultTranslationValues` - Remove deprecated detection of `src/i18n.ts` (use `src/i18n/request.ts` instead, or specify a custom path in your Next.js config) - Removed deprecated export of `Pathnames` from `next-intl/navigation` (still available via `next-intl/routing`) - Remove deprecated legacy navigation APIs `createSharedPathnamesNavigation` and `createLocalizedPathnamesNavigation`
Configuration menu - View commit details
-
Copy full SHA for 5b5f0e3 - Browse repository at this point
Copy the full SHA 5b5f0e3View commit details -
feat!: Bump minimum required
typescript
version to 5 for projects u……sing TypeScript (#1481) If you don't use TypeScript, this change doesn't affect you.
Configuration menu - View commit details
-
Copy full SHA for eb5bf09 - Browse repository at this point
Copy the full SHA eb5bf09View commit details -
feat!: Remove deprecated APIs pt. 2 (#1482)
**Changes** - Removed deprecated second argument of `createMiddleware` (use first argument instead, ideally via `defineRouting`) - Remove deprecated `({locale})` argument in `getRequestConfig` (use `({requestLocale})` instead) - Remove deprecated `unstable_setRequestLocale` (use `setRequestLocale` instead)
Configuration menu - View commit details
-
Copy full SHA for a6238f4 - Browse repository at this point
Copy the full SHA a6238f4View commit details -
feat!: Infer default
locale
forNextIntlClientProvider
from `useP……arams` when rendered on the client side (#1483) Bumps the Next.js peer dependency to 13.3.
Configuration menu - View commit details
-
Copy full SHA for 829998e - Browse repository at this point
Copy the full SHA 829998eView commit details -
Configuration menu - View commit details
-
Copy full SHA for a9c35db - Browse repository at this point
Copy the full SHA a9c35dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5402851 - Browse repository at this point
Copy the full SHA 5402851View commit details
Commits on Oct 30, 2024
-
feat!: Decrease cookie expiration to 5 hours, only set cookie when ne…
…cessary and only disable cookie if `localeCookie: false` is set (#1487) **Changes** 1. The `maxAge` attribute of the locale cookie is decreased from 1 year to 5 hours in order to be GDPR-compliant. 2. The locale cookie is now only set when the user's language doesn't match a requested locale. E.g. a user with `accept-language: 'en'` will cause a cookie to be set when `/de` is requested to remember the preference for `de`. 3. `localeDetection: false` previously ambiguously also disabled the cookie from being set. This is no longer the case. For consistency, you can now use the explicit [`localeCookie: false`](https://next-intl-docs.vercel.app/docs/routing#locale-cookie) option instead. If you want to increase the cookie expiration, you can use the [`maxAge`](https://next-intl-docs.vercel.app/docs/routing#locale-cookie) attribute to do so: ```tsx import {defineRouting} from 'next-intl/routing'; export const routing = defineRouting({ // ... localeCookie: { // Expire in one year maxAge: 60 * 60 * 24 * 365 } }); ```
Configuration menu - View commit details
-
Copy full SHA for b4e4d1d - Browse repository at this point
Copy the full SHA b4e4d1dView commit details -
feat: Return type-safe
IntlMessages
fromuseMessages
& `getMessag…Configuration menu - View commit details
-
Copy full SHA for d83abc2 - Browse repository at this point
Copy the full SHA d83abc2View commit details
Commits on Nov 1, 2024
-
feat!: Revamp augmented types and add support for typed
Locale
(#1495)**Changes** - Revamps the API to augment types by getting rid of the global `IntlMessages` and `IntlFormats` in favor of a more general `AppConfig` that is scoped to `next-intl`. - Adds support for strictly-typing the locale across `useLocale` as well as the navigation APIs. - Adds `import {Locale} from 'next-intl';` as a convenience API to be reused wherever a `locale` is passed around. - Add `hasLocale(locales, candidate)` API for simplified checking of whether a locale is available with TypeScript. - Adds a new `import {Messages} from 'next-intl;` type that corresponds to the `Messages` you've provided in `AppConfig` (probably rarely needed). **Example:** ```tsx // global.d.ts import {routing} from '@/i18n/routing'; import {formats} from '@/i18n/request'; import en from './messages/en.json'; declare module 'next-intl' { interface AppConfig { Locale: (typeof routing.locales)[number]; Formats: typeof formats; Messages: typeof en; } } ``` **→ [Proposed docs](https://next-intl-docs-git-feat-augmented-config-next-intl.vercel.app/docs/workflows/typescript)** Fixes #1377
Configuration menu - View commit details
-
Copy full SHA for a7aaf56 - Browse repository at this point
Copy the full SHA a7aaf56View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2388c9b - Browse repository at this point
Copy the full SHA 2388c9bView commit details
Commits on Nov 7, 2024
-
feat: Type-safe ICU arguments (#1499)
```json { "UserProfile": { "title": "Hello {firstName}" } } ``` ```tsx function UserProfile({user}) { const t = useTranslations('UserProfile'); // ✖️ Missing argument t('title'); // ✅ Argument is provided t('title', {firstName: user.firstName}); } ``` **Changes** - ICU arguments can now be validated with TypeScript (however, currently this is [opt-in](https://next-intl-docs-git-feat-type-safe-params-next-intl.vercel.app/docs/workflows/typescript#messages-arguments)) - `undefined` and `null` are no longer accepted as values for calls to `t`—please only provide valid values. Fixes #410
Configuration menu - View commit details
-
Copy full SHA for 01268f6 - Browse repository at this point
Copy the full SHA 01268f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0bb75c5 - Browse repository at this point
Copy the full SHA 0bb75c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd28ac1 - Browse repository at this point
Copy the full SHA dd28ac1View commit details
Commits on Nov 8, 2024
-
Merge remote-tracking branch 'origin/main' into v4
# Conflicts: # packages/next-intl/package.json # packages/next-intl/src/navigation/react-client/index.tsx # packages/next-intl/src/routing/index.tsx # packages/next-intl/src/server/react-server/index.tsx # packages/use-intl/package.json # packages/use-intl/src/core/index.tsx # pnpm-lock.yaml # pnpm-workspace.yaml
Configuration menu - View commit details
-
Copy full SHA for 4675f7e - Browse repository at this point
Copy the full SHA 4675f7eView commit details -
Configuration menu - View commit details
-
Copy full SHA for c154409 - Browse repository at this point
Copy the full SHA c154409View commit details -
Configuration menu - View commit details
-
Copy full SHA for 887034d - Browse repository at this point
Copy the full SHA 887034dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ab22a92 - Browse repository at this point
Copy the full SHA ab22a92View commit details -
Configuration menu - View commit details
-
Copy full SHA for b9c515e - Browse repository at this point
Copy the full SHA b9c515eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ac7206 - Browse repository at this point
Copy the full SHA 8ac7206View commit details
Commits on Nov 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 21f2dac - Browse repository at this point
Copy the full SHA 21f2dacView commit details