next-intl 3.17.4 → 3.17.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,12 +50,13 @@ async function receiveRuntimeConfigImpl(getConfig, localeOverride) {
50
50
  };
51
51
  }
52
52
  const receiveRuntimeConfig = React.cache(receiveRuntimeConfigImpl);
53
- const getFormatters = React.cache(core._createFormatters);
53
+ const getFormatters = React.cache(core._createIntlFormatters);
54
+ const getCache = React.cache(core._createCache);
54
55
  async function getConfigImpl(localeOverride) {
55
56
  const runtimeConfig = await receiveRuntimeConfig(getRuntimeConfig__default.default, localeOverride);
56
57
  return {
57
58
  ...core.initializeConfig(runtimeConfig),
58
- _formatters: getFormatters()
59
+ _formatters: getFormatters(getCache())
59
60
  };
60
61
  }
61
62
  const getConfig = React.cache(getConfigImpl);
@@ -1 +1 @@
1
- import{cache as t}from"react";import{_createFormatters as e,initializeConfig as o}from"use-intl/core";import{getRequestLocale as n}from"./RequestLocale.js";import r from"next-intl/config";const a=t((function(){return new Date}));const s=t((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const i=t((async function(t,e){let o=!1;const r={get locale(){return o=!0,e||n()}};let i=t(r);return i instanceof Promise&&(i=await i),i.locale&&o&&console.error("\nYou've read the `locale` param that was passed to `getRequestConfig` but have also returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"),{...i,locale:i.locale||r.locale,now:i.now||a(),timeZone:i.timeZone||s()}})),c=t(e);const l=t((async function(t){const e=await i(r,t);return{...o(e),_formatters:c()}}));export{l as default};
1
+ import{cache as t}from"react";import{_createIntlFormatters as e,_createCache as o,initializeConfig as n}from"use-intl/core";import{getRequestLocale as r}from"./RequestLocale.js";import a from"next-intl/config";const s=t((function(){return new Date}));const i=t((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const c=t((async function(t,e){let o=!1;const n={get locale(){return o=!0,e||r()}};let a=t(n);return a instanceof Promise&&(a=await a),a.locale&&o&&console.error("\nYou've read the `locale` param that was passed to `getRequestConfig` but have also returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"),{...a,locale:a.locale||n.locale,now:a.now||s(),timeZone:a.timeZone||i()}})),l=t(e),u=t(o);const m=t((async function(t){const e=await c(a,t);return{...n(e),_formatters:l(u())}}));export{m as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("use-intl/core"),n=require("./RequestLocale.js");function o(e){return e&&e.__esModule?e:{default:e}}var r=o(require("next-intl/config"));const a=e.cache((function(){return new Date}));const c=e.cache((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const s=e.cache((async function(e,t){let o=!1;const r={get locale(){return o=!0,t||n.getRequestLocale()}};let s=e(r);return s instanceof Promise&&(s=await s),s.locale&&o&&console.error("\nYou've read the `locale` param that was passed to `getRequestConfig` but have also returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"),{...s,locale:s.locale||r.locale,now:s.now||a(),timeZone:s.timeZone||c()}})),i=e.cache(t._createFormatters);const u=e.cache((async function(e){const n=await s(r.default,e);return{...t.initializeConfig(n),_formatters:i()}}));exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("use-intl/core"),n=require("./RequestLocale.js");function o(e){return e&&e.__esModule?e:{default:e}}var r=o(require("next-intl/config"));const a=e.cache((function(){return new Date}));const c=e.cache((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const s=e.cache((async function(e,t){let o=!1;const r={get locale(){return o=!0,t||n.getRequestLocale()}};let s=e(r);return s instanceof Promise&&(s=await s),s.locale&&o&&console.error("\nYou've read the `locale` param that was passed to `getRequestConfig` but have also returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"),{...s,locale:s.locale||r.locale,now:s.now||a(),timeZone:s.timeZone||c()}})),i=e.cache(t._createIntlFormatters),u=e.cache(t._createCache);const l=e.cache((async function(e){const n=await s(r.default,e);return{...t.initializeConfig(n),_formatters:i(u())}}));exports.default=l;
@@ -1,10 +1,10 @@
1
- import { IntlConfig, _createFormatters } from 'use-intl/core';
1
+ import { IntlConfig, _createIntlFormatters } from 'use-intl/core';
2
2
  declare function getConfigImpl(localeOverride?: string): Promise<IntlConfig & {
3
3
  getMessageFallback: NonNullable<IntlConfig['getMessageFallback']>;
4
4
  now: NonNullable<IntlConfig['now']>;
5
5
  onError: NonNullable<IntlConfig['onError']>;
6
6
  timeZone: NonNullable<IntlConfig['timeZone']>;
7
- _formatters: ReturnType<typeof _createFormatters>;
7
+ _formatters: ReturnType<typeof _createIntlFormatters>;
8
8
  }>;
9
9
  declare const getConfig: typeof getConfigImpl;
10
10
  export default getConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intl",
3
- "version": "3.17.4",
3
+ "version": "3.17.5",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -87,45 +87,11 @@
87
87
  "dependencies": {
88
88
  "@formatjs/intl-localematcher": "^0.5.4",
89
89
  "negotiator": "^0.6.3",
90
- "use-intl": "^3.17.4"
90
+ "use-intl": "^3.17.5"
91
91
  },
92
92
  "peerDependencies": {
93
93
  "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
94
94
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
95
95
  },
96
- "size-limit": [
97
- {
98
- "path": "dist/production/index.react-client.js",
99
- "limit": "16.055 KB"
100
- },
101
- {
102
- "path": "dist/production/index.react-server.js",
103
- "limit": "16.875 KB"
104
- },
105
- {
106
- "path": "dist/production/navigation.react-client.js",
107
- "limit": "3.55 KB"
108
- },
109
- {
110
- "path": "dist/production/navigation.react-server.js",
111
- "limit": "18.355 KB"
112
- },
113
- {
114
- "path": "dist/production/server.react-client.js",
115
- "limit": "1 KB"
116
- },
117
- {
118
- "path": "dist/production/server.react-server.js",
119
- "limit": "16.025 KB"
120
- },
121
- {
122
- "path": "dist/production/middleware.js",
123
- "limit": "11.515 KB"
124
- },
125
- {
126
- "path": "dist/production/routing.js",
127
- "limit": "0 KB"
128
- }
129
- ],
130
- "gitHead": "720c254b5f1b189adfd5406e501793ad4d4cc8a6"
96
+ "gitHead": "ffa3b52e93c3282dd8e0dce6e1bb8c41eab8a499"
131
97
  }