remote-components 0.3.6 → 0.4.0
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/dist/{chunk-6IUP26UK.cjs → chunk-42TVDI3G.cjs} +5 -4
- package/dist/chunk-42TVDI3G.cjs.map +1 -0
- package/dist/chunk-5KTAEO52.cjs +28 -0
- package/dist/chunk-5KTAEO52.cjs.map +1 -0
- package/dist/{chunk-42N2ZLE2.js → chunk-5WL3FP4V.js} +6 -6
- package/dist/{chunk-ZPMTZ3KJ.js → chunk-AKOMV2UF.js} +4 -3
- package/dist/chunk-AKOMV2UF.js.map +1 -0
- package/dist/{chunk-ER73O65F.cjs → chunk-AYC2AWUG.cjs} +23 -23
- package/dist/{chunk-KEPHL25S.js → chunk-D5GNZB6O.js} +2 -1
- package/dist/chunk-D5GNZB6O.js.map +1 -0
- package/dist/{chunk-F44NODUS.cjs → chunk-EYALF655.cjs} +26 -26
- package/dist/{chunk-XCFYWSLD.cjs → chunk-JJTCFQHE.cjs} +31 -19
- package/dist/chunk-JJTCFQHE.cjs.map +1 -0
- package/dist/{chunk-OO4AMJWO.js → chunk-LQ7VQ74E.js} +2 -2
- package/dist/{chunk-2VQGCACH.js → chunk-MKO52FRO.js} +30 -18
- package/dist/chunk-MKO52FRO.js.map +1 -0
- package/dist/{chunk-KYJWRZ2B.js → chunk-N3KPUFOB.js} +3 -3
- package/dist/chunk-N3SQTOSE.cjs +25 -0
- package/dist/chunk-N3SQTOSE.cjs.map +1 -0
- package/dist/{chunk-W5ESPGHH.js → chunk-NN5V3FVD.js} +27 -15
- package/dist/chunk-NN5V3FVD.js.map +1 -0
- package/dist/chunk-RHGEBXPL.js +25 -0
- package/dist/chunk-RHGEBXPL.js.map +1 -0
- package/dist/{chunk-R4QFK5TN.cjs → chunk-RLI4YTBJ.cjs} +20 -4
- package/dist/chunk-RLI4YTBJ.cjs.map +1 -0
- package/dist/{chunk-HNZVEIKN.js → chunk-SAGYPGIQ.js} +18 -2
- package/dist/chunk-SAGYPGIQ.js.map +1 -0
- package/dist/chunk-STIJO4AG.js +28 -0
- package/dist/chunk-STIJO4AG.js.map +1 -0
- package/dist/{chunk-CREXMFMF.cjs → chunk-TZT7DLO5.cjs} +4 -4
- package/dist/{chunk-KKBEMQU7.cjs → chunk-Y4GMYUJT.cjs} +41 -29
- package/dist/chunk-Y4GMYUJT.cjs.map +1 -0
- package/dist/{chunk-7MVFHOIP.cjs → chunk-Z2SLBFQL.cjs} +2 -1
- package/dist/chunk-Z2SLBFQL.cjs.map +1 -0
- package/dist/config/nextjs.cjs +7 -12
- package/dist/config/nextjs.cjs.map +1 -1
- package/dist/config/nextjs.js +4 -9
- package/dist/config/nextjs.js.map +1 -1
- package/dist/host/html.cjs +29 -28
- package/dist/host/html.cjs.map +1 -1
- package/dist/host/html.js +12 -11
- package/dist/host/html.js.map +1 -1
- package/dist/host/navigation.cjs +8 -0
- package/dist/host/navigation.d.ts +30 -0
- package/dist/host/navigation.js +8 -0
- package/dist/host/nextjs/app/client-only.cjs +16 -14
- package/dist/host/nextjs/app/client-only.cjs.map +1 -1
- package/dist/host/nextjs/app/client-only.d.ts +2 -1
- package/dist/host/nextjs/app/client-only.js +11 -9
- package/dist/host/nextjs/app/client-only.js.map +1 -1
- package/dist/host/react.cjs +14 -10
- package/dist/host/react.d.ts +2 -1
- package/dist/host/react.js +15 -11
- package/dist/{index-4c65355c.d.ts → index-d2ce8a3f.d.ts} +22 -2
- package/dist/internal/config/webpack/next-client-pages-loader.cjs +27 -15
- package/dist/internal/config/webpack/next-client-pages-loader.cjs.map +1 -1
- package/dist/internal/config/webpack/next-client-pages-loader.d.ts +3 -5
- package/dist/internal/config/webpack/next-client-pages-loader.js +27 -15
- package/dist/internal/config/webpack/next-client-pages-loader.js.map +1 -1
- package/dist/internal/host/nextjs/app-client.d.ts +1 -1
- package/dist/internal/host/react/context.d.ts +2 -2
- package/dist/internal/host/shared/navigate-event.cjs +51 -0
- package/dist/internal/host/shared/navigate-event.cjs.map +1 -0
- package/dist/internal/host/shared/navigate-event.d.ts +21 -0
- package/dist/internal/host/shared/navigate-event.js +26 -0
- package/dist/internal/host/shared/navigate-event.js.map +1 -0
- package/dist/internal/host/shared/pipeline.d.ts +2 -2
- package/dist/internal/host/shared/polyfill.cjs +14 -0
- package/dist/internal/host/shared/polyfill.cjs.map +1 -1
- package/dist/internal/host/shared/polyfill.js +16 -0
- package/dist/internal/host/shared/polyfill.js.map +1 -1
- package/dist/internal/runtime/loaders/component-loader.d.ts +2 -2
- package/dist/internal/runtime/loaders/script-loader.cjs +2 -1
- package/dist/internal/runtime/loaders/script-loader.cjs.map +1 -1
- package/dist/internal/runtime/loaders/script-loader.js +2 -1
- package/dist/internal/runtime/loaders/script-loader.js.map +1 -1
- package/dist/internal/runtime/loaders/static-loader.d.ts +2 -1
- package/dist/internal/runtime/namespace.cjs +1 -0
- package/dist/internal/runtime/namespace.cjs.map +1 -1
- package/dist/internal/runtime/namespace.d.ts +2 -1
- package/dist/internal/runtime/namespace.js +1 -0
- package/dist/internal/runtime/namespace.js.map +1 -1
- package/dist/internal/runtime/types.d.ts +2 -1
- package/dist/navigate-event-baee0b63.d.ts +14 -0
- package/dist/remote/html.cjs +1 -1
- package/dist/remote/html.js +1 -1
- package/dist/{script-6W5JRBZK.cjs → script-D5AD7HLV.cjs} +4 -4
- package/dist/{script-IFEBOLIA.js → script-VPOI7ARP.js} +3 -3
- package/dist/{server-handoff-ce13bebc.d.ts → server-handoff-8c89b856.d.ts} +2 -2
- package/dist/{static-loader-X4TSF5KW.js → static-loader-OHSAUD62.js} +3 -3
- package/dist/static-loader-OHSAUD62.js.map +1 -0
- package/dist/static-loader-UDIXK5MV.cjs +11 -0
- package/dist/static-loader-UDIXK5MV.cjs.map +1 -0
- package/dist/{turbopack-NPGO3MWS.js → turbopack-DK6L7P3J.js} +6 -5
- package/dist/{turbopack-NPGO3MWS.js.map → turbopack-DK6L7P3J.js.map} +1 -1
- package/dist/{turbopack-WRMKPNN4.cjs → turbopack-PSD4THQE.cjs} +13 -12
- package/dist/turbopack-PSD4THQE.cjs.map +1 -0
- package/dist/{types-59251814.d.ts → types-8b0edd78.d.ts} +7 -0
- package/dist/{webpack-DUBHPYD6.js → webpack-KSDNIXMS.js} +6 -5
- package/dist/{webpack-DUBHPYD6.js.map → webpack-KSDNIXMS.js.map} +1 -1
- package/dist/{webpack-KSCMCL7M.cjs → webpack-SIFRCBIN.cjs} +13 -12
- package/dist/webpack-SIFRCBIN.cjs.map +1 -0
- package/package.json +9 -1
- package/dist/chunk-2VQGCACH.js.map +0 -1
- package/dist/chunk-6IUP26UK.cjs.map +0 -1
- package/dist/chunk-7MVFHOIP.cjs.map +0 -1
- package/dist/chunk-HNZVEIKN.js.map +0 -1
- package/dist/chunk-KEPHL25S.js.map +0 -1
- package/dist/chunk-KKBEMQU7.cjs.map +0 -1
- package/dist/chunk-R4QFK5TN.cjs.map +0 -1
- package/dist/chunk-W5ESPGHH.js.map +0 -1
- package/dist/chunk-XCFYWSLD.cjs.map +0 -1
- package/dist/chunk-ZPMTZ3KJ.js.map +0 -1
- package/dist/static-loader-ZYD5BO4D.cjs +0 -11
- package/dist/turbopack-WRMKPNN4.cjs.map +0 -1
- package/dist/webpack-KSCMCL7M.cjs.map +0 -1
- /package/dist/{chunk-42N2ZLE2.js.map → chunk-5WL3FP4V.js.map} +0 -0
- /package/dist/{chunk-ER73O65F.cjs.map → chunk-AYC2AWUG.cjs.map} +0 -0
- /package/dist/{chunk-F44NODUS.cjs.map → chunk-EYALF655.cjs.map} +0 -0
- /package/dist/{chunk-OO4AMJWO.js.map → chunk-LQ7VQ74E.js.map} +0 -0
- /package/dist/{chunk-KYJWRZ2B.js.map → chunk-N3KPUFOB.js.map} +0 -0
- /package/dist/{chunk-CREXMFMF.cjs.map → chunk-TZT7DLO5.cjs.map} +0 -0
- /package/dist/{static-loader-ZYD5BO4D.cjs.map → host/navigation.cjs.map} +0 -0
- /package/dist/{static-loader-X4TSF5KW.js.map → host/navigation.js.map} +0 -0
- /package/dist/{script-6W5JRBZK.cjs.map → script-D5AD7HLV.cjs.map} +0 -0
- /package/dist/{script-IFEBOLIA.js.map → script-VPOI7ARP.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkRLI4YTBJcjs = require('./chunk-RLI4YTBJ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -17,10 +17,11 @@ async function loadScripts(scripts, resolveClientUrl) {
|
|
|
17
17
|
return new Promise((resolve, reject) => {
|
|
18
18
|
const newSrc = new URL(
|
|
19
19
|
// remove the remote component bundle name identifier from the script src
|
|
20
|
-
script.src.replace(
|
|
20
|
+
script.src.replace(_chunkRLI4YTBJcjs.NEXT_BUNDLE_PATH_RE, "/_next/"),
|
|
21
21
|
location.origin
|
|
22
22
|
).href;
|
|
23
|
-
const
|
|
23
|
+
const rawResolved = _nullishCoalesce(_optionalChain([resolveClientUrl, 'optionalCall', _ => _(newSrc)]), () => ( newSrc));
|
|
24
|
+
const resolvedSrc = new URL(rawResolved, location.href).href;
|
|
24
25
|
const alreadyLoaded = Array.from(
|
|
25
26
|
document.querySelectorAll("script[src]")
|
|
26
27
|
).some((s) => s.src === resolvedSrc);
|
|
@@ -54,4 +55,4 @@ async function loadScripts(scripts, resolveClientUrl) {
|
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
exports.loadScripts = loadScripts;
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-42TVDI3G.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime/loaders/script-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAYA,eAAsB,YACpB,SACA,kBACe;AACf,QAAM,QAAQ;AAAA,IACZ,QAAQ,IAAI,CAAC,WAAW;AACtB,aAAO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,cAAM,SAAS,IAAI;AAAA;AAAA,UAEjB,OAAO,IAAI,QAAQ,qBAAqB,SAAS;AAAA,UACjD,SAAS;AAAA,QACX,EAAE;AAMF,cAAM,cAAc,mBAAmB,MAAM,KAAK;AAClD,cAAM,cAAc,IAAI,IAAI,aAAa,SAAS,IAAI,EAAE;AAExD,cAAM,gBAAgB,MAAM;AAAA,UAC1B,SAAS,iBAAoC,aAAa;AAAA,QAC5D,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,WAAW;AACnC,YAAI,eAAe;AACjB,kBAAQ;AACR;AAAA,QACF;AAEA,cAAM,YAAY,SAAS,cAAc,QAAQ;AACjD,kBAAU,SAAS,MAAM,QAAQ;AACjC,kBAAU,UAAU,MAAM;AACxB,gBAAM,YAAY,aAAa,WAAW;AAC1C,cAAI,WAAW;AACb,mBAAO,wBAAwB,UAAU,QAAQ,WAAW,CAAC;AAAA,UAC/D,OAAO;AACL,sCAA0B,gBAAgB,MAAM;AAChD;AAAA,cACE,IAAI;AAAA,gBACF,+BAA+B;AAAA,cACjC;AAAA,YACF;AAAA,UACF;AAAA,QACF;AACA,kBAAU,MAAM;AAChB,kBAAU,QAAQ;AAClB,iBAAS,KAAK,YAAY,SAAS;AAAA,MACrC,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF","sourcesContent":["import type { InternalResolveClientUrl } from '#internal/host/server/types';\nimport { NEXT_BUNDLE_PATH_RE } from '#internal/runtime/patterns';\nimport { isProxiedUrl } from '#internal/runtime/url/protected-rc-fallback';\nimport {\n failedProxiedAssetError,\n RemoteComponentsError,\n} from '#internal/utils/error';\nimport { warnCrossOriginFetchError } from '#internal/utils/logger';\n\n/**\n * Loads external scripts for remote components\n */\nexport async function loadScripts(\n scripts: { src: string }[],\n resolveClientUrl?: InternalResolveClientUrl,\n): Promise<void> {\n await Promise.all(\n scripts.map((script) => {\n return new Promise<void>((resolve, reject) => {\n const newSrc = new URL(\n // remove the remote component bundle name identifier from the script src\n script.src.replace(NEXT_BUNDLE_PATH_RE, '/_next/'),\n location.origin,\n ).href;\n\n // resolveClientUrl may return a relative URL (e.g. the host-proxy\n // path \"/rc-fetch-protected-remote?url=...\"). Normalize to absolute\n // before comparing with s.src, which browsers always expose as\n // absolute, so the deduplication check works in deployed contexts.\n const rawResolved = resolveClientUrl?.(newSrc) ?? newSrc;\n const resolvedSrc = new URL(rawResolved, location.href).href;\n\n const alreadyLoaded = Array.from(\n document.querySelectorAll<HTMLScriptElement>('script[src]'),\n ).some((s) => s.src === resolvedSrc);\n if (alreadyLoaded) {\n resolve();\n return;\n }\n\n const newScript = document.createElement('script');\n newScript.onload = () => resolve();\n newScript.onerror = () => {\n const isProxied = isProxiedUrl(resolvedSrc);\n if (isProxied) {\n reject(failedProxiedAssetError('script', newSrc, resolvedSrc));\n } else {\n warnCrossOriginFetchError('ScriptLoader', newSrc);\n reject(\n new RemoteComponentsError(\n `Failed to load <script src=\"${newSrc}\"> for Remote Component. Check the URL is correct.`,\n ),\n );\n }\n };\n newScript.src = resolvedSrc;\n newScript.async = true;\n document.head.appendChild(newScript);\n });\n }),\n );\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/host/shared/navigate-event.ts
|
|
2
|
+
var REMOTE_NAVIGATE_EVENT = "remote-components:navigate";
|
|
3
|
+
function parseRemoteNavigateDetail(detail) {
|
|
4
|
+
try {
|
|
5
|
+
const parsed = new URL(detail.url, window.location.origin);
|
|
6
|
+
return {
|
|
7
|
+
url: detail.url,
|
|
8
|
+
pathname: parsed.pathname,
|
|
9
|
+
search: parsed.search,
|
|
10
|
+
hash: parsed.hash,
|
|
11
|
+
type: detail.type
|
|
12
|
+
};
|
|
13
|
+
} catch (e) {
|
|
14
|
+
return {
|
|
15
|
+
url: detail.url,
|
|
16
|
+
pathname: detail.url,
|
|
17
|
+
search: "",
|
|
18
|
+
hash: "",
|
|
19
|
+
type: detail.type
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
exports.REMOTE_NAVIGATE_EVENT = REMOTE_NAVIGATE_EVENT; exports.parseRemoteNavigateDetail = parseRemoteNavigateDetail;
|
|
28
|
+
//# sourceMappingURL=chunk-5KTAEO52.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/host/shared/navigate-event.ts"],"names":[],"mappings":";AAAO,IAAM,wBAAwB;AAqB9B,SAAS,0BACd,QACqB;AACrB,MAAI;AACF,UAAM,SAAS,IAAI,IAAI,OAAO,KAAK,OAAO,SAAS,MAAM;AACzD,WAAO;AAAA,MACL,KAAK,OAAO;AAAA,MACZ,UAAU,OAAO;AAAA,MACjB,QAAQ,OAAO;AAAA,MACf,MAAM,OAAO;AAAA,MACb,MAAM,OAAO;AAAA,IACf;AAAA,EACF,QAAE;AACA,WAAO;AAAA,MACL,KAAK,OAAO;AAAA,MACZ,UAAU,OAAO;AAAA,MACjB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,MAAM,OAAO;AAAA,IACf;AAAA,EACF;AACF","sourcesContent":["export const REMOTE_NAVIGATE_EVENT = 'remote-components:navigate';\n\nexport interface RemoteNavigateDetail {\n url: string;\n type: 'push' | 'replace';\n}\n\n/** Parsed navigation request surfaced to `onRemoteNavigate` / `useRemoteNavigate` callbacks. */\nexport interface RemoteNavigateEvent {\n /** Raw value from the remote; may be absolute or relative. */\n url: string;\n pathname: string;\n /** Includes leading `?`, or `''` if none. */\n search: string;\n /** Includes leading `#`, or `''` if none. */\n hash: string;\n /** `'push'` / `'replace'` mirror the remote's history call. */\n type: 'push' | 'replace';\n}\n\n/** Handles both absolute URLs and relative paths; falls back to pathname-only on parse failure. */\nexport function parseRemoteNavigateDetail(\n detail: RemoteNavigateDetail,\n): RemoteNavigateEvent {\n try {\n const parsed = new URL(detail.url, window.location.origin);\n return {\n url: detail.url,\n pathname: parsed.pathname,\n search: parsed.search,\n hash: parsed.hash,\n type: detail.type,\n };\n } catch {\n return {\n url: detail.url,\n pathname: detail.url,\n search: '',\n hash: '',\n type: detail.type,\n };\n }\n}\n"]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadScripts
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AKOMV2UF.js";
|
|
4
4
|
import {
|
|
5
5
|
initializeSharedModules,
|
|
6
6
|
setupRemoteScope
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N3KPUFOB.js";
|
|
8
8
|
import {
|
|
9
9
|
applySharedModules,
|
|
10
10
|
nextClientPagesLoader
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MKO52FRO.js";
|
|
12
12
|
import {
|
|
13
13
|
loadStaticRemoteComponent
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LQ7VQ74E.js";
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_BUNDLE_NAME,
|
|
17
17
|
DEFAULT_COMPONENT_NAME,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
buildWebpackResolve,
|
|
24
24
|
collapseDoubleSlashes,
|
|
25
25
|
escapeString
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-SAGYPGIQ.js";
|
|
27
27
|
import {
|
|
28
28
|
RemoteComponentsError,
|
|
29
29
|
logDebug,
|
|
@@ -700,4 +700,4 @@ export {
|
|
|
700
700
|
resolveNameFromSrc,
|
|
701
701
|
bindResolveClientUrl
|
|
702
702
|
};
|
|
703
|
-
//# sourceMappingURL=chunk-
|
|
703
|
+
//# sourceMappingURL=chunk-5WL3FP4V.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NEXT_BUNDLE_PATH_RE
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SAGYPGIQ.js";
|
|
4
4
|
import {
|
|
5
5
|
RemoteComponentsError,
|
|
6
6
|
failedProxiedAssetError,
|
|
@@ -20,7 +20,8 @@ async function loadScripts(scripts, resolveClientUrl) {
|
|
|
20
20
|
script.src.replace(NEXT_BUNDLE_PATH_RE, "/_next/"),
|
|
21
21
|
location.origin
|
|
22
22
|
).href;
|
|
23
|
-
const
|
|
23
|
+
const rawResolved = resolveClientUrl?.(newSrc) ?? newSrc;
|
|
24
|
+
const resolvedSrc = new URL(rawResolved, location.href).href;
|
|
24
25
|
const alreadyLoaded = Array.from(
|
|
25
26
|
document.querySelectorAll("script[src]")
|
|
26
27
|
).some((s) => s.src === resolvedSrc);
|
|
@@ -54,4 +55,4 @@ async function loadScripts(scripts, resolveClientUrl) {
|
|
|
54
55
|
export {
|
|
55
56
|
loadScripts
|
|
56
57
|
};
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-AKOMV2UF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime/loaders/script-loader.ts"],"sourcesContent":["import type { InternalResolveClientUrl } from '#internal/host/server/types';\nimport { NEXT_BUNDLE_PATH_RE } from '#internal/runtime/patterns';\nimport { isProxiedUrl } from '#internal/runtime/url/protected-rc-fallback';\nimport {\n failedProxiedAssetError,\n RemoteComponentsError,\n} from '#internal/utils/error';\nimport { warnCrossOriginFetchError } from '#internal/utils/logger';\n\n/**\n * Loads external scripts for remote components\n */\nexport async function loadScripts(\n scripts: { src: string }[],\n resolveClientUrl?: InternalResolveClientUrl,\n): Promise<void> {\n await Promise.all(\n scripts.map((script) => {\n return new Promise<void>((resolve, reject) => {\n const newSrc = new URL(\n // remove the remote component bundle name identifier from the script src\n script.src.replace(NEXT_BUNDLE_PATH_RE, '/_next/'),\n location.origin,\n ).href;\n\n // resolveClientUrl may return a relative URL (e.g. the host-proxy\n // path \"/rc-fetch-protected-remote?url=...\"). Normalize to absolute\n // before comparing with s.src, which browsers always expose as\n // absolute, so the deduplication check works in deployed contexts.\n const rawResolved = resolveClientUrl?.(newSrc) ?? newSrc;\n const resolvedSrc = new URL(rawResolved, location.href).href;\n\n const alreadyLoaded = Array.from(\n document.querySelectorAll<HTMLScriptElement>('script[src]'),\n ).some((s) => s.src === resolvedSrc);\n if (alreadyLoaded) {\n resolve();\n return;\n }\n\n const newScript = document.createElement('script');\n newScript.onload = () => resolve();\n newScript.onerror = () => {\n const isProxied = isProxiedUrl(resolvedSrc);\n if (isProxied) {\n reject(failedProxiedAssetError('script', newSrc, resolvedSrc));\n } else {\n warnCrossOriginFetchError('ScriptLoader', newSrc);\n reject(\n new RemoteComponentsError(\n `Failed to load <script src=\"${newSrc}\"> for Remote Component. Check the URL is correct.`,\n ),\n );\n }\n };\n newScript.src = resolvedSrc;\n newScript.async = true;\n document.head.appendChild(newScript);\n });\n }),\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,eAAsB,YACpB,SACA,kBACe;AACf,QAAM,QAAQ;AAAA,IACZ,QAAQ,IAAI,CAAC,WAAW;AACtB,aAAO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,cAAM,SAAS,IAAI;AAAA;AAAA,UAEjB,OAAO,IAAI,QAAQ,qBAAqB,SAAS;AAAA,UACjD,SAAS;AAAA,QACX,EAAE;AAMF,cAAM,cAAc,mBAAmB,MAAM,KAAK;AAClD,cAAM,cAAc,IAAI,IAAI,aAAa,SAAS,IAAI,EAAE;AAExD,cAAM,gBAAgB,MAAM;AAAA,UAC1B,SAAS,iBAAoC,aAAa;AAAA,QAC5D,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,WAAW;AACnC,YAAI,eAAe;AACjB,kBAAQ;AACR;AAAA,QACF;AAEA,cAAM,YAAY,SAAS,cAAc,QAAQ;AACjD,kBAAU,SAAS,MAAM,QAAQ;AACjC,kBAAU,UAAU,MAAM;AACxB,gBAAM,YAAY,aAAa,WAAW;AAC1C,cAAI,WAAW;AACb,mBAAO,wBAAwB,UAAU,QAAQ,WAAW,CAAC;AAAA,UAC/D,OAAO;AACL,sCAA0B,gBAAgB,MAAM;AAChD;AAAA,cACE,IAAI;AAAA,gBACF,+BAA+B;AAAA,cACjC;AAAA,YACF;AAAA,UACF;AAAA,QACF;AACA,kBAAU,MAAM;AAChB,kBAAU,QAAQ;AAClB,iBAAS,KAAK,YAAY,SAAS;AAAA,MACrC,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk42TVDI3Gcjs = require('./chunk-42TVDI3G.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkEYALF655cjs = require('./chunk-EYALF655.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkJJTCFQHEcjs = require('./chunk-JJTCFQHE.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkTZT7DLO5cjs = require('./chunk-TZT7DLO5.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ var _chunkCREXMFMFcjs = require('./chunk-CREXMFMF.cjs');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkRLI4YTBJcjs = require('./chunk-RLI4YTBJ.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -285,12 +285,12 @@ function toComponentType(value) {
|
|
|
285
285
|
return value && isComponentType(value) ? value : "unknown";
|
|
286
286
|
}
|
|
287
287
|
function buildMetadata(attrs, url) {
|
|
288
|
-
const id = attrs.id ||
|
|
289
|
-
const bundle = attrs.bundle || process.env.NEXT_PUBLIC_MFE_CURRENT_APPLICATION ||
|
|
288
|
+
const id = attrs.id || _chunkRLI4YTBJcjs.DEFAULT_COMPONENT_NAME;
|
|
289
|
+
const bundle = attrs.bundle || process.env.NEXT_PUBLIC_MFE_CURRENT_APPLICATION || _chunkRLI4YTBJcjs.DEFAULT_BUNDLE_NAME;
|
|
290
290
|
return {
|
|
291
291
|
name: attrs.name || id.replace(/_ssr$/, ""),
|
|
292
292
|
bundle,
|
|
293
|
-
route: attrs.route || url.pathname ||
|
|
293
|
+
route: attrs.route || url.pathname || _chunkRLI4YTBJcjs.DEFAULT_ROUTE,
|
|
294
294
|
runtime: toRuntime(attrs.runtime),
|
|
295
295
|
id,
|
|
296
296
|
type: toComponentType(attrs.type)
|
|
@@ -329,7 +329,7 @@ function extractRemoteShared(doc, name, nextData) {
|
|
|
329
329
|
function validateComponentFound(component, rsc, nextData, isRemoteComponent, url, name) {
|
|
330
330
|
if (!component || !(rsc || nextData || isRemoteComponent)) {
|
|
331
331
|
throw new (0, _chunkRUWR74XQcjs.RemoteComponentsError)(
|
|
332
|
-
`Remote Component not found on ${url}.${name !==
|
|
332
|
+
`Remote Component not found on ${url}.${name !== _chunkRLI4YTBJcjs.DEFAULT_COMPONENT_NAME ? ` The name for the <RemoteComponent> is "${name}". Check <RemoteComponent> usage.` : ""} Did you forget to wrap the content in <RemoteComponent>?`
|
|
333
333
|
);
|
|
334
334
|
}
|
|
335
335
|
}
|
|
@@ -360,7 +360,7 @@ function parseRemoteComponentDocument(doc, name, url) {
|
|
|
360
360
|
name: resolvedName,
|
|
361
361
|
bundle: _optionalChain([component, 'optionalAccess', _34 => _34.getAttribute, 'call', _35 => _35(DATA_BUNDLE)]) || _optionalChain([nextData, 'optionalAccess', _36 => _36.props, 'access', _37 => _37.__REMOTE_COMPONENT__, 'optionalAccess', _38 => _38.bundle]),
|
|
362
362
|
route: _nullishCoalesce(_optionalChain([component, 'optionalAccess', _39 => _39.getAttribute, 'call', _40 => _40(DATA_ROUTE)]), () => ( _optionalChain([nextData, 'optionalAccess', _41 => _41.page]))),
|
|
363
|
-
runtime: _nullishCoalesce(_nullishCoalesce(_optionalChain([component, 'optionalAccess', _42 => _42.getAttribute, 'call', _43 => _43(DATA_RUNTIME)]), () => ( _optionalChain([nextData, 'optionalAccess', _44 => _44.props, 'access', _45 => _45.__REMOTE_COMPONENT__, 'optionalAccess', _46 => _46.runtime]))), () => (
|
|
363
|
+
runtime: _nullishCoalesce(_nullishCoalesce(_optionalChain([component, 'optionalAccess', _42 => _42.getAttribute, 'call', _43 => _43(DATA_RUNTIME)]), () => ( _optionalChain([nextData, 'optionalAccess', _44 => _44.props, 'access', _45 => _45.__REMOTE_COMPONENT__, 'optionalAccess', _46 => _46.runtime]))), () => ( _chunkRLI4YTBJcjs.RUNTIME_SCRIPT)),
|
|
364
364
|
id: _optionalChain([component, 'optionalAccess', _47 => _47.getAttribute, 'call', _48 => _48("id")]),
|
|
365
365
|
type: _optionalChain([component, 'optionalAccess', _49 => _49.getAttribute, 'call', _50 => _50(DATA_TYPE)])
|
|
366
366
|
},
|
|
@@ -430,7 +430,7 @@ async function loadRemoteComponent({
|
|
|
430
430
|
self.__DISABLE_WEBPACK_EXEC__ = {};
|
|
431
431
|
}
|
|
432
432
|
self.__DISABLE_WEBPACK_EXEC__[bundle] = true;
|
|
433
|
-
await
|
|
433
|
+
await _chunk42TVDI3Gcjs.loadScripts.call(void 0, scripts, resolveClientUrl);
|
|
434
434
|
}
|
|
435
435
|
const hostShared = await shared;
|
|
436
436
|
_chunkRUWR74XQcjs.logDebug.call(void 0,
|
|
@@ -445,7 +445,7 @@ async function loadRemoteComponent({
|
|
|
445
445
|
"ComponentLoader",
|
|
446
446
|
`Remote shared modules requested: ${JSON.stringify(remoteShared)}`
|
|
447
447
|
);
|
|
448
|
-
const scope = await
|
|
448
|
+
const scope = await _chunkEYALF655cjs.setupRemoteScope.call(void 0,
|
|
449
449
|
runtime,
|
|
450
450
|
scripts,
|
|
451
451
|
url,
|
|
@@ -453,14 +453,14 @@ async function loadRemoteComponent({
|
|
|
453
453
|
resolveClientUrl
|
|
454
454
|
);
|
|
455
455
|
if (runtime === "turbopack") {
|
|
456
|
-
await
|
|
456
|
+
await _chunkEYALF655cjs.initializeSharedModules.call(void 0,
|
|
457
457
|
scope,
|
|
458
|
-
|
|
458
|
+
_chunkRLI4YTBJcjs.buildCoreShared.call(void 0, hostShared),
|
|
459
459
|
remoteShared
|
|
460
460
|
);
|
|
461
461
|
}
|
|
462
462
|
if (bundle) {
|
|
463
|
-
const resolve = await
|
|
463
|
+
const resolve = await _chunkRLI4YTBJcjs.buildWebpackResolve.call(void 0,
|
|
464
464
|
hostShared,
|
|
465
465
|
remoteShared,
|
|
466
466
|
bundle,
|
|
@@ -473,7 +473,7 @@ async function loadRemoteComponent({
|
|
|
473
473
|
},
|
|
474
474
|
"ComponentLoader"
|
|
475
475
|
);
|
|
476
|
-
|
|
476
|
+
_chunkJJTCFQHEcjs.applySharedModules.call(void 0, bundle, resolve);
|
|
477
477
|
} else {
|
|
478
478
|
_chunkRUWR74XQcjs.logWarn.call(void 0,
|
|
479
479
|
"ComponentLoader",
|
|
@@ -514,7 +514,7 @@ async function loadRSCComponent(rscName, data) {
|
|
|
514
514
|
return { component };
|
|
515
515
|
}
|
|
516
516
|
function loadNextPagesComponent(bundle, route, nextData, name, container) {
|
|
517
|
-
const { Component, App } =
|
|
517
|
+
const { Component, App } = _chunkJJTCFQHEcjs.nextClientPagesLoader.call(void 0, bundle, route, container);
|
|
518
518
|
if (!Component) {
|
|
519
519
|
throw new (0, _chunkRUWR74XQcjs.RemoteComponentsError)(
|
|
520
520
|
`Remote Component "${name}" is trying to load the component for route "${route}" but it is not available.`
|
|
@@ -571,12 +571,12 @@ async function loadPrepared(input) {
|
|
|
571
571
|
function buildScriptDescriptors(scripts, url) {
|
|
572
572
|
return scripts.map((script) => {
|
|
573
573
|
const scriptSrc = script.getAttribute("data-src") || script.getAttribute("src") || script.src;
|
|
574
|
-
const { prefix, id: path } = _nullishCoalesce(_optionalChain([
|
|
574
|
+
const { prefix, id: path } = _nullishCoalesce(_optionalChain([_chunkRLI4YTBJcjs.REMOTE_COMPONENT_REGEX, 'access', _51 => _51.exec, 'call', _52 => _52(scriptSrc), 'optionalAccess', _53 => _53.groups]), () => ( {
|
|
575
575
|
prefix: void 0,
|
|
576
576
|
id: scriptSrc
|
|
577
577
|
}));
|
|
578
578
|
return {
|
|
579
|
-
src: new URL(
|
|
579
|
+
src: new URL(_chunkRLI4YTBJcjs.collapseDoubleSlashes.call(void 0, `${_nullishCoalesce(prefix, () => ( ""))}${path}`), url).href
|
|
580
580
|
};
|
|
581
581
|
});
|
|
582
582
|
}
|
|
@@ -585,7 +585,7 @@ async function loadStaticPath(input) {
|
|
|
585
585
|
const scripts = Array.from(
|
|
586
586
|
parsed.component.querySelectorAll("script")
|
|
587
587
|
);
|
|
588
|
-
const { mount, unmount } = await
|
|
588
|
+
const { mount, unmount } = await _chunkTZT7DLO5cjs.loadStaticRemoteComponent.call(void 0,
|
|
589
589
|
scripts,
|
|
590
590
|
url,
|
|
591
591
|
resolveClientUrl
|
|
@@ -609,7 +609,7 @@ async function loadDynamicPath(input) {
|
|
|
609
609
|
resolveClientUrl,
|
|
610
610
|
container
|
|
611
611
|
} = input;
|
|
612
|
-
const rscName = _nullishCoalesce(input.rscName, () => ( (parsed.rsc ? `__remote_component_rsc_${
|
|
612
|
+
const rscName = _nullishCoalesce(input.rscName, () => ( (parsed.rsc ? `__remote_component_rsc_${_chunkRLI4YTBJcjs.escapeString.call(void 0, url.href)}_${_chunkRLI4YTBJcjs.escapeString.call(void 0, parsed.name)}` : void 0)));
|
|
613
613
|
const rscData = parsed.rsc ? (parsed.rsc.textContent || "").split("\n").filter(Boolean) : [];
|
|
614
614
|
const result = await loadRemoteComponent({
|
|
615
615
|
url,
|
|
@@ -621,7 +621,7 @@ async function loadDynamicPath(input) {
|
|
|
621
621
|
data: rscData,
|
|
622
622
|
nextData: parsed.nextData,
|
|
623
623
|
scripts: scriptDescriptors,
|
|
624
|
-
shared:
|
|
624
|
+
shared: _chunkRLI4YTBJcjs.buildHostShared.call(void 0, shared, resolveClientUrl),
|
|
625
625
|
remoteShared: parsed.remoteShared,
|
|
626
626
|
container,
|
|
627
627
|
resolveClientUrl
|
|
@@ -700,4 +700,4 @@ function bindResolveClientUrl(prop, remoteSrc) {
|
|
|
700
700
|
|
|
701
701
|
|
|
702
702
|
exports.fetchWithHooks = fetchWithHooks; exports.getClientOrServerUrl = getClientOrServerUrl; exports.makeReactEmitter = makeReactEmitter; exports.makeEventEmitter = makeEventEmitter; exports.createRSCStream = createRSCStream; exports.preparePipeline = preparePipeline; exports.loadPrepared = loadPrepared; exports.createHostState = createHostState; exports.resolveNameFromSrc = resolveNameFromSrc; exports.bindResolveClientUrl = bindResolveClientUrl;
|
|
703
|
-
//# sourceMappingURL=chunk-
|
|
703
|
+
//# sourceMappingURL=chunk-AYC2AWUG.cjs.map
|
|
@@ -32,6 +32,7 @@ function getNamespace() {
|
|
|
32
32
|
dispatcherRuntime: void 0,
|
|
33
33
|
hostSharedModules: {},
|
|
34
34
|
cssCache: {},
|
|
35
|
+
pageComponentCache: {},
|
|
35
36
|
shadowRoots: {}
|
|
36
37
|
};
|
|
37
38
|
const nsRecord = ns;
|
|
@@ -57,4 +58,4 @@ function getNamespace() {
|
|
|
57
58
|
export {
|
|
58
59
|
getNamespace
|
|
59
60
|
};
|
|
60
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-D5GNZB6O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime/namespace.ts"],"sourcesContent":["import type React from 'react';\nimport type { RemoteScope } from '#internal/runtime/turbopack/remote-scope';\nimport type {\n GlobalScope,\n MountOrUnmountFunction,\n MountUnmountFunctions,\n} from '#internal/runtime/types';\n\n/**\n * Typed namespace for all remote-components runtime state.\n *\n * Consolidates scattered `globalThis` globals into a single object at\n * `globalThis.__remote_components__`. Each property corresponds to a\n * previously independent global — see inline `@see` tags for the original\n * global name. Code that previously read from those globals still works\n * because each migration writes through to both the namespace and the\n * legacy global (pointing at the same underlying object).\n */\nexport interface RemoteComponentsNamespace {\n /** @see `__remote_component_scopes__` */\n scopes: Map<string, RemoteScope>;\n /** @see `__remote_components_turbopack_chunk_loader_promise__` */\n chunkCache: Record<string, Promise<unknown>>;\n /** @see `__remote_script_entrypoint_mount__` */\n mountFns: Record<string, Set<MountOrUnmountFunction>>;\n /** @see `__remote_script_entrypoint_unmount__` */\n unmountFns: Record<string, Set<MountOrUnmountFunction>>;\n /** @see `__remote_bundle_url__` */\n bundleUrls: Record<string, string | URL>;\n /** @see `__rc_module_registry__` */\n moduleRegistry: Record<string, unknown>;\n /** @see `__webpack_require_type__` */\n dispatcherRuntime: string | undefined;\n /** @see `__remote_component_host_shared_modules__` */\n hostSharedModules: Record<string, () => Promise<unknown>>;\n /** @see `__remote_next_css__` */\n cssCache: Record<string, ChildNode[]>;\n pageComponentCache?: Record<\n string,\n {\n Component: React.ComponentType<Record<string, unknown>> | null;\n App: React.ComponentType<\n { Component: React.ComponentType<Record<string, unknown>> } & Record<\n string,\n unknown\n >\n > | null;\n }\n >;\n /** @see `__remote_components_shadowroot_*` */\n shadowRoots: Record<string, ShadowRoot | null>;\n}\n\n/** Prefix for legacy per-key shadow root globals (`__remote_components_shadowroot_*`). */\nconst SHADOW_ROOT_PREFIX = '__remote_components_shadowroot_';\n\n/**\n * Backward-compat aliases for globals used in <=0.3.3.\n *\n * Only includes object/Map values that can be aliased by reference.\n * Primitives (`dispatcherRuntime`) must use write-through at their call sites.\n * Dynamic-key shadow root globals are adopted separately in `getNamespace()`.\n */\nconst LEGACY_ALIASES: ReadonlyArray<{\n global: string;\n prop: keyof RemoteComponentsNamespace;\n}> = [\n { global: '__remote_component_scopes__', prop: 'scopes' },\n {\n global: '__remote_components_turbopack_chunk_loader_promise__',\n prop: 'chunkCache',\n },\n { global: '__remote_script_entrypoint_mount__', prop: 'mountFns' },\n { global: '__remote_script_entrypoint_unmount__', prop: 'unmountFns' },\n { global: '__remote_bundle_url__', prop: 'bundleUrls' },\n { global: '__rc_module_registry__', prop: 'moduleRegistry' },\n {\n global: '__remote_component_host_shared_modules__',\n prop: 'hostSharedModules',\n },\n { global: '__remote_next_css__', prop: 'cssCache' },\n];\n\n/**\n * Returns the single shared `RemoteComponentsNamespace` instance, creating\n * it on first access. The namespace lives at `globalThis.__remote_components__`\n * so every module in the page shares the same state regardless of how many\n * copies of the library are loaded.\n *\n * On first initialization this function also handles backward compatibility\n * with legacy globals:\n * 1. **Adopt**: if a legacy global already exists (written by older code before\n * the namespace was created), its value becomes the initial namespace value.\n * 2. **Alias**: legacy globals are assigned to point at the namespace's objects,\n * so older code that reads the legacy global sees the same reference.\n */\nexport function getNamespace(): RemoteComponentsNamespace {\n const g = globalThis as GlobalScope & MountUnmountFunctions;\n const existing = g.__remote_components__;\n if (existing) {\n return existing;\n }\n\n const ns: RemoteComponentsNamespace = {\n scopes: new Map(),\n chunkCache: {},\n mountFns: {},\n unmountFns: {},\n bundleUrls: {},\n moduleRegistry: {},\n dispatcherRuntime: undefined,\n hostSharedModules: {},\n cssCache: {},\n pageComponentCache: {},\n shadowRoots: {},\n };\n\n // Adopt any pre-existing legacy globals, then alias them to the namespace.\n const nsRecord = ns as unknown as Record<string, unknown>;\n for (const { global, prop } of LEGACY_ALIASES) {\n const legacyValue = (g as Record<string, unknown>)[global];\n if (legacyValue != null) {\n nsRecord[prop] = legacyValue;\n }\n (g as Record<string, unknown>)[global] = ns[prop];\n }\n\n // Adopt per-key shadow root globals used in <=0.3.3\n // (e.g. `globalThis.__remote_components_shadowroot_<key> = root`).\n const gRecord = g as Record<string, unknown>;\n for (const key of Object.keys(gRecord)) {\n if (key.startsWith(SHADOW_ROOT_PREFIX)) {\n const suffix = key.slice(SHADOW_ROOT_PREFIX.length);\n ns.shadowRoots[suffix] = gRecord[key] as ShadowRoot | null;\n delete gRecord[key];\n }\n }\n\n g.__remote_components__ = ns;\n return ns;\n}\n"],"mappings":";AAsDA,IAAM,qBAAqB;AAS3B,IAAM,iBAGD;AAAA,EACH,EAAE,QAAQ,+BAA+B,MAAM,SAAS;AAAA,EACxD;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,EACR;AAAA,EACA,EAAE,QAAQ,sCAAsC,MAAM,WAAW;AAAA,EACjE,EAAE,QAAQ,wCAAwC,MAAM,aAAa;AAAA,EACrE,EAAE,QAAQ,yBAAyB,MAAM,aAAa;AAAA,EACtD,EAAE,QAAQ,0BAA0B,MAAM,iBAAiB;AAAA,EAC3D;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,EACR;AAAA,EACA,EAAE,QAAQ,uBAAuB,MAAM,WAAW;AACpD;AAeO,SAAS,eAA0C;AACxD,QAAM,IAAI;AACV,QAAM,WAAW,EAAE;AACnB,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AAEA,QAAM,KAAgC;AAAA,IACpC,QAAQ,oBAAI,IAAI;AAAA,IAChB,YAAY,CAAC;AAAA,IACb,UAAU,CAAC;AAAA,IACX,YAAY,CAAC;AAAA,IACb,YAAY,CAAC;AAAA,IACb,gBAAgB,CAAC;AAAA,IACjB,mBAAmB;AAAA,IACnB,mBAAmB,CAAC;AAAA,IACpB,UAAU,CAAC;AAAA,IACX,oBAAoB,CAAC;AAAA,IACrB,aAAa,CAAC;AAAA,EAChB;AAGA,QAAM,WAAW;AACjB,aAAW,EAAE,QAAQ,KAAK,KAAK,gBAAgB;AAC7C,UAAM,cAAe,EAA8B,MAAM;AACzD,QAAI,eAAe,MAAM;AACvB,eAAS,IAAI,IAAI;AAAA,IACnB;AACA,IAAC,EAA8B,MAAM,IAAI,GAAG,IAAI;AAAA,EAClD;AAIA,QAAM,UAAU;AAChB,aAAW,OAAO,OAAO,KAAK,OAAO,GAAG;AACtC,QAAI,IAAI,WAAW,kBAAkB,GAAG;AACtC,YAAM,SAAS,IAAI,MAAM,mBAAmB,MAAM;AAClD,SAAG,YAAY,MAAM,IAAI,QAAQ,GAAG;AACpC,aAAO,QAAQ,GAAG;AAAA,IACpB;AAAA,EACF;AAEA,IAAE,wBAAwB;AAC1B,SAAO;AACT;","names":[]}
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkRLI4YTBJcjs = require('./chunk-RLI4YTBJ.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkZ2SLBFQLcjs = require('./chunk-Z2SLBFQL.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -55,13 +55,13 @@ function loadChunkWithScope(scope, chunkId) {
|
|
|
55
55
|
`loadChunkWithScope: "${chunkId}" (scope: "${scope.scopedName}")`
|
|
56
56
|
);
|
|
57
57
|
const self = globalThis;
|
|
58
|
-
const ns =
|
|
59
|
-
const { bundle, path, prefix } =
|
|
58
|
+
const ns = _chunkZ2SLBFQLcjs.getNamespace.call(void 0, );
|
|
59
|
+
const { bundle, path, prefix } = _chunkRLI4YTBJcjs.parseRemoteId.call(void 0, chunkId);
|
|
60
60
|
const remoteRuntime = _optionalChain([self, 'access', _5 => _5.__remote_webpack_require__, 'optionalAccess', _6 => _6[_nullishCoalesce(bundle, () => ( "default"))]]) ? _optionalChain([self, 'access', _7 => _7.__remote_webpack_require__, 'access', _8 => _8[_nullishCoalesce(bundle, () => ( "default"))], 'optionalAccess', _9 => _9.type]) || "webpack" : scope.runtime;
|
|
61
|
-
if (remoteRuntime ===
|
|
61
|
+
if (remoteRuntime === _chunkRLI4YTBJcjs.RUNTIME_WEBPACK) {
|
|
62
62
|
return Promise.resolve(void 0);
|
|
63
63
|
}
|
|
64
|
-
const rawPath = path ?
|
|
64
|
+
const rawPath = path ? _chunkRLI4YTBJcjs.collapseDoubleSlashes.call(void 0, `${prefix}${path}`) : "/";
|
|
65
65
|
const url = new URL(rawPath, scope.url).href;
|
|
66
66
|
if (url.endsWith(".css")) {
|
|
67
67
|
return;
|
|
@@ -95,9 +95,9 @@ function loadChunkWithScope(scope, chunkId) {
|
|
|
95
95
|
function createChunkDispatcher() {
|
|
96
96
|
return function __chunk_dispatcher__(chunkId, scriptBundle) {
|
|
97
97
|
_chunkRUWR74XQcjs.logDebug.call(void 0, "ChunkDispatcher", `Dispatching chunk: "${chunkId}"`);
|
|
98
|
-
const { bundle } =
|
|
98
|
+
const { bundle } = _chunkRLI4YTBJcjs.parseRemoteId.call(void 0, chunkId);
|
|
99
99
|
const bundleName = bundle || scriptBundle || "default";
|
|
100
|
-
const scope =
|
|
100
|
+
const scope = _chunkRLI4YTBJcjs.getScope.call(void 0, bundleName);
|
|
101
101
|
_chunkRUWR74XQcjs.logDebug.call(void 0,
|
|
102
102
|
"ChunkDispatcher",
|
|
103
103
|
`Scope resolution: bundle="${bundleName}", scope=${_nullishCoalesce(_optionalChain([scope, 'optionalAccess', _12 => _12.scopedName]), () => ( "null"))}`
|
|
@@ -207,7 +207,7 @@ async function handleTurbopackChunk(code, scope, url) {
|
|
|
207
207
|
const baseUrl = url.slice(0, url.indexOf("/_next"));
|
|
208
208
|
const chunkLoadResult = loadChunkWithScope(
|
|
209
209
|
scope,
|
|
210
|
-
|
|
210
|
+
_chunkRLI4YTBJcjs.formatRemoteId.call(void 0, scope, `${baseUrl}/_next/${id}`)
|
|
211
211
|
);
|
|
212
212
|
if (chunkLoadResult) {
|
|
213
213
|
loadChunkPromises.push(chunkLoadResult);
|
|
@@ -231,7 +231,7 @@ function requireModule(scope, moduleId, fullId) {
|
|
|
231
231
|
return handleTurbopackModule(
|
|
232
232
|
scope,
|
|
233
233
|
idStr,
|
|
234
|
-
_nullishCoalesce(fullId, () => (
|
|
234
|
+
_nullishCoalesce(fullId, () => ( _chunkRLI4YTBJcjs.formatRemoteId.call(void 0, scope, idStr)))
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
function handleTurbopackModule(scope, moduleId, id) {
|
|
@@ -301,7 +301,7 @@ function findModuleInit(modules, moduleId) {
|
|
|
301
301
|
return void 0;
|
|
302
302
|
}
|
|
303
303
|
function createTurbopackContext(scope, exports, moduleExports, modules, moduleInit, id) {
|
|
304
|
-
const scopedRequire = (moduleId) => requireModule(scope, moduleId,
|
|
304
|
+
const scopedRequire = (moduleId) => requireModule(scope, moduleId, _chunkRLI4YTBJcjs.formatRemoteId.call(void 0, scope, String(moduleId)));
|
|
305
305
|
return {
|
|
306
306
|
// HMR not implemented for Remote Components
|
|
307
307
|
k: {
|
|
@@ -430,7 +430,7 @@ function createTurbopackContext(scope, exports, moduleExports, modules, moduleIn
|
|
|
430
430
|
const nextIndex = scriptSrc.indexOf("/_next");
|
|
431
431
|
const baseUrl = nextIndex !== -1 ? scriptSrc.slice(0, nextIndex) : "";
|
|
432
432
|
const chunkUrl = `${baseUrl}/_next/${url}`;
|
|
433
|
-
return loadChunkWithScope(scope,
|
|
433
|
+
return loadChunkWithScope(scope, _chunkRLI4YTBJcjs.formatRemoteId.call(void 0, scope, chunkUrl));
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
throw new Error(
|
|
@@ -486,7 +486,7 @@ async function initializeSharedModules(scope, hostShared = {}, remoteShared = {}
|
|
|
486
486
|
const { default: sharedModuleInitializerInstance } = handleTurbopackModule(
|
|
487
487
|
scope,
|
|
488
488
|
sharedModuleId,
|
|
489
|
-
|
|
489
|
+
_chunkRLI4YTBJcjs.formatRemoteId.call(void 0, scope, String(sharedModuleInitializerId))
|
|
490
490
|
);
|
|
491
491
|
sharedModuleInitializer = sharedModuleInitializerInstance;
|
|
492
492
|
}
|
|
@@ -580,16 +580,16 @@ function getSharedModule(scope, id) {
|
|
|
580
580
|
// src/runtime/turbopack/remote-scope-setup.ts
|
|
581
581
|
async function setupRemoteScope(runtime, scripts = [], url = new URL(location.href), bundle, resolveClientUrl) {
|
|
582
582
|
const self = globalThis;
|
|
583
|
-
const ns =
|
|
583
|
+
const ns = _chunkZ2SLBFQLcjs.getNamespace.call(void 0, );
|
|
584
584
|
const bundleName = _nullishCoalesce(bundle, () => ( "default"));
|
|
585
|
-
const existingScope =
|
|
585
|
+
const existingScope = _chunkRLI4YTBJcjs.getScope.call(void 0, bundleName);
|
|
586
586
|
if (existingScope && existingScope.url.origin === url.origin) {
|
|
587
587
|
_chunkRUWR74XQcjs.logDebug.call(void 0,
|
|
588
588
|
"WebpackRuntime",
|
|
589
589
|
`Reusing scope "${existingScope.scopedName}" (turbopackModules=${existingScope.turbopackModules.length})`
|
|
590
590
|
);
|
|
591
591
|
existingScope.resolveClientUrl = resolveClientUrl;
|
|
592
|
-
if (runtime ===
|
|
592
|
+
if (runtime === _chunkRLI4YTBJcjs.RUNTIME_TURBOPACK) {
|
|
593
593
|
await Promise.allSettled(
|
|
594
594
|
scripts.map(
|
|
595
595
|
(script) => script.src ? loadChunkWithScope(existingScope, script.src) : Promise.resolve(void 0)
|
|
@@ -598,9 +598,9 @@ async function setupRemoteScope(runtime, scripts = [], url = new URL(location.hr
|
|
|
598
598
|
}
|
|
599
599
|
return existingScope;
|
|
600
600
|
}
|
|
601
|
-
const scope =
|
|
602
|
-
|
|
603
|
-
if (runtime ===
|
|
601
|
+
const scope = _chunkRLI4YTBJcjs.createScope.call(void 0, bundleName, url, runtime, resolveClientUrl);
|
|
602
|
+
_chunkRLI4YTBJcjs.registerScope.call(void 0, scope);
|
|
603
|
+
if (runtime === _chunkRLI4YTBJcjs.RUNTIME_WEBPACK && _optionalChain([self, 'access', _17 => _17.__remote_webpack_require__, 'optionalAccess', _18 => _18[bundleName]])) {
|
|
604
604
|
scope.webpackRequire = self.__remote_webpack_require__[bundleName];
|
|
605
605
|
}
|
|
606
606
|
ns.bundleUrls[bundleName] = url;
|
|
@@ -618,7 +618,7 @@ async function setupRemoteScope(runtime, scripts = [], url = new URL(location.hr
|
|
|
618
618
|
self.__webpack_require__ = createModuleDispatcher(runtime);
|
|
619
619
|
ns.dispatcherRuntime = runtime;
|
|
620
620
|
self.__webpack_require_type__ = runtime;
|
|
621
|
-
if (self.__remote_webpack_require__ && runtime ===
|
|
621
|
+
if (self.__remote_webpack_require__ && runtime === _chunkRLI4YTBJcjs.RUNTIME_TURBOPACK) {
|
|
622
622
|
self.__remote_webpack_require__[bundleName] = self.__webpack_require__;
|
|
623
623
|
self.__remote_webpack_require__[bundleName].type = "turbopack";
|
|
624
624
|
}
|
|
@@ -626,7 +626,7 @@ async function setupRemoteScope(runtime, scripts = [], url = new URL(location.hr
|
|
|
626
626
|
if (_optionalChain([self, 'access', _19 => _19.__remote_webpack_require__, 'optionalAccess', _20 => _20[bundleName]]) && scope.scopedName !== bundleName) {
|
|
627
627
|
self.__remote_webpack_require__[scope.scopedName] = self.__remote_webpack_require__[bundleName];
|
|
628
628
|
}
|
|
629
|
-
if (runtime ===
|
|
629
|
+
if (runtime === _chunkRLI4YTBJcjs.RUNTIME_TURBOPACK) {
|
|
630
630
|
const results = await Promise.allSettled(
|
|
631
631
|
scripts.map((script) => {
|
|
632
632
|
if (script.src) {
|
|
@@ -649,7 +649,7 @@ async function setupRemoteScope(runtime, scripts = [], url = new URL(location.hr
|
|
|
649
649
|
function createModuleDispatcher(runtime) {
|
|
650
650
|
return (id) => {
|
|
651
651
|
const self = globalThis;
|
|
652
|
-
const { bundle, id: moduleId } = _nullishCoalesce(_optionalChain([id, 'access', _21 => _21.match, 'call', _22 => _22(
|
|
652
|
+
const { bundle, id: moduleId } = _nullishCoalesce(_optionalChain([id, 'access', _21 => _21.match, 'call', _22 => _22(_chunkRLI4YTBJcjs.REMOTE_COMPONENT_REGEX), 'optionalAccess', _23 => _23.groups]), () => ( {
|
|
653
653
|
bundle: "default",
|
|
654
654
|
id
|
|
655
655
|
}));
|
|
@@ -660,13 +660,13 @@ function createModuleDispatcher(runtime) {
|
|
|
660
660
|
`Resolving "${id}" (bundle: "${bundleName}", runtime: "${remoteRuntime}")`
|
|
661
661
|
);
|
|
662
662
|
try {
|
|
663
|
-
if (remoteRuntime ===
|
|
664
|
-
const scope2 =
|
|
663
|
+
if (remoteRuntime === _chunkRLI4YTBJcjs.RUNTIME_WEBPACK && bundle && moduleId) {
|
|
664
|
+
const scope2 = _chunkRLI4YTBJcjs.getScope.call(void 0, bundle);
|
|
665
665
|
if (_optionalChain([scope2, 'optionalAccess', _29 => _29.webpackRequire]))
|
|
666
666
|
return scope2.webpackRequire(moduleId);
|
|
667
667
|
return _optionalChain([self, 'access', _30 => _30.__remote_webpack_require__, 'optionalAccess', _31 => _31[bundle], 'optionalCall', _32 => _32(moduleId)]);
|
|
668
668
|
}
|
|
669
|
-
const scope =
|
|
669
|
+
const scope = _chunkRLI4YTBJcjs.getScope.call(void 0, bundleName);
|
|
670
670
|
if (scope) {
|
|
671
671
|
return requireModule(scope, _nullishCoalesce(moduleId, () => ( id)), id);
|
|
672
672
|
}
|
|
@@ -706,4 +706,4 @@ function createModuleDispatcher(runtime) {
|
|
|
706
706
|
|
|
707
707
|
|
|
708
708
|
exports.initializeSharedModules = initializeSharedModules; exports.setupRemoteScope = setupRemoteScope;
|
|
709
|
-
//# sourceMappingURL=chunk-
|
|
709
|
+
//# sourceMappingURL=chunk-EYALF655.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkRLI4YTBJcjs = require('./chunk-RLI4YTBJ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkZ2SLBFQLcjs = require('./chunk-Z2SLBFQL.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -22,7 +22,7 @@ function applySharedModules(bundle, resolve) {
|
|
|
22
22
|
`Shared modules to resolve: ${Object.keys(resolve)}`
|
|
23
23
|
);
|
|
24
24
|
const self = globalThis;
|
|
25
|
-
const scope =
|
|
25
|
+
const scope = _chunkRLI4YTBJcjs.getScope.call(void 0, bundle);
|
|
26
26
|
const webpackBundle = _nullishCoalesce(_optionalChain([scope, 'optionalAccess', _ => _.webpackRequire]), () => ( _optionalChain([self, 'access', _2 => _2.__remote_webpack_require__, 'optionalAccess', _3 => _3[bundle]])));
|
|
27
27
|
if (webpackBundle) {
|
|
28
28
|
const modulePaths = Object.keys(
|
|
@@ -76,6 +76,26 @@ function applySharedModules(bundle, resolve) {
|
|
|
76
76
|
// src/config/webpack/next-client-pages-loader.ts
|
|
77
77
|
function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
78
78
|
const self = globalThis;
|
|
79
|
+
const ns = _chunkZ2SLBFQLcjs.getNamespace.call(void 0, );
|
|
80
|
+
ns.pageComponentCache ??= {};
|
|
81
|
+
const cacheKey = `${bundle}:${route}`;
|
|
82
|
+
const applyBundleCss = () => {
|
|
83
|
+
const elements = _nullishCoalesce(ns.cssCache[bundle], () => ( []));
|
|
84
|
+
if (styleContainer) {
|
|
85
|
+
for (const el of elements) {
|
|
86
|
+
styleContainer.appendChild(el.cloneNode(true));
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
for (const el of elements) {
|
|
90
|
+
document.head.appendChild(el);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const cachedEntry = ns.pageComponentCache[cacheKey];
|
|
95
|
+
if (cachedEntry) {
|
|
96
|
+
applyBundleCss();
|
|
97
|
+
return cachedEntry;
|
|
98
|
+
}
|
|
79
99
|
const nextCssOriginal = document.querySelector(
|
|
80
100
|
`[id="__next_css__DO_NOT_USE__"]:not([data-bundle="${bundle}"][data-route="${route}"])`
|
|
81
101
|
);
|
|
@@ -137,9 +157,9 @@ function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
|
137
157
|
default: null
|
|
138
158
|
})
|
|
139
159
|
]));
|
|
140
|
-
const { default: Component } = componentLoader();
|
|
141
|
-
const { default: App } = appLoader();
|
|
142
|
-
const cssCache =
|
|
160
|
+
const { default: Component = null } = componentLoader();
|
|
161
|
+
const { default: App = null } = appLoader();
|
|
162
|
+
const cssCache = ns.cssCache;
|
|
143
163
|
if (!cssCache[bundle]) {
|
|
144
164
|
const cssRE = /\.s?css$/;
|
|
145
165
|
Object.keys(_nullishCoalesce(_optionalChain([self, 'access', _36 => _36.__remote_webpack_require__, 'optionalAccess', _37 => _37[bundle], 'optionalAccess', _38 => _38.m]), () => ( {}))).filter((id) => cssRE.test(id)).forEach((id) => {
|
|
@@ -160,17 +180,7 @@ function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
|
160
180
|
}
|
|
161
181
|
cssCache[bundle] = elements;
|
|
162
182
|
}
|
|
163
|
-
|
|
164
|
-
const elements = cssCache[bundle];
|
|
165
|
-
elements.forEach((el) => {
|
|
166
|
-
styleContainer.appendChild(el.cloneNode(true));
|
|
167
|
-
});
|
|
168
|
-
} else {
|
|
169
|
-
const elements = cssCache[bundle];
|
|
170
|
-
elements.forEach((el) => {
|
|
171
|
-
document.head.appendChild(el);
|
|
172
|
-
});
|
|
173
|
-
}
|
|
183
|
+
applyBundleCss();
|
|
174
184
|
delete self.__NEXT_P;
|
|
175
185
|
self.__NEXT_P = __NEXT_P_ORIGINAL;
|
|
176
186
|
if (nextCssOriginal) {
|
|
@@ -178,7 +188,9 @@ function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
|
178
188
|
}
|
|
179
189
|
nextCss.remove();
|
|
180
190
|
nextCssEnd.remove();
|
|
181
|
-
|
|
191
|
+
const result = { Component, App };
|
|
192
|
+
ns.pageComponentCache[cacheKey] = result;
|
|
193
|
+
return result;
|
|
182
194
|
}
|
|
183
195
|
return { Component: null, App: null };
|
|
184
196
|
}
|
|
@@ -187,4 +199,4 @@ function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
|
187
199
|
|
|
188
200
|
|
|
189
201
|
exports.applySharedModules = applySharedModules; exports.nextClientPagesLoader = nextClientPagesLoader;
|
|
190
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-JJTCFQHE.cjs.map
|