remote-components 0.0.30 → 0.0.32
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/component-loader-e5513139.d.ts +76 -0
- package/dist/html/host.cjs +198 -75
- package/dist/html/host.cjs.map +1 -1
- package/dist/html/host.js +198 -75
- package/dist/html/host.js.map +1 -1
- package/dist/internal/next/remote/render-client.cjs +7 -3
- package/dist/internal/next/remote/render-client.cjs.map +1 -1
- package/dist/internal/next/remote/render-client.d.ts +2 -1
- package/dist/internal/next/remote/render-client.js +5 -2
- package/dist/internal/next/remote/render-client.js.map +1 -1
- package/dist/internal/shared/client/remote-component.cjs +198 -75
- package/dist/internal/shared/client/remote-component.cjs.map +1 -1
- package/dist/internal/shared/client/remote-component.d.ts +3 -74
- package/dist/internal/shared/client/remote-component.js +198 -75
- package/dist/internal/shared/client/remote-component.js.map +1 -1
- package/dist/next/config.cjs +0 -2
- package/dist/next/config.cjs.map +1 -1
- package/dist/next/config.js +0 -2
- package/dist/next/config.js.map +1 -1
- package/dist/next/host/client/index.cjs +1704 -10
- package/dist/next/host/client/index.cjs.map +1 -1
- package/dist/next/host/client/index.d.ts +38 -5
- package/dist/next/host/client/index.js +1709 -10
- package/dist/next/host/client/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
interface RemoteComponentMetadata {
|
|
4
|
+
bundle: string;
|
|
5
|
+
route: string;
|
|
6
|
+
runtime: 'webpack' | 'turbopack';
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface RemoteComponentProps {
|
|
11
|
+
url: string;
|
|
12
|
+
name: string;
|
|
13
|
+
bundle: string;
|
|
14
|
+
route?: string;
|
|
15
|
+
runtime?: RemoteComponentMetadata['runtime'];
|
|
16
|
+
data: string[];
|
|
17
|
+
nextData?: {
|
|
18
|
+
props: {
|
|
19
|
+
pageProps: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
buildId?: string;
|
|
22
|
+
} | null;
|
|
23
|
+
scripts?: {
|
|
24
|
+
src: string;
|
|
25
|
+
}[];
|
|
26
|
+
links?: Record<string, string | boolean | undefined>[];
|
|
27
|
+
remoteShared?: Record<string, string>;
|
|
28
|
+
isolate?: boolean;
|
|
29
|
+
mode?: 'open' | 'closed';
|
|
30
|
+
reset?: boolean;
|
|
31
|
+
children: react.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
interface GlobalScope {
|
|
34
|
+
__DISABLE_WEBPACK_EXEC__?: Record<string, boolean>;
|
|
35
|
+
__webpack_chunk_load__?: (chunkId: string, scriptBundle?: string) => Promise<unknown> | undefined;
|
|
36
|
+
__original_webpack_chunk_load__?: (chunkId: string, scriptBundle?: string) => Promise<unknown> | undefined;
|
|
37
|
+
__webpack_require__?: (id: string) => unknown;
|
|
38
|
+
__webpack_get_script_filename__?: (id: string) => string | null | undefined;
|
|
39
|
+
__original_webpack_require__?: (id: string) => unknown;
|
|
40
|
+
__remote_webpack_require__?: Record<string, ((remoteId: string | number) => unknown) & {
|
|
41
|
+
c?: Record<string | number, {
|
|
42
|
+
id: string;
|
|
43
|
+
parents: string[];
|
|
44
|
+
children: string[];
|
|
45
|
+
}>;
|
|
46
|
+
m?: Record<string | number, (module: {
|
|
47
|
+
exports: unknown;
|
|
48
|
+
}) => void>;
|
|
49
|
+
type?: 'turbopack' | 'webpack';
|
|
50
|
+
}>;
|
|
51
|
+
__webpack_require_type__?: RemoteComponentMetadata['runtime'];
|
|
52
|
+
__remote_shared_modules__?: Record<string, Record<string, unknown>>;
|
|
53
|
+
__remote_bundle_url__?: Record<string, string | URL>;
|
|
54
|
+
__remote_components_turbopack_chunk_loader_promise__?: Record<string, Promise<unknown>>;
|
|
55
|
+
__remote_components_turbopack_modules__?: Record<string, Record<string, unknown>>;
|
|
56
|
+
__remote_components_turbopack_global__?: Record<string, unknown>;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
interface LoaderResult {
|
|
60
|
+
component: react.ReactNode;
|
|
61
|
+
error?: Error;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type LoadRemoteComponentProps = Pick<RemoteComponentProps, 'name' | 'bundle' | 'route' | 'runtime' | 'data' | 'nextData' | 'scripts'> & {
|
|
65
|
+
url: URL;
|
|
66
|
+
shared: Promise<Record<string, (bundle?: string) => Promise<unknown>>> | Record<string, (bundle?: string) => Promise<unknown>>;
|
|
67
|
+
remoteShared: Record<string, string>;
|
|
68
|
+
container?: HTMLHeadElement | ShadowRoot | null;
|
|
69
|
+
rscName?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Main loader function that orchestrates the component loading process
|
|
73
|
+
*/
|
|
74
|
+
declare function loadRemoteComponent({ url, name, rscName, bundle, route, runtime, data, nextData, scripts, shared, remoteShared, container, }: LoadRemoteComponentProps): Promise<LoaderResult>;
|
|
75
|
+
|
|
76
|
+
export { GlobalScope as G, LoaderResult as L, RemoteComponentProps as R, LoadRemoteComponentProps as a, loadRemoteComponent as l };
|
package/dist/html/host.cjs
CHANGED
|
@@ -212,19 +212,6 @@ async function setupWebpackRuntime(runtime, scripts = [], url = new URL(location
|
|
|
212
212
|
}
|
|
213
213
|
self.__remote_bundle_url__[bundle ?? "default"] = url;
|
|
214
214
|
self.__webpack_get_script_filename__ = () => null;
|
|
215
|
-
await initializeSharedModules(
|
|
216
|
-
bundle ?? "default",
|
|
217
|
-
// include all core modules as shared
|
|
218
|
-
{
|
|
219
|
-
react: async () => (await import("react")).default,
|
|
220
|
-
"react-dom": async () => (await import("react-dom")).default,
|
|
221
|
-
"react/jsx-dev-runtime": async () => (await import("react/jsx-dev-runtime")).default,
|
|
222
|
-
"react/jsx-runtime": async () => (await import("react/jsx-runtime")).default,
|
|
223
|
-
"react-dom/client": async () => (await import("react-dom/client")).default,
|
|
224
|
-
...shared
|
|
225
|
-
},
|
|
226
|
-
remoteShared
|
|
227
|
-
);
|
|
228
215
|
if (typeof self.__webpack_require__ !== "function" || self.__webpack_require_type__ !== "turbopack") {
|
|
229
216
|
if (!self.__original_webpack_require__ && !self.__original_webpack_chunk_load__) {
|
|
230
217
|
self.__original_webpack_chunk_load__ = self.__webpack_chunk_load__;
|
|
@@ -249,6 +236,19 @@ async function setupWebpackRuntime(runtime, scripts = [], url = new URL(location
|
|
|
249
236
|
})
|
|
250
237
|
);
|
|
251
238
|
}
|
|
239
|
+
await initializeSharedModules(
|
|
240
|
+
bundle ?? "default",
|
|
241
|
+
// include all core modules as shared
|
|
242
|
+
{
|
|
243
|
+
react: async () => (await import("react")).default,
|
|
244
|
+
"react-dom": async () => (await import("react-dom")).default,
|
|
245
|
+
"react/jsx-dev-runtime": async () => (await import("react/jsx-dev-runtime")).default,
|
|
246
|
+
"react/jsx-runtime": async () => (await import("react/jsx-runtime")).default,
|
|
247
|
+
"react-dom/client": async () => (await import("react-dom/client")).default,
|
|
248
|
+
...shared
|
|
249
|
+
},
|
|
250
|
+
remoteShared
|
|
251
|
+
);
|
|
252
252
|
}
|
|
253
253
|
function createChunkLoader(runtime) {
|
|
254
254
|
return function __turbopack_chunk_load__(chunkId, scriptBundle) {
|
|
@@ -326,6 +326,7 @@ async function handleTurbopackChunk(code, bundle, url) {
|
|
|
326
326
|
});
|
|
327
327
|
const scriptUrl = URL.createObjectURL(blob);
|
|
328
328
|
const script = document.createElement("script");
|
|
329
|
+
script.setAttribute("data-turbopack-src", url);
|
|
329
330
|
script.src = scriptUrl;
|
|
330
331
|
script.async = true;
|
|
331
332
|
script.onload = () => {
|
|
@@ -400,17 +401,84 @@ function createModuleRequire(runtime) {
|
|
|
400
401
|
}
|
|
401
402
|
};
|
|
402
403
|
}
|
|
403
|
-
function initializeSharedModules(bundle,
|
|
404
|
+
async function initializeSharedModules(bundle, hostShared = {}, remoteShared = {}) {
|
|
404
405
|
const self = globalThis;
|
|
405
406
|
self.__remote_shared_modules__ = self.__remote_shared_modules__ ?? {};
|
|
406
407
|
if (!self.__remote_shared_modules__[bundle]) {
|
|
407
408
|
self.__remote_shared_modules__[bundle] = {};
|
|
408
409
|
}
|
|
410
|
+
const bundleKey = getBundleKey(bundle);
|
|
411
|
+
const modules = self[`TURBOPACK_${bundleKey}`];
|
|
412
|
+
let sharedModuleInitializer = null;
|
|
413
|
+
if (modules && Array.isArray(modules)) {
|
|
414
|
+
const allModules = modules.flat();
|
|
415
|
+
const sharedModuleInitializerIndex = allModules.findIndex((idOrFunc) => {
|
|
416
|
+
if (typeof idOrFunc !== "function") {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
const funcCode = idOrFunc.toString();
|
|
420
|
+
return /[a-z]\.TURBOPACK_REMOTE_SHARED/.test(funcCode);
|
|
421
|
+
});
|
|
422
|
+
if (sharedModuleInitializerIndex > 0) {
|
|
423
|
+
const sharedModuleInitializerCode = allModules[sharedModuleInitializerIndex].toString();
|
|
424
|
+
const sharedModuleInitializerId = allModules[sharedModuleInitializerIndex - 1];
|
|
425
|
+
const { sharedModuleId } = /\.TURBOPACK_REMOTE_SHARED=await e\.A\((?<sharedModuleId>[0-9]+)\)/.exec(
|
|
426
|
+
sharedModuleInitializerCode
|
|
427
|
+
)?.groups ?? {};
|
|
428
|
+
if (sharedModuleId) {
|
|
429
|
+
const { default: sharedModuleInitializerInstance } = handleTurbopackModule(
|
|
430
|
+
bundle,
|
|
431
|
+
sharedModuleId,
|
|
432
|
+
`[${bundle}] ${sharedModuleInitializerId}`
|
|
433
|
+
);
|
|
434
|
+
sharedModuleInitializer = sharedModuleInitializerInstance;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
if (sharedModuleInitializer) {
|
|
438
|
+
const { shared } = await sharedModuleInitializer;
|
|
439
|
+
const sharedModuleIds = Object.entries(shared).filter(([, value]) => typeof value === "function").reduce((acc, [key, value]) => {
|
|
440
|
+
const { asyncSharedModuleId } = /e\.A\((?<asyncSharedModuleId>[0-9]+)\)/.exec(value.toString())?.groups ?? {};
|
|
441
|
+
if (asyncSharedModuleId) {
|
|
442
|
+
const asyncSharedModuleIdNumber = Number(asyncSharedModuleId);
|
|
443
|
+
let asyncSharedModule;
|
|
444
|
+
const newAllModules = self[`TURBOPACK_${bundleKey}`]?.flat() ?? [];
|
|
445
|
+
const asyncSharedModuleIdIndex = newAllModules.indexOf(
|
|
446
|
+
asyncSharedModuleIdNumber
|
|
447
|
+
);
|
|
448
|
+
if (asyncSharedModuleIdIndex !== -1 && typeof newAllModules[asyncSharedModuleIdIndex + 1] === "function") {
|
|
449
|
+
asyncSharedModule = newAllModules[asyncSharedModuleIdIndex + 1];
|
|
450
|
+
}
|
|
451
|
+
if (asyncSharedModule) {
|
|
452
|
+
const asyncSharedModuleCode = asyncSharedModule.toString();
|
|
453
|
+
const { sharedModuleId } = /e=>{e\.v\(e=>Promise\.resolve\(\)\.then\(\(\)=>e\((?<sharedModuleId>[0-9]+)\)\)\)}/.exec(
|
|
454
|
+
asyncSharedModuleCode
|
|
455
|
+
)?.groups ?? /e=>{e\.v\(t=>Promise\.all\(\["[^"]+"\].map\(t=>e\.l\(t\)\)\)\.then\(\(\)=>t\((?<sharedModuleId>[0-9]+)\)\)\)}/.exec(
|
|
456
|
+
asyncSharedModuleCode
|
|
457
|
+
)?.groups ?? {};
|
|
458
|
+
acc[sharedModuleId ?? asyncSharedModuleId] = key.replace(
|
|
459
|
+
"__remote_shared_module_",
|
|
460
|
+
""
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return acc;
|
|
465
|
+
}, {});
|
|
466
|
+
return Promise.all(
|
|
467
|
+
Object.entries(sharedModuleIds).map(async ([id, module2]) => {
|
|
468
|
+
if (self.__remote_shared_modules__?.[bundle]) {
|
|
469
|
+
if (hostShared[module2]) {
|
|
470
|
+
self.__remote_shared_modules__[bundle][id] = await hostShared[module2](bundle);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
})
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
409
477
|
return Promise.all(
|
|
410
478
|
Object.entries(remoteShared).map(async ([id, module2]) => {
|
|
411
479
|
if (self.__remote_shared_modules__?.[bundle]) {
|
|
412
|
-
if (
|
|
413
|
-
self.__remote_shared_modules__[bundle][id.replace("[app-ssr]", "[app-client]")] = await
|
|
480
|
+
if (hostShared[module2]) {
|
|
481
|
+
self.__remote_shared_modules__[bundle][id.replace("[app-ssr]", "[app-client]")] = await hostShared[module2](bundle);
|
|
414
482
|
} else {
|
|
415
483
|
console.error(`Shared module "${module2}" not found for "${bundle}".`);
|
|
416
484
|
}
|
|
@@ -434,32 +502,28 @@ function handleTurbopackModule(bundle, moduleId, id) {
|
|
|
434
502
|
const bundleKey = getBundleKey(bundle);
|
|
435
503
|
const modules = self[`TURBOPACK_${bundleKey}`];
|
|
436
504
|
let moduleInit;
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
)
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
moduleInit = mod[index];
|
|
450
|
-
break;
|
|
451
|
-
}
|
|
452
|
-
} else {
|
|
453
|
-
const map = mod[1];
|
|
454
|
-
if (moduleId in map) {
|
|
455
|
-
moduleInit = map[moduleId];
|
|
456
|
-
break;
|
|
505
|
+
const allModules = modules?.flat() ?? [];
|
|
506
|
+
if (typeof allModules[1] === "string" || typeof allModules[1] === "number") {
|
|
507
|
+
const normalizedId = /^[0-9]+$/.test(moduleId) ? Number(moduleId) : moduleId;
|
|
508
|
+
let moduleIdIndex = allModules.indexOf(normalizedId);
|
|
509
|
+
if (moduleIdIndex === -1) {
|
|
510
|
+
moduleIdIndex = allModules.findIndex(
|
|
511
|
+
(bundleEntry) => typeof bundleEntry === "string" && bundleEntry.startsWith(moduleId) || bundleEntry === normalizedId
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
if (moduleIdIndex !== -1) {
|
|
515
|
+
while (typeof allModules[moduleIdIndex] !== "function" && moduleIdIndex < allModules.length) {
|
|
516
|
+
moduleIdIndex++;
|
|
457
517
|
}
|
|
518
|
+
moduleInit = allModules[moduleIdIndex];
|
|
458
519
|
}
|
|
520
|
+
} else {
|
|
521
|
+
moduleInit = allModules.find(
|
|
522
|
+
(bundleEntry) => typeof bundleEntry === "object" && bundleEntry !== null && moduleId in bundleEntry
|
|
523
|
+
)?.[moduleId];
|
|
459
524
|
}
|
|
460
525
|
const exports = {};
|
|
461
526
|
const moduleExports = { exports };
|
|
462
|
-
const exportNames = /* @__PURE__ */ new Set();
|
|
463
527
|
if (!self.__remote_components_turbopack_modules__) {
|
|
464
528
|
self.__remote_components_turbopack_modules__ = {};
|
|
465
529
|
}
|
|
@@ -495,43 +559,80 @@ function handleTurbopackModule(bundle, moduleId, id) {
|
|
|
495
559
|
};
|
|
496
560
|
}
|
|
497
561
|
},
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
562
|
+
// esm
|
|
563
|
+
s(bindings, esmId) {
|
|
564
|
+
let mod = exports;
|
|
565
|
+
if (typeof esmId === "string" || typeof esmId === "number") {
|
|
566
|
+
if (!self.__remote_components_turbopack_modules__) {
|
|
567
|
+
self.__remote_components_turbopack_modules__ = {};
|
|
568
|
+
}
|
|
569
|
+
if (!self.__remote_components_turbopack_modules__[bundle]) {
|
|
570
|
+
self.__remote_components_turbopack_modules__[bundle] = {};
|
|
571
|
+
}
|
|
572
|
+
if (!self.__remote_components_turbopack_modules__[bundle][esmId]) {
|
|
573
|
+
self.__remote_components_turbopack_modules__[bundle][esmId] = {};
|
|
574
|
+
}
|
|
575
|
+
mod = self.__remote_components_turbopack_modules__[bundle][esmId];
|
|
576
|
+
}
|
|
577
|
+
Object.defineProperty(mod, "__esModule", { value: true });
|
|
578
|
+
if (Array.isArray(bindings)) {
|
|
579
|
+
let i = 0;
|
|
580
|
+
while (i < bindings.length) {
|
|
581
|
+
const propName = bindings[i++];
|
|
582
|
+
const tagOrFunc = bindings[i++];
|
|
583
|
+
if (typeof tagOrFunc === "number") {
|
|
584
|
+
Object.defineProperty(mod, propName, {
|
|
585
|
+
value: bindings[i++],
|
|
586
|
+
enumerable: true,
|
|
587
|
+
writable: false
|
|
588
|
+
});
|
|
589
|
+
} else {
|
|
590
|
+
const getterFn = tagOrFunc;
|
|
591
|
+
if (typeof bindings[i] === "function") {
|
|
592
|
+
const setterFn = bindings[i++];
|
|
593
|
+
Object.defineProperty(mod, propName, {
|
|
594
|
+
get: getterFn,
|
|
595
|
+
set: setterFn,
|
|
596
|
+
enumerable: true
|
|
597
|
+
});
|
|
598
|
+
} else {
|
|
599
|
+
Object.defineProperty(mod, propName, {
|
|
600
|
+
get: getterFn,
|
|
601
|
+
enumerable: true
|
|
602
|
+
});
|
|
512
603
|
}
|
|
513
604
|
}
|
|
514
605
|
}
|
|
515
606
|
}
|
|
516
|
-
for (const [key, value] of Object.entries(mod)) {
|
|
517
|
-
exports[key] = value;
|
|
518
|
-
exportNames.add(key);
|
|
519
|
-
}
|
|
520
607
|
},
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
608
|
+
// import
|
|
609
|
+
i(importId) {
|
|
610
|
+
let mod;
|
|
611
|
+
if (typeof importId === "string") {
|
|
612
|
+
const { exportSource, exportName } = /\s+<export (?<exportSource>.*?) as (?<exportName>.*?)>$/.exec(
|
|
613
|
+
importId
|
|
614
|
+
)?.groups ?? {};
|
|
615
|
+
const normalizedId = importId.replace(
|
|
616
|
+
/\s+<export(?<specifier>.*)>$/,
|
|
617
|
+
""
|
|
618
|
+
);
|
|
619
|
+
mod = self.__webpack_require__?.(
|
|
620
|
+
`[${bundle}] ${normalizedId}`
|
|
621
|
+
);
|
|
622
|
+
if (exportSource && exportName && (exportSource === "*" || typeof mod[exportSource] !== "undefined") && typeof mod[exportName] === "undefined") {
|
|
623
|
+
if (exportSource === "*") {
|
|
624
|
+
mod[exportName] = mod;
|
|
625
|
+
} else {
|
|
626
|
+
mod[exportName] = mod[exportSource];
|
|
627
|
+
}
|
|
532
628
|
}
|
|
629
|
+
} else {
|
|
630
|
+
mod = self.__webpack_require__?.(`[${bundle}] ${importId}`);
|
|
533
631
|
}
|
|
534
|
-
if (
|
|
632
|
+
if (typeof mod !== "object") {
|
|
633
|
+
mod = { default: mod };
|
|
634
|
+
} else if (!("default" in mod) && // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
635
|
+
mod.toString() !== "[object Module]") {
|
|
535
636
|
try {
|
|
536
637
|
mod.default = mod;
|
|
537
638
|
} catch {
|
|
@@ -539,12 +640,21 @@ function handleTurbopackModule(bundle, moduleId, id) {
|
|
|
539
640
|
}
|
|
540
641
|
return mod;
|
|
541
642
|
},
|
|
542
|
-
|
|
543
|
-
|
|
643
|
+
// require
|
|
644
|
+
r(requireId) {
|
|
645
|
+
return self.__webpack_require__?.(`[${bundle}] ${requireId}`);
|
|
544
646
|
},
|
|
647
|
+
// value exports
|
|
545
648
|
v(value) {
|
|
546
|
-
|
|
649
|
+
if (typeof value === "function") {
|
|
650
|
+
exports.default = value((vid) => {
|
|
651
|
+
return self.__webpack_require__?.(`[${bundle}] ${vid}`);
|
|
652
|
+
});
|
|
653
|
+
} else {
|
|
654
|
+
moduleExports.exports = value;
|
|
655
|
+
}
|
|
547
656
|
},
|
|
657
|
+
// async module initializer
|
|
548
658
|
async a(mod) {
|
|
549
659
|
let result;
|
|
550
660
|
await mod(
|
|
@@ -554,12 +664,30 @@ function handleTurbopackModule(bundle, moduleId, id) {
|
|
|
554
664
|
);
|
|
555
665
|
exports.default = result;
|
|
556
666
|
},
|
|
667
|
+
// async module loader
|
|
557
668
|
async A(Aid) {
|
|
558
669
|
const mod = self.__webpack_require__?.(`[${bundle}] ${Aid}`);
|
|
559
670
|
return mod.default(
|
|
560
671
|
(parentId) => self.__webpack_require__?.(`[${bundle}] ${parentId}`)
|
|
561
672
|
);
|
|
562
673
|
},
|
|
674
|
+
// chunk loader
|
|
675
|
+
l(url) {
|
|
676
|
+
const moduleInitIndex = allModules.indexOf(moduleInit);
|
|
677
|
+
if (moduleInitIndex !== -1) {
|
|
678
|
+
const scriptIndex = allModules.slice(0, moduleInitIndex).findLastIndex((bundleEntry) => bundleEntry instanceof Element);
|
|
679
|
+
if (scriptIndex !== -1) {
|
|
680
|
+
const script = allModules[scriptIndex];
|
|
681
|
+
const scriptSrc = script.getAttribute("data-turbopack-src") || "";
|
|
682
|
+
const nextIndex = scriptSrc.indexOf("/_next");
|
|
683
|
+
const baseUrl = nextIndex !== -1 ? scriptSrc.slice(0, nextIndex) : "";
|
|
684
|
+
const bundleUrl = `[${bundle}] ${baseUrl}/_next/${url}`;
|
|
685
|
+
return self.__webpack_chunk_load__?.(bundleUrl, bundle);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
throw new Error(`Failed to load chunk ${url} for module ${id}`);
|
|
689
|
+
},
|
|
690
|
+
// global
|
|
563
691
|
g: self.__remote_components_turbopack_global__[bundle],
|
|
564
692
|
m: moduleExports,
|
|
565
693
|
e: exports
|
|
@@ -567,11 +695,6 @@ function handleTurbopackModule(bundle, moduleId, id) {
|
|
|
567
695
|
moduleExports,
|
|
568
696
|
exports
|
|
569
697
|
);
|
|
570
|
-
for (const name of exportNames) {
|
|
571
|
-
if (typeof exports[name] === "function") {
|
|
572
|
-
exports[name] = exports[name]();
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
698
|
if (self.__remote_components_turbopack_modules__[bundle][moduleId] !== moduleExports.exports) {
|
|
576
699
|
self.__remote_components_turbopack_modules__[bundle][moduleId] = moduleExports.exports;
|
|
577
700
|
}
|