remote-components 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/html/host.cjs +758 -0
- package/dist/html/host.cjs.map +1 -0
- package/dist/html/host.d.ts +2 -0
- package/dist/html/host.js +737 -0
- package/dist/html/host.js.map +1 -0
- package/dist/next/config.cjs +347 -0
- package/dist/next/config.cjs.map +1 -0
- package/dist/next/config.d.ts +8 -0
- package/dist/next/config.js +325 -0
- package/dist/next/config.js.map +1 -0
- package/dist/next/host/app-client.cjs +124 -0
- package/dist/next/host/app-client.cjs.map +1 -0
- package/dist/next/host/app-client.d.ts +33 -0
- package/dist/next/host/app-client.js +104 -0
- package/dist/next/host/app-client.js.map +1 -0
- package/dist/next/host/app-server.cjs +61 -0
- package/dist/next/host/app-server.cjs.map +1 -0
- package/dist/next/host/app-server.d.ts +7 -0
- package/dist/next/host/app-server.js +37 -0
- package/dist/next/host/app-server.js.map +1 -0
- package/dist/next/host/pages-client.cjs +52 -0
- package/dist/next/host/pages-client.cjs.map +1 -0
- package/dist/next/host/pages-client.d.ts +17 -0
- package/dist/next/host/pages-client.js +18 -0
- package/dist/next/host/pages-client.js.map +1 -0
- package/dist/next/host/pages-server.cjs +134 -0
- package/dist/next/host/pages-server.cjs.map +1 -0
- package/dist/next/host/pages-server.d.ts +25 -0
- package/dist/next/host/pages-server.js +99 -0
- package/dist/next/host/pages-server.js.map +1 -0
- package/dist/next/remote/pages.cjs +37 -0
- package/dist/next/remote/pages.cjs.map +1 -0
- package/dist/next/remote/pages.d.ts +9 -0
- package/dist/next/remote/pages.js +13 -0
- package/dist/next/remote/pages.js.map +1 -0
- package/dist/next/remote/render-client-turbopack.cjs +51 -0
- package/dist/next/remote/render-client-turbopack.cjs.map +1 -0
- package/dist/next/remote/render-client-turbopack.d.ts +11 -0
- package/dist/next/remote/render-client-turbopack.js +27 -0
- package/dist/next/remote/render-client-turbopack.js.map +1 -0
- package/dist/next/remote/render-client-webpack.cjs +51 -0
- package/dist/next/remote/render-client-webpack.cjs.map +1 -0
- package/dist/next/remote/render-client-webpack.d.ts +11 -0
- package/dist/next/remote/render-client-webpack.js +27 -0
- package/dist/next/remote/render-client-webpack.js.map +1 -0
- package/dist/next/remote/render-client.cjs +106 -0
- package/dist/next/remote/render-client.cjs.map +1 -0
- package/dist/next/remote/render-client.d.ts +15 -0
- package/dist/next/remote/render-client.js +82 -0
- package/dist/next/remote/render-client.js.map +1 -0
- package/dist/next/remote/render-server.cjs +133 -0
- package/dist/next/remote/render-server.cjs.map +1 -0
- package/dist/next/remote/render-server.d.ts +9 -0
- package/dist/next/remote/render-server.js +99 -0
- package/dist/next/remote/render-server.js.map +1 -0
- package/dist/next/remote/server.cjs +29 -0
- package/dist/next/remote/server.cjs.map +1 -0
- package/dist/next/remote/server.d.ts +3 -0
- package/dist/next/remote/server.js +5 -0
- package/dist/next/remote/server.js.map +1 -0
- package/dist/shared/client/remote-component.cjs +558 -0
- package/dist/shared/client/remote-component.cjs.map +1 -0
- package/dist/shared/client/remote-component.d.ts +93 -0
- package/dist/shared/client/remote-component.js +511 -0
- package/dist/shared/client/remote-component.js.map +1 -0
- package/dist/shared/ssr/dom-flight.cjs +185 -0
- package/dist/shared/ssr/dom-flight.cjs.map +1 -0
- package/dist/shared/ssr/dom-flight.d.ts +30 -0
- package/dist/shared/ssr/dom-flight.js +151 -0
- package/dist/shared/ssr/dom-flight.js.map +1 -0
- package/dist/shared/ssr/fetch-remote-component.cjs +162 -0
- package/dist/shared/ssr/fetch-remote-component.cjs.map +1 -0
- package/dist/shared/ssr/fetch-remote-component.d.ts +31 -0
- package/dist/shared/ssr/fetch-remote-component.js +137 -0
- package/dist/shared/ssr/fetch-remote-component.js.map +1 -0
- package/dist/shared/webpack/next-client-pages-loader.cjs +107 -0
- package/dist/shared/webpack/next-client-pages-loader.cjs.map +1 -0
- package/dist/shared/webpack/next-client-pages-loader.d.ts +10 -0
- package/dist/shared/webpack/next-client-pages-loader.js +83 -0
- package/dist/shared/webpack/next-client-pages-loader.js.map +1 -0
- package/dist/shared/webpack/shared-modules.cjs +50 -0
- package/dist/shared/webpack/shared-modules.cjs.map +1 -0
- package/dist/shared/webpack/shared-modules.d.ts +3 -0
- package/dist/shared/webpack/shared-modules.js +26 -0
- package/dist/shared/webpack/shared-modules.js.map +1 -0
- package/dist/types-280a3640.d.ts +8 -0
- package/dist/types-a1bd5b56.d.ts +6 -0
- package/package.json +151 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { createFromReadableStream } from "next/dist/compiled/react-server-dom-webpack/client.edge";
|
|
2
|
+
import { Parser } from "parse5";
|
|
3
|
+
import { visit } from "./dom-flight";
|
|
4
|
+
const CURRENT_ZONE = process.env.NEXT_PUBLIC_MFE_CURRENT_APPLICATION;
|
|
5
|
+
function getBaseUrl(reqHeaders) {
|
|
6
|
+
const host = reqHeaders.get("host");
|
|
7
|
+
if (host) {
|
|
8
|
+
return host.startsWith("localhost") ? `http://${host}` : `https://${host}`;
|
|
9
|
+
}
|
|
10
|
+
const forwardedHost = reqHeaders.get("x-forwarded-host");
|
|
11
|
+
if (forwardedHost) {
|
|
12
|
+
return `https://${forwardedHost}`;
|
|
13
|
+
}
|
|
14
|
+
if (process.env.VERCEL_PROJECT_PRODUCTION_URL) {
|
|
15
|
+
return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`;
|
|
16
|
+
}
|
|
17
|
+
return `http://localhost:${process.env.MFE_LOCAL_PROXY_PORT || 3024}`;
|
|
18
|
+
}
|
|
19
|
+
async function fetchRemoteComponent(src, headers, createComponent = false) {
|
|
20
|
+
const url = new URL(src, getBaseUrl(headers));
|
|
21
|
+
const fetchInit = {
|
|
22
|
+
method: "GET",
|
|
23
|
+
headers: {
|
|
24
|
+
// pass all headers to the remote component
|
|
25
|
+
...Object.fromEntries(headers.entries()),
|
|
26
|
+
Accept: "text/html",
|
|
27
|
+
// pass the public address of the remote component to the server used for module map mutation
|
|
28
|
+
"Vercel-Remote-Component-Url": url.href
|
|
29
|
+
},
|
|
30
|
+
credentials: "include"
|
|
31
|
+
};
|
|
32
|
+
const res = await fetch(url, fetchInit);
|
|
33
|
+
if (!res.ok) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`Failed to fetch remote component "${url.href}": ${res.status}`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const parser = Parser.getFragmentParser();
|
|
39
|
+
if (!res.body) {
|
|
40
|
+
throw new Error(`No response body for remote component "${url.href}"`);
|
|
41
|
+
}
|
|
42
|
+
const decoder = new TextDecoder();
|
|
43
|
+
for await (const chunk of res.body) {
|
|
44
|
+
parser.tokenizer.write(decoder.decode(chunk), false);
|
|
45
|
+
}
|
|
46
|
+
const fragment = parser.getFragment();
|
|
47
|
+
let metadata = {
|
|
48
|
+
bundle: CURRENT_ZONE ?? "__vercel_remote_component",
|
|
49
|
+
route: "/",
|
|
50
|
+
runtime: "webpack",
|
|
51
|
+
id: "__vercel_remote_component"
|
|
52
|
+
};
|
|
53
|
+
let remoteShared = {};
|
|
54
|
+
const scripts = [];
|
|
55
|
+
const links = [];
|
|
56
|
+
const hydrationData = [];
|
|
57
|
+
let nextData;
|
|
58
|
+
let html = "";
|
|
59
|
+
const rsc = visit(fragment, {
|
|
60
|
+
url,
|
|
61
|
+
onMetadata(_metadata) {
|
|
62
|
+
metadata = _metadata;
|
|
63
|
+
},
|
|
64
|
+
onScript(attrs) {
|
|
65
|
+
if (!scripts.find((it) => it.src === attrs.src)) {
|
|
66
|
+
scripts.push({ src: attrs.src });
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
onLink(attrs) {
|
|
70
|
+
if (!links.find((it) => it.href === attrs.href && it.rel === attrs.rel)) {
|
|
71
|
+
links.push(attrs);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
onRSC(chunk) {
|
|
75
|
+
hydrationData.push(chunk);
|
|
76
|
+
},
|
|
77
|
+
onNextData(data) {
|
|
78
|
+
nextData = data;
|
|
79
|
+
if (data.props.__REMOTE_COMPONENT__) {
|
|
80
|
+
Object.assign(metadata, data.props.__REMOTE_COMPONENT__);
|
|
81
|
+
metadata.id = "__next";
|
|
82
|
+
metadata.route = data.page ?? "/";
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
onHTML(_html) {
|
|
86
|
+
if (!html.includes(_html)) {
|
|
87
|
+
html += _html;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
onShared(_shared) {
|
|
91
|
+
remoteShared = _shared;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
let component;
|
|
95
|
+
if (createComponent) {
|
|
96
|
+
const componentRSC = `0:${JSON.stringify(rsc)}
|
|
97
|
+
`;
|
|
98
|
+
component = await createFromReadableStream(
|
|
99
|
+
new ReadableStream({
|
|
100
|
+
type: "bytes",
|
|
101
|
+
start(controller) {
|
|
102
|
+
const encoder = new TextEncoder();
|
|
103
|
+
controller.enqueue(encoder.encode(componentRSC));
|
|
104
|
+
controller.close();
|
|
105
|
+
}
|
|
106
|
+
}),
|
|
107
|
+
{
|
|
108
|
+
serverConsumerManifest: {
|
|
109
|
+
moduleLoading: {
|
|
110
|
+
prefix: url.origin,
|
|
111
|
+
crossOrigin: true
|
|
112
|
+
},
|
|
113
|
+
moduleMap: {}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
const name = metadata.id.replace(/_ssr$/, "");
|
|
119
|
+
return {
|
|
120
|
+
name,
|
|
121
|
+
url,
|
|
122
|
+
metadata,
|
|
123
|
+
rsc,
|
|
124
|
+
scripts,
|
|
125
|
+
links,
|
|
126
|
+
hydrationData,
|
|
127
|
+
nextData,
|
|
128
|
+
component,
|
|
129
|
+
html,
|
|
130
|
+
remoteShared
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
fetchRemoteComponent,
|
|
135
|
+
getBaseUrl
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=fetch-remote-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/ssr/fetch-remote-component.ts"],"sourcesContent":["import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack/client.edge';\nimport { type DefaultTreeAdapterMap, Parser } from 'parse5';\nimport type { RemoteComponentMetadata } from './types';\nimport { visit } from './dom-flight';\n\nconst CURRENT_ZONE = process.env.NEXT_PUBLIC_MFE_CURRENT_APPLICATION;\n\n/**\n * Resolves the base URL that should be used to fetch the remote component.\n * This function must support local development, Vercel environments, and SSG\n * and dynamic rendering.\n */\nexport function getBaseUrl(reqHeaders: Headers): string {\n const host = reqHeaders.get('host');\n if (host) {\n return host.startsWith('localhost') ? `http://${host}` : `https://${host}`;\n }\n const forwardedHost = reqHeaders.get('x-forwarded-host');\n if (forwardedHost) {\n return `https://${forwardedHost}`;\n }\n if (process.env.VERCEL_PROJECT_PRODUCTION_URL) {\n return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`;\n }\n // TODO: Resolve the correct URL in local development when the proxy is not running.\n return `http://localhost:${process.env.MFE_LOCAL_PROXY_PORT || 3024}`;\n}\n\nexport async function fetchRemoteComponent(\n src: string | URL,\n headers: Headers,\n createComponent = false,\n) {\n const url = new URL(src, getBaseUrl(headers));\n\n const fetchInit = {\n method: 'GET',\n headers: {\n // pass all headers to the remote component\n ...Object.fromEntries(headers.entries()),\n Accept: 'text/html',\n // pass the public address of the remote component to the server used for module map mutation\n 'Vercel-Remote-Component-Url': url.href,\n },\n credentials: 'include',\n } as RequestInit;\n\n const res = await fetch(url, fetchInit);\n\n if (!res.ok) {\n throw new Error(\n `Failed to fetch remote component \"${url.href}\": ${res.status}`,\n );\n }\n\n // create a parser for the HTML response\n const parser = Parser.getFragmentParser<DefaultTreeAdapterMap>();\n\n if (!res.body) {\n throw new Error(`No response body for remote component \"${url.href}\"`);\n }\n\n const decoder = new TextDecoder();\n // read the response body as a stream and parse it using the parse5 fragment parser\n for await (const chunk of res.body as unknown as AsyncIterable<Uint8Array>) {\n parser.tokenizer.write(decoder.decode(chunk), false);\n }\n const fragment = parser.getFragment();\n\n let metadata: RemoteComponentMetadata = {\n bundle: CURRENT_ZONE ?? '__vercel_remote_component',\n route: '/',\n runtime: 'webpack',\n id: '__vercel_remote_component',\n };\n let remoteShared: Record<string, string> = {};\n const scripts: { src: string }[] = [];\n const links: Record<string, string | boolean>[] = [];\n const hydrationData: string[] = [];\n let nextData:\n | {\n props: { pageProps: Record<string, unknown> };\n buildId?: string;\n }\n | undefined;\n let html = '';\n // convert the parsed HTML fragment into an RSC flight data\n // and extract the metadata, scripts, links and remote component RSC flight data\n const rsc = visit(fragment, {\n url,\n onMetadata(_metadata) {\n metadata = _metadata;\n },\n onScript(attrs) {\n if (!scripts.find((it) => it.src === attrs.src)) {\n scripts.push({ src: attrs.src as string });\n }\n },\n onLink(attrs) {\n if (!links.find((it) => it.href === attrs.href && it.rel === attrs.rel)) {\n links.push(attrs);\n }\n },\n onRSC(chunk) {\n hydrationData.push(chunk);\n },\n onNextData(data) {\n nextData = data;\n\n // use the Next.js Pages Router props data to extract remote component metadata\n if (data.props.__REMOTE_COMPONENT__) {\n Object.assign(metadata, data.props.__REMOTE_COMPONENT__);\n // only a singleton remote component is supported per page when using the Next.js Pages Router\n metadata.id = '__next';\n metadata.route = data.page ?? '/';\n }\n },\n onHTML(_html) {\n if (!html.includes(_html)) {\n html += _html;\n }\n },\n onShared(_shared) {\n remoteShared = _shared;\n },\n });\n\n let component: React.ReactNode | undefined;\n\n // only create a React component if requested\n if (createComponent) {\n // RSC flight data for the static HTML in a single RSC line\n const componentRSC = `0:${JSON.stringify(rsc)}\\n`;\n\n // create a React tree from the RSC flight data\n component = await createFromReadableStream(\n new ReadableStream({\n type: 'bytes',\n start(controller) {\n const encoder = new TextEncoder();\n controller.enqueue(encoder.encode(componentRSC));\n controller.close();\n },\n }),\n {\n serverConsumerManifest: {\n moduleLoading: {\n prefix: url.origin,\n crossOrigin: true,\n },\n moduleMap: {},\n },\n },\n );\n }\n\n const name = metadata.id.replace(/_ssr$/, '');\n return {\n name,\n url,\n metadata,\n rsc,\n scripts,\n links,\n hydrationData,\n nextData,\n component,\n html,\n remoteShared,\n };\n}\n"],"mappings":"AAAA,SAAS,gCAAgC;AACzC,SAAqC,cAAc;AAEnD,SAAS,aAAa;AAEtB,MAAM,eAAe,QAAQ,IAAI;AAO1B,SAAS,WAAW,YAA6B;AACtD,QAAM,OAAO,WAAW,IAAI,MAAM;AAClC,MAAI,MAAM;AACR,WAAO,KAAK,WAAW,WAAW,IAAI,UAAU,SAAS,WAAW;AAAA,EACtE;AACA,QAAM,gBAAgB,WAAW,IAAI,kBAAkB;AACvD,MAAI,eAAe;AACjB,WAAO,WAAW;AAAA,EACpB;AACA,MAAI,QAAQ,IAAI,+BAA+B;AAC7C,WAAO,WAAW,QAAQ,IAAI;AAAA,EAChC;AAEA,SAAO,oBAAoB,QAAQ,IAAI,wBAAwB;AACjE;AAEA,eAAsB,qBACpB,KACA,SACA,kBAAkB,OAClB;AACA,QAAM,MAAM,IAAI,IAAI,KAAK,WAAW,OAAO,CAAC;AAE5C,QAAM,YAAY;AAAA,IAChB,QAAQ;AAAA,IACR,SAAS;AAAA;AAAA,MAEP,GAAG,OAAO,YAAY,QAAQ,QAAQ,CAAC;AAAA,MACvC,QAAQ;AAAA;AAAA,MAER,+BAA+B,IAAI;AAAA,IACrC;AAAA,IACA,aAAa;AAAA,EACf;AAEA,QAAM,MAAM,MAAM,MAAM,KAAK,SAAS;AAEtC,MAAI,CAAC,IAAI,IAAI;AACX,UAAM,IAAI;AAAA,MACR,qCAAqC,IAAI,UAAU,IAAI;AAAA,IACzD;AAAA,EACF;AAGA,QAAM,SAAS,OAAO,kBAAyC;AAE/D,MAAI,CAAC,IAAI,MAAM;AACb,UAAM,IAAI,MAAM,0CAA0C,IAAI,OAAO;AAAA,EACvE;AAEA,Q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,EACF,CAAC;AAED,MAAI;AAGJ,MAAI,iBAAiB;AAEnB,UAAM,eAAe,KAAK,KAAK,UAAU,GAAG;AAAA;AAG5C,gBAAY,MAAM;AAAA,MAChB,IAAI,eAAe;AAAA,QACjB,MAAM;AAAA,QACN,MAAM,YAAY;AAChB,gBAAM,UAAU,IAAI,YAAY;AAChC,qBAAW,QAAQ,QAAQ,OAAO,YAAY,CAAC;AAC/C,qBAAW,MAAM;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,MACD;AAAA,QACE,wBAAwB;AAAA,UACtB,eAAe;AAAA,YACb,QAAQ,IAAI;AAAA,YACZ,aAAa;AAAA,UACf;AAAA,UACA,WAAW,CAAC;AAAA,QACd;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,OAAO,SAAS,GAAG,QAAQ,SAAS,EAAE;AAC5C,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var next_client_pages_loader_exports = {};
|
|
20
|
+
__export(next_client_pages_loader_exports, {
|
|
21
|
+
nextClientPagesLoader: () => nextClientPagesLoader
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(next_client_pages_loader_exports);
|
|
24
|
+
function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
25
|
+
const self = globalThis;
|
|
26
|
+
const nextCssOriginal = document.getElementById("__next_css__DO_NOT_USE__");
|
|
27
|
+
if (nextCssOriginal) {
|
|
28
|
+
nextCssOriginal.parentNode?.removeChild(nextCssOriginal);
|
|
29
|
+
}
|
|
30
|
+
const nextCss = document.createElement("noscript");
|
|
31
|
+
nextCss.id = "__next_css__DO_NOT_USE__";
|
|
32
|
+
const lastNode = document.head.childNodes[document.head.childNodes.length - 1];
|
|
33
|
+
document.head.appendChild(nextCss);
|
|
34
|
+
const componentLoaderChunk = Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(
|
|
35
|
+
(key) => key.includes("/webpack/loaders/next-client-pages-loader.js") && key.includes(`page=${encodeURIComponent(route)}`)
|
|
36
|
+
) ?? Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(
|
|
37
|
+
(key) => key.includes("/next/dist/client/page-loader.js")
|
|
38
|
+
) ?? self.__remote_webpack_module_map__?.[bundle]?.[Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(
|
|
39
|
+
(key) => key.includes("/webpack/loaders/next-client-pages-loader.js") && key.includes(`page=${encodeURIComponent(route)}`)
|
|
40
|
+
) ?? Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(
|
|
41
|
+
(key) => key.includes("/next/dist/client/page-loader.js")
|
|
42
|
+
) ?? ""] ?? -1;
|
|
43
|
+
const appLoaderChunk = Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(
|
|
44
|
+
(key) => key.includes("/webpack/loaders/next-client-pages-loader.js") && key.includes(`page=%2F_app`)
|
|
45
|
+
) ?? Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(
|
|
46
|
+
(key) => key.includes("/next/dist/client/page-loader.js")
|
|
47
|
+
) ?? self.__remote_webpack_module_map__?.[bundle]?.[Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(
|
|
48
|
+
(key) => key.includes("/webpack/loaders/next-client-pages-loader.js") && key.includes(`page=%2F_app`)
|
|
49
|
+
) ?? Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(
|
|
50
|
+
(key) => key.includes("/next/dist/client/page-loader.js")
|
|
51
|
+
) ?? ""] ?? -1;
|
|
52
|
+
if (!(componentLoaderChunk && appLoaderChunk)) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
`Next.js client pages loader not found in bundle "${bundle}"`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
const __NEXT_P_ORIGINAL = self.__NEXT_P;
|
|
58
|
+
const selfOriginal = self;
|
|
59
|
+
delete selfOriginal.__NEXT_P;
|
|
60
|
+
self.__remote_webpack_require__?.[bundle]?.(componentLoaderChunk);
|
|
61
|
+
if (typeof appLoaderChunk === "string" || typeof appLoaderChunk === "number" && appLoaderChunk !== -1) {
|
|
62
|
+
self.__remote_webpack_require__?.[bundle]?.(appLoaderChunk);
|
|
63
|
+
}
|
|
64
|
+
if (self.__NEXT_P) {
|
|
65
|
+
const [, componentLoader] = self.__NEXT_P[0] ?? [
|
|
66
|
+
void 0,
|
|
67
|
+
() => ({ default: null })
|
|
68
|
+
];
|
|
69
|
+
const [, appLoader] = self.__NEXT_P[2] ?? [
|
|
70
|
+
void 0,
|
|
71
|
+
() => ({
|
|
72
|
+
default: null
|
|
73
|
+
})
|
|
74
|
+
];
|
|
75
|
+
const { default: Component } = componentLoader();
|
|
76
|
+
const { default: App } = appLoader();
|
|
77
|
+
const cssRE = /\.s?css$/;
|
|
78
|
+
Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).filter((id) => cssRE.test(id)).forEach((id) => {
|
|
79
|
+
self.__remote_webpack_require__?.[bundle]?.(id);
|
|
80
|
+
});
|
|
81
|
+
Object.keys(self.__remote_webpack_module_map__?.[bundle] ?? {}).filter((path) => cssRE.test(path)).forEach((path) => {
|
|
82
|
+
const id = self.__remote_webpack_module_map__?.[bundle]?.[path];
|
|
83
|
+
if (id) {
|
|
84
|
+
self.__remote_webpack_require__?.[bundle]?.(id);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
if (styleContainer) {
|
|
88
|
+
let node = nextCss.previousSibling;
|
|
89
|
+
while (node && node !== lastNode) {
|
|
90
|
+
styleContainer.appendChild(node);
|
|
91
|
+
node = nextCss.previousSibling;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
delete self.__NEXT_P;
|
|
95
|
+
self.__NEXT_P = __NEXT_P_ORIGINAL;
|
|
96
|
+
if (nextCssOriginal) {
|
|
97
|
+
nextCssOriginal.parentNode?.appendChild(nextCssOriginal);
|
|
98
|
+
}
|
|
99
|
+
return { Component, App };
|
|
100
|
+
}
|
|
101
|
+
return { Component: null, App: null };
|
|
102
|
+
}
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
nextClientPagesLoader
|
|
106
|
+
});
|
|
107
|
+
//# sourceMappingURL=next-client-pages-loader.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/webpack/next-client-pages-loader.ts"],"sourcesContent":["// 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 }\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.getElementById('__next_css__DO_NOT_USE__');\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 const lastNode =\n document.head.childNodes[document.head.childNodes.length - 1];\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 Error(\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]?.(componentLoaderChunk);\n if (\n typeof appLoaderChunk === 'string' ||\n (typeof appLoaderChunk === 'number' && appLoaderChunk !== -1)\n ) {\n self.__remote_webpack_require__?.[bundle]?.(appLoaderChunk);\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 // 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 // if the styleContainer is provided, we need to move the styles to it\n if (styleContainer) {\n let node = nextCss.previousSibling;\n while (node && node !== lastNode) {\n styleContainer.appendChild(node);\n node = nextCss.previousSibling;\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 return { Component, App };\n }\n\n return { Component: null, App: null };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACO,SAAS,sBACd,QACA,OACA,iBAAsD,SAAS,MAC/D;AAEA,QAAM,OAAO;AAqDb,QAAM,kBAAkB,SAAS,eAAe,0BAA0B;AAC1E,MAAI,iBAAiB;AACnB,oBAAgB,YAAY,YAAY,eAAe;AAAA,EACzD;AAGA,QAAM,UAAU,SAAS,cAAc,UAAU;AACjD,UAAQ,KAAK;AACb,QAAM,WACJ,SAAS,KAAK,WAAW,SAAS,KAAK,WAAW,SAAS,CAAC;AAC9D,WAAS,KAAK,YAAY,OAAO;AAGjC,QAAM,uBACJ,OAAO,KAAK,KAAK,6BAA6B,MAAM,GAAG,KAAK,CAAC,CAAC,EAAE;AAAA,IAC9D,CAAC,QACC,IAAI,SAAS,8CAA8C,KAC3D,IAAI,SAAS,QAAQ,mBAAmB,KAAK,GAAG;AAAA,EACpD,KACA,OAAO,KAAK,KAAK,6BAA6B,MAAM,GAAG,KAAK,CAAC,CAAC,EAAE;AAAA,IAC9D,CAAC,QAAQ,IAAI,SAAS,kCAAkC;AAAA,EAC1D,KACA,KAAK,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as react from 'react';
|
|
2
|
+
|
|
3
|
+
declare function nextClientPagesLoader(bundle: string, route: string, styleContainer?: HTMLHeadElement | ShadowRoot | null): {
|
|
4
|
+
Component: react.ComponentType<Record<string, unknown>> | null | undefined;
|
|
5
|
+
App: react.ComponentType<{
|
|
6
|
+
Component: React.ComponentType<Record<string, unknown>>;
|
|
7
|
+
} & Record<string, unknown>> | null | undefined;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { nextClientPagesLoader };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
2
|
+
const self = globalThis;
|
|
3
|
+
const nextCssOriginal = document.getElementById("__next_css__DO_NOT_USE__");
|
|
4
|
+
if (nextCssOriginal) {
|
|
5
|
+
nextCssOriginal.parentNode?.removeChild(nextCssOriginal);
|
|
6
|
+
}
|
|
7
|
+
const nextCss = document.createElement("noscript");
|
|
8
|
+
nextCss.id = "__next_css__DO_NOT_USE__";
|
|
9
|
+
const lastNode = document.head.childNodes[document.head.childNodes.length - 1];
|
|
10
|
+
document.head.appendChild(nextCss);
|
|
11
|
+
const componentLoaderChunk = Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(
|
|
12
|
+
(key) => key.includes("/webpack/loaders/next-client-pages-loader.js") && key.includes(`page=${encodeURIComponent(route)}`)
|
|
13
|
+
) ?? Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(
|
|
14
|
+
(key) => key.includes("/next/dist/client/page-loader.js")
|
|
15
|
+
) ?? self.__remote_webpack_module_map__?.[bundle]?.[Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(
|
|
16
|
+
(key) => key.includes("/webpack/loaders/next-client-pages-loader.js") && key.includes(`page=${encodeURIComponent(route)}`)
|
|
17
|
+
) ?? Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(
|
|
18
|
+
(key) => key.includes("/next/dist/client/page-loader.js")
|
|
19
|
+
) ?? ""] ?? -1;
|
|
20
|
+
const appLoaderChunk = Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(
|
|
21
|
+
(key) => key.includes("/webpack/loaders/next-client-pages-loader.js") && key.includes(`page=%2F_app`)
|
|
22
|
+
) ?? Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(
|
|
23
|
+
(key) => key.includes("/next/dist/client/page-loader.js")
|
|
24
|
+
) ?? self.__remote_webpack_module_map__?.[bundle]?.[Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(
|
|
25
|
+
(key) => key.includes("/webpack/loaders/next-client-pages-loader.js") && key.includes(`page=%2F_app`)
|
|
26
|
+
) ?? Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(
|
|
27
|
+
(key) => key.includes("/next/dist/client/page-loader.js")
|
|
28
|
+
) ?? ""] ?? -1;
|
|
29
|
+
if (!(componentLoaderChunk && appLoaderChunk)) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`Next.js client pages loader not found in bundle "${bundle}"`
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
const __NEXT_P_ORIGINAL = self.__NEXT_P;
|
|
35
|
+
const selfOriginal = self;
|
|
36
|
+
delete selfOriginal.__NEXT_P;
|
|
37
|
+
self.__remote_webpack_require__?.[bundle]?.(componentLoaderChunk);
|
|
38
|
+
if (typeof appLoaderChunk === "string" || typeof appLoaderChunk === "number" && appLoaderChunk !== -1) {
|
|
39
|
+
self.__remote_webpack_require__?.[bundle]?.(appLoaderChunk);
|
|
40
|
+
}
|
|
41
|
+
if (self.__NEXT_P) {
|
|
42
|
+
const [, componentLoader] = self.__NEXT_P[0] ?? [
|
|
43
|
+
void 0,
|
|
44
|
+
() => ({ default: null })
|
|
45
|
+
];
|
|
46
|
+
const [, appLoader] = self.__NEXT_P[2] ?? [
|
|
47
|
+
void 0,
|
|
48
|
+
() => ({
|
|
49
|
+
default: null
|
|
50
|
+
})
|
|
51
|
+
];
|
|
52
|
+
const { default: Component } = componentLoader();
|
|
53
|
+
const { default: App } = appLoader();
|
|
54
|
+
const cssRE = /\.s?css$/;
|
|
55
|
+
Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).filter((id) => cssRE.test(id)).forEach((id) => {
|
|
56
|
+
self.__remote_webpack_require__?.[bundle]?.(id);
|
|
57
|
+
});
|
|
58
|
+
Object.keys(self.__remote_webpack_module_map__?.[bundle] ?? {}).filter((path) => cssRE.test(path)).forEach((path) => {
|
|
59
|
+
const id = self.__remote_webpack_module_map__?.[bundle]?.[path];
|
|
60
|
+
if (id) {
|
|
61
|
+
self.__remote_webpack_require__?.[bundle]?.(id);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
if (styleContainer) {
|
|
65
|
+
let node = nextCss.previousSibling;
|
|
66
|
+
while (node && node !== lastNode) {
|
|
67
|
+
styleContainer.appendChild(node);
|
|
68
|
+
node = nextCss.previousSibling;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
delete self.__NEXT_P;
|
|
72
|
+
self.__NEXT_P = __NEXT_P_ORIGINAL;
|
|
73
|
+
if (nextCssOriginal) {
|
|
74
|
+
nextCssOriginal.parentNode?.appendChild(nextCssOriginal);
|
|
75
|
+
}
|
|
76
|
+
return { Component, App };
|
|
77
|
+
}
|
|
78
|
+
return { Component: null, App: null };
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
nextClientPagesLoader
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=next-client-pages-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/webpack/next-client-pages-loader.ts"],"sourcesContent":["// 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 }\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.getElementById('__next_css__DO_NOT_USE__');\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 const lastNode =\n document.head.childNodes[document.head.childNodes.length - 1];\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 Error(\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]?.(componentLoaderChunk);\n if (\n typeof appLoaderChunk === 'string' ||\n (typeof appLoaderChunk === 'number' && appLoaderChunk !== -1)\n ) {\n self.__remote_webpack_require__?.[bundle]?.(appLoaderChunk);\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 // 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 // if the styleContainer is provided, we need to move the styles to it\n if (styleContainer) {\n let node = nextCss.previousSibling;\n while (node && node !== lastNode) {\n styleContainer.appendChild(node);\n node = nextCss.previousSibling;\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 return { Component, App };\n }\n\n return { Component: null, App: null };\n}\n"],"mappings":"AACO,SAAS,sBACd,QACA,OACA,iBAAsD,SAAS,MAC/D;AAEA,QAAM,OAAO;AAqDb,QAAM,kBAAkB,SAAS,eAAe,0BAA0B;AAC1E,MAAI,iBAAiB;AACnB,oBAAgB,YAAY,YAAY,eAAe;AAAA,EACzD;AAGA,QAAM,UAAU,SAAS,cAAc,UAAU;AACjD,UAAQ,KAAK;AACb,QAAM,WACJ,SAAS,KAAK,WAAW,SAAS,KAAK,WAAW,SAAS,CAAC;AAC9D,WAAS,KAAK,YAAY,OAAO;AAGjC,QAAM,uBACJ,OAAO,KAAK,KAAK,6BAA6B,MAAM,GAAG,KAAK,CAAC,CAAC,EAAE;AAAA,IAC9D,CAAC,QACC,IAAI,SAAS,8CAA8C,KAC3D,IAAI,SAAS,QAAQ,mBAAmB,KAAK,GAAG;AAAA,EACpD,KACA,OAAO,KAAK,KAAK,6BAA6B,MAAM,GAAG,KAAK,CAAC,CAAC,EAAE;AAAA,IAC9D,CAAC,QAAQ,IAAI,SAAS,kCAAkC;AAAA,EAC1D,KACA,KAAK,gCAAgC,MAAM,IACzC,OAAO,KAAK,KAAK,8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
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var shared_modules_exports = {};
|
|
20
|
+
__export(shared_modules_exports, {
|
|
21
|
+
applySharedModules: () => applySharedModules
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(shared_modules_exports);
|
|
24
|
+
function applySharedModules(bundle, resolve) {
|
|
25
|
+
const self = globalThis;
|
|
26
|
+
if (self.__remote_webpack_require__?.[bundle]) {
|
|
27
|
+
const modulePaths = Object.keys(
|
|
28
|
+
self.__remote_webpack_module_map__?.[bundle] ?? self.__remote_webpack_require__[bundle].m ?? {}
|
|
29
|
+
);
|
|
30
|
+
for (const [key, value] of Object.entries(resolve)) {
|
|
31
|
+
const ids = modulePaths.filter((p) => p.includes(key));
|
|
32
|
+
for (let id of ids) {
|
|
33
|
+
const webpackBundle = self.__remote_webpack_require__[bundle];
|
|
34
|
+
if (webpackBundle.m) {
|
|
35
|
+
if (self.__remote_webpack_module_map__?.[bundle]?.[id]) {
|
|
36
|
+
id = `${self.__remote_webpack_module_map__[bundle][id]}`;
|
|
37
|
+
}
|
|
38
|
+
webpackBundle.m[id] = (module2) => {
|
|
39
|
+
module2.exports = value;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
applySharedModules
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=shared-modules.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/webpack/shared-modules.ts"],"sourcesContent":["// Webpack shared module patching\n// used in multiple remote component host types\n// multiple host types includes: HTML custom element for remote components and Next.js host application\n// we are using this shared function to patch a Webpack module map\n// to use shared modules between the host application and the remote component\nexport function applySharedModules(\n bundle: string,\n resolve: Record<string, unknown>,\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) => unknown) & {\n m?: Record<string | number, (module: { exports: unknown }) => void>;\n }\n >;\n // webpack module map for each bundle used in production builds\n __remote_webpack_module_map__?: Record<string, Record<string, number>>;\n } & Record<string, string[]>;\n\n // if we have the bundle\n if (self.__remote_webpack_require__?.[bundle]) {\n const modulePaths = Object.keys(\n self.__remote_webpack_module_map__?.[bundle] ??\n self.__remote_webpack_require__[bundle].m ??\n {},\n );\n // patch all modules in the bundle to use the shared modules\n for (const [key, value] of Object.entries(resolve)) {\n const ids = modulePaths.filter((p) => p.includes(key));\n for (let id of ids) {\n const webpackBundle = self.__remote_webpack_require__[bundle];\n if (webpackBundle.m) {\n // if we have a module map, we need to use the mapped id\n // this is required for production builds where the module ids are module id numbers\n if (self.__remote_webpack_module_map__?.[bundle]?.[id]) {\n id = `${self.__remote_webpack_module_map__[bundle][id]}`;\n }\n // create a mock module which exports the shared module\n webpackBundle.m[id] = (module) => {\n module.exports = value;\n };\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,SAAS,mBACd,QACA,SACA;AAEA,QAAM,OAAO;AAab,MAAI,KAAK,6BAA6B,MAAM,GAAG;AAC7C,UAAM,cAAc,OAAO;AAAA,MACzB,KAAK,gCAAgC,MAAM,KACzC,KAAK,2BAA2B,MAAM,EAAE,KACxC,CAAC;AAAA,IACL;AAEA,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,GAAG;AAClD,YAAM,MAAM,YAAY,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,CAAC;AACrD,eAAS,MAAM,KAAK;AAClB,cAAM,gBAAgB,KAAK,2BAA2B,MAAM;AAC5D,YAAI,cAAc,GAAG;AAGnB,cAAI,KAAK,gCAAgC,MAAM,IAAI,EAAE,GAAG;AACtD,iBAAK,GAAG,KAAK,8BAA8B,MAAM,EAAE,EAAE;AAAA,UACvD;AAEA,wBAAc,EAAE,EAAE,IAAI,CAACA,YAAW;AAChC,YAAAA,QAAO,UAAU;AAAA,UACnB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["module"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function applySharedModules(bundle, resolve) {
|
|
2
|
+
const self = globalThis;
|
|
3
|
+
if (self.__remote_webpack_require__?.[bundle]) {
|
|
4
|
+
const modulePaths = Object.keys(
|
|
5
|
+
self.__remote_webpack_module_map__?.[bundle] ?? self.__remote_webpack_require__[bundle].m ?? {}
|
|
6
|
+
);
|
|
7
|
+
for (const [key, value] of Object.entries(resolve)) {
|
|
8
|
+
const ids = modulePaths.filter((p) => p.includes(key));
|
|
9
|
+
for (let id of ids) {
|
|
10
|
+
const webpackBundle = self.__remote_webpack_require__[bundle];
|
|
11
|
+
if (webpackBundle.m) {
|
|
12
|
+
if (self.__remote_webpack_module_map__?.[bundle]?.[id]) {
|
|
13
|
+
id = `${self.__remote_webpack_module_map__[bundle][id]}`;
|
|
14
|
+
}
|
|
15
|
+
webpackBundle.m[id] = (module) => {
|
|
16
|
+
module.exports = value;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
applySharedModules
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=shared-modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/shared/webpack/shared-modules.ts"],"sourcesContent":["// Webpack shared module patching\n// used in multiple remote component host types\n// multiple host types includes: HTML custom element for remote components and Next.js host application\n// we are using this shared function to patch a Webpack module map\n// to use shared modules between the host application and the remote component\nexport function applySharedModules(\n bundle: string,\n resolve: Record<string, unknown>,\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) => unknown) & {\n m?: Record<string | number, (module: { exports: unknown }) => void>;\n }\n >;\n // webpack module map for each bundle used in production builds\n __remote_webpack_module_map__?: Record<string, Record<string, number>>;\n } & Record<string, string[]>;\n\n // if we have the bundle\n if (self.__remote_webpack_require__?.[bundle]) {\n const modulePaths = Object.keys(\n self.__remote_webpack_module_map__?.[bundle] ??\n self.__remote_webpack_require__[bundle].m ??\n {},\n );\n // patch all modules in the bundle to use the shared modules\n for (const [key, value] of Object.entries(resolve)) {\n const ids = modulePaths.filter((p) => p.includes(key));\n for (let id of ids) {\n const webpackBundle = self.__remote_webpack_require__[bundle];\n if (webpackBundle.m) {\n // if we have a module map, we need to use the mapped id\n // this is required for production builds where the module ids are module id numbers\n if (self.__remote_webpack_module_map__?.[bundle]?.[id]) {\n id = `${self.__remote_webpack_module_map__[bundle][id]}`;\n }\n // create a mock module which exports the shared module\n webpackBundle.m[id] = (module) => {\n module.exports = value;\n };\n }\n }\n }\n }\n}\n"],"mappings":"AAKO,SAAS,mBACd,QACA,SACA;AAEA,QAAM,OAAO;AAab,MAAI,KAAK,6BAA6B,MAAM,GAAG;AAC7C,UAAM,cAAc,OAAO;AAAA,MACzB,KAAK,gCAAgC,MAAM,KACzC,KAAK,2BAA2B,MAAM,EAAE,KACxC,CAAC;AAAA,IACL;AAEA,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,GAAG;AAClD,YAAM,MAAM,YAAY,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,CAAC;AACrD,eAAS,MAAM,KAAK;AAClB,cAAM,gBAAgB,KAAK,2BAA2B,MAAM;AAC5D,YAAI,cAAc,GAAG;AAGnB,cAAI,KAAK,gCAAgC,MAAM,IAAI,EAAE,GAAG;AACtD,iBAAK,GAAG,KAAK,8BAA8B,MAAM,EAAE,EAAE;AAAA,UACvD;AAEA,wBAAc,EAAE,EAAE,IAAI,CAAC,WAAW;AAChC,mBAAO,UAAU;AAAA,UACnB;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|