@absolutejs/absolute 0.20.0-beta.179 → 0.20.0-beta.180
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/CHANGELOG.md +23 -0
- package/changelog.json +45 -0
- package/dist/angular/browser.js +2 -2
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +21 -6
- package/dist/angular/index.js.map +6 -6
- package/dist/angular/server.js +21 -6
- package/dist/angular/server.js.map +6 -6
- package/dist/build.js +5357 -4945
- package/dist/build.js.map +27 -24
- package/dist/cli/build-fntmf42w.js +495 -0
- package/dist/cli/{buildDepVendor-qvsh6dsj.js → buildDepVendor-qnwfct22.js} +5 -3
- package/dist/cli/buildReactServerComponents-fq6mw10d.js +13 -0
- package/dist/cli/{compile-p5yv6ecp.js → compile-54rb8szn.js} +94 -125
- package/dist/cli/config/server.js +10 -5
- package/dist/cli/{dev-2hbcsvkp.js → dev-6s6g5tnk.js} +13 -14
- package/dist/cli/{expoProject-1qtw97js.js → expoProject-acgfaj3f.js} +2 -1
- package/dist/cli/generatedDir-239r7csr.js +9 -0
- package/dist/cli/{index-cksezef8.js → index-0gd30trc.js} +105 -851
- package/dist/cli/index-2wvysvjc.js +40 -0
- package/dist/cli/index-42xjh6gg.js +282 -0
- package/dist/cli/{index-qw98g1p6.js → index-47e8fwha.js} +4 -1
- package/dist/cli/index-65kqn88a.js +8 -0
- package/dist/cli/{index-2bxfhs32.js → index-6f448d7m.js} +0 -26
- package/dist/cli/index-972xxwgj.js +16 -0
- package/dist/cli/index-aqe25w4h.js +39 -0
- package/dist/cli/index-assqancr.js +51 -0
- package/dist/cli/{index-2shf4aya.js → index-c8rcfe5a.js} +4 -6
- package/dist/cli/index-cba1cemz.js +8 -0
- package/dist/cli/{index-3ff5ztt3.js → index-djkrb7pc.js} +1 -7
- package/dist/cli/index-dkfwkpc8.js +138 -0
- package/dist/cli/{index-92g14j47.js → index-dw44xa4x.js} +2 -1
- package/dist/cli/index-evsnq0n2.js +17 -0
- package/dist/cli/index-fxwf3n2v.js +224 -0
- package/dist/cli/{index-zyd80s3h.js → index-js2hksgv.js} +21 -295
- package/dist/cli/{index-bp60baze.js → index-jyap0bhv.js} +1 -1
- package/dist/cli/{index-9dzdbbfc.js → index-kx2d067c.js} +8 -6
- package/dist/cli/index-pb31zan6.js +9 -0
- package/dist/cli/index-sq0478b0.js +281 -0
- package/dist/cli/index-va274tsf.js +7 -0
- package/dist/cli/{index-yd672jyq.js → index-w6xsk8cv.js} +4 -1
- package/dist/cli/index-w79snsxv.js +461 -0
- package/dist/cli/index-x1vvn549.js +835 -0
- package/dist/cli/index-xf9sfr8a.js +243 -0
- package/dist/cli/index-ycqdxy55.js +754 -0
- package/dist/cli/index-z74cqxz0.js +131 -0
- package/dist/cli/index.js +10 -9
- package/dist/cli/{islands-6zgb7501.js → islands-17tfx8jf.js} +6 -17
- package/dist/cli/{ls-0hfx323m.js → ls-0wr74w0b.js} +10 -58
- package/dist/cli/{mobile-93vaawcz.js → mobile-hpqpy61f.js} +11 -8
- package/dist/cli/{prerender-010z771p.js → prerender-w65xp6h8.js} +2 -1
- package/dist/cli/{rewriteImports-z6629aww.js → rewriteImports-np2d2kvc.js} +4 -11
- package/dist/cli/rewriteImportsPlugin-c6hcb3x6.js +12 -0
- package/dist/cli/{start-asxb79rc.js → start-mbn2zgs2.js} +6 -4
- package/dist/cli/staticAnalyzeSpaRoutes-2nev05m1.js +8 -0
- package/dist/cli/staticAnalyzeSpaRoutes-6vgzp0rs.js +8 -0
- package/dist/cli/staticAnalyzeSpaRoutes-f85q9dqk.js +8 -0
- package/dist/cli/staticAnalyzeSpaRoutes-yakmg22g.js +7 -0
- package/dist/cli/{typecheck-m2j4tkdk.js → typecheck-488txsfc.js} +92 -18
- package/dist/cli/vueCompiler-8bzdmf08.js +7 -0
- package/dist/client/chunks/{react-khr6ewhr.js → react-g8r290b8.js} +37 -2
- package/dist/client/chunks/react-g8r290b8.js.map +10 -0
- package/dist/client/chunks/vue-zcpmka32.js +85 -0
- package/dist/client/chunks/vue-zcpmka32.js.map +10 -0
- package/dist/client/index.js +58 -10
- package/dist/client/index.js.map +4 -4
- package/dist/dev/client/handlers/vue.ts +116 -0
- package/dist/index.js +2472 -2058
- package/dist/index.js.map +26 -23
- package/dist/islands/browser.js +2 -2
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +2 -2
- package/dist/islands/index.js.map +3 -3
- package/dist/react/browser.js +2 -2
- package/dist/react/browser.js.map +3 -3
- package/dist/react/index.js +42 -11
- package/dist/react/index.js.map +10 -10
- package/dist/react/server.js +42 -11
- package/dist/react/server.js.map +10 -10
- package/dist/src/angular/ssrRender.d.ts +2 -2
- package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +6 -1
- package/dist/src/build/generateManifest.d.ts +15 -0
- package/dist/src/build/manifestKeys.d.ts +22 -0
- package/dist/src/cli/add/dependencies.d.ts +1 -1
- package/dist/src/cli/scripts/typecheck.d.ts +11 -0
- package/dist/src/client/hydrators/react.d.ts +10 -0
- package/dist/src/client/hydrators/vue.d.ts +13 -0
- package/dist/src/client/islandRuntime.d.ts +1 -1
- package/dist/src/core/islandManifest.d.ts +4 -0
- package/dist/src/core/islandPageContext.d.ts +8 -2
- package/dist/src/core/lookup.d.ts +16 -1
- package/dist/src/dev/importCost/instrument.d.ts +1 -1
- package/dist/src/dev/manifestKeysRefresher.d.ts +6 -0
- package/dist/src/dev/spaRouteRefresh.d.ts +13 -0
- package/dist/src/mobile/androidConformance.d.ts +1 -1
- package/dist/src/react/staticAnalyzeSpaRoutes.d.ts +6 -1
- package/dist/src/svelte/staticAnalyzeSpaRoutes.d.ts +1 -0
- package/dist/src/utils/logger.d.ts +5 -0
- package/dist/src/utils/spaRouteManifest.d.ts +1 -0
- package/dist/src/vue/components/Image.d.ts +4 -4
- package/dist/src/vue/components/StreamSlot.d.ts +1 -1
- package/dist/src/vue/components/SuspenseSlot.d.ts +2 -2
- package/dist/src/vue/staticAnalyzeSpaRoutes.d.ts +4 -0
- package/dist/svelte/browser.js +2 -2
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +25 -9
- package/dist/svelte/index.js.map +8 -8
- package/dist/svelte/server.js +25 -9
- package/dist/svelte/server.js.map +8 -8
- package/dist/types/globals.d.ts +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/island.d.ts +1 -1
- package/dist/types/manifest.d.ts +25 -0
- package/dist/vue/browser.js +2 -2
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +21 -6
- package/dist/vue/index.js.map +6 -6
- package/dist/vue/server.js +21 -6
- package/dist/vue/server.js.map +6 -6
- package/package.json +1 -1
- package/dist/client/chunks/react-khr6ewhr.js.map +0 -10
- package/dist/client/chunks/vue-db6ppn1f.js +0 -32
- package/dist/client/chunks/vue-db6ppn1f.js.map +0 -10
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/core/islandManifest.ts", "../src/core/islands.ts", "../src/core/islandMarkupAttributes.ts", "../src/utils/cspNonceRef.ts", "../src/client/preserveIslandMarkup.ts", "../src/core/islandStylesheet.ts", "../src/react/IslandStyleLink.tsx", "../src/react/Island.browser.tsx", "../src/react/createIsland.browser.tsx", "../src/react/hooks/useIslandStore.ts", "../node_modules/zustand/esm/vanilla.mjs", "../node_modules/zustand/esm/middleware.mjs", "../src/client/islandStore.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { IslandFramework } from '../../types/island';\n\n/** Manifest key the server injects as the islands bootstrap script on any\n * page with island markers. The build records the configured\n * `islands.bootstrap` (whatever its file name) or a generated default under\n * it — see build/islandBootstrap.ts. */\nexport const ISLAND_BOOTSTRAP_MANIFEST_KEY = 'AbsoluteIslandBootstrap';\n\n/** Key a bootstrap file named `bootstrapClient.*` gets naturally, which is\n * all the server used to look for. Still honored for manifests built\n * before the reserved key existed. */\nexport const LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = 'BootstrapClient';\n\nconst toIslandFrameworkSegment = (framework: IslandFramework) =>\n\tframework[0]?.toUpperCase() + framework.slice(1);\n\nconst collectFrameworkIslands = (\n\tmanifest: Record<string, string>,\n\tprefix: string\n) => {\n\tconst entries: Record<string, string> = {};\n\tlet found = false;\n\n\tfor (const [key, value] of Object.entries(manifest)) {\n\t\tif (!key.startsWith(prefix)) continue;\n\n\t\tconst component = key.slice(prefix.length);\n\t\tif (!component) continue;\n\n\t\tentries[component] = value;\n\t\tfound = true;\n\t}\n\n\treturn found ? entries : undefined;\n};\n\nexport const getIslandBootstrapPath = (manifest: Record<string, string>) =>\n\tmanifest[ISLAND_BOOTSTRAP_MANIFEST_KEY] ??\n\tmanifest[LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY];\nexport const getIslandManifestEntries = (manifest: Record<string, string>) => {\n\tconst islands: Partial<Record<IslandFramework, Record<string, string>>> =\n\t\t{};\n\tconst frameworks: IslandFramework[] = ['react', 'svelte', 'vue', 'angular'];\n\n\tfor (const framework of frameworks) {\n\t\tconst prefix = `Island${toIslandFrameworkSegment(framework)}`;\n\t\tconst entries = collectFrameworkIslands(manifest, prefix);\n\t\tif (entries) islands[framework] = entries;\n\t}\n\n\treturn islands;\n};\nexport const getIslandManifestKey = (\n\tframework: IslandFramework,\n\tcomponent: string\n) => `Island${toIslandFrameworkSegment(framework)}${component}`;\n\nconst ISLAND_STYLE_PREFIX = 'IslandStyle';\n\n/** Every island stylesheet in the manifest, by manifest key. */\nexport const getIslandStyleManifestEntries = (\n\tmanifest: Record<string, string>\n) =>\n\tObject.entries(manifest).filter(([key]) =>\n\t\tkey.startsWith(ISLAND_STYLE_PREFIX)\n\t);\n\n/** Manifest key of the stylesheet the island client pass emits for an\n * island (its Svelte/Vue component styles and any CSS it imports). The\n * server links it from every page that renders the island. */\nexport const getIslandStyleManifestKey = (\n\tframework: IslandFramework,\n\tcomponent: string\n) => `${ISLAND_STYLE_PREFIX}${toIslandFrameworkSegment(framework)}${component}`;\n",
|
|
5
|
+
"import type { IslandFramework } from '../../types/island';\n\n/** Manifest key the server injects as the islands bootstrap script on any\n * page with island markers. The build records the configured\n * `islands.bootstrap` (whatever its file name) or a generated default under\n * it — see build/islandBootstrap.ts. */\nexport const ISLAND_BOOTSTRAP_MANIFEST_KEY = 'AbsoluteIslandBootstrap';\n\n/** Key a bootstrap file named `bootstrapClient.*` gets naturally, which is\n * all the server used to look for. Still honored for manifests built\n * before the reserved key existed. */\nexport const LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = 'BootstrapClient';\n\n/** Window event a React page's generated index dispatches once it has\n * created the page's root. The island runtime holds a React page's\n * islands until then (see startIslands in client/islandRuntime.ts). */\nexport const REACT_PAGE_ROOT_EVENT = 'absolute:react-page-root';\n\nconst toIslandFrameworkSegment = (framework: IslandFramework) =>\n\tframework[0]?.toUpperCase() + framework.slice(1);\n\nconst collectFrameworkIslands = (\n\tmanifest: Record<string, string>,\n\tprefix: string\n) => {\n\tconst entries: Record<string, string> = {};\n\tlet found = false;\n\n\tfor (const [key, value] of Object.entries(manifest)) {\n\t\tif (!key.startsWith(prefix)) continue;\n\n\t\tconst component = key.slice(prefix.length);\n\t\tif (!component) continue;\n\n\t\tentries[component] = value;\n\t\tfound = true;\n\t}\n\n\treturn found ? entries : undefined;\n};\n\nexport const getIslandBootstrapPath = (manifest: Record<string, string>) =>\n\tmanifest[ISLAND_BOOTSTRAP_MANIFEST_KEY] ??\n\tmanifest[LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY];\nexport const getIslandManifestEntries = (manifest: Record<string, string>) => {\n\tconst islands: Partial<Record<IslandFramework, Record<string, string>>> =\n\t\t{};\n\tconst frameworks: IslandFramework[] = ['react', 'svelte', 'vue', 'angular'];\n\n\tfor (const framework of frameworks) {\n\t\tconst prefix = `Island${toIslandFrameworkSegment(framework)}`;\n\t\tconst entries = collectFrameworkIslands(manifest, prefix);\n\t\tif (entries) islands[framework] = entries;\n\t}\n\n\treturn islands;\n};\nexport const getIslandManifestKey = (\n\tframework: IslandFramework,\n\tcomponent: string\n) => `Island${toIslandFrameworkSegment(framework)}${component}`;\n\nconst ISLAND_STYLE_PREFIX = 'IslandStyle';\n\n/** Every island stylesheet in the manifest, by manifest key. */\nexport const getIslandStyleManifestEntries = (\n\tmanifest: Record<string, string>\n) =>\n\tObject.entries(manifest).filter(([key]) =>\n\t\tkey.startsWith(ISLAND_STYLE_PREFIX)\n\t);\n\n/** Manifest key of the stylesheet the island client pass emits for an\n * island (its Svelte/Vue component styles and any CSS it imports). The\n * server links it from every page that renders the island. */\nexport const getIslandStyleManifestKey = (\n\tframework: IslandFramework,\n\tcomponent: string\n) => `${ISLAND_STYLE_PREFIX}${toIslandFrameworkSegment(framework)}${component}`;\n",
|
|
6
6
|
"import type {\n\tIslandComponentDefinition,\n\tIslandRegistry,\n\tIslandRegistryInput\n} from '../../types/island';\n\nexport const defineIslandComponent = <Component>(\n\tcomponent: Component,\n\toptions: {\n\t\texport?: string;\n\t\tsource: string;\n\t}\n): IslandComponentDefinition<Component> => ({\n\tcomponent,\n\texport: options.export,\n\tsource: options.source\n});\nexport const defineIslandRegistry = <T extends IslandRegistryInput>(\n\tregistry: IslandRegistry<T>\n) => registry;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nexport const getIslandBuildReference = <Component>(\n\tcomponent: Component | IslandComponentDefinition<Component>\n) => {\n\tif (!isIslandComponentDefinition(component)) return null;\n\n\treturn {\n\t\texport: component.export,\n\t\tsource: component.source\n\t};\n};\nexport const isIslandComponentDefinition = <Component>(\n\tvalue: Component | IslandComponentDefinition<Component>\n): value is IslandComponentDefinition<Component> =>\n\tisRecord(value) &&\n\t'component' in value &&\n\t'source' in value &&\n\ttypeof value.source === 'string';\n\nexport function getIslandComponent<Component>(component: Component): Component;\nexport function getIslandComponent<Component>(\n\tcomponent: IslandComponentDefinition<Component>\n): Component;\nexport function getIslandComponent<Component>(\n\tcomponent: Component | IslandComponentDefinition<Component>\n) {\n\tif (isIslandComponentDefinition(component)) {\n\t\treturn component.component;\n\t}\n\n\treturn component;\n}\nexport const parseIslandProps = (rawProps: string | null) => {\n\tif (!rawProps) return {};\n\n\treturn JSON.parse(rawProps);\n};\nexport const serializeIslandProps = (props: unknown) =>\n\tJSON.stringify(props ?? {});\n\nexport {\n\tgetIslandManifestEntries,\n\tgetIslandManifestKey\n} from './islandManifest';\n",
|
|
7
7
|
"import type { RuntimeIslandRenderProps } from '../../types/island';\nimport { serializeIslandProps } from './islands';\n\ntype IslandMarkerAttributes = {\n\t'data-component': string;\n\t'data-framework': string;\n\t'data-hydrate': string;\n\t'data-island': 'true';\n\t'data-island-id'?: string;\n\t'data-props': string;\n};\n\nexport const getIslandMarkerAttributes = (\n\tprops: RuntimeIslandRenderProps,\n\tislandId?: string\n): IslandMarkerAttributes => ({\n\t'data-component': props.component,\n\t'data-framework': props.framework,\n\t'data-hydrate': props.hydrate ?? 'load',\n\t'data-island': 'true',\n\t...(islandId ? { 'data-island-id': islandId } : {}),\n\t'data-props': serializeIslandProps(props.props)\n});\n\nconst escapeHtmlAttribute = (value: string) =>\n\tvalue\n\t\t.replaceAll('&', '&')\n\t\t.replaceAll('\"', '"')\n\t\t.replaceAll('<', '<')\n\t\t.replaceAll('>', '>');\n\nexport const serializeIslandAttributes = (attributes: Record<string, string>) =>\n\tObject.entries(attributes)\n\t\t.map(([key, value]) => `${key}=\"${escapeHtmlAttribute(value)}\"`)\n\t\t.join(' ');\n",
|
|
8
8
|
"/* Dependency-free access to the current request's CSP nonce, for code that\n * also ships to the browser (streaming slots, Angular components) and so\n * can't import the server's request context. `secureHeaders()` registers\n * the getter (src/core/cspNonce.ts); in the browser, or with secure headers\n * off, there is none and these return undefined / ''. */\n\nconst GETTER_KEY = Symbol.for('absolutejs.cspNonceGetter');\n\n/** ` nonce=\"…\"` for an inline <script>/<style> tag, or '' without one. */\nexport const nonceAttr = (nonce: string | undefined = readCspNonce()) =>\n\tnonce ? ` nonce=\"${nonce}\"` : '';\n\n/** Adds the nonce to the <style id=\"svelte-…\"> tags Svelte renders into the\n * head for components compiled with injected CSS. Only those: a <style>\n * that arrived through {@html} stays without one. */\nexport const nonceSvelteHeadStyles = (\n\thead: string,\n\tnonce: string | undefined = readCspNonce()\n) =>\n\tnonce\n\t\t? head.replace(\n\t\t\t\t/<style(?=\\s+id=\"svelte-[^\"]*\")(?![^>]*\\snonce=)/g,\n\t\t\t\t`<style nonce=\"${nonce}\"`\n\t\t\t)\n\t\t: head;\n\nexport const readCspNonce = () => {\n\tconst getter: unknown = Reflect.get(globalThis, GETTER_KEY);\n\tif (typeof getter !== 'function') return undefined;\n\tconst nonce: unknown = getter();\n\n\treturn typeof nonce === 'string' ? nonce : undefined;\n};\n\nexport const registerCspNonceGetter = (getter: () => string | undefined) => {\n\tReflect.set(globalThis, GETTER_KEY, getter);\n};\n",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...args) => api.dispatch(...args), ...initial };\n};\nconst redux = reduxImpl;\n\nconst shouldDispatchFromDevtools = (api) => !!api.dispatchFromDevtools && typeof api.dispatch === \"function\";\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst removeStoreFromTrackedConnections = (name, store) => {\n if (store === void 0) return;\n const connectionInfo = trackedConnections.get(name);\n if (!connectionInfo) return;\n delete connectionInfo.stores[store];\n if (Object.keys(connectionInfo.stores).length === 0) {\n trackedConnections.delete(name);\n }\n};\nconst findCallerName = (stack) => {\n var _a, _b;\n if (!stack) return void 0;\n const traceLines = stack.split(\"\\n\");\n const apiSetStateLineIndex = traceLines.findIndex(\n (traceLine) => traceLine.includes(\"api.setState\")\n );\n if (apiSetStateLineIndex < 0) return void 0;\n const callerLine = ((_a = traceLines[apiSetStateLineIndex + 1]) == null ? void 0 : _a.trim()) || \"\";\n return (_b = /.+ (.+) .+/.exec(callerLine)) == null ? void 0 : _b[1];\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extensionConnector) {\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = ((state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === void 0 ? {\n type: anonymousActionType || findCallerName(new Error().stack) || \"anonymous\"\n } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n });\n api.devtools = {\n cleanup: () => {\n if (connection && typeof connection.unsubscribe === \"function\") {\n connection.unsubscribe();\n }\n removeStoreFromTrackedConnections(options.name, store);\n }\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (shouldDispatchFromDevtools(api)) {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...args) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && args[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...args);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (shouldDispatchFromDevtools(api)) {\n api.dispatch(action);\n }\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState) return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, fn) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0) fn(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = ((selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n });\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nfunction combine(initialState, create) {\n return (...args) => Object.assign({}, initialState, create(...args));\n}\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst persistImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => window.localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n let hydrationVersion = 0;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n return setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n return setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n const currentVersion = ++hydrationVersion;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n const migration = options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n if (migration instanceof Promise) {\n return migration.then((result) => [true, result]);\n }\n return [true, migration];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, void 0];\n }).then((migrationResult) => {\n var _a2;\n if (currentVersion !== hydrationVersion) {\n return;\n }\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(get(), void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persist = persistImpl;\n\nfunction ssrSafe(config, isSSR = typeof window === \"undefined\") {\n return (set, get, api) => {\n if (!isSSR) {\n return config(set, get, api);\n }\n const ssrSet = () => {\n throw new Error(\"Cannot set state of Zustand store in SSR\");\n };\n api.setState = ssrSet;\n return config(ssrSet, get, api);\n };\n}\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector, ssrSafe as unstable_ssrSafe };\n",
|
|
17
17
|
"import { createStore, type StateCreator, type StoreApi } from 'zustand/vanilla';\nimport { combine } from 'zustand/middleware';\n\nexport type IslandStoreState = object;\ntype IslandStoreSnapshot = Record<string, unknown>;\ntype IslandStoreShape<\n\tTState extends IslandStoreState,\n\tTActions extends object\n> = Omit<TState, keyof TActions> & TActions;\nexport type IslandStateSnapshot = Record<string, IslandStoreSnapshot>;\ntype AnyIslandStore = StoreApi<object>;\ntype IslandStoreInstance = {\n\tapplyExternalSnapshot: (snapshot: IslandStoreSnapshot) => void;\n\tstore: AnyIslandStore;\n};\n\nexport const ABSOLUTE_ISLAND_STATE = '__ABS_ISLAND_STATE__';\nexport const ABSOLUTE_ISLAND_STORES = '__ABS_ISLAND_STORES__';\n\ndeclare global {\n\tvar __ABS_ISLAND_STATE__: IslandStateSnapshot | undefined;\n\tvar __ABS_ISLAND_STORES__:\n\t\tMap<string, Set<IslandStoreInstance>> | undefined;\n}\n\nconst getIslandStoreSnapshot = () => {\n\tglobalThis.__ABS_ISLAND_STATE__ ??= {};\n\n\treturn globalThis.__ABS_ISLAND_STATE__;\n};\n\nconst getIslandStores = () => {\n\tglobalThis.__ABS_ISLAND_STORES__ ??= new Map();\n\n\treturn globalThis.__ABS_ISLAND_STORES__;\n};\n\nconst isSerializableValue = (value: unknown) =>\n\ttypeof value !== 'function' && value !== undefined;\n\nconst toSerializableState = <T extends object>(state: T) =>\n\tObject.fromEntries(\n\t\tObject.entries(state).filter(([, value]) => isSerializableValue(value))\n\t);\n\nconst applySnapshot = <T extends object>(\n\tstore: StoreApi<T>,\n\tsnapshot: IslandStoreSnapshot | undefined\n) => {\n\tif (!snapshot) {\n\t\treturn;\n\t}\n\n\tstore.setState({\n\t\t...store.getState(),\n\t\t...snapshot\n\t});\n};\n\nconst getPeerStores = (\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => [...storeInstances].filter((peer) => peer.store !== ownerStore);\n\nconst syncIslandSnapshot = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tstate: IslandStoreShape<TState, TActions>,\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => {\n\tconst nextSnapshot = toSerializableState(state);\n\tgetIslandStoreSnapshot()[storeId] = nextSnapshot;\n\n\tfor (const peerStore of getPeerStores(storeInstances, ownerStore)) {\n\t\tpeerStore.applyExternalSnapshot(nextSnapshot);\n\t}\n};\n\nexport const createIslandStore = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tinitialState: TState,\n\tcreateState: StateCreator<TState, [], [], TActions>\n) => {\n\tconst store = createStore(combine(initialState, createState));\n\tconst stores = getIslandStores();\n\tconst storeInstances =\n\t\tstores.get(storeId) ?? new Set<IslandStoreInstance>();\n\tconst initialSnapshot = getIslandStoreSnapshot()[storeId];\n\tapplySnapshot(store, initialSnapshot);\n\tlet isApplyingExternalSnapshot = false;\n\n\tconst applyExternalSnapshot = (snapshot: IslandStoreSnapshot) => {\n\t\tisApplyingExternalSnapshot = true;\n\t\tapplySnapshot(store, snapshot);\n\t};\n\n\tstoreInstances.add({\n\t\tapplyExternalSnapshot,\n\t\tstore\n\t});\n\tstores.set(storeId, storeInstances);\n\n\tsyncIslandSnapshot(storeId, store.getState(), storeInstances, store);\n\tstore.subscribe((state) => {\n\t\tif (isApplyingExternalSnapshot) {\n\t\t\tisApplyingExternalSnapshot = false;\n\n\t\t\treturn;\n\t\t}\n\n\t\tsyncIslandSnapshot(storeId, state, storeInstances, store);\n\t});\n\n\treturn store;\n};\nexport const getIslandStoreServerSnapshot = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getInitialState());\nconst applySnapshotToStoreInstances = (\n\tstoreId: string,\n\tinstances: Set<IslandStoreInstance>,\n\tsnapshot: IslandStateSnapshot\n) => {\n\tfor (const instance of instances) {\n\t\tinstance.applyExternalSnapshot(snapshot[storeId] ?? {});\n\t}\n};\n\nexport const initializeIslandStores = (state: IslandStateSnapshot) => {\n\tconst currentSnapshot = getIslandStoreSnapshot();\n\tconst nextSnapshot: IslandStateSnapshot = {\n\t\t...state,\n\t\t...currentSnapshot\n\t};\n\n\tglobalThis.__ABS_ISLAND_STATE__ = nextSnapshot;\n\n\tfor (const [storeId, store] of getIslandStores()) {\n\t\tapplySnapshotToStoreInstances(storeId, store, nextSnapshot);\n\t}\n};\nexport const readIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getState());\nexport const resetIslandStoreForTesting = () => {\n\tdelete globalThis.__ABS_ISLAND_STATE__;\n\tdelete globalThis.__ABS_ISLAND_STORES__;\n};\nexport const subscribeIslandStore = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected,\n\tlistener: (value: TSelected) => void\n) => {\n\tlet currentSelection = selector(store.getState());\n\n\treturn store.subscribe((state) => {\n\t\tconst nextSelection = selector(state);\n\t\tif (Object.is(nextSelection, currentSelection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tcurrentSelection = nextSelection;\n\t\tlistener(nextSelection);\n\t});\n};\n"
|
|
18
18
|
],
|
|
19
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMa,gCAAgC,2BAKhC,uCAAuC,
|
|
20
|
-
"debugId": "
|
|
19
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMa,gCAAgC,2BAKhC,uCAAuC,mBAKvC,wBAAwB,4BAE/B,2BAA2B,CAAC,cACjC,UAAU,IAAI,YAAY,IAAI,UAAU,MAAM,CAAC,GAE1C,0BAA0B,CAC/B,UACA,WACI;AAAA,EACJ,MAAM,UAAkC,CAAC;AAAA,EACzC,IAAI,QAAQ;AAAA,EAEZ,YAAY,KAAK,UAAU,OAAO,QAAQ,QAAQ,GAAG;AAAA,IACpD,IAAI,CAAC,IAAI,WAAW,MAAM;AAAA,MAAG;AAAA,IAE7B,MAAM,YAAY,IAAI,MAAM,OAAO,MAAM;AAAA,IACzC,IAAI,CAAC;AAAA,MAAW;AAAA,IAEhB,QAAQ,aAAa;AAAA,IACrB,QAAQ;AAAA,EACT;AAAA,EAEA,OAAO,QAAQ,UAAU;AAAA,GAGb,yBAAyB,CAAC,aACtC,SAAS,kCACT,SAAS,uCACG,2BAA2B,CAAC,aAAqC;AAAA,EAC7E,MAAM,UACL,CAAC;AAAA,EACF,MAAM,aAAgC,CAAC,SAAS,UAAU,OAAO,SAAS;AAAA,EAE1E,WAAW,aAAa,YAAY;AAAA,I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,QAAQ,CACnD;",
|
|
20
|
+
"debugId": "EE6D9F711A5FFD6A64756E2164756E21",
|
|
21
21
|
"names": []
|
|
22
22
|
}
|
package/dist/react/index.js
CHANGED
|
@@ -223,6 +223,8 @@ var colors2, frameworkColors, logTag = () => isDevelopmentRuntime() ? "[hmr]" :
|
|
|
223
223
|
const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
|
|
224
224
|
message += ` ${pathColor}${formatPath(options.path)}${colors2.reset}`;
|
|
225
225
|
}
|
|
226
|
+
if (options?.detail)
|
|
227
|
+
message += ` ${options.detail}`;
|
|
226
228
|
if (options?.duration !== undefined) {
|
|
227
229
|
message += ` ${colors2.dim}(${options.duration}ms)${colors2.reset}`;
|
|
228
230
|
}
|
|
@@ -254,6 +256,16 @@ var colors2, frameworkColors, logTag = () => isDevelopmentRuntime() ? "[hmr]" :
|
|
|
254
256
|
log(message);
|
|
255
257
|
}, logPageBuild = (path, framework, duration) => {
|
|
256
258
|
log("page build", { duration, framework, path });
|
|
259
|
+
}, logRoutesUpdate = (path, framework, added, removed) => {
|
|
260
|
+
const changes = [
|
|
261
|
+
...added.map((route) => `${colors2.green}+${route}${colors2.reset}`),
|
|
262
|
+
...removed.map((route) => `${colors2.red}-${route}${colors2.reset}`)
|
|
263
|
+
];
|
|
264
|
+
log("routes update", {
|
|
265
|
+
detail: changes.length > 0 ? changes.join(" ") : undefined,
|
|
266
|
+
framework,
|
|
267
|
+
path
|
|
268
|
+
});
|
|
257
269
|
}, logScriptUpdate = (path, framework, duration) => {
|
|
258
270
|
log("script update", { duration, framework, path });
|
|
259
271
|
}, logServerReload = () => {
|
|
@@ -290,7 +302,7 @@ var init_logger = __esm(() => {
|
|
|
290
302
|
});
|
|
291
303
|
|
|
292
304
|
// src/core/islandManifest.ts
|
|
293
|
-
var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
|
|
305
|
+
var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", REACT_PAGE_ROOT_EVENT = "absolute:react-page-root", toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
|
|
294
306
|
const entries = {};
|
|
295
307
|
let found = false;
|
|
296
308
|
for (const [key, value] of Object.entries(manifest)) {
|
|
@@ -364,13 +376,15 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
364
376
|
return "";
|
|
365
377
|
const renderedKeys = collectRenderedIslandStyleKeys(html);
|
|
366
378
|
return getIslandStyleManifestEntries(manifest).filter(([key]) => renderedKeys.has(key)).filter(([, href]) => !html.includes(`href="${href}"`)).map(([key, href]) => `<link rel="stylesheet" href="${href}" data-island-style="${key}"${nonceAttr()}>`).join("");
|
|
367
|
-
}, buildIslandsHeadMarkup = (manifest, html) => {
|
|
379
|
+
}, REACT_HOOK_STAND_IN, buildIslandsHeadMarkup = (manifest, html, host) => {
|
|
368
380
|
const styleLinks = buildIslandStyleLinks(manifest, html);
|
|
369
381
|
const manifestScript = `<script${nonceAttr()}>window.__ABSOLUTE_MANIFEST__ = ${escapeScriptContent(JSON.stringify(toBrowserManifest(manifest)))}</script>`;
|
|
370
|
-
const
|
|
382
|
+
const hostAssignment = host ? `;window.__ABS_ISLAND_HOST__ = ${JSON.stringify(host)}` : "";
|
|
383
|
+
const islandStateScript = `<script${nonceAttr()}>window.__ABS_ISLAND_STATE__ = ${escapeScriptContent(JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {}))}${hostAssignment}</script>`;
|
|
384
|
+
const reactHookScript = isProductionRuntime() ? "" : `<script${nonceAttr()}>${REACT_HOOK_STAND_IN}</script>`;
|
|
371
385
|
const bootstrapPath = getIslandBootstrapPath(manifest);
|
|
372
386
|
const bootstrapScript = bootstrapPath ? `<script${nonceAttr()} type="module" src="${bootstrapPath}"></script>` : "";
|
|
373
|
-
return `${styleLinks}${manifestScript}${islandStateScript}${bootstrapScript}`;
|
|
387
|
+
return `${styleLinks}${manifestScript}${islandStateScript}${reactHookScript}${bootstrapScript}`;
|
|
374
388
|
}, injectHeadMarkup = (html, markup) => {
|
|
375
389
|
const closingHeadIndex = html.indexOf("</head>");
|
|
376
390
|
if (closingHeadIndex >= 0) {
|
|
@@ -557,7 +571,7 @@ var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST
|
|
|
557
571
|
const manifest = globalThis.__absoluteManifest;
|
|
558
572
|
if (!manifest)
|
|
559
573
|
return stream;
|
|
560
|
-
const markup = buildIslandsHeadMarkup(manifest);
|
|
574
|
+
const markup = buildIslandsHeadMarkup(manifest, undefined, options?.host);
|
|
561
575
|
if (options?.hasIslands === true) {
|
|
562
576
|
warnIfBootstrapMissing(manifest);
|
|
563
577
|
return pipeStreamWithHeadInjection(stream, markup);
|
|
@@ -583,6 +597,7 @@ var init_islandPageContext = __esm(() => {
|
|
|
583
597
|
"vue",
|
|
584
598
|
"angular"
|
|
585
599
|
];
|
|
600
|
+
REACT_HOOK_STAND_IN = "if(!window.__REACT_DEVTOOLS_GLOBAL_HOOK__){var n=0;" + "window.__REACT_DEVTOOLS_GLOBAL_HOOK__={renderers:new Map(),supportsFiber:true," + "inject:function(r){n+=1;this.renderers.set(n,r);return n}," + "onScheduleFiberRoot:function(){},onCommitFiberRoot:function(){},onCommitFiberUnmount:function(){}}}";
|
|
586
601
|
});
|
|
587
602
|
|
|
588
603
|
// src/core/devRouteRegistrationCallsite.ts
|
|
@@ -5342,7 +5357,9 @@ var handleReactPageRequest = async (input) => {
|
|
|
5342
5357
|
console.error("[SSR] React streaming error:", error);
|
|
5343
5358
|
}
|
|
5344
5359
|
});
|
|
5345
|
-
const htmlStream = injectIslandPageContextStream(stream
|
|
5360
|
+
const htmlStream = injectIslandPageContextStream(stream, {
|
|
5361
|
+
host: "react"
|
|
5362
|
+
});
|
|
5346
5363
|
if (resolveErrorConventionPath("react", pageName) || hasErrorConvention("react")) {
|
|
5347
5364
|
const html = await new Response(htmlStream).text();
|
|
5348
5365
|
return new Response(html, {
|
|
@@ -5417,7 +5434,8 @@ var warnDoubledRscKey = (source, name, assetPath) => {
|
|
|
5417
5434
|
warnedDoubledRscKeys.add(name);
|
|
5418
5435
|
console.warn(`[asset] key "${name}" is deprecated: React Server Components pages whose file name ends in RSC no longer get the suffix twice. Use asset(manifest, '${current}').`);
|
|
5419
5436
|
};
|
|
5420
|
-
var asset = (source, name) =>
|
|
5437
|
+
var asset = (source, name) => assetUnchecked(source, name);
|
|
5438
|
+
var assetUnchecked = (source, name) => {
|
|
5421
5439
|
const assetPath = source[name];
|
|
5422
5440
|
if (assetPath === undefined) {
|
|
5423
5441
|
if (isProductionRuntime()) {
|
|
@@ -5443,7 +5461,7 @@ var reactFileRoute = (route) => defineFileRouteWith("react", route, async ({ man
|
|
|
5443
5461
|
throw new Error(`File route ${route.source} has no default-exported React component.`);
|
|
5444
5462
|
}
|
|
5445
5463
|
return handleReactPageRequest({
|
|
5446
|
-
index:
|
|
5464
|
+
index: assetUnchecked(manifest, `${route.name}Index`),
|
|
5447
5465
|
Page,
|
|
5448
5466
|
props,
|
|
5449
5467
|
request
|
|
@@ -5598,6 +5616,12 @@ var createNodeRenderer = (pageModule, renderer) => {
|
|
|
5598
5616
|
}));
|
|
5599
5617
|
return render;
|
|
5600
5618
|
};
|
|
5619
|
+
var dropAllStackFrames = () => false;
|
|
5620
|
+
var createDevelopmentDebugChannel = (pageModule) => {
|
|
5621
|
+
if (pageModule.developmentFlight !== true)
|
|
5622
|
+
return;
|
|
5623
|
+
return new TransformStream;
|
|
5624
|
+
};
|
|
5601
5625
|
var createRendererStorage = () => new AsyncLocalStorage5;
|
|
5602
5626
|
var handleReactServerPageRequest = async (input) => {
|
|
5603
5627
|
const request = input.request ?? getCurrentAbsoluteRequest();
|
|
@@ -5614,7 +5638,14 @@ var handleReactServerPageRequest = async (input) => {
|
|
|
5614
5638
|
]);
|
|
5615
5639
|
const renderer = await loadRenderer(runtime.ssr);
|
|
5616
5640
|
const nonce = readCspNonce();
|
|
5617
|
-
const
|
|
5641
|
+
const debugChannel = createDevelopmentDebugChannel(pageModule);
|
|
5642
|
+
const renderFlight = () => pageModule.renderToReadableStream(pageModule.createElement(pageModule.Page, input.props ?? {}), pageModule.clientManifest, debugChannel ? {
|
|
5643
|
+
debugChannel: {
|
|
5644
|
+
writable: debugChannel.writable
|
|
5645
|
+
},
|
|
5646
|
+
filterStackFrame: dropAllStackFrames,
|
|
5647
|
+
onError: logRenderError
|
|
5648
|
+
} : { onError: logRenderError });
|
|
5618
5649
|
const nodeRenderer = createNodeRenderer(pageModule, renderer);
|
|
5619
5650
|
const flight = nodeRenderer ? runWithReactServerNodeRenderer(nodeRenderer, createRendererStorage, renderFlight) : renderFlight();
|
|
5620
5651
|
const [forHtml, forPayload] = flight.tee();
|
|
@@ -5623,7 +5654,7 @@ var handleReactServerPageRequest = async (input) => {
|
|
|
5623
5654
|
bootstrapScriptContent: `${BROWSER_TRANSLATION_BASELINE_SCRIPT}window.__ABS_SLOT_HYDRATION_PENDING__=true;`,
|
|
5624
5655
|
nonce,
|
|
5625
5656
|
onError: logRenderError
|
|
5626
|
-
});
|
|
5657
|
+
}, debugChannel?.readable);
|
|
5627
5658
|
return new Response(injectFlightPayload(html, forPayload, nonce), {
|
|
5628
5659
|
headers: streamingPageHeaders()
|
|
5629
5660
|
});
|
|
@@ -5876,5 +5907,5 @@ export {
|
|
|
5876
5907
|
useIslandStore
|
|
5877
5908
|
};
|
|
5878
5909
|
|
|
5879
|
-
//# debugId=
|
|
5910
|
+
//# debugId=A6A52A17EA97686064756E2164756E21
|
|
5880
5911
|
//# sourceMappingURL=index.js.map
|