gt-next 11.0.10 → 11.0.12
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.
- package/CHANGELOG.md +18 -0
- package/dist/i18n-cache/NextI18nCache.js +1 -1
- package/dist/i18n-cache/NextI18nCache.mjs +1 -1
- package/dist/index.server.js +1 -1
- package/dist/index.server.mjs +1 -1
- package/dist/setup/initGT.client.d.ts +6 -1
- package/dist/setup/initGT.client.d.ts.map +1 -1
- package/dist/setup/initGT.client.js +12 -15
- package/dist/setup/initGT.client.js.map +1 -1
- package/dist/setup/initGT.client.mjs +11 -15
- package/dist/setup/initGT.client.mjs.map +1 -1
- package/dist/setup/initGT.js +1 -1
- package/dist/setup/initGT.mjs +1 -1
- package/dist/utils/client-boundary.js +1 -1
- package/dist/utils/client-boundary.mjs +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# gt-next
|
|
2
2
|
|
|
3
|
+
## 11.0.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @generaltranslation/react-core@11.0.12
|
|
9
|
+
- gt-react@11.0.12
|
|
10
|
+
|
|
11
|
+
## 11.0.11
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#1928](https://github.com/generaltranslation/gt/pull/1928) [`84bc362`](https://github.com/generaltranslation/gt/commit/84bc362d03d03c6f70773c35e6d92770ad56548f) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - Use the client-safe React i18n cache in the browser so gt-next only resolves dictionary files and loaders on the server.
|
|
16
|
+
|
|
17
|
+
- Updated dependencies []:
|
|
18
|
+
- @generaltranslation/react-core@11.0.11
|
|
19
|
+
- gt-react@11.0.11
|
|
20
|
+
|
|
3
21
|
## 11.0.10
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -2,8 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
require("../_virtual/_rolldown/runtime.js");
|
|
3
3
|
const require_dictionary_getDictionary = require("../dictionary/getDictionary.js");
|
|
4
4
|
const require_resolvers_resolveDictionaryLoader = require("../resolvers/resolveDictionaryLoader.js");
|
|
5
|
-
let gt_i18n_internal = require("gt-i18n/internal");
|
|
6
5
|
let gt_react = require("gt-react");
|
|
6
|
+
let gt_i18n_internal = require("gt-i18n/internal");
|
|
7
7
|
//#region src/i18n-cache/NextI18nCache.ts
|
|
8
8
|
function getNextI18nCache() {
|
|
9
9
|
return (0, gt_i18n_internal.getI18nCache)();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getDictionary } from "../dictionary/getDictionary.mjs";
|
|
2
2
|
import { resolveDictionaryLoader } from "../resolvers/resolveDictionaryLoader.mjs";
|
|
3
|
-
import { getI18nCache, getI18nConfig, setI18nCache } from "gt-i18n/internal";
|
|
4
3
|
import { ReactI18nCache } from "gt-react";
|
|
4
|
+
import { getI18nCache, getI18nConfig, setI18nCache } from "gt-i18n/internal";
|
|
5
5
|
//#region src/i18n-cache/NextI18nCache.ts
|
|
6
6
|
function getNextI18nCache() {
|
|
7
7
|
return getI18nCache();
|
package/dist/index.server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("./_virtual/_rolldown/runtime.js");
|
|
4
|
-
const require_setup_initGT = require("./setup/initGT.js");
|
|
5
4
|
const require_request_localeValidation = require("./request/localeValidation.js");
|
|
5
|
+
const require_setup_initGT = require("./setup/initGT.js");
|
|
6
6
|
const require_pages_dir_parseLocale = require("./pages-dir/parseLocale.js");
|
|
7
7
|
const require_pages_dir_withGTServerSideProps = require("./pages-dir/withGTServerSideProps.js");
|
|
8
8
|
const require_pages_dir_withGTStaticProps = require("./pages-dir/withGTStaticProps.js");
|
package/dist/index.server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { initializeGT } from "./setup/initGT.mjs";
|
|
3
2
|
import { isLocaleSupported } from "./request/localeValidation.mjs";
|
|
3
|
+
import { initializeGT } from "./setup/initGT.mjs";
|
|
4
4
|
import { parseLocale } from "./pages-dir/parseLocale.mjs";
|
|
5
5
|
import { withGTServerSideProps } from "./pages-dir/withGTServerSideProps.mjs";
|
|
6
6
|
import { withGTStaticProps } from "./pages-dir/withGTStaticProps.mjs";
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import type { NextSetupI18nConfigParams } from './shared';
|
|
2
|
+
import type { NextI18nCacheParams } from '../i18n-cache/NextI18nCache';
|
|
1
3
|
/**
|
|
2
4
|
* Initialize GT for Next.js client entrypoints.
|
|
3
5
|
*/
|
|
4
|
-
export declare function initializeGTClient(
|
|
6
|
+
export declare function initializeGTClient({ i18nConfigParams, nextI18nCacheParams, }?: {
|
|
7
|
+
i18nConfigParams: NextSetupI18nConfigParams;
|
|
8
|
+
nextI18nCacheParams: NextI18nCacheParams;
|
|
9
|
+
}): void;
|
|
5
10
|
//# sourceMappingURL=initGT.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initGT.client.d.ts","sourceRoot":"","sources":["../../src/setup/initGT.client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initGT.client.d.ts","sourceRoot":"","sources":["../../src/setup/initGT.client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,EACE,gBAAgB,EAChB,mBAAmB,GACpB,GAAE;IACD,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,mBAAmB,EAAE,mBAAmB,CAAC;CAC5B,GACd,IAAI,CAWN"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../_virtual/_rolldown/runtime.js");
|
|
2
3
|
const require_setup_shared = require("./shared.js");
|
|
3
|
-
|
|
4
|
+
let _generaltranslation_react_core_pure = require("@generaltranslation/react-core/pure");
|
|
4
5
|
//#region src/setup/initGT.client.ts
|
|
5
6
|
/**
|
|
6
7
|
* Initialize GT for Next.js client entrypoints.
|
|
7
8
|
*/
|
|
8
|
-
function initializeGTClient() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* to fetch new translations.
|
|
19
|
-
*/
|
|
20
|
-
cacheExpiryTime: null
|
|
21
|
-
}
|
|
9
|
+
function initializeGTClient({ i18nConfigParams, nextI18nCacheParams } = require_setup_shared.getParams()) {
|
|
10
|
+
(0, _generaltranslation_react_core_pure.internalInitializeGTSRA)({
|
|
11
|
+
...i18nConfigParams,
|
|
12
|
+
...nextI18nCacheParams,
|
|
13
|
+
/**
|
|
14
|
+
* Always disable cache expiry for client-side lookups.
|
|
15
|
+
* Translations and dictionaries are exclusively passed from server to
|
|
16
|
+
* client, so the client has no loader to refresh expired entries.
|
|
17
|
+
*/
|
|
18
|
+
cacheExpiryTime: null
|
|
22
19
|
});
|
|
23
20
|
}
|
|
24
21
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initGT.client.js","names":["getParams"],"sources":["../../src/setup/initGT.client.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"initGT.client.js","names":["getParams"],"sources":["../../src/setup/initGT.client.ts"],"sourcesContent":["import { internalInitializeGTSRA } from '@generaltranslation/react-core/pure';\nimport { getParams } from './shared';\nimport type { NextSetupI18nConfigParams } from './shared';\nimport type { NextI18nCacheParams } from '../i18n-cache/NextI18nCache';\n\n/**\n * Initialize GT for Next.js client entrypoints.\n */\nexport function initializeGTClient(\n {\n i18nConfigParams,\n nextI18nCacheParams,\n }: {\n i18nConfigParams: NextSetupI18nConfigParams;\n nextI18nCacheParams: NextI18nCacheParams;\n } = getParams()\n): void {\n internalInitializeGTSRA({\n ...i18nConfigParams,\n ...nextI18nCacheParams,\n /**\n * Always disable cache expiry for client-side lookups.\n * Translations and dictionaries are exclusively passed from server to\n * client, so the client has no loader to refresh expired entries.\n */\n cacheExpiryTime: null,\n });\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,mBACd,EACE,kBACA,wBAIEA,qBAAAA,WAAW,EACT;AACN,EAAA,GAAA,oCAAA,yBAAwB;EACtB,GAAG;EACH,GAAG;;;;;;EAMH,iBAAiB;EAClB,CAAC"}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import { getParams } from "./shared.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { internalInitializeGTSRA } from "@generaltranslation/react-core/pure";
|
|
3
3
|
//#region src/setup/initGT.client.ts
|
|
4
4
|
/**
|
|
5
5
|
* Initialize GT for Next.js client entrypoints.
|
|
6
6
|
*/
|
|
7
|
-
function initializeGTClient() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
...
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* to fetch new translations.
|
|
18
|
-
*/
|
|
19
|
-
cacheExpiryTime: null
|
|
20
|
-
}
|
|
7
|
+
function initializeGTClient({ i18nConfigParams, nextI18nCacheParams } = getParams()) {
|
|
8
|
+
internalInitializeGTSRA({
|
|
9
|
+
...i18nConfigParams,
|
|
10
|
+
...nextI18nCacheParams,
|
|
11
|
+
/**
|
|
12
|
+
* Always disable cache expiry for client-side lookups.
|
|
13
|
+
* Translations and dictionaries are exclusively passed from server to
|
|
14
|
+
* client, so the client has no loader to refresh expired entries.
|
|
15
|
+
*/
|
|
16
|
+
cacheExpiryTime: null
|
|
21
17
|
});
|
|
22
18
|
}
|
|
23
19
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initGT.client.mjs","names":[],"sources":["../../src/setup/initGT.client.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"initGT.client.mjs","names":[],"sources":["../../src/setup/initGT.client.ts"],"sourcesContent":["import { internalInitializeGTSRA } from '@generaltranslation/react-core/pure';\nimport { getParams } from './shared';\nimport type { NextSetupI18nConfigParams } from './shared';\nimport type { NextI18nCacheParams } from '../i18n-cache/NextI18nCache';\n\n/**\n * Initialize GT for Next.js client entrypoints.\n */\nexport function initializeGTClient(\n {\n i18nConfigParams,\n nextI18nCacheParams,\n }: {\n i18nConfigParams: NextSetupI18nConfigParams;\n nextI18nCacheParams: NextI18nCacheParams;\n } = getParams()\n): void {\n internalInitializeGTSRA({\n ...i18nConfigParams,\n ...nextI18nCacheParams,\n /**\n * Always disable cache expiry for client-side lookups.\n * Translations and dictionaries are exclusively passed from server to\n * client, so the client has no loader to refresh expired entries.\n */\n cacheExpiryTime: null,\n });\n}\n"],"mappings":";;;;;;AAQA,SAAgB,mBACd,EACE,kBACA,wBAIE,WAAW,EACT;AACN,yBAAwB;EACtB,GAAG;EACH,GAAG;;;;;;EAMH,iBAAiB;EAClB,CAAC"}
|
package/dist/setup/initGT.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../_virtual/_rolldown/runtime.js");
|
|
3
|
-
const require_i18n_cache_NextI18nCache = require("../i18n-cache/NextI18nCache.js");
|
|
4
3
|
const require_setup_shared = require("./shared.js");
|
|
4
|
+
const require_i18n_cache_NextI18nCache = require("../i18n-cache/NextI18nCache.js");
|
|
5
5
|
let _generaltranslation_react_core_pure = require("@generaltranslation/react-core/pure");
|
|
6
6
|
//#region src/setup/initGT.ts
|
|
7
7
|
/**
|
package/dist/setup/initGT.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NextI18nCache, setNextI18nCache } from "../i18n-cache/NextI18nCache.mjs";
|
|
2
1
|
import { getParams } from "./shared.mjs";
|
|
2
|
+
import { NextI18nCache, setNextI18nCache } from "../i18n-cache/NextI18nCache.mjs";
|
|
3
3
|
import { initializeI18nConfig } from "@generaltranslation/react-core/pure";
|
|
4
4
|
//#region src/setup/initGT.ts
|
|
5
5
|
/**
|
|
@@ -4,8 +4,8 @@ require("../_virtual/_rolldown/runtime.js");
|
|
|
4
4
|
const require_utils_cookies = require("./cookies.js");
|
|
5
5
|
const require_utils_pathRegex = require("./pathRegex.js");
|
|
6
6
|
const require_setup_initGT_client = require("../setup/initGT.client.js");
|
|
7
|
-
let gt_i18n_internal = require("gt-i18n/internal");
|
|
8
7
|
let gt_react = require("gt-react");
|
|
8
|
+
let gt_i18n_internal = require("gt-i18n/internal");
|
|
9
9
|
let react = require("react");
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
let next_navigation_js = require("next/navigation.js");
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { defaultLocaleRoutingEnabledCookieName, defaultReferrerLocaleCookieName } from "./cookies.mjs";
|
|
3
3
|
import { compilePathRegex, pathnameMatchesRegex } from "./pathRegex.mjs";
|
|
4
4
|
import { initializeGTClient } from "../setup/initGT.client.mjs";
|
|
5
|
-
import { getCookieValue, getI18nConfig } from "gt-i18n/internal";
|
|
6
5
|
import { GTProvider, LocaleSelector as Client_LocaleSelector, RegionSelector as Client_RegionSelector } from "gt-react";
|
|
6
|
+
import { getCookieValue, getI18nConfig } from "gt-i18n/internal";
|
|
7
7
|
import { useCallback, useEffect } from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import { usePathname, useRouter } from "next/navigation.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-next",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.12",
|
|
4
4
|
"description": "A Next.js library for automatic internationalization.",
|
|
5
5
|
"main": "dist/index.server.js",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@generaltranslation/format": "0.1.2",
|
|
32
|
-
"@generaltranslation/react-core": "11.0.
|
|
32
|
+
"@generaltranslation/react-core": "11.0.12",
|
|
33
33
|
"generaltranslation": "9.0.3",
|
|
34
|
-
"gt-react": "11.0.
|
|
34
|
+
"gt-react": "11.0.12",
|
|
35
35
|
"gt-i18n": "1.0.7"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|