next-intl 3.3.3 → 3.4.1
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.
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var headers = require('next/headers');
|
|
6
|
+
var navigation = require('next/navigation');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var constants = require('../../shared/constants.js');
|
|
8
9
|
|
|
@@ -20,7 +21,10 @@ function getLocaleFromHeaderImpl() {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
if (!locale) {
|
|
23
|
-
|
|
24
|
+
{
|
|
25
|
+
console.error("Unable to find `next-intl` locale because the middleware didn't run on this request. See https://next-intl-docs.vercel.app/docs/routing/middleware#unable-to-find-locale. The `notFound()` function will be called as a result.");
|
|
26
|
+
}
|
|
27
|
+
navigation.notFound();
|
|
24
28
|
}
|
|
25
29
|
return locale;
|
|
26
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{headers as
|
|
1
|
+
import{headers as t}from"next/headers";import{notFound as e}from"next/navigation";import{cache as n}from"react";import{HEADER_LOCALE_NAME as o}from"../../shared/constants.js";const r=n((function(){let n;try{n=t().get(o)}catch(t){throw t instanceof Error&&"DYNAMIC_SERVER_USAGE"===t.digest?new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `unstable_setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components#static-rendering",{cause:t}):t}return n||e(),n}));const i=n((function(){return{locale:void 0}}));function s(t){i().locale=t}function a(){return i().locale||r()}export{a as getRequestLocale,s as setRequestLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("next/navigation"),n=require("react"),r=require("../../shared/constants.js");const o=n.cache((function(){let n;try{n=e.headers().get(r.HEADER_LOCALE_NAME)}catch(e){throw e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest?new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `unstable_setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components#static-rendering",{cause:e}):e}return n||t.notFound(),n}));const s=n.cache((function(){return{locale:void 0}}));exports.getRequestLocale=function(){return s().locale||o()},exports.setRequestLocale=function(e){s().locale=e};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intl",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"funding": [
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "rm -rf dist && rollup -c",
|
|
21
21
|
"test": "TZ=Europe/Berlin vitest",
|
|
22
|
-
"lint": "
|
|
22
|
+
"lint": "pnpm run lint:source && pnpm run lint:package",
|
|
23
|
+
"lint:source": "eslint src test && tsc --noEmit",
|
|
24
|
+
"lint:package": "publint && attw --pack",
|
|
23
25
|
"prepublishOnly": "CI=true turbo test && turbo lint && turbo build && cp ../../README.md .",
|
|
24
26
|
"postpublish": "git checkout . && rm ./README.md",
|
|
25
27
|
"size": "size-limit"
|
|
@@ -80,13 +82,14 @@
|
|
|
80
82
|
"dependencies": {
|
|
81
83
|
"@formatjs/intl-localematcher": "^0.2.32",
|
|
82
84
|
"negotiator": "^0.6.3",
|
|
83
|
-
"use-intl": "^3.
|
|
85
|
+
"use-intl": "^3.4.1"
|
|
84
86
|
},
|
|
85
87
|
"peerDependencies": {
|
|
86
88
|
"next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
|
87
89
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
88
90
|
},
|
|
89
91
|
"devDependencies": {
|
|
92
|
+
"@arethetypeswrong/cli": "^0.13.5",
|
|
90
93
|
"@edge-runtime/vm": "^3.1.3",
|
|
91
94
|
"@size-limit/preset-big-lib": "^8.2.6",
|
|
92
95
|
"@testing-library/react": "^13.0.0",
|
|
@@ -99,6 +102,7 @@
|
|
|
99
102
|
"eslint-plugin-deprecation": "^1.4.1",
|
|
100
103
|
"next": "^14.0.4",
|
|
101
104
|
"path-to-regexp": "^6.2.1",
|
|
105
|
+
"publint": "^0.2.7",
|
|
102
106
|
"react": "^18.2.0",
|
|
103
107
|
"react-dom": "^18.2.0",
|
|
104
108
|
"rollup": "^3.28.1",
|
|
@@ -137,5 +141,5 @@
|
|
|
137
141
|
"limit": "5.8 KB"
|
|
138
142
|
}
|
|
139
143
|
],
|
|
140
|
-
"gitHead": "
|
|
144
|
+
"gitHead": "e90eda6d85867f87d941ebba10d0bcf6170c5e81"
|
|
141
145
|
}
|