remote-components 0.0.25 → 0.0.26

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.
@@ -380,17 +380,21 @@ function createModuleRequire(runtime) {
380
380
  return handleTurbopackModule(bundle, moduleId, id);
381
381
  }
382
382
  throw new Error(`Module ${id} not found`);
383
- } catch {
383
+ } catch (requireError) {
384
384
  if (typeof self.__original_webpack_require__ !== "function") {
385
385
  throw new Error(
386
- `Module ${id} not found in remote component bundle ${bundle}`
386
+ `Module ${id} not found in remote component bundle ${bundle}`,
387
+ {
388
+ cause: requireError instanceof Error ? requireError : void 0
389
+ }
387
390
  );
388
391
  }
389
392
  try {
390
393
  return self.__original_webpack_require__(id);
391
- } catch {
394
+ } catch (originalError) {
392
395
  throw new Error(
393
- `Module ${id} not found in remote component bundle ${bundle}`
396
+ `Module ${id} not found in remote component bundle ${bundle}`,
397
+ { cause: originalError instanceof Error ? originalError : void 0 }
394
398
  );
395
399
  }
396
400
  }
@@ -486,7 +490,8 @@ function handleTurbopackModule(bundle, moduleId, id) {
486
490
  registerExports() {
487
491
  },
488
492
  signature() {
489
- return () => {
493
+ return (fn) => {
494
+ return fn;
490
495
  };
491
496
  }
492
497
  },
@@ -519,8 +524,18 @@ function handleTurbopackModule(bundle, moduleId, id) {
519
524
  const mod = self.__webpack_require__?.(
520
525
  `[${bundle}] ${normalizedId}`
521
526
  );
522
- if (exportSource && exportName && typeof mod[exportSource] !== "undefined" && typeof mod[exportName] === "undefined") {
523
- mod[exportName] = mod[exportSource];
527
+ if (exportSource && exportName && (exportSource === "*" || typeof mod[exportSource] !== "undefined") && typeof mod[exportName] === "undefined") {
528
+ if (exportSource === "*") {
529
+ mod[exportName] = mod;
530
+ } else {
531
+ mod[exportName] = mod[exportSource];
532
+ }
533
+ }
534
+ if (!("default" in mod) && mod.toString() !== "[object Module]") {
535
+ try {
536
+ mod.default = mod;
537
+ } catch {
538
+ }
524
539
  }
525
540
  return mod;
526
541
  },
@@ -530,6 +545,21 @@ function handleTurbopackModule(bundle, moduleId, id) {
530
545
  v(value) {
531
546
  exports.default = value;
532
547
  },
548
+ async a(mod) {
549
+ let result;
550
+ await mod(
551
+ () => {
552
+ },
553
+ (value) => result = value
554
+ );
555
+ exports.default = result;
556
+ },
557
+ async A(Aid) {
558
+ const mod = self.__webpack_require__?.(`[${bundle}] ${Aid}`);
559
+ return mod.default(
560
+ (parentId) => self.__webpack_require__?.(`[${bundle}] ${parentId}`)
561
+ );
562
+ },
533
563
  g: self.__remote_components_turbopack_global__[bundle],
534
564
  m: moduleExports,
535
565
  e: exports
@@ -542,6 +572,9 @@ function handleTurbopackModule(bundle, moduleId, id) {
542
572
  exports[name] = exports[name]();
543
573
  }
544
574
  }
575
+ if (self.__remote_components_turbopack_modules__[bundle][moduleId] !== moduleExports.exports) {
576
+ self.__remote_components_turbopack_modules__[bundle][moduleId] = moduleExports.exports;
577
+ }
545
578
  return moduleExports.exports;
546
579
  }
547
580
  var init_webpack_adapter = __esm({
@@ -642,7 +675,15 @@ function sharedPolyfills(shared) {
642
675
  },
643
676
  __esModule: true
644
677
  })
645
- ))
678
+ )),
679
+ "next/dist/build/polyfills/process": () => Promise.resolve({
680
+ default: {
681
+ env: {
682
+ NODE_ENV: "production"
683
+ }
684
+ },
685
+ __esModule: true
686
+ })
646
687
  };
647
688
  polyfill["next/navigation"] = polyfill["next/dist/client/components/navigation"];
648
689
  polyfill["next/link"] = polyfill["next/dist/client/app-dir/link"];
@@ -902,7 +943,7 @@ function createRSCStream(rscName, data) {
902
943
  self[rscName] = null;
903
944
  allChunks.split("\n").forEach((chunk) => {
904
945
  if (chunk.length > 0) {
905
- const { before, id, prefix, payload } = /^(?<before>.*?)?(?<id>[0-9a-zA-Z]+):(?<prefix>[A-Z])?(?<payload>\[.*\])/.exec(
946
+ const { before, id, prefix, payload } = /^(?<before>[^:]*?)?(?<id>[0-9a-zA-Z]+):(?<prefix>[A-Z])?(?<payload>\[.*\])/.exec(
906
947
  chunk
907
948
  )?.groups ?? {};
908
949
  if (payload) {
@@ -945,26 +986,28 @@ var tagNames = [
945
986
  "link"
946
987
  ];
947
988
  function applyOriginToNodes(doc, url) {
948
- const nodes = doc.querySelectorAll(
949
- tagNames.map((type) => `${type}[src],${type}[srcset]`).join(",")
950
- );
951
- nodes.forEach((node) => {
952
- if (node.hasAttribute("src") && /^[./]+\/?/.test(node.getAttribute("src") ?? "")) {
953
- node.src = new URL(node.getAttribute("src") ?? "/", url).href;
954
- }
955
- if (node.hasAttribute("srcset")) {
956
- const srcSet = node.getAttribute("srcset")?.split(",").map((entry) => {
957
- const [urlPart, descriptor] = entry.trim().split(/\s+/);
958
- if (!urlPart)
959
- return entry;
960
- const absoluteUrl = new URL(urlPart, url).href;
961
- return descriptor ? `${absoluteUrl} ${descriptor}` : absoluteUrl;
962
- }).join(", ");
963
- if (srcSet) {
964
- node.setAttribute("srcset", srcSet);
989
+ if (url.origin !== location.origin) {
990
+ const nodes = doc.querySelectorAll(
991
+ tagNames.map((type) => `${type}[src],${type}[srcset]`).join(",")
992
+ );
993
+ nodes.forEach((node) => {
994
+ if (node.hasAttribute("src") && /^[./]+\/?/.test(node.getAttribute("src") ?? "")) {
995
+ node.src = new URL(node.getAttribute("src") ?? "/", url).href;
965
996
  }
966
- }
967
- });
997
+ if (node.hasAttribute("srcset")) {
998
+ const srcSet = node.getAttribute("srcset")?.split(",").map((entry) => {
999
+ const [urlPart, descriptor] = entry.trim().split(/\s+/);
1000
+ if (!urlPart)
1001
+ return entry;
1002
+ const absoluteUrl = new URL(urlPart, url).href;
1003
+ return descriptor ? `${absoluteUrl} ${descriptor}` : absoluteUrl;
1004
+ }).join(", ");
1005
+ if (srcSet) {
1006
+ node.setAttribute("srcset", srcSet);
1007
+ }
1008
+ }
1009
+ });
1010
+ }
968
1011
  }
969
1012
 
970
1013
  // src/html/host/runtime/index.ts