remote-components 0.0.41 → 0.0.42
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/html/host.cjs +429 -312
- package/dist/html/host.cjs.map +1 -1
- package/dist/html/host.js +429 -312
- package/dist/html/host.js.map +1 -1
- package/dist/html/remote.cjs.map +1 -1
- package/dist/html/remote.js.map +1 -1
- package/dist/internal/shared/client/remote-component.cjs +404 -304
- package/dist/internal/shared/client/remote-component.cjs.map +1 -1
- package/dist/internal/shared/client/remote-component.d.ts +10 -1
- package/dist/internal/shared/client/remote-component.js +404 -304
- package/dist/internal/shared/client/remote-component.js.map +1 -1
- package/dist/internal/shared/error.cjs +4 -4
- package/dist/internal/shared/error.cjs.map +1 -1
- package/dist/internal/shared/error.d.ts +5 -2
- package/dist/internal/shared/error.js +4 -4
- package/dist/internal/shared/error.js.map +1 -1
- package/dist/internal/shared/ssr/fetch-remote-component.cjs +22 -7
- package/dist/internal/shared/ssr/fetch-remote-component.cjs.map +1 -1
- package/dist/internal/shared/ssr/fetch-remote-component.js +22 -7
- package/dist/internal/shared/ssr/fetch-remote-component.js.map +1 -1
- package/dist/internal/webpack/shared-modules.cjs +36 -1
- package/dist/internal/webpack/shared-modules.cjs.map +1 -1
- package/dist/internal/webpack/shared-modules.js +36 -1
- package/dist/internal/webpack/shared-modules.js.map +1 -1
- package/dist/next/host/client/index.cjs +412 -311
- package/dist/next/host/client/index.cjs.map +1 -1
- package/dist/next/host/client/index.js +412 -311
- package/dist/next/host/client/index.js.map +1 -1
- package/dist/react/index.cjs +4 -3
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +4 -3
- package/dist/react/index.js.map +1 -1
- package/package.json +4 -6
package/dist/html/host.js
CHANGED
|
@@ -10,14 +10,14 @@ var __export = (target, all) => {
|
|
|
10
10
|
|
|
11
11
|
// src/shared/error.ts
|
|
12
12
|
function multipleRemoteComponentsError(url) {
|
|
13
|
-
return new
|
|
13
|
+
return new RemoteComponentsError(
|
|
14
14
|
`Multiple Remote Components found at "${url}". When a page exposes multiple Remote Components you must specify the "name" prop to select which one to load.`
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
|
-
function failedToFetchRemoteComponentError(url,
|
|
17
|
+
function failedToFetchRemoteComponentError(url, { status, statusText }, help = "Is the URL correct and accessible?") {
|
|
18
18
|
return new RemoteComponentsError(
|
|
19
|
-
`Failed to fetch Remote Component from "${url}".
|
|
20
|
-
{ cause:
|
|
19
|
+
`Failed to fetch Remote Component from "${url}". ${help}`,
|
|
20
|
+
{ cause: new Error(`${status} ${statusText}`) }
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
23
|
var RemoteComponentsError;
|
|
@@ -34,6 +34,24 @@ var init_error = __esm({
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
+
// src/shared/utils/logger.ts
|
|
38
|
+
function logDebug(location2, message) {
|
|
39
|
+
if (DEBUG) {
|
|
40
|
+
console.debug(`[${PREFIX}:${location2}]: ${message}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function logWarn(location2, message) {
|
|
44
|
+
console.warn(`[${PREFIX}:${location2}]: ${message}`);
|
|
45
|
+
}
|
|
46
|
+
var PREFIX, DEBUG;
|
|
47
|
+
var init_logger = __esm({
|
|
48
|
+
"src/shared/utils/logger.ts"() {
|
|
49
|
+
"use strict";
|
|
50
|
+
PREFIX = "remote-components";
|
|
51
|
+
DEBUG = typeof window !== "undefined" && localStorage.getItem("RC_DEBUG") === "true";
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
37
55
|
// src/shared/webpack/next-client-pages-loader.ts
|
|
38
56
|
function nextClientPagesLoader(bundle, route, styleContainer = document.head) {
|
|
39
57
|
const self = globalThis;
|
|
@@ -154,33 +172,68 @@ var init_next_client_pages_loader = __esm({
|
|
|
154
172
|
|
|
155
173
|
// src/shared/webpack/shared-modules.ts
|
|
156
174
|
function applySharedModules(bundle, resolve) {
|
|
175
|
+
logDebug(
|
|
176
|
+
"SharedModules",
|
|
177
|
+
`applySharedModules called for bundle: "${bundle}"`
|
|
178
|
+
);
|
|
179
|
+
logDebug(
|
|
180
|
+
"SharedModules",
|
|
181
|
+
`Shared modules to resolve: ${Object.keys(resolve)}`
|
|
182
|
+
);
|
|
157
183
|
const self = globalThis;
|
|
158
184
|
if (self.__remote_webpack_require__?.[bundle]) {
|
|
159
185
|
const modulePaths = Object.keys(
|
|
160
186
|
self.__remote_webpack_module_map__?.[bundle] ?? self.__remote_webpack_require__[bundle].m ?? {}
|
|
161
187
|
);
|
|
188
|
+
logDebug(
|
|
189
|
+
"SharedModules",
|
|
190
|
+
`Available module paths in __remote_webpack_require__[${bundle}]: ${modulePaths}`
|
|
191
|
+
);
|
|
162
192
|
for (const [key, value] of Object.entries(resolve)) {
|
|
163
193
|
let ids = modulePaths.filter((p) => p === key);
|
|
164
194
|
if (ids.length === 0) {
|
|
165
195
|
ids = modulePaths.filter((p) => p.includes(key));
|
|
166
196
|
}
|
|
197
|
+
if (ids.length === 0) {
|
|
198
|
+
logDebug(
|
|
199
|
+
"SharedModules",
|
|
200
|
+
`No matching module path found for shared module "${key}"`
|
|
201
|
+
);
|
|
202
|
+
}
|
|
167
203
|
for (let id of ids) {
|
|
168
204
|
const webpackBundle = self.__remote_webpack_require__[bundle];
|
|
169
205
|
if (webpackBundle.m) {
|
|
170
206
|
if (self.__remote_webpack_module_map__?.[bundle]?.[id]) {
|
|
171
|
-
|
|
207
|
+
const mappedId = `${self.__remote_webpack_module_map__[bundle][id]}`;
|
|
208
|
+
logDebug(
|
|
209
|
+
"SharedModules",
|
|
210
|
+
`Mapped module id: "${id}" -> "${mappedId}"`
|
|
211
|
+
);
|
|
212
|
+
id = mappedId;
|
|
172
213
|
}
|
|
173
214
|
webpackBundle.m[id] = (module) => {
|
|
174
215
|
module.exports = value;
|
|
175
216
|
};
|
|
217
|
+
} else {
|
|
218
|
+
logWarn(
|
|
219
|
+
"SharedModules",
|
|
220
|
+
`webpackBundle.m is not available for bundle "${bundle}"`
|
|
221
|
+
);
|
|
176
222
|
}
|
|
177
223
|
}
|
|
178
224
|
}
|
|
225
|
+
} else {
|
|
226
|
+
logWarn("SharedModules", `No webpack require found for bundle "${bundle}"`);
|
|
227
|
+
logDebug(
|
|
228
|
+
"SharedModules",
|
|
229
|
+
`Available bundles: ${Object.keys(self.__remote_webpack_require__ ?? {})}`
|
|
230
|
+
);
|
|
179
231
|
}
|
|
180
232
|
}
|
|
181
233
|
var init_shared_modules = __esm({
|
|
182
234
|
"src/shared/webpack/shared-modules.ts"() {
|
|
183
235
|
"use strict";
|
|
236
|
+
init_logger();
|
|
184
237
|
}
|
|
185
238
|
});
|
|
186
239
|
|
|
@@ -209,52 +262,7 @@ var init_const = __esm({
|
|
|
209
262
|
}
|
|
210
263
|
});
|
|
211
264
|
|
|
212
|
-
// src/shared/client/
|
|
213
|
-
async function setupWebpackRuntime(runtime, scripts = [], url = new URL(location.href), bundle, shared = {}, remoteShared = {}) {
|
|
214
|
-
const self = globalThis;
|
|
215
|
-
if (!self.__remote_bundle_url__) {
|
|
216
|
-
self.__remote_bundle_url__ = {};
|
|
217
|
-
}
|
|
218
|
-
self.__remote_bundle_url__[bundle ?? "default"] = url;
|
|
219
|
-
self.__webpack_get_script_filename__ = () => null;
|
|
220
|
-
if (typeof self.__webpack_require__ !== "function" || self.__webpack_require_type__ !== "turbopack") {
|
|
221
|
-
if (!self.__original_webpack_require__ && !self.__original_webpack_chunk_load__) {
|
|
222
|
-
self.__original_webpack_chunk_load__ = self.__webpack_chunk_load__;
|
|
223
|
-
self.__original_webpack_require__ = self.__webpack_require__;
|
|
224
|
-
}
|
|
225
|
-
self.__webpack_chunk_load__ = createChunkLoader(runtime);
|
|
226
|
-
self.__webpack_require__ = createModuleRequire(runtime);
|
|
227
|
-
self.__webpack_require_type__ = runtime;
|
|
228
|
-
if (self.__remote_webpack_require__ && runtime === RUNTIME_TURBOPACK) {
|
|
229
|
-
const remoteBundle = bundle ?? "default";
|
|
230
|
-
self.__remote_webpack_require__[remoteBundle] = self.__webpack_require__;
|
|
231
|
-
self.__remote_webpack_require__[remoteBundle].type = "turbopack";
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
if (runtime === RUNTIME_TURBOPACK) {
|
|
235
|
-
await Promise.all(
|
|
236
|
-
scripts.map((script) => {
|
|
237
|
-
if (script.src) {
|
|
238
|
-
return self.__webpack_chunk_load__?.(script.src, bundle);
|
|
239
|
-
}
|
|
240
|
-
return Promise.resolve(void 0);
|
|
241
|
-
})
|
|
242
|
-
);
|
|
243
|
-
}
|
|
244
|
-
await initializeSharedModules(
|
|
245
|
-
bundle ?? "default",
|
|
246
|
-
// include all core modules as shared
|
|
247
|
-
{
|
|
248
|
-
react: async () => (await import("react")).default,
|
|
249
|
-
"react-dom": async () => (await import("react-dom")).default,
|
|
250
|
-
"react/jsx-dev-runtime": async () => (await import("react/jsx-dev-runtime")).default,
|
|
251
|
-
"react/jsx-runtime": async () => (await import("react/jsx-runtime")).default,
|
|
252
|
-
"react-dom/client": async () => (await import("react-dom/client")).default,
|
|
253
|
-
...shared
|
|
254
|
-
},
|
|
255
|
-
remoteShared
|
|
256
|
-
);
|
|
257
|
-
}
|
|
265
|
+
// src/shared/client/chunk-loader.ts
|
|
258
266
|
function createChunkLoader(runtime) {
|
|
259
267
|
return function __turbopack_chunk_load__(chunkId, scriptBundle) {
|
|
260
268
|
const self = globalThis;
|
|
@@ -369,46 +377,251 @@ async function handleTurbopackChunk(code, bundle, url) {
|
|
|
369
377
|
await Promise.all(loadChunkLists);
|
|
370
378
|
}
|
|
371
379
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
380
|
+
var init_chunk_loader = __esm({
|
|
381
|
+
"src/shared/client/chunk-loader.ts"() {
|
|
382
|
+
"use strict";
|
|
383
|
+
init_error();
|
|
384
|
+
init_const();
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
// src/shared/client/turbopack-module.ts
|
|
389
|
+
function handleTurbopackModule(bundle, moduleId, id) {
|
|
390
|
+
const self = globalThis;
|
|
391
|
+
const bundleKey = getBundleKey(bundle);
|
|
392
|
+
const modules = self[`TURBOPACK_${bundleKey}`];
|
|
393
|
+
const moduleInit = findModuleInit(modules, moduleId);
|
|
394
|
+
const exports = {};
|
|
395
|
+
const moduleExports = { exports };
|
|
396
|
+
if (!self.__remote_components_turbopack_modules__) {
|
|
397
|
+
self.__remote_components_turbopack_modules__ = {};
|
|
398
|
+
}
|
|
399
|
+
if (!self.__remote_components_turbopack_modules__[bundle]) {
|
|
400
|
+
self.__remote_components_turbopack_modules__[bundle] = {};
|
|
401
|
+
}
|
|
402
|
+
if (self.__remote_components_turbopack_modules__[bundle][moduleId]) {
|
|
403
|
+
return self.__remote_components_turbopack_modules__[bundle][moduleId];
|
|
404
|
+
}
|
|
405
|
+
if (typeof moduleInit !== "function") {
|
|
406
|
+
throw new Error(
|
|
407
|
+
`Module ${id} not found in bundle ${bundle} with id ${moduleId}`
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
self.__remote_components_turbopack_modules__[bundle][moduleId] = moduleExports.exports;
|
|
411
|
+
if (!self.__remote_components_turbopack_global__) {
|
|
412
|
+
self.__remote_components_turbopack_global__ = {};
|
|
413
|
+
}
|
|
414
|
+
if (!self.__remote_components_turbopack_global__[bundle]) {
|
|
415
|
+
self.__remote_components_turbopack_global__[bundle] = {};
|
|
416
|
+
}
|
|
417
|
+
const allModules = modules?.flat() ?? [];
|
|
418
|
+
moduleInit(
|
|
419
|
+
createTurbopackContext(
|
|
420
|
+
bundle,
|
|
421
|
+
exports,
|
|
422
|
+
moduleExports,
|
|
423
|
+
allModules,
|
|
424
|
+
moduleInit,
|
|
425
|
+
id,
|
|
426
|
+
self
|
|
427
|
+
),
|
|
428
|
+
moduleExports,
|
|
429
|
+
exports
|
|
430
|
+
);
|
|
431
|
+
if (self.__remote_components_turbopack_modules__[bundle][moduleId] !== moduleExports.exports) {
|
|
432
|
+
self.__remote_components_turbopack_modules__[bundle][moduleId] = moduleExports.exports;
|
|
433
|
+
}
|
|
434
|
+
return moduleExports.exports;
|
|
435
|
+
}
|
|
436
|
+
function findModuleInit(modules, moduleId) {
|
|
437
|
+
const allModules = modules?.flat() ?? [];
|
|
438
|
+
if (typeof allModules[1] === "string" || typeof allModules[1] === "number") {
|
|
439
|
+
const normalizedId = /^[0-9]+$/.test(moduleId) ? Number(moduleId) : moduleId;
|
|
440
|
+
let moduleIdIndex = allModules.indexOf(normalizedId);
|
|
441
|
+
if (moduleIdIndex === -1) {
|
|
442
|
+
moduleIdIndex = allModules.findIndex(
|
|
443
|
+
(bundleEntry) => typeof bundleEntry === "string" && bundleEntry.startsWith(moduleId) || bundleEntry === normalizedId
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
if (moduleIdIndex !== -1) {
|
|
447
|
+
while (typeof allModules[moduleIdIndex] !== "function" && moduleIdIndex < allModules.length) {
|
|
448
|
+
moduleIdIndex++;
|
|
383
449
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
450
|
+
return allModules[moduleIdIndex];
|
|
451
|
+
}
|
|
452
|
+
} else {
|
|
453
|
+
return allModules.find(
|
|
454
|
+
(bundleEntry) => typeof bundleEntry === "object" && bundleEntry !== null && moduleId in bundleEntry
|
|
455
|
+
)?.[moduleId];
|
|
456
|
+
}
|
|
457
|
+
return void 0;
|
|
458
|
+
}
|
|
459
|
+
function createTurbopackContext(bundle, exports, moduleExports, allModules, moduleInit, id, self) {
|
|
460
|
+
return {
|
|
461
|
+
// HMR not implemented for Remote Components
|
|
462
|
+
k: {
|
|
463
|
+
register() {
|
|
464
|
+
},
|
|
465
|
+
registerExports() {
|
|
466
|
+
},
|
|
467
|
+
signature() {
|
|
468
|
+
return (fn) => fn;
|
|
387
469
|
}
|
|
388
|
-
|
|
389
|
-
|
|
470
|
+
},
|
|
471
|
+
// ESM exports setup
|
|
472
|
+
s(bindings, esmId) {
|
|
473
|
+
let mod = exports;
|
|
474
|
+
if (typeof esmId === "string" || typeof esmId === "number") {
|
|
475
|
+
if (!self.__remote_components_turbopack_modules__) {
|
|
476
|
+
self.__remote_components_turbopack_modules__ = {};
|
|
477
|
+
}
|
|
478
|
+
if (!self.__remote_components_turbopack_modules__[bundle]) {
|
|
479
|
+
self.__remote_components_turbopack_modules__[bundle] = {};
|
|
480
|
+
}
|
|
481
|
+
if (!self.__remote_components_turbopack_modules__[bundle][esmId]) {
|
|
482
|
+
self.__remote_components_turbopack_modules__[bundle][esmId] = {};
|
|
483
|
+
}
|
|
484
|
+
mod = self.__remote_components_turbopack_modules__[bundle][esmId];
|
|
390
485
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
486
|
+
Object.defineProperty(mod, "__esModule", { value: true });
|
|
487
|
+
if (Array.isArray(bindings)) {
|
|
488
|
+
let i = 0;
|
|
489
|
+
while (i < bindings.length) {
|
|
490
|
+
const propName = bindings[i++];
|
|
491
|
+
const tagOrFunc = bindings[i++];
|
|
492
|
+
if (typeof tagOrFunc === "number") {
|
|
493
|
+
Object.defineProperty(mod, propName, {
|
|
494
|
+
value: bindings[i++],
|
|
495
|
+
enumerable: true,
|
|
496
|
+
writable: false
|
|
497
|
+
});
|
|
498
|
+
} else {
|
|
499
|
+
const getterFn = tagOrFunc;
|
|
500
|
+
if (typeof bindings[i] === "function") {
|
|
501
|
+
const setterFn = bindings[i++];
|
|
502
|
+
Object.defineProperty(mod, propName, {
|
|
503
|
+
get: getterFn,
|
|
504
|
+
set: setterFn,
|
|
505
|
+
enumerable: true
|
|
506
|
+
});
|
|
507
|
+
} else {
|
|
508
|
+
Object.defineProperty(mod, propName, {
|
|
509
|
+
get: getterFn,
|
|
510
|
+
enumerable: true
|
|
511
|
+
});
|
|
512
|
+
}
|
|
398
513
|
}
|
|
399
|
-
|
|
514
|
+
}
|
|
400
515
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
516
|
+
},
|
|
517
|
+
// import
|
|
518
|
+
i(importId) {
|
|
519
|
+
let mod;
|
|
520
|
+
if (typeof importId === "string") {
|
|
521
|
+
const { exportSource, exportName } = /\s+<export (?<exportSource>.*?) as (?<exportName>.*?)>$/.exec(
|
|
522
|
+
importId
|
|
523
|
+
)?.groups ?? {};
|
|
524
|
+
const normalizedId = importId.replace(
|
|
525
|
+
/\s+<export(?<specifier>.*)>$/,
|
|
526
|
+
""
|
|
407
527
|
);
|
|
528
|
+
mod = self.__webpack_require__?.(`[${bundle}] ${normalizedId}`);
|
|
529
|
+
if (mod && exportSource && exportName && (exportSource === "*" || typeof mod[exportSource] !== "undefined") && typeof mod[exportName] === "undefined") {
|
|
530
|
+
if (exportSource === "*") {
|
|
531
|
+
mod[exportName] = mod;
|
|
532
|
+
} else {
|
|
533
|
+
mod[exportName] = mod[exportSource];
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
} else {
|
|
537
|
+
mod = self.__webpack_require__?.(`[${bundle}] ${importId}`);
|
|
408
538
|
}
|
|
409
|
-
|
|
539
|
+
if (typeof mod !== "object" || mod === null) {
|
|
540
|
+
mod = { default: mod };
|
|
541
|
+
} else if (!("default" in mod) && mod.toString() !== "[object Module]") {
|
|
542
|
+
try {
|
|
543
|
+
mod.default = mod;
|
|
544
|
+
} catch {
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
return mod;
|
|
548
|
+
},
|
|
549
|
+
// require
|
|
550
|
+
r(requireId) {
|
|
551
|
+
return self.__webpack_require__?.(`[${bundle}] ${requireId}`);
|
|
552
|
+
},
|
|
553
|
+
// value exports
|
|
554
|
+
v(value) {
|
|
555
|
+
if (typeof value === "function") {
|
|
556
|
+
exports.default = value((vid) => {
|
|
557
|
+
return self.__webpack_require__?.(`[${bundle}] ${vid}`);
|
|
558
|
+
});
|
|
559
|
+
} else {
|
|
560
|
+
moduleExports.exports = value;
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
// async module initializer
|
|
564
|
+
async a(mod) {
|
|
565
|
+
let result;
|
|
566
|
+
await mod(
|
|
567
|
+
() => {
|
|
568
|
+
},
|
|
569
|
+
(value) => result = value
|
|
570
|
+
);
|
|
571
|
+
exports.default = result;
|
|
572
|
+
},
|
|
573
|
+
// async module loader
|
|
574
|
+
async A(Aid) {
|
|
575
|
+
const mod = self.__webpack_require__?.(`[${bundle}] ${Aid}`);
|
|
576
|
+
return mod.default(
|
|
577
|
+
(parentId) => self.__webpack_require__?.(`[${bundle}] ${parentId}`)
|
|
578
|
+
);
|
|
579
|
+
},
|
|
580
|
+
// chunk loader
|
|
581
|
+
l(url) {
|
|
582
|
+
const moduleInitIndex = allModules.indexOf(moduleInit);
|
|
583
|
+
if (moduleInitIndex !== -1) {
|
|
584
|
+
const scriptIndex = allModules.slice(0, moduleInitIndex).findLastIndex((bundleEntry) => bundleEntry instanceof Element);
|
|
585
|
+
if (scriptIndex !== -1) {
|
|
586
|
+
const script = allModules[scriptIndex];
|
|
587
|
+
const scriptSrc = script.getAttribute("data-turbopack-src") || "";
|
|
588
|
+
const nextIndex = scriptSrc.indexOf("/_next");
|
|
589
|
+
const baseUrl = nextIndex !== -1 ? scriptSrc.slice(0, nextIndex) : "";
|
|
590
|
+
const bundleUrl = `[${bundle}] ${baseUrl}/_next/${url}`;
|
|
591
|
+
return self.__webpack_chunk_load__?.(bundleUrl, bundle);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
throw new Error(
|
|
595
|
+
`Failed to load Turbopack chunk "${url}" for module "${id}". Check the URL is correct.`
|
|
596
|
+
);
|
|
597
|
+
},
|
|
598
|
+
// global object for this bundle
|
|
599
|
+
g: self.__remote_components_turbopack_global__?.[bundle],
|
|
600
|
+
m: moduleExports,
|
|
601
|
+
e: exports
|
|
410
602
|
};
|
|
411
603
|
}
|
|
604
|
+
var init_turbopack_module = __esm({
|
|
605
|
+
"src/shared/client/turbopack-module.ts"() {
|
|
606
|
+
"use strict";
|
|
607
|
+
init_const();
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
// src/shared/client/turbopack-patterns.ts
|
|
612
|
+
var REMOTE_SHARED_MARKER_RE, REMOTE_SHARED_ASSIGNMENT_RE, ASYNC_MODULE_LOADER_RE, ASYNC_MODULE_RESOLVE_RE, ASYNC_MODULE_ALL_RE;
|
|
613
|
+
var init_turbopack_patterns = __esm({
|
|
614
|
+
"src/shared/client/turbopack-patterns.ts"() {
|
|
615
|
+
"use strict";
|
|
616
|
+
REMOTE_SHARED_MARKER_RE = /(?:self|[a-z])\.TURBOPACK_REMOTE_SHARED/;
|
|
617
|
+
REMOTE_SHARED_ASSIGNMENT_RE = /\.TURBOPACK_REMOTE_SHARED=await (?:__turbopack_context__|e)\.A\((?<sharedModuleId>[0-9]+)\)/;
|
|
618
|
+
ASYNC_MODULE_LOADER_RE = /(?:__turbopack_context__|e)\.A\((?<asyncSharedModuleId>[0-9]+)\)/;
|
|
619
|
+
ASYNC_MODULE_RESOLVE_RE = /(?<ctx>__turbopack_context__|e)=>\{\k<ctx>\.v\((?<inner>parentImport|e)=>Promise\.resolve\(\)\.then\(\(\)=>\k<inner>\((?<sharedModuleId>[0-9]+)\)\)\)\}/;
|
|
620
|
+
ASYNC_MODULE_ALL_RE = /(?<ctx>__turbopack_context__|e)=>\{\k<ctx>\.v\((?<vCb>parentImport|t)=>Promise\.all\(\["[^"]+"\]\.map\((?<mapCb>chunk|t)=>\k<ctx>\.l\(\k<mapCb>\)\)\)\.then\(\(\)=>\k<vCb>\((?<sharedModuleId>[0-9]+)\)\)\)\}/;
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
// src/shared/client/shared-modules.ts
|
|
412
625
|
async function initializeSharedModules(bundle, hostShared = {}, remoteShared = {}) {
|
|
413
626
|
const self = globalThis;
|
|
414
627
|
self.__remote_shared_modules__ = self.__remote_shared_modules__ ?? {};
|
|
@@ -425,14 +638,12 @@ async function initializeSharedModules(bundle, hostShared = {}, remoteShared = {
|
|
|
425
638
|
return false;
|
|
426
639
|
}
|
|
427
640
|
const funcCode = idOrFunc.toString();
|
|
428
|
-
return
|
|
641
|
+
return REMOTE_SHARED_MARKER_RE.test(funcCode);
|
|
429
642
|
});
|
|
430
643
|
if (sharedModuleInitializerIndex > 0) {
|
|
431
644
|
const sharedModuleInitializerCode = allModules[sharedModuleInitializerIndex].toString();
|
|
432
645
|
const sharedModuleInitializerId = allModules[sharedModuleInitializerIndex - 1];
|
|
433
|
-
const { sharedModuleId } =
|
|
434
|
-
sharedModuleInitializerCode
|
|
435
|
-
)?.groups ?? {};
|
|
646
|
+
const { sharedModuleId } = REMOTE_SHARED_ASSIGNMENT_RE.exec(sharedModuleInitializerCode)?.groups ?? {};
|
|
436
647
|
if (sharedModuleId) {
|
|
437
648
|
const { default: sharedModuleInitializerInstance } = handleTurbopackModule(
|
|
438
649
|
bundle,
|
|
@@ -444,33 +655,11 @@ async function initializeSharedModules(bundle, hostShared = {}, remoteShared = {
|
|
|
444
655
|
}
|
|
445
656
|
if (sharedModuleInitializer) {
|
|
446
657
|
const { shared } = await sharedModuleInitializer;
|
|
447
|
-
const sharedModuleIds =
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
const newAllModules = self[`TURBOPACK_${bundleKey}`]?.flat() ?? [];
|
|
453
|
-
const asyncSharedModuleIdIndex = newAllModules.indexOf(
|
|
454
|
-
asyncSharedModuleIdNumber
|
|
455
|
-
);
|
|
456
|
-
if (asyncSharedModuleIdIndex !== -1 && typeof newAllModules[asyncSharedModuleIdIndex + 1] === "function") {
|
|
457
|
-
asyncSharedModule = newAllModules[asyncSharedModuleIdIndex + 1];
|
|
458
|
-
}
|
|
459
|
-
if (asyncSharedModule) {
|
|
460
|
-
const asyncSharedModuleCode = asyncSharedModule.toString();
|
|
461
|
-
const { sharedModuleId } = /e=>{e\.v\(e=>Promise\.resolve\(\)\.then\(\(\)=>e\((?<sharedModuleId>[0-9]+)\)\)\)}/.exec(
|
|
462
|
-
asyncSharedModuleCode
|
|
463
|
-
)?.groups ?? /e=>{e\.v\(t=>Promise\.all\(\["[^"]+"\].map\(t=>e\.l\(t\)\)\)\.then\(\(\)=>t\((?<sharedModuleId>[0-9]+)\)\)\)}/.exec(
|
|
464
|
-
asyncSharedModuleCode
|
|
465
|
-
)?.groups ?? {};
|
|
466
|
-
acc[sharedModuleId ?? asyncSharedModuleId] = key.replace(
|
|
467
|
-
"__remote_shared_module_",
|
|
468
|
-
""
|
|
469
|
-
);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
return acc;
|
|
473
|
-
}, {});
|
|
658
|
+
const sharedModuleIds = extractSharedModuleIds(
|
|
659
|
+
shared,
|
|
660
|
+
bundleKey,
|
|
661
|
+
self
|
|
662
|
+
);
|
|
474
663
|
return Promise.all(
|
|
475
664
|
Object.entries(sharedModuleIds).map(async ([id, module]) => {
|
|
476
665
|
if (self.__remote_shared_modules__?.[bundle]) {
|
|
@@ -494,6 +683,31 @@ async function initializeSharedModules(bundle, hostShared = {}, remoteShared = {
|
|
|
494
683
|
})
|
|
495
684
|
);
|
|
496
685
|
}
|
|
686
|
+
function extractSharedModuleIds(shared, bundleKey, self) {
|
|
687
|
+
return Object.entries(shared).filter(([, value]) => typeof value === "function").reduce((acc, [key, value]) => {
|
|
688
|
+
const { asyncSharedModuleId } = ASYNC_MODULE_LOADER_RE.exec(value.toString())?.groups ?? {};
|
|
689
|
+
if (asyncSharedModuleId) {
|
|
690
|
+
const asyncSharedModuleIdNumber = Number(asyncSharedModuleId);
|
|
691
|
+
let asyncSharedModule;
|
|
692
|
+
const newAllModules = self[`TURBOPACK_${bundleKey}`]?.flat() ?? [];
|
|
693
|
+
const asyncSharedModuleIdIndex = newAllModules.indexOf(
|
|
694
|
+
asyncSharedModuleIdNumber
|
|
695
|
+
);
|
|
696
|
+
if (asyncSharedModuleIdIndex !== -1 && typeof newAllModules[asyncSharedModuleIdIndex + 1] === "function") {
|
|
697
|
+
asyncSharedModule = newAllModules[asyncSharedModuleIdIndex + 1];
|
|
698
|
+
}
|
|
699
|
+
if (asyncSharedModule) {
|
|
700
|
+
const asyncSharedModuleCode = asyncSharedModule.toString();
|
|
701
|
+
const { sharedModuleId } = ASYNC_MODULE_RESOLVE_RE.exec(asyncSharedModuleCode)?.groups ?? ASYNC_MODULE_ALL_RE.exec(asyncSharedModuleCode)?.groups ?? {};
|
|
702
|
+
acc[sharedModuleId ?? asyncSharedModuleId] = key.replace(
|
|
703
|
+
"__remote_shared_module_",
|
|
704
|
+
""
|
|
705
|
+
);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
return acc;
|
|
709
|
+
}, {});
|
|
710
|
+
}
|
|
497
711
|
function getSharedModule(bundle, id) {
|
|
498
712
|
const self = globalThis;
|
|
499
713
|
for (const [key, value] of Object.entries(
|
|
@@ -505,216 +719,118 @@ function getSharedModule(bundle, id) {
|
|
|
505
719
|
}
|
|
506
720
|
return null;
|
|
507
721
|
}
|
|
508
|
-
|
|
722
|
+
var init_shared_modules2 = __esm({
|
|
723
|
+
"src/shared/client/shared-modules.ts"() {
|
|
724
|
+
"use strict";
|
|
725
|
+
init_const();
|
|
726
|
+
init_turbopack_module();
|
|
727
|
+
init_turbopack_patterns();
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
// src/shared/client/webpack-adapter.ts
|
|
732
|
+
async function setupWebpackRuntime(runtime, scripts = [], url = new URL(location.href), bundle, shared = {}, remoteShared = {}) {
|
|
509
733
|
const self = globalThis;
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
(bundleEntry) => typeof bundleEntry === "string" && bundleEntry.startsWith(moduleId) || bundleEntry === normalizedId
|
|
520
|
-
);
|
|
734
|
+
if (!self.__remote_bundle_url__) {
|
|
735
|
+
self.__remote_bundle_url__ = {};
|
|
736
|
+
}
|
|
737
|
+
self.__remote_bundle_url__[bundle ?? "default"] = url;
|
|
738
|
+
self.__webpack_get_script_filename__ = () => null;
|
|
739
|
+
if (typeof self.__webpack_require__ !== "function" || self.__webpack_require_type__ !== "turbopack") {
|
|
740
|
+
if (!self.__original_webpack_require__ && !self.__original_webpack_chunk_load__) {
|
|
741
|
+
self.__original_webpack_chunk_load__ = self.__webpack_chunk_load__;
|
|
742
|
+
self.__original_webpack_require__ = self.__webpack_require__;
|
|
521
743
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
744
|
+
self.__webpack_chunk_load__ = createChunkLoader(runtime);
|
|
745
|
+
self.__webpack_require__ = createModuleRequire(runtime);
|
|
746
|
+
self.__webpack_require_type__ = runtime;
|
|
747
|
+
if (self.__remote_webpack_require__ && runtime === RUNTIME_TURBOPACK) {
|
|
748
|
+
const remoteBundle = bundle ?? "default";
|
|
749
|
+
self.__remote_webpack_require__[remoteBundle] = self.__webpack_require__;
|
|
750
|
+
self.__remote_webpack_require__[remoteBundle].type = "turbopack";
|
|
527
751
|
}
|
|
528
|
-
} else {
|
|
529
|
-
moduleInit = allModules.find(
|
|
530
|
-
(bundleEntry) => typeof bundleEntry === "object" && bundleEntry !== null && moduleId in bundleEntry
|
|
531
|
-
)?.[moduleId];
|
|
532
|
-
}
|
|
533
|
-
const exports = {};
|
|
534
|
-
const moduleExports = { exports };
|
|
535
|
-
if (!self.__remote_components_turbopack_modules__) {
|
|
536
|
-
self.__remote_components_turbopack_modules__ = {};
|
|
537
|
-
}
|
|
538
|
-
if (!self.__remote_components_turbopack_modules__[bundle]) {
|
|
539
|
-
self.__remote_components_turbopack_modules__[bundle] = {};
|
|
540
|
-
}
|
|
541
|
-
if (self.__remote_components_turbopack_modules__[bundle][moduleId]) {
|
|
542
|
-
return self.__remote_components_turbopack_modules__[bundle][moduleId];
|
|
543
752
|
}
|
|
544
|
-
if (
|
|
545
|
-
|
|
546
|
-
|
|
753
|
+
if (runtime === RUNTIME_TURBOPACK) {
|
|
754
|
+
await Promise.all(
|
|
755
|
+
scripts.map((script) => {
|
|
756
|
+
if (script.src) {
|
|
757
|
+
return self.__webpack_chunk_load__?.(script.src, bundle);
|
|
758
|
+
}
|
|
759
|
+
return Promise.resolve(void 0);
|
|
760
|
+
})
|
|
547
761
|
);
|
|
548
762
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
});
|
|
597
|
-
} else {
|
|
598
|
-
const getterFn = tagOrFunc;
|
|
599
|
-
if (typeof bindings[i] === "function") {
|
|
600
|
-
const setterFn = bindings[i++];
|
|
601
|
-
Object.defineProperty(mod, propName, {
|
|
602
|
-
get: getterFn,
|
|
603
|
-
set: setterFn,
|
|
604
|
-
enumerable: true
|
|
605
|
-
});
|
|
606
|
-
} else {
|
|
607
|
-
Object.defineProperty(mod, propName, {
|
|
608
|
-
get: getterFn,
|
|
609
|
-
enumerable: true
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
},
|
|
616
|
-
// import
|
|
617
|
-
i(importId) {
|
|
618
|
-
let mod;
|
|
619
|
-
if (typeof importId === "string") {
|
|
620
|
-
const { exportSource, exportName } = /\s+<export (?<exportSource>.*?) as (?<exportName>.*?)>$/.exec(
|
|
621
|
-
importId
|
|
622
|
-
)?.groups ?? {};
|
|
623
|
-
const normalizedId = importId.replace(
|
|
624
|
-
/\s+<export(?<specifier>.*)>$/,
|
|
625
|
-
""
|
|
626
|
-
);
|
|
627
|
-
mod = self.__webpack_require__?.(
|
|
628
|
-
`[${bundle}] ${normalizedId}`
|
|
629
|
-
);
|
|
630
|
-
if (exportSource && exportName && (exportSource === "*" || typeof mod[exportSource] !== "undefined") && typeof mod[exportName] === "undefined") {
|
|
631
|
-
if (exportSource === "*") {
|
|
632
|
-
mod[exportName] = mod;
|
|
633
|
-
} else {
|
|
634
|
-
mod[exportName] = mod[exportSource];
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
} else {
|
|
638
|
-
mod = self.__webpack_require__?.(`[${bundle}] ${importId}`);
|
|
639
|
-
}
|
|
640
|
-
if (typeof mod !== "object") {
|
|
641
|
-
mod = { default: mod };
|
|
642
|
-
} else if (!("default" in mod) && // eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
643
|
-
mod.toString() !== "[object Module]") {
|
|
644
|
-
try {
|
|
645
|
-
mod.default = mod;
|
|
646
|
-
} catch {
|
|
763
|
+
const coreShared = {
|
|
764
|
+
react: async () => (await import("react")).default,
|
|
765
|
+
"react-dom": async () => (await import("react-dom")).default,
|
|
766
|
+
"react/jsx-dev-runtime": async () => (await import("react/jsx-dev-runtime")).default,
|
|
767
|
+
"react/jsx-runtime": async () => (await import("react/jsx-runtime")).default,
|
|
768
|
+
"react-dom/client": async () => (await import("react-dom/client")).default,
|
|
769
|
+
...shared
|
|
770
|
+
};
|
|
771
|
+
await initializeSharedModules(
|
|
772
|
+
bundle ?? "default",
|
|
773
|
+
// include all core modules as shared
|
|
774
|
+
coreShared,
|
|
775
|
+
remoteShared
|
|
776
|
+
);
|
|
777
|
+
}
|
|
778
|
+
function createModuleRequire(runtime) {
|
|
779
|
+
return (id) => {
|
|
780
|
+
const self = globalThis;
|
|
781
|
+
const { bundle, id: moduleId } = id.match(REMOTE_COMPONENT_REGEX)?.groups ?? {
|
|
782
|
+
bundle: "default",
|
|
783
|
+
id
|
|
784
|
+
};
|
|
785
|
+
const remoteRuntime = self.__remote_webpack_require__?.[bundle ?? "default"] ? self.__remote_webpack_require__[bundle ?? "default"]?.type || "webpack" : runtime;
|
|
786
|
+
logDebug("WebpackAdapter", `remoteRuntime: "${remoteRuntime}"`);
|
|
787
|
+
try {
|
|
788
|
+
if (remoteRuntime === RUNTIME_WEBPACK && bundle && moduleId) {
|
|
789
|
+
return self.__remote_webpack_require__?.[bundle]?.(moduleId);
|
|
790
|
+
}
|
|
791
|
+
const sharedModuleId = moduleId ?? id;
|
|
792
|
+
const sharedModule = getSharedModule(bundle ?? "default", sharedModuleId);
|
|
793
|
+
if (sharedModule) {
|
|
794
|
+
return sharedModule;
|
|
795
|
+
}
|
|
796
|
+
if (bundle && moduleId) {
|
|
797
|
+
return handleTurbopackModule(bundle, moduleId, id);
|
|
798
|
+
}
|
|
799
|
+
throw new Error(`Module "${id}" not found.`);
|
|
800
|
+
} catch (requireError) {
|
|
801
|
+
logWarn(
|
|
802
|
+
"WebpackAdapter",
|
|
803
|
+
`Module require failed: ${String(requireError)}`
|
|
804
|
+
);
|
|
805
|
+
if (typeof self.__original_webpack_require__ !== "function") {
|
|
806
|
+
throw new RemoteComponentsError(
|
|
807
|
+
`Module "${id}" not found in remote component bundle "${bundle}".`,
|
|
808
|
+
{
|
|
809
|
+
cause: requireError instanceof Error ? requireError : void 0
|
|
647
810
|
}
|
|
648
|
-
}
|
|
649
|
-
return mod;
|
|
650
|
-
},
|
|
651
|
-
// require
|
|
652
|
-
r(requireId) {
|
|
653
|
-
return self.__webpack_require__?.(`[${bundle}] ${requireId}`);
|
|
654
|
-
},
|
|
655
|
-
// value exports
|
|
656
|
-
v(value) {
|
|
657
|
-
if (typeof value === "function") {
|
|
658
|
-
exports.default = value((vid) => {
|
|
659
|
-
return self.__webpack_require__?.(`[${bundle}] ${vid}`);
|
|
660
|
-
});
|
|
661
|
-
} else {
|
|
662
|
-
moduleExports.exports = value;
|
|
663
|
-
}
|
|
664
|
-
},
|
|
665
|
-
// async module initializer
|
|
666
|
-
async a(mod) {
|
|
667
|
-
let result;
|
|
668
|
-
await mod(
|
|
669
|
-
() => {
|
|
670
|
-
},
|
|
671
|
-
(value) => result = value
|
|
672
811
|
);
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
},
|
|
682
|
-
// chunk loader
|
|
683
|
-
l(url) {
|
|
684
|
-
const moduleInitIndex = allModules.indexOf(moduleInit);
|
|
685
|
-
if (moduleInitIndex !== -1) {
|
|
686
|
-
const scriptIndex = allModules.slice(0, moduleInitIndex).findLastIndex((bundleEntry) => bundleEntry instanceof Element);
|
|
687
|
-
if (scriptIndex !== -1) {
|
|
688
|
-
const script = allModules[scriptIndex];
|
|
689
|
-
const scriptSrc = script.getAttribute("data-turbopack-src") || "";
|
|
690
|
-
const nextIndex = scriptSrc.indexOf("/_next");
|
|
691
|
-
const baseUrl = nextIndex !== -1 ? scriptSrc.slice(0, nextIndex) : "";
|
|
692
|
-
const bundleUrl = `[${bundle}] ${baseUrl}/_next/${url}`;
|
|
693
|
-
return self.__webpack_chunk_load__?.(bundleUrl, bundle);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
throw new Error(
|
|
697
|
-
`Failed to load Turbopack chunk "${url}" for module "${id}". Check the URL is correct.`
|
|
812
|
+
}
|
|
813
|
+
try {
|
|
814
|
+
logDebug("WebpackAdapter", "Falling back to original webpack require");
|
|
815
|
+
return self.__original_webpack_require__(id);
|
|
816
|
+
} catch (originalError) {
|
|
817
|
+
throw new RemoteComponentsError(
|
|
818
|
+
`Module "${id}" not found in remote component bundle "${bundle}".`,
|
|
819
|
+
{ cause: originalError instanceof Error ? originalError : void 0 }
|
|
698
820
|
);
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
m: moduleExports,
|
|
703
|
-
e: exports
|
|
704
|
-
},
|
|
705
|
-
moduleExports,
|
|
706
|
-
exports
|
|
707
|
-
);
|
|
708
|
-
if (self.__remote_components_turbopack_modules__[bundle][moduleId] !== moduleExports.exports) {
|
|
709
|
-
self.__remote_components_turbopack_modules__[bundle][moduleId] = moduleExports.exports;
|
|
710
|
-
}
|
|
711
|
-
return moduleExports.exports;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
};
|
|
712
824
|
}
|
|
713
825
|
var init_webpack_adapter = __esm({
|
|
714
826
|
"src/shared/client/webpack-adapter.ts"() {
|
|
715
827
|
"use strict";
|
|
716
828
|
init_error();
|
|
829
|
+
init_logger();
|
|
830
|
+
init_chunk_loader();
|
|
717
831
|
init_const();
|
|
832
|
+
init_shared_modules2();
|
|
833
|
+
init_turbopack_module();
|
|
718
834
|
}
|
|
719
835
|
});
|
|
720
836
|
|
|
@@ -1279,6 +1395,7 @@ init_error();
|
|
|
1279
1395
|
|
|
1280
1396
|
// src/shared/client/component-loader.ts
|
|
1281
1397
|
init_error();
|
|
1398
|
+
init_logger();
|
|
1282
1399
|
init_next_client_pages_loader();
|
|
1283
1400
|
init_shared_modules();
|
|
1284
1401
|
import * as React from "react";
|
|
@@ -1543,9 +1660,7 @@ if (typeof HTMLElement !== "undefined") {
|
|
|
1543
1660
|
};
|
|
1544
1661
|
const res = await fetch(url, fetchInit);
|
|
1545
1662
|
if (!res.ok) {
|
|
1546
|
-
let error = failedToFetchRemoteComponentError(url.href,
|
|
1547
|
-
cause: new Error(`${res.status} ${res.statusText}`)
|
|
1548
|
-
});
|
|
1663
|
+
let error = failedToFetchRemoteComponentError(url.href, res);
|
|
1549
1664
|
try {
|
|
1550
1665
|
const body = await res.text();
|
|
1551
1666
|
const parser2 = new DOMParser();
|
|
@@ -1856,7 +1971,9 @@ if (typeof HTMLElement !== "undefined") {
|
|
|
1856
1971
|
};
|
|
1857
1972
|
if (rsc) {
|
|
1858
1973
|
rsc.parentElement?.removeChild(rsc);
|
|
1859
|
-
const rscName = `__remote_component_rsc_${escapeString(
|
|
1974
|
+
const rscName = `__remote_component_rsc_${escapeString(
|
|
1975
|
+
url.href
|
|
1976
|
+
)}_${escapeString(this.name)}`;
|
|
1860
1977
|
const rscClone = document.createElement("script");
|
|
1861
1978
|
rscClone.id = `${rscName}_rsc`;
|
|
1862
1979
|
rscClone.textContent = rsc.textContent?.replace(
|