remote-components 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/{chunk-2VQGCACH.js → chunk-52BJ7VFA.js} +30 -18
  2. package/dist/chunk-52BJ7VFA.js.map +1 -0
  3. package/dist/{chunk-KKBEMQU7.cjs → chunk-AWWWK2ZY.cjs} +28 -28
  4. package/dist/{chunk-KEPHL25S.js → chunk-D5GNZB6O.js} +2 -1
  5. package/dist/chunk-D5GNZB6O.js.map +1 -0
  6. package/dist/{chunk-W5ESPGHH.js → chunk-GBFUPMMI.js} +5 -5
  7. package/dist/{chunk-ER73O65F.cjs → chunk-I47KE3EC.cjs} +23 -23
  8. package/dist/{chunk-6IUP26UK.cjs → chunk-LCXO7BUY.cjs} +3 -3
  9. package/dist/{chunk-OO4AMJWO.js → chunk-LQ7VQ74E.js} +2 -2
  10. package/dist/{chunk-42N2ZLE2.js → chunk-NZAB7REE.js} +6 -6
  11. package/dist/{chunk-KYJWRZ2B.js → chunk-QKB74MLO.js} +3 -3
  12. package/dist/{chunk-F44NODUS.cjs → chunk-RJW3EZJP.cjs} +26 -26
  13. package/dist/{chunk-HNZVEIKN.js → chunk-SJM7AAGU.js} +2 -2
  14. package/dist/{chunk-ZPMTZ3KJ.js → chunk-SZFCBE54.js} +2 -2
  15. package/dist/{chunk-XCFYWSLD.cjs → chunk-T64P7BAG.cjs} +31 -19
  16. package/dist/chunk-T64P7BAG.cjs.map +1 -0
  17. package/dist/{chunk-CREXMFMF.cjs → chunk-TZT7DLO5.cjs} +4 -4
  18. package/dist/{chunk-R4QFK5TN.cjs → chunk-X6W464D6.cjs} +4 -4
  19. package/dist/{chunk-7MVFHOIP.cjs → chunk-Z2SLBFQL.cjs} +2 -1
  20. package/dist/chunk-Z2SLBFQL.cjs.map +1 -0
  21. package/dist/config/nextjs.cjs +5 -11
  22. package/dist/config/nextjs.cjs.map +1 -1
  23. package/dist/config/nextjs.js +2 -8
  24. package/dist/config/nextjs.js.map +1 -1
  25. package/dist/host/html.cjs +27 -27
  26. package/dist/host/html.js +10 -10
  27. package/dist/host/nextjs/app/client-only.cjs +13 -13
  28. package/dist/host/nextjs/app/client-only.js +8 -8
  29. package/dist/host/react.cjs +9 -9
  30. package/dist/host/react.js +8 -8
  31. package/dist/internal/config/webpack/next-client-pages-loader.cjs +27 -15
  32. package/dist/internal/config/webpack/next-client-pages-loader.cjs.map +1 -1
  33. package/dist/internal/config/webpack/next-client-pages-loader.d.ts +3 -5
  34. package/dist/internal/config/webpack/next-client-pages-loader.js +27 -15
  35. package/dist/internal/config/webpack/next-client-pages-loader.js.map +1 -1
  36. package/dist/internal/host/nextjs/app-client.d.ts +1 -1
  37. package/dist/internal/host/react/context.d.ts +2 -2
  38. package/dist/internal/host/shared/pipeline.d.ts +2 -2
  39. package/dist/internal/runtime/loaders/component-loader.d.ts +2 -2
  40. package/dist/internal/runtime/loaders/static-loader.d.ts +2 -1
  41. package/dist/internal/runtime/namespace.cjs +1 -0
  42. package/dist/internal/runtime/namespace.cjs.map +1 -1
  43. package/dist/internal/runtime/namespace.d.ts +2 -1
  44. package/dist/internal/runtime/namespace.js +1 -0
  45. package/dist/internal/runtime/namespace.js.map +1 -1
  46. package/dist/internal/runtime/types.d.ts +2 -1
  47. package/dist/remote/html.cjs +1 -1
  48. package/dist/remote/html.js +1 -1
  49. package/dist/{script-6W5JRBZK.cjs → script-D5AD7HLV.cjs} +4 -4
  50. package/dist/{script-IFEBOLIA.js → script-VPOI7ARP.js} +3 -3
  51. package/dist/{server-handoff-ce13bebc.d.ts → server-handoff-8c89b856.d.ts} +2 -2
  52. package/dist/{static-loader-X4TSF5KW.js → static-loader-OHSAUD62.js} +3 -3
  53. package/dist/static-loader-UDIXK5MV.cjs +11 -0
  54. package/dist/{turbopack-NPGO3MWS.js → turbopack-5LW6V6IT.js} +5 -5
  55. package/dist/{turbopack-WRMKPNN4.cjs → turbopack-KRKECGY2.cjs} +12 -12
  56. package/dist/{types-59251814.d.ts → types-8b0edd78.d.ts} +7 -0
  57. package/dist/{webpack-DUBHPYD6.js → webpack-NPZNXRNL.js} +5 -5
  58. package/dist/{webpack-KSCMCL7M.cjs → webpack-TTZDARNY.cjs} +12 -12
  59. package/package.json +1 -1
  60. package/dist/chunk-2VQGCACH.js.map +0 -1
  61. package/dist/chunk-7MVFHOIP.cjs.map +0 -1
  62. package/dist/chunk-KEPHL25S.js.map +0 -1
  63. package/dist/chunk-XCFYWSLD.cjs.map +0 -1
  64. package/dist/static-loader-ZYD5BO4D.cjs +0 -11
  65. /package/dist/{chunk-KKBEMQU7.cjs.map → chunk-AWWWK2ZY.cjs.map} +0 -0
  66. /package/dist/{chunk-W5ESPGHH.js.map → chunk-GBFUPMMI.js.map} +0 -0
  67. /package/dist/{chunk-ER73O65F.cjs.map → chunk-I47KE3EC.cjs.map} +0 -0
  68. /package/dist/{chunk-6IUP26UK.cjs.map → chunk-LCXO7BUY.cjs.map} +0 -0
  69. /package/dist/{chunk-OO4AMJWO.js.map → chunk-LQ7VQ74E.js.map} +0 -0
  70. /package/dist/{chunk-42N2ZLE2.js.map → chunk-NZAB7REE.js.map} +0 -0
  71. /package/dist/{chunk-KYJWRZ2B.js.map → chunk-QKB74MLO.js.map} +0 -0
  72. /package/dist/{chunk-F44NODUS.cjs.map → chunk-RJW3EZJP.cjs.map} +0 -0
  73. /package/dist/{chunk-HNZVEIKN.js.map → chunk-SJM7AAGU.js.map} +0 -0
  74. /package/dist/{chunk-ZPMTZ3KJ.js.map → chunk-SZFCBE54.js.map} +0 -0
  75. /package/dist/{chunk-CREXMFMF.cjs.map → chunk-TZT7DLO5.cjs.map} +0 -0
  76. /package/dist/{chunk-R4QFK5TN.cjs.map → chunk-X6W464D6.cjs.map} +0 -0
  77. /package/dist/{script-6W5JRBZK.cjs.map → script-D5AD7HLV.cjs.map} +0 -0
  78. /package/dist/{script-IFEBOLIA.js.map → script-VPOI7ARP.js.map} +0 -0
  79. /package/dist/{static-loader-X4TSF5KW.js.map → static-loader-OHSAUD62.js.map} +0 -0
  80. /package/dist/{static-loader-ZYD5BO4D.cjs.map → static-loader-UDIXK5MV.cjs.map} +0 -0
  81. /package/dist/{turbopack-NPGO3MWS.js.map → turbopack-5LW6V6IT.js.map} +0 -0
  82. /package/dist/{turbopack-WRMKPNN4.cjs.map → turbopack-KRKECGY2.cjs.map} +0 -0
  83. /package/dist/{webpack-DUBHPYD6.js.map → webpack-NPZNXRNL.js.map} +0 -0
  84. /package/dist/{webpack-KSCMCL7M.cjs.map → webpack-TTZDARNY.cjs.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/config/webpack/apply-shared-modules.ts","../src/config/webpack/next-client-pages-loader.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\n\nimport { getScope } from '#internal/runtime/turbopack/remote-scope';\nimport { logDebug, logWarn } from '#internal/utils/logger';\n\nconst DEDUPLICATION_SKIPPED =\n 'shared module deduplication skipped. The remote may load its own copy of shared dependencies.';\n\nexport function applySharedModules(\n bundle: string,\n resolve: Record<string, unknown>,\n) {\n logDebug(\n 'SharedModules',\n `applySharedModules called for bundle: \"${bundle}\"`,\n );\n logDebug(\n 'SharedModules',\n `Shared modules to resolve: ${Object.keys(resolve)}`,\n );\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 // Prefer scope-based access when available.\n const scope = getScope(bundle);\n // @legacy(v0.3.4) — fall back to global __remote_webpack_require__ for hosts that\n // haven't run setupWebpackRuntime yet (e.g. HTML host's inline path).\n // Remove once all host types go through the shared pipeline (Phase 5).\n const webpackBundle =\n scope?.webpackRequire ?? self.__remote_webpack_require__?.[bundle];\n\n if (webpackBundle) {\n const modulePaths = Object.keys(\n self.__remote_webpack_module_map__?.[bundle] ?? webpackBundle.m ?? {},\n );\n logDebug(\n 'SharedModules',\n `Available module paths for bundle \"${bundle}\": ${modulePaths}`,\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 exactIds = modulePaths.filter((p) => p === key);\n const ids =\n exactIds.length > 0\n ? exactIds\n : modulePaths.filter((p) => p.includes(key));\n\n if (ids.length === 0) {\n logDebug(\n 'SharedModules',\n `No matching module path found for shared module \"${key}\"`,\n );\n }\n\n for (const id of ids) {\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 const resolvedId = self.__remote_webpack_module_map__?.[bundle]?.[id]\n ? `${self.__remote_webpack_module_map__[bundle][id]}`\n : id;\n if (resolvedId !== id) {\n logDebug(\n 'SharedModules',\n `Mapped module id: \"${id}\" -> \"${resolvedId}\"`,\n );\n }\n // create a mock module which exports the shared module\n webpackBundle.m[resolvedId] = (module) => {\n module.exports = value;\n };\n } else {\n logWarn(\n 'SharedModules',\n `webpackBundle.m is not available for bundle \"${bundle}\" — ${DEDUPLICATION_SKIPPED}`,\n );\n }\n }\n }\n } else {\n logWarn(\n 'SharedModules',\n `No webpack require found for bundle \"${bundle}\" — ${DEDUPLICATION_SKIPPED}`,\n );\n logDebug(\n 'SharedModules',\n `Available bundles: ${Object.keys(self.__remote_webpack_require__ ?? {})}`,\n );\n }\n}\n","import { getNamespace } from '#internal/runtime/namespace';\nimport { RemoteComponentsError } from '#internal/utils/error';\n\n// module loader for Next.js Pages Router\nexport function nextClientPagesLoader(\n bundle: string,\n route: string,\n styleContainer: HTMLHeadElement | ShadowRoot | null = document.head,\n) {\n // make a typed reference to the global scope\n const self = globalThis as typeof globalThis & {\n // webpack remote module loading function scoped for each bundle\n __remote_webpack_require__?: Record<\n string,\n ((remoteId: string | number) => unknown) & {\n c?: Record<\n string | number,\n { id: string; parents: string[]; children: string[] }\n >;\n m?: Record<string | number, (module: { exports: unknown }) => void>;\n type?: 'turbopack' | 'webpack';\n }\n >;\n // webpack module map for each bundle used in production builds\n __remote_webpack_module_map__?: Record<string, Record<string, number>>;\n // Next.js client pages loader reference storage\n __NEXT_P?: [\n (\n | [\n string,\n () => { default?: React.ComponentType<Record<string, unknown>> },\n ]\n | undefined\n ),\n (\n | [\n string,\n () => {\n default?: React.ComponentType<\n {\n Component: React.ComponentType<Record<string, unknown>>;\n } & Record<string, unknown>\n >;\n },\n ]\n | undefined\n ),\n (\n | [\n string,\n () => {\n default?: React.ComponentType<\n {\n Component: React.ComponentType<Record<string, unknown>>;\n } & Record<string, unknown>\n >;\n },\n ]\n | undefined\n ),\n ];\n };\n\n // temporarily remove the original Next.js CSS loader\n const nextCssOriginal = document.querySelector(\n `[id=\"__next_css__DO_NOT_USE__\"]:not([data-bundle=\"${bundle}\"][data-route=\"${route}\"])`,\n );\n if (nextCssOriginal) {\n nextCssOriginal.parentNode?.removeChild(nextCssOriginal);\n }\n\n // create a new Next.js CSS loader element\n const nextCss = document.createElement('noscript');\n nextCss.id = '__next_css__DO_NOT_USE__';\n nextCss.setAttribute('data-bundle', bundle);\n nextCss.setAttribute('data-route', route);\n const nextCssEnd = document.createElement('noscript');\n nextCssEnd.id = '__next_css__DO_NOT_USE_END__';\n nextCssEnd.setAttribute('data-bundle', bundle);\n nextCssEnd.setAttribute('data-route', route);\n document.head.appendChild(nextCssEnd);\n document.head.appendChild(nextCss);\n\n // find the page component loader chunk\n const componentLoaderChunk =\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=${encodeURIComponent(route)}!`),\n ) ??\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n self.__remote_webpack_module_map__?.[bundle]?.[\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=${encodeURIComponent(route)}!`),\n ) ??\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n ''\n ] ??\n -1;\n\n // find the app loader chunk\n const appLoaderChunk =\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=%2F_app`),\n ) ??\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n self.__remote_webpack_module_map__?.[bundle]?.[\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=%2F_app`),\n ) ??\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n ''\n ] ??\n -1;\n\n // if we didn't find the component loader or app loader, throw an error\n if (!(componentLoaderChunk && appLoaderChunk)) {\n throw new RemoteComponentsError(\n `Next.js client pages loader not found in bundle \"${bundle}\".`,\n );\n }\n\n // temporarily store the original __NEXT_P reference\n // this is required to avoid conflicts with the Next.js client pages loader\n // which uses the same global variable to store the page components\n const __NEXT_P_ORIGINAL = self.__NEXT_P;\n const selfOriginal = self;\n delete selfOriginal.__NEXT_P;\n\n // load the component and app loader chunks\n self.__remote_webpack_require__?.[bundle]?.(\n self.__remote_webpack_require__[bundle].type !== 'turbopack'\n ? componentLoaderChunk\n : `[${bundle}] ${componentLoaderChunk}`,\n );\n if (\n typeof appLoaderChunk === 'string' ||\n (typeof appLoaderChunk === 'number' && appLoaderChunk !== -1)\n ) {\n self.__remote_webpack_require__?.[bundle]?.(\n self.__remote_webpack_require__[bundle].type !== 'turbopack'\n ? appLoaderChunk\n : `[${bundle}] ${appLoaderChunk}`,\n );\n }\n\n // if we have the __NEXT_P global variable, we can extract the component and app\n if (self.__NEXT_P) {\n const [, componentLoader] = self.__NEXT_P[0] ?? [\n undefined,\n () => ({ default: null }),\n ];\n const [, appLoader] = self.__NEXT_P[2] ?? [\n undefined,\n () => ({\n default: null,\n }),\n ];\n const { default: Component } = componentLoader();\n const { default: App } = appLoader();\n\n const cssCache = getNamespace().cssCache;\n\n if (!cssCache[bundle]) {\n // load the CSS files from the remote bundle\n const cssRE = /\\.s?css$/;\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {})\n .filter((id) => cssRE.test(id))\n .forEach((id) => {\n self.__remote_webpack_require__?.[bundle]?.(id);\n });\n\n Object.keys(self.__remote_webpack_module_map__?.[bundle] ?? {})\n .filter((path) => cssRE.test(path))\n .forEach((path) => {\n const id = self.__remote_webpack_module_map__?.[bundle]?.[path];\n if (id) {\n self.__remote_webpack_require__?.[bundle]?.(id);\n }\n });\n\n const elements = [];\n let node = nextCss.previousSibling;\n while (node && node !== nextCssEnd) {\n elements.push(node);\n node.remove();\n node = nextCss.previousSibling;\n }\n cssCache[bundle] = elements;\n }\n\n // if the styleContainer is provided, we need to move the styles to it\n if (styleContainer) {\n const elements = cssCache[bundle];\n elements.forEach((el) => {\n styleContainer.appendChild(el.cloneNode(true));\n });\n } else {\n // if no styleContainer is provided, we need to move the styles back to the head\n const elements = cssCache[bundle];\n elements.forEach((el) => {\n document.head.appendChild(el);\n });\n }\n\n // restore the original __NEXT_P reference\n delete self.__NEXT_P;\n self.__NEXT_P = __NEXT_P_ORIGINAL;\n\n // restore the original Next.js CSS loader\n if (nextCssOriginal) {\n nextCssOriginal.parentNode?.appendChild(nextCssOriginal);\n }\n\n nextCss.remove();\n nextCssEnd.remove();\n\n return { Component, App };\n }\n\n return { Component: null,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M;AACvB,eAAS,IAAI,IAAI;AAAA,IACnB;AACA,IAAC,EAA8B,MAAM,IAAI,GAAG,IAAI;AAAA,EAClD;AAIA,QAAM,UAAU;AAChB,aAAW,OAAO,OAAO,KAAK,OAAO,GAAG;AACtC,QAAI,IAAI,WAAW,kBAAkB,GAAG;AACtC,YAAM,SAAS,IAAI,MAAM,mBAAmB,MAAM;AAClD,SAAG,YAAY,MAAM,IAAI,QAAQ,GAAG;AACpC,aAAO,QAAQ,GAAG;AAAA,IACpB;AAAA,EACF;AAEA,IAAE,wBAAwB;AAC1B,SAAO;AACT","sourcesContent":["import type { RemoteScope } from '#internal/runtime/turbopack/remote-scope';\nimport type {\n GlobalScope,\n MountOrUnmountFunction,\n MountUnmountFunctions,\n} from '#internal/runtime/types';\n\n/**\n * Typed namespace for all remote-components runtime state.\n *\n * Consolidates scattered `globalThis` globals into a single object at\n * `globalThis.__remote_components__`. Each property corresponds to a\n * previously independent global — see inline `@see` tags for the original\n * global name. Code that previously read from those globals still works\n * because each migration writes through to both the namespace and the\n * legacy global (pointing at the same underlying object).\n */\nexport interface RemoteComponentsNamespace {\n /** @see `__remote_component_scopes__` */\n scopes: Map<string, RemoteScope>;\n /** @see `__remote_components_turbopack_chunk_loader_promise__` */\n chunkCache: Record<string, Promise<unknown>>;\n /** @see `__remote_script_entrypoint_mount__` */\n mountFns: Record<string, Set<MountOrUnmountFunction>>;\n /** @see `__remote_script_entrypoint_unmount__` */\n unmountFns: Record<string, Set<MountOrUnmountFunction>>;\n /** @see `__remote_bundle_url__` */\n bundleUrls: Record<string, string | URL>;\n /** @see `__rc_module_registry__` */\n moduleRegistry: Record<string, unknown>;\n /** @see `__webpack_require_type__` */\n dispatcherRuntime: string | undefined;\n /** @see `__remote_component_host_shared_modules__` */\n hostSharedModules: Record<string, () => Promise<unknown>>;\n /** @see `__remote_next_css__` */\n cssCache: Record<string, ChildNode[]>;\n /** @see `__remote_components_shadowroot_*` */\n shadowRoots: Record<string, ShadowRoot | null>;\n}\n\n/** Prefix for legacy per-key shadow root globals (`__remote_components_shadowroot_*`). */\nconst SHADOW_ROOT_PREFIX = '__remote_components_shadowroot_';\n\n/**\n * Backward-compat aliases for globals used in <=0.3.3.\n *\n * Only includes object/Map values that can be aliased by reference.\n * Primitives (`dispatcherRuntime`) must use write-through at their call sites.\n * Dynamic-key shadow root globals are adopted separately in `getNamespace()`.\n */\nconst LEGACY_ALIASES: ReadonlyArray<{\n global: string;\n prop: keyof RemoteComponentsNamespace;\n}> = [\n { global: '__remote_component_scopes__', prop: 'scopes' },\n {\n global: '__remote_components_turbopack_chunk_loader_promise__',\n prop: 'chunkCache',\n },\n { global: '__remote_script_entrypoint_mount__', prop: 'mountFns' },\n { global: '__remote_script_entrypoint_unmount__', prop: 'unmountFns' },\n { global: '__remote_bundle_url__', prop: 'bundleUrls' },\n { global: '__rc_module_registry__', prop: 'moduleRegistry' },\n {\n global: '__remote_component_host_shared_modules__',\n prop: 'hostSharedModules',\n },\n { global: '__remote_next_css__', prop: 'cssCache' },\n];\n\n/**\n * Returns the single shared `RemoteComponentsNamespace` instance, creating\n * it on first access. The namespace lives at `globalThis.__remote_components__`\n * so every module in the page shares the same state regardless of how many\n * copies of the library are loaded.\n *\n * On first initialization this function also handles backward compatibility\n * with legacy globals:\n * 1. **Adopt**: if a legacy global already exists (written by older code before\n * the namespace was created), its value becomes the initial namespace value.\n * 2. **Alias**: legacy globals are assigned to point at the namespace's objects,\n * so older code that reads the legacy global sees the same reference.\n */\nexport function getNamespace(): RemoteComponentsNamespace {\n const g = globalThis as GlobalScope & MountUnmountFunctions;\n const existing = g.__remote_components__;\n if (existing) {\n return existing;\n }\n\n const ns: RemoteComponentsNamespace = {\n scopes: new Map(),\n chunkCache: {},\n mountFns: {},\n unmountFns: {},\n bundleUrls: {},\n moduleRegistry: {},\n dispatcherRuntime: undefined,\n hostSharedModules: {},\n cssCache: {},\n shadowRoots: {},\n };\n\n // Adopt any pre-existing legacy globals, then alias them to the namespace.\n const nsRecord = ns as unknown as Record<string, unknown>;\n for (const { global, prop } of LEGACY_ALIASES) {\n const legacyValue = (g as Record<string, unknown>)[global];\n if (legacyValue != null) {\n nsRecord[prop] = legacyValue;\n }\n (g as Record<string, unknown>)[global] = ns[prop];\n }\n\n // Adopt per-key shadow root globals used in <=0.3.3\n // (e.g. `globalThis.__remote_components_shadowroot_<key> = root`).\n const gRecord = g as Record<string, unknown>;\n for (const key of Object.keys(gRecord)) {\n if (key.startsWith(SHADOW_ROOT_PREFIX)) {\n const suffix = key.slice(SHADOW_ROOT_PREFIX.length);\n ns.shadowRoots[suffix] = gRecord[key] as ShadowRoot | null;\n delete gRecord[key];\n }\n }\n\n g.__remote_components__ = ns;\n return ns;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/runtime/namespace.ts"],"sourcesContent":["import type { RemoteScope } from '#internal/runtime/turbopack/remote-scope';\nimport type {\n GlobalScope,\n MountOrUnmountFunction,\n MountUnmountFunctions,\n} from '#internal/runtime/types';\n\n/**\n * Typed namespace for all remote-components runtime state.\n *\n * Consolidates scattered `globalThis` globals into a single object at\n * `globalThis.__remote_components__`. Each property corresponds to a\n * previously independent global — see inline `@see` tags for the original\n * global name. Code that previously read from those globals still works\n * because each migration writes through to both the namespace and the\n * legacy global (pointing at the same underlying object).\n */\nexport interface RemoteComponentsNamespace {\n /** @see `__remote_component_scopes__` */\n scopes: Map<string, RemoteScope>;\n /** @see `__remote_components_turbopack_chunk_loader_promise__` */\n chunkCache: Record<string, Promise<unknown>>;\n /** @see `__remote_script_entrypoint_mount__` */\n mountFns: Record<string, Set<MountOrUnmountFunction>>;\n /** @see `__remote_script_entrypoint_unmount__` */\n unmountFns: Record<string, Set<MountOrUnmountFunction>>;\n /** @see `__remote_bundle_url__` */\n bundleUrls: Record<string, string | URL>;\n /** @see `__rc_module_registry__` */\n moduleRegistry: Record<string, unknown>;\n /** @see `__webpack_require_type__` */\n dispatcherRuntime: string | undefined;\n /** @see `__remote_component_host_shared_modules__` */\n hostSharedModules: Record<string, () => Promise<unknown>>;\n /** @see `__remote_next_css__` */\n cssCache: Record<string, ChildNode[]>;\n /** @see `__remote_components_shadowroot_*` */\n shadowRoots: Record<string, ShadowRoot | null>;\n}\n\n/** Prefix for legacy per-key shadow root globals (`__remote_components_shadowroot_*`). */\nconst SHADOW_ROOT_PREFIX = '__remote_components_shadowroot_';\n\n/**\n * Backward-compat aliases for globals used in <=0.3.3.\n *\n * Only includes object/Map values that can be aliased by reference.\n * Primitives (`dispatcherRuntime`) must use write-through at their call sites.\n * Dynamic-key shadow root globals are adopted separately in `getNamespace()`.\n */\nconst LEGACY_ALIASES: ReadonlyArray<{\n global: string;\n prop: keyof RemoteComponentsNamespace;\n}> = [\n { global: '__remote_component_scopes__', prop: 'scopes' },\n {\n global: '__remote_components_turbopack_chunk_loader_promise__',\n prop: 'chunkCache',\n },\n { global: '__remote_script_entrypoint_mount__', prop: 'mountFns' },\n { global: '__remote_script_entrypoint_unmount__', prop: 'unmountFns' },\n { global: '__remote_bundle_url__', prop: 'bundleUrls' },\n { global: '__rc_module_registry__', prop: 'moduleRegistry' },\n {\n global: '__remote_component_host_shared_modules__',\n prop: 'hostSharedModules',\n },\n { global: '__remote_next_css__', prop: 'cssCache' },\n];\n\n/**\n * Returns the single shared `RemoteComponentsNamespace` instance, creating\n * it on first access. The namespace lives at `globalThis.__remote_components__`\n * so every module in the page shares the same state regardless of how many\n * copies of the library are loaded.\n *\n * On first initialization this function also handles backward compatibility\n * with legacy globals:\n * 1. **Adopt**: if a legacy global already exists (written by older code before\n * the namespace was created), its value becomes the initial namespace value.\n * 2. **Alias**: legacy globals are assigned to point at the namespace's objects,\n * so older code that reads the legacy global sees the same reference.\n */\nexport function getNamespace(): RemoteComponentsNamespace {\n const g = globalThis as GlobalScope & MountUnmountFunctions;\n const existing = g.__remote_components__;\n if (existing) {\n return existing;\n }\n\n const ns: RemoteComponentsNamespace = {\n scopes: new Map(),\n chunkCache: {},\n mountFns: {},\n unmountFns: {},\n bundleUrls: {},\n moduleRegistry: {},\n dispatcherRuntime: undefined,\n hostSharedModules: {},\n cssCache: {},\n shadowRoots: {},\n };\n\n // Adopt any pre-existing legacy globals, then alias them to the namespace.\n const nsRecord = ns as unknown as Record<string, unknown>;\n for (const { global, prop } of LEGACY_ALIASES) {\n const legacyValue = (g as Record<string, unknown>)[global];\n if (legacyValue != null) {\n nsRecord[prop] = legacyValue;\n }\n (g as Record<string, unknown>)[global] = ns[prop];\n }\n\n // Adopt per-key shadow root globals used in <=0.3.3\n // (e.g. `globalThis.__remote_components_shadowroot_<key> = root`).\n const gRecord = g as Record<string, unknown>;\n for (const key of Object.keys(gRecord)) {\n if (key.startsWith(SHADOW_ROOT_PREFIX)) {\n const suffix = key.slice(SHADOW_ROOT_PREFIX.length);\n ns.shadowRoots[suffix] = gRecord[key] as ShadowRoot | null;\n delete gRecord[key];\n }\n }\n\n g.__remote_components__ = ns;\n return ns;\n}\n"],"mappings":";AAyCA,IAAM,qBAAqB;AAS3B,IAAM,iBAGD;AAAA,EACH,EAAE,QAAQ,+BAA+B,MAAM,SAAS;AAAA,EACxD;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,EACR;AAAA,EACA,EAAE,QAAQ,sCAAsC,MAAM,WAAW;AAAA,EACjE,EAAE,QAAQ,wCAAwC,MAAM,aAAa;AAAA,EACrE,EAAE,QAAQ,yBAAyB,MAAM,aAAa;AAAA,EACtD,EAAE,QAAQ,0BAA0B,MAAM,iBAAiB;AAAA,EAC3D;AAAA,IACE,QAAQ;AAAA,IACR,MAAM;AAAA,EACR;AAAA,EACA,EAAE,QAAQ,uBAAuB,MAAM,WAAW;AACpD;AAeO,SAAS,eAA0C;AACxD,QAAM,IAAI;AACV,QAAM,WAAW,EAAE;AACnB,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AAEA,QAAM,KAAgC;AAAA,IACpC,QAAQ,oBAAI,IAAI;AAAA,IAChB,YAAY,CAAC;AAAA,IACb,UAAU,CAAC;AAAA,IACX,YAAY,CAAC;AAAA,IACb,YAAY,CAAC;AAAA,IACb,gBAAgB,CAAC;AAAA,IACjB,mBAAmB;AAAA,IACnB,mBAAmB,CAAC;AAAA,IACpB,UAAU,CAAC;AAAA,IACX,aAAa,CAAC;AAAA,EAChB;AAGA,QAAM,WAAW;AACjB,aAAW,EAAE,QAAQ,KAAK,KAAK,gBAAgB;AAC7C,UAAM,cAAe,EAA8B,MAAM;AACzD,QAAI,eAAe,MAAM;AACvB,eAAS,IAAI,IAAI;AAAA,IACnB;AACA,IAAC,EAA8B,MAAM,IAAI,GAAG,IAAI;AAAA,EAClD;AAIA,QAAM,UAAU;AAChB,aAAW,OAAO,OAAO,KAAK,OAAO,GAAG;AACtC,QAAI,IAAI,WAAW,kBAAkB,GAAG;AACtC,YAAM,SAAS,IAAI,MAAM,mBAAmB,MAAM;AAClD,SAAG,YAAY,MAAM,IAAI,QAAQ,GAAG;AACpC,aAAO,QAAQ,GAAG;AAAA,IACpB;AAAA,EACF;AAEA,IAAE,wBAAwB;AAC1B,SAAO;AACT;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/config/webpack/apply-shared-modules.ts","../src/config/webpack/next-client-pages-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;AASA,IAAM,wBACJ;AAEK,SAAS,mBACd,QACA,SACA;AACA;AAAA,IACE;AAAA,IACA,0CAA0C;AAAA,EAC5C;AACA;AAAA,IACE;AAAA,IACA,8BAA8B,OAAO,KAAK,OAAO;AAAA,EACnD;AAGA,QAAM,OAAO;AAab,QAAM,QAAQ,SAAS,MAAM;AAI7B,QAAM,gBACJ,OAAO,kBAAkB,KAAK,6BAA6B,MAAM;AAEnE,MAAI,eAAe;AACjB,UAAM,cAAc,OAAO;AAAA,MACzB,KAAK,gCAAgC,MAAM,KAAK,cAAc,KAAK,CAAC;AAAA,IACtE;AACA;AAAA,MACE;AAAA,MACA,sCAAsC,YAAY;AAAA,IACpD;AAGA,eAAW,CAAC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D,CAAC;AAEH,aAAO,KAAK,KAAK,gCAAgC,MAAM,KAAK,CAAC,CAAC,EAC3D,OAAO,CAAC,SAAS,MAAM,KAAK,IAAI,CAAC,EACjC,QAAQ,CAAC,SAAS;AACjB,cAAM,KAAK,KAAK,gCAAgC,MAAM,IAAI,IAAI;AAC9D,YAAI,IAAI;AACN,eAAK,6BAA6B,MAAM,IAAI,EAAE;AAAA,QAChD;AAAA,MACF,CAAC;AAEH,YAAM,WAAW,CAAC;AAClB,UAAI,OAAO,QAAQ;AACnB,aAAO,QAAQ,SAAS,YAAY;AAClC,iBAAS,KAAK,IAAI;AAClB,aAAK,OAAO;AACZ,eAAO,QAAQ;AAAA,MACjB;AACA,eAAS,MAAM,IAAI;AAAA,IACrB;AAGA,QAAI,gBAAgB;AAClB,YAAM,WAAW,SAAS,MAAM;AAChC,eAAS,QAAQ,CAAC,OAAO;AACvB,uBAAe,YAAY,GAAG,UAAU,IAAI,CAAC;AAAA,MAC/C,CAAC;AAAA,IACH,OAAO;AAEL,YAAM,WAAW,SAAS,MAAM;AAChC,eAAS,QAAQ,CAAC,OAAO;AACvB,iBAAS,KAAK,YAAY,EAAE;AAAA,MAC9B,CAAC;AAAA,IACH;AAGA,WAAO,KAAK;AACZ,SAAK,WAAW;AAGhB,QAAI,iBAAiB;AACnB,sBAAgB,YAAY,YAAY,eAAe;AAAA,IACzD;AAEA,YAAQ,OAAO;AACf,eAAW,OAAO;AAElB,WAAO,EAAE,WAAW,IAAI;AAAA,EAC1B;AAEA,SAAO,EAAE,WAAW,MAAM,KAAK,KAAK;AACtC","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\n\nimport { getScope } from '#internal/runtime/turbopack/remote-scope';\nimport { logDebug, logWarn } from '#internal/utils/logger';\n\nconst DEDUPLICATION_SKIPPED =\n 'shared module deduplication skipped. The remote may load its own copy of shared dependencies.';\n\nexport function applySharedModules(\n bundle: string,\n resolve: Record<string, unknown>,\n) {\n logDebug(\n 'SharedModules',\n `applySharedModules called for bundle: \"${bundle}\"`,\n );\n logDebug(\n 'SharedModules',\n `Shared modules to resolve: ${Object.keys(resolve)}`,\n );\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 // Prefer scope-based access when available.\n const scope = getScope(bundle);\n // @legacy(v0.3.4) — fall back to global __remote_webpack_require__ for hosts that\n // haven't run setupWebpackRuntime yet (e.g. HTML host's inline path).\n // Remove once all host types go through the shared pipeline (Phase 5).\n const webpackBundle =\n scope?.webpackRequire ?? self.__remote_webpack_require__?.[bundle];\n\n if (webpackBundle) {\n const modulePaths = Object.keys(\n self.__remote_webpack_module_map__?.[bundle] ?? webpackBundle.m ?? {},\n );\n logDebug(\n 'SharedModules',\n `Available module paths for bundle \"${bundle}\": ${modulePaths}`,\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 exactIds = modulePaths.filter((p) => p === key);\n const ids =\n exactIds.length > 0\n ? exactIds\n : modulePaths.filter((p) => p.includes(key));\n\n if (ids.length === 0) {\n logDebug(\n 'SharedModules',\n `No matching module path found for shared module \"${key}\"`,\n );\n }\n\n for (const id of ids) {\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 const resolvedId = self.__remote_webpack_module_map__?.[bundle]?.[id]\n ? `${self.__remote_webpack_module_map__[bundle][id]}`\n : id;\n if (resolvedId !== id) {\n logDebug(\n 'SharedModules',\n `Mapped module id: \"${id}\" -> \"${resolvedId}\"`,\n );\n }\n // create a mock module which exports the shared module\n webpackBundle.m[resolvedId] = (module) => {\n module.exports = value;\n };\n } else {\n logWarn(\n 'SharedModules',\n `webpackBundle.m is not available for bundle \"${bundle}\" — ${DEDUPLICATION_SKIPPED}`,\n );\n }\n }\n }\n } else {\n logWarn(\n 'SharedModules',\n `No webpack require found for bundle \"${bundle}\" — ${DEDUPLICATION_SKIPPED}`,\n );\n logDebug(\n 'SharedModules',\n `Available bundles: ${Object.keys(self.__remote_webpack_require__ ?? {})}`,\n );\n }\n}\n","import { getNamespace } from '#internal/runtime/namespace';\nimport { RemoteComponentsError } from '#internal/utils/error';\n\n// module loader for Next.js Pages Router\nexport function nextClientPagesLoader(\n bundle: string,\n route: string,\n styleContainer: HTMLHeadElement | ShadowRoot | null = document.head,\n) {\n // make a typed reference to the global scope\n const self = globalThis as typeof globalThis & {\n // webpack remote module loading function scoped for each bundle\n __remote_webpack_require__?: Record<\n string,\n ((remoteId: string | number) => unknown) & {\n c?: Record<\n string | number,\n { id: string; parents: string[]; children: string[] }\n >;\n m?: Record<string | number, (module: { exports: unknown }) => void>;\n type?: 'turbopack' | 'webpack';\n }\n >;\n // webpack module map for each bundle used in production builds\n __remote_webpack_module_map__?: Record<string, Record<string, number>>;\n // Next.js client pages loader reference storage\n __NEXT_P?: [\n (\n | [\n string,\n () => { default?: React.ComponentType<Record<string, unknown>> },\n ]\n | undefined\n ),\n (\n | [\n string,\n () => {\n default?: React.ComponentType<\n {\n Component: React.ComponentType<Record<string, unknown>>;\n } & Record<string, unknown>\n >;\n },\n ]\n | undefined\n ),\n (\n | [\n string,\n () => {\n default?: React.ComponentType<\n {\n Component: React.ComponentType<Record<string, unknown>>;\n } & Record<string, unknown>\n >;\n },\n ]\n | undefined\n ),\n ];\n };\n\n // temporarily remove the original Next.js CSS loader\n const nextCssOriginal = document.querySelector(\n `[id=\"__next_css__DO_NOT_USE__\"]:not([data-bundle=\"${bundle}\"][data-route=\"${route}\"])`,\n );\n if (nextCssOriginal) {\n nextCssOriginal.parentNode?.removeChild(nextCssOriginal);\n }\n\n // create a new Next.js CSS loader element\n const nextCss = document.createElement('noscript');\n nextCss.id = '__next_css__DO_NOT_USE__';\n nextCss.setAttribute('data-bundle', bundle);\n nextCss.setAttribute('data-route', route);\n const nextCssEnd = document.createElement('noscript');\n nextCssEnd.id = '__next_css__DO_NOT_USE_END__';\n nextCssEnd.setAttribute('data-bundle', bundle);\n nextCssEnd.setAttribute('data-route', route);\n document.head.appendChild(nextCssEnd);\n document.head.appendChild(nextCss);\n\n // find the page component loader chunk\n const componentLoaderChunk =\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=${encodeURIComponent(route)}!`),\n ) ??\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n self.__remote_webpack_module_map__?.[bundle]?.[\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=${encodeURIComponent(route)}!`),\n ) ??\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n ''\n ] ??\n -1;\n\n // find the app loader chunk\n const appLoaderChunk =\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=%2F_app`),\n ) ??\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n self.__remote_webpack_module_map__?.[bundle]?.[\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) =>\n key.includes('/webpack/loaders/next-client-pages-loader.js') &&\n key.includes(`page=%2F_app`),\n ) ??\n Object.keys(self.__remote_webpack_module_map__[bundle] ?? {}).find(\n (key) => key.includes('/next/dist/client/page-loader.js'),\n ) ??\n ''\n ] ??\n -1;\n\n // if we didn't find the component loader or app loader, throw an error\n if (!(componentLoaderChunk && appLoaderChunk)) {\n throw new RemoteComponentsError(\n `Next.js client pages loader not found in bundle \"${bundle}\".`,\n );\n }\n\n // temporarily store the original __NEXT_P reference\n // this is required to avoid conflicts with the Next.js client pages loader\n // which uses the same global variable to store the page components\n const __NEXT_P_ORIGINAL = self.__NEXT_P;\n const selfOriginal = self;\n delete selfOriginal.__NEXT_P;\n\n // load the component and app loader chunks\n self.__remote_webpack_require__?.[bundle]?.(\n self.__remote_webpack_require__[bundle].type !== 'turbopack'\n ? componentLoaderChunk\n : `[${bundle}] ${componentLoaderChunk}`,\n );\n if (\n typeof appLoaderChunk === 'string' ||\n (typeof appLoaderChunk === 'number' && appLoaderChunk !== -1)\n ) {\n self.__remote_webpack_require__?.[bundle]?.(\n self.__remote_webpack_require__[bundle].type !== 'turbopack'\n ? appLoaderChunk\n : `[${bundle}] ${appLoaderChunk}`,\n );\n }\n\n // if we have the __NEXT_P global variable, we can extract the component and app\n if (self.__NEXT_P) {\n const [, componentLoader] = self.__NEXT_P[0] ?? [\n undefined,\n () => ({ default: null }),\n ];\n const [, appLoader] = self.__NEXT_P[2] ?? [\n undefined,\n () => ({\n default: null,\n }),\n ];\n const { default: Component } = componentLoader();\n const { default: App } = appLoader();\n\n const cssCache = getNamespace().cssCache;\n\n if (!cssCache[bundle]) {\n // load the CSS files from the remote bundle\n const cssRE = /\\.s?css$/;\n Object.keys(self.__remote_webpack_require__?.[bundle]?.m ?? {})\n .filter((id) => cssRE.test(id))\n .forEach((id) => {\n self.__remote_webpack_require__?.[bundle]?.(id);\n });\n\n Object.keys(self.__remote_webpack_module_map__?.[bundle] ?? {})\n .filter((path) => cssRE.test(path))\n .forEach((path) => {\n const id = self.__remote_webpack_module_map__?.[bundle]?.[path];\n if (id) {\n self.__remote_webpack_require__?.[bundle]?.(id);\n }\n });\n\n const elements = [];\n let node = nextCss.previousSibling;\n while (node && node !== nextCssEnd) {\n elements.push(node);\n node.remove();\n node = nextCss.previousSibling;\n }\n cssCache[bundle] = elements;\n }\n\n // if the styleContainer is provided, we need to move the styles to it\n if (styleContainer) {\n const elements = cssCache[bundle];\n elements.forEach((el) => {\n styleContainer.appendChild(el.cloneNode(true));\n });\n } else {\n // if no styleContainer is provided, we need to move the styles back to the head\n const elements = cssCache[bundle];\n elements.forEach((el) => {\n document.head.appendChild(el);\n });\n }\n\n // restore the original __NEXT_P reference\n delete self.__NEXT_P;\n self.__NEXT_P = __NEXT_P_ORIGINAL;\n\n // restore the original Next.js CSS loader\n if (nextCssOriginal) {\n nextCssOriginal.parentNode?.appendChild(nextCssOriginal);\n }\n\n nextCss.remove();\n nextCssEnd.remove();\n\n return { Component, App };\n }\n\n return { Component: null, App: null };\n}\n"]}
@@ -1,11 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkCREXMFMFcjs = require('./chunk-CREXMFMF.cjs');
4
- require('./chunk-7MVFHOIP.cjs');
5
- require('./chunk-RUWR74XQ.cjs');
6
- require('./chunk-KE7QPAQ4.cjs');
7
- require('./chunk-SHFJ5OQA.cjs');
8
-
9
-
10
- exports.loadStaticRemoteComponent = _chunkCREXMFMFcjs.loadStaticRemoteComponent;
11
- //# sourceMappingURL=static-loader-ZYD5BO4D.cjs.map