remote-components 0.3.7 → 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-LCXO7BUY.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-NZAB7REE.js → chunk-5WL3FP4V.js} +5 -5
- package/dist/{chunk-SZFCBE54.js → chunk-AKOMV2UF.js} +4 -3
- package/dist/chunk-AKOMV2UF.js.map +1 -0
- package/dist/{chunk-I47KE3EC.cjs → chunk-AYC2AWUG.cjs} +21 -21
- package/dist/{chunk-RJW3EZJP.cjs → chunk-EYALF655.cjs} +23 -23
- package/dist/{chunk-T64P7BAG.cjs → chunk-JJTCFQHE.cjs} +3 -3
- package/dist/{chunk-52BJ7VFA.js → chunk-MKO52FRO.js} +2 -2
- package/dist/{chunk-QKB74MLO.js → chunk-N3KPUFOB.js} +2 -2
- package/dist/chunk-N3SQTOSE.cjs +25 -0
- package/dist/chunk-N3SQTOSE.cjs.map +1 -0
- package/dist/{chunk-GBFUPMMI.js → chunk-NN5V3FVD.js} +25 -13
- 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-X6W464D6.cjs → chunk-RLI4YTBJ.cjs} +17 -1
- package/dist/chunk-RLI4YTBJ.cjs.map +1 -0
- package/dist/{chunk-SJM7AAGU.js → chunk-SAGYPGIQ.js} +17 -1
- 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-AWWWK2ZY.cjs → chunk-Y4GMYUJT.cjs} +32 -20
- package/dist/chunk-Y4GMYUJT.cjs.map +1 -0
- package/dist/config/nextjs.cjs +6 -5
- package/dist/config/nextjs.cjs.map +1 -1
- package/dist/config/nextjs.js +3 -2
- package/dist/config/nextjs.js.map +1 -1
- package/dist/host/html.cjs +21 -20
- package/dist/host/html.cjs.map +1 -1
- package/dist/host/html.js +9 -8
- package/dist/host/html.js.map +1 -1
- package/dist/host/navigation.cjs +8 -0
- package/dist/host/navigation.cjs.map +1 -0
- package/dist/host/navigation.d.ts +30 -0
- package/dist/host/navigation.js +8 -0
- package/dist/host/navigation.js.map +1 -0
- package/dist/host/nextjs/app/client-only.cjs +14 -12
- 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 +9 -7
- package/dist/host/nextjs/app/client-only.js.map +1 -1
- package/dist/host/react.cjs +12 -8
- package/dist/host/react.d.ts +2 -1
- package/dist/host/react.js +13 -9
- package/dist/{index-4c65355c.d.ts → index-d2ce8a3f.d.ts} +22 -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/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/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/navigate-event-baee0b63.d.ts +14 -0
- package/dist/{turbopack-5LW6V6IT.js → turbopack-DK6L7P3J.js} +5 -4
- package/dist/{turbopack-5LW6V6IT.js.map → turbopack-DK6L7P3J.js.map} +1 -1
- package/dist/{turbopack-KRKECGY2.cjs → turbopack-PSD4THQE.cjs} +12 -11
- package/dist/turbopack-PSD4THQE.cjs.map +1 -0
- package/dist/{webpack-NPZNXRNL.js → webpack-KSDNIXMS.js} +5 -4
- package/dist/{webpack-NPZNXRNL.js.map → webpack-KSDNIXMS.js.map} +1 -1
- package/dist/{webpack-TTZDARNY.cjs → webpack-SIFRCBIN.cjs} +12 -11
- package/dist/webpack-SIFRCBIN.cjs.map +1 -0
- package/package.json +9 -1
- package/dist/chunk-AWWWK2ZY.cjs.map +0 -1
- package/dist/chunk-GBFUPMMI.js.map +0 -1
- package/dist/chunk-LCXO7BUY.cjs.map +0 -1
- package/dist/chunk-SJM7AAGU.js.map +0 -1
- package/dist/chunk-SZFCBE54.js.map +0 -1
- package/dist/chunk-X6W464D6.cjs.map +0 -1
- package/dist/turbopack-KRKECGY2.cjs.map +0 -1
- package/dist/webpack-TTZDARNY.cjs.map +0 -1
- /package/dist/{chunk-NZAB7REE.js.map → chunk-5WL3FP4V.js.map} +0 -0
- /package/dist/{chunk-I47KE3EC.cjs.map → chunk-AYC2AWUG.cjs.map} +0 -0
- /package/dist/{chunk-RJW3EZJP.cjs.map → chunk-EYALF655.cjs.map} +0 -0
- /package/dist/{chunk-T64P7BAG.cjs.map → chunk-JJTCFQHE.cjs.map} +0 -0
- /package/dist/{chunk-52BJ7VFA.js.map → chunk-MKO52FRO.js.map} +0 -0
- /package/dist/{chunk-QKB74MLO.js.map → chunk-N3KPUFOB.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,14 +1,14 @@
|
|
|
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
14
|
} from "./chunk-LQ7VQ74E.js";
|
|
@@ -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,14 +1,14 @@
|
|
|
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
14
|
var _chunkTZT7DLO5cjs = require('./chunk-TZT7DLO5.cjs');
|
|
@@ -23,7 +23,7 @@ var _chunkTZT7DLO5cjs = require('./chunk-TZT7DLO5.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
|
}
|
|
@@ -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
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkRLI4YTBJcjs = require('./chunk-RLI4YTBJ.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _chunkZ2SLBFQLcjs = require('./chunk-Z2SLBFQL.cjs');
|
|
@@ -56,12 +56,12 @@ function loadChunkWithScope(scope, chunkId) {
|
|
|
56
56
|
);
|
|
57
57
|
const self = globalThis;
|
|
58
58
|
const ns = _chunkZ2SLBFQLcjs.getNamespace.call(void 0, );
|
|
59
|
-
const { bundle, path, prefix } =
|
|
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
|
}
|
|
@@ -582,14 +582,14 @@ async function setupRemoteScope(runtime, scripts = [], url = new URL(location.hr
|
|
|
582
582
|
const self = globalThis;
|
|
583
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,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
|
var _chunkZ2SLBFQLcjs = require('./chunk-Z2SLBFQL.cjs');
|
|
@@ -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(
|
|
@@ -199,4 +199,4 @@ function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
exports.applySharedModules = applySharedModules; exports.nextClientPagesLoader = nextClientPagesLoader;
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-JJTCFQHE.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getScope
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SAGYPGIQ.js";
|
|
4
4
|
import {
|
|
5
5
|
getNamespace
|
|
6
6
|
} from "./chunk-D5GNZB6O.js";
|
|
@@ -199,4 +199,4 @@ export {
|
|
|
199
199
|
applySharedModules,
|
|
200
200
|
nextClientPagesLoader
|
|
201
201
|
};
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# sourceMappingURL=chunk-MKO52FRO.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getScope,
|
|
9
9
|
parseRemoteId,
|
|
10
10
|
registerScope
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SAGYPGIQ.js";
|
|
12
12
|
import {
|
|
13
13
|
getNamespace
|
|
14
14
|
} from "./chunk-D5GNZB6O.js";
|
|
@@ -706,4 +706,4 @@ export {
|
|
|
706
706
|
initializeSharedModules,
|
|
707
707
|
setupRemoteScope
|
|
708
708
|
};
|
|
709
|
-
//# sourceMappingURL=chunk-
|
|
709
|
+
//# sourceMappingURL=chunk-N3KPUFOB.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk5KTAEO52cjs = require('./chunk-5KTAEO52.cjs');
|
|
5
|
+
|
|
6
|
+
// src/host/navigation/index.ts
|
|
7
|
+
function onRemoteNavigate(callback) {
|
|
8
|
+
if (typeof window === "undefined") {
|
|
9
|
+
return () => {
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const handler = (event) => {
|
|
13
|
+
const detail = event.detail;
|
|
14
|
+
callback(_chunk5KTAEO52cjs.parseRemoteNavigateDetail.call(void 0, detail));
|
|
15
|
+
};
|
|
16
|
+
window.addEventListener(_chunk5KTAEO52cjs.REMOTE_NAVIGATE_EVENT, handler);
|
|
17
|
+
return () => {
|
|
18
|
+
window.removeEventListener(_chunk5KTAEO52cjs.REMOTE_NAVIGATE_EVENT, handler);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
exports.onRemoteNavigate = onRemoteNavigate;
|
|
25
|
+
//# sourceMappingURL=chunk-N3SQTOSE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/host/navigation/index.ts"],"names":[],"mappings":";;;;;;AAkCO,SAAS,iBACd,UACY;AACZ,MAAI,OAAO,WAAW,aAAa;AACjC,WAAO,MAAM;AAAA,IAAC;AAAA,EAChB;AACA,QAAM,UAAU,CAAC,UAAiB;AAChC,UAAM,SAAU,MAA4C;AAC5D,aAAS,0BAA0B,MAAM,CAAC;AAAA,EAC5C;AACA,SAAO,iBAAiB,uBAAuB,OAAO;AACtD,SAAO,MAAM;AACX,WAAO,oBAAoB,uBAAuB,OAAO;AAAA,EAC3D;AACF","sourcesContent":["import {\n parseRemoteNavigateDetail,\n REMOTE_NAVIGATE_EVENT,\n type RemoteNavigateDetail,\n type RemoteNavigateEvent,\n} from '#internal/host/shared/navigate-event';\n\nexport type { RemoteNavigateEvent } from '#internal/host/shared/navigate-event';\n\n/**\n * Subscribe to navigation requests from remote components. One subscription\n * handles every `<ConsumeRemoteComponent>` on the page. SSR-safe: no-op when\n * `window` is undefined.\n *\n * In React, prefer `useRemoteNavigate` from `remote-components/host/react` —\n * it avoids re-registering the listener on every render.\n *\n * @example React Router\n * ```ts\n * useEffect(\n * () =>\n * onRemoteNavigate((e) =>\n * navigate(e.pathname + e.search, { replace: e.type === 'replace' }),\n * ),\n * [navigate],\n * );\n * ```\n *\n * @example Plain HTML\n * ```ts\n * // Always replace — the polyfill already pushed/replaced the browser history entry.\n * onRemoteNavigate((e) => window.location.replace(e.url));\n * ```\n */\nexport function onRemoteNavigate(\n callback: (event: RemoteNavigateEvent) => void,\n): () => void {\n if (typeof window === 'undefined') {\n return () => {};\n }\n const handler = (event: Event) => {\n const detail = (event as CustomEvent<RemoteNavigateDetail>).detail;\n callback(parseRemoteNavigateDetail(detail));\n };\n window.addEventListener(REMOTE_NAVIGATE_EVENT, handler);\n return () => {\n window.removeEventListener(REMOTE_NAVIGATE_EVENT, handler);\n };\n}\n"]}
|
|
@@ -7,10 +7,13 @@ import {
|
|
|
7
7
|
makeReactEmitter,
|
|
8
8
|
preparePipeline,
|
|
9
9
|
resolveNameFromSrc
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5WL3FP4V.js";
|
|
11
11
|
import {
|
|
12
12
|
loadStaticRemoteComponent
|
|
13
13
|
} from "./chunk-LQ7VQ74E.js";
|
|
14
|
+
import {
|
|
15
|
+
onRemoteNavigate
|
|
16
|
+
} from "./chunk-RHGEBXPL.js";
|
|
14
17
|
import {
|
|
15
18
|
DEFAULT_COMPONENT_NAME,
|
|
16
19
|
DEFAULT_ROUTE,
|
|
@@ -18,7 +21,7 @@ import {
|
|
|
18
21
|
RUNTIME_WEBPACK,
|
|
19
22
|
attrToProp,
|
|
20
23
|
escapeString
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-SAGYPGIQ.js";
|
|
22
25
|
import {
|
|
23
26
|
getNamespace
|
|
24
27
|
} from "./chunk-D5GNZB6O.js";
|
|
@@ -31,11 +34,11 @@ import {
|
|
|
31
34
|
// src/host/react/index.tsx
|
|
32
35
|
import {
|
|
33
36
|
startTransition,
|
|
34
|
-
useEffect,
|
|
37
|
+
useEffect as useEffect2,
|
|
35
38
|
useId,
|
|
36
39
|
useLayoutEffect as useLayoutEffect2,
|
|
37
40
|
useMemo as useMemo2,
|
|
38
|
-
useRef as
|
|
41
|
+
useRef as useRef3,
|
|
39
42
|
useState as useState2
|
|
40
43
|
} from "react";
|
|
41
44
|
import { createPortal } from "react-dom";
|
|
@@ -159,6 +162,14 @@ function getRemoteComponentHtml(html) {
|
|
|
159
162
|
return "";
|
|
160
163
|
}
|
|
161
164
|
|
|
165
|
+
// src/host/react/hooks/use-remote-navigate.ts
|
|
166
|
+
import { useEffect, useRef as useRef2 } from "react";
|
|
167
|
+
function useRemoteNavigate(callback) {
|
|
168
|
+
const callbackRef = useRef2(callback);
|
|
169
|
+
callbackRef.current = callback;
|
|
170
|
+
useEffect(() => onRemoteNavigate((event) => callbackRef.current(event)), []);
|
|
171
|
+
}
|
|
172
|
+
|
|
162
173
|
// src/host/react/index.tsx
|
|
163
174
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
164
175
|
import { createElement } from "react";
|
|
@@ -206,13 +217,13 @@ function ConsumeRemoteComponent({
|
|
|
206
217
|
mode,
|
|
207
218
|
keySuffix
|
|
208
219
|
});
|
|
209
|
-
const htmlRef =
|
|
220
|
+
const htmlRef = useRef3(
|
|
210
221
|
typeof document !== "undefined" ? document.querySelector(
|
|
211
222
|
`[data-remote-component-id="shadowroot_${keySuffix}"]`
|
|
212
223
|
)?.shadowRoot?.innerHTML ?? document.getElementById(`__REMOTE_COMPONENT${name}`)?.innerHTML ?? document.querySelector(`div[data-bundle][data-route][id^="${name}"]`)?.innerHTML ?? document.querySelector("div[data-bundle][data-route]")?.innerHTML : null
|
|
213
224
|
);
|
|
214
|
-
const endTemplateRef =
|
|
215
|
-
const childrenRef =
|
|
225
|
+
const endTemplateRef = useRef3(null);
|
|
226
|
+
const childrenRef = useRef3(
|
|
216
227
|
typeof document !== "undefined" ? (() => {
|
|
217
228
|
let el = document.querySelector(`template[id="${name}_start"]`);
|
|
218
229
|
const elements = [];
|
|
@@ -225,10 +236,10 @@ function ConsumeRemoteComponent({
|
|
|
225
236
|
return elements;
|
|
226
237
|
})() : []
|
|
227
238
|
);
|
|
228
|
-
const hostStateRef =
|
|
229
|
-
const componentHydrationHtml =
|
|
230
|
-
const prevRemoteComponentContainerRef =
|
|
231
|
-
const unmountRef =
|
|
239
|
+
const hostStateRef = useRef3(createHostState());
|
|
240
|
+
const componentHydrationHtml = useRef3(null);
|
|
241
|
+
const prevRemoteComponentContainerRef = useRef3(null);
|
|
242
|
+
const unmountRef = useRef3(null);
|
|
232
243
|
useLayoutEffect2(() => {
|
|
233
244
|
return () => {
|
|
234
245
|
delete getNamespace().shadowRoots[keySuffix];
|
|
@@ -265,7 +276,7 @@ function ConsumeRemoteComponent({
|
|
|
265
276
|
}
|
|
266
277
|
}
|
|
267
278
|
}, [shadowRoot, remoteComponent, name]);
|
|
268
|
-
|
|
279
|
+
useEffect2(() => {
|
|
269
280
|
if (src && src !== hostStateRef.current.prevSrc) {
|
|
270
281
|
const previousSrc = hostStateRef.current.prevSrc;
|
|
271
282
|
const previousName = hostStateRef.current.prevName;
|
|
@@ -665,6 +676,7 @@ function ConsumeRemoteComponent({
|
|
|
665
676
|
}
|
|
666
677
|
|
|
667
678
|
export {
|
|
679
|
+
useRemoteNavigate,
|
|
668
680
|
ConsumeRemoteComponent
|
|
669
681
|
};
|
|
670
|
-
//# sourceMappingURL=chunk-
|
|
682
|
+
//# sourceMappingURL=chunk-NN5V3FVD.js.map
|