remote-components 0.3.6 → 0.4.0
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/{chunk-6IUP26UK.cjs → chunk-42TVDI3G.cjs} +5 -4
- package/dist/chunk-42TVDI3G.cjs.map +1 -0
- package/dist/chunk-5KTAEO52.cjs +28 -0
- package/dist/chunk-5KTAEO52.cjs.map +1 -0
- package/dist/{chunk-42N2ZLE2.js → chunk-5WL3FP4V.js} +6 -6
- package/dist/{chunk-ZPMTZ3KJ.js → chunk-AKOMV2UF.js} +4 -3
- package/dist/chunk-AKOMV2UF.js.map +1 -0
- package/dist/{chunk-ER73O65F.cjs → chunk-AYC2AWUG.cjs} +23 -23
- package/dist/{chunk-KEPHL25S.js → chunk-D5GNZB6O.js} +2 -1
- package/dist/chunk-D5GNZB6O.js.map +1 -0
- package/dist/{chunk-F44NODUS.cjs → chunk-EYALF655.cjs} +26 -26
- package/dist/{chunk-XCFYWSLD.cjs → chunk-JJTCFQHE.cjs} +31 -19
- package/dist/chunk-JJTCFQHE.cjs.map +1 -0
- package/dist/{chunk-OO4AMJWO.js → chunk-LQ7VQ74E.js} +2 -2
- package/dist/{chunk-2VQGCACH.js → chunk-MKO52FRO.js} +30 -18
- package/dist/chunk-MKO52FRO.js.map +1 -0
- package/dist/{chunk-KYJWRZ2B.js → chunk-N3KPUFOB.js} +3 -3
- package/dist/chunk-N3SQTOSE.cjs +25 -0
- package/dist/chunk-N3SQTOSE.cjs.map +1 -0
- package/dist/{chunk-W5ESPGHH.js → chunk-NN5V3FVD.js} +27 -15
- package/dist/chunk-NN5V3FVD.js.map +1 -0
- package/dist/chunk-RHGEBXPL.js +25 -0
- package/dist/chunk-RHGEBXPL.js.map +1 -0
- package/dist/{chunk-R4QFK5TN.cjs → chunk-RLI4YTBJ.cjs} +20 -4
- package/dist/chunk-RLI4YTBJ.cjs.map +1 -0
- package/dist/{chunk-HNZVEIKN.js → chunk-SAGYPGIQ.js} +18 -2
- package/dist/chunk-SAGYPGIQ.js.map +1 -0
- package/dist/chunk-STIJO4AG.js +28 -0
- package/dist/chunk-STIJO4AG.js.map +1 -0
- package/dist/{chunk-CREXMFMF.cjs → chunk-TZT7DLO5.cjs} +4 -4
- package/dist/{chunk-KKBEMQU7.cjs → chunk-Y4GMYUJT.cjs} +41 -29
- package/dist/chunk-Y4GMYUJT.cjs.map +1 -0
- package/dist/{chunk-7MVFHOIP.cjs → chunk-Z2SLBFQL.cjs} +2 -1
- package/dist/chunk-Z2SLBFQL.cjs.map +1 -0
- package/dist/config/nextjs.cjs +7 -12
- package/dist/config/nextjs.cjs.map +1 -1
- package/dist/config/nextjs.js +4 -9
- package/dist/config/nextjs.js.map +1 -1
- package/dist/host/html.cjs +29 -28
- package/dist/host/html.cjs.map +1 -1
- package/dist/host/html.js +12 -11
- package/dist/host/html.js.map +1 -1
- package/dist/host/navigation.cjs +8 -0
- package/dist/host/navigation.d.ts +30 -0
- package/dist/host/navigation.js +8 -0
- package/dist/host/nextjs/app/client-only.cjs +16 -14
- package/dist/host/nextjs/app/client-only.cjs.map +1 -1
- package/dist/host/nextjs/app/client-only.d.ts +2 -1
- package/dist/host/nextjs/app/client-only.js +11 -9
- package/dist/host/nextjs/app/client-only.js.map +1 -1
- package/dist/host/react.cjs +14 -10
- package/dist/host/react.d.ts +2 -1
- package/dist/host/react.js +15 -11
- package/dist/{index-4c65355c.d.ts → index-d2ce8a3f.d.ts} +22 -2
- package/dist/internal/config/webpack/next-client-pages-loader.cjs +27 -15
- package/dist/internal/config/webpack/next-client-pages-loader.cjs.map +1 -1
- package/dist/internal/config/webpack/next-client-pages-loader.d.ts +3 -5
- package/dist/internal/config/webpack/next-client-pages-loader.js +27 -15
- package/dist/internal/config/webpack/next-client-pages-loader.js.map +1 -1
- package/dist/internal/host/nextjs/app-client.d.ts +1 -1
- package/dist/internal/host/react/context.d.ts +2 -2
- package/dist/internal/host/shared/navigate-event.cjs +51 -0
- package/dist/internal/host/shared/navigate-event.cjs.map +1 -0
- package/dist/internal/host/shared/navigate-event.d.ts +21 -0
- package/dist/internal/host/shared/navigate-event.js +26 -0
- package/dist/internal/host/shared/navigate-event.js.map +1 -0
- package/dist/internal/host/shared/pipeline.d.ts +2 -2
- package/dist/internal/host/shared/polyfill.cjs +14 -0
- package/dist/internal/host/shared/polyfill.cjs.map +1 -1
- package/dist/internal/host/shared/polyfill.js +16 -0
- package/dist/internal/host/shared/polyfill.js.map +1 -1
- package/dist/internal/runtime/loaders/component-loader.d.ts +2 -2
- package/dist/internal/runtime/loaders/script-loader.cjs +2 -1
- package/dist/internal/runtime/loaders/script-loader.cjs.map +1 -1
- package/dist/internal/runtime/loaders/script-loader.js +2 -1
- package/dist/internal/runtime/loaders/script-loader.js.map +1 -1
- package/dist/internal/runtime/loaders/static-loader.d.ts +2 -1
- package/dist/internal/runtime/namespace.cjs +1 -0
- package/dist/internal/runtime/namespace.cjs.map +1 -1
- package/dist/internal/runtime/namespace.d.ts +2 -1
- package/dist/internal/runtime/namespace.js +1 -0
- package/dist/internal/runtime/namespace.js.map +1 -1
- package/dist/internal/runtime/types.d.ts +2 -1
- package/dist/navigate-event-baee0b63.d.ts +14 -0
- package/dist/remote/html.cjs +1 -1
- package/dist/remote/html.js +1 -1
- package/dist/{script-6W5JRBZK.cjs → script-D5AD7HLV.cjs} +4 -4
- package/dist/{script-IFEBOLIA.js → script-VPOI7ARP.js} +3 -3
- package/dist/{server-handoff-ce13bebc.d.ts → server-handoff-8c89b856.d.ts} +2 -2
- package/dist/{static-loader-X4TSF5KW.js → static-loader-OHSAUD62.js} +3 -3
- package/dist/static-loader-OHSAUD62.js.map +1 -0
- package/dist/static-loader-UDIXK5MV.cjs +11 -0
- package/dist/static-loader-UDIXK5MV.cjs.map +1 -0
- package/dist/{turbopack-NPGO3MWS.js → turbopack-DK6L7P3J.js} +6 -5
- package/dist/{turbopack-NPGO3MWS.js.map → turbopack-DK6L7P3J.js.map} +1 -1
- package/dist/{turbopack-WRMKPNN4.cjs → turbopack-PSD4THQE.cjs} +13 -12
- package/dist/turbopack-PSD4THQE.cjs.map +1 -0
- package/dist/{types-59251814.d.ts → types-8b0edd78.d.ts} +7 -0
- package/dist/{webpack-DUBHPYD6.js → webpack-KSDNIXMS.js} +6 -5
- package/dist/{webpack-DUBHPYD6.js.map → webpack-KSDNIXMS.js.map} +1 -1
- package/dist/{webpack-KSCMCL7M.cjs → webpack-SIFRCBIN.cjs} +13 -12
- package/dist/webpack-SIFRCBIN.cjs.map +1 -0
- package/package.json +9 -1
- package/dist/chunk-2VQGCACH.js.map +0 -1
- package/dist/chunk-6IUP26UK.cjs.map +0 -1
- package/dist/chunk-7MVFHOIP.cjs.map +0 -1
- package/dist/chunk-HNZVEIKN.js.map +0 -1
- package/dist/chunk-KEPHL25S.js.map +0 -1
- package/dist/chunk-KKBEMQU7.cjs.map +0 -1
- package/dist/chunk-R4QFK5TN.cjs.map +0 -1
- package/dist/chunk-W5ESPGHH.js.map +0 -1
- package/dist/chunk-XCFYWSLD.cjs.map +0 -1
- package/dist/chunk-ZPMTZ3KJ.js.map +0 -1
- package/dist/static-loader-ZYD5BO4D.cjs +0 -11
- package/dist/turbopack-WRMKPNN4.cjs.map +0 -1
- package/dist/webpack-KSCMCL7M.cjs.map +0 -1
- /package/dist/{chunk-42N2ZLE2.js.map → chunk-5WL3FP4V.js.map} +0 -0
- /package/dist/{chunk-ER73O65F.cjs.map → chunk-AYC2AWUG.cjs.map} +0 -0
- /package/dist/{chunk-F44NODUS.cjs.map → chunk-EYALF655.cjs.map} +0 -0
- /package/dist/{chunk-OO4AMJWO.js.map → chunk-LQ7VQ74E.js.map} +0 -0
- /package/dist/{chunk-KYJWRZ2B.js.map → chunk-N3KPUFOB.js.map} +0 -0
- /package/dist/{chunk-CREXMFMF.cjs.map → chunk-TZT7DLO5.cjs.map} +0 -0
- /package/dist/{static-loader-ZYD5BO4D.cjs.map → host/navigation.cjs.map} +0 -0
- /package/dist/{static-loader-X4TSF5KW.js.map → host/navigation.js.map} +0 -0
- /package/dist/{script-6W5JRBZK.cjs.map → script-D5AD7HLV.cjs.map} +0 -0
- /package/dist/{script-IFEBOLIA.js.map → script-VPOI7ARP.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/index.ts","../src/runtime/constants.ts","../src/runtime/patterns.ts","../src/runtime/turbopack/remote-scope.ts","../src/host/shared/remote-image-loader.ts","../src/host/shared/polyfill.tsx","../src/host/shared/shared-module-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAO,SAAS,aAAa,KAAa;AACxC,SAAO,IAAI,QAAQ,cAAc,GAAG;AACtC;AAaO,SAAS,kBACd,MACA,SACQ;AACR,SAAO,GAAG,QAAQ,aAAa,QAAQ,WAAW,YAAY,CAAC;AACjE;AAEO,IAAM,aAAa;AAAA,EACxB,eAAe;AAAA,EACf,aAAa;AAAA,EACb,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,QAAQ;AACV;;;AC1BO,IAAM,sBAAsB;AAC5B,IAAM,yBAAyB;AAC/B,IAAM,gBAAgB;AAEtB,IAAM,kBAAkB;AACxB,IAAM,oBAAoB;AAC1B,IAAM,iBAAiB;AAEvB,SAAS,aAAa,QAAwB;AACnD,SAAO,aAAa,MAAM;AAC5B;;;ACZO,IAAM,yBACX;AAIK,IAAM,sBAAsB;AAGnC,IAAM,kBAAkB;AACjB,SAAS,sBAAsB,MAAsB;AAC1D,SAAO,KAAK,QAAQ,iBAAiB,GAAG;AAC1C;;;AC4CA,SAAS,cAAwC;AAC/C,SAAO,aAAa,EAAE;AACxB;AAEO,SAAS,YACd,MACA,KACA,SACA,kBACa;AACb,QAAM,aAAa,kBAAkB,MAAM,EAAE,YAAY,IAAI,KAAK,CAAC;AACnE,QAAM,YAAY,aAAa,UAAU;AACzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,CAAC;AA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ACF;AACA,QAAM,QAAQ;AAAA,IACZ,OAAO,QAAQ,OAAO,EAAE,IAAI,OAAO,CAAC,KAAK,KAAK,MAAM;AAClD,UAAI,OAAO,UAAU,YAAY;AAC/B,gBAAQ,GAAG,IAAI,MAAM,MAAM,MAAM;AAAA,MACnC;AACA,aAAO,QAAQ,QAAQ,KAAK;AAAA,IAC9B,CAAC;AAAA,EACH;AACA,SAAO;AACT","sourcesContent":["export function escapeString(str: string) {\n return str.replace(/[^a-z0-9]/g, '_');\n}\n\n/**\n * Computes the origin-qualified scoped name for a bundle by appending\n * the escaped host (hostname + port). This ensures the server and client\n * always agree on the scoped name — the server's cross-origin detection\n * (based on deployment URL) can differ from the client's (based on\n * `location.origin`), so the name must not depend on that distinction.\n *\n * Used on both the server (to rewrite RSC flight data) and the client\n * (to create and look up RemoteScopes). Both sides must produce the\n * same value for a given remote.\n */\nexport function computeScopedName(\n name: string,\n options: { remoteHost: string },\n): string {\n return `${name}_${escapeString(options.remoteHost.toLowerCase())}`;\n}\n\nexport const attrToProp = {\n fetchpriority: 'fetchPriority',\n crossorigin: 'crossOrigin',\n imagesrcset: 'imageSrcSet',\n imagesizes: 'imageSizes',\n srcset: 'srcSet',\n} as Record<string, string>;\n","import { escapeString } from '#internal/utils';\n\nexport const DEFAULT_BUNDLE_NAME = '__vercel_remote_bundle';\nexport const DEFAULT_COMPONENT_NAME = '__vercel_remote_component';\nexport const DEFAULT_ROUTE = '/';\n\nexport const RUNTIME_WEBPACK = 'webpack';\nexport const RUNTIME_TURBOPACK = 'turbopack';\nexport const RUNTIME_SCRIPT = 'script';\n\nexport function getBundleKey(bundle: string): string {\n return escapeString(bundle);\n}\n\nexport type Runtime =\n | typeof RUNTIME_WEBPACK\n | typeof RUNTIME_TURBOPACK\n | typeof RUNTIME_SCRIPT;\n","export const REMOTE_COMPONENT_REGEX =\n /(?<prefix>.*?)\\[(?<bundle>[^\\]]+)\\](?:%20| )(?<id>.+)/;\n\n// Matches Next.js bundle-prefixed paths like /_next/[bundle-name] /static/...\n// Used to strip the bundle identifier before loading scripts via the standard /_next/ path.\nexport const NEXT_BUNDLE_PATH_RE = /\\/_next\\/\\[.+\\](?:%20| )/;\n\n/** Collapse duplicate path separators (`//`) while preserving protocol (`://`). */\nconst DOUBLE_SLASH_RE = /(?<!:)\\/\\//g;\nexport function collapseDoubleSlashes(path: string): string {\n return path.replace(DOUBLE_SLASH_RE, '/');\n}\n","import type { InternalResolveClientUrl } from '#internal/host/server/types';\nimport { getBundleKey, type Runtime } from '#internal/runtime/constants';\nimport { getNamespace } from '#internal/runtime/namespace';\nimport { REMOTE_COMPONENT_REGEX } from '#internal/runtime/patterns';\nimport { computeScopedName } from '#internal/utils';\nimport { logDebug, logWarn } from '#internal/utils/logger';\n\n/**\n * Encapsulates all per-remote state so that two remotes sharing the same\n * bundle name but served from different origins never collide.\n *\n * A scope is created once per `setupRemoteScope` call and threaded\n * directly through internal code paths (chunk loading, module resolution,\n * shared modules). Global dispatchers (`__webpack_require__`,\n * `__webpack_chunk_load__`) only exist for external callers (RSC runtime)\n * and resolve the correct scope via the registry.\n */\nexport interface RemoteScope {\n /** Plain bundle name (e.g. \"remote-component-registry\") */\n name: string;\n /** Origin-qualified key — unique even when two remotes share a name */\n scopedName: string;\n /** Escaped key used as suffix for TURBOPACK_ globals */\n globalKey: string;\n /** Base URL for resolving relative chunk paths */\n url: URL;\n /** Bundler runtime type */\n runtime: Runtime;\n /** Proxy callback for routing chunks through the host */\n resolveClientUrl?: InternalResolveClientUrl;\n /** Per-scope cache of executed Turbopack module exports */\n moduleCache: Record<string, unknown>;\n /** Per-scope shared modules provided by the host (React, etc.) */\n sharedModules: Record<string, unknown>;\n /** Per-scope globalThis substitute passed to module initializers as `g` */\n moduleGlobal: Record<string, unknown>;\n /**\n * Webpack's bundle-scoped require function, populated from\n * `__remote_webpack_require__[bundleName]` for webpack remotes.\n * Undefined for turbopack remotes.\n */\n webpackRequire?: ((id: string | number) => unknown) & {\n m?: Record<string | number, (module: { exports: unknown }) => void>;\n type?: string;\n };\n /**\n * Flat array of captured turbopack module entries: [scriptEl, id, factory, ...].\n * Populated by the push interceptor in handleTurbopackChunk. This is the\n * primary source of truth for getTurbopackModules — immune to the turbopack\n * runtime replacing the TURBOPACK global (canary builds use a deferred-loading\n * pattern that swaps the array for an immediate-processing dispatcher).\n */\n turbopackModules: unknown[];\n}\n\nfunction getRegistry(): Map<string, RemoteScope> {\n return getNamespace().scopes;\n}\n\nexport function createScope(\n name: string,\n url: URL,\n runtime: Runtime,\n resolveClientUrl?: InternalResolveClientUrl,\n): RemoteScope {\n const scopedName = computeScopedName(name, { remoteHost: url.host });\n const globalKey = getBundleKey(scopedName);\n return {\n name,\n scopedName,\n globalKey,\n url,\n runtime,\n resolveClientUrl,\n moduleCache: {},\n sharedModules: {},\n moduleGlobal: {},\n turbopackModules: [],\n };\n}\n\nexport function registerScope(scope: RemoteScope): void {\n const registry = getRegistry();\n registry.set(scope.scopedName, scope);\n\n // Also register under the plain name so static/HTML hosts (which don't\n // rewrite RSC chunk IDs) can look up scopes by the unrewritten bundle name.\n if (scope.scopedName !== scope.name) {\n const existing = registry.get(scope.name);\n if (existing && existing.scopedName !== scope.scopedName) {\n logWarn(\n 'RemoteScope',\n `Plain name \"${scope.name}\" already registered by scope \"${existing.scopedName}\" — ` +\n `overwriting with \"${scope.scopedName}\". Static hosts will only resolve the latest one.`,\n );\n }\n registry.set(scope.name, scope);\n }\n\n logDebug(\n 'RemoteScope',\n `Registered scope \"${scope.scopedName}\" (${registry.size} total)`,\n );\n}\n\n/**\n * Resolves a scope by name. Accepts either the scoped name (used by Next.js\n * hosts that rewrite RSC data server-side) or the plain bundle name (used by\n * static/HTML hosts where chunks arrive unrewritten).\n */\nexport function getScope(name: string): RemoteScope | undefined {\n return getRegistry().get(name);\n}\n\n/** Formats a `[scopedName] path` string for use in chunk/module IDs. */\nexport function formatRemoteId(scope: RemoteScope, path: string): string {\n return `[${scope.scopedName}] ${path}`;\n}\n\n/**\n * Parses the `[bundle] path` format used in chunk/module IDs.\n * Uses REMOTE_COMPONENT_REGEX (the same pattern used by the module dispatcher\n * and script loader) so the two parsing paths can never diverge.\n */\nexport function parseRemoteId(id: string): {\n bundle: string;\n path: string;\n prefix: string;\n} {\n const groups = REMOTE_COMPONENT_REGEX.exec(id)?.groups;\n if (groups?.bundle && groups.id) {\n return {\n bundle: groups.bundle,\n path: groups.id,\n prefix: groups.prefix ?? '',\n };\n }\n return { bundle: 'default', path: id, prefix: '' };\n}\n","import { getScope } from '#internal/runtime/turbopack/remote-scope';\nimport type { InternalResolveClientUrl } from '#internal/runtime/url/resolve-client-url';\n\n/**\n * Replacement for `next/dist/shared/lib/image-loader`.\n *\n * Uses `config.path` (which includes the remote's asset prefix, e.g.\n * `/vc-ap-xxx/_next/image`) to generate URLs that match the server-rendered\n * HTML and avoid hydration mismatches. Under the microfrontends proxy these\n * relative paths are routed to the correct app.\n *\n * For cross-origin deployments (standalone host on a different domain),\n * `config.path` is a relative path that would incorrectly resolve to the host\n * origin, so we prefix it with the remote origin to produce an absolute URL\n * pointing at the remote's optimizer.\n *\n * When `resolveClientUrl` is provided (deployment protection), the final URL\n * is routed through the host's proxy.\n */\nexport function createRemoteImageLoader(\n bundle: string,\n resolveClientUrl?: InternalResolveClientUrl,\n) {\n const loader = Object.assign(\n ({\n config,\n src,\n width,\n quality,\n }: {\n config: { path?: string };\n src: string;\n width: number;\n quality?: number;\n }) => {\n const q = quality ?? 75;\n const remoteOrigin = getScope(bundle)?.url.origin ?? '';\n const isCrossOrigin = remoteOrigin && remoteOrigin !== location.origin;\n const basePath = isCrossOrigin\n ? `${remoteOrigin}${config.path ?? '/_next/image'}`\n : (config.path ?? `${remoteOrigin}/_next/image`);\n const url = `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${q}`;\n return resolveClientUrl?.(url) ?? url;\n },\n // Signals to getImgProps that this is a default loader (not a user-defined\n // one), enabling srcSet generation with device/image sizes from the config.\n { __next_img_default: true as const },\n );\n return loader;\n}\n","import type { LinkProps } from 'next/link';\nimport {\n REMOTE_NAVIGATE_EVENT,\n type RemoteNavigateDetail,\n} from '#internal/host/shared/navigate-event';\nimport { createRemoteImageLoader } from '#internal/host/shared/remote-image-loader';\nimport { getNamespace } from '#internal/runtime/namespace';\nimport type { InternalResolveClientUrl } from '#internal/runtime/url/resolve-client-url';\nimport { logWarn } from '#internal/utils/logger';\n\nfunction dispatchRemoteNavigate(detail: RemoteNavigateDetail) {\n window.dispatchEvent(\n new CustomEvent<RemoteNavigateDetail>(REMOTE_NAVIGATE_EVENT, { detail }),\n );\n}\n\n// polyfill Next.js App Router client API (minimal)\n// implementations are minimal and do not cover all use cases\n// developer can override these shared modules from configuration\nexport function sharedPolyfills(\n shared?: Record<string, () => Promise<unknown>>,\n resolveClientUrl?: InternalResolveClientUrl,\n) {\n const hostShared = getNamespace().hostSharedModules;\n const polyfill = {\n 'next/dist/client/components/navigation':\n hostShared['next/navigation'] ??\n shared?.['next/navigation'] ??\n (() =>\n Promise.resolve({\n useRouter() {\n return {\n push: (routerUrl: string) => {\n history.pushState({}, '', routerUrl);\n dispatchRemoteNavigate({ url: routerUrl, type: 'push' });\n },\n replace: (routerUrl: string) => {\n history.replaceState({}, '', routerUrl);\n dispatchRemoteNavigate({ url: routerUrl, type: 'replace' });\n },\n back: () => {\n history.back();\n },\n };\n },\n usePathname() {\n return location.pathname;\n },\n useParams() {\n return {};\n },\n useSearchParams() {\n return new URLSearchParams(location.search);\n },\n useSelectedLayoutSegment() {\n return null;\n },\n useSelectedLayoutSegments() {\n return [];\n },\n __esModule: true,\n })),\n 'next/dist/client/app-dir/link':\n hostShared['next/link'] ??\n shared?.['next/link'] ??\n (() =>\n Promise.resolve({\n default: ({\n scroll: _,\n replace,\n prefetch,\n onNavigate,\n children,\n ...props\n }: React.PropsWithChildren<LinkProps>) => {\n if (prefetch) {\n logWarn(\n 'Polyfill',\n 'Next.js Link prefetch is not supported in remote components',\n );\n }\n return (\n <a\n {...props}\n href={props.href as string}\n onClick={(e) => {\n e.preventDefault();\n let preventDefaulted = false;\n e.preventDefault = () => {\n preventDefaulted = true;\n e.defaultPrevented = true;\n };\n if (typeof props.onClick === 'function') {\n props.onClick(e);\n }\n onNavigate?.(e);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (preventDefaulted) {\n return;\n }\n if (replace) {\n history.replaceState({}, '', props.href as string);\n } else {\n history.pushState({}, '', props.href as string);\n }\n dispatchRemoteNavigate({\n url: props.href as string,\n type: replace ? 'replace' : 'push',\n });\n }}\n suppressHydrationWarning\n >\n {children ?? null}\n </a>\n );\n },\n useLinkStatus() {\n return { pending: false };\n },\n __esModule: true,\n })),\n 'next/dist/client/app-dir/form':\n hostShared['next/form'] ??\n shared?.['next/form'] ??\n (() =>\n Promise.resolve({\n default: () => {\n // TODO: implement <Form> component for non-Next.js host applications\n throw new Error('Next.js <Form> component not implemented');\n },\n __esModule: true,\n })),\n // Instead of replacing next/image entirely, we let the real Next.js Image\n // component load from the remote bundle and only replace its default loader.\n // This gives us full next/image fidelity (fill, priority, srcSet, blur\n // placeholders, error handling) while routing image optimization through the\n // remote app's /_next/image endpoint.\n 'next/dist/shared/lib/image-loader':\n hostShared['next/dist/shared/lib/image-loader'] ??\n shared?.['next/dist/shared/lib/image-loader'] ??\n ((bundle: string) =>\n Promise.resolve({\n default: createRemoteImageLoader(bundle, resolveClientUrl),\n __esModule: true,\n })),\n 'next/dist/client/script':\n hostShared['next/script'] ??\n shared?.['next/script'] ??\n (() =>\n Promise.resolve({\n // TODO: implement <Script> component for non-Next.js host applications\n // do not throw an error for now\n default: () => null,\n __esModule: true,\n })),\n 'next/router':\n hostShared['next/router'] ??\n shared?.['next/router'] ??\n (() =>\n // TODO: incomplete implementation\n Promise.resolve({\n useRouter() {\n return {\n push: (routerUrl: string) => {\n history.pushState({}, '', routerUrl);\n dispatchRemoteNavigate({ url: routerUrl, type: 'push' });\n },\n replace: (routerUrl: string) => {\n history.replaceState({}, '', routerUrl);\n dispatchRemoteNavigate({ url: routerUrl, type: 'replace' });\n },\n back: () => {\n history.back();\n },\n };\n },\n __esModule: true,\n })),\n 'next/dist/build/polyfills/process': () =>\n Promise.resolve({\n default: {\n env: {\n NODE_ENV: 'production',\n },\n },\n __esModule: true,\n }),\n } as Record<string, () => Promise<unknown>>;\n\n polyfill['next/navigation'] = polyfill[\n 'next/dist/client/components/navigation'\n ] as () => Promise<unknown>;\n polyfill['next/link'] = polyfill[\n 'next/dist/client/app-dir/link'\n ] as () => Promise<unknown>;\n polyfill['next/form'] = polyfill[\n 'next/dist/client/app-dir/form'\n ] as () => Promise<unknown>;\n polyfill['next/dist/esm/shared/lib/image-loader'] = polyfill[\n 'next/dist/shared/lib/image-loader'\n ] as () => Promise<unknown>;\n polyfill['next/script'] = polyfill[\n 'next/dist/client/script'\n ] as () => Promise<unknown>;\n\n return polyfill;\n}\n","import type { InternalResolveClientUrl } from '#internal/host/server/types';\nimport { sharedPolyfills } from '#internal/host/shared/polyfill';\nimport type { LogLocation } from '#internal/utils/logger';\nimport { logDebug } from '#internal/utils/logger';\n\n/**\n * The core React packages that are always shared between host and remote.\n * These correspond to the `/react/*.js` and `/react-dom/*.js` path keys\n * used in the webpack module resolution map.\n */\nexport const CORE_REACT_SHARED_KEYS = [\n 'react',\n 'react/jsx-dev-runtime',\n 'react/jsx-runtime',\n 'react-dom',\n 'react-dom/client',\n] as const;\n\n/**\n * Maps each core React package to its webpack-style path key.\n * For example, `react` maps to `/react/index.js`.\n */\nexport const CORE_REACT_PATH_MAP: Record<string, string> = {\n react: '/react/index.js',\n 'react/jsx-dev-runtime': '/react/jsx-dev-runtime.js',\n 'react/jsx-runtime': '/react/jsx-runtime.js',\n 'react-dom': '/react-dom/index.js',\n 'react-dom/client': '/react-dom/client.js',\n};\n\n/**\n * The vendorShared record used by the Next.js config to map React packages\n * to their webpack path-key string literals. Derived from CORE_REACT_PATH_MAP\n * but excludes `react-dom/client` to match the existing config behavior.\n */\nexport const VENDOR_SHARED: Record<string, string> = Object.fromEntries(\n Object.entries(CORE_REACT_PATH_MAP)\n .filter(([key]) => key !== 'react-dom/client')\n .map(([key, path]) => [key, `'${path}'`]),\n);\n\ntype SharedModuleFactory = (bundle?: string) => Promise<unknown>;\n\n/**\n * Builds the `coreShared` map for the Turbopack runtime's\n * `initializeSharedModules`. Each entry is an async factory that dynamically\n * imports the corresponding React package. User-provided shared modules\n * override core entries (e.g. to supply a pinned React version).\n */\nexport function buildCoreShared(\n userShared?: Record<string, SharedModuleFactory>,\n): Record<string, SharedModuleFactory> {\n return {\n react: async () => (await import('react')).default,\n 'react-dom': async () => (await import('react-dom')).default,\n 'react/jsx-dev-runtime': async () =>\n (await import('react/jsx-dev-runtime')).default,\n 'react/jsx-runtime': async () =>\n (await import('react/jsx-runtime')).default,\n 'react-dom/client': async () => (await import('react-dom/client')).default,\n ...userShared,\n };\n}\n\ninterface HostSharedGlobals {\n __remote_component_host_shared_modules__?: Record<\n string,\n SharedModuleFactory\n >;\n __remote_component_shared__?: Record<string, SharedModuleFactory>;\n}\n\n/**\n * Builds the merged host shared modules map with a consistent merge priority:\n * 1. Polyfills (lowest priority — fallback implementations)\n * 2. Global host shared modules (`__remote_component_host_shared_modules__`)\n * 3. User-provided shared modules (highest priority — explicit overrides)\n *\n * Some callers also include `__remote_component_shared__` (the pages router\n * global). Pass `includeRemoteComponentShared: true` to include it at the end.\n */\nexport function buildHostShared(\n userShared?: Record<string, SharedModuleFactory>,\n resolveClientUrl?: InternalResolveClientUrl,\n options?: { includeRemoteComponentShared?: boolean },\n): Record<string, SharedModuleFactory> {\n const self = globalThis as typeof globalThis & HostSharedGlobals;\n const result: Record<string, SharedModuleFactory> = {\n ...sharedPolyfills(userShared, resolveClientUrl),\n ...self.__remote_component_host_shared_modules__,\n ...userShared,\n };\n if (options?.includeRemoteComponentShared) {\n Object.assign(result, self.__remote_component_shared__);\n }\n return result;\n}\n\n/**\n * React module instances keyed by their webpack path, e.g.\n * `{ '/react/index.js': React }`. Passed into `buildWebpackResolve` so it\n * can populate the resolve map without importing React itself.\n */\nexport interface ReactModules {\n '/react/index.js': unknown;\n '/react/jsx-dev-runtime.js': unknown;\n '/react/jsx-runtime.js': unknown;\n '/react-dom/index.js': unknown;\n '/react-dom/client.js': unknown;\n}\n\n/**\n * Builds the `resolve` map passed to `applySharedModules` for the webpack\n * runtime. Combines:\n * - Static React module path keys (`/react/index.js`, etc.)\n * - Remote shared modules matched against host shared, with `(ssr)/` prefix stripped\n *\n * After building the map, resolves any factory functions by awaiting them\n * with the given bundle name.\n */\nexport async function buildWebpackResolve(\n hostShared: Record<string, SharedModuleFactory | unknown>,\n remoteShared: Record<string, string | number>,\n bundle: string,\n reactModules: ReactModules,\n callerTag: LogLocation = 'SharedModuleResolver',\n): Promise<Record<string, unknown>> {\n const resolve: Record<string, unknown> = {\n ...reactModules,\n ...Object.entries(remoteShared).reduce<Record<string, unknown>>(\n (acc, [key, value]) => {\n if (typeof hostShared[value] !== 'undefined') {\n acc[key.replace(/^\\(ssr\\)\\/(?<relative>\\.\\/)?/, '')] =\n hostShared[value];\n } else {\n logDebug(\n callerTag,\n `Remote requests \"${value}\" but host doesn't provide it`,\n );\n }\n return acc;\n },\n {},\n ),\n };\n await Promise.all(\n Object.entries(resolve).map(async ([key, value]) => {\n if (typeof value === 'function') {\n resolve[key] = await value(bundle);\n }\n return Promise.resolve(value);\n }),\n );\n return resolve;\n}\n"]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getNamespace
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D5GNZB6O.js";
|
|
4
|
+
import {
|
|
5
|
+
REMOTE_NAVIGATE_EVENT
|
|
6
|
+
} from "./chunk-STIJO4AG.js";
|
|
4
7
|
import {
|
|
5
8
|
logDebug,
|
|
6
9
|
logWarn
|
|
@@ -121,6 +124,11 @@ function createRemoteImageLoader(bundle, resolveClientUrl) {
|
|
|
121
124
|
|
|
122
125
|
// src/host/shared/polyfill.tsx
|
|
123
126
|
import { jsx } from "react/jsx-runtime";
|
|
127
|
+
function dispatchRemoteNavigate(detail) {
|
|
128
|
+
window.dispatchEvent(
|
|
129
|
+
new CustomEvent(REMOTE_NAVIGATE_EVENT, { detail })
|
|
130
|
+
);
|
|
131
|
+
}
|
|
124
132
|
function sharedPolyfills(shared, resolveClientUrl) {
|
|
125
133
|
const hostShared = getNamespace().hostSharedModules;
|
|
126
134
|
const polyfill = {
|
|
@@ -129,9 +137,11 @@ function sharedPolyfills(shared, resolveClientUrl) {
|
|
|
129
137
|
return {
|
|
130
138
|
push: (routerUrl) => {
|
|
131
139
|
history.pushState({}, "", routerUrl);
|
|
140
|
+
dispatchRemoteNavigate({ url: routerUrl, type: "push" });
|
|
132
141
|
},
|
|
133
142
|
replace: (routerUrl) => {
|
|
134
143
|
history.replaceState({}, "", routerUrl);
|
|
144
|
+
dispatchRemoteNavigate({ url: routerUrl, type: "replace" });
|
|
135
145
|
},
|
|
136
146
|
back: () => {
|
|
137
147
|
history.back();
|
|
@@ -194,6 +204,10 @@ function sharedPolyfills(shared, resolveClientUrl) {
|
|
|
194
204
|
} else {
|
|
195
205
|
history.pushState({}, "", props.href);
|
|
196
206
|
}
|
|
207
|
+
dispatchRemoteNavigate({
|
|
208
|
+
url: props.href,
|
|
209
|
+
type: replace ? "replace" : "push"
|
|
210
|
+
});
|
|
197
211
|
},
|
|
198
212
|
suppressHydrationWarning: true,
|
|
199
213
|
children: children ?? null
|
|
@@ -233,9 +247,11 @@ function sharedPolyfills(shared, resolveClientUrl) {
|
|
|
233
247
|
return {
|
|
234
248
|
push: (routerUrl) => {
|
|
235
249
|
history.pushState({}, "", routerUrl);
|
|
250
|
+
dispatchRemoteNavigate({ url: routerUrl, type: "push" });
|
|
236
251
|
},
|
|
237
252
|
replace: (routerUrl) => {
|
|
238
253
|
history.replaceState({}, "", routerUrl);
|
|
254
|
+
dispatchRemoteNavigate({ url: routerUrl, type: "replace" });
|
|
239
255
|
},
|
|
240
256
|
back: () => {
|
|
241
257
|
history.back();
|
|
@@ -355,4 +371,4 @@ export {
|
|
|
355
371
|
buildHostShared,
|
|
356
372
|
buildWebpackResolve
|
|
357
373
|
};
|
|
358
|
-
//# sourceMappingURL=chunk-
|
|
374
|
+
//# sourceMappingURL=chunk-SAGYPGIQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/index.ts","../src/runtime/constants.ts","../src/runtime/patterns.ts","../src/runtime/turbopack/remote-scope.ts","../src/host/shared/remote-image-loader.ts","../src/host/shared/polyfill.tsx","../src/host/shared/shared-module-resolver.ts"],"sourcesContent":["export function escapeString(str: string) {\n return str.replace(/[^a-z0-9]/g, '_');\n}\n\n/**\n * Computes the origin-qualified scoped name for a bundle by appending\n * the escaped host (hostname + port). This ensures the server and client\n * always agree on the scoped name — the server's cross-origin detection\n * (based on deployment URL) can differ from the client's (based on\n * `location.origin`), so the name must not depend on that distinction.\n *\n * Used on both the server (to rewrite RSC flight data) and the client\n * (to create and look up RemoteScopes). Both sides must produce the\n * same value for a given remote.\n */\nexport function computeScopedName(\n name: string,\n options: { remoteHost: string },\n): string {\n return `${name}_${escapeString(options.remoteHost.toLowerCase())}`;\n}\n\nexport const attrToProp = {\n fetchpriority: 'fetchPriority',\n crossorigin: 'crossOrigin',\n imagesrcset: 'imageSrcSet',\n imagesizes: 'imageSizes',\n srcset: 'srcSet',\n} as Record<string, string>;\n","import { escapeString } from '#internal/utils';\n\nexport const DEFAULT_BUNDLE_NAME = '__vercel_remote_bundle';\nexport const DEFAULT_COMPONENT_NAME = '__vercel_remote_component';\nexport const DEFAULT_ROUTE = '/';\n\nexport const RUNTIME_WEBPACK = 'webpack';\nexport const RUNTIME_TURBOPACK = 'turbopack';\nexport const RUNTIME_SCRIPT = 'script';\n\nexport function getBundleKey(bundle: string): string {\n return escapeString(bundle);\n}\n\nexport type Runtime =\n | typeof RUNTIME_WEBPACK\n | typeof RUNTIME_TURBOPACK\n | typeof RUNTIME_SCRIPT;\n","export const REMOTE_COMPONENT_REGEX =\n /(?<prefix>.*?)\\[(?<bundle>[^\\]]+)\\](?:%20| )(?<id>.+)/;\n\n// Matches Next.js bundle-prefixed paths like /_next/[bundle-name] /static/...\n// Used to strip the bundle identifier before loading scripts via the standard /_next/ path.\nexport const NEXT_BUNDLE_PATH_RE = /\\/_next\\/\\[.+\\](?:%20| )/;\n\n/** Collapse duplicate path separators (`//`) while preserving protocol (`://`). */\nconst DOUBLE_SLASH_RE = /(?<!:)\\/\\//g;\nexport function collapseDoubleSlashes(path: string): string {\n return path.replace(DOUBLE_SLASH_RE, '/');\n}\n","import type { InternalResolveClientUrl } from '#internal/host/server/types';\nimport { getBundleKey, type Runtime } from '#internal/runtime/constants';\nimport { getNamespace } from '#internal/runtime/namespace';\nimport { REMOTE_COMPONENT_REGEX } from '#internal/runtime/patterns';\nimport { computeScopedName } from '#internal/utils';\nimport { logDebug, logWarn } from '#internal/utils/logger';\n\n/**\n * Encapsulates all per-remote state so that two remotes sharing the same\n * bundle name but served from different origins never collide.\n *\n * A scope is created once per `setupRemoteScope` call and threaded\n * directly through internal code paths (chunk loading, module resolution,\n * shared modules). Global dispatchers (`__webpack_require__`,\n * `__webpack_chunk_load__`) only exist for external callers (RSC runtime)\n * and resolve the correct scope via the registry.\n */\nexport interface RemoteScope {\n /** Plain bundle name (e.g. \"remote-component-registry\") */\n name: string;\n /** Origin-qualified key — unique even when two remotes share a name */\n scopedName: string;\n /** Escaped key used as suffix for TURBOPACK_ globals */\n globalKey: string;\n /** Base URL for resolving relative chunk paths */\n url: URL;\n /** Bundler runtime type */\n runtime: Runtime;\n /** Proxy callback for routing chunks through the host */\n resolveClientUrl?: InternalResolveClientUrl;\n /** Per-scope cache of executed Turbopack module exports */\n moduleCache: Record<string, unknown>;\n /** Per-scope shared modules provided by the host (React, etc.) */\n sharedModules: Record<string, unknown>;\n /** Per-scope globalThis substitute passed to module initializers as `g` */\n moduleGlobal: Record<string, unknown>;\n /**\n * Webpack's bundle-scoped require function, populated from\n * `__remote_webpack_require__[bundleName]` for webpack remotes.\n * Undefined for turbopack remotes.\n */\n webpackRequire?: ((id: string | number) => unknown) & {\n m?: Record<string | number, (module: { exports: unknown }) => void>;\n type?: string;\n };\n /**\n * Flat array of captured turbopack module entries: [scriptEl, id, factory, ...].\n * Populated by the push interceptor in handleTurbopackChunk. This is the\n * primary source of truth for getTurbopackModules — immune to the turbopack\n * runtime replacing the TURBOPACK global (canary builds use a deferred-loading\n * pattern that swaps the array for an immediate-processing dispatcher).\n */\n turbopackModules: unknown[];\n}\n\nfunction getRegistry(): Map<string, RemoteScope> {\n return getNamespace().scopes;\n}\n\nexport function createScope(\n name: string,\n url: URL,\n runtime: Runtime,\n resolveClientUrl?: InternalResolveClientUrl,\n): RemoteScope {\n const scopedName = computeScopedName(name, { remoteHost: url.host });\n const globalKey = getBundleKey(scopedName);\n return {\n name,\n scopedName,\n globalKey,\n url,\n runtime,\n resolveClientUrl,\n moduleCache: {},\n sharedModules: {},\n moduleGlobal: {},\n turbopackModules: [],\n };\n}\n\nexport function registerScope(scope: RemoteScope): void {\n const registry = getRegistry();\n registry.set(scope.scopedName, scope);\n\n // Also register under the plain name so static/HTML hosts (which don't\n // rewrite RSC chunk IDs) can look up scopes by the unrewritten bundle name.\n if (scope.scopedName !== scope.name) {\n const existing = registry.get(scope.name);\n if (existing && existing.scopedName !== scope.scopedName) {\n logWarn(\n 'RemoteScope',\n `Plain name \"${scope.name}\" already registered by scope \"${existing.scopedName}\" — ` +\n `overwriting with \"${scope.scopedName}\". Static hosts will only resolve the latest one.`,\n );\n }\n registry.set(scope.name, scope);\n }\n\n logDebug(\n 'RemoteScope',\n `Registered scope \"${scope.scopedName}\" (${registry.size} total)`,\n );\n}\n\n/**\n * Resolves a scope by name. Accepts either the scoped name (used by Next.js\n * hosts that rewrite RSC data server-side) or the plain bundle name (used by\n * static/HTML hosts where chunks arrive unrewritten).\n */\nexport function getScope(name: string): RemoteScope | undefined {\n return getRegistry().get(name);\n}\n\n/** Formats a `[scopedName] path` string for use in chunk/module IDs. */\nexport function formatRemoteId(scope: RemoteScope, path: string): string {\n return `[${scope.scopedName}] ${path}`;\n}\n\n/**\n * Parses the `[bundle] path` format used in chunk/module IDs.\n * Uses REMOTE_COMPONENT_REGEX (the same pattern used by the module dispatcher\n * and script loader) so the two parsing paths can never diverge.\n */\nexport function parseRemoteId(id: string): {\n bundle: string;\n path: string;\n prefix: string;\n} {\n const groups = REMOTE_COMPONENT_REGEX.exec(id)?.groups;\n if (groups?.bundle && groups.id) {\n return {\n bundle: groups.bundle,\n path: groups.id,\n prefix: groups.prefix ?? '',\n };\n }\n return { bundle: 'default', path: id, prefix: '' };\n}\n","import { getScope } from '#internal/runtime/turbopack/remote-scope';\nimport type { InternalResolveClientUrl } from '#internal/runtime/url/resolve-client-url';\n\n/**\n * Replacement for `next/dist/shared/lib/image-loader`.\n *\n * Uses `config.path` (which includes the remote's asset prefix, e.g.\n * `/vc-ap-xxx/_next/image`) to generate URLs that match the server-rendered\n * HTML and avoid hydration mismatches. Under the microfrontends proxy these\n * relative paths are routed to the correct app.\n *\n * For cross-origin deployments (standalone host on a different domain),\n * `config.path` is a relative path that would incorrectly resolve to the host\n * origin, so we prefix it with the remote origin to produce an absolute URL\n * pointing at the remote's optimizer.\n *\n * When `resolveClientUrl` is provided (deployment protection), the final URL\n * is routed through the host's proxy.\n */\nexport function createRemoteImageLoader(\n bundle: string,\n resolveClientUrl?: InternalResolveClientUrl,\n) {\n const loader = Object.assign(\n ({\n config,\n src,\n width,\n quality,\n }: {\n config: { path?: string };\n src: string;\n width: number;\n quality?: number;\n }) => {\n const q = quality ?? 75;\n const remoteOrigin = getScope(bundle)?.url.origin ?? '';\n const isCrossOrigin = remoteOrigin && remoteOrigin !== location.origin;\n const basePath = isCrossOrigin\n ? `${remoteOrigin}${config.path ?? '/_next/image'}`\n : (config.path ?? `${remoteOrigin}/_next/image`);\n const url = `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${q}`;\n return resolveClientUrl?.(url) ?? url;\n },\n // Signals to getImgProps that this is a default loader (not a user-defined\n // one), enabling srcSet generation with device/image sizes from the config.\n { __next_img_default: true as const },\n );\n return loader;\n}\n","import type { LinkProps } from 'next/link';\nimport {\n REMOTE_NAVIGATE_EVENT,\n type RemoteNavigateDetail,\n} from '#internal/host/shared/navigate-event';\nimport { createRemoteImageLoader } from '#internal/host/shared/remote-image-loader';\nimport { getNamespace } from '#internal/runtime/namespace';\nimport type { InternalResolveClientUrl } from '#internal/runtime/url/resolve-client-url';\nimport { logWarn } from '#internal/utils/logger';\n\nfunction dispatchRemoteNavigate(detail: RemoteNavigateDetail) {\n window.dispatchEvent(\n new CustomEvent<RemoteNavigateDetail>(REMOTE_NAVIGATE_EVENT, { detail }),\n );\n}\n\n// polyfill Next.js App Router client API (minimal)\n// implementations are minimal and do not cover all use cases\n// developer can override these shared modules from configuration\nexport function sharedPolyfills(\n shared?: Record<string, () => Promise<unknown>>,\n resolveClientUrl?: InternalResolveClientUrl,\n) {\n const hostShared = getNamespace().hostSharedModules;\n const polyfill = {\n 'next/dist/client/components/navigation':\n hostShared['next/navigation'] ??\n shared?.['next/navigation'] ??\n (() =>\n Promise.resolve({\n useRouter() {\n return {\n push: (routerUrl: string) => {\n history.pushState({}, '', routerUrl);\n dispatchRemoteNavigate({ url: routerUrl, type: 'push' });\n },\n replace: (routerUrl: string) => {\n history.replaceState({}, '', routerUrl);\n dispatchRemoteNavigate({ url: routerUrl, type: 'replace' });\n },\n back: () => {\n history.back();\n },\n };\n },\n usePathname() {\n return location.pathname;\n },\n useParams() {\n return {};\n },\n useSearchParams() {\n return new URLSearchParams(location.search);\n },\n useSelectedLayoutSegment() {\n return null;\n },\n useSelectedLayoutSegments() {\n return [];\n },\n __esModule: true,\n })),\n 'next/dist/client/app-dir/link':\n hostShared['next/link'] ??\n shared?.['next/link'] ??\n (() =>\n Promise.resolve({\n default: ({\n scroll: _,\n replace,\n prefetch,\n onNavigate,\n children,\n ...props\n }: React.PropsWithChildren<LinkProps>) => {\n if (prefetch) {\n logWarn(\n 'Polyfill',\n 'Next.js Link prefetch is not supported in remote components',\n );\n }\n return (\n <a\n {...props}\n href={props.href as string}\n onClick={(e) => {\n e.preventDefault();\n let preventDefaulted = false;\n e.preventDefault = () => {\n preventDefaulted = true;\n e.defaultPrevented = true;\n };\n if (typeof props.onClick === 'function') {\n props.onClick(e);\n }\n onNavigate?.(e);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (preventDefaulted) {\n return;\n }\n if (replace) {\n history.replaceState({}, '', props.href as string);\n } else {\n history.pushState({}, '', props.href as string);\n }\n dispatchRemoteNavigate({\n url: props.href as string,\n type: replace ? 'replace' : 'push',\n });\n }}\n suppressHydrationWarning\n >\n {children ?? null}\n </a>\n );\n },\n useLinkStatus() {\n return { pending: false };\n },\n __esModule: true,\n })),\n 'next/dist/client/app-dir/form':\n hostShared['next/form'] ??\n shared?.['next/form'] ??\n (() =>\n Promise.resolve({\n default: () => {\n // TODO: implement <Form> component for non-Next.js host applications\n throw new Error('Next.js <Form> component not implemented');\n },\n __esModule: true,\n })),\n // Instead of replacing next/image entirely, we let the real Next.js Image\n // component load from the remote bundle and only replace its default loader.\n // This gives us full next/image fidelity (fill, priority, srcSet, blur\n // placeholders, error handling) while routing image optimization through the\n // remote app's /_next/image endpoint.\n 'next/dist/shared/lib/image-loader':\n hostShared['next/dist/shared/lib/image-loader'] ??\n shared?.['next/dist/shared/lib/image-loader'] ??\n ((bundle: string) =>\n Promise.resolve({\n default: createRemoteImageLoader(bundle, resolveClientUrl),\n __esModule: true,\n })),\n 'next/dist/client/script':\n hostShared['next/script'] ??\n shared?.['next/script'] ??\n (() =>\n Promise.resolve({\n // TODO: implement <Script> component for non-Next.js host applications\n // do not throw an error for now\n default: () => null,\n __esModule: true,\n })),\n 'next/router':\n hostShared['next/router'] ??\n shared?.['next/router'] ??\n (() =>\n // TODO: incomplete implementation\n Promise.resolve({\n useRouter() {\n return {\n push: (routerUrl: string) => {\n history.pushState({}, '', routerUrl);\n dispatchRemoteNavigate({ url: routerUrl, type: 'push' });\n },\n replace: (routerUrl: string) => {\n history.replaceState({}, '', routerUrl);\n dispatchRemoteNavigate({ url: routerUrl, type: 'replace' });\n },\n back: () => {\n history.back();\n },\n };\n },\n __esModule: true,\n })),\n 'next/dist/build/polyfills/process': () =>\n Promise.resolve({\n default: {\n env: {\n NODE_ENV: 'production',\n },\n },\n __esModule: true,\n }),\n } as Record<string, () => Promise<unknown>>;\n\n polyfill['next/navigation'] = polyfill[\n 'next/dist/client/components/navigation'\n ] as () => Promise<unknown>;\n polyfill['next/link'] = polyfill[\n 'next/dist/client/app-dir/link'\n ] as () => Promise<unknown>;\n polyfill['next/form'] = polyfill[\n 'next/dist/client/app-dir/form'\n ] as () => Promise<unknown>;\n polyfill['next/dist/esm/shared/lib/image-loader'] = polyfill[\n 'next/dist/shared/lib/image-loader'\n ] as () => Promise<unknown>;\n polyfill['next/script'] = polyfill[\n 'next/dist/client/script'\n ] as () => Promise<unknown>;\n\n return polyfill;\n}\n","import type { InternalResolveClientUrl } from '#internal/host/server/types';\nimport { sharedPolyfills } from '#internal/host/shared/polyfill';\nimport type { LogLocation } from '#internal/utils/logger';\nimport { logDebug } from '#internal/utils/logger';\n\n/**\n * The core React packages that are always shared between host and remote.\n * These correspond to the `/react/*.js` and `/react-dom/*.js` path keys\n * used in the webpack module resolution map.\n */\nexport const CORE_REACT_SHARED_KEYS = [\n 'react',\n 'react/jsx-dev-runtime',\n 'react/jsx-runtime',\n 'react-dom',\n 'react-dom/client',\n] as const;\n\n/**\n * Maps each core React package to its webpack-style path key.\n * For example, `react` maps to `/react/index.js`.\n */\nexport const CORE_REACT_PATH_MAP: Record<string, string> = {\n react: '/react/index.js',\n 'react/jsx-dev-runtime': '/react/jsx-dev-runtime.js',\n 'react/jsx-runtime': '/react/jsx-runtime.js',\n 'react-dom': '/react-dom/index.js',\n 'react-dom/client': '/react-dom/client.js',\n};\n\n/**\n * The vendorShared record used by the Next.js config to map React packages\n * to their webpack path-key string literals. Derived from CORE_REACT_PATH_MAP\n * but excludes `react-dom/client` to match the existing config behavior.\n */\nexport const VENDOR_SHARED: Record<string, string> = Object.fromEntries(\n Object.entries(CORE_REACT_PATH_MAP)\n .filter(([key]) => key !== 'react-dom/client')\n .map(([key, path]) => [key, `'${path}'`]),\n);\n\ntype SharedModuleFactory = (bundle?: string) => Promise<unknown>;\n\n/**\n * Builds the `coreShared` map for the Turbopack runtime's\n * `initializeSharedModules`. Each entry is an async factory that dynamically\n * imports the corresponding React package. User-provided shared modules\n * override core entries (e.g. to supply a pinned React version).\n */\nexport function buildCoreShared(\n userShared?: Record<string, SharedModuleFactory>,\n): Record<string, SharedModuleFactory> {\n return {\n react: async () => (await import('react')).default,\n 'react-dom': async () => (await import('react-dom')).default,\n 'react/jsx-dev-runtime': async () =>\n (await import('react/jsx-dev-runtime')).default,\n 'react/jsx-runtime': async () =>\n (await import('react/jsx-runtime')).default,\n 'react-dom/client': async () => (await import('react-dom/client')).default,\n ...userShared,\n };\n}\n\ninterface HostSharedGlobals {\n __remote_component_host_shared_modules__?: Record<\n string,\n SharedModuleFactory\n >;\n __remote_component_shared__?: Record<string, SharedModuleFactory>;\n}\n\n/**\n * Builds the merged host shared modules map with a consistent merge priority:\n * 1. Polyfills (lowest priority — fallback implementations)\n * 2. Global host shared modules (`__remote_component_host_shared_modules__`)\n * 3. User-provided shared modules (highest priority — explicit overrides)\n *\n * Some callers also include `__remote_component_shared__` (the pages router\n * global). Pass `includeRemoteComponentShared: true` to include it at the end.\n */\nexport function buildHostShared(\n userShared?: Record<string, SharedModuleFactory>,\n resolveClientUrl?: InternalResolveClientUrl,\n options?: { includeRemoteComponentShared?: boolean },\n): Record<string, SharedModuleFactory> {\n const self = globalThis as typeof globalThis & HostSharedGlobals;\n const result: Record<string, SharedModuleFactory> = {\n ...sharedPolyfills(userShared, resolveClientUrl),\n ...self.__remote_component_host_shared_modules__,\n ...userShared,\n };\n if (options?.includeRemoteComponentShared) {\n Object.assign(result, self.__remote_component_shared__);\n }\n return result;\n}\n\n/**\n * React module instances keyed by their webpack path, e.g.\n * `{ '/react/index.js': React }`. Passed into `buildWebpackResolve` so it\n * can populate the resolve map without importing React itself.\n */\nexport interface ReactModules {\n '/react/index.js': unknown;\n '/react/jsx-dev-runtime.js': unknown;\n '/react/jsx-runtime.js': unknown;\n '/react-dom/index.js': unknown;\n '/react-dom/client.js': unknown;\n}\n\n/**\n * Builds the `resolve` map passed to `applySharedModules` for the webpack\n * runtime. Combines:\n * - Static React module path keys (`/react/index.js`, etc.)\n * - Remote shared modules matched against host shared, with `(ssr)/` prefix stripped\n *\n * After building the map, resolves any factory functions by awaiting them\n * with the given bundle name.\n */\nexport async function buildWebpackResolve(\n hostShared: Record<string, SharedModuleFactory | unknown>,\n remoteShared: Record<string, string | number>,\n bundle: string,\n reactModules: ReactModules,\n callerTag: LogLocation = 'SharedModuleResolver',\n): Promise<Record<string, unknown>> {\n const resolve: Record<string, unknown> = {\n ...reactModules,\n ...Object.entries(remoteShared).reduce<Record<string, unknown>>(\n (acc, [key, value]) => {\n if (typeof hostShared[value] !== 'undefined') {\n acc[key.replace(/^\\(ssr\\)\\/(?<relative>\\.\\/)?/, '')] =\n hostShared[value];\n } else {\n logDebug(\n callerTag,\n `Remote requests \"${value}\" but host doesn't provide it`,\n );\n }\n return acc;\n },\n {},\n ),\n };\n await Promise.all(\n Object.entries(resolve).map(async ([key, value]) => {\n if (typeof value === 'function') {\n resolve[key] = await value(bundle);\n }\n return Promise.resolve(value);\n }),\n );\n return resolve;\n}\n"],"mappings":";;;;;;;;;;;;AAAO,SAAS,aAAa,KAAa;AACxC,SAAO,IAAI,QAAQ,cAAc,GAAG;AACtC;AAaO,SAAS,kBACd,MACA,SACQ;AACR,SAAO,GAAG,QAAQ,aAAa,QAAQ,WAAW,YAAY,CAAC;AACjE;AAEO,IAAM,aAAa;AAAA,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G;AAAA,EACL;AACF;AAmBO,SAAS,gBACd,YACA,kBACA,SACqC;AACrC,QAAM,OAAO;AACb,QAAM,SAA8C;AAAA,IAClD,GAAG,gBAAgB,YAAY,gBAAgB;AAAA,IAC/C,GAAG,KAAK;AAAA,IACR,GAAG;AAAA,EACL;AACA,MAAI,SAAS,8BAA8B;AACzC,WAAO,OAAO,QAAQ,KAAK,2BAA2B;AAAA,EACxD;AACA,SAAO;AACT;AAwBA,eAAsB,oBACpB,YACA,cACA,QACA,cACA,YAAyB,wBACS;AAClC,QAAM,UAAmC;AAAA,IACvC,GAAG;AAAA,IACH,GAAG,OAAO,QAAQ,YAAY,EAAE;AAAA,MAC9B,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM;AACrB,YAAI,OAAO,WAAW,KAAK,MAAM,aAAa;AAC5C,cAAI,IAAI,QAAQ,gCAAgC,EAAE,CAAC,IACjD,WAAW,KAAK;AAAA,QACpB,OAAO;AACL;AAAA,YACE;AAAA,YACA,oBAAoB;AAAA,UACtB;AAAA,QACF;AACA,eAAO;AAAA,MACT;AAAA,MACA,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,QAAQ;AAAA,IACZ,OAAO,QAAQ,OAAO,EAAE,IAAI,OAAO,CAAC,KAAK,KAAK,MAAM;AAClD,UAAI,OAAO,UAAU,YAAY;AAC/B,gBAAQ,GAAG,IAAI,MAAM,MAAM,MAAM;AAAA,MACnC;AACA,aAAO,QAAQ,QAAQ,KAAK;AAAA,IAC9B,CAAC;AAAA,EACH;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/host/shared/navigate-event.ts
|
|
2
|
+
var REMOTE_NAVIGATE_EVENT = "remote-components:navigate";
|
|
3
|
+
function parseRemoteNavigateDetail(detail) {
|
|
4
|
+
try {
|
|
5
|
+
const parsed = new URL(detail.url, window.location.origin);
|
|
6
|
+
return {
|
|
7
|
+
url: detail.url,
|
|
8
|
+
pathname: parsed.pathname,
|
|
9
|
+
search: parsed.search,
|
|
10
|
+
hash: parsed.hash,
|
|
11
|
+
type: detail.type
|
|
12
|
+
};
|
|
13
|
+
} catch {
|
|
14
|
+
return {
|
|
15
|
+
url: detail.url,
|
|
16
|
+
pathname: detail.url,
|
|
17
|
+
search: "",
|
|
18
|
+
hash: "",
|
|
19
|
+
type: detail.type
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
REMOTE_NAVIGATE_EVENT,
|
|
26
|
+
parseRemoteNavigateDetail
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=chunk-STIJO4AG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/host/shared/navigate-event.ts"],"sourcesContent":["export const REMOTE_NAVIGATE_EVENT = 'remote-components:navigate';\n\nexport interface RemoteNavigateDetail {\n url: string;\n type: 'push' | 'replace';\n}\n\n/** Parsed navigation request surfaced to `onRemoteNavigate` / `useRemoteNavigate` callbacks. */\nexport interface RemoteNavigateEvent {\n /** Raw value from the remote; may be absolute or relative. */\n url: string;\n pathname: string;\n /** Includes leading `?`, or `''` if none. */\n search: string;\n /** Includes leading `#`, or `''` if none. */\n hash: string;\n /** `'push'` / `'replace'` mirror the remote's history call. */\n type: 'push' | 'replace';\n}\n\n/** Handles both absolute URLs and relative paths; falls back to pathname-only on parse failure. */\nexport function parseRemoteNavigateDetail(\n detail: RemoteNavigateDetail,\n): RemoteNavigateEvent {\n try {\n const parsed = new URL(detail.url, window.location.origin);\n return {\n url: detail.url,\n pathname: parsed.pathname,\n search: parsed.search,\n hash: parsed.hash,\n type: detail.type,\n };\n } catch {\n return {\n url: detail.url,\n pathname: detail.url,\n search: '',\n hash: '',\n type: detail.type,\n };\n }\n}\n"],"mappings":";AAAO,IAAM,wBAAwB;AAqB9B,SAAS,0BACd,QACqB;AACrB,MAAI;AACF,UAAM,SAAS,IAAI,IAAI,OAAO,KAAK,OAAO,SAAS,MAAM;AACzD,WAAO;AAAA,MACL,KAAK,OAAO;AAAA,MACZ,UAAU,OAAO;AAAA,MACjB,QAAQ,OAAO;AAAA,MACf,MAAM,OAAO;AAAA,MACb,MAAM,OAAO;AAAA,IACf;AAAA,EACF,QAAE;AACA,WAAO;AAAA,MACL,KAAK,OAAO;AAAA,MACZ,UAAU,OAAO;AAAA,MACjB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,MAAM,OAAO;AAAA,IACf;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZ2SLBFQLcjs = require('./chunk-Z2SLBFQL.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -49,7 +49,7 @@ async function importViaCallback(absoluteSrc, resolveClientUrl) {
|
|
|
49
49
|
URL.revokeObjectURL(moduleBlobUrl);
|
|
50
50
|
URL.revokeObjectURL(wrapperBlobUrl);
|
|
51
51
|
}
|
|
52
|
-
const registry =
|
|
52
|
+
const registry = _chunkZ2SLBFQLcjs.getNamespace.call(void 0, ).moduleRegistry;
|
|
53
53
|
const mod = _nullishCoalesce(registry[absoluteSrc], () => ( {}));
|
|
54
54
|
delete registry[absoluteSrc];
|
|
55
55
|
return mod;
|
|
@@ -81,7 +81,7 @@ function resolveScriptSrc(script, url) {
|
|
|
81
81
|
return rawSrc;
|
|
82
82
|
}
|
|
83
83
|
async function loadStaticRemoteComponent(scripts, url, resolveClientUrl) {
|
|
84
|
-
const ns =
|
|
84
|
+
const ns = _chunkZ2SLBFQLcjs.getNamespace.call(void 0, );
|
|
85
85
|
if (ns.mountFns[url.href]) {
|
|
86
86
|
ns.mountFns[url.href] = /* @__PURE__ */ new Set();
|
|
87
87
|
}
|
|
@@ -152,4 +152,4 @@ async function loadStaticRemoteComponent(scripts, url, resolveClientUrl) {
|
|
|
152
152
|
|
|
153
153
|
|
|
154
154
|
exports.loadStaticRemoteComponent = loadStaticRemoteComponent;
|
|
155
|
-
//# sourceMappingURL=chunk-
|
|
155
|
+
//# sourceMappingURL=chunk-TZT7DLO5.cjs.map
|
|
@@ -7,21 +7,24 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkAYC2AWUGcjs = require('./chunk-AYC2AWUG.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkTZT7DLO5cjs = require('./chunk-TZT7DLO5.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
var _chunkN3SQTOSEcjs = require('./chunk-N3SQTOSE.cjs');
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
var _chunkR4QFK5TNcjs = require('./chunk-R4QFK5TN.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkRLI4YTBJcjs = require('./chunk-RLI4YTBJ.cjs');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var _chunkZ2SLBFQLcjs = require('./chunk-Z2SLBFQL.cjs');
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
|
|
@@ -89,7 +92,7 @@ function setAttributesFromProps(el, props) {
|
|
|
89
92
|
function useResolveClientUrl(prop, urlHref) {
|
|
90
93
|
const { resolveClientUrl: contextValue } = _context.useRemoteComponentsContext.call(void 0, );
|
|
91
94
|
const raw = _nullishCoalesce(prop, () => ( contextValue));
|
|
92
|
-
return _react.useMemo.call(void 0, () =>
|
|
95
|
+
return _react.useMemo.call(void 0, () => _chunkAYC2AWUGcjs.bindResolveClientUrl.call(void 0, raw, urlHref), [raw, urlHref]);
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
// src/host/react/hooks/use-shadow-root.ts
|
|
@@ -101,7 +104,7 @@ function useShadowRoot({
|
|
|
101
104
|
}) {
|
|
102
105
|
const shadowRootContainerRef = _react.useRef.call(void 0, null);
|
|
103
106
|
const [shadowRoot, setShadowRoot] = _react.useState.call(void 0, () => {
|
|
104
|
-
const shadowRoots =
|
|
107
|
+
const shadowRoots = _chunkZ2SLBFQLcjs.getNamespace.call(void 0, ).shadowRoots;
|
|
105
108
|
const ssrShadowRoot = typeof document !== "undefined" ? _nullishCoalesce(_nullishCoalesce(_optionalChain([document, 'access', _ => _.querySelector, 'call', _2 => _2(
|
|
106
109
|
`[data-remote-component-id="shadowroot_${keySuffix}"]`
|
|
107
110
|
), 'optionalAccess', _3 => _3.shadowRoot]), () => ( shadowRoots[keySuffix])), () => ( null)) : null;
|
|
@@ -109,7 +112,7 @@ function useShadowRoot({
|
|
|
109
112
|
return ssrShadowRoot;
|
|
110
113
|
});
|
|
111
114
|
_react.useLayoutEffect.call(void 0, () => {
|
|
112
|
-
const shadowRoots =
|
|
115
|
+
const shadowRoots = _chunkZ2SLBFQLcjs.getNamespace.call(void 0, ).shadowRoots;
|
|
113
116
|
if (isolate !== false && typeof document !== "undefined" && (!shadowRoot || !shadowRoot.isConnected)) {
|
|
114
117
|
let shadowRootElement = null;
|
|
115
118
|
const element = document.querySelector(
|
|
@@ -151,7 +154,7 @@ function getRemoteComponentHtml(html) {
|
|
|
151
154
|
return ssrRemoteComponentContainer.innerHTML;
|
|
152
155
|
}
|
|
153
156
|
const remoteComponentContainer = temp.querySelectorAll(
|
|
154
|
-
`div[data-bundle][data-route][data-runtime][id^="${
|
|
157
|
+
`div[data-bundle][data-route][data-runtime][id^="${_chunkRLI4YTBJcjs.DEFAULT_COMPONENT_NAME}"],div[data-bundle][data-route],div#__next,remote-component:not([src])`
|
|
155
158
|
);
|
|
156
159
|
if (remoteComponentContainer.length > 0) {
|
|
157
160
|
return `${Array.from(temp.querySelectorAll("link,script")).map((link) => link.outerHTML).join("")}${Array.from(remoteComponentContainer).map((container) => container.outerHTML).join("")}`;
|
|
@@ -159,6 +162,14 @@ function getRemoteComponentHtml(html) {
|
|
|
159
162
|
return "";
|
|
160
163
|
}
|
|
161
164
|
|
|
165
|
+
// src/host/react/hooks/use-remote-navigate.ts
|
|
166
|
+
|
|
167
|
+
function useRemoteNavigate(callback) {
|
|
168
|
+
const callbackRef = _react.useRef.call(void 0, callback);
|
|
169
|
+
callbackRef.current = callback;
|
|
170
|
+
_react.useEffect.call(void 0, () => _chunkN3SQTOSEcjs.onRemoteNavigate.call(void 0, (event) => callbackRef.current(event)), []);
|
|
171
|
+
}
|
|
172
|
+
|
|
162
173
|
// src/host/react/index.tsx
|
|
163
174
|
var _jsxruntime = require('react/jsx-runtime');
|
|
164
175
|
|
|
@@ -168,7 +179,7 @@ function ConsumeRemoteComponent({
|
|
|
168
179
|
mode = "open",
|
|
169
180
|
reset,
|
|
170
181
|
credentials: credentialsProp,
|
|
171
|
-
name: nameProp =
|
|
182
|
+
name: nameProp = _chunkRLI4YTBJcjs.DEFAULT_COMPONENT_NAME,
|
|
172
183
|
shared: sharedProp,
|
|
173
184
|
children,
|
|
174
185
|
onBeforeLoad,
|
|
@@ -184,22 +195,22 @@ function ConsumeRemoteComponent({
|
|
|
184
195
|
const credentials = _nullishCoalesce(_nullishCoalesce(credentialsProp, () => ( contextCredentials)), () => ( "same-origin"));
|
|
185
196
|
const shared = _nullishCoalesce(_nullishCoalesce(sharedProp, () => ( contextShared)), () => ( {}));
|
|
186
197
|
const emitter = _react.useMemo.call(void 0,
|
|
187
|
-
() =>
|
|
198
|
+
() => _chunkAYC2AWUGcjs.makeReactEmitter.call(void 0, { onBeforeLoad, onLoad, onError, onChange }),
|
|
188
199
|
[onBeforeLoad, onLoad, onError, onChange]
|
|
189
200
|
);
|
|
190
201
|
const name = _react.useMemo.call(void 0,
|
|
191
|
-
() =>
|
|
202
|
+
() => _chunkAYC2AWUGcjs.resolveNameFromSrc.call(void 0, src, nameProp),
|
|
192
203
|
[src, nameProp]
|
|
193
204
|
);
|
|
194
205
|
const [data, setData] = _react.useState.call(void 0,
|
|
195
206
|
null
|
|
196
207
|
);
|
|
197
|
-
const url = _react.useMemo.call(void 0, () =>
|
|
208
|
+
const url = _react.useMemo.call(void 0, () => _chunkAYC2AWUGcjs.getClientOrServerUrl.call(void 0, src, DUMMY_FALLBACK), [src]);
|
|
198
209
|
const resolveClientUrl = useResolveClientUrl(resolveClientUrlProp, url.href);
|
|
199
210
|
const id = url.origin === (typeof location !== "undefined" ? location.origin : DUMMY_FALLBACK) ? url.pathname : url.href;
|
|
200
|
-
const keySuffix = `${
|
|
211
|
+
const keySuffix = `${_chunkRLI4YTBJcjs.escapeString.call(void 0, id)}_${_chunkRLI4YTBJcjs.escapeString.call(void 0,
|
|
201
212
|
_nullishCoalesce(_optionalChain([data, 'optionalAccess', _5 => _5.name]), () => ( name))
|
|
202
|
-
)}_${
|
|
213
|
+
)}_${_chunkRLI4YTBJcjs.escapeString.call(void 0, instanceId)}`;
|
|
203
214
|
const [remoteComponent, setRemoteComponent] = _react.useState.call(void 0, null);
|
|
204
215
|
const { shadowRoot, shadowRootContainerRef } = useShadowRoot({
|
|
205
216
|
isolate,
|
|
@@ -225,13 +236,13 @@ function ConsumeRemoteComponent({
|
|
|
225
236
|
return elements;
|
|
226
237
|
})() : []
|
|
227
238
|
);
|
|
228
|
-
const hostStateRef = _react.useRef.call(void 0,
|
|
239
|
+
const hostStateRef = _react.useRef.call(void 0, _chunkAYC2AWUGcjs.createHostState.call(void 0, ));
|
|
229
240
|
const componentHydrationHtml = _react.useRef.call(void 0, null);
|
|
230
241
|
const prevRemoteComponentContainerRef = _react.useRef.call(void 0, null);
|
|
231
242
|
const unmountRef = _react.useRef.call(void 0, null);
|
|
232
243
|
_react.useLayoutEffect.call(void 0, () => {
|
|
233
244
|
return () => {
|
|
234
|
-
delete
|
|
245
|
+
delete _chunkZ2SLBFQLcjs.getNamespace.call(void 0, ).shadowRoots[keySuffix];
|
|
235
246
|
};
|
|
236
247
|
}, [keySuffix]);
|
|
237
248
|
_react.useLayoutEffect.call(void 0, () => {
|
|
@@ -291,7 +302,7 @@ function ConsumeRemoteComponent({
|
|
|
291
302
|
_nullishCoalesce(_optionalChain([resolveClientUrl, 'optionalCall', _29 => _29(url.href)]), () => ( url.href)),
|
|
292
303
|
location.href
|
|
293
304
|
);
|
|
294
|
-
const res = await
|
|
305
|
+
const res = await _chunkAYC2AWUGcjs.fetchWithHooks.call(void 0, resolvedUrl, fetchInit, {
|
|
295
306
|
onRequest,
|
|
296
307
|
onResponse,
|
|
297
308
|
abortController: hostStateRef.current.abortController
|
|
@@ -310,7 +321,7 @@ function ConsumeRemoteComponent({
|
|
|
310
321
|
const userShared = await shared;
|
|
311
322
|
if (signal.aborted)
|
|
312
323
|
return;
|
|
313
|
-
const prepared =
|
|
324
|
+
const prepared = _chunkAYC2AWUGcjs.preparePipeline.call(void 0, {
|
|
314
325
|
html,
|
|
315
326
|
name,
|
|
316
327
|
url,
|
|
@@ -332,7 +343,7 @@ function ConsumeRemoteComponent({
|
|
|
332
343
|
shadowRoot.innerHTML = "";
|
|
333
344
|
}
|
|
334
345
|
const prevUrl = hostStateRef.current.prevUrl;
|
|
335
|
-
if (prevUrl &&
|
|
346
|
+
if (prevUrl && _chunkZ2SLBFQLcjs.getNamespace.call(void 0, ).unmountFns[prevUrl.href]) {
|
|
336
347
|
const unmountPromises = Promise.all(
|
|
337
348
|
Array.from(_nullishCoalesce(unmountRef.current, () => ( []))).map(
|
|
338
349
|
async (unmount) => unmount(
|
|
@@ -351,7 +362,7 @@ function ConsumeRemoteComponent({
|
|
|
351
362
|
href: new URL(_nullishCoalesce(link.getAttribute("href"), () => ( link.href)), url).href,
|
|
352
363
|
...link.getAttributeNames().reduce((acc, key) => {
|
|
353
364
|
if (key !== "href") {
|
|
354
|
-
acc[_nullishCoalesce(
|
|
365
|
+
acc[_nullishCoalesce(_chunkRLI4YTBJcjs.attrToProp[key], () => ( key))] = _nullishCoalesce(link.getAttribute(key), () => ( ""));
|
|
355
366
|
}
|
|
356
367
|
return acc;
|
|
357
368
|
}, {})
|
|
@@ -413,7 +424,7 @@ function ConsumeRemoteComponent({
|
|
|
413
424
|
});
|
|
414
425
|
self.__next_s = prevNextScripts;
|
|
415
426
|
}
|
|
416
|
-
const rscName = rsc ? `__remote_component_rsc_${
|
|
427
|
+
const rscName = rsc ? `__remote_component_rsc_${_chunkRLI4YTBJcjs.escapeString.call(void 0, id)}_${_chunkRLI4YTBJcjs.escapeString.call(void 0,
|
|
417
428
|
remoteName
|
|
418
429
|
)}` : void 0;
|
|
419
430
|
if (rsc) {
|
|
@@ -449,7 +460,7 @@ function ConsumeRemoteComponent({
|
|
|
449
460
|
shadowRoot.innerHTML = shadowRootHtml;
|
|
450
461
|
htmlRef.current = null;
|
|
451
462
|
setRemoteComponent(null);
|
|
452
|
-
const { mount, unmount } = await
|
|
463
|
+
const { mount, unmount } = await _chunkTZT7DLO5cjs.loadStaticRemoteComponent.call(void 0,
|
|
453
464
|
Array.from(shadowRoot.querySelectorAll("script")),
|
|
454
465
|
url,
|
|
455
466
|
resolveClientUrl
|
|
@@ -471,7 +482,7 @@ function ConsumeRemoteComponent({
|
|
|
471
482
|
)
|
|
472
483
|
);
|
|
473
484
|
htmlRef.current = null;
|
|
474
|
-
const { mount, unmount } = await
|
|
485
|
+
const { mount, unmount } = await _chunkTZT7DLO5cjs.loadStaticRemoteComponent.call(void 0,
|
|
475
486
|
Array.from(component.querySelectorAll("script")),
|
|
476
487
|
url,
|
|
477
488
|
resolveClientUrl
|
|
@@ -486,7 +497,7 @@ function ConsumeRemoteComponent({
|
|
|
486
497
|
}
|
|
487
498
|
hostStateRef.current.stage = "loaded";
|
|
488
499
|
} else {
|
|
489
|
-
const result = await
|
|
500
|
+
const result = await _chunkAYC2AWUGcjs.loadPrepared.call(void 0, {
|
|
490
501
|
prepared,
|
|
491
502
|
url,
|
|
492
503
|
signal,
|
|
@@ -555,8 +566,8 @@ function ConsumeRemoteComponent({
|
|
|
555
566
|
const metadataJson = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "script", { "data-remote-component": true, type: "application/json", children: JSON.stringify({
|
|
556
567
|
name: _optionalChain([data, 'optionalAccess', _33 => _33.name]) || name,
|
|
557
568
|
bundle: _optionalChain([data, 'optionalAccess', _34 => _34.bundle]) || "default",
|
|
558
|
-
route: _optionalChain([data, 'optionalAccess', _35 => _35.route]) ||
|
|
559
|
-
runtime: hostStateRef.current.prevIsRemoteComponent ?
|
|
569
|
+
route: _optionalChain([data, 'optionalAccess', _35 => _35.route]) || _chunkRLI4YTBJcjs.DEFAULT_ROUTE,
|
|
570
|
+
runtime: hostStateRef.current.prevIsRemoteComponent ? _chunkRLI4YTBJcjs.RUNTIME_SCRIPT : _optionalChain([data, 'optionalAccess', _36 => _36.runtime]) || _chunkRLI4YTBJcjs.RUNTIME_WEBPACK
|
|
560
571
|
}) });
|
|
561
572
|
const resetStyle = reset ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { "data-remote-components-reset": "react", children: `:host { all: initial; }` }) : null;
|
|
562
573
|
const linksToRender = _optionalChain([data, 'optionalAccess', _37 => _37.links, 'optionalAccess', _38 => _38.map, 'call', _39 => _39((link) => /* @__PURE__ */ _react.createElement.call(void 0,
|
|
@@ -576,7 +587,7 @@ function ConsumeRemoteComponent({
|
|
|
576
587
|
shadowRoot.innerHTML = componentHydrationHtml.current;
|
|
577
588
|
componentHydrationHtml.current = null;
|
|
578
589
|
if (hostStateRef.current.prevIsRemoteComponent) {
|
|
579
|
-
|
|
590
|
+
_chunkTZT7DLO5cjs.loadStaticRemoteComponent.call(void 0,
|
|
580
591
|
Array.from(shadowRoot.querySelectorAll("script")),
|
|
581
592
|
url,
|
|
582
593
|
resolveClientUrl
|
|
@@ -666,5 +677,6 @@ function ConsumeRemoteComponent({
|
|
|
666
677
|
|
|
667
678
|
|
|
668
679
|
|
|
669
|
-
|
|
670
|
-
|
|
680
|
+
|
|
681
|
+
exports.useRemoteNavigate = useRemoteNavigate; exports.ConsumeRemoteComponent = ConsumeRemoteComponent;
|
|
682
|
+
//# sourceMappingURL=chunk-Y4GMYUJT.cjs.map
|