next-intl 3.23.2 → 3.23.4

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.
@@ -2,12 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var RequestLocale = require('../../server/react-server/RequestLocale.js');
6
5
  var createSharedNavigationFns = require('../shared/createSharedNavigationFns.js');
6
+ var getServerLocale = require('./getServerLocale.js');
7
7
 
8
8
  function createNavigation(routing) {
9
9
  function getLocale() {
10
- return RequestLocale.getRequestLocale();
10
+ return getServerLocale.default();
11
11
  }
12
12
 
13
13
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var getConfig = require('../../server/react-server/getConfig.js');
6
+
7
+ /**
8
+ * This is only moved to a separate module for easier mocking in
9
+ * `../createNavigatoin.test.tsx` in order to avoid suspending.
10
+ */
11
+ async function getServerLocale() {
12
+ const config = await getConfig.default();
13
+ return config.locale;
14
+ }
15
+
16
+ exports.default = getServerLocale;
@@ -1 +1 @@
1
- import{getRequestLocale as e}from"../../server/react-server/RequestLocale.js";import o from"../shared/createSharedNavigationFns.js";function t(t){const{config:n,...r}=o((function(){return e()}),t);function s(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the calling component to a Client Component."))}}return{...r,usePathname:s("usePathname"),useRouter:s("useRouter")}}export{t as default};
1
+ import e from"../shared/createSharedNavigationFns.js";import o from"./getServerLocale.js";function t(t){const{config:n,...r}=e((function(){return o()}),t);function u(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the calling component to a Client Component."))}}return{...r,usePathname:u("usePathname"),useRouter:u("useRouter")}}export{t as default};
@@ -0,0 +1 @@
1
+ import e from"../../server/react-server/getConfig.js";async function r(){return(await e()).locale}export{r as default};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../server/react-server/RequestLocale.js"),t=require("../shared/createSharedNavigationFns.js");exports.default=function(r){const{config:o,...n}=t.default((function(){return e.getRequestLocale()}),r);function u(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the calling component to a Client Component."))}}return{...n,usePathname:u("usePathname"),useRouter:u("useRouter")}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/createSharedNavigationFns.js"),t=require("./getServerLocale.js");exports.default=function(r){const{config:n,...o}=e.default((function(){return t.default()}),r);function u(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the calling component to a Client Component."))}}return{...o,usePathname:u("usePathname"),useRouter:u("useRouter")}};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../server/react-server/getConfig.js");exports.default=async function(){return(await e.default()).locale};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This is only moved to a separate module for easier mocking in
3
+ * `../createNavigatoin.test.tsx` in order to avoid suspending.
4
+ */
5
+ export default function getServerLocale(): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intl",
3
- "version": "3.23.2",
3
+ "version": "3.23.4",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -87,12 +87,12 @@
87
87
  ],
88
88
  "dependencies": {
89
89
  "@formatjs/intl-localematcher": "^0.5.4",
90
- "negotiator": "^0.6.3",
91
- "use-intl": "^3.23.2"
90
+ "negotiator": "^1.0.0",
91
+ "use-intl": "^3.23.4"
92
92
  },
93
93
  "peerDependencies": {
94
94
  "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
95
95
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
96
96
  },
97
- "gitHead": "963d94a5f8aca06cc699a0910480034851bac05f"
97
+ "gitHead": "af789e33c31d2e632d5db7eb6f6802543cfebbdb"
98
98
  }