remote-components 0.3.6 → 0.3.7
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-2VQGCACH.js → chunk-52BJ7VFA.js} +30 -18
- package/dist/chunk-52BJ7VFA.js.map +1 -0
- package/dist/{chunk-KKBEMQU7.cjs → chunk-AWWWK2ZY.cjs} +28 -28
- package/dist/{chunk-KEPHL25S.js → chunk-D5GNZB6O.js} +2 -1
- package/dist/chunk-D5GNZB6O.js.map +1 -0
- package/dist/{chunk-W5ESPGHH.js → chunk-GBFUPMMI.js} +5 -5
- package/dist/{chunk-ER73O65F.cjs → chunk-I47KE3EC.cjs} +23 -23
- package/dist/{chunk-6IUP26UK.cjs → chunk-LCXO7BUY.cjs} +3 -3
- package/dist/{chunk-OO4AMJWO.js → chunk-LQ7VQ74E.js} +2 -2
- package/dist/{chunk-42N2ZLE2.js → chunk-NZAB7REE.js} +6 -6
- package/dist/{chunk-KYJWRZ2B.js → chunk-QKB74MLO.js} +3 -3
- package/dist/{chunk-F44NODUS.cjs → chunk-RJW3EZJP.cjs} +26 -26
- package/dist/{chunk-HNZVEIKN.js → chunk-SJM7AAGU.js} +2 -2
- package/dist/{chunk-ZPMTZ3KJ.js → chunk-SZFCBE54.js} +2 -2
- package/dist/{chunk-XCFYWSLD.cjs → chunk-T64P7BAG.cjs} +31 -19
- package/dist/chunk-T64P7BAG.cjs.map +1 -0
- package/dist/{chunk-CREXMFMF.cjs → chunk-TZT7DLO5.cjs} +4 -4
- package/dist/{chunk-R4QFK5TN.cjs → chunk-X6W464D6.cjs} +4 -4
- package/dist/{chunk-7MVFHOIP.cjs → chunk-Z2SLBFQL.cjs} +2 -1
- package/dist/chunk-Z2SLBFQL.cjs.map +1 -0
- package/dist/config/nextjs.cjs +5 -11
- package/dist/config/nextjs.cjs.map +1 -1
- package/dist/config/nextjs.js +2 -8
- package/dist/config/nextjs.js.map +1 -1
- package/dist/host/html.cjs +27 -27
- package/dist/host/html.js +10 -10
- package/dist/host/nextjs/app/client-only.cjs +13 -13
- package/dist/host/nextjs/app/client-only.js +8 -8
- package/dist/host/react.cjs +9 -9
- package/dist/host/react.js +8 -8
- 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/pipeline.d.ts +2 -2
- package/dist/internal/runtime/loaders/component-loader.d.ts +2 -2
- 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/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-UDIXK5MV.cjs +11 -0
- package/dist/{turbopack-NPGO3MWS.js → turbopack-5LW6V6IT.js} +5 -5
- package/dist/{turbopack-WRMKPNN4.cjs → turbopack-KRKECGY2.cjs} +12 -12
- package/dist/{types-59251814.d.ts → types-8b0edd78.d.ts} +7 -0
- package/dist/{webpack-DUBHPYD6.js → webpack-NPZNXRNL.js} +5 -5
- package/dist/{webpack-KSCMCL7M.cjs → webpack-TTZDARNY.cjs} +12 -12
- package/package.json +1 -1
- package/dist/chunk-2VQGCACH.js.map +0 -1
- package/dist/chunk-7MVFHOIP.cjs.map +0 -1
- package/dist/chunk-KEPHL25S.js.map +0 -1
- package/dist/chunk-XCFYWSLD.cjs.map +0 -1
- package/dist/static-loader-ZYD5BO4D.cjs +0 -11
- /package/dist/{chunk-KKBEMQU7.cjs.map → chunk-AWWWK2ZY.cjs.map} +0 -0
- /package/dist/{chunk-W5ESPGHH.js.map → chunk-GBFUPMMI.js.map} +0 -0
- /package/dist/{chunk-ER73O65F.cjs.map → chunk-I47KE3EC.cjs.map} +0 -0
- /package/dist/{chunk-6IUP26UK.cjs.map → chunk-LCXO7BUY.cjs.map} +0 -0
- /package/dist/{chunk-OO4AMJWO.js.map → chunk-LQ7VQ74E.js.map} +0 -0
- /package/dist/{chunk-42N2ZLE2.js.map → chunk-NZAB7REE.js.map} +0 -0
- /package/dist/{chunk-KYJWRZ2B.js.map → chunk-QKB74MLO.js.map} +0 -0
- /package/dist/{chunk-F44NODUS.cjs.map → chunk-RJW3EZJP.cjs.map} +0 -0
- /package/dist/{chunk-HNZVEIKN.js.map → chunk-SJM7AAGU.js.map} +0 -0
- /package/dist/{chunk-ZPMTZ3KJ.js.map → chunk-SZFCBE54.js.map} +0 -0
- /package/dist/{chunk-CREXMFMF.cjs.map → chunk-TZT7DLO5.cjs.map} +0 -0
- /package/dist/{chunk-R4QFK5TN.cjs.map → chunk-X6W464D6.cjs.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
- /package/dist/{static-loader-X4TSF5KW.js.map → static-loader-OHSAUD62.js.map} +0 -0
- /package/dist/{static-loader-ZYD5BO4D.cjs.map → static-loader-UDIXK5MV.cjs.map} +0 -0
- /package/dist/{turbopack-NPGO3MWS.js.map → turbopack-5LW6V6IT.js.map} +0 -0
- /package/dist/{turbopack-WRMKPNN4.cjs.map → turbopack-KRKECGY2.cjs.map} +0 -0
- /package/dist/{webpack-DUBHPYD6.js.map → webpack-NPZNXRNL.js.map} +0 -0
- /package/dist/{webpack-KSCMCL7M.cjs.map → webpack-TTZDARNY.cjs.map} +0 -0
|
@@ -2,6 +2,26 @@ import { getNamespace } from "#internal/runtime/namespace";
|
|
|
2
2
|
import { RemoteComponentsError } from "#internal/utils/error";
|
|
3
3
|
function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
4
4
|
const self = globalThis;
|
|
5
|
+
const ns = getNamespace();
|
|
6
|
+
ns.pageComponentCache ??= {};
|
|
7
|
+
const cacheKey = `${bundle}:${route}`;
|
|
8
|
+
const applyBundleCss = () => {
|
|
9
|
+
const elements = ns.cssCache[bundle] ?? [];
|
|
10
|
+
if (styleContainer) {
|
|
11
|
+
for (const el of elements) {
|
|
12
|
+
styleContainer.appendChild(el.cloneNode(true));
|
|
13
|
+
}
|
|
14
|
+
} else {
|
|
15
|
+
for (const el of elements) {
|
|
16
|
+
document.head.appendChild(el);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const cachedEntry = ns.pageComponentCache[cacheKey];
|
|
21
|
+
if (cachedEntry) {
|
|
22
|
+
applyBundleCss();
|
|
23
|
+
return cachedEntry;
|
|
24
|
+
}
|
|
5
25
|
const nextCssOriginal = document.querySelector(
|
|
6
26
|
`[id="__next_css__DO_NOT_USE__"]:not([data-bundle="${bundle}"][data-route="${route}"])`
|
|
7
27
|
);
|
|
@@ -63,9 +83,9 @@ function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
|
63
83
|
default: null
|
|
64
84
|
})
|
|
65
85
|
];
|
|
66
|
-
const { default: Component } = componentLoader();
|
|
67
|
-
const { default: App } = appLoader();
|
|
68
|
-
const cssCache =
|
|
86
|
+
const { default: Component = null } = componentLoader();
|
|
87
|
+
const { default: App = null } = appLoader();
|
|
88
|
+
const cssCache = ns.cssCache;
|
|
69
89
|
if (!cssCache[bundle]) {
|
|
70
90
|
const cssRE = /\.s?css$/;
|
|
71
91
|
Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).filter((id) => cssRE.test(id)).forEach((id) => {
|
|
@@ -86,17 +106,7 @@ function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
|
86
106
|
}
|
|
87
107
|
cssCache[bundle] = elements;
|
|
88
108
|
}
|
|
89
|
-
|
|
90
|
-
const elements = cssCache[bundle];
|
|
91
|
-
elements.forEach((el) => {
|
|
92
|
-
styleContainer.appendChild(el.cloneNode(true));
|
|
93
|
-
});
|
|
94
|
-
} else {
|
|
95
|
-
const elements = cssCache[bundle];
|
|
96
|
-
elements.forEach((el) => {
|
|
97
|
-
document.head.appendChild(el);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
109
|
+
applyBundleCss();
|
|
100
110
|
delete self.__NEXT_P;
|
|
101
111
|
self.__NEXT_P = __NEXT_P_ORIGINAL;
|
|
102
112
|
if (nextCssOriginal) {
|
|
@@ -104,7 +114,9 @@ function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
|
104
114
|
}
|
|
105
115
|
nextCss.remove();
|
|
106
116
|
nextCssEnd.remove();
|
|
107
|
-
|
|
117
|
+
const result = { Component, App };
|
|
118
|
+
ns.pageComponentCache[cacheKey] = result;
|
|
119
|
+
return result;
|
|
108
120
|
}
|
|
109
121
|
return { Component: null, App: null };
|
|
110
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/config/webpack/next-client-pages-loader.ts"],"sourcesContent":["import { getNamespace } from '#internal/runtime/namespace';\nimport { RemoteComponentsError } from '#internal/utils/error';\n\n// module loader for Next.js Pages Router\nexport function nextClientPagesLoader(\n bundle: string,\n route: string,\n styleContainer: HTMLHeadElement | ShadowRoot | null = document.head,\n) {\n // make a typed reference to the global scope\n const self = globalThis as typeof globalThis & {\n // webpack remote module loading function scoped for each bundle\n __remote_webpack_require__?: Record<\n string,\n ((remoteId: string | number) => unknown) & {\n c?: Record<\n string | number,\n { id: string; parents: string[]; children: string[] }\n >;\n m?: Record<string | number, (module: { exports: unknown }) => void>;\n type?: 'turbopack' | 'webpack';\n }\n >;\n // webpack module map for each bundle used in production builds\n __remote_webpack_module_map__?: Record<string, Record<string, number>>;\n // Next.js client pages loader reference storage\n __NEXT_P?: [\n (\n | [\n string,\n () => { default?: React.ComponentType<Record<string, unknown>> },\n ]\n | undefined\n ),\n (\n | [\n string,\n () => {\n default?: React.ComponentType<\n {\n Component: React.ComponentType<Record<string, unknown>>;\n } & Record<string, unknown>\n >;\n },\n ]\n | undefined\n ),\n (\n | [\n string,\n () => {\n default?: React.ComponentType<\n {\n Component: React.ComponentType<Record<string, unknown>>;\n } & Record<string, unknown>\n >;\n },\n ]\n | undefined\n ),\n ];\n };\n\n // temporarily remove the original Next.js CSS loader\n const nextCssOriginal = document.querySelector(\n `[id=\"__next_css__DO_NOT_USE__\"]:not([data-bundle=\"${bundle}\"][data-route=\"${route}\"])`,\n );\n if (nextCssOriginal) {\n nextCssOriginal.parentNode?.removeChild(nextCssOriginal);\n }\n\n // create a new Next.js CSS loader element\n const nextCss = document.createElement('noscript');\n nextCss.id = '__next_css__DO_NOT_USE__';\n nextCss.setAttribute('data-bundle', bundle);\n nextCss.setAttribute('data-route', route);\n const nextCssEnd = document.createElement('noscript');\n nextCssEnd.id = '__next_css__DO_NOT_USE_END__';\n nextCssEnd.setAttribute('data-bundle', bundle);\n nextCssEnd.setAttribute('data-route', route);\n document.head.appendChild(nextCssEnd);\n document.head.appendChild(nextCss);\n\n // find the page component loader chunk\n const componentLoaderChunk =\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=${encodeURIComponent(route)}!`),\n ) ??\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n self.__remote_webpack_module_map__?.[bundle]?.[\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=${encodeURIComponent(route)}!`),\n ) ??\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n ''\n ] ??\n -1;\n\n // find the app loader chunk\n const appLoaderChunk =\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=%2F_app`),\n ) ??\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n self.__remote_webpack_module_map__?.[bundle]?.[\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=%2F_app`),\n ) ??\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n ''\n ] ??\n -1;\n\n // if we didn't find the component loader or app loader, throw an error\n if (!(componentLoaderChunk && appLoaderChunk)) {\n throw new RemoteComponentsError(\n `Next.js client pages loader not found in bundle \"${bundle}\".`,\n );\n }\n\n // temporarily store the original __NEXT_P reference\n // this is required to avoid conflicts with the Next.js client pages loader\n // which uses the same global variable to store the page components\n const __NEXT_P_ORIGINAL = self.__NEXT_P;\n const selfOriginal = self;\n delete selfOriginal.__NEXT_P;\n\n // load the component and app loader chunks\n self.__remote_webpack_require__?.[bundle]?.(\n self.__remote_webpack_require__[bundle].type !== 'turbopack'\n ? componentLoaderChunk\n : `[${bundle}] ${componentLoaderChunk}`,\n );\n if (\n typeof appLoaderChunk === 'string' ||\n (typeof appLoaderChunk === 'number' && appLoaderChunk !== -1)\n ) {\n self.__remote_webpack_require__?.[bundle]?.(\n self.__remote_webpack_require__[bundle].type !== 'turbopack'\n ? appLoaderChunk\n : `[${bundle}] ${appLoaderChunk}`,\n );\n }\n\n // if we have the __NEXT_P global variable, we can extract the component and app\n if (self.__NEXT_P) {\n const [, componentLoader] = self.__NEXT_P[0] ?? [\n undefined,\n () => ({ default: null }),\n ];\n const [, appLoader] = self.__NEXT_P[2] ?? [\n undefined,\n () => ({\n default: null,\n }),\n ];\n const { default: Component } = componentLoader();\n const { default: App } = appLoader();\n\n const cssCache = getNamespace().cssCache;\n\n if (!cssCache[bundle]) {\n // load the CSS files from the remote bundle\n const cssRE = /\\.s?css$/;\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {})\n .filter((id) => cssRE.test(id))\n .forEach((id) => {\n self.__remote_webpack_require__?.[bundle]?.(id);\n });\n\n Object.keys(self.__remote_webpack_module_map__?.[bundle] ?? {})\n .filter((path) => cssRE.test(path))\n .forEach((path) => {\n const id = self.__remote_webpack_module_map__?.[bundle]?.[path];\n if (id) {\n self.__remote_webpack_require__?.[bundle]?.(id);\n }\n });\n\n const elements = [];\n let node = nextCss.previousSibling;\n while (node && node !== nextCssEnd) {\n elements.push(node);\n node.remove();\n node = nextCss.previousSibling;\n }\n cssCache[bundle] = elements;\n }\n\n // if the styleContainer is provided, we need to move the styles to it\n if (styleContainer) {\n const elements = cssCache[bundle];\n elements.forEach((el) => {\n styleContainer.appendChild(el.cloneNode(true));\n });\n } else {\n // if no styleContainer is provided, we need to move the styles back to the head\n const elements = cssCache[bundle];\n elements.forEach((el) => {\n document.head.appendChild(el);\n });\n }\n\n // restore the original __NEXT_P reference\n delete self.__NEXT_P;\n self.__NEXT_P = __NEXT_P_ORIGINAL;\n\n // restore the original Next.js CSS loader\n if (nextCssOriginal) {\n nextCssOriginal.parentNode?.appendChild(nextCssOriginal);\n }\n\n nextCss.remove();\n nextCssEnd.remove();\n\n return { Component, App };\n }\n\n return { Component: null, App: null };\n}\n"],"mappings":"AAAA,SAA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AAAA,IACzD;AAEA,YAAQ,OAAO;AACf,eAAW,OAAO;AAElB,WAAO,EAAE,WAAW,IAAI;AAAA,EAC1B;AAEA,SAAO,EAAE,WAAW,MAAM,KAAK,KAAK;AACtC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/config/webpack/next-client-pages-loader.ts"],"sourcesContent":["import { getNamespace } from '#internal/runtime/namespace';\nimport { RemoteComponentsError } from '#internal/utils/error';\n\n// module loader for Next.js Pages Router\nexport function nextClientPagesLoader(\n bundle: string,\n route: string,\n styleContainer: HTMLHeadElement | ShadowRoot | null = document.head,\n) {\n // make a typed reference to the global scope\n const self = globalThis as typeof globalThis & {\n // webpack remote module loading function scoped for each bundle\n __remote_webpack_require__?: Record<\n string,\n ((remoteId: string | number) => unknown) & {\n c?: Record<\n string | number,\n { id: string; parents: string[]; children: string[] }\n >;\n m?: Record<string | number, (module: { exports: unknown }) => void>;\n type?: 'turbopack' | 'webpack';\n }\n >;\n // webpack module map for each bundle used in production builds\n __remote_webpack_module_map__?: Record<string, Record<string, number>>;\n // Next.js client pages loader reference storage\n __NEXT_P?: [\n (\n | [\n string,\n () => { default?: React.ComponentType<Record<string, unknown>> },\n ]\n | undefined\n ),\n (\n | [\n string,\n () => {\n default?: React.ComponentType<\n {\n Component: React.ComponentType<Record<string, unknown>>;\n } & Record<string, unknown>\n >;\n },\n ]\n | undefined\n ),\n (\n | [\n string,\n () => {\n default?: React.ComponentType<\n {\n Component: React.ComponentType<Record<string, unknown>>;\n } & Record<string, unknown>\n >;\n },\n ]\n | undefined\n ),\n ];\n };\n\n const ns = getNamespace();\n ns.pageComponentCache ??= {};\n const cacheKey = `${bundle}:${route}`;\n\n // Applies the cached CSS for `bundle` into the caller's styleContainer.\n // Mirrors the final CSS-attach step of the fresh-load path so that cache\n // hits and additional host instances (each with their own shadow root)\n // still receive the styles.\n const applyBundleCss = () => {\n const elements = ns.cssCache[bundle] ?? [];\n if (styleContainer) {\n for (const el of elements) {\n styleContainer.appendChild(el.cloneNode(true));\n }\n } else {\n for (const el of elements) {\n document.head.appendChild(el);\n }\n }\n };\n\n // On repeat loads (e.g. after history.back()) the next-client-pages-loader\n // chunk is already cached by webpack and its factory won't re-run, so\n // __NEXT_P wouldn't be populated. Reuse the Component/App extracted on the\n // first load, but still run the CSS attach below because the caller may be\n // a different host instance with its own styleContainer.\n const cachedEntry = ns.pageComponentCache[cacheKey];\n if (cachedEntry) {\n applyBundleCss();\n return cachedEntry;\n }\n\n // temporarily remove the original Next.js CSS loader\n const nextCssOriginal = document.querySelector(\n `[id=\"__next_css__DO_NOT_USE__\"]:not([data-bundle=\"${bundle}\"][data-route=\"${route}\"])`,\n );\n if (nextCssOriginal) {\n nextCssOriginal.parentNode?.removeChild(nextCssOriginal);\n }\n\n // create a new Next.js CSS loader element\n const nextCss = document.createElement('noscript');\n nextCss.id = '__next_css__DO_NOT_USE__';\n nextCss.setAttribute('data-bundle', bundle);\n nextCss.setAttribute('data-route', route);\n const nextCssEnd = document.createElement('noscript');\n nextCssEnd.id = '__next_css__DO_NOT_USE_END__';\n nextCssEnd.setAttribute('data-bundle', bundle);\n nextCssEnd.setAttribute('data-route', route);\n document.head.appendChild(nextCssEnd);\n document.head.appendChild(nextCss);\n\n // find the page component loader chunk\n const componentLoaderChunk =\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=${encodeURIComponent(route)}!`),\n ) ??\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n self.__remote_webpack_module_map__?.[bundle]?.[\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=${encodeURIComponent(route)}!`),\n ) ??\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n ''\n ] ??\n -1;\n\n // find the app loader chunk\n const appLoaderChunk =\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=%2F_app`),\n ) ??\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n self.__remote_webpack_module_map__?.[bundle]?.[\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=%2F_app`),\n ) ??\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n ''\n ] ??\n -1;\n\n // if we didn't find the component loader or app loader, throw an error\n if (!(componentLoaderChunk && appLoaderChunk)) {\n throw new RemoteComponentsError(\n `Next.js client pages loader not found in bundle \"${bundle}\".`,\n );\n }\n\n // temporarily store the original __NEXT_P reference\n // this is required to avoid conflicts with the Next.js client pages loader\n // which uses the same global variable to store the page components\n const __NEXT_P_ORIGINAL = self.__NEXT_P;\n const selfOriginal = self;\n delete selfOriginal.__NEXT_P;\n\n // load the component and app loader chunks\n self.__remote_webpack_require__?.[bundle]?.(\n self.__remote_webpack_require__[bundle].type !== 'turbopack'\n ? componentLoaderChunk\n : `[${bundle}] ${componentLoaderChunk}`,\n );\n if (\n typeof appLoaderChunk === 'string' ||\n (typeof appLoaderChunk === 'number' && appLoaderChunk !== -1)\n ) {\n self.__remote_webpack_require__?.[bundle]?.(\n self.__remote_webpack_require__[bundle].type !== 'turbopack'\n ? appLoaderChunk\n : `[${bundle}] ${appLoaderChunk}`,\n );\n }\n\n // if we have the __NEXT_P global variable, we can extract the component and app\n if (self.__NEXT_P) {\n const [, componentLoader] = self.__NEXT_P[0] ?? [\n undefined,\n () => ({ default: null }),\n ];\n const [, appLoader] = self.__NEXT_P[2] ?? [\n undefined,\n () => ({\n default: null,\n }),\n ];\n const { default: Component = null } = componentLoader();\n const { default: App = null } = appLoader();\n\n const cssCache = ns.cssCache;\n\n if (!cssCache[bundle]) {\n // load the CSS files from the remote bundle\n const cssRE = /\\.s?css$/;\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {})\n .filter((id) => cssRE.test(id))\n .forEach((id) => {\n self.__remote_webpack_require__?.[bundle]?.(id);\n });\n\n Object.keys(self.__remote_webpack_module_map__?.[bundle] ?? {})\n .filter((path) => cssRE.test(path))\n .forEach((path) => {\n const id = self.__remote_webpack_module_map__?.[bundle]?.[path];\n if (id) {\n self.__remote_webpack_require__?.[bundle]?.(id);\n }\n });\n\n const elements = [];\n let node = nextCss.previousSibling;\n while (node && node !== nextCssEnd) {\n elements.push(node);\n node.remove();\n node = nextCss.previousSibling;\n }\n cssCache[bundle] = elements;\n }\n\n applyBundleCss();\n\n // restore the original __NEXT_P reference\n delete self.__NEXT_P;\n self.__NEXT_P = __NEXT_P_ORIGINAL;\n\n // restore the original Next.js CSS loader\n if (nextCssOriginal) {\n nextCssOriginal.parentNode?.appendChild(nextCssOriginal);\n }\n\n nextCss.remove();\n nextCssEnd.remove();\n\n const result = { Component, App };\n ns.pageComponentCache[cacheKey] = result;\n return result;\n }\n\n return { Component: null, App: null };\n}\n"],"mappings":"AAAA,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AAG/B,SAAS,sBACd,QACA,OACA,iBAAsD,SAAS,MAC/D;AAEA,QAAM,OAAO;AAqDb,QAAM,KAAK,aAAa;AACxB,KAAG,uBAAuB,CAAC;AAC3B,QAAM,WAAW,GAAG,UAAU;AAM9B,QAAM,iBAAiB,MAAM;AAC3B,UAAM,WAAW,GAAG,SAAS,MAAM,KAAK,CAAC;AACzC,QAAI,gBAAgB;AAClB,iBAAW,MAAM,UAAU;AACzB,uBAAe,YAAY,GAAG,UAAU,IAAI,CAAC;AAAA,MAC/C;AAAA,IACF,OAAO;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C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ConsumeClientOnlyConfig } from '../shared/config.js';
|
|
3
|
-
import { C as ConsumeServerData } from '../../../server-handoff-
|
|
3
|
+
import { C as ConsumeServerData } from '../../../server-handoff-8c89b856.js';
|
|
4
4
|
import '../../runtime/url/resolve-client-url.js';
|
|
5
5
|
import '../shared/fetch-interceptors.js';
|
|
6
6
|
import 'react';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ConsumeClientOnlyConfig } from '../shared/config.js';
|
|
3
3
|
import '../../runtime/url/resolve-client-url.js';
|
|
4
4
|
import '../shared/fetch-interceptors.js';
|
|
5
5
|
|
|
6
|
-
declare const RemoteComponentsContext:
|
|
6
|
+
declare const RemoteComponentsContext: React.Context<ConsumeClientOnlyConfig>;
|
|
7
7
|
declare function useRemoteComponentsContext(): ConsumeClientOnlyConfig;
|
|
8
8
|
|
|
9
9
|
export { RemoteComponentsContext, useRemoteComponentsContext };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RemoteComponentMetadata } from '../../runtime/metadata.js';
|
|
2
2
|
import { ScriptDescriptor } from './asset-descriptors.js';
|
|
3
3
|
import { InternalResolveClientUrl } from '../../runtime/url/resolve-client-url.js';
|
|
4
|
-
import { a as ConsumeLoaderPayload } from '../../../server-handoff-
|
|
4
|
+
import { a as ConsumeLoaderPayload } from '../../../server-handoff-8c89b856.js';
|
|
5
5
|
import { ParsedRemoteComponent } from '../../runtime/html/parse-remote-html.js';
|
|
6
|
-
import { M as MountOrUnmountFunction } from '../../../types-
|
|
6
|
+
import { M as MountOrUnmountFunction } from '../../../types-8b0edd78.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import './config.js';
|
|
9
9
|
import './fetch-interceptors.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InternalResolveClientUrl } from '../url/resolve-client-url.js';
|
|
2
|
-
import { a as ConsumeLoaderPayload } from '../../../server-handoff-
|
|
3
|
-
import { L as LoaderResult } from '../../../types-
|
|
2
|
+
import { a as ConsumeLoaderPayload } from '../../../server-handoff-8c89b856.js';
|
|
3
|
+
import { L as LoaderResult } from '../../../types-8b0edd78.js';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../../host/shared/asset-descriptors.js';
|
|
6
6
|
import '../../host/shared/config.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { InternalResolveClientUrl } from '../url/resolve-client-url.js';
|
|
2
|
-
import { M as MountOrUnmountFunction } from '../../../types-
|
|
2
|
+
import { M as MountOrUnmountFunction } from '../../../types-8b0edd78.js';
|
|
3
3
|
import '../metadata.js';
|
|
4
|
+
import 'react';
|
|
4
5
|
import '../turbopack/remote-scope.js';
|
|
5
6
|
import '../constants.js';
|
|
6
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/runtime/namespace.ts"],"sourcesContent":["import 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 /** @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 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":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
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":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsDA,MAAM,qBAAqB;AAS3B,MAAM,iBAGD;AAAA,EACH,EAAE,QAAQ,+BAA+B,MAAM,SAAS;AAA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T;","names":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import 'react';
|
|
1
2
|
import './turbopack/remote-scope.js';
|
|
2
|
-
export { R as RemoteComponentsNamespace, g as getNamespace } from '../../types-
|
|
3
|
+
export { R as RemoteComponentsNamespace, g as getNamespace } from '../../types-8b0edd78.js';
|
|
3
4
|
import './url/resolve-client-url.js';
|
|
4
5
|
import './constants.js';
|
|
5
6
|
import './metadata.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/runtime/namespace.ts"],"sourcesContent":["import 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 /** @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 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":"
|
|
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,MAAM,qBAAqB;AAS3B,MAAM,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":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './metadata.js';
|
|
2
|
-
export { G as GlobalScope, L as LoaderResult, M as MountOrUnmountFunction, b as MountUnmountFunctions, a as RSCKey } from '../../types-
|
|
2
|
+
export { G as GlobalScope, L as LoaderResult, M as MountOrUnmountFunction, b as MountUnmountFunctions, a as RSCKey } from '../../types-8b0edd78.js';
|
|
3
|
+
import 'react';
|
|
3
4
|
import './turbopack/remote-scope.js';
|
|
4
5
|
import './url/resolve-client-url.js';
|
|
5
6
|
import './constants.js';
|
package/dist/remote/html.cjs
CHANGED
|
@@ -19,7 +19,7 @@ if (typeof HTMLElement !== "undefined") {
|
|
|
19
19
|
this.root.innerHTML = html;
|
|
20
20
|
this.replaceChildren();
|
|
21
21
|
(async () => {
|
|
22
|
-
const { loadStaticRemoteComponent } = await Promise.resolve().then(() => _interopRequireWildcard(require("../static-loader-
|
|
22
|
+
const { loadStaticRemoteComponent } = await Promise.resolve().then(() => _interopRequireWildcard(require("../static-loader-UDIXK5MV.cjs")));
|
|
23
23
|
loadStaticRemoteComponent(
|
|
24
24
|
Array.from(_nullishCoalesce(_optionalChain([this, 'access', _ => _.root, 'optionalAccess', _2 => _2.querySelectorAll, 'call', _3 => _3("script")]), () => ( []))),
|
|
25
25
|
new URL(location.href)
|
package/dist/remote/html.js
CHANGED
|
@@ -19,7 +19,7 @@ if (typeof HTMLElement !== "undefined") {
|
|
|
19
19
|
this.root.innerHTML = html;
|
|
20
20
|
this.replaceChildren();
|
|
21
21
|
(async () => {
|
|
22
|
-
const { loadStaticRemoteComponent } = await import("../static-loader-
|
|
22
|
+
const { loadStaticRemoteComponent } = await import("../static-loader-OHSAUD62.js");
|
|
23
23
|
loadStaticRemoteComponent(
|
|
24
24
|
Array.from(this.root?.querySelectorAll("script") ?? []),
|
|
25
25
|
new URL(location.href)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkTZT7DLO5cjs = require('./chunk-TZT7DLO5.cjs');
|
|
4
|
+
require('./chunk-Z2SLBFQL.cjs');
|
|
5
5
|
require('./chunk-RUWR74XQ.cjs');
|
|
6
6
|
require('./chunk-KE7QPAQ4.cjs');
|
|
7
7
|
require('./chunk-SHFJ5OQA.cjs');
|
|
@@ -17,10 +17,10 @@ function scriptRuntime(resolveClientUrl) {
|
|
|
17
17
|
Component: null,
|
|
18
18
|
App: null
|
|
19
19
|
}),
|
|
20
|
-
preloadScripts: (scripts, url) =>
|
|
20
|
+
preloadScripts: (scripts, url) => _chunkTZT7DLO5cjs.loadStaticRemoteComponent.call(void 0, scripts, url, resolveClientUrl)
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
exports.scriptRuntime = scriptRuntime;
|
|
26
|
-
//# sourceMappingURL=script-
|
|
26
|
+
//# sourceMappingURL=script-D5AD7HLV.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadStaticRemoteComponent
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LQ7VQ74E.js";
|
|
4
|
+
import "./chunk-D5GNZB6O.js";
|
|
5
5
|
import "./chunk-S2A4TFLS.js";
|
|
6
6
|
import "./chunk-X6YKUJKH.js";
|
|
7
7
|
import "./chunk-ENYGL5CO.js";
|
|
@@ -23,4 +23,4 @@ function scriptRuntime(resolveClientUrl) {
|
|
|
23
23
|
export {
|
|
24
24
|
scriptRuntime
|
|
25
25
|
};
|
|
26
|
-
//# sourceMappingURL=script-
|
|
26
|
+
//# sourceMappingURL=script-VPOI7ARP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ScriptDescriptor, LinkDescriptor } from './internal/host/shared/asset-descriptors.js';
|
|
3
3
|
import { ShadowDomConfig } from './internal/host/shared/config.js';
|
|
4
4
|
import { RemoteComponentMetadata } from './internal/runtime/metadata.js';
|
|
@@ -40,7 +40,7 @@ interface ConsumeServerData extends ConsumeLoaderPayload, ShadowDomConfig {
|
|
|
40
40
|
serverUrl: string;
|
|
41
41
|
links?: LinkDescriptor[];
|
|
42
42
|
type?: RemoteComponentMetadata['type'];
|
|
43
|
-
children:
|
|
43
|
+
children: React.ReactNode;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export { ConsumeServerData as C, ConsumeLoaderPayload as a };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadStaticRemoteComponent
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LQ7VQ74E.js";
|
|
4
|
+
import "./chunk-D5GNZB6O.js";
|
|
5
5
|
import "./chunk-S2A4TFLS.js";
|
|
6
6
|
import "./chunk-X6YKUJKH.js";
|
|
7
7
|
import "./chunk-ENYGL5CO.js";
|
|
8
8
|
export {
|
|
9
9
|
loadStaticRemoteComponent
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=static-loader-
|
|
11
|
+
//# sourceMappingURL=static-loader-OHSAUD62.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkTZT7DLO5cjs = require('./chunk-TZT7DLO5.cjs');
|
|
4
|
+
require('./chunk-Z2SLBFQL.cjs');
|
|
5
|
+
require('./chunk-RUWR74XQ.cjs');
|
|
6
|
+
require('./chunk-KE7QPAQ4.cjs');
|
|
7
|
+
require('./chunk-SHFJ5OQA.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.loadStaticRemoteComponent = _chunkTZT7DLO5cjs.loadStaticRemoteComponent;
|
|
11
|
+
//# sourceMappingURL=static-loader-UDIXK5MV.cjs.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
initializeSharedModules,
|
|
3
3
|
setupRemoteScope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QKB74MLO.js";
|
|
5
5
|
import {
|
|
6
6
|
applySharedModules,
|
|
7
7
|
nextClientPagesLoader
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-52BJ7VFA.js";
|
|
9
9
|
import {
|
|
10
10
|
buildCoreShared,
|
|
11
11
|
buildHostShared
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-SJM7AAGU.js";
|
|
13
|
+
import "./chunk-D5GNZB6O.js";
|
|
14
14
|
import "./chunk-S2A4TFLS.js";
|
|
15
15
|
import "./chunk-X6YKUJKH.js";
|
|
16
16
|
import "./chunk-ENYGL5CO.js";
|
|
@@ -52,4 +52,4 @@ async function turbopackRuntime(url, bundle, shared, remoteShared, resolveClient
|
|
|
52
52
|
export {
|
|
53
53
|
turbopackRuntime
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=turbopack-
|
|
55
|
+
//# sourceMappingURL=turbopack-5LW6V6IT.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
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(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkRJW3EZJPcjs = require('./chunk-RJW3EZJP.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkT64P7BAGcjs = require('./chunk-T64P7BAG.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkX6W464D6cjs = require('./chunk-X6W464D6.cjs');
|
|
13
|
+
require('./chunk-Z2SLBFQL.cjs');
|
|
14
14
|
require('./chunk-RUWR74XQ.cjs');
|
|
15
15
|
require('./chunk-KE7QPAQ4.cjs');
|
|
16
16
|
require('./chunk-SHFJ5OQA.cjs');
|
|
@@ -18,15 +18,15 @@ require('./chunk-SHFJ5OQA.cjs');
|
|
|
18
18
|
// src/host/html/runtime/turbopack.ts
|
|
19
19
|
async function turbopackRuntime(url, bundle, shared, remoteShared, resolveClientUrl) {
|
|
20
20
|
const self = globalThis;
|
|
21
|
-
const hostShared =
|
|
21
|
+
const hostShared = _chunkX6W464D6cjs.buildHostShared.call(void 0, shared, resolveClientUrl, {
|
|
22
22
|
includeRemoteComponentShared: true
|
|
23
23
|
});
|
|
24
|
-
await
|
|
24
|
+
await _chunkRJW3EZJPcjs.setupRemoteScope.call(void 0, "turbopack", [], url, bundle, resolveClientUrl);
|
|
25
25
|
const {
|
|
26
26
|
default: { createFromReadableStream }
|
|
27
27
|
} = await Promise.resolve().then(() => _interopRequireWildcard(require("react-server-dom-webpack/client.browser")));
|
|
28
28
|
async function preloadScripts(scripts, __) {
|
|
29
|
-
const scope = await
|
|
29
|
+
const scope = await _chunkRJW3EZJPcjs.setupRemoteScope.call(void 0,
|
|
30
30
|
"turbopack",
|
|
31
31
|
scripts.map((script) => ({
|
|
32
32
|
src: script.getAttribute("src") || script.getAttribute("data-src") || script.src
|
|
@@ -35,21 +35,21 @@ async function turbopackRuntime(url, bundle, shared, remoteShared, resolveClient
|
|
|
35
35
|
bundle,
|
|
36
36
|
resolveClientUrl
|
|
37
37
|
);
|
|
38
|
-
await
|
|
38
|
+
await _chunkRJW3EZJPcjs.initializeSharedModules.call(void 0,
|
|
39
39
|
scope,
|
|
40
|
-
|
|
40
|
+
_chunkX6W464D6cjs.buildCoreShared.call(void 0, hostShared),
|
|
41
41
|
_nullishCoalesce(remoteShared, () => ( {}))
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
45
|
self,
|
|
46
46
|
createFromReadableStream,
|
|
47
|
-
applySharedModules:
|
|
48
|
-
nextClientPagesLoader:
|
|
47
|
+
applySharedModules: _chunkT64P7BAGcjs.applySharedModules,
|
|
48
|
+
nextClientPagesLoader: _chunkT64P7BAGcjs.nextClientPagesLoader,
|
|
49
49
|
preloadScripts
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
exports.turbopackRuntime = turbopackRuntime;
|
|
55
|
-
//# sourceMappingURL=turbopack-
|
|
55
|
+
//# sourceMappingURL=turbopack-KRKECGY2.cjs.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RemoteComponentMetadata } from './internal/runtime/metadata.js';
|
|
2
|
+
import React__default from 'react';
|
|
2
3
|
import { RemoteScope } from './internal/runtime/turbopack/remote-scope.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -30,6 +31,12 @@ interface RemoteComponentsNamespace {
|
|
|
30
31
|
hostSharedModules: Record<string, () => Promise<unknown>>;
|
|
31
32
|
/** @see `__remote_next_css__` */
|
|
32
33
|
cssCache: Record<string, ChildNode[]>;
|
|
34
|
+
pageComponentCache?: Record<string, {
|
|
35
|
+
Component: React__default.ComponentType<Record<string, unknown>> | null;
|
|
36
|
+
App: React__default.ComponentType<{
|
|
37
|
+
Component: React__default.ComponentType<Record<string, unknown>>;
|
|
38
|
+
} & Record<string, unknown>> | null;
|
|
39
|
+
}>;
|
|
33
40
|
/** @see `__remote_components_shadowroot_*` */
|
|
34
41
|
shadowRoots: Record<string, ShadowRoot | null>;
|
|
35
42
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadScripts
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SZFCBE54.js";
|
|
4
4
|
import {
|
|
5
5
|
applySharedModules,
|
|
6
6
|
nextClientPagesLoader
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-52BJ7VFA.js";
|
|
8
8
|
import {
|
|
9
9
|
NEXT_BUNDLE_PATH_RE,
|
|
10
10
|
buildHostShared,
|
|
11
11
|
buildWebpackResolve
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-SJM7AAGU.js";
|
|
13
|
+
import "./chunk-D5GNZB6O.js";
|
|
14
14
|
import {
|
|
15
15
|
RemoteComponentsError
|
|
16
16
|
} from "./chunk-S2A4TFLS.js";
|
|
@@ -89,4 +89,4 @@ async function webpackRuntime(bundle, shared, remoteShared, resolveClientUrl) {
|
|
|
89
89
|
export {
|
|
90
90
|
webpackRuntime
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=webpack-
|
|
92
|
+
//# sourceMappingURL=webpack-NPZNXRNL.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
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(); } } 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 _chunkLCXO7BUYcjs = require('./chunk-LCXO7BUY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkT64P7BAGcjs = require('./chunk-T64P7BAG.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkX6W464D6cjs = require('./chunk-X6W464D6.cjs');
|
|
13
|
+
require('./chunk-Z2SLBFQL.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _chunkRUWR74XQcjs = require('./chunk-RUWR74XQ.cjs');
|
|
@@ -57,13 +57,13 @@ async function webpackRuntime(bundle, shared, remoteShared, resolveClientUrl) {
|
|
|
57
57
|
return [];
|
|
58
58
|
return [
|
|
59
59
|
{
|
|
60
|
-
src: new URL(scriptSrc.replace(
|
|
60
|
+
src: new URL(scriptSrc.replace(_chunkX6W464D6cjs.NEXT_BUNDLE_PATH_RE, "/_next/"), url).href
|
|
61
61
|
}
|
|
62
62
|
];
|
|
63
63
|
});
|
|
64
|
-
await
|
|
65
|
-
const hostShared =
|
|
66
|
-
const resolve = await
|
|
64
|
+
await _chunkLCXO7BUYcjs.loadScripts.call(void 0, scriptSrcs, resolveClientUrl);
|
|
65
|
+
const hostShared = _chunkX6W464D6cjs.buildHostShared.call(void 0, shared, resolveClientUrl);
|
|
66
|
+
const resolve = await _chunkX6W464D6cjs.buildWebpackResolve.call(void 0,
|
|
67
67
|
hostShared,
|
|
68
68
|
_nullishCoalesce(remoteShared, () => ( {})),
|
|
69
69
|
remoteBundle,
|
|
@@ -76,17 +76,17 @@ async function webpackRuntime(bundle, shared, remoteShared, resolveClientUrl) {
|
|
|
76
76
|
},
|
|
77
77
|
"WebpackRuntime"
|
|
78
78
|
);
|
|
79
|
-
|
|
79
|
+
_chunkT64P7BAGcjs.applySharedModules.call(void 0, remoteBundle, resolve);
|
|
80
80
|
}
|
|
81
81
|
return {
|
|
82
82
|
self,
|
|
83
83
|
createFromReadableStream,
|
|
84
|
-
applySharedModules:
|
|
85
|
-
nextClientPagesLoader:
|
|
84
|
+
applySharedModules: _chunkT64P7BAGcjs.applySharedModules,
|
|
85
|
+
nextClientPagesLoader: _chunkT64P7BAGcjs.nextClientPagesLoader,
|
|
86
86
|
preloadScripts
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
exports.webpackRuntime = webpackRuntime;
|
|
92
|
-
//# sourceMappingURL=webpack-
|
|
92
|
+
//# sourceMappingURL=webpack-TTZDARNY.cjs.map
|