@absolutejs/absolute 0.19.0-beta.1041 → 0.19.0-beta.1043
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/package.json +1 -1
- package/dist/angular/browser.js +0 -10358
- package/dist/angular/browser.js.map +0 -260
- package/dist/angular/components/constants.js +0 -101
- package/dist/angular/components/core/streamingSlotRegistrar.js +0 -58
- package/dist/angular/components/core/streamingSlotRegistry.js +0 -114
- package/dist/angular/components/defer-slot-payload.js +0 -6
- package/dist/angular/components/defer-slot-templates.directive.js +0 -44
- package/dist/angular/components/defer-slot.component.js +0 -152
- package/dist/angular/components/image.component.js +0 -202
- package/dist/angular/components/index.js +0 -4
- package/dist/angular/components/stream-slot.component.js +0 -102
- package/dist/angular/hmrPreserveCore.ts +0 -188
- package/dist/angular/index.js +0 -15793
- package/dist/angular/index.js.map +0 -299
- package/dist/angular/server.js +0 -6357
- package/dist/angular/server.js.map +0 -61
- package/dist/build.js +0 -27484
- package/dist/build.js.map +0 -146
- package/dist/cli/config/client.js +0 -527
- package/dist/cli/config/server.js +0 -37130
- package/dist/cli/htmx/htmx.min.js +0 -1
- package/dist/cli/index.js +0 -179275
- package/dist/client/index.js +0 -1267
- package/dist/client/index.js.map +0 -31
- package/dist/core/streamingSlotRegistrar.js +0 -138
- package/dist/core/streamingSlotRegistrar.js.map +0 -10
- package/dist/core/streamingSlotRegistry.js +0 -194
- package/dist/core/streamingSlotRegistry.js.map +0 -11
- package/dist/dev/client/constants.ts +0 -26
- package/dist/dev/client/cssUtils.ts +0 -311
- package/dist/dev/client/domDiff.ts +0 -226
- package/dist/dev/client/domState.ts +0 -423
- package/dist/dev/client/domTracker.ts +0 -61
- package/dist/dev/client/errorOverlay.ts +0 -445
- package/dist/dev/client/frameworkDetect.ts +0 -63
- package/dist/dev/client/handlers/angularHmrShim.ts +0 -88
- package/dist/dev/client/handlers/angularRemount.ts +0 -362
- package/dist/dev/client/handlers/angularRemountWiring.ts +0 -52
- package/dist/dev/client/handlers/html.ts +0 -364
- package/dist/dev/client/handlers/htmx.ts +0 -278
- package/dist/dev/client/handlers/react.ts +0 -108
- package/dist/dev/client/handlers/rebuild.ts +0 -153
- package/dist/dev/client/handlers/svelte.ts +0 -334
- package/dist/dev/client/handlers/vue.ts +0 -292
- package/dist/dev/client/headPatch.ts +0 -233
- package/dist/dev/client/hmrClient.ts +0 -352
- package/dist/dev/client/hmrState.ts +0 -14
- package/dist/dev/client/hmrToast.ts +0 -150
- package/dist/dev/client/moduleVersions.ts +0 -62
- package/dist/dev/client/reactRefreshSetup.ts +0 -31
- package/dist/dev/client/vendor/lview/lViewOps.ts +0 -196
- package/dist/dev/client/vendor/lview/slotConstants.ts +0 -44
- package/dist/dev/client/vendor/reactRefreshRuntime.d.ts +0 -12
- package/dist/dev/client/vendor/reactRefreshRuntime.js +0 -313
- package/dist/image-client/imageClient.js +0 -69
- package/dist/index.js +0 -36361
- package/dist/index.js.map +0 -320
- package/dist/islands/browser.js +0 -259
- package/dist/islands/browser.js.map +0 -15
- package/dist/islands/index.js +0 -2415
- package/dist/islands/index.js.map +0 -37
- package/dist/react/browser.js +0 -374
- package/dist/react/browser.js.map +0 -19
- package/dist/react/components/browser/index.js +0 -467
- package/dist/react/components/index.js +0 -684
- package/dist/react/components/index.js.map +0 -18
- package/dist/react/hooks/index.js +0 -285
- package/dist/react/hooks/index.js.map +0 -14
- package/dist/react/index.js +0 -4258
- package/dist/react/index.js.map +0 -56
- package/dist/react/jsxDevRuntimeCompat.js +0 -90
- package/dist/react/jsxDevRuntimeCompat.js.map +0 -10
- package/dist/react/router/browser.js +0 -95
- package/dist/react/router/browser.js.map +0 -10
- package/dist/react/router/index.js +0 -95
- package/dist/react/router/index.js.map +0 -10
- package/dist/react/server.js +0 -1895
- package/dist/react/server.js.map +0 -26
- package/dist/src/angular/Island.browser.d.ts +0 -34
- package/dist/src/angular/Island.d.ts +0 -29
- package/dist/src/angular/angularDeps.d.ts +0 -2
- package/dist/src/angular/angularPatch.d.ts +0 -1
- package/dist/src/angular/animationProviders.d.ts +0 -2
- package/dist/src/angular/browser.d.ts +0 -14
- package/dist/src/angular/components/constants.d.ts +0 -96
- package/dist/src/angular/components/defer-slot-payload.d.ts +0 -7
- package/dist/src/angular/components/defer-slot-templates.directive.d.ts +0 -21
- package/dist/src/angular/components/defer-slot.component.d.ts +0 -29
- package/dist/src/angular/components/image.component.d.ts +0 -42
- package/dist/src/angular/components/index.d.ts +0 -4
- package/dist/src/angular/components/stream-slot.component.d.ts +0 -20
- package/dist/src/angular/composables/index.d.ts +0 -6
- package/dist/src/angular/composables/usePageContext.d.ts +0 -16
- package/dist/src/angular/composables/useResource.d.ts +0 -57
- package/dist/src/angular/composables/useSubscription.d.ts +0 -33
- package/dist/src/angular/composables/useTimers.d.ts +0 -18
- package/dist/src/angular/createIsland.browser.d.ts +0 -2
- package/dist/src/angular/createIsland.d.ts +0 -2
- package/dist/src/angular/deterministicEnv.d.ts +0 -26
- package/dist/src/angular/hmrPreserveCore.d.ts +0 -21
- package/dist/src/angular/httpTransferCache.d.ts +0 -12
- package/dist/src/angular/index.d.ts +0 -14
- package/dist/src/angular/injectorPatch.d.ts +0 -1
- package/dist/src/angular/islandStore.d.ts +0 -9
- package/dist/src/angular/islands.d.ts +0 -4
- package/dist/src/angular/lowerDeferSyntax.d.ts +0 -18
- package/dist/src/angular/lowerServerIslands.d.ts +0 -1
- package/dist/src/angular/pageHandler.d.ts +0 -48
- package/dist/src/angular/pendingTask.d.ts +0 -1
- package/dist/src/angular/preserveAcrossHmr.d.ts +0 -12
- package/dist/src/angular/renderIsland.d.ts +0 -2
- package/dist/src/angular/requestProviders.d.ts +0 -5
- package/dist/src/angular/resolveAngularPackage.d.ts +0 -19
- package/dist/src/angular/routerRedirectProviders.d.ts +0 -6
- package/dist/src/angular/server.d.ts +0 -4
- package/dist/src/angular/ssrRender.d.ts +0 -13
- package/dist/src/angular/ssrSanitizer.d.ts +0 -3
- package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +0 -7
- package/dist/src/build/angularLinkerPlugin.d.ts +0 -29
- package/dist/src/build/buildAngularVendor.d.ts +0 -40
- package/dist/src/build/buildDepVendor.d.ts +0 -2
- package/dist/src/build/buildEmberVendor.d.ts +0 -24
- package/dist/src/build/buildReactVendor.d.ts +0 -8
- package/dist/src/build/buildSvelteVendor.d.ts +0 -6
- package/dist/src/build/buildVueVendor.d.ts +0 -6
- package/dist/src/build/chainInlineSourcemaps.d.ts +0 -13
- package/dist/src/build/compileAngular.d.ts +0 -40
- package/dist/src/build/compileEmber.d.ts +0 -43
- package/dist/src/build/compileSvelte.d.ts +0 -14
- package/dist/src/build/compileTailwind.d.ts +0 -5
- package/dist/src/build/compileVue.d.ts +0 -22
- package/dist/src/build/externalAssetPlugin.d.ts +0 -2
- package/dist/src/build/generateManifest.d.ts +0 -2
- package/dist/src/build/generateReactIndexes.d.ts +0 -2
- package/dist/src/build/htmlScriptHMRPlugin.d.ts +0 -13
- package/dist/src/build/index.d.ts +0 -2
- package/dist/src/build/islandEntries.d.ts +0 -32
- package/dist/src/build/islandRegistryTransform.d.ts +0 -17
- package/dist/src/build/nativeRewrite.d.ts +0 -5
- package/dist/src/build/optimizeHtmlImages.d.ts +0 -2
- package/dist/src/build/outputLogs.d.ts +0 -1
- package/dist/src/build/parseAngularConfigImports.d.ts +0 -9
- package/dist/src/build/parseVueSpaRoutes.d.ts +0 -20
- package/dist/src/build/resolvePackageImport.d.ts +0 -9
- package/dist/src/build/rewriteImports.d.ts +0 -8
- package/dist/src/build/rewriteImportsPlugin.d.ts +0 -48
- package/dist/src/build/rewriteReactImports.d.ts +0 -7
- package/dist/src/build/runAngularHandlerScan.d.ts +0 -7
- package/dist/src/build/scanAngularHandlerCalls.d.ts +0 -13
- package/dist/src/build/scanAngularPageRoutes.d.ts +0 -10
- package/dist/src/build/scanConventions.d.ts +0 -5
- package/dist/src/build/scanCssEntryPoints.d.ts +0 -1
- package/dist/src/build/scanEntryPoints.d.ts +0 -1
- package/dist/src/build/scanRouteRegistrations.d.ts +0 -23
- package/dist/src/build/scanVueSsrOnlyPages.d.ts +0 -6
- package/dist/src/build/staticIslandPages.d.ts +0 -9
- package/dist/src/build/stylePreprocessor.d.ts +0 -26
- package/dist/src/build/tailwindCompiler.d.ts +0 -8
- package/dist/src/build/updateAssetPaths.d.ts +0 -1
- package/dist/src/build/vendorEntrySource.d.ts +0 -1
- package/dist/src/build/verifyAngularCoreUniqueness.d.ts +0 -2
- package/dist/src/build/vueAutoRouterTransform.d.ts +0 -1
- package/dist/src/build/wrapHTMLScript.d.ts +0 -17
- package/dist/src/build.d.ts +0 -2
- package/dist/src/cli/add/dependencies.d.ts +0 -12
- package/dist/src/cli/cache.d.ts +0 -15
- package/dist/src/cli/config/absolute/AbsoluteConfigPanel.d.ts +0 -6
- package/dist/src/cli/config/absolute/editAbsoluteConfig.d.ts +0 -5
- package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +0 -14
- package/dist/src/cli/config/client.d.ts +0 -1
- package/dist/src/cli/config/configCert.d.ts +0 -12
- package/dist/src/cli/config/eslint/EslintPanel.d.ts +0 -6
- package/dist/src/cli/config/eslint/configAst.d.ts +0 -18
- package/dist/src/cli/config/eslint/editConfigRule.d.ts +0 -6
- package/dist/src/cli/config/eslint/eslintStyles.d.ts +0 -1
- package/dist/src/cli/config/eslint/resolveConfig.d.ts +0 -3
- package/dist/src/cli/config/eslint/serializeValue.d.ts +0 -9
- package/dist/src/cli/config/guards.d.ts +0 -4
- package/dist/src/cli/config/packageJson/PackageJsonPanel.d.ts +0 -6
- package/dist/src/cli/config/packageJson/editPackageJson.d.ts +0 -9
- package/dist/src/cli/config/packageJson/resolvePackageJson.d.ts +0 -9
- package/dist/src/cli/config/page/ConfigShell.d.ts +0 -6
- package/dist/src/cli/config/page/FieldEditor.d.ts +0 -9
- package/dist/src/cli/config/page/PanelHost.d.ts +0 -6
- package/dist/src/cli/config/page/configStyles.d.ts +0 -1
- package/dist/src/cli/config/panels.d.ts +0 -7
- package/dist/src/cli/config/prettier/PrettierPanel.d.ts +0 -6
- package/dist/src/cli/config/prettier/editPrettier.d.ts +0 -5
- package/dist/src/cli/config/prettier/resolvePrettier.d.ts +0 -11
- package/dist/src/cli/config/schema/fromJsonSchema.d.ts +0 -3
- package/dist/src/cli/config/schema/fromType.d.ts +0 -2
- package/dist/src/cli/config/schema/serialize.d.ts +0 -1
- package/dist/src/cli/config/server.d.ts +0 -298
- package/dist/src/cli/config/tsconfig/TsconfigPanel.d.ts +0 -6
- package/dist/src/cli/config/tsconfig/editTsconfig.d.ts +0 -5
- package/dist/src/cli/config/tsconfig/resolveTsconfig.d.ts +0 -8
- package/dist/src/cli/config/tsconfig/tsconfigStyles.d.ts +0 -1
- package/dist/src/cli/discoverInstances.d.ts +0 -5
- package/dist/src/cli/generate/componentTemplates.d.ts +0 -7
- package/dist/src/cli/generate/context.d.ts +0 -30
- package/dist/src/cli/generate/cssStrategy.d.ts +0 -20
- package/dist/src/cli/generate/frameworkKey.d.ts +0 -3
- package/dist/src/cli/generate/frameworks.d.ts +0 -40
- package/dist/src/cli/generate/generateApi.d.ts +0 -3
- package/dist/src/cli/generate/generateComponent.d.ts +0 -4
- package/dist/src/cli/generate/generatePage.d.ts +0 -4
- package/dist/src/cli/generate/naming.d.ts +0 -5
- package/dist/src/cli/generate/navData.d.ts +0 -10
- package/dist/src/cli/generate/outcome.d.ts +0 -17
- package/dist/src/cli/generate/pageTemplates.d.ts +0 -11
- package/dist/src/cli/generate/routeWiring.d.ts +0 -40
- package/dist/src/cli/generate/staticNav.d.ts +0 -5
- package/dist/src/cli/htmx/install.d.ts +0 -6
- package/dist/src/cli/index.d.ts +0 -2
- package/dist/src/cli/inspectData.d.ts +0 -11
- package/dist/src/cli/inspectTui.d.ts +0 -1
- package/dist/src/cli/instanceStatus.d.ts +0 -22
- package/dist/src/cli/interactive.d.ts +0 -2
- package/dist/src/cli/psTui.d.ts +0 -1
- package/dist/src/cli/scripts/add.d.ts +0 -1
- package/dist/src/cli/scripts/build.d.ts +0 -1
- package/dist/src/cli/scripts/compile.d.ts +0 -2
- package/dist/src/cli/scripts/dev.d.ts +0 -1
- package/dist/src/cli/scripts/doctor.d.ts +0 -1
- package/dist/src/cli/scripts/env.d.ts +0 -7
- package/dist/src/cli/scripts/eslint.d.ts +0 -16
- package/dist/src/cli/scripts/generate.d.ts +0 -1
- package/dist/src/cli/scripts/htmx.d.ts +0 -1
- package/dist/src/cli/scripts/info.d.ts +0 -1
- package/dist/src/cli/scripts/inspect.d.ts +0 -1
- package/dist/src/cli/scripts/logs.d.ts +0 -1
- package/dist/src/cli/scripts/ls.d.ts +0 -1
- package/dist/src/cli/scripts/mem.d.ts +0 -1
- package/dist/src/cli/scripts/prettier.d.ts +0 -3
- package/dist/src/cli/scripts/ps.d.ts +0 -1
- package/dist/src/cli/scripts/remove.d.ts +0 -1
- package/dist/src/cli/scripts/routes.d.ts +0 -1
- package/dist/src/cli/scripts/start.d.ts +0 -1
- package/dist/src/cli/scripts/telemetry.d.ts +0 -5
- package/dist/src/cli/scripts/tunnelRelay.d.ts +0 -9
- package/dist/src/cli/scripts/typecheck.d.ts +0 -1
- package/dist/src/cli/scripts/workspace.d.ts +0 -11
- package/dist/src/cli/telemetryEvent.d.ts +0 -1
- package/dist/src/cli/tuiPrimitives.d.ts +0 -14
- package/dist/src/cli/utils.d.ts +0 -15
- package/dist/src/cli/workspaceTui.d.ts +0 -44
- package/dist/src/client/hydrators/react.d.ts +0 -3
- package/dist/src/client/hydrators/svelte.d.ts +0 -2
- package/dist/src/client/hydrators/vue.d.ts +0 -2
- package/dist/src/client/index.d.ts +0 -4
- package/dist/src/client/islandResolver.d.ts +0 -2
- package/dist/src/client/islandRuntime.d.ts +0 -9
- package/dist/src/client/islandStore.d.ts +0 -22
- package/dist/src/client/preserveIslandMarkup.d.ts +0 -16
- package/dist/src/client/streamSwap.d.ts +0 -1
- package/dist/src/constants.d.ts +0 -96
- package/dist/src/core/angularServerModule.d.ts +0 -1
- package/dist/src/core/build.d.ts +0 -14
- package/dist/src/core/currentIslandRegistry.d.ts +0 -7
- package/dist/src/core/devBuild.d.ts +0 -23
- package/dist/src/core/devRouteRegistrationCallsite.d.ts +0 -4
- package/dist/src/core/devVendorPaths.d.ts +0 -17
- package/dist/src/core/index.d.ts +0 -7
- package/dist/src/core/islandManifest.d.ts +0 -3
- package/dist/src/core/islandMarkupAttributes.d.ts +0 -12
- package/dist/src/core/islandPageContext.d.ts +0 -12
- package/dist/src/core/islandSsr.d.ts +0 -6
- package/dist/src/core/islands.d.ts +0 -16
- package/dist/src/core/loadIslandRegistry.d.ts +0 -1
- package/dist/src/core/lookup.d.ts +0 -1
- package/dist/src/core/normalizeIslandProps.d.ts +0 -15
- package/dist/src/core/pageHandlers.d.ts +0 -5
- package/dist/src/core/prepare.d.ts +0 -417
- package/dist/src/core/prerender.d.ts +0 -31
- package/dist/src/core/renderIslandMarkup.d.ts +0 -13
- package/dist/src/core/responseEnhancers.d.ts +0 -10
- package/dist/src/core/staticStreaming.d.ts +0 -25
- package/dist/src/core/streamingSlotRegistrar.d.ts +0 -16
- package/dist/src/core/streamingSlotRegistry.d.ts +0 -2
- package/dist/src/core/streamingSlotWarningScope.d.ts +0 -4
- package/dist/src/core/svelteServerModule.d.ts +0 -1
- package/dist/src/core/vueServerModule.d.ts +0 -1
- package/dist/src/core/wrapPageHandlerWithStreamingSlots.d.ts +0 -2
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +0 -58
- package/dist/src/dev/angular/hmrCompiler.d.ts +0 -2
- package/dist/src/dev/angular/hmrImportGenerator.d.ts +0 -3
- package/dist/src/dev/angular/hmrInjectionPlugin.d.ts +0 -8
- package/dist/src/dev/angular/resolveOwningComponents.d.ts +0 -16
- package/dist/src/dev/angular/vendor/translator/api/ast_factory.d.ts +0 -363
- package/dist/src/dev/angular/vendor/translator/api/import_generator.d.ts +0 -49
- package/dist/src/dev/angular/vendor/translator/context.d.ts +0 -18
- package/dist/src/dev/angular/vendor/translator/translator.d.ts +0 -75
- package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +0 -12
- package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +0 -66
- package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +0 -13
- package/dist/src/dev/assetStore.d.ts +0 -8
- package/dist/src/dev/buildHMRClient.d.ts +0 -1
- package/dist/src/dev/clientManager.d.ts +0 -33
- package/dist/src/dev/configResolver.d.ts +0 -16
- package/dist/src/dev/dependencyGraph.d.ts +0 -10
- package/dist/src/dev/devCert.d.ts +0 -11
- package/dist/src/dev/fileHashTracker.d.ts +0 -2
- package/dist/src/dev/fileWatcher.d.ts +0 -4
- package/dist/src/dev/moduleMapper.d.ts +0 -27
- package/dist/src/dev/moduleServer.d.ts +0 -24
- package/dist/src/dev/moduleVersionTracker.d.ts +0 -7
- package/dist/src/dev/pathUtils.d.ts +0 -8
- package/dist/src/dev/reactComponentClassifier.d.ts +0 -2
- package/dist/src/dev/rebuildTrigger.d.ts +0 -11
- package/dist/src/dev/requestInspector.d.ts +0 -43
- package/dist/src/dev/serverEntryWatcher.d.ts +0 -5
- package/dist/src/dev/simpleHTMLHMR.d.ts +0 -4
- package/dist/src/dev/simpleHTMXHMR.d.ts +0 -4
- package/dist/src/dev/transformCache.d.ts +0 -22
- package/dist/src/dev/tunnel/client.d.ts +0 -20
- package/dist/src/dev/tunnel/protocol.d.ts +0 -85
- package/dist/src/dev/tunnel/relay.d.ts +0 -28
- package/dist/src/dev/webSocket.d.ts +0 -9
- package/dist/src/ember/browser.d.ts +0 -24
- package/dist/src/ember/index.d.ts +0 -2
- package/dist/src/ember/pageHandler.d.ts +0 -35
- package/dist/src/ember/server.d.ts +0 -2
- package/dist/src/index.d.ts +0 -7
- package/dist/src/islands/browser.d.ts +0 -3
- package/dist/src/islands/index.d.ts +0 -3
- package/dist/src/islands/pageMetadata.d.ts +0 -13
- package/dist/src/islands/sourceMetadata.d.ts +0 -10
- package/dist/src/plugins/devtoolsJson.d.ts +0 -58
- package/dist/src/plugins/hmr.d.ts +0 -163
- package/dist/src/plugins/imageOptimizer.d.ts +0 -67
- package/dist/src/plugins/index.d.ts +0 -3
- package/dist/src/plugins/networking.d.ts +0 -2
- package/dist/src/plugins/pageRouter.d.ts +0 -1
- package/dist/src/react/Island.browser.d.ts +0 -2
- package/dist/src/react/Island.d.ts +0 -2
- package/dist/src/react/bridgeInternals.d.ts +0 -1
- package/dist/src/react/browser.d.ts +0 -3
- package/dist/src/react/components/Head.d.ts +0 -2
- package/dist/src/react/components/Image.d.ts +0 -2
- package/dist/src/react/components/JsonLd.d.ts +0 -4
- package/dist/src/react/components/StreamSlot.browser.d.ts +0 -10
- package/dist/src/react/components/StreamSlot.d.ts +0 -10
- package/dist/src/react/components/SuspenseSlot.browser.d.ts +0 -22
- package/dist/src/react/components/SuspenseSlot.d.ts +0 -37
- package/dist/src/react/components/browser/index.d.ts +0 -5
- package/dist/src/react/components/index.d.ts +0 -5
- package/dist/src/react/createIsland.browser.d.ts +0 -2
- package/dist/src/react/createIsland.d.ts +0 -2
- package/dist/src/react/hooks/index.d.ts +0 -3
- package/dist/src/react/hooks/useIslandStore.d.ts +0 -3
- package/dist/src/react/hooks/useMediaQuery.d.ts +0 -7
- package/dist/src/react/index.d.ts +0 -4
- package/dist/src/react/jsxDevRuntimeCompat.d.ts +0 -8
- package/dist/src/react/pageHandler.d.ts +0 -25
- package/dist/src/react/router/UniversalRouter.d.ts +0 -43
- package/dist/src/react/router/browser.d.ts +0 -2
- package/dist/src/react/router/index.d.ts +0 -2
- package/dist/src/react/server.d.ts +0 -1
- package/dist/src/react/staticAnalyzeSpaRoutes.d.ts +0 -7
- package/dist/src/svelte/browser.d.ts +0 -4
- package/dist/src/svelte/createIsland.browser.d.ts +0 -2
- package/dist/src/svelte/createIsland.d.ts +0 -2
- package/dist/src/svelte/index.d.ts +0 -6
- package/dist/src/svelte/islandStore.d.ts +0 -5
- package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +0 -4
- package/dist/src/svelte/lowerIslandSyntax.d.ts +0 -4
- package/dist/src/svelte/pageHandler.d.ts +0 -28
- package/dist/src/svelte/renderIsland.d.ts +0 -2
- package/dist/src/svelte/renderToPipeableStream.d.ts +0 -12
- package/dist/src/svelte/renderToReadableStream.d.ts +0 -14
- package/dist/src/svelte/renderToString.d.ts +0 -9
- package/dist/src/svelte/resolveIslandHtml.browser.d.ts +0 -2
- package/dist/src/svelte/resolveIslandHtml.d.ts +0 -2
- package/dist/src/svelte/router/browser.d.ts +0 -4
- package/dist/src/svelte/router/goto.d.ts +0 -15
- package/dist/src/svelte/router/hashMode.d.ts +0 -16
- package/dist/src/svelte/router/index.d.ts +0 -4
- package/dist/src/svelte/router/matchPath.d.ts +0 -30
- package/dist/src/svelte/router/page.svelte.d.ts +0 -15
- package/dist/src/svelte/router/prefetchCache.d.ts +0 -17
- package/dist/src/svelte/router/pushState.d.ts +0 -13
- package/dist/src/svelte/router/viewTransitions.d.ts +0 -6
- package/dist/src/svelte/server.d.ts +0 -1
- package/dist/src/svelte/staticAnalyzeSpaRoutes.d.ts +0 -7
- package/dist/src/utils/buildDirectoryLock.d.ts +0 -28
- package/dist/src/utils/cleanStaleOutputs.d.ts +0 -1
- package/dist/src/utils/cleanup.d.ts +0 -9
- package/dist/src/utils/commonAncestor.d.ts +0 -1
- package/dist/src/utils/defineConfig.d.ts +0 -39
- package/dist/src/utils/defineConvention.d.ts +0 -3
- package/dist/src/utils/defineEnv.d.ts +0 -10
- package/dist/src/utils/escapeScriptContent.d.ts +0 -1
- package/dist/src/utils/formatBytes.d.ts +0 -2
- package/dist/src/utils/generateHeadElement.d.ts +0 -4
- package/dist/src/utils/generateSitemap.d.ts +0 -21
- package/dist/src/utils/generatedDir.d.ts +0 -3
- package/dist/src/utils/getDurationString.d.ts +0 -1
- package/dist/src/utils/getEnv.d.ts +0 -1
- package/dist/src/utils/imageClient.d.ts +0 -13
- package/dist/src/utils/imageProcessing.d.ts +0 -33
- package/dist/src/utils/index.d.ts +0 -11
- package/dist/src/utils/inlinePageCss.d.ts +0 -2
- package/dist/src/utils/instanceRegistry.d.ts +0 -13
- package/dist/src/utils/jsonLd.d.ts +0 -3
- package/dist/src/utils/loadConfig.d.ts +0 -55
- package/dist/src/utils/logger.d.ts +0 -56
- package/dist/src/utils/networking.d.ts +0 -2
- package/dist/src/utils/normalizePath.d.ts +0 -9
- package/dist/src/utils/portScan.d.ts +0 -22
- package/dist/src/utils/projectRoot.d.ts +0 -17
- package/dist/src/utils/registerClientScript.d.ts +0 -36
- package/dist/src/utils/resolveConvention.d.ts +0 -10
- package/dist/src/utils/resolveDevPort.d.ts +0 -24
- package/dist/src/utils/runtimeMode.d.ts +0 -3
- package/dist/src/utils/spaRouteCss.d.ts +0 -4
- package/dist/src/utils/spaRouteTypes.d.ts +0 -25
- package/dist/src/utils/ssrErrorPage.d.ts +0 -1
- package/dist/src/utils/startupBanner.d.ts +0 -10
- package/dist/src/utils/startupTimings.d.ts +0 -7
- package/dist/src/utils/streamingSlotMetricSink.d.ts +0 -18
- package/dist/src/utils/streamingSlots.d.ts +0 -76
- package/dist/src/utils/stringModifiers.d.ts +0 -3
- package/dist/src/utils/userAgentFunctions.d.ts +0 -1
- package/dist/src/utils/validateSafePath.d.ts +0 -1
- package/dist/src/vue/Island.browser.d.ts +0 -37
- package/dist/src/vue/Island.d.ts +0 -36
- package/dist/src/vue/browser.d.ts +0 -6
- package/dist/src/vue/components/Image.d.ts +0 -74
- package/dist/src/vue/components/StreamSlot.d.ts +0 -22
- package/dist/src/vue/components/SuspenseSlot.d.ts +0 -26
- package/dist/src/vue/components/index.d.ts +0 -3
- package/dist/src/vue/createIsland.browser.d.ts +0 -13
- package/dist/src/vue/createIsland.d.ts +0 -13
- package/dist/src/vue/defineVuePage.d.ts +0 -6
- package/dist/src/vue/index.d.ts +0 -9
- package/dist/src/vue/pageHandler.d.ts +0 -45
- package/dist/src/vue/routerRedirectProviders.d.ts +0 -45
- package/dist/src/vue/server.d.ts +0 -2
- package/dist/src/vue/staticAnalyzeSpaRoutes.d.ts +0 -7
- package/dist/src/vue/useIslandStore.d.ts +0 -3
- package/dist/svelte/browser.js +0 -309
- package/dist/svelte/browser.js.map +0 -19
- package/dist/svelte/components/AwaitSlot.svelte +0 -39
- package/dist/svelte/components/AwaitSlot.svelte.d.ts +0 -2
- package/dist/svelte/components/Head.svelte +0 -144
- package/dist/svelte/components/Head.svelte.d.ts +0 -2
- package/dist/svelte/components/Image.svelte +0 -164
- package/dist/svelte/components/Image.svelte.d.ts +0 -5
- package/dist/svelte/components/Island.svelte +0 -71
- package/dist/svelte/components/Island.svelte.d.ts +0 -5
- package/dist/svelte/components/JsonLd.svelte +0 -21
- package/dist/svelte/components/JsonLd.svelte.d.ts +0 -2
- package/dist/svelte/components/StreamSlot.svelte +0 -41
- package/dist/svelte/components/StreamSlot.svelte.d.ts +0 -2
- package/dist/svelte/index.js +0 -4371
- package/dist/svelte/index.js.map +0 -60
- package/dist/svelte/router/Link.svelte +0 -124
- package/dist/svelte/router/Link.svelte.d.ts +0 -21
- package/dist/svelte/router/Route.svelte +0 -54
- package/dist/svelte/router/Route.svelte.d.ts +0 -13
- package/dist/svelte/router/Router.svelte +0 -189
- package/dist/svelte/router/Router.svelte.d.ts +0 -16
- package/dist/svelte/router/browser.ts +0 -14
- package/dist/svelte/router/goto.ts +0 -89
- package/dist/svelte/router/hashMode.ts +0 -31
- package/dist/svelte/router/index.ts +0 -23
- package/dist/svelte/router/matchPath.ts +0 -136
- package/dist/svelte/router/page.d.ts +0 -15
- package/dist/svelte/router/page.js +0 -27
- package/dist/svelte/router/prefetchCache.ts +0 -85
- package/dist/svelte/router/pushState.ts +0 -35
- package/dist/svelte/router/viewTransitions.ts +0 -35
- package/dist/svelte/server.js +0 -2996
- package/dist/svelte/server.js.map +0 -33
- package/dist/types/absoluteConfig.d.ts +0 -22
- package/dist/types/angular.d.ts +0 -43
- package/dist/types/build.d.ts +0 -245
- package/dist/types/cli.d.ts +0 -71
- package/dist/types/client.d.ts +0 -70
- package/dist/types/config.d.ts +0 -50
- package/dist/types/conventions.d.ts +0 -26
- package/dist/types/ember.d.ts +0 -39
- package/dist/types/env.d.ts +0 -2
- package/dist/types/eslintConfig.d.ts +0 -68
- package/dist/types/globals.d.ts +0 -163
- package/dist/types/image.d.ts +0 -77
- package/dist/types/index.d.ts +0 -17
- package/dist/types/island.d.ts +0 -52
- package/dist/types/jsonLd.d.ts +0 -300
- package/dist/types/mediaQuery.d.ts +0 -9
- package/dist/types/messages.d.ts +0 -152
- package/dist/types/metadata.d.ts +0 -51
- package/dist/types/packageJson.d.ts +0 -74
- package/dist/types/packageJsonPanel.d.ts +0 -29
- package/dist/types/prettier.d.ts +0 -26
- package/dist/types/react.d.ts +0 -2
- package/dist/types/sitemap.d.ts +0 -24
- package/dist/types/style-module-shim.d.ts +0 -29
- package/dist/types/svelte.d.ts +0 -2
- package/dist/types/svelteRouter.d.ts +0 -65
- package/dist/types/svelteRouter.ts +0 -91
- package/dist/types/telemetry.d.ts +0 -15
- package/dist/types/tool.d.ts +0 -11
- package/dist/types/tsconfig.d.ts +0 -31
- package/dist/types/typeGuards.d.ts +0 -2
- package/dist/types/userAgentTypes.d.ts +0 -2
- package/dist/types/vue.d.ts +0 -56
- package/dist/types/websocket.d.ts +0 -6
- package/dist/vue/browser.js +0 -512
- package/dist/vue/browser.js.map +0 -22
- package/dist/vue/components/Image.js +0 -264
- package/dist/vue/components/Image.js.map +0 -12
- package/dist/vue/components/index.js +0 -571
- package/dist/vue/components/index.js.map +0 -15
- package/dist/vue/index.js +0 -5238
- package/dist/vue/index.js.map +0 -69
- package/dist/vue/server.js +0 -2251
- package/dist/vue/server.js.map +0 -32
package/dist/vue/index.js.map
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/constants.ts", "../src/core/devRouteRegistrationCallsite.ts", "../src/client/streamSwap.ts", "../src/utils/escapeScriptContent.ts", "../src/utils/streamingSlots.ts", "../src/utils/getDurationString.ts", "../src/utils/startupBanner.ts", "../src/utils/logger.ts", "../src/utils/ssrErrorPage.ts", "../src/utils/stringModifiers.ts", "../src/cli/scripts/telemetry.ts", "../src/cli/telemetryEvent.ts", "../src/dev/buildHMRClient.ts", "../src/core/islandManifest.ts", "../src/core/islands.ts", "../src/core/islandMarkupAttributes.ts", "../src/core/currentIslandRegistry.ts", "../src/angular/resolveAngularPackage.ts", "../src/utils/runtimeMode.ts", "../src/angular/angularPatch.ts", "../src/angular/angularDeps.ts", "../src/utils/registerClientScript.ts", "../src/angular/httpTransferCache.ts", "../src/angular/requestProviders.ts", "../src/angular/ssrRender.ts", "../src/angular/islands.ts", "../src/core/islandSsr.ts", "../src/build/nativeRewrite.ts", "../src/build/rewriteImportsPlugin.ts", "../src/core/angularServerModule.ts", "../src/build/resolvePackageImport.ts", "../src/svelte/lowerIslandSyntax.ts", "../src/svelte/lowerAwaitSlotSyntax.ts", "../src/build/stylePreprocessor.ts", "../src/core/svelteServerModule.ts", "../src/core/vueServerModule.ts", "../src/core/renderIslandMarkup.ts", "../src/core/streamingSlotRegistrar.ts", "../src/core/streamingSlotRegistry.ts", "../src/vue/components/Image.ts", "../src/utils/imageClient.ts", "../src/vue/components/SuspenseSlot.ts", "../src/vue/components/StreamSlot.ts", "../src/vue/pageHandler.ts", "../src/utils/inlinePageCss.ts", "../src/utils/spaRouteCss.ts", "../src/core/islandPageContext.ts", "../src/core/responseEnhancers.ts", "../src/core/streamingSlotWarningScope.ts", "../src/utils/resolveConvention.ts", "../src/vue/routerRedirectProviders.ts", "../src/vue/defineVuePage.ts", "../src/vue/Island.ts", "../src/client/preserveIslandMarkup.ts", "../src/core/normalizeIslandProps.ts", "../src/vue/createIsland.ts", "../src/vue/useIslandStore.ts", "../node_modules/zustand/esm/vanilla.mjs", "../node_modules/zustand/esm/middleware.mjs", "../src/client/islandStore.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"export const ANGULAR_INIT_TIMEOUT_MS = 500;\nexport const ANSI_ESCAPE_CODE = 27;\nexport const ANSI_ESCAPE_LENGTH = 3;\nexport const ASCII_SPACE = 32;\nexport const BASE_36_RADIX = 36;\nexport const BUN_BUILD_WARNING_SUPPRESSION =\n\t'wildcard sideEffects are not supported yet';\nexport const BODY_SLICE_LENGTH = 2000;\nexport const BYTES_PER_KILOBYTE = 1024;\nexport const CLI_ARGS_OFFSET = 3;\nexport const CSS_ERROR_RESOLVE_DELAY_MS = 50;\nexport const CSS_MAX_CHECK_ATTEMPTS = 10;\nexport const CSS_MAX_PARSE_TIMEOUT_MS = 500;\nexport const CSS_SHEET_READY_TIMEOUT_MS = 100;\nexport const DEFAULT_CHUNK_SIZE = 16_384;\nexport const DEFAULT_DEBOUNCE_MS = 15;\nexport const DEFAULT_PORT = 3000;\nexport const DEV_SERVER_RESTART_DEBOUNCE_MS = 100;\nexport const DOM_UPDATE_DELAY_MS = 50;\nexport const FILE_PROTOCOL_PREFIX_LENGTH = 7;\nexport const FOCUS_ID_PREFIX_LENGTH = 3;\nexport const FOCUS_IDX_PREFIX_LENGTH = 4;\nexport const FOCUS_NAME_PREFIX_LENGTH = 5;\nexport const ESLINT_STUDIO_DEFAULT_HOST = 'eslint.absolute.localhost';\nexport const ESLINT_STUDIO_DEFAULT_PORT = 4099;\nexport const CONFIG_DEFAULT_HOST = 'config.absolute.localhost';\nexport const CONFIG_DEFAULT_PORT = 4099;\nexport const HMR_UPDATE_TIMEOUT_MS = 2000;\nexport const HOOK_SIGNATURE_LENGTH = 12;\nexport const EXCLUDE_LAST_OFFSET = -1;\nexport const HTTP_STATUS_OK = 200;\nexport const HTTP_STATUS_BAD_REQUEST = 400;\nexport const HTTP_STATUS_NOT_FOUND = 404;\nexport const HOURS_IN_DAY = 24;\nexport const HOURS_IN_HALF_DAY = 12;\nexport const IMAGE_DEFAULT_DEVICE_SIZES = [\n\t640, 750, 828, 1080, 1200, 1920, 2048, 3840\n];\nexport const IMAGE_DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];\nexport const IMAGE_DEFAULT_QUALITY = 75;\nexport const IMAGE_GLOB_SUFFIX_LENGTH = 2;\nexport const INSTANCE_PROBE_TIMEOUT_MS = 250;\nexport const MAX_ERROR_LENGTH = 200;\nexport const MAX_RECONNECT_ATTEMPTS = 60;\nexport const MILLISECONDS_IN_A_SECOND = 1000;\nexport const MINUTES_IN_AN_HOUR = 60;\nexport const SECONDS_IN_A_MINUTE = 60;\nexport const MILLISECONDS_IN_A_MINUTE =\n\tMILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;\nexport const MILLISECONDS_IN_A_DAY =\n\tMILLISECONDS_IN_A_SECOND *\n\tSECONDS_IN_A_MINUTE *\n\tMINUTES_IN_AN_HOUR *\n\tHOURS_IN_DAY;\nexport const OVERLAY_FADE_DURATION_MS = 150;\nexport const PING_INTERVAL_MS = 30_000;\nexport const LIST_LOG_TAIL_MAX_BYTES = 65_536;\nexport const LIST_TUI_COLUMN_GAP = 2;\nexport const LIST_TUI_DEFAULT_HEIGHT = 28;\nexport const LIST_TUI_DEFAULT_WIDTH = 100;\nexport const LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30;\nexport const LIST_TUI_FOOTER_LINE_COUNT = 2;\nexport const LIST_TUI_MARKER_WIDTH = 2;\nexport const LIST_TUI_MIN_LOG_HEIGHT = 3;\nexport const LIST_TUI_MIN_URL_WIDTH = 16;\nexport const LIST_TUI_RENDER_DEBOUNCE_MS = 16;\nexport const LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000;\nexport const LIST_WATCH_REFRESH_MS = 1000;\nexport const RAF_BATCH_COUNT = 3;\nexport const RANDOM_ID_END_INDEX = 11;\nexport const REBUILD_BATCH_DELAY_MS = 10;\nexport const REBUILD_RELOAD_DELAY_MS = 200;\nexport const RECONNECT_INITIAL_DELAY_MS = 500;\nexport const RECONNECT_POLL_INTERVAL_MS = 300;\nexport const REACT_STREAM_SLOT_FAST_DELAY_MS = 5;\nexport const REACT_STREAM_SLOT_SLOW_DELAY_MS = 20;\nexport const SIGINT_EXIT_CODE = 130;\nexport const SIGTERM_EXIT_CODE = 143;\nexport const SVELTE_CSS_LOAD_TIMEOUT_MS = 500;\nexport const TIME_PRECISION = 2;\nexport const TWO_THIRDS = 2 / 3;\nexport const UNFOUND_INDEX = -1;\nexport const WEBSOCKET_NORMAL_CLOSURE = 1000;\nexport const WORKSPACE_COMMAND_ARGS_OFFSET = 3;\nexport const WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30;\nexport const WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60;\nexport const WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5_000;\nexport const WORKSPACE_READY_PROBE_INTERVAL_MS = 250;\nexport const WORKSPACE_READY_TIMEOUT_MS = 30_000;\nexport const WORKSPACE_SHUTDOWN_TIMEOUT_MS = 10_000;\nexport const WORKSPACE_TUI_DEFAULT_HEIGHT = 28;\nexport const WORKSPACE_TUI_DEFAULT_WIDTH = 100;\nexport const WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30;\nexport const WORKSPACE_TUI_FOOTER_LINE_COUNT = 3;\nexport const WORKSPACE_TUI_MIN_LOG_HEIGHT = 3;\nexport const WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7;\nexport const WORKSPACE_TUI_MIN_TARGET_WIDTH = 8;\nexport const WORKSPACE_TUI_MIN_WRAP_WIDTH = 12;\nexport const WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3;\nexport const WORKSPACE_TUI_RECENT_LOG_LIMIT = 40;\nexport const WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16;\nexport const WORKSPACE_TUI_STATUS_WIDTH = 10;\nexport const WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6;\nexport const WORKSPACE_TUI_VISIBILITY_WIDTH = 8;\n",
|
|
6
|
-
"import { AsyncLocalStorage } from 'node:async_hooks';\nimport { Elysia } from 'elysia';\n\ntype RouteCallsiteStore = { callsite?: string };\ntype RouteCallsiteStorage = AsyncLocalStorage<RouteCallsiteStore>;\ntype RouteMethod = (this: unknown, ...args: unknown[]) => unknown;\n\nconst ROUTE_CALLSITE_STORAGE_KEY = Symbol.for(\n\t'absolutejs.devRouteRegistrationCallsiteStorage'\n);\nconst ROUTE_CALLSITE_PATCHED_KEY = Symbol.for(\n\t'absolutejs.devRouteRegistrationCallsitePatched'\n);\n\nconst ROUTE_METHOD_NAMES = [\n\t'all',\n\t'delete',\n\t'get',\n\t'head',\n\t'options',\n\t'patch',\n\t'post',\n\t'put'\n] as const;\n\n// Names of the framework page-request helpers. A GET route whose\n// handler source mentions any of these is treated as a page route by\n// the sitemap generator. Keep in sync with the page handlers exported\n// from each framework's pageHandler module.\nconst PAGE_HANDLER_NAMES = [\n\t'handleReactPageRequest',\n\t'handleSveltePageRequest',\n\t'handleVuePageRequest',\n\t'handleAngularPageRequest',\n\t'handleHTMLPageRequest',\n\t'handleHTMXPageRequest'\n] as const;\n\n/* In dev, the registration patch replaces each handler with a wrapper\n * whose `.toString()` no longer mentions the original page-helper name —\n * which used to break sitemap discovery. We instead peek at the raw\n * handler at registration time (where it still has its real source) and\n * record per-route info keyed by the resulting wrapper here. The\n * sitemap looks up `route.handler` to identify page routes and to read\n * any literal `sitemap: { ... }` block the user passed to a\n * `handle*PageRequest` call. In prod no wrapping happens, so the same\n * helpers fall through to inspecting the raw handler directly. */\ntype PageHandlerInfo = {\n\t/** The unwrapped handler function — its `.toString()` exposes the\n\t * literal `handle*PageRequest({ ... })` call source. */\n\toriginalHandler: (...args: unknown[]) => unknown;\n};\n\nconst pageHandlerWrappers = new WeakMap<\n\t(...args: unknown[]) => unknown,\n\tPageHandlerInfo\n>();\n\nconst handlerSourceMentionsPageHelper = (\n\thandler: (...args: unknown[]) => unknown\n) => {\n\tconst source = handler.toString();\n\n\treturn PAGE_HANDLER_NAMES.some((name) => source.includes(name));\n};\n\nexport const getOriginalPageHandlerSource = (\n\thandler: unknown\n) => {\n\tif (typeof handler !== 'function') return undefined;\n\tconst fn = handler as (...args: unknown[]) => unknown;\n\tconst info = pageHandlerWrappers.get(fn);\n\n\treturn (info?.originalHandler ?? fn).toString();\n};\nexport const isPageHandler = (handler: unknown) => {\n\tif (typeof handler !== 'function') return false;\n\tconst fn = handler as (...args: unknown[]) => unknown;\n\tif (pageHandlerWrappers.has(fn)) return true;\n\n\treturn handlerSourceMentionsPageHelper(fn);\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isAsyncLocalStorage = (value: unknown): value is RouteCallsiteStorage =>\n\tisObjectRecord(value) &&\n\t'getStore' in value &&\n\ttypeof value.getStore === 'function' &&\n\t'run' in value &&\n\ttypeof value.run === 'function';\n\nconst isRouteMethod = (value: unknown): value is RouteMethod =>\n\ttypeof value === 'function';\n\nconst getRouteCallsiteStorage = () => {\n\tconst value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') {\n\t\treturn undefined;\n\t}\n\n\treturn isAsyncLocalStorage(value) ? value : undefined;\n};\n\nconst ensureRouteCallsiteStorage = () => {\n\tconst existing = getRouteCallsiteStorage();\n\tif (existing) {\n\t\treturn existing;\n\t}\n\n\tconst storage = new AsyncLocalStorage<RouteCallsiteStore>();\n\tReflect.set(globalThis, ROUTE_CALLSITE_STORAGE_KEY, storage);\n\n\treturn storage;\n};\n\nconst normalizeCallsitePath = (value: string) =>\n\tvalue\n\t\t.replace(`${process.cwd()}/`, '')\n\t\t.replace(process.cwd(), '')\n\t\t.replace(/^\\.\\/+/, '');\n\nconst shouldIgnoreRouteCallsiteFrame = (frame: string) =>\n\tframe.includes('/node_modules/') ||\n\tframe.includes('/dist/') ||\n\tframe.includes('/src/core/devRouteRegistrationCallsite.');\n\nconst getRouteCallsiteLocation = (frame: string) =>\n\tframe.match(/\\((\\/[^)]+:\\d+:\\d+)\\)$/)?.[1] ??\n\tframe.match(/at (\\/[^ ]+:\\d+:\\d+)$/)?.[1];\n\nconst extractRouteRegistrationCallsite = (stack: string) => {\n\tconst location = stack\n\t\t.split('\\n')\n\t\t.slice(1)\n\t\t.map((line) => line.trim())\n\t\t.filter((frame) => !shouldIgnoreRouteCallsiteFrame(frame))\n\t\t.map((frame) => getRouteCallsiteLocation(frame))\n\t\t.find((frameLocation) => frameLocation !== undefined);\n\n\treturn location ? normalizeCallsitePath(location) : undefined;\n};\n\nconst captureRouteRegistrationCallsite = () => {\n\tconst { stack } = new Error();\n\tif (!stack) {\n\t\treturn undefined;\n\t}\n\n\treturn extractRouteRegistrationCallsite(stack);\n};\n\nconst wrapRouteHandlerWithCallsite = (handler: unknown, callsite?: string) => {\n\tif (typeof handler !== 'function' || !callsite) {\n\t\treturn handler;\n\t}\n\n\tconst storage = ensureRouteCallsiteStorage();\n\tconst routeHandler = handler;\n\n\treturn function wrappedRouteHandler(this: unknown, ...args: unknown[]) {\n\t\treturn storage.run({ callsite }, () =>\n\t\t\tReflect.apply(routeHandler, this, args)\n\t\t);\n\t};\n};\n\nconst createPatchedRouteMethod = (\n\toriginalMethod: RouteMethod,\n\tmethodName: string\n) =>\n\tfunction patchedRouteMethod(\n\t\tthis: unknown,\n\t\tpath: unknown,\n\t\thandler: unknown,\n\t\t...rest: unknown[]\n\t) {\n\t\tconst callsite = captureRouteRegistrationCallsite();\n\t\tconst wrapped = wrapRouteHandlerWithCallsite(handler, callsite);\n\n\t\t/* Record page-route registrations now, while the raw handler\n\t\t * still exposes its real source. After this point the wrapper\n\t\t * replaces it and `.toString()` no longer mentions the\n\t\t * `handle*PageRequest` helper, so the sitemap can't discover\n\t\t * the route by inspection. The wrapper itself goes into the\n\t\t * `pageHandlerWrappers` map keyed by reference, with the\n\t\t * original handler kept alive for later `.toString()` reads\n\t\t * (used to extract literal `sitemap: { ... }` metadata). */\n\t\tif (\n\t\t\tmethodName === 'get' &&\n\t\t\ttypeof handler === 'function' &&\n\t\t\ttypeof wrapped === 'function' &&\n\t\t\thandlerSourceMentionsPageHelper(\n\t\t\t\thandler as (...args: unknown[]) => unknown\n\t\t\t)\n\t\t) {\n\t\t\tpageHandlerWrappers.set(\n\t\t\t\twrapped as (...args: unknown[]) => unknown,\n\t\t\t\t{\n\t\t\t\t\toriginalHandler: handler as (...args: unknown[]) => unknown\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn Reflect.apply(originalMethod, this, [path, wrapped, ...rest]);\n\t};\n\nexport const getCurrentRouteRegistrationCallsite = () =>\n\tgetRouteCallsiteStorage()?.getStore()?.callsite;\nexport const patchElysiaRouteRegistrationCallsites = () => {\n\tif (process.env.NODE_ENV === 'production') {\n\t\treturn;\n\t}\n\n\tif (Reflect.get(globalThis, ROUTE_CALLSITE_PATCHED_KEY) === true) {\n\t\treturn;\n\t}\n\n\tconst { prototype } = Elysia;\n\tROUTE_METHOD_NAMES.forEach((methodName) => {\n\t\tconst originalMethod = Reflect.get(prototype, methodName);\n\t\tif (!isRouteMethod(originalMethod)) return;\n\t\tReflect.set(\n\t\t\tprototype,\n\t\t\tmethodName,\n\t\t\tcreatePatchedRouteMethod(originalMethod, methodName)\n\t\t);\n\t});\n\n\tReflect.set(globalThis, ROUTE_CALLSITE_PATCHED_KEY, true);\n};\n",
|
|
7
|
-
"type AbsoluteSlotWindow = Window & {\n\t__ABS_SLOT_ENQUEUE__?: (id: string, payload: unknown) => void;\n\t__ABS_SLOT_FLUSH__?: () => void;\n\t__ABS_SLOT_CONSUMERS__?: Record<\n\t\tstring,\n\t\t((payload: unknown) => boolean | void) | undefined\n\t>;\n\t__ABS_SLOT_HYDRATION_PENDING__?: boolean;\n\t__ABS_SLOT_PENDING__?: Record<string, unknown>;\n\t__ABS_SLOT_RUNTIME__?: boolean;\n};\n\nconst streamSwapRuntime = () => {\n\tconst absoluteWindow: AbsoluteSlotWindow = window;\n\tconst SLOT_PATCH_EVENT = 'absolutejs:slot-patch';\n\tif (absoluteWindow.__ABS_SLOT_RUNTIME__ === true) return;\n\tabsoluteWindow.__ABS_SLOT_RUNTIME__ = true;\n\tabsoluteWindow.__ABS_SLOT_CONSUMERS__ =\n\t\tabsoluteWindow.__ABS_SLOT_CONSUMERS__ ?? {};\n\tabsoluteWindow.__ABS_SLOT_PENDING__ =\n\t\tabsoluteWindow.__ABS_SLOT_PENDING__ ?? {};\n\tconst consumers = absoluteWindow.__ABS_SLOT_CONSUMERS__;\n\tconst pending = absoluteWindow.__ABS_SLOT_PENDING__;\n\tconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\t\tBoolean(value) && typeof value === 'object';\n\tconst isPatchedPendingEntry = (\n\t\tvalue: unknown\n\t): value is {\n\t\tdomPatched: true;\n\t\tpayload: unknown;\n\t} => {\n\t\tif (!isObjectRecord(value)) return false;\n\n\t\treturn value.domPatched === true && 'payload' in value;\n\t};\n\tconst unwrapPendingPayload = (value: unknown) =>\n\t\tisPatchedPendingEntry(value) ? value.payload : value;\n\tconst canApplyImmediately = () =>\n\t\tabsoluteWindow.__ABS_SLOT_HYDRATION_PENDING__ !== true;\n\tconst isAngularDeferPayload = (payload: unknown) => {\n\t\tif (!isObjectRecord(payload)) return false;\n\n\t\treturn payload.kind === 'angular-defer';\n\t};\n\tconst isVueSuspensePayload = (payload: unknown) => {\n\t\tif (!isObjectRecord(payload)) return false;\n\n\t\treturn payload.kind === 'vue-suspense';\n\t};\n\tconst resolveHtml = (payload: unknown) => {\n\t\tif (!isObjectRecord(payload)) {\n\t\t\treturn typeof payload === 'string' ? payload : '';\n\t\t}\n\t\tif (typeof payload.html === 'string') {\n\t\t\treturn payload.html;\n\t\t}\n\n\t\treturn '';\n\t};\n\n\tconst apply = (id: string, pendingEntry: unknown) => {\n\t\tconst payload = unwrapPendingPayload(pendingEntry);\n\t\tif (!canApplyImmediately()) {\n\t\t\tpending[id] = payload;\n\n\t\t\treturn;\n\t\t}\n\t\tconst consumer = consumers[id];\n\t\tif (typeof consumer !== 'function') {\n\t\t\tapplyToDom(id, payload, pendingEntry);\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst handled = consumer(payload);\n\t\tif (handled !== false) {\n\t\t\tdelete pending[id];\n\n\t\t\treturn;\n\t\t}\n\n\t\tapplyToDom(id, payload, pendingEntry);\n\t};\n\tconst applyToDom = (\n\t\tid: string,\n\t\tpayload: unknown,\n\t\tpendingEntry: unknown\n\t) => {\n\t\tif (isAngularDeferPayload(payload)) {\n\t\t\tpending[id] = payload;\n\n\t\t\treturn;\n\t\t}\n\t\tconst node = document.getElementById(id);\n\t\tif (!node) {\n\t\t\tpending[id] = payload;\n\n\t\t\treturn;\n\t\t}\n\t\tconst html = resolveHtml(payload);\n\t\tif (\n\t\t\tisVueSuspensePayload(payload) &&\n\t\t\tisPatchedPendingEntry(pendingEntry)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tnode.innerHTML = html;\n\t\tnode.setAttribute('data-absolute-slot-state', 'resolved');\n\t\twindow.dispatchEvent(\n\t\t\tnew CustomEvent(SLOT_PATCH_EVENT, {\n\t\t\t\tdetail: { html, id, payload }\n\t\t\t})\n\t\t);\n\t\tif (isVueSuspensePayload(payload)) {\n\t\t\tpending[id] = { domPatched: true, payload };\n\n\t\t\treturn;\n\t\t}\n\t\tdelete pending[id];\n\t};\n\n\tconst flush = () => {\n\t\tfor (const id in pending) {\n\t\t\tif (!Object.prototype.hasOwnProperty.call(pending, id)) continue;\n\t\t\tapply(id, pending[id] ?? '');\n\t\t}\n\t};\n\n\tabsoluteWindow.__ABS_SLOT_FLUSH__ = flush;\n\tabsoluteWindow.__ABS_SLOT_ENQUEUE__ = (id: string, payload: unknown) => {\n\t\tapply(id, payload);\n\t};\n\n\tif (typeof MutationObserver === 'function') {\n\t\tconst observer = new MutationObserver(flush);\n\t\tconst root = document.documentElement ?? document.body ?? document;\n\t\tobserver.observe(root, { childList: true, subtree: true });\n\t}\n\n\tif (document.readyState === 'loading') {\n\t\tdocument.addEventListener('DOMContentLoaded', flush, { once: true });\n\t}\n\tflush();\n};\n\nconst stripFunctionWrapper = (value: string) => {\n\tconst start = value.indexOf('{');\n\tconst end = value.lastIndexOf('}');\n\tif (start < 0 || end <= start) return '';\n\n\treturn value.slice(start + 1, end);\n};\n\nexport const getStreamSwapRuntimeScript = () =>\n\t`(function(){${stripFunctionWrapper(streamSwapRuntime.toString())}})();`;\n",
|
|
8
|
-
"const ESCAPE_LOOKUP: Record<string, string> = {\n\t'\\u2028': '\\\\u2028',\n\t'\\u2029': '\\\\u2029',\n\t'<': '\\\\u003C'\n};\n\nconst ESCAPE_REGEX = /[<\\u2028\\u2029]/g;\n\nexport const escapeScriptContent = (content: string) =>\n\tcontent.replace(ESCAPE_REGEX, (char) => {\n\t\tconst escaped = ESCAPE_LOOKUP[char];\n\n\t\treturn escaped !== undefined ? escaped : char;\n\t});\n",
|
|
9
|
-
"import { getStreamSwapRuntimeScript } from '../client/streamSwap';\nimport { BASE_36_RADIX, RANDOM_ID_END_INDEX } from '../constants';\nimport { escapeScriptContent } from './escapeScriptContent';\n\nconst SLOT_ID_PREFIX = 'abs-slot-';\nconst CLOSING_BODY_TAG = '</body>';\nconst CLOSING_HEAD_TAG = '</head>';\nconst CLOSING_BODY_TAG_LENGTH = CLOSING_BODY_TAG.length;\nconst CLOSING_HEAD_TAG_LENGTH = CLOSING_HEAD_TAG.length;\nconst CLOSING_PAGE_TAG_REGEX = /<\\/body>\\s*<\\/html>\\s*$/i;\nconst STREAMING_RUNTIME_GLOBAL = '__ABS_SLOT_ENQUEUE__';\nconst STREAMING_PENDING_GLOBAL = '__ABS_SLOT_PENDING__';\nconst STREAM_TAIL_LOOKBEHIND = 128;\nconst STREAMING_SLOT_TIMEOUT_MS = 5_000;\nconst STREAMING_SLOT_MAX_PER_RESPONSE = 128;\nconst STREAMING_SLOT_MAX_HTML_BYTES = 64_000;\n\ntype SlotResolver = () => Promise<unknown> | unknown;\ntype SlotErrorHandler = (error: unknown, slot: StreamingSlot) => void;\ntype StreamReader = ReadableStreamDefaultReader<string | Uint8Array>;\ntype StreamReadPromise = ReturnType<StreamReader['read']>;\nexport type StreamingSlotMetricType =\n\t| 'prepared'\n\t| 'dropped'\n\t| 'resolved'\n\t| 'patched'\n\t| 'timeout'\n\t| 'size_exceeded'\n\t| 'error';\nexport type StreamingSlotMetric = {\n\ttype: StreamingSlotMetricType;\n\tslotId: string;\n\tdurationMs?: number;\n\tbytes?: number;\n\treason?: string;\n\terror?: unknown;\n};\nexport type StreamingSlotMetricHandler = (metric: StreamingSlotMetric) => void;\n\nexport type StreamingSlotPolicy = {\n\ttimeoutMs?: number;\n\tfallbackHtml?: unknown;\n\terrorHtml?: unknown;\n\tmaxSlotsPerResponse?: number;\n\tmaxSlotHtmlSizeBytes?: number;\n\tonError?: SlotErrorHandler;\n\tonSlotMetric?: StreamingSlotMetricHandler;\n};\n\ntype StreamingSlotPolicyValue = {\n\ttimeoutMs: number;\n\tfallbackHtml: string;\n\terrorHtml?: string;\n\tmaxSlotsPerResponse: number;\n\tmaxSlotHtmlSizeBytes: number;\n\tonError?: SlotErrorHandler;\n\tonSlotMetric?: StreamingSlotMetricHandler;\n};\n\nexport type StreamingSlot = {\n\terrorHtml?: unknown;\n\tfallbackHtml?: unknown;\n\tid: string;\n\ttimeoutMs?: number;\n\tresolve: SlotResolver;\n};\n\nexport type StreamingSlotPatchPayload =\n\t| string\n\t| {\n\t\t\t[key: string]: unknown;\n\t\t\thtml: string;\n\t };\n\ntype DeferredStreamingSlot = Omit<StreamingSlot, 'id'> & { id?: string };\n\nexport type AppendStreamingSlotsOptions = {\n\tinjectRuntime?: boolean;\n\tnonce?: string;\n\truntimePreludeScript?: string;\n\tpolicy?: StreamingSlotPolicy;\n\tonSlotMetric?: StreamingSlotMetricHandler;\n\tonError?: (error: unknown, slot: StreamingSlot) => void;\n\truntimePlacement?: 'body' | 'head';\n};\n\nexport type StreamOutOfOrderSlotsOptions = {\n\tfooterHtml?: string;\n\theaderHtml?: string;\n\tnonce?: string;\n\tpolicy?: StreamingSlotPolicy;\n\tonSlotMetric?: StreamingSlotMetricHandler;\n\tonError?: (error: unknown, slot: StreamingSlot) => void;\n\tslots: DeferredStreamingSlot[];\n};\n\nconst createSlotPatchStatement = (\n\tid: string,\n\tpayload: StreamingSlotPatchPayload\n) =>\n\t`(window.${STREAMING_RUNTIME_GLOBAL}||function(i,p){window.${STREAMING_PENDING_GLOBAL}=window.${STREAMING_PENDING_GLOBAL}||{};window.${STREAMING_PENDING_GLOBAL}[i]=p;})(${JSON.stringify(id)},${JSON.stringify(payload)});`;\n\nconst createNonceAttr = (nonce?: string) => (nonce ? ` nonce=\"${nonce}\"` : '');\n\nexport const createStreamingSlotId = () =>\n\t`${SLOT_ID_PREFIX}${Math.random().toString(BASE_36_RADIX).slice(2, RANDOM_ID_END_INDEX)}`;\nexport const getStreamingSlotsRuntimeScript = () =>\n\tgetStreamSwapRuntimeScript();\nexport const injectHtmlIntoBody = (html: string, injection: string) => {\n\tconst closingBodyIndex = html.indexOf(CLOSING_BODY_TAG);\n\tif (closingBodyIndex >= 0) {\n\t\treturn `${html.slice(0, closingBodyIndex)}${injection}${html.slice(closingBodyIndex)}`;\n\t}\n\n\treturn `${html}${injection}`;\n};\nexport const injectHtmlIntoHead = (html: string, injection: string) => {\n\tconst closingHeadIndex = html.indexOf(CLOSING_HEAD_TAG);\n\tif (closingHeadIndex >= 0) {\n\t\treturn `${html.slice(0, closingHeadIndex)}${injection}${html.slice(closingHeadIndex)}`;\n\t}\n\n\treturn `${html}${injection}`;\n};\nexport const renderStreamingSlotPatchTag = (\n\tid: string,\n\tpayload: StreamingSlotPatchPayload,\n\tnonce?: string\n) =>\n\t`<script${createNonceAttr(nonce)}>${escapeScriptContent(\n\t\tcreateSlotPatchStatement(id, payload)\n\t)}</script>`;\nexport const renderStreamingSlotPlaceholder = (id: string, fallbackHtml = '') =>\n\t`<div id=\"${id}\" data-absolute-slot=\"true\" data-absolute-slot-state=\"fallback\">${fallbackHtml}</div>`;\nexport const renderStreamingSlotsRuntimeTag = (\n\tnonce?: string,\n\truntimePreludeScript?: string\n) => {\n\tconst runtimeBody = [\n\t\truntimePreludeScript?.trim() ? runtimePreludeScript.trim() : '',\n\t\tgetStreamingSlotsRuntimeScript()\n\t]\n\t\t.filter(Boolean)\n\t\t.join(';');\n\n\treturn `<script${createNonceAttr(nonce)}>${escapeScriptContent(runtimeBody)}</script>`;\n};\n\nconst toUint8 = (value: string, encoder: TextEncoder) => encoder.encode(value);\n\ntype SafeHtmlLike = {\n\tchangingThisBreaksApplicationSecurity: string;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isSafeHtmlLike = (value: unknown): value is SafeHtmlLike =>\n\tisRecord(value) &&\n\ttypeof value.changingThisBreaksApplicationSecurity === 'string';\n\nconst normalizeSafeHtml = (value: unknown) => {\n\tif (isSafeHtmlLike(value)) {\n\t\treturn value.changingThisBreaksApplicationSecurity;\n\t}\n\n\treturn value;\n};\n\nlet currentStreamingSlotPolicy: StreamingSlotPolicyValue = {\n\terrorHtml: undefined,\n\tfallbackHtml: '',\n\tmaxSlotHtmlSizeBytes: STREAMING_SLOT_MAX_HTML_BYTES,\n\tmaxSlotsPerResponse: STREAMING_SLOT_MAX_PER_RESPONSE,\n\ttimeoutMs: STREAMING_SLOT_TIMEOUT_MS\n};\n\nconst clonePolicy = (\n\tpolicy: StreamingSlotPolicyValue\n): StreamingSlotPolicyValue => ({\n\t...policy\n});\n\nconst normalizeSlotBytes = (value: unknown, fallback: number) => {\n\tif (typeof value === 'number' && Number.isFinite(value) && value >= 0) {\n\t\treturn Math.floor(value);\n\t}\n\n\treturn fallback;\n};\n\nconst normalizeSlotText = (value: unknown, fallback: string) => {\n\tconst normalizedValue = normalizeSafeHtml(value);\n\n\treturn typeof normalizedValue === 'string' ? normalizedValue : fallback;\n};\nconst normalizeSlotError = (\n\tvalue: unknown,\n\tfallback: string | undefined = undefined\n) => {\n\tconst safeValue = normalizeSafeHtml(value);\n\tif (typeof safeValue === 'string') return safeValue;\n\n\treturn fallback;\n};\nconst hasPolicyValue = (\n\tpolicy: StreamingSlotPolicy,\n\tkey: keyof StreamingSlotPolicy\n) => Object.prototype.hasOwnProperty.call(policy, key);\n\nconst applyStreamingSlotPolicyOverrides = (\n\tbase: StreamingSlotPolicyValue,\n\toverridePolicy: StreamingSlotPolicy = {}\n) => ({\n\terrorHtml: hasPolicyValue(overridePolicy, 'errorHtml')\n\t\t? normalizeSlotError(overridePolicy.errorHtml)\n\t\t: base.errorHtml,\n\tfallbackHtml: hasPolicyValue(overridePolicy, 'fallbackHtml')\n\t\t? normalizeSlotText(overridePolicy.fallbackHtml, '')\n\t\t: base.fallbackHtml,\n\tmaxSlotHtmlSizeBytes: hasPolicyValue(overridePolicy, 'maxSlotHtmlSizeBytes')\n\t\t? normalizeSlotBytes(\n\t\t\t\toverridePolicy.maxSlotHtmlSizeBytes,\n\t\t\t\tbase.maxSlotHtmlSizeBytes\n\t\t\t)\n\t\t: base.maxSlotHtmlSizeBytes,\n\tmaxSlotsPerResponse: hasPolicyValue(overridePolicy, 'maxSlotsPerResponse')\n\t\t? normalizeSlotBytes(\n\t\t\t\toverridePolicy.maxSlotsPerResponse,\n\t\t\t\tbase.maxSlotsPerResponse\n\t\t\t)\n\t\t: base.maxSlotsPerResponse,\n\tonError: hasPolicyValue(overridePolicy, 'onError')\n\t\t? overridePolicy.onError\n\t\t: base.onError,\n\tonSlotMetric: hasPolicyValue(overridePolicy, 'onSlotMetric')\n\t\t? overridePolicy.onSlotMetric\n\t\t: base.onSlotMetric,\n\ttimeoutMs: hasPolicyValue(overridePolicy, 'timeoutMs')\n\t\t? normalizeSlotBytes(overridePolicy.timeoutMs, base.timeoutMs)\n\t\t: base.timeoutMs\n});\n\nconst createCombinedSlotErrorHandler = (\n\tpolicyOnError?: SlotErrorHandler,\n\tenhancerOnError?: SlotErrorHandler\n) => {\n\tif (!policyOnError && !enhancerOnError) return undefined;\n\n\treturn (error: unknown, slot: StreamingSlot) => {\n\t\tpolicyOnError?.(error, slot);\n\t\tenhancerOnError?.(error, slot);\n\t};\n};\n\nconst createCombinedSlotMetricHandler = (\n\tpolicyOnSlotMetric?: StreamingSlotMetricHandler,\n\tcallOnSlotMetric?: StreamingSlotMetricHandler\n) => {\n\tif (!policyOnSlotMetric && !callOnSlotMetric) return undefined;\n\n\treturn (metric: StreamingSlotMetric) => {\n\t\tpolicyOnSlotMetric?.(metric);\n\t\tcallOnSlotMetric?.(metric);\n\t};\n};\n\nconst resolveStreamingSlotPolicy = (\n\toverridePolicy: StreamingSlotPolicy = {}\n) => {\n\tconst base = getStreamingSlotPolicy();\n\n\treturn applyStreamingSlotPolicyOverrides(base, overridePolicy);\n};\n\nexport const getStreamingSlotPolicy = () =>\n\tclonePolicy(currentStreamingSlotPolicy);\n\nexport const setStreamingSlotPolicy = (policy: StreamingSlotPolicy = {}) => {\n\tconst base = getStreamingSlotPolicy();\n\n\tcurrentStreamingSlotPolicy = applyStreamingSlotPolicyOverrides(\n\t\tbase,\n\t\tpolicy\n\t);\n};\n\nexport const withStreamingSlotPolicy = async <T>(\n\tpolicy: StreamingSlotPolicy,\n\tcallback: () => Promise<T> | T\n) => {\n\tconst previous = getStreamingSlotPolicy();\n\n\tsetStreamingSlotPolicy(policy);\n\ttry {\n\t\treturn await callback();\n\t} finally {\n\t\tcurrentStreamingSlotPolicy = previous;\n\t}\n};\n\nconst emitSlotMetric = (\n\tmetric: StreamingSlotMetric,\n\tonSlotMetric?: StreamingSlotMetricHandler\n) => {\n\tonSlotMetric?.(metric);\n};\n\nconst createTimeoutError = (slot: StreamingSlot, timeoutMs: number) => {\n\tconst error = Object.assign(\n\t\tnew Error(`Streaming slot \"${slot.id}\" timed out after ${timeoutMs}ms`),\n\t\t{ __absTimeout: true }\n\t);\n\n\treturn error;\n};\n\nconst isSlotPatchPayloadObject = (\n\tvalue: unknown\n): value is Record<string, unknown> & { html: unknown } =>\n\tisRecord(value) && 'html' in value;\n\nconst isTimeoutError = (\n\terror: unknown\n): error is Error & { __absTimeout: true } =>\n\tisRecord(error) && error.__absTimeout === true;\n\nconst toStreamingSlot = (\n\tslot: DeferredStreamingSlot,\n\tpolicy: StreamingSlotPolicyValue\n): StreamingSlot => ({\n\terrorHtml: slot.errorHtml === undefined ? policy.errorHtml : slot.errorHtml,\n\tfallbackHtml: normalizeSlotText(slot.fallbackHtml, policy.fallbackHtml),\n\tid: slot.id ?? createStreamingSlotId(),\n\tresolve: slot.resolve,\n\ttimeoutMs: normalizeSlotBytes(slot.timeoutMs, policy.timeoutMs)\n});\n\nconst prepareSlots = ({\n\tpolicy,\n\tslots,\n\tonError,\n\tonSlotMetric\n}: {\n\tpolicy: StreamingSlotPolicyValue;\n\tslots: DeferredStreamingSlot[];\n\tonError?: SlotErrorHandler;\n\tonSlotMetric?: StreamingSlotMetricHandler;\n}) => {\n\tconst preparedSlots = slots.map((slot) => toStreamingSlot(slot, policy));\n\tconst emitPreparedSlotMetric = (slot: StreamingSlot) => {\n\t\temitSlotMetric(\n\t\t\t{\n\t\t\t\tslotId: slot.id,\n\t\t\t\ttype: 'prepared'\n\t\t\t},\n\t\t\tonSlotMetric\n\t\t);\n\t};\n\tconst dropPreparedSlot = (slot: StreamingSlot, reason: string) => {\n\t\tonError?.(new Error(reason), slot);\n\t\temitSlotMetric(\n\t\t\t{\n\t\t\t\treason,\n\t\t\t\tslotId: slot.id,\n\t\t\t\ttype: 'dropped'\n\t\t\t},\n\t\t\tonSlotMetric\n\t\t);\n\t};\n\n\tconst { maxSlotsPerResponse } = policy;\n\tif (maxSlotsPerResponse === 0) {\n\t\tpreparedSlots.forEach((slot) =>\n\t\t\tdropPreparedSlot(slot, 'maxSlotsPerResponse is 0')\n\t\t);\n\n\t\treturn [];\n\t}\n\n\tif (preparedSlots.length <= maxSlotsPerResponse) {\n\t\tpreparedSlots.forEach(emitPreparedSlotMetric);\n\n\t\treturn preparedSlots;\n\t}\n\n\tconst keptSlots = preparedSlots.slice(0, maxSlotsPerResponse);\n\tconst droppedSlots = preparedSlots.slice(maxSlotsPerResponse);\n\tdroppedSlots.forEach((slot) => {\n\t\tdropPreparedSlot(\n\t\t\tslot,\n\t\t\t`Streaming slot \"${slot.id}\" dropped because ${maxSlotsPerResponse} slots is the configured maximum`\n\t\t);\n\t});\n\tkeptSlots.forEach(emitPreparedSlotMetric);\n\n\treturn keptSlots;\n};\n\nconst htmlByteLength = (value: string, encoder: TextEncoder) =>\n\tencoder.encode(value).length;\n\ntype ResolvedStreamingSlot = {\n\tpayload: StreamingSlotPatchPayload | null;\n\tid: string;\n\tdurationMs: number;\n\tbytes: number;\n};\n\nconst normalizeSlotPatchPayload = (value: unknown) => {\n\tconst safeValue = normalizeSafeHtml(value);\n\tif (\n\t\tisSlotPatchPayloadObject(safeValue) &&\n\t\ttypeof safeValue.html === 'string'\n\t) {\n\t\treturn {\n\t\t\t...safeValue,\n\t\t\thtml: normalizeSlotText(safeValue.html, '')\n\t\t};\n\t}\n\n\treturn typeof safeValue === 'string' ? safeValue : `${safeValue}`;\n};\n\nconst getPayloadHtml = (payload: StreamingSlotPatchPayload) =>\n\ttypeof payload === 'string' ? payload : payload.html;\n\nconst enqueueEncodedText = (\n\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\tencoder: TextEncoder,\n\tvalue: string\n) => {\n\tif (value.length === 0) {\n\t\treturn;\n\t}\n\n\tcontroller.enqueue(encoder.encode(value));\n};\n\nconst readStreamingRuntimeChunk = async (\n\treader: ReadableStreamDefaultReader<string | Uint8Array>\n) => {\n\tconst { done, value } = await reader.read();\n\tif (done || !value) {\n\t\treturn { done, value: undefined };\n\t}\n\n\treturn { done, value };\n};\n\nconst applyBaseWinnerState = (\n\tstate: {\n\t\tbaseDone: boolean;\n\t\tbaseRead: StreamReadPromise;\n\t\tfooter: string;\n\t\thandled: boolean;\n\t\ttail: string;\n\t},\n\twinner:\n\t\t| {\n\t\t\t\tdone: boolean;\n\t\t\t\tkind: 'base';\n\t\t\t\tvalue?: string | Uint8Array;\n\t\t }\n\t\t| {\n\t\t\t\tkind: 'slot';\n\t\t\t\toriginal: Promise<{\n\t\t\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\t\t\tid: string;\n\t\t\t\t\tdurationMs: number;\n\t\t\t\t\tbytes: number;\n\t\t\t\t}>;\n\t\t\t\tresult: {\n\t\t\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\t\t\tid: string;\n\t\t\t\t\tdurationMs: number;\n\t\t\t\t\tbytes: number;\n\t\t\t\t};\n\t\t },\n\thandleResolved: (winner: {\n\t\tkind: 'slot';\n\t\toriginal: Promise<{\n\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\tid: string;\n\t\t\tdurationMs: number;\n\t\t\tbytes: number;\n\t\t}>;\n\t\tresult: {\n\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\tid: string;\n\t\t\tdurationMs: number;\n\t\t\tbytes: number;\n\t\t};\n\t}) => void\n) => {\n\tif (!state.handled && winner.kind === 'slot') {\n\t\thandleResolved(winner);\n\t}\n\n\treturn state;\n};\n\nconst resolveOversizedSlotPayload = (input: {\n\tencoder: TextEncoder;\n\thtml: string;\n\tmaxSlotHtmlSizeBytes: number;\n\tonError?: SlotErrorHandler;\n\tonSlotMetric?: StreamingSlotMetricHandler;\n\tslot: StreamingSlot;\n\tstart: number;\n}) => {\n\tconst {\n\t\tencoder,\n\t\thtml,\n\t\tmaxSlotHtmlSizeBytes,\n\t\tonError,\n\t\tonSlotMetric,\n\t\tslot,\n\t\tstart\n\t} = input;\n\tconst bytes = htmlByteLength(html, encoder);\n\tif (bytes <= maxSlotHtmlSizeBytes) {\n\t\treturn null;\n\t}\n\n\tconst error = new Error(\n\t\t`Streaming slot \"${slot.id}\" exceeded max payload size of ${maxSlotHtmlSizeBytes} bytes`\n\t);\n\tconst durationMs = Date.now() - start;\n\tonError?.(error, slot);\n\temitSlotMetric(\n\t\t{\n\t\t\tbytes,\n\t\t\tdurationMs,\n\t\t\terror,\n\t\t\tslotId: slot.id,\n\t\t\ttype: 'size_exceeded'\n\t\t},\n\t\tonSlotMetric\n\t);\n\n\tconst fallbackHtml = normalizeSlotError(slot.errorHtml, undefined);\n\n\treturn {\n\t\tbytes:\n\t\t\tfallbackHtml === undefined\n\t\t\t\t? 0\n\t\t\t\t: htmlByteLength(fallbackHtml, encoder),\n\t\tdurationMs,\n\t\tid: slot.id,\n\t\tpayload: fallbackHtml === undefined ? null : fallbackHtml\n\t};\n};\n\nconst raceWithTimeout = (promise: Promise<unknown>, slot: StreamingSlot) => {\n\tconst { timeoutMs } = slot;\n\tif (typeof timeoutMs !== 'number' || timeoutMs <= 0) {\n\t\treturn promise;\n\t}\n\n\tconst { promise: timeoutPromise, reject } =\n\t\tPromise.withResolvers<StreamingSlotPatchPayload>();\n\n\tsetTimeout(() => {\n\t\treject(createTimeoutError(slot, timeoutMs));\n\t}, timeoutMs);\n\n\treturn Promise.race([promise, timeoutPromise]);\n};\n\nconst resolveSlot = async (\n\tslot: StreamingSlot,\n\tonError?: SlotErrorHandler,\n\tpolicy?: StreamingSlotPolicyValue,\n\tonSlotMetric?: StreamingSlotMetricHandler\n) => {\n\tconst safePolicy = policy ?? getStreamingSlotPolicy();\n\tconst encoder = new TextEncoder();\n\tconst start = Date.now();\n\ttry {\n\t\tconst maybeAsyncValue = Promise.resolve(slot.resolve());\n\t\tconst resolved = await raceWithTimeout(maybeAsyncValue, slot);\n\t\tconst payload = normalizeSlotPatchPayload(resolved);\n\t\tconst html = getPayloadHtml(payload);\n\t\tconst oversizedResult =\n\t\t\tsafePolicy.maxSlotHtmlSizeBytes > 0\n\t\t\t\t? resolveOversizedSlotPayload({\n\t\t\t\t\t\tencoder,\n\t\t\t\t\t\thtml,\n\t\t\t\t\t\tmaxSlotHtmlSizeBytes: safePolicy.maxSlotHtmlSizeBytes,\n\t\t\t\t\t\tonError,\n\t\t\t\t\t\tonSlotMetric,\n\t\t\t\t\t\tslot,\n\t\t\t\t\t\tstart\n\t\t\t\t\t})\n\t\t\t\t: null;\n\t\tif (oversizedResult) {\n\t\t\treturn oversizedResult;\n\t\t}\n\t\tconst durationMs = Date.now() - start;\n\t\tconst bytes = htmlByteLength(html, encoder);\n\t\temitSlotMetric(\n\t\t\t{\n\t\t\t\tbytes,\n\t\t\t\tdurationMs,\n\t\t\t\tslotId: slot.id,\n\t\t\t\ttype: 'resolved'\n\t\t\t},\n\t\t\tonSlotMetric\n\t\t);\n\n\t\treturn {\n\t\t\tbytes,\n\t\t\tdurationMs,\n\t\t\tid: slot.id,\n\t\t\tpayload\n\t\t};\n\t} catch (error) {\n\t\tconst durationMs = Date.now() - start;\n\t\tonError?.(error, slot);\n\t\temitSlotMetric(\n\t\t\t{\n\t\t\t\tdurationMs,\n\t\t\t\terror,\n\t\t\t\tslotId: slot.id,\n\t\t\t\ttype: isTimeoutError(error) ? 'timeout' : 'error'\n\t\t\t},\n\t\t\tonSlotMetric\n\t\t);\n\t\tconst html = normalizeSlotError(slot.errorHtml, undefined);\n\t\tif (html) {\n\t\t\treturn {\n\t\t\t\tbytes: htmlByteLength(html, encoder),\n\t\t\t\tdurationMs,\n\t\t\t\tid: slot.id,\n\t\t\t\tpayload: html\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tbytes: 0,\n\t\t\tdurationMs,\n\t\t\tid: slot.id,\n\t\t\tpayload: null\n\t\t};\n\t}\n};\n\nconst nextResolvedSlot = async (\n\tpending: Array<Promise<ResolvedStreamingSlot>>\n) => {\n\tconst wrapped = pending.map((promise) =>\n\t\tpromise.then((result) => ({\n\t\t\toriginal: promise,\n\t\t\tresult\n\t\t}))\n\t);\n\n\treturn Promise.race(wrapped);\n};\n\nconst streamChunkToString = (\n\tvalue: string | Uint8Array,\n\tdecoder: TextDecoder\n) =>\n\ttypeof value === 'string' ? value : decoder.decode(value, { stream: true });\n\nexport const appendStreamingSlotPatchesToStream = (\n\tstream: ReadableStream<string | Uint8Array>,\n\tslots: DeferredStreamingSlot[] = [],\n\t{\n\t\tinjectRuntime = true,\n\t\tnonce,\n\t\tonError,\n\t\tonSlotMetric,\n\t\tpolicy,\n\t\truntimePreludeScript,\n\t\truntimePlacement = 'head'\n\t}: AppendStreamingSlotsOptions = {}\n) => {\n\tconst resolvedPolicy = resolveStreamingSlotPolicy(policy);\n\tconst combinedOnError = createCombinedSlotErrorHandler(\n\t\tresolvedPolicy.onError,\n\t\tonError\n\t);\n\tconst combinedOnSlotMetric = createCombinedSlotMetricHandler(\n\t\tresolvedPolicy.onSlotMetric,\n\t\tonSlotMetric\n\t);\n\tconst effectivePolicy: StreamingSlotPolicyValue = {\n\t\t...resolvedPolicy,\n\t\tonSlotMetric: combinedOnSlotMetric\n\t};\n\tconst preparedSlots = prepareSlots({\n\t\tonError: combinedOnError,\n\t\tonSlotMetric: combinedOnSlotMetric,\n\t\tpolicy: effectivePolicy,\n\t\tslots\n\t});\n\tif (preparedSlots.length === 0) return stream;\n\n\tconst source = injectRuntime\n\t\t? injectStreamingRuntimeIntoStream(\n\t\t\t\tstream,\n\t\t\t\tnonce,\n\t\t\t\truntimePlacement,\n\t\t\t\truntimePreludeScript\n\t\t\t)\n\t\t: stream;\n\tconst encoder = new TextEncoder();\n\tconst decoder = new TextDecoder();\n\tconst reader = source.getReader();\n\tconst pending: Array<Promise<ResolvedStreamingSlot>> = preparedSlots.map(\n\t\t(slot) =>\n\t\t\tresolveSlot(\n\t\t\t\tslot,\n\t\t\t\tcombinedOnError,\n\t\t\t\teffectivePolicy,\n\t\t\t\tcombinedOnSlotMetric\n\t\t\t)\n\t);\n\tconst createRaceCandidates = (\n\t\tbaseDone: boolean,\n\t\tbaseRead: StreamReadPromise\n\t) => {\n\t\tconst racers: Array<\n\t\t\tPromise<\n\t\t\t\t| {\n\t\t\t\t\t\tdone: boolean;\n\t\t\t\t\t\tkind: 'base';\n\t\t\t\t\t\tvalue?: string | Uint8Array;\n\t\t\t\t }\n\t\t\t\t| {\n\t\t\t\t\t\tkind: 'slot';\n\t\t\t\t\t\toriginal: Promise<{\n\t\t\t\t\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\tdurationMs: number;\n\t\t\t\t\t\t\tbytes: number;\n\t\t\t\t\t\t}>;\n\t\t\t\t\t\tresult: {\n\t\t\t\t\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\t\t\t\t\tid: string;\n\t\t\t\t\t\t\tdurationMs: number;\n\t\t\t\t\t\t\tbytes: number;\n\t\t\t\t\t\t};\n\t\t\t\t }\n\t\t\t>\n\t\t> = [];\n\n\t\tif (!baseDone) {\n\t\t\tracers.push(\n\t\t\t\tbaseRead.then(({ done, value }) => ({\n\t\t\t\t\tdone,\n\t\t\t\t\tkind: 'base' as const,\n\t\t\t\t\tvalue\n\t\t\t\t}))\n\t\t\t);\n\t\t}\n\t\tif (pending.length > 0) {\n\t\t\tracers.push(\n\t\t\t\tnextResolvedSlot(pending).then((resolved) => ({\n\t\t\t\t\tkind: 'slot' as const,\n\t\t\t\t\t...resolved\n\t\t\t\t}))\n\t\t\t);\n\t\t}\n\n\t\treturn racers;\n\t};\n\tconst flushTailLookbehind = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\ttail: string\n\t) => {\n\t\tif (tail.length <= STREAM_TAIL_LOOKBEHIND) {\n\t\t\treturn tail;\n\t\t}\n\n\t\tconst content = tail.slice(0, tail.length - STREAM_TAIL_LOOKBEHIND);\n\t\tcontroller.enqueue(encoder.encode(content));\n\n\t\treturn tail.slice(-STREAM_TAIL_LOOKBEHIND);\n\t};\n\tconst finalizeCompletedBaseWinner = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\tdecodedTail: string,\n\t\tbaseRead: StreamReadPromise\n\t) => {\n\t\tconst footerStart = decodedTail.search(CLOSING_PAGE_TAG_REGEX);\n\t\tif (footerStart < 0) {\n\t\t\tenqueueEncodedText(controller, encoder, decodedTail);\n\n\t\t\treturn {\n\t\t\t\tbaseDone: true,\n\t\t\t\tbaseRead,\n\t\t\t\tfooter: '',\n\t\t\t\thandled: true,\n\t\t\t\ttail: ''\n\t\t\t};\n\t\t}\n\n\t\tconst content = decodedTail.slice(0, footerStart);\n\t\tconst nextFooter = decodedTail.slice(footerStart);\n\t\tenqueueEncodedText(controller, encoder, content);\n\n\t\treturn {\n\t\t\tbaseDone: true,\n\t\t\tbaseRead,\n\t\t\tfooter: nextFooter,\n\t\t\thandled: true,\n\t\t\ttail: ''\n\t\t};\n\t};\n\tconst handleBaseWinner = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\twinner:\n\t\t\t| {\n\t\t\t\t\tdone: boolean;\n\t\t\t\t\tkind: 'base';\n\t\t\t\t\tvalue?: string | Uint8Array;\n\t\t\t }\n\t\t\t| {\n\t\t\t\t\tkind: 'slot';\n\t\t\t\t\toriginal: Promise<{\n\t\t\t\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\t\t\t\tid: string;\n\t\t\t\t\t\tdurationMs: number;\n\t\t\t\t\t\tbytes: number;\n\t\t\t\t\t}>;\n\t\t\t\t\tresult: {\n\t\t\t\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\t\t\t\tid: string;\n\t\t\t\t\t\tdurationMs: number;\n\t\t\t\t\t\tbytes: number;\n\t\t\t\t\t};\n\t\t\t },\n\t\tbaseRead: StreamReadPromise,\n\t\ttail: string,\n\t\tfooter: string\n\t) => {\n\t\tif (winner.kind !== 'base') {\n\t\t\treturn { baseDone: false, baseRead, footer, handled: false, tail };\n\t\t}\n\n\t\tif (winner.done) {\n\t\t\treturn finalizeCompletedBaseWinner(\n\t\t\t\tcontroller,\n\t\t\t\ttail + decoder.decode(),\n\t\t\t\tbaseRead\n\t\t\t);\n\t\t}\n\n\t\tif (!winner.value) {\n\t\t\treturn { baseDone: false, baseRead, footer, handled: true, tail };\n\t\t}\n\n\t\tconst nextTail = flushTailLookbehind(\n\t\t\tcontroller,\n\t\t\ttail + streamChunkToString(winner.value, decoder)\n\t\t);\n\n\t\treturn {\n\t\t\tbaseDone: false,\n\t\t\tbaseRead: reader.read(),\n\t\t\tfooter,\n\t\t\thandled: true,\n\t\t\ttail: nextTail\n\t\t};\n\t};\n\tconst handleResolvedSlot = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\twinner: {\n\t\t\tkind: 'slot';\n\t\t\toriginal: Promise<{\n\t\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\t\tid: string;\n\t\t\t\tdurationMs: number;\n\t\t\t\tbytes: number;\n\t\t\t}>;\n\t\t\tresult: {\n\t\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\t\tid: string;\n\t\t\t\tdurationMs: number;\n\t\t\t\tbytes: number;\n\t\t\t};\n\t\t}\n\t) => {\n\t\tconst index = pending.indexOf(winner.original);\n\t\tif (index >= 0) pending.splice(index, 1);\n\t\tif (winner.result.payload === null) {\n\t\t\treturn;\n\t\t}\n\n\t\temitSlotMetric(\n\t\t\t{\n\t\t\t\tbytes: winner.result.bytes,\n\t\t\t\tdurationMs: winner.result.durationMs,\n\t\t\t\tslotId: winner.result.id,\n\t\t\t\ttype: 'patched'\n\t\t\t},\n\t\t\tcombinedOnSlotMetric\n\t\t);\n\n\t\tcontroller.enqueue(\n\t\t\tencoder.encode(\n\t\t\t\trenderStreamingSlotPatchTag(\n\t\t\t\t\twinner.result.id,\n\t\t\t\t\twinner.result.payload,\n\t\t\t\t\tnonce\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t};\n\n\tconst runPatchedStreamLoop = async (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>\n\t) => {\n\t\tlet baseDone = false;\n\t\tlet baseRead = reader.read();\n\t\tlet tail = '';\n\t\tlet footer = '';\n\t\tconst readNextRaceWinner = async () => {\n\t\t\tconst racers = createRaceCandidates(baseDone, baseRead);\n\t\t\tif (racers.length === 0) {\n\t\t\t\treturn footer;\n\t\t\t}\n\n\t\t\tconst winner = await Promise.race(racers);\n\t\t\tconst baseWinnerState = applyBaseWinnerState(\n\t\t\t\thandleBaseWinner(controller, winner, baseRead, tail, footer),\n\t\t\t\twinner,\n\t\t\t\t(slotWinner) => {\n\t\t\t\t\thandleResolvedSlot(controller, slotWinner);\n\t\t\t\t}\n\t\t\t);\n\t\t\t({ baseDone, baseRead, footer, tail } = baseWinnerState);\n\t\t\tif (baseDone && pending.length === 0) {\n\t\t\t\treturn footer;\n\t\t\t}\n\n\t\t\treturn readNextRaceWinner();\n\t\t};\n\n\t\treturn readNextRaceWinner();\n\t};\n\n\treturn new ReadableStream<Uint8Array>({\n\t\tasync start(controller) {\n\t\t\ttry {\n\t\t\t\tconst footer = await runPatchedStreamLoop(controller);\n\t\t\t\tenqueueEncodedText(controller, encoder, footer);\n\t\t\t\tcontroller.close();\n\t\t\t} catch (error) {\n\t\t\t\tcontroller.error(error);\n\t\t\t}\n\t\t}\n\t});\n};\nexport const injectStreamingRuntimeIntoStream = (\n\tstream: ReadableStream<string | Uint8Array>,\n\tnonce?: string,\n\truntimePlacement: 'body' | 'head' = 'head',\n\truntimePreludeScript?: string\n) => {\n\tconst runtimeTag = renderStreamingSlotsRuntimeTag(\n\t\tnonce,\n\t\truntimePreludeScript\n\t);\n\tconst encoder = new TextEncoder();\n\tconst decoder = new TextDecoder();\n\tconst closingTag =\n\t\truntimePlacement === 'body' ? CLOSING_BODY_TAG : CLOSING_HEAD_TAG;\n\tconst lookbehind =\n\t\t(runtimePlacement === 'body'\n\t\t\t? CLOSING_BODY_TAG_LENGTH\n\t\t\t: CLOSING_HEAD_TAG_LENGTH) - 1;\n\tconst flushRuntimeLookbehind = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\tpending: string\n\t) => {\n\t\tif (pending.length <= lookbehind) {\n\t\t\treturn pending;\n\t\t}\n\n\t\tconst safeText = pending.slice(0, pending.length - lookbehind);\n\t\tcontroller.enqueue(encoder.encode(safeText));\n\n\t\treturn pending.slice(-lookbehind);\n\t};\n\tconst injectRuntimeIntoPending = (pending: string) =>\n\t\truntimePlacement === 'body'\n\t\t\t? injectHtmlIntoBody(pending, runtimeTag)\n\t\t\t: injectHtmlIntoHead(pending, runtimeTag);\n\tconst processRuntimePending = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\tpending: string,\n\t\tinjected: boolean\n\t) => {\n\t\tif (injected) {\n\t\t\tcontroller.enqueue(encoder.encode(pending));\n\n\t\t\treturn { injected, pending: '' };\n\t\t}\n\n\t\tconst closingTagIndex = pending.indexOf(closingTag);\n\t\tif (closingTagIndex >= 0) {\n\t\t\tconst withRuntime = `${pending.slice(0, closingTagIndex)}${runtimeTag}${pending.slice(closingTagIndex)}`;\n\t\t\tcontroller.enqueue(encoder.encode(withRuntime));\n\n\t\t\treturn { injected: true, pending: '' };\n\t\t}\n\n\t\treturn {\n\t\t\tinjected,\n\t\t\tpending: flushRuntimeLookbehind(controller, pending)\n\t\t};\n\t};\n\n\treturn new ReadableStream<Uint8Array>({\n\t\tasync start(controller) {\n\t\t\tconst reader = stream.getReader();\n\t\t\tlet injected = false;\n\t\t\tlet pending = '';\n\t\t\tconst enqueuePending = () =>\n\t\t\t\tenqueueEncodedText(controller, encoder, pending);\n\t\t\tconst consumeRuntimeChunk = async () => {\n\t\t\t\tconst { done, value } = await readStreamingRuntimeChunk(reader);\n\t\t\t\tif (done || !value) {\n\t\t\t\t\treturn done;\n\t\t\t\t}\n\n\t\t\t\tpending += streamChunkToString(value, decoder);\n\t\t\t\t({ injected, pending } = processRuntimePending(\n\t\t\t\t\tcontroller,\n\t\t\t\t\tpending,\n\t\t\t\t\tinjected\n\t\t\t\t));\n\n\t\t\t\treturn false;\n\t\t\t};\n\n\t\t\tconst runRuntimeInjectionLoop = async () => {\n\t\t\t\tconst done = await consumeRuntimeChunk();\n\t\t\t\tif (done) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tawait runRuntimeInjectionLoop();\n\t\t\t};\n\n\t\t\ttry {\n\t\t\t\tawait runRuntimeInjectionLoop();\n\n\t\t\t\tpending += decoder.decode();\n\t\t\t\tpending = injected\n\t\t\t\t\t? pending\n\t\t\t\t\t: injectRuntimeIntoPending(pending);\n\t\t\t\tenqueuePending();\n\t\t\t\tcontroller.close();\n\t\t\t} catch (error) {\n\t\t\t\tcontroller.error(error);\n\t\t\t}\n\t\t}\n\t});\n};\nexport const streamOutOfOrderSlots = ({\n\tfooterHtml = '',\n\theaderHtml = '',\n\tnonce,\n\tpolicy,\n\tonSlotMetric,\n\tonError,\n\tslots\n}: StreamOutOfOrderSlotsOptions) => {\n\tconst resolvedPolicy = resolveStreamingSlotPolicy(policy);\n\tconst combinedOnError = createCombinedSlotErrorHandler(\n\t\tresolvedPolicy.onError,\n\t\tonError\n\t);\n\tconst combinedOnSlotMetric = createCombinedSlotMetricHandler(\n\t\tresolvedPolicy.onSlotMetric,\n\t\tonSlotMetric\n\t);\n\tconst effectivePolicy: StreamingSlotPolicyValue = {\n\t\t...resolvedPolicy,\n\t\tonSlotMetric: combinedOnSlotMetric\n\t};\n\tconst preparedSlots = prepareSlots({\n\t\tonError: combinedOnError,\n\t\tonSlotMetric: combinedOnSlotMetric,\n\t\tpolicy: effectivePolicy,\n\t\tslots\n\t});\n\tconst encoder = new TextEncoder();\n\tconst createPendingSlots = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>\n\t) =>\n\t\tpreparedSlots.map((slot) => {\n\t\t\tconst fallback = renderStreamingSlotPlaceholder(\n\t\t\t\tslot.id,\n\t\t\t\tnormalizeSlotText(slot.fallbackHtml, '')\n\t\t\t);\n\t\t\tcontroller.enqueue(toUint8(fallback, encoder));\n\n\t\t\treturn resolveSlot(\n\t\t\t\tslot,\n\t\t\t\tcombinedOnError,\n\t\t\t\teffectivePolicy,\n\t\t\t\tcombinedOnSlotMetric\n\t\t\t);\n\t\t});\n\tconst handleResolvedPreparedSlot = async (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\tpending: Array<\n\t\t\tPromise<{\n\t\t\t\tpayload: StreamingSlotPatchPayload | null;\n\t\t\t\tid: string;\n\t\t\t\tdurationMs: number;\n\t\t\t\tbytes: number;\n\t\t\t}>\n\t\t>\n\t) => {\n\t\tconst { original, result } = await nextResolvedSlot(pending);\n\t\tconst index = pending.indexOf(original);\n\t\tif (index >= 0) pending.splice(index, 1);\n\t\tif (result.payload === null) {\n\t\t\treturn;\n\t\t}\n\n\t\temitSlotMetric(\n\t\t\t{\n\t\t\t\tbytes: result.bytes,\n\t\t\t\tdurationMs: result.durationMs,\n\t\t\t\tslotId: result.id,\n\t\t\t\ttype: 'patched'\n\t\t\t},\n\t\t\tcombinedOnSlotMetric\n\t\t);\n\t\tcontroller.enqueue(\n\t\t\ttoUint8(\n\t\t\t\trenderStreamingSlotPatchTag(result.id, result.payload, nonce),\n\t\t\t\tencoder\n\t\t\t)\n\t\t);\n\t};\n\n\tconst streamPreparedSlots = async (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>\n\t) => {\n\t\tconst pending = createPendingSlots(controller);\n\t\tconst streamNextPreparedSlot = async () => {\n\t\t\tif (pending.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait handleResolvedPreparedSlot(controller, pending);\n\n\t\t\tawait streamNextPreparedSlot();\n\t\t};\n\n\t\tawait streamNextPreparedSlot();\n\t};\n\tconst resolveHeaderHtml = () => {\n\t\tconst needsRuntimeTag =\n\t\t\tpreparedSlots.length > 0 &&\n\t\t\t!headerHtml.includes(STREAMING_RUNTIME_GLOBAL);\n\t\tif (!needsRuntimeTag) {\n\t\t\treturn headerHtml;\n\t\t}\n\n\t\treturn injectHtmlIntoHead(\n\t\t\theaderHtml,\n\t\t\trenderStreamingSlotsRuntimeTag(nonce)\n\t\t);\n\t};\n\n\treturn new ReadableStream<Uint8Array>({\n\t\tasync start(controller) {\n\t\t\ttry {\n\t\t\t\tconst header = resolveHeaderHtml();\n\t\t\t\tcontroller.enqueue(toUint8(header, encoder));\n\t\t\t\tawait streamPreparedSlots(controller);\n\n\t\t\t\tenqueueEncodedText(controller, encoder, footerHtml);\n\t\t\t\tcontroller.close();\n\t\t\t} catch (error) {\n\t\t\t\tcontroller.error(error);\n\t\t\t}\n\t\t}\n\t});\n};\n",
|
|
10
|
-
"import {\n\tMILLISECONDS_IN_A_SECOND,\n\tTIME_PRECISION,\n\tMILLISECONDS_IN_A_MINUTE\n} from '../constants';\n\nexport const getDurationString = (duration: number) => {\n\tlet durationString;\n\n\tif (duration < MILLISECONDS_IN_A_SECOND) {\n\t\tdurationString = `${duration.toFixed(TIME_PRECISION)}ms`;\n\t} else if (duration < MILLISECONDS_IN_A_MINUTE) {\n\t\tdurationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;\n\t} else {\n\t\tconst totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);\n\t\tconst minutes = Math.floor(totalSeconds / 60);\n\t\tconst seconds = totalSeconds % 60;\n\t\tdurationString =\n\t\t\tseconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;\n\t}\n\n\treturn durationString;\n};\n",
|
|
11
|
-
"import { HOURS_IN_HALF_DAY } from '../constants';\nimport { getDurationString } from './getDurationString';\n\nconst colors = {\n\tbold: '\\x1b[1m',\n\tcyan: '\\x1b[36m',\n\tdim: '\\x1b[2m',\n\tgreen: '\\x1b[32m',\n\treset: '\\x1b[0m'\n} as const;\n\nconst MONTHS = [\n\t'Jan',\n\t'Feb',\n\t'Mar',\n\t'Apr',\n\t'May',\n\t'Jun',\n\t'Jul',\n\t'Aug',\n\t'Sep',\n\t'Oct',\n\t'Nov',\n\t'Dec'\n] as const;\n\nexport const formatTimestamp = () => {\n\tconst now = new Date();\n\tconst month = MONTHS[now.getMonth()];\n\tconst day = now.getDate().toString().padStart(2, '0');\n\tlet hours = now.getHours();\n\tconst minutes = now.getMinutes().toString().padStart(2, '0');\n\tconst seconds = now.getSeconds().toString().padStart(2, '0');\n\tconst ampm = hours >= HOURS_IN_HALF_DAY ? 'PM' : 'AM';\n\thours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;\n\n\treturn `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;\n};\n\nexport const startupBanner = (options: {\n\tversion: string;\n\treadyDuration: number;\n\tbuildDuration?: number;\n\tport: string | number;\n\thost: string;\n\tnetworkUrl?: string;\n\tprotocol?: string;\n}) => {\n\tconst {\n\t\tversion,\n\t\treadyDuration,\n\t\tbuildDuration,\n\t\tport,\n\t\thost,\n\t\tnetworkUrl,\n\t\tprotocol = 'http'\n\t} = options;\n\tconst name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;\n\tconst ver = `${colors.dim}v${version}${colors.reset}`;\n\tconst time = `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDuration)}${colors.reset}`;\n\tconst build =\n\t\ttypeof buildDuration === 'number' && Number.isFinite(buildDuration)\n\t\t\t? ` ${colors.dim}(build ${getDurationString(buildDuration)})${colors.reset}`\n\t\t\t: '';\n\tconsole.log('');\n\tconsole.log(` ${name} ${ver} ${time}${build}`);\n\tconsole.log('');\n\tconsole.log(\n\t\t` ${colors.green}➜${colors.reset} ${colors.bold}Local:${colors.reset} ${protocol}://${host === '0.0.0.0' ? 'localhost' : host}:${port}/`\n\t);\n\tif (networkUrl) {\n\t\tconsole.log(\n\t\t\t` ${colors.green}➜${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`\n\t\t);\n\t}\n\tconsole.log('');\n};\n",
|
|
12
|
-
"/**\n * Centralized logger utility for AbsoluteJS\n * Provides formatted output with ANSI colors and timestamps\n */\n\nimport { formatTimestamp, startupBanner } from './startupBanner';\n\nexport { formatTimestamp };\n\n// ANSI color codes\nconst colors = {\n\tblue: '\\x1b[34m',\n\tbold: '\\x1b[1m',\n\t// Core colors\n\tcyan: '\\x1b[36m',\n\tdim: '\\x1b[2m',\n\tgreen: '\\x1b[32m',\n\tmagenta: '\\x1b[35m',\n\tred: '\\x1b[31m',\n\treset: '\\x1b[0m',\n\twhite: '\\x1b[37m',\n\tyellow: '\\x1b[33m'\n} as const;\n\n// Framework color mapping\nconst frameworkColors: Record<string, string> = {\n\tangular: colors.magenta,\n\tassets: colors.dim,\n\tcss: colors.cyan,\n\thtml: colors.white,\n\thtmx: colors.white,\n\treact: colors.blue,\n\tsvelte: colors.yellow,\n\tvue: colors.green\n};\n\n/**\n * Format a file path for display (relative, clean)\n */\nconst formatPath = (filePath: string) => {\n\tconst cwd = process.cwd();\n\tlet relative = filePath.startsWith(cwd)\n\t\t? filePath.slice(cwd.length + 1)\n\t\t: filePath;\n\t// Normalize slashes\n\trelative = relative.replace(/\\\\/g, '/');\n\t// Ensure it starts with /\n\tif (!relative.startsWith('/')) {\n\t\trelative = `/${relative}`;\n\t}\n\n\treturn relative;\n};\n\n/**\n * Get color for a framework\n */\nconst getFrameworkColor = (framework: string) =>\n\tframeworkColors[framework] || colors.white;\n\n/**\n * Core logging function\n */\nconst log = (\n\taction: string,\n\toptions?: {\n\t\tframework?: string;\n\t\tduration?: number;\n\t\tpath?: string;\n\t\tcolor?: string;\n\t}\n) => {\n\tconst timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;\n\tconst tag = `${colors.cyan}[hmr]${colors.reset}`;\n\n\tlet message = action;\n\n\t// Apply framework color to path if present\n\tif (options?.path) {\n\t\tconst pathColor = options.framework\n\t\t\t? getFrameworkColor(options.framework)\n\t\t\t: colors.white;\n\t\tmessage += ` ${pathColor}${formatPath(options.path)}${colors.reset}`;\n\t}\n\n\t// Add duration if present\n\tif (options?.duration !== undefined) {\n\t\tmessage += ` ${colors.dim}(${options.duration}ms)${colors.reset}`;\n\t}\n\n\tconsole.log(`${timestamp} ${tag} ${message}`);\n};\n\n/**\n * Startup banner\n */\nexport const logReady = startupBanner;\n\n/**\n * CSS update message\n * Format: \"10:30:45 AM [hmr] css update /styles/main.css (125ms)\"\n */\nexport const logCssUpdate = (\n\tpath: string,\n\tframework?: string,\n\tduration?: number\n) => {\n\tlog('css update', { duration, framework: framework ?? 'css', path });\n};\n\n/**\n * Build error\n * Format: \"10:30:45 AM [hmr] error Build failed: ...\"\n */\nexport const logError = (message: string, error?: Error | string) => {\n\tconst timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;\n\tconst tag = `${colors.red}[hmr]${colors.reset}`;\n\tconst errorMsg = error instanceof Error ? error.message : error;\n\tconst fullMessage = `${colors.red}error${colors.reset} ${message}${errorMsg ? `: ${errorMsg}` : ''}`;\n\tconsole.error(`${timestamp} ${tag} ${fullMessage}`);\n};\n\n/**\n * HMR update message\n * Format: \"10:30:45 AM [hmr] hmr update /pages/App.tsx\"\n */\nexport const logHmrUpdate = (\n\tpath: string,\n\tframework?: string,\n\tduration?: number\n) => {\n\tlog('hmr update', { duration, framework, path });\n};\n\n/**\n * Generic info message\n */\nexport const logInfo = (message: string) => {\n\tlog(message);\n};\n\n/**\n * Page reload message\n * Format: \"10:30:45 AM [hmr] page reload /src/App.tsx (125ms)\"\n */\nexport const logPageReload = (\n\tpath: string,\n\tframework?: string,\n\tduration?: number\n) => {\n\tlog('page reload', { duration, framework, path });\n};\n\n/**\n * Script update message\n * Format: \"10:30:45 AM [hmr] script update /scripts/counter.ts (125ms)\"\n */\nexport const logScriptUpdate = (\n\tpath: string,\n\tframework?: string,\n\tduration?: number\n) => {\n\tlog('script update', { duration, framework, path });\n};\n\n/**\n * Server module reloaded (Bun --hot triggered a server-side change)\n */\nexport const logServerReload = () => {\n\tlog(`${colors.cyan}server module reloaded${colors.reset}`);\n};\n\n/**\n * Warning message\n * Format: \"10:30:45 AM [hmr] warning ...\"\n */\nexport const logWarn = (message: string) => {\n\tconst timestamp = `${colors.dim}${formatTimestamp()}${colors.reset}`;\n\tconst tag = `${colors.yellow}[hmr]${colors.reset}`;\n\tconsole.log(\n\t\t`${timestamp} ${tag} ${colors.yellow}warning ${message}${colors.reset}`\n\t);\n};\n",
|
|
13
|
-
"export const ssrErrorPage = (framework: string, error: unknown) => {\n\tconst frameworkColors: Record<string, string> = {\n\t\tangular: '#dd0031',\n\t\thtml: '#e34c26',\n\t\thtmx: '#1a365d',\n\t\treact: '#61dafb',\n\t\tsvelte: '#ff3e00',\n\t\tvue: '#42b883'\n\t};\n\n\tconst accent = frameworkColors[framework] ?? '#94a3b8';\n\tconst label = framework.charAt(0).toUpperCase() + framework.slice(1);\n\tconst message = error instanceof Error ? error.message : String(error);\n\n\treturn `<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>SSR Error - AbsoluteJS</title>\n<style>\n*{margin:0;padding:0;box-sizing:border-box}\nbody{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);color:#e2e8f0;font-family:\"JetBrains Mono\",\"Fira Code\",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;display:flex;align-items:flex-start;justify-content:center;padding:32px}\n.card{max-width:720px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden}\n.header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4)}\n.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}\n.badge{padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${accent};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2)}\n.kind{color:#94a3b8;font-size:13px;font-weight:500}\n.content{padding:24px}\n.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}\n.message{margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5}\n.hint{margin-top:20px;padding:12px 20px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px}\n</style>\n</head>\n<body>\n<div class=\"card\">\n<div class=\"header\">\n<div style=\"display:flex;align-items:center;gap:12px\">\n<span class=\"brand\">AbsoluteJS</span>\n<span class=\"badge\">${label}</span>\n</div>\n<span class=\"kind\">Server Render Error</span>\n</div>\n<div class=\"content\">\n<div class=\"label\">What went wrong</div>\n<pre class=\"message\">${message.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</pre>\n<div class=\"hint\">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>\n</div>\n</div>\n</body>\n</html>`;\n};\n",
|
|
14
|
-
"const normalizeSlug = (str: string) =>\n\tstr\n\t\t.trim()\n\t\t.replace(/\\s+/g, '-')\n\t\t.replace(/[^A-Za-z0-9\\-_]+/g, '')\n\t\t.replace(/[-_]{2,}/g, '-');\n\nexport const toKebab = (str: string) =>\n\tnormalizeSlug(str)\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n\t\t.toLowerCase();\nexport const toPascal = (str: string) => {\n\tif (!str.includes('-') && !str.includes('_')) {\n\t\treturn str.charAt(0).toUpperCase() + str.slice(1);\n\t}\n\n\treturn normalizeSlug(str)\n\t\t.split(/[-_]/)\n\t\t.filter(Boolean)\n\t\t.map(\n\t\t\t(segment) =>\n\t\t\t\tsegment.charAt(0).toUpperCase() + segment.slice(1).toLowerCase()\n\t\t)\n\t\t.join('');\n};\nexport const toScreamingSnake = (str: string) =>\n\tstr.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toUpperCase();\n",
|
|
15
|
-
"import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport type { TelemetryConfig } from '../../../types/telemetry';\n\nconst configDir = join(homedir(), '.absolutejs');\nconst configPath = join(configDir, 'telemetry.json');\n\nexport const getTelemetryConfig = () => {\n\ttry {\n\t\tif (!existsSync(configPath)) return null;\n\t\tconst raw = readFileSync(configPath, 'utf-8');\n\n\t\tconst config: TelemetryConfig = JSON.parse(raw);\n\n\t\treturn config;\n\t} catch {\n\t\treturn null;\n\t}\n};\n\nexport const isTelemetryEnabled = () => {\n\tconst config = getTelemetryConfig();\n\n\treturn config?.enabled === true;\n};\n\nexport const saveTelemetryConfig = (config: TelemetryConfig) => {\n\tmkdirSync(configDir, { recursive: true });\n\twriteFileSync(configPath, `${JSON.stringify(config, null, '\\t')}\\n`);\n};\n\nconst enable = () => {\n\tconst existing = getTelemetryConfig();\n\tconst config: TelemetryConfig = {\n\t\tanonymousId: existing?.anonymousId ?? crypto.randomUUID(),\n\t\tcreatedAt: existing?.createdAt ?? new Date().toISOString(),\n\t\tenabled: true\n\t};\n\tsaveTelemetryConfig(config);\n\tconsole.log('Telemetry enabled.');\n\tconsole.log(`Anonymous ID: ${config.anonymousId}`);\n};\n\nconst disable = () => {\n\tconst existing = getTelemetryConfig();\n\tif (existing) {\n\t\tsaveTelemetryConfig({ ...existing, enabled: false });\n\t}\n\tconsole.log('Telemetry disabled.');\n};\n\nconst status = () => {\n\tconst config = getTelemetryConfig();\n\tif (!config || !config.enabled) {\n\t\tconsole.log('Telemetry is disabled.');\n\t} else {\n\t\tconsole.log('Telemetry is enabled.');\n\t\tconsole.log(`Anonymous ID: ${config.anonymousId}`);\n\t}\n};\n\nexport const telemetry = (args: string[]) => {\n\tconst [subcommand] = args;\n\n\tif (subcommand === 'enable') {\n\t\tenable();\n\n\t\treturn;\n\t}\n\tif (subcommand === 'disable') {\n\t\tdisable();\n\n\t\treturn;\n\t}\n\tif (subcommand === 'status') {\n\t\tstatus();\n\n\t\treturn;\n\t}\n\tif (!subcommand) {\n\t\tstatus();\n\t\tconsole.log('');\n\t\tconsole.log('Usage: absolute telemetry <command>');\n\t\tconsole.log('Commands:');\n\t\tconsole.log(' enable Enable anonymous telemetry');\n\t\tconsole.log(' disable Disable telemetry');\n\t\tconsole.log(' status Show current telemetry status');\n\n\t\treturn;\n\t}\n\tconsole.error(`Unknown telemetry command: ${subcommand}`);\n\tconsole.error('Usage: absolute telemetry <enable|disable|status>');\n\tprocess.exit(1);\n};\n",
|
|
16
|
-
"import { existsSync, readFileSync } from 'node:fs';\nimport { arch, platform } from 'node:os';\nimport { dirname, join, parse } from 'node:path';\nimport type { TelemetryEvent } from '../../types/telemetry';\nimport { getTelemetryConfig } from './scripts/telemetry';\n\nconst checkCandidate = (candidate: string) => {\n\tif (!existsSync(candidate)) {\n\t\treturn null;\n\t}\n\tconst pkg = JSON.parse(readFileSync(candidate, 'utf-8'));\n\n\tif (pkg.name === '@absolutejs/absolute') {\n\t\tconst ver: string = pkg.version;\n\n\t\treturn ver;\n\t}\n\n\treturn null;\n};\n\nconst getVersion = () => {\n\ttry {\n\t\treturn findPackageVersion();\n\t} catch {\n\t\treturn 'unknown';\n\t}\n};\n\nconst findPackageVersion = () => {\n\tlet { dir } = import.meta;\n\n\twhile (dir !== parse(dir).root) {\n\t\tconst candidate = join(dir, 'package.json');\n\t\tconst version = checkCandidate(candidate);\n\t\tif (version) {\n\t\t\treturn version;\n\t\t}\n\t\tdir = dirname(dir);\n\t}\n\n\treturn 'unknown';\n};\n\nexport const sendTelemetryEvent = (\n\tevent: string,\n\tpayload: Record<string, unknown>\n) => {\n\ttry {\n\t\tif (process.env.TELEMETRY_OFF === '1') return;\n\t\tconst config = getTelemetryConfig();\n\t\tif (!config?.enabled) return;\n\n\t\tconst body: TelemetryEvent = {\n\t\t\tanonymousId: config.anonymousId,\n\t\t\tarch: arch(),\n\t\t\tbunVersion: Bun.version,\n\t\t\tevent,\n\t\t\tos: platform(),\n\t\t\tpayload,\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tversion: getVersion()\n\t\t};\n\n\t\tfetch('https://absolutejs.com/api/telemetry', {\n\t\t\tbody: JSON.stringify(body),\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tmethod: 'POST'\n\t\t}).catch(() => undefined);\n\t} catch {\n\t\t/* silently ignore */\n\t}\n};\n",
|
|
17
|
-
"import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport { build as bunBuild } from 'bun';\nimport { sendTelemetryEvent } from '../cli/telemetryEvent';\n\nconst resolveHmrClientPath = () => {\n\tconst projectRoot = process.cwd();\n\tconst fromSource = resolve(import.meta.dir, 'client/hmrClient.ts');\n\n\tif (existsSync(fromSource) && fromSource.startsWith(projectRoot)) {\n\t\treturn fromSource;\n\t}\n\n\tconst fromNodeModules = resolve(\n\t\tprojectRoot,\n\t\t'node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts'\n\t);\n\tif (existsSync(fromNodeModules)) return fromNodeModules;\n\n\treturn resolve(import.meta.dir, 'dev/client/hmrClient.ts');\n};\n\nconst hmrClientPath = resolveHmrClientPath();\n\nexport const buildHMRClient = async () => {\n\tconst entryPoint = hmrClientPath;\n\tconst result = await bunBuild({\n\t\tentrypoints: [entryPoint],\n\t\tformat: 'iife',\n\t\tminify: false,\n\t\ttarget: 'browser'\n\t});\n\tif (!result.success) {\n\t\tconsole.error('Failed to build HMR client:', result.logs);\n\t\tsendTelemetryEvent('hmr:client-build-failed', {\n\t\t\tlogCount: result.logs.length,\n\t\t\tmessage: result.logs.map((log) => log.message).join('; ')\n\t\t});\n\n\t\treturn '// HMR client build failed';\n\t}\n\n\tconst [firstOutput] = result.outputs;\n\tif (!firstOutput) return '// HMR client build failed';\n\n\treturn firstOutput.text();\n};\n",
|
|
18
|
-
"import type { IslandFramework } from '../../types/island';\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 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",
|
|
19
|
-
"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",
|
|
20
|
-
"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",
|
|
21
|
-
"import type { IslandRegistryInput } from '../../types/island';\n\ndeclare global {\n\tvar __absoluteIslandRegistry: IslandRegistryInput | undefined;\n}\n\nexport const getCurrentIslandRegistry = () =>\n\tglobalThis.__absoluteIslandRegistry;\nexport const requireCurrentIslandRegistry = () => {\n\tconst registry = globalThis.__absoluteIslandRegistry;\n\tif (!registry) {\n\t\tthrow new Error(\n\t\t\t'No island registry is active. Configure `islands.registry` in absolute.config.ts before rendering <Island />.'\n\t\t);\n\t}\n\n\treturn registry;\n};\nexport const setCurrentIslandRegistry = (\n\tregistry: IslandRegistryInput | undefined\n) => {\n\tglobalThis.__absoluteIslandRegistry = registry;\n};\n",
|
|
22
|
-
"import { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\n\n/**\n * Resolve Angular package paths from the compiled runtime node_modules first,\n * then the app's process.cwd()/node_modules, falling back to the bare specifier.\n * This prevents Bun's baked import.meta.dir from resolving Angular packages\n * from the absolutejs source tree instead of the consumer's project when\n * running from a published npm package.\n */\nexport const resolveAngularPackageDir = (specifier: string) => {\n\tconst fromCompiledRuntime = process.env.ABSOLUTE_BUILD_DIR\n\t\t? resolve(process.env.ABSOLUTE_BUILD_DIR, 'node_modules', specifier)\n\t\t: null;\n\tif (fromCompiledRuntime && existsSync(fromCompiledRuntime)) {\n\t\treturn fromCompiledRuntime;\n\t}\n\n\tconst fromProject = resolve(process.cwd(), 'node_modules', specifier);\n\n\tif (existsSync(fromProject)) {\n\t\treturn fromProject;\n\t}\n\n\treturn null;\n};\n\nconst resolvePackageEntry = (packageDir: string) => {\n\ttry {\n\t\tconst pkg = JSON.parse(\n\t\t\treadFileSync(join(packageDir, 'package.json'), 'utf-8')\n\t\t);\n\t\tconst rootExport = pkg.exports?.['.'];\n\t\tconst entry =\n\t\t\t(typeof rootExport === 'string'\n\t\t\t\t? rootExport\n\t\t\t\t: rootExport?.default) ??\n\t\t\tpkg.module ??\n\t\t\tpkg.main ??\n\t\t\t'index.js';\n\n\t\treturn join(packageDir, entry);\n\t} catch {\n\t\treturn packageDir;\n\t}\n};\n\nexport const resolveAngularPackage = (specifier: string) => {\n\tconst packageDir = resolveAngularPackageDir(specifier);\n\tif (packageDir) return resolvePackageEntry(packageDir);\n\n\treturn specifier;\n};\n\nconst toSafeVendorName = (specifier: string) =>\n\tspecifier.replace(/^@/, '').replace(/\\//g, '_');\n\n/** Prefer the linked Bun-target vendor file built by\n * `buildAngularServerVendor`. The file is at\n * `<ABSOLUTE_BUILD_DIR>/angular/vendor/server/<safe>.js`, which is what every\n * server bundle's `@angular/*` imports get rewritten to point at. Sharing\n * this path keeps SSR's class identity unified — the dual-package hazard\n * that produces NG0201 only appears when the runtime imports a *different*\n * copy from the bundles. Falls back to `resolveAngularPackage` (node_modules)\n * when no vendor file is available — e.g. running tests outside an\n * absolutejs build, or before the vendor pass completes. */\nexport const resolveAngularRuntimePath = (specifier: string) => {\n\tconst buildDirs = [\n\t\tprocess.env.ABSOLUTE_BUILD_DIR,\n\t\tresolve(process.cwd(), 'build')\n\t].filter((value): value is string => Boolean(value));\n\n\tfor (const buildDir of buildDirs) {\n\t\tconst vendorPath = join(\n\t\t\tbuildDir,\n\t\t\t'angular',\n\t\t\t'vendor',\n\t\t\t'server',\n\t\t\t`${toSafeVendorName(specifier)}.js`\n\t\t);\n\t\tif (existsSync(vendorPath)) return vendorPath;\n\t}\n\n\treturn resolveAngularPackage(specifier);\n};\n",
|
|
23
|
-
"/* Bundler-safe NODE_ENV reader.\n *\n * Bun (like esbuild and most modern bundlers) statically replaces\n * `process.env.NODE_ENV` with the build-time string. When absolutejs\n * itself is bundled (`bun run scripts/build.ts`), NODE_ENV is unset,\n * so every `process.env.NODE_ENV === 'production'` site collapses to\n * `false` and the production branch is dead-code-eliminated from\n * `dist/`. That breaks `bun start`, `bun compile`, and the standalone\n * compiled binary — they all run with NODE_ENV=production but see the\n * dev branches baked in.\n *\n * Computed-property access (`process.env[KEY]`) is NOT constant-folded\n * by Bun, so we read NODE_ENV through a string variable. Both branches\n * stay live in `dist/`, and the consumer's actual runtime NODE_ENV\n * decides which one fires.\n *\n * Verified empirically: Bun's bundler matches the literal AST shape\n * `MemberExpression { object: process.env, property: NODE_ENV }` for\n * its replacement. Computed-key access uses\n * `MemberExpression { computed: true, property: Identifier(KEY) }`,\n * which doesn't match the pattern. */\n\nconst ENV_VAR = 'NODE_ENV';\n\nexport const getNodeEnv = () => process.env[ENV_VAR];\nexport const isDevelopmentRuntime = () =>\n\tprocess.env[ENV_VAR] === 'development';\nexport const isProductionRuntime = () => process.env[ENV_VAR] === 'production';\n",
|
|
24
|
-
"import { resolveAngularRuntimePath } from './resolveAngularPackage';\nimport { isProductionRuntime } from '../utils/runtimeMode';\n\n// Patches Angular SSR's DominoAdapter to guard against null doc.head\n\nconst ensureHead = (doc: Document) => {\n\tif (!doc || doc.head || !doc.documentElement) {\n\t\treturn;\n\t}\n\n\tconst head = doc.createElement('head');\n\tdoc.documentElement.insertBefore(head, doc.documentElement.firstChild);\n};\n\n// Domino's Element does not implement layout APIs that browser components\n// (e.g. ngx-datatable, swiper, drag-drop) call eagerly during change detection.\n// Returning a zeroed DOMRect lets those components render in SSR without\n// crashing — the real values get computed once the page hydrates client-side.\nconst SSR_LAYOUT_RECT = Object.freeze({\n\tbottom: 0,\n\theight: 0,\n\tleft: 0,\n\tright: 0,\n\ttop: 0,\n\twidth: 0,\n\tx: 0,\n\ty: 0,\n\ttoJSON() {\n\t\treturn this;\n\t}\n});\nlet layoutPatchApplied = false;\nconst collectPrototypeChain = (instance: object | null) => {\n\tconst protos: object[] = [];\n\tlet current: object | null = instance\n\t\t? Object.getPrototypeOf(instance)\n\t\t: null;\n\twhile (current && current !== Object.prototype) {\n\t\tprotos.push(current);\n\t\tcurrent = Object.getPrototypeOf(current);\n\t}\n\n\treturn protos;\n};\n\nconst patchElementLayout = (doc: Document) => {\n\tif (layoutPatchApplied || !doc) {\n\t\treturn;\n\t}\n\tlet element: Element;\n\ttry {\n\t\telement = doc.createElement('div');\n\t} catch {\n\t\treturn;\n\t}\n\t// Walk the entire prototype chain so HTMLElement → Element → Node all get\n\t// the layout shims. Domino's base Element.prototype is several hops above\n\t// HTMLDivElement.prototype, and 3rd-party libs call methods anywhere along\n\t// the chain.\n\tconst protos = collectPrototypeChain(element);\n\tif (protos.length === 0) return;\n\n\tconst copyLayoutRect = (rect: typeof SSR_LAYOUT_RECT) => ({ ...rect });\n\tconst createLayoutRect = () => copyLayoutRect(SSR_LAYOUT_RECT);\n\tconst getClientRects = () => [];\n\tconst noop = () => undefined;\n\tconst numericProps = [\n\t\t'clientWidth',\n\t\t'clientHeight',\n\t\t'clientLeft',\n\t\t'clientTop',\n\t\t'offsetWidth',\n\t\t'offsetHeight',\n\t\t'offsetLeft',\n\t\t'offsetTop',\n\t\t'scrollWidth',\n\t\t'scrollHeight',\n\t\t'scrollLeft',\n\t\t'scrollTop'\n\t];\n\n\tfor (const proto of protos) {\n\t\tconst define = (name: string, value: unknown) => {\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(proto, name);\n\t\t\tif (typeof descriptor?.value === 'function') return;\n\n\t\t\tObject.defineProperty(proto, name, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tvalue,\n\t\t\t\twritable: true\n\t\t\t});\n\t\t};\n\n\t\tdefine('getBoundingClientRect', createLayoutRect);\n\t\tdefine('getClientRects', getClientRects);\n\t\tdefine('scrollTo', noop);\n\t\tdefine('scrollBy', noop);\n\t\tdefine('scrollIntoView', noop);\n\t\tdefine('focus', noop);\n\t\tdefine('blur', noop);\n\n\t\tfor (const prop of numericProps) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(proto, prop);\n\t\t\tif (desc) continue;\n\t\t\tObject.defineProperty(proto, prop, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tget: () => 0\n\t\t\t});\n\t\t}\n\t}\n\n\tlayoutPatchApplied = true;\n};\n\nexport const applyPatches = async () => {\n\t// §1.1 — bare specifier in dev shares Bun's module cache with bundled\n\t// server pages. Production stays on the resolved vendor path. Use\n\t// `isProductionRuntime()` instead of a direct `process.env.NODE_ENV`\n\t// read so Bun's bundler doesn't constant-fold this branch out of\n\t// dist/ at absolutejs build time.\n\tconst spec = isProductionRuntime()\n\t\t? resolveAngularRuntimePath('@angular/platform-server')\n\t\t: '@angular/platform-server';\n\tconst { ɵDominoAdapter } = await import(spec);\n\tif (!ɵDominoAdapter?.prototype) {\n\t\tconsole.warn(\n\t\t\t'[Angular Patch] ɵDominoAdapter not found, skipping patches'\n\t\t);\n\n\t\treturn false;\n\t}\n\n\t// Patch the layout shims onto Domino's Element prototypes immediately\n\t// (don't wait for the first createHtmlDocument call). Components that\n\t// hold an ElementRef from the very first change-detection pass call\n\t// these methods before the lazy patch path would have run.\n\ttry {\n\t\tconst adapter = new ɵDominoAdapter();\n\t\tconst resolveSeedDoc = () => {\n\t\t\tif (typeof adapter.createHtmlDocument === 'function')\n\t\t\t\treturn adapter.createHtmlDocument();\n\t\t\tif (typeof adapter.getDefaultDocument === 'function')\n\t\t\t\treturn adapter.getDefaultDocument();\n\n\t\t\treturn null;\n\t\t};\n\t\tconst seedDoc = resolveSeedDoc();\n\t\tif (seedDoc) {\n\t\t\tpatchElementLayout(seedDoc);\n\t\t\tconst probe = seedDoc.createElement('div') as Element & {\n\t\t\t\tgetBoundingClientRect?: () => DOMRect;\n\t\t\t};\n\t\t\tif (typeof probe.getBoundingClientRect !== 'function') {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'[Angular Patch] Layout shim did not stick on probe element prototype chain'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tconsole.warn(\n\t\t\t'[Angular Patch] Could not eagerly patch Element prototypes:',\n\t\t\terror\n\t\t);\n\t}\n\n\tconst proto = ɵDominoAdapter.prototype;\n\n\tconst origGetBaseHref = proto.getBaseHref;\n\tproto.getBaseHref = function (doc: Document) {\n\t\tif (!doc || !doc.head || typeof doc.head.children === 'undefined') {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn origGetBaseHref.call(this, doc);\n\t};\n\n\tconst origCreateHtmlDocument = proto.createHtmlDocument;\n\tproto.createHtmlDocument = function () {\n\t\tconst doc = origCreateHtmlDocument.call(this);\n\t\tensureHead(doc);\n\t\tpatchElementLayout(doc);\n\n\t\treturn doc;\n\t};\n\n\tconst origGetDefaultDocument = proto.getDefaultDocument;\n\tproto.getDefaultDocument = function () {\n\t\tconst doc = origGetDefaultDocument.call(this);\n\t\tensureHead(doc);\n\t\tpatchElementLayout(doc);\n\n\t\treturn doc;\n\t};\n\n\treturn true;\n};\n",
|
|
25
|
-
"import type { AngularDeps } from '../../types/angular';\nimport { resolveAngularRuntimePath } from './resolveAngularPackage';\nimport {\n\tisDevelopmentRuntime,\n\tisProductionRuntime\n} from '../utils/runtimeMode';\n\nconst initDominoAdapter = (platformServer: {\n\tɵDominoAdapter?: { makeCurrent?: () => void };\n}) => {\n\ttry {\n\t\tplatformServer.ɵDominoAdapter?.makeCurrent?.();\n\t} catch (err) {\n\t\tconsole.error('Failed to initialize DominoAdapter:', err);\n\t}\n};\n\nconst loadAngularDeps = async () => {\n\t// JIT compiler is only needed in development, where user pages are\n\t// runtime-compiled by `compileAngularFileJIT` and emit partial\n\t// declarations that need the compiler facade to link. In production\n\t// the linker has already processed every partial declaration into\n\t// final ɵdir/ɵcmp/ɵfac at vendor build time, so the compiler isn't\n\t// imported and isn't part of the prod vendor bundle.\n\tif (!isProductionRuntime()) {\n\t\t// Bare specifier in dev — Bun's module cache dedupes on\n\t\t// normalized specifier, so this is the same instance as the\n\t\t// `import \"@angular/compiler\"` baked into bundled server pages.\n\t\tawait import('@angular/compiler');\n\t}\n\n\t// angularPatch imports @angular/platform-server internally, so it\n\t// must also run after the compiler is available.\n\tconst { applyPatches } = await import('./angularPatch');\n\tawait applyPatches();\n\n\t// In dev (no Angular server vendor on disk — see §1.1), use bare\n\t// specifiers so Bun resolves them through node_modules and shares\n\t// the same module records with the bundled server pages, which\n\t// also have bare `@angular/*` imports in dev. Production keeps the\n\t// resolved-path import because the vendor bundle is what every\n\t// server-side import points at, and the resolved path is stable.\n\tconst useBareSpecifiers = !isProductionRuntime();\n\tconst [platformBrowser, platformServer, common, core] = await Promise.all([\n\t\timport(\n\t\t\tuseBareSpecifiers\n\t\t\t\t? '@angular/platform-browser'\n\t\t\t\t: resolveAngularRuntimePath('@angular/platform-browser')\n\t\t),\n\t\timport(\n\t\t\tuseBareSpecifiers\n\t\t\t\t? '@angular/platform-server'\n\t\t\t\t: resolveAngularRuntimePath('@angular/platform-server')\n\t\t),\n\t\timport(\n\t\t\tuseBareSpecifiers\n\t\t\t\t? '@angular/common'\n\t\t\t\t: resolveAngularRuntimePath('@angular/common')\n\t\t),\n\t\timport(\n\t\t\tuseBareSpecifiers\n\t\t\t\t? '@angular/core'\n\t\t\t\t: resolveAngularRuntimePath('@angular/core')\n\t\t)\n\t]);\n\n\tif (!isDevelopmentRuntime()) {\n\t\tcore.enableProdMode();\n\t}\n\n\tinitDominoAdapter(platformServer);\n\n\treturn {\n\t\tAPP_BASE_HREF: common.APP_BASE_HREF,\n\t\tbootstrapApplication: platformBrowser.bootstrapApplication,\n\t\tComponent: core.Component,\n\t\tDomSanitizer: platformBrowser.DomSanitizer,\n\t\tENVIRONMENT_INITIALIZER: core.ENVIRONMENT_INITIALIZER,\n\t\tinject: core.inject,\n\t\tInjectionToken: core.InjectionToken,\n\t\tNgComponentOutlet: common.NgComponentOutlet,\n\t\tprovideClientHydration: platformBrowser.provideClientHydration,\n\t\tprovideServerRendering: platformServer.provideServerRendering,\n\t\tprovideZonelessChangeDetection: core.provideZonelessChangeDetection,\n\t\treflectComponentType: core.reflectComponentType,\n\t\trenderApplication: platformServer.renderApplication,\n\t\tREQUEST: core.REQUEST,\n\t\tREQUEST_CONTEXT: core.REQUEST_CONTEXT,\n\t\tRESPONSE_INIT: core.RESPONSE_INIT,\n\t\tSanitizer: core.Sanitizer,\n\t\tSecurityContext: core.SecurityContext,\n\t\twithHttpTransferCacheOptions:\n\t\t\tplatformBrowser.withHttpTransferCacheOptions\n\t};\n};\n\nlet angularDeps: Promise<AngularDeps> | null = null;\n\nexport const getAngularDeps = () => {\n\tif (!angularDeps) {\n\t\tangularDeps = loadAngularDeps();\n\t}\n\n\treturn angularDeps;\n};\n\n// TODO(test): the unit-style coverage in\n// `tests/integration/angular/single-core.test.ts` checks that\n// `resolveAngularRuntimePath` is consistent across calls and that two\n// dynamic imports from the resolved path return the same module record\n// — necessary but not sufficient. A stronger test would spawn a dev\n// server, trigger an HMR cycle, and assert the SSR process never sees\n// two `@angular/core` evaluations (e.g. via a marker incremented at\n// module init in a vendor stub). The fixture in\n// `tests/fixtures/compile-angular` is wired for compile-time checks\n// only, so end-to-end verification of the SSR core uniqueness fix\n// happens manually in `~/onspark/absolutejs/dealroom` (see\n// docs/ABSOLUTEJS_ANGULAR_HMR.md §3.9).\n",
|
|
26
|
-
"/**\n * Utility for registering client-side scripts that need to run after Angular SSR hydration.\n *\n * This is necessary because Angular's lifecycle hooks don't always run reliably on the client\n * after SSR hydration, especially for event listeners attached to DOM elements.\n *\n * Usage in Angular components:\n * ```typescript\n * import { registerClientScript } from '@absolutejs/absolute';\n *\n * // Register an event listener script\n * registerClientScript(() => {\n * const element = document.querySelector('.my-element');\n * if (element) {\n * element.addEventListener('click', () => {\n * console.log('Clicked!');\n * });\n * }\n * });\n * ```\n *\n * The script will be automatically injected into the HTML response and executed on the client.\n */\n\n// Request-scoped registry for client scripts\n// Each request gets its own set of scripts to inject\nconst scriptRegistry = new Map<string, Set<() => void>>();\n\n// Generate a unique request ID for tracking scripts per request\nlet requestCounter = 0;\nconst getRequestId = () => `req_${Date.now()}_${++requestCounter}`;\n\n// Allow SSR frameworks to inject a request context getter (e.g. AsyncLocalStorage)\nlet ssrContextGetter: (() => string | undefined) | null = null;\nexport const getSsrContextId = () =>\n\tssrContextGetter?.() ||\n\tObject.getOwnPropertyDescriptor(globalThis, '__absolutejs_requestId')\n\t\t?.value;\nexport const registerClientScript = (\n\tscript: () => void,\n\trequestId?: string\n) => {\n\t// Try to get requestId from explicit arg, then Async Context, then global fallback\n\tconst id = requestId || getSsrContextId() || getRequestId();\n\n\tif (!scriptRegistry.has(id)) {\n\t\tscriptRegistry.set(id, new Set());\n\t}\n\n\tscriptRegistry.get(id)?.add(script);\n\n\treturn id;\n};\nexport const setSsrContextGetter = (getter: () => string | undefined) => {\n\tssrContextGetter = getter;\n};\n\n// Make registerClientScript available globally during SSR for Angular components\n// Using type assertion for globalThis extension\nif (typeof globalThis !== 'undefined') {\n\tObject.assign(globalThis, { registerClientScript });\n}\n\n/**\n * Get all registered scripts for a request and clear them.\n * This is called by the page handler after rendering.\n *\n * @param requestId - The request ID to get scripts for\n * @returns Array of script functions, or empty array if none registered\n */\nexport const clearAllClientScripts = () => {\n\tscriptRegistry.clear();\n};\nexport const generateClientScriptCode = (scripts: (() => void)[]) => {\n\tif (scripts.length === 0) {\n\t\treturn '';\n\t}\n\n\t// Convert functions to strings and wrap in IIFE\n\tconst scriptCode = scripts\n\t\t.map((script, index) => {\n\t\t\t// Get the function body as a string\n\t\t\tconst funcString = script.toString();\n\n\t\t\t// Extract the body (everything between { and })\n\t\t\tconst bodyMatch = funcString.match(/\\{([\\s\\S]*)\\}/);\n\t\t\tif (!bodyMatch || !bodyMatch[1]) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tconst body = bodyMatch[1].trim();\n\n\t\t\t// Wrap in IIFE with MutationObserver for DOM readiness\n\t\t\treturn `\n\t(function() {\n\t\tvar executed = false;\n\t\tfunction executeScript_${index}() {\n\t\t\tif (executed) return;\n\t\t\texecuted = true;\n\t\t\t${body}\n\t\t}\n\n\t\tif (document.readyState === 'complete' || document.readyState === 'interactive') {\n\t\t\texecuteScript_${index}();\n\t\t} else {\n\t\t\tdocument.addEventListener('DOMContentLoaded', executeScript_${index});\n\t\t}\n\n\t\t// Watch for hydration-added elements\n\t\tvar observer = new MutationObserver(function() {\n\t\t\texecuteScript_${index}();\n\t\t\tif (executed) observer.disconnect();\n\t\t});\n\t\tif (!executed) {\n\t\t\tobserver.observe(document.body || document.documentElement, { childList: true, subtree: true });\n\t\t}\n\n\t\t// Single fallback timeout\n\t\tsetTimeout(function() {\n\t\t\texecuteScript_${index}();\n\t\t\tobserver.disconnect();\n\t\t}, 1000);\n\t})();`;\n\t\t})\n\t\t.join('\\n');\n\n\treturn `<script>\n(function() {\n${scriptCode}\n})();\n</script>`;\n};\nexport const getAndClearClientScripts = (requestId?: string) => {\n\tconst id = requestId || ssrContextGetter?.();\n\tif (!id) return [];\n\n\tconst scripts = scriptRegistry.get(id);\n\tif (!scripts) {\n\t\treturn [];\n\t}\n\n\tconst scriptArray = Array.from(scripts);\n\tscriptRegistry.delete(id);\n\n\treturn scriptArray;\n};\n",
|
|
27
|
-
"import type { HttpTransferCacheOptions } from '@angular/common/http';\n\nexport const ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER = 'x-skip-transfer-cache';\n\nexport type AbsoluteHttpTransferCacheOptions = Omit<\n\tHttpTransferCacheOptions,\n\t'filter'\n> & {\n\tfilter?: NonNullable<HttpTransferCacheOptions['filter']>;\n\tskipHeader?: string;\n};\n\nexport const buildAbsoluteHttpTransferCacheOptions = (\n\toptions: AbsoluteHttpTransferCacheOptions = {}\n) => {\n\tconst {\n\t\tfilter: userFilter,\n\t\tskipHeader = ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER,\n\t\t...angularOptions\n\t} = options;\n\n\treturn {\n\t\tincludePostRequests: false,\n\t\tincludeRequestsWithAuthHeaders: false,\n\t\t...angularOptions,\n\t\tfilter: (request) =>\n\t\t\t!request.headers.has(skipHeader) && (userFilter?.(request) ?? true)\n\t} satisfies HttpTransferCacheOptions;\n};\n",
|
|
28
|
-
"import type { AngularDeps } from '../../types/angular';\n\n/* `REQUEST`, `REQUEST_CONTEXT`, and `RESPONSE_INIT` are public Angular DI\n tokens — import them directly from `@angular/core`. Re-exporting them\n here would force a static `import { ... } from \"@angular/core\"` into\n every absolutejs bundle that transitively reaches this file, breaking\n non-Angular consumers (no `@angular/core` installed) at module-load\n time. Bun's bundler treats `await import(\"./angular/...\")` as a\n static dep when `splitting: false`, so even guarded dynamic loaders\n on the consumer side pull this file in. The cleanest fix is to not\n own these symbols here at all. */\n\nexport const buildRequestProviders = (\n\tdeps: AngularDeps,\n\trequest: Request | undefined,\n\trequestContext: unknown,\n\tresponseInit: ResponseInit | undefined\n) => [\n\t{ provide: deps.REQUEST, useValue: request ?? null },\n\t{ provide: deps.REQUEST_CONTEXT, useValue: requestContext ?? null },\n\t{ provide: deps.RESPONSE_INIT, useValue: responseInit ?? null }\n];\n",
|
|
29
|
-
"import type { EnvironmentProviders, Provider, Type } from '@angular/core';\nimport type { BootstrapContext } from '@angular/platform-browser';\nimport type { AngularDeps, CachedRouteData } from '../../types/angular';\nimport {\n\tgetAndClearClientScripts,\n\tgenerateClientScriptCode\n} from '../utils/registerClientScript';\nimport { buildAbsoluteHttpTransferCacheOptions } from './httpTransferCache';\nimport { buildRequestProviders } from './requestProviders';\n\n// --- Last-used requestContext cache for HMR ---\n// Stores { requestContext, headTag } from the most recent real request per\n// route so HMR re-renders with the same data the user last saw.\n\nconst routeContextCache = new Map<string, CachedRouteData>();\n\nexport const cacheRouteData = (pagePath: string, data: CachedRouteData) => {\n\tconst cacheKey = pagePath.split('?')[0] ?? pagePath;\n\trouteContextCache.set(cacheKey, data);\n};\nexport const getCachedRouteData = (pagePath: string) =>\n\trouteContextCache.get(pagePath);\n\n// --- Selector cache ---\n\nconst selectorCache = new Map<string, string>();\nexport const buildProviders = (\n\tdeps: AngularDeps,\n\tsanitizer: InstanceType<AngularDeps['DomSanitizer']>,\n\trequest: Request | undefined,\n\trequestContext: unknown,\n\tresponseInit: ResponseInit | undefined,\n\tuserProviders: ReadonlyArray<Provider | EnvironmentProviders> = []\n) => [\n\tdeps.provideServerRendering(),\n\tdeps.provideClientHydration(\n\t\tdeps.withHttpTransferCacheOptions(\n\t\t\tbuildAbsoluteHttpTransferCacheOptions()\n\t\t)\n\t),\n\tdeps.provideZonelessChangeDetection(),\n\t{ provide: deps.APP_BASE_HREF, useValue: '/' },\n\t{ provide: deps.DomSanitizer, useValue: sanitizer },\n\t{ provide: deps.Sanitizer, useValue: sanitizer },\n\t...buildRequestProviders(deps, request, requestContext, responseInit),\n\t...userProviders\n];\nexport const clearSelectorCache = () => selectorCache.clear();\n\nexport const resolveSelector = (\n\tdeps: AngularDeps,\n\tpagePath: string,\n\tPageComponent: Type<unknown>\n) => {\n\tconst cached = selectorCache.get(pagePath);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst selector =\n\t\tdeps.reflectComponentType(PageComponent)?.selector ?? 'ng-app';\n\tselectorCache.set(pagePath, selector);\n\n\treturn selector;\n};\n\n// --- Inject HTML helper ---\n\nconst injectBeforeClose = (html: string, snippet: string) => {\n\tif (html.includes('</body>')) {\n\t\treturn html.replace('</body>', `${snippet}</body>`);\n\t}\n\tif (html.includes('</html>')) {\n\t\treturn html.replace('</html>', `${snippet}</html>`);\n\t}\n\n\treturn html + snippet;\n};\n\n// --- Post-render HTML injection ---\n\nexport const injectSsrScripts = (\n\thtml: string,\n\trequestId: string,\n\tindexPath: string,\n\trequestContext?: unknown\n) => {\n\tlet result = html;\n\n\tconst registeredScripts = getAndClearClientScripts(requestId);\n\tif (registeredScripts.length > 0) {\n\t\tresult = injectBeforeClose(\n\t\t\tresult,\n\t\t\tgenerateClientScriptCode(registeredScripts)\n\t\t);\n\t}\n\n\tif (requestContext !== undefined) {\n\t\tresult = injectBeforeClose(\n\t\t\tresult,\n\t\t\t`<script>window.__ABS_ANGULAR_REQUEST_CONTEXT__ = ${JSON.stringify(requestContext)};</script>`\n\t\t);\n\t}\n\n\tif (indexPath) {\n\t\tconst escapedIndexPath = JSON.stringify(indexPath);\n\t\tresult = injectBeforeClose(\n\t\t\tresult,\n\t\t\t`<script>import(${escapedIndexPath});</script>`\n\t\t);\n\t}\n\n\treturn result;\n};\nexport const renderAngularApp = async (\n\tdeps: AngularDeps,\n\tPageComponent: Type<unknown>,\n\tproviders: (Provider | EnvironmentProviders)[],\n\tdocument: string | Document,\n\turl: string = '/'\n) => {\n\tconst bootstrap = (context: BootstrapContext) =>\n\t\tdeps.bootstrapApplication(PageComponent, { providers }, context);\n\n\treturn withSuppressedAngularDevLogs(() =>\n\t\tdeps.renderApplication(bootstrap, {\n\t\t\tdocument,\n\t\t\tplatformProviders: [],\n\t\t\turl\n\t\t})\n\t);\n};\nexport const withSuppressedAngularDevLogs = async <T>(\n\trender: () => Promise<T>\n) => {\n\tconst origLog = console.log;\n\tconsole.log = (...args: unknown[]) => {\n\t\tif (\n\t\t\ttypeof args[0] === 'string' &&\n\t\t\targs[0].includes('development mode')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\torigLog.apply(console, args);\n\t};\n\n\ttry {\n\t\treturn await render();\n\t} finally {\n\t\tconsole.log = origLog;\n\t}\n};\n",
|
|
30
|
-
"import { getAngularDeps } from './angularDeps';\nimport { withSuppressedAngularDevLogs } from './ssrRender';\nimport { getSsrContextId } from '../utils/registerClientScript';\n\nconst angularIslandSelector = 'abs-angular-island';\n\nexport const getAngularIslandSelector = (_islandId: string) =>\n\tangularIslandSelector;\nexport const isAngularComponent = (\n\tvalue: unknown\n): value is import('@angular/core').Type<object> => typeof value === 'function';\n\nconst getSelectorFromRenderedIsland = (rootElement: HTMLElement) => {\n\tconst firstChild = rootElement.firstElementChild;\n\tif (!(firstChild instanceof HTMLElement)) {\n\t\treturn null;\n\t}\n\n\tconst selector = firstChild.tagName.toLowerCase();\n\n\treturn selector.length > 0 ? selector : null;\n};\n\nconst getClientAngularComponentSelector = (\n\tcomponent: import('@angular/core').Type<object>\n) => {\n\tconst maybeDef = Reflect.get(component, 'ɵcmp');\n\tif (typeof maybeDef !== 'object' || maybeDef === null) {\n\t\treturn null;\n\t}\n\n\tconst maybeSelectors = Reflect.get(maybeDef, 'selectors');\n\tif (!Array.isArray(maybeSelectors)) {\n\t\treturn null;\n\t}\n\n\tconst [firstSelectorGroup] = maybeSelectors;\n\tif (!Array.isArray(firstSelectorGroup)) {\n\t\treturn null;\n\t}\n\n\tconst [selector] = firstSelectorGroup;\n\n\treturn typeof selector === 'string' && selector.length > 0\n\t\t? selector\n\t\t: null;\n};\n\nconst createAngularIslandApp = async () => {\n\tconst { EnvironmentInjector, provideZonelessChangeDetection } =\n\t\tawait import('@angular/core');\n\tconst { createApplication } = await import('@angular/platform-browser');\n\tconst app = await createApplication({\n\t\tproviders: [provideZonelessChangeDetection()]\n\t});\n\tconst environmentInjector = app.injector.get(EnvironmentInjector);\n\n\treturn { app, environmentInjector };\n};\n\nlet angularIslandAppPromise: Promise<{\n\tapp: import('@angular/core').ApplicationRef;\n\tenvironmentInjector: import('@angular/core').EnvironmentInjector;\n}> | null = null;\n\nconst getAngularIslandApp = async () => {\n\tif (!angularIslandAppPromise) {\n\t\tangularIslandAppPromise = createAngularIslandApp();\n\t}\n\n\treturn angularIslandAppPromise;\n};\n\ntype AngularIslandWrapperMetadata = {\n\tdeps: Awaited<ReturnType<typeof getAngularDeps>>;\n\tpropsToken: import('@angular/core').InjectionToken<Record<string, unknown>>;\n\tselector: string;\n\tWrapperComponent: import('@angular/core').Type<object>;\n};\n\nconst wrapperMetadataCache = new Map<\n\tstring,\n\tPromise<AngularIslandWrapperMetadata>\n>();\nconst requestRenderCache = new Map<string, Map<string, string>>();\n\nconst getRequestRenderCache = () => {\n\tconst requestId = getSsrContextId();\n\tif (!requestId) {\n\t\treturn null;\n\t}\n\n\tconst cached = requestRenderCache.get(requestId);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst renderCache = new Map<string, string>();\n\trequestRenderCache.set(requestId, renderCache);\n\n\treturn renderCache;\n};\n\nconst getAngularIslandWrapperKey = (\n\tcomponent: import('@angular/core').Type<object>,\n\t_islandId: string\n) => {\n\tconst componentName =\n\t\ttypeof component.name === 'string' && component.name.length > 0\n\t\t\t? component.name\n\t\t\t: 'AngularIsland';\n\n\treturn `${componentName}:${angularIslandSelector}`;\n};\n\nconst getIslandRenderCacheKey = (\n\tcomponent: import('@angular/core').Type<object>,\n\tprops: Record<string, unknown>\n) => {\n\tconst componentName =\n\t\ttypeof component.name === 'string' && component.name.length > 0\n\t\t\t? component.name\n\t\t\t: 'AngularIsland';\n\n\treturn `${componentName}:${JSON.stringify(props)}`;\n};\n\nconst buildAngularIslandWrapperMetadata = async (\n\tcomponent: import('@angular/core').Type<object>,\n\tislandId: string,\n\twrapperKey: string\n) => {\n\t// Resolve Angular through getAngularDeps so the wrapper is built with the\n\t// SAME Angular instance that renders it. In production server-side imports\n\t// point at the pre-linked Angular vendor bundle; bare `@angular/*` imports\n\t// here would instead resolve to node_modules, giving the wrapper component\n\t// (its decorator, InjectionToken and inject) a different Angular instance\n\t// than the render pipeline's injector — every cross-instance token lookup\n\t// then fails with NG0201. (Dev uses a single node_modules Angular, so this\n\t// only manifests in production.)\n\tconst deps = await getAngularDeps();\n\tconst { Component, InjectionToken, NgComponentOutlet, inject } = deps;\n\tconst selector = getAngularIslandSelector(islandId);\n\tconst propsToken = new InjectionToken<Record<string, unknown>>(\n\t\t`${wrapperKey}:props`\n\t);\n\n\tclass AngularIslandWrapperComponent {\n\t\tcomponent = component;\n\t\tprops = inject(propsToken);\n\t}\n\n\treturn {\n\t\tdeps,\n\t\tpropsToken,\n\t\tselector,\n\t\tWrapperComponent: Component({\n\t\t\timports: [NgComponentOutlet, component],\n\t\t\tselector,\n\t\t\tstandalone: true,\n\t\t\ttemplate:\n\t\t\t\t'<ng-container *ngComponentOutlet=\"component; inputs: props\"></ng-container>'\n\t\t})(AngularIslandWrapperComponent)\n\t};\n};\n\nconst createAngularIslandWrapper = async (\n\tcomponent: import('@angular/core').Type<object>,\n\tislandId: string\n) => {\n\tconst wrapperKey = getAngularIslandWrapperKey(component, islandId);\n\tconst cached = wrapperMetadataCache.get(wrapperKey);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst metadataPromise = buildAngularIslandWrapperMetadata(\n\t\tcomponent,\n\t\tislandId,\n\t\twrapperKey\n\t);\n\n\twrapperMetadataCache.set(wrapperKey, metadataPromise);\n\n\treturn metadataPromise;\n};\n\nconst extractAngularIslandRoot = (html: string, selector: string) => {\n\tconst openTag = `<${selector}`;\n\tconst start = html.indexOf(openTag);\n\tif (start < 0) {\n\t\tthrow new Error(`Could not find Angular island root \"${selector}\".`);\n\t}\n\n\tconst endTag = `</${selector}>`;\n\tconst end = html.indexOf(endTag, start);\n\tif (end < 0) {\n\t\tthrow new Error(`Could not close Angular island root \"${selector}\".`);\n\t}\n\n\treturn html.slice(start, end + endTag.length);\n};\n\nexport const mountAngularIsland = async <Props extends Record<string, unknown>>(\n\tcomponent: import('@angular/core').Type<object>,\n\telement: HTMLElement,\n\tprops: Props,\n\tislandId: string\n) => {\n\tawait import('@angular/compiler');\n\tconst { createComponent, inputBinding } = await import('@angular/core');\n\tconst selector = getAngularIslandSelector(islandId);\n\tconst { app, environmentInjector } = await getAngularIslandApp();\n\n\tlet rootElement = element.querySelector(selector);\n\tif (!(rootElement instanceof HTMLElement)) {\n\t\telement.innerHTML = `<${selector}></${selector}>`;\n\t\trootElement = element.querySelector(selector);\n\t}\n\tif (!(rootElement instanceof HTMLElement)) return app;\n\n\tconst componentSelector =\n\t\tgetClientAngularComponentSelector(component) ??\n\t\tgetSelectorFromRenderedIsland(rootElement);\n\tif (!componentSelector) return app;\n\n\trootElement.innerHTML = `<${componentSelector}></${componentSelector}>`;\n\tconst hostElement = rootElement.querySelector(componentSelector);\n\tif (!(hostElement instanceof HTMLElement)) return app;\n\n\tconst bindings = Object.entries(props).map(([key, value]) =>\n\t\tinputBinding(key, () => value)\n\t);\n\tconst componentRef = createComponent(component, {\n\t\tbindings,\n\t\tenvironmentInjector,\n\t\thostElement\n\t});\n\tapp.attachView(componentRef.hostView);\n\tcomponentRef.changeDetectorRef.detectChanges();\n\twindow.__ABS_ANGULAR_ISLAND_APPS__ ??= [];\n\twindow.__ABS_ANGULAR_ISLAND_APPS__.push(app);\n\n\treturn app;\n};\nexport const renderAngularIslandToHtml = async <\n\tProps extends Record<string, unknown>\n>(\n\tcomponent: import('@angular/core').Type<object>,\n\tprops: Props,\n\tislandId: string\n) => {\n\tconst requestCache = getRequestRenderCache();\n\tconst renderCacheKey = getIslandRenderCacheKey(component, props);\n\tconst cachedHtml = requestCache?.get(renderCacheKey);\n\tif (cachedHtml) {\n\t\treturn cachedHtml;\n\t}\n\n\tconst { deps, propsToken, selector, WrapperComponent } =\n\t\tawait createAngularIslandWrapper(component, islandId);\n\n\tconst providers: (\n\t\t| import('@angular/core').Provider\n\t\t| import('@angular/core').EnvironmentProviders\n\t)[] = [\n\t\tdeps.provideServerRendering(),\n\t\tdeps.provideZonelessChangeDetection(),\n\t\t{ provide: deps.APP_BASE_HREF, useValue: '/' },\n\t\t{ provide: propsToken, useValue: props }\n\t];\n\tconst document = `<!DOCTYPE html><html><body><${selector}></${selector}></body></html>`;\n\tconst html = await withSuppressedAngularDevLogs(() =>\n\t\tdeps.renderApplication(\n\t\t\t(context) =>\n\t\t\t\tdeps.bootstrapApplication(\n\t\t\t\t\tWrapperComponent,\n\t\t\t\t\t{ providers },\n\t\t\t\t\tcontext\n\t\t\t\t),\n\t\t\t{\n\t\t\t\tdocument,\n\t\t\t\tplatformProviders: [],\n\t\t\t\turl: '/'\n\t\t\t}\n\t\t)\n\t);\n\tconst islandHtml = extractAngularIslandRoot(html, selector);\n\trequestCache?.set(renderCacheKey, islandHtml);\n\n\treturn islandHtml;\n};\n",
|
|
31
|
-
"type ReactComponentType<Props extends Record<string, unknown>> =\n\timport('react').ComponentType<Props>;\n\nconst renderAngularIslandToHtmlInternal = async (\n\tcomponent: import('@angular/core').Type<object>,\n\tprops: Record<string, unknown>,\n\tislandId: string\n) => {\n\tconst { renderAngularIslandToHtml } = await import('../angular/islands');\n\n\treturn renderAngularIslandToHtml(component, props, islandId);\n};\nexport const renderAngularIslandToHtml = renderAngularIslandToHtmlInternal;\n// React 19 hoists resources (`<link rel=\"preload\">` for images, stylesheet\n// links, etc.) to the FRONT of server output. In a full document these go to\n// `<head>`. An island is SSR'd as an isolated fragment, so they land inline as\n// leading siblings before the component's real root — but during standalone\n// client hydration React routes the same resources to `document.head` instead,\n// so the fragment's first child differs (server `<link>`, client the component\n// root) and hydration mismatches. Strip these leading hoisted tags so the SSR\n// fragment matches what the island root renders on the client. They're perf\n// hints; dropping them from the fragment doesn't affect the rendered UI.\nconst LEADING_HOISTED_RESOURCE_RE =\n\t/^\\s*(?:<link\\b[^>]*\\/?>|<meta\\b[^>]*\\/?>|<title\\b[^>]*>[\\s\\S]*?<\\/title>|<style\\b[^>]*>[\\s\\S]*?<\\/style>|<script\\b[^>]*>[\\s\\S]*?<\\/script>)/i;\n\nconst stripLeadingHoistedResources = (html: string) => {\n\tlet result = html;\n\tlet match = LEADING_HOISTED_RESOURCE_RE.exec(result);\n\twhile (match) {\n\t\tresult = result.slice(match[0].length);\n\t\tmatch = LEADING_HOISTED_RESOURCE_RE.exec(result);\n\t}\n\n\treturn result.trimStart();\n};\n\nexport const renderReactIslandToHtml = <Props extends Record<string, unknown>>(\n\tcomponent: ReactComponentType<Props>,\n\tprops: Props\n) =>\n\timport('react').then(({ createElement }) =>\n\t\timport('react-dom/server').then(({ renderToString }) =>\n\t\t\tstripLeadingHoistedResources(\n\t\t\t\trenderToString(createElement(component, props))\n\t\t\t)\n\t\t)\n\t);\nexport const renderSvelteIslandToHtml = <Props extends Record<string, unknown>>(\n\tcomponent: import('svelte').Component<Props>,\n\tprops: Props\n) =>\n\timport('svelte/server').then(({ render }) => {\n\t\tconst { body } = render(component, { props });\n\n\t\treturn body;\n\t});\nexport const renderVueIslandToHtml = <Props extends Record<string, unknown>>(\n\tcomponent: import('vue').Component<Props>,\n\tprops: Props\n) =>\n\timport('vue').then(({ createSSRApp, h: createVueVNode }) => {\n\t\tconst app = createSSRApp({\n\t\t\trender: () => createVueVNode(component, props)\n\t\t});\n\n\t\treturn import('vue/server-renderer').then(({ renderToString }) =>\n\t\t\trenderToString(app)\n\t\t);\n\t});\n",
|
|
32
|
-
"/** Native Zig import rewriter — 15x faster than JS regex on large files.\n * Falls back to JS if the native addon isn't available (Windows, missing .so). */\n\nimport { dlopen, FFIType, ptr } from 'bun:ffi';\nimport { platform, arch } from 'node:os';\nimport { resolve } from 'node:path';\n\nconst ffiDefinition = {\n\trewrite_imports: {\n\t\targs: [\n\t\t\tFFIType.ptr,\n\t\t\tFFIType.u64,\n\t\t\tFFIType.ptr,\n\t\t\tFFIType.u64,\n\t\t\tFFIType.ptr,\n\t\t\tFFIType.ptr\n\t\t],\n\t\treturns: FFIType.i32\n\t}\n} as const;\n\ntype NativeLib = ReturnType<typeof dlopen<typeof ffiDefinition>>['symbols'];\n\nlet nativeLib: NativeLib | null = null;\n\nconst loadNative = () => {\n\tif (nativeLib !== null) return nativeLib;\n\n\tconst osPlatform = platform();\n\tconst cpu = arch();\n\n\tconst platformMap: Record<string, string> = {\n\t\t'darwin-arm64': 'darwin-arm64/fast_ops.dylib',\n\t\t'darwin-x64': 'darwin-x64/fast_ops.dylib',\n\t\t'linux-arm64': 'linux-arm64/fast_ops.so',\n\t\t'linux-x64': 'linux-x64/fast_ops.so',\n\t\t'win32-arm64': 'windows-arm64/fast_ops.dll',\n\t\t'win32-x64': 'windows-x64/fast_ops.dll'\n\t};\n\n\tconst libPath = platformMap[`${osPlatform}-${cpu}`];\n\tif (!libPath) return null;\n\n\ttry {\n\t\tconst fullPath = resolve(\n\t\t\timport.meta.dir,\n\t\t\t'../../native/packages',\n\t\t\tlibPath\n\t\t);\n\t\tconst lib = dlopen(fullPath, ffiDefinition);\n\t\tnativeLib = lib.symbols;\n\n\t\treturn nativeLib;\n\t} catch {\n\t\treturn null;\n\t}\n};\n\n/** Rewrite import specifiers in a string using the native Zig scanner.\n * Returns the rewritten string, or null if native isn't available. */\nexport const nativeRewriteImports = (\n\tcontent: string,\n\treplacements: [string, string][]\n) => {\n\tconst lib = loadNative();\n\tif (!lib) return null;\n\n\t// Format replacements as JSON array of [specifier, webPath] pairs\n\tconst jsonStr = JSON.stringify(replacements);\n\tconst contentBuf = Buffer.from(content);\n\tconst jsonBuf = Buffer.from(jsonStr);\n\tconst outBuf = Buffer.alloc(content.length * 2);\n\n\t// outLenPtr is a pointer to a usize (8 bytes on 64-bit)\n\tconst outLenBuf = new BigUint64Array([BigInt(outBuf.length)]);\n\n\tconst result = lib.rewrite_imports(\n\t\tptr(contentBuf),\n\t\tcontentBuf.length,\n\t\tptr(jsonBuf),\n\t\tjsonBuf.length,\n\t\tptr(outBuf),\n\t\tptr(new Uint8Array(outLenBuf.buffer))\n\t);\n\n\tif (result < 0) return null;\n\tif (result === 0) return content; // no changes\n\n\tconst outLen = Number(outLenBuf[0]);\n\n\treturn outBuf.subarray(0, outLen).toString('utf-8');\n};\n",
|
|
33
|
-
"/** In-pipeline import rewriter for Bun.build outputs.\n *\n * Replaces the previous post-build `rewriteImports` + `rewriteVendorDirectories`\n * passes that walked file paths captured at scheduling time and read them off\n * disk later — a race window where the next rebuild could sweep a path between\n * capture and read, producing ENOENT.\n *\n * Now: the rewrite operates on the `BuildArtifact` outputs returned by\n * `Bun.build()` itself, in the same await chain. Each output's content is\n * transformed (using the native Zig scanner when available, falling back to\n * the JS regex implementation), then written back to disk. The standalone\n * iteration over a captured path list goes away. */\n\nimport type { BuildArtifact, BuildOutput } from 'bun';\nimport { readdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { nativeRewriteImports } from './nativeRewrite';\n\nconst escapeRegex = (str: string) =>\n\tstr.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n/** JS fallback: regex-based import rewriting. */\nexport const jsRewriteImports = (\n\tcontent: string,\n\treplacements: [string, string][]\n) => {\n\tlet result = content;\n\n\tfor (const [specifier, webPath] of replacements) {\n\t\tconst escaped = escapeRegex(specifier);\n\t\tconst fromRegex = new RegExp(\n\t\t\t`(from\\\\s*[\"'])${escaped}([\"'])`,\n\t\t\t'g'\n\t\t);\n\t\tconst sideEffectRegex = new RegExp(\n\t\t\t`(import\\\\s*[\"'])${escaped}([\"'])`,\n\t\t\t'g'\n\t\t);\n\t\tconst dynamicRegex = new RegExp(\n\t\t\t`(import\\\\s*\\\\(\\\\s*[\"'])${escaped}([\"']\\\\s*\\\\))`,\n\t\t\t'g'\n\t\t);\n\t\tresult = result.replace(fromRegex, `$1${webPath}$2`);\n\t\tresult = result.replace(sideEffectRegex, `$1${webPath}$2`);\n\t\tresult = result.replace(dynamicRegex, `$1${webPath}$2`);\n\t}\n\n\treturn result;\n};\n\n/** Apply the bare-specifier → vendor-URL rewrite to a single chunk of text. */\nexport const rewriteImportsInContent = (\n\tcontent: string,\n\tvendorPaths: Record<string, string>\n) => {\n\tif (Object.keys(vendorPaths).length === 0) return content;\n\n\t// Sort by specifier length (longest first) to avoid partial matches.\n\tconst replacements = Object.entries(vendorPaths).sort(\n\t\t([keyA], [keyB]) => keyB.length - keyA.length\n\t);\n\n\tconst native = nativeRewriteImports(content, replacements);\n\n\treturn native ?? jsRewriteImports(content, replacements);\n};\n\n/** Workaround for a Bun bundler bug: when a module does both\n * `import { x } from 'X'` AND `export * from 'X'`, and `X` is externalized,\n * Bun synthesizes a `__reExport(exports_Y, ns)` call but drops the\n * corresponding `import * as ns from \"X\"` declaration. The resulting chunk\n * references an undeclared identifier and crashes at module evaluation.\n *\n * Detects the pattern and injects the missing namespace import. The source\n * path is recovered from a sibling named-import in the same chunk (Bun keeps\n * that intact). */\nexport const fixMissingReExportNamespacesInContent = (content: string) => {\n\tconst REEXPORT_PATTERN =\n\t\t/__reExport\\(\\s*[A-Za-z_$][\\w$]*\\s*,\\s*([A-Za-z_$][\\w$]*)\\s*\\)/g;\n\n\tREEXPORT_PATTERN.lastIndex = 0;\n\tconst missing: { ident: string; path: string }[] = [];\n\tlet match;\n\twhile ((match = REEXPORT_PATTERN.exec(content)) !== null) {\n\t\tconst ident = match[1];\n\t\tif (!ident) continue;\n\t\tconst nsImportRe = new RegExp(\n\t\t\t`\\\\bimport\\\\s*\\\\*\\\\s*as\\\\s+${ident}\\\\s+from\\\\b`\n\t\t);\n\t\tif (nsImportRe.test(content)) continue;\n\t\tconst declRe = new RegExp(\n\t\t\t`\\\\b(?:const|let|var|function|class)\\\\s+${ident}\\\\b`\n\t\t);\n\t\tif (declRe.test(content)) continue;\n\t\tconst namedImportRe = new RegExp(\n\t\t\t`\\\\bimport\\\\s*\\\\{[^}]*\\\\b${ident}\\\\b[^}]*\\\\}\\\\s*from\\\\b`\n\t\t);\n\t\tif (namedImportRe.test(content)) continue;\n\n\t\tconst importPathRe =\n\t\t\t/(?:from\\s+|import\\s*)[\"']([^\"']+)[\"']/g;\n\t\tlet pathMatch;\n\t\tlet sourcePath: string | undefined;\n\t\twhile ((pathMatch = importPathRe.exec(content)) !== null) {\n\t\t\tconst p = pathMatch[1];\n\t\t\tif (!p) continue;\n\t\t\tconst base = p.split('/').pop()?.replace(/\\.[mc]?js$/, '');\n\t\t\tif (!base) continue;\n\t\t\tconst normalized = base.startsWith('_') ? base.slice(1) : base;\n\t\t\tif (normalized === ident || normalized.endsWith(`_${ident}`)) {\n\t\t\t\tsourcePath = p;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (sourcePath) missing.push({ ident, path: sourcePath });\n\t}\n\n\tif (missing.length === 0) return content;\n\n\tconst seen = new Set<string>();\n\tconst unique = missing.filter((entry) => {\n\t\tif (seen.has(entry.ident)) return false;\n\t\tseen.add(entry.ident);\n\n\t\treturn true;\n\t});\n\n\tconst inserts = unique\n\t\t.map((entry) => `import * as ${entry.ident} from \"${entry.path}\";`)\n\t\t.join('\\n');\n\n\treturn `${inserts}\\n${content}`;\n};\n\nconst isReadableArtifact = (artifact: BuildArtifact) =>\n\tartifact.path.endsWith('.js');\n\n/** In-pipeline output rewrite. Reads each emitted .js artifact, applies the\n * rewrite, and writes back. Operates on `BuildArtifact[]` straight off\n * `Bun.build()`'s result so paths are guaranteed-current — no race window. */\nexport const rewriteBuildOutputs = async (\n\toutputs: BuildArtifact[],\n\tvendorPaths: Record<string, string>\n) => {\n\tif (Object.keys(vendorPaths).length === 0) return;\n\n\tawait Promise.all(\n\t\toutputs.filter(isReadableArtifact).map(async (artifact) => {\n\t\t\tlet original: string;\n\t\t\ttry {\n\t\t\t\toriginal = await artifact.text();\n\t\t\t} catch (err) {\n\t\t\t\tconst code = (err as NodeJS.ErrnoException).code;\n\t\t\t\tif (code === 'ENOENT') return;\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\tconst rewritten = rewriteImportsInContent(original, vendorPaths);\n\t\t\tif (rewritten === original) return;\n\n\t\t\ttry {\n\t\t\t\tawait Bun.write(artifact.path, rewritten);\n\t\t\t} catch (err) {\n\t\t\t\tconst code = (err as NodeJS.ErrnoException).code;\n\t\t\t\tif (code === 'ENOENT') return;\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t})\n\t);\n};\n\n/** Like `rewriteBuildOutputs`, but takes a separate per-artifact resolver to\n * produce path maps. Used for the SSR-side @angular/* rewrite which uses\n * paths relative to each artifact's directory. */\nexport const rewriteBuildOutputsWith = async (\n\toutputs: BuildArtifact[],\n\tresolveVendorPaths: (artifact: BuildArtifact) => Record<string, string>\n) => {\n\tawait Promise.all(\n\t\toutputs.filter(isReadableArtifact).map(async (artifact) => {\n\t\t\tconst vendorPaths = resolveVendorPaths(artifact);\n\t\t\tif (Object.keys(vendorPaths).length === 0) return;\n\n\t\t\tlet original: string;\n\t\t\ttry {\n\t\t\t\toriginal = await artifact.text();\n\t\t\t} catch (err) {\n\t\t\t\tconst code = (err as NodeJS.ErrnoException).code;\n\t\t\t\tif (code === 'ENOENT') return;\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\tconst rewritten = rewriteImportsInContent(original, vendorPaths);\n\t\t\tif (rewritten === original) return;\n\n\t\t\ttry {\n\t\t\t\tawait Bun.write(artifact.path, rewritten);\n\t\t\t} catch (err) {\n\t\t\t\tconst code = (err as NodeJS.ErrnoException).code;\n\t\t\t\tif (code === 'ENOENT') return;\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t})\n\t);\n};\n\n/** Apply the rewrite + re-export fix to every .js file inside a list of\n * vendor directories. Used after vendor builds where each pipeline emits\n * files that may externalize specifiers owned by another pipeline.\n *\n * This still walks the directory because the cross-vendor rewrite happens\n * AFTER all vendor builds complete (so every framework's path map is\n * available) — it doesn't have a single `BuildArtifact[]` to operate on.\n * ENOENT during read/write is tolerated for the same race-protection\n * reason as the in-pipeline path. */\nexport const rewriteVendorDirectories = async (\n\tvendorDirs: string[],\n\tvendorPaths: Record<string, string>\n) => {\n\tif (Object.keys(vendorPaths).length === 0) return;\n\n\tconst allFiles: string[] = [];\n\tfor (const dir of vendorDirs) {\n\t\ttry {\n\t\t\tconst entries = await readdir(dir);\n\t\t\tfor (const entry of entries) {\n\t\t\t\tif (entry.endsWith('.js')) allFiles.push(join(dir, entry));\n\t\t\t}\n\t\t} catch {\n\t\t\t// missing dir is fine — that framework wasn't used\n\t\t}\n\t}\n\n\tawait Promise.all(\n\t\tallFiles.map(async (filePath) => {\n\t\t\tlet original: string;\n\t\t\ttry {\n\t\t\t\toriginal = await Bun.file(filePath).text();\n\t\t\t} catch (err) {\n\t\t\t\tconst code = (err as NodeJS.ErrnoException).code;\n\t\t\t\tif (code === 'ENOENT') return;\n\t\t\t\tthrow err;\n\t\t\t}\n\n\t\t\tlet next = rewriteImportsInContent(original, vendorPaths);\n\t\t\tnext = fixMissingReExportNamespacesInContent(next);\n\n\t\t\tif (next === original) return;\n\t\t\ttry {\n\t\t\t\tawait Bun.write(filePath, next);\n\t\t\t} catch (err) {\n\t\t\t\tconst code = (err as NodeJS.ErrnoException).code;\n\t\t\t\tif (code === 'ENOENT') return;\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t})\n\t);\n};\n\n/** Helper to wrap a `Bun.build` call so the rewrite happens in-pipeline.\n * Use as: `const result = await buildWithImportRewrite(bunBuild(config), vendorPaths)`. */\nexport const buildWithImportRewrite = async (\n\tpendingBuild: Promise<BuildOutput>,\n\tvendorPaths: Record<string, string>\n): Promise<BuildOutput> => {\n\tconst result = await pendingBuild;\n\tif (result.outputs.length > 0) {\n\t\tawait rewriteBuildOutputs(result.outputs, vendorPaths);\n\t}\n\n\treturn result;\n};\n",
|
|
34
|
-
"import { mkdir } from 'node:fs/promises';\nimport { dirname, join, relative } from 'node:path';\nimport { resolveAngularRuntimePath } from '../angular/resolveAngularPackage';\nimport { rewriteImportsInContent } from '../build/rewriteImportsPlugin';\nimport { isProductionRuntime } from '../utils/runtimeMode';\n\n// On-the-fly server-module compiler for cross-framework Angular islands —\n// the Angular analogue of `compileSvelteServerModule`/`compileVueServerModule`.\n//\n// At SSR the island registry's build reference for an Angular island points at\n// the raw component `.ts`. Importing it directly resolves its bare `@angular/*`\n// to node_modules — a DIFFERENT Angular instance than the pre-linked server\n// vendor that the render pipeline (`getAngularDeps`) and every bundled server\n// page use — so the JIT-compiled component injects across instances and every\n// DI lookup fails with NG0201. (Dev shares one node_modules Angular, so it only\n// bites production.)\n//\n// Fix: bundle the component with its relative deps (sibling components, the\n// shared store) but leave every npm package external, then rewrite the bare\n// `@angular/*` specifiers to the same vendor files `getAngularDeps` resolves.\n// The component then JIT-compiles against the vendor Angular, so its factory and\n// the render pipeline's injector share one instance. Package deps stay external:\n// `@angular/*` is redirected to the vendor; `IslandStore`\n// (`@absolutejs/absolute/angular`, `providedIn: 'root'`, no constructor deps)\n// resolves cross-instance via its plain `ɵprov`; and the vendor\n// `@angular/compiler` JIT facade is already loaded by the bundled server entry.\n// (Bundling the package graph instead drags in Angular's SSR view-engine\n// optional deps — `consolidate` → ejs/handlebars/… — which fail to resolve.)\n\nconst serverCacheRoot = join(\n\tprocess.cwd(),\n\t'.absolutejs',\n\t'islands',\n\t'angular'\n);\nconst compiledModuleCache = new Map<string, Promise<string>>();\nconst ANGULAR_SPECIFIER_RE = /[\"'](@angular\\/[^\"']+)[\"']/g;\n\nconst getCachedModulePath = (sourcePath: string) => {\n\tconst relativeSourcePath = relative(process.cwd(), sourcePath).replace(\n\t\t/\\\\/g,\n\t\t'/'\n\t);\n\tconst normalizedSourcePath = relativeSourcePath.startsWith('..')\n\t\t? sourcePath.replace(/[:\\\\/]/g, '_')\n\t\t: relativeSourcePath;\n\n\treturn join(serverCacheRoot, `${normalizedSourcePath}.server.js`);\n};\n\n// Map every `@angular/*` specifier the bundle still imports to its vendor file.\n// Gated on `isProductionRuntime()` to stay in lockstep with `getAngularDeps`,\n// which only resolves to the vendor in production (`useBareSpecifiers =\n// !isProductionRuntime()`) and uses bare node_modules specifiers otherwise — in\n// dev and during the build-time static prerender. Rewriting unconditionally\n// would pin the component to the vendor while the render pipeline used\n// node_modules, re-creating the NG0201 dual-instance split in reverse.\nconst collectVendorPaths = (code: string) => {\n\tconst vendorPaths: Record<string, string> = {};\n\tif (!isProductionRuntime()) {\n\t\treturn vendorPaths;\n\t}\n\tconst specifiers = new Set(\n\t\t[...code.matchAll(ANGULAR_SPECIFIER_RE)].map((match) => match[1])\n\t);\n\tspecifiers.forEach((specifier) => {\n\t\tif (!specifier) return;\n\t\tconst resolved = resolveAngularRuntimePath(specifier);\n\t\tif (resolved === specifier) return;\n\t\tvendorPaths[specifier] = resolved;\n\t});\n\n\treturn vendorPaths;\n};\n\nconst buildAngularServerModule = async (sourcePath: string) => {\n\tconst result = await Bun.build({\n\t\tentrypoints: [sourcePath],\n\t\tformat: 'esm',\n\t\tpackages: 'external',\n\t\ttarget: 'bun',\n\t\tthrow: false\n\t});\n\tconst entry = result.outputs.find(\n\t\t(output) => output.kind === 'entry-point'\n\t);\n\tif (!result.success || !entry) {\n\t\tconst message = result.logs.map((log) => String(log)).join('\\n');\n\t\tthrow new Error(\n\t\t\t`Failed to compile Angular island server module for \"${sourcePath}\":\\n${message}`\n\t\t);\n\t}\n\n\tconst code = await entry.text();\n\tconst rewritten = rewriteImportsInContent(code, collectVendorPaths(code));\n\tconst modulePath = getCachedModulePath(sourcePath);\n\tawait mkdir(dirname(modulePath), { recursive: true });\n\tawait Bun.write(modulePath, rewritten);\n\n\treturn modulePath;\n};\n\nexport const compileAngularServerModule = (sourcePath: string) => {\n\tconst cached = compiledModuleCache.get(sourcePath);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst compiledModulePromise = buildAngularServerModule(sourcePath);\n\tcompiledModuleCache.set(sourcePath, compiledModulePromise);\n\n\treturn compiledModulePromise;\n};\n",
|
|
35
|
-
"import { resolve, join } from 'node:path';\nimport { existsSync, readFileSync } from 'node:fs';\n\n/**\n * Resolve a bare module import (e.g. \"@absolutejs/absolute/svelte/components/Image.svelte\")\n * to an absolute file path by reading the package's exports map in package.json.\n *\n * Returns the resolved absolute path, or null if the import can't be resolved.\n */\ntype ExportConditions = 'browser' | 'import';\n\nconst resolveExportPath = (\n\tentry: unknown,\n\tconditions: ExportConditions[]\n) => {\n\tif (typeof entry === 'string') return entry;\n\tif (!entry || typeof entry !== 'object') return null;\n\n\tfor (const condition of conditions) {\n\t\tconst target = Reflect.get(entry, condition);\n\t\tif (typeof target === 'string') {\n\t\t\treturn target;\n\t\t}\n\t}\n\n\treturn null;\n};\n\nexport const resolvePackageImport = (\n\tspecifier: string,\n\tconditions: ExportConditions[] = ['import']\n) => {\n\t// Only handle bare module imports (not relative or absolute paths)\n\tif (specifier.startsWith('.') || specifier.startsWith('/')) return null;\n\n\t// Split into package name and subpath\n\tconst parts = specifier.split('/');\n\tconst isScoped = specifier.startsWith('@');\n\tconst packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];\n\tconst subpath = isScoped ? parts.slice(2).join('/') : parts.slice(1).join('/');\n\tconst exportKey = subpath ? `./${subpath}` : '.';\n\n\tconst currentPackageJsonPath = resolve(process.cwd(), 'package.json');\n\tconst currentPackageJson = existsSync(currentPackageJsonPath)\n\t\t? JSON.parse(readFileSync(currentPackageJsonPath, 'utf-8'))\n\t\t: null;\n\tconst currentPackageDir =\n\t\tcurrentPackageJson?.name === packageName ? process.cwd() : null;\n\tconst packageDir =\n\t\tcurrentPackageDir ?? resolve(process.cwd(), 'node_modules', packageName ?? '');\n\tconst packageJsonPath = join(packageDir, 'package.json');\n\n\tif (!existsSync(packageJsonPath)) return null;\n\n\ttry {\n\t\tconst packageJson =\n\t\t\tcurrentPackageDir && currentPackageJson\n\t\t\t\t? currentPackageJson\n\t\t\t\t: JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n\t\tconst {exports} = packageJson;\n\n\t\tif (!exports) return null;\n\n\t\t// Try exact match first, then try without extension for .svelte/.vue files\n\t\tconst entry = exports[exportKey];\n\n\t\tif (!entry) return null;\n\n\t\tconst importPath = resolveExportPath(entry, conditions);\n\n\t\tif (!importPath) return null;\n\n\t\tif (currentPackageDir && importPath.startsWith('./dist/')) {\n\t\t\tconst sourceCandidate = resolve(\n\t\t\t\tpackageDir,\n\t\t\t\timportPath.replace(/^\\.\\/dist\\//, './src/')\n\t\t\t);\n\t\t\tif (existsSync(sourceCandidate)) {\n\t\t\t\treturn sourceCandidate;\n\t\t\t}\n\t\t}\n\n\t\tconst resolved = resolve(packageDir, importPath);\n\n\t\treturn existsSync(resolved) ? resolved : null;\n\t} catch {\n\t\treturn null;\n\t}\n};\n",
|
|
36
|
-
"import { BASE_36_RADIX } from '../constants';\n\nconst ISLAND_TAG_RE = /<Island\\b([\\s\\S]*?)\\/>/g;\n\nconst extractBracedExpression = (text: string, braceStart: number) => {\n\tlet depth = 0;\n\tfor (let index = braceStart; index < text.length; index += 1) {\n\t\tconst char = text[index];\n\t\tif (char === '{') depth += 1;\n\t\tif (char === '}') depth -= 1;\n\t\tif (depth === 0) {\n\t\t\treturn text.slice(braceStart + 1, index).trim();\n\t\t}\n\t}\n\n\treturn null;\n};\n\nconst extractIslandAttribute = (attributeString: string, name: string) => {\n\tconst quotedMatch = attributeString.match(\n\t\tnew RegExp(`\\\\b${name}\\\\s*=\\\\s*[\"']([^\"']+)[\"']`)\n\t);\n\tif (quotedMatch?.[1]) {\n\t\treturn { expression: JSON.stringify(quotedMatch[1]), found: true };\n\t}\n\n\tconst attributeIndex = attributeString.search(\n\t\tnew RegExp(`\\\\b${name}\\\\s*=\\\\s*\\\\{`)\n\t);\n\tif (attributeIndex < 0) {\n\t\treturn { expression: '', found: false };\n\t}\n\n\tconst braceStart = attributeString.indexOf('{', attributeIndex);\n\tif (braceStart < 0) {\n\t\treturn { expression: '', found: false };\n\t}\n\n\tconst expression = extractBracedExpression(attributeString, braceStart);\n\tif (expression === null) {\n\t\treturn { expression: '', found: false };\n\t}\n\n\treturn { expression, found: true };\n};\n\nexport const lowerSvelteIslandSyntax = (\n\tsource: string,\n\t_mode: 'server' | 'client' = 'server'\n) => {\n\tif (!source.includes('<Island')) {\n\t\treturn { code: source, transformed: false };\n\t}\n\n\tlet islandIndex = 0;\n\tconst transformedMarkup = source.replace(\n\t\tISLAND_TAG_RE,\n\t\t(fullMatch, attributeString: string) => {\n\t\t\tconst framework = extractIslandAttribute(\n\t\t\t\tattributeString,\n\t\t\t\t'framework'\n\t\t\t);\n\t\t\tconst component = extractIslandAttribute(\n\t\t\t\tattributeString,\n\t\t\t\t'component'\n\t\t\t);\n\t\t\tif (!framework.found || !component.found) {\n\t\t\t\treturn fullMatch;\n\t\t\t}\n\n\t\t\tconst hydrate = extractIslandAttribute(attributeString, 'hydrate');\n\t\t\tconst props = extractIslandAttribute(attributeString, 'props');\n\t\t\tconst slotId = `absolute-svelte-island-${islandIndex.toString(BASE_36_RADIX)}`;\n\t\t\tislandIndex += 1;\n\n\t\t\tconst resolveExpression = `await __absoluteResolveIslandHtml(${JSON.stringify(\n\t\t\t\tslotId\n\t\t\t)}, { component: ${component.expression}, framework: ${framework.expression}, hydrate: ${\n\t\t\t\thydrate.found ? hydrate.expression : JSON.stringify('load')\n\t\t\t}, props: ${props.found ? props.expression : '{}'} })`;\n\n\t\t\treturn `<div data-absolute-island-slot=\"${slotId}\" style=\"display: contents\">{@html ${resolveExpression}}</div>`;\n\t\t}\n\t);\n\n\tconst importLine =\n\t\t'import { resolveIslandHtml as __absoluteResolveIslandHtml } from \"@absolutejs/absolute/svelte\";';\n\n\tif (transformedMarkup.includes('<script')) {\n\t\treturn {\n\t\t\tcode: transformedMarkup.replace(\n\t\t\t\t/<script(\\s[^>]*)?>/,\n\t\t\t\t(match) => `${match}\\n${importLine}\\n`\n\t\t\t),\n\t\t\ttransformed: true\n\t\t};\n\t}\n\n\treturn {\n\t\tcode: `<script lang=\"ts\">\\n${importLine}\\n</script>\\n${transformedMarkup}`,\n\t\ttransformed: true\n\t};\n};\n",
|
|
37
|
-
"import { BASE_36_RADIX } from '../constants';\n\nconst AWAIT_BLOCK_RE =\n\t/\\{#await\\s+([^}]+)\\}([\\s\\S]*?)\\{:then(?:\\s+([A-Za-z_$][\\w$]*))?\\}([\\s\\S]*?)(?:\\{:catch(?:\\s+([A-Za-z_$][\\w$]*))?\\}([\\s\\S]*?))?\\{\\/await\\}/g;\n\nconst escapeTemplateLiteral = (value: string) =>\n\tvalue\n\t\t.replaceAll('\\\\', '\\\\\\\\')\n\t\t.replaceAll('`', '\\\\`')\n\t\t.replaceAll('${', '\\\\${');\n\nconst markupToTemplateLiteral = (markup: string) => {\n\tconst escaped = escapeTemplateLiteral(markup.trim());\n\tconst withExpressions = escaped.replace(\n\t\t/\\{([^{}]+)\\}/g,\n\t\t(_, expression) => `\\${${String(expression).trim()}}`\n\t);\n\n\treturn `\\`${withExpressions}\\``;\n};\n\nexport const lowerSvelteAwaitSlotSyntax = (source: string) => {\n\tif (!source.includes('{#await')) {\n\t\treturn { code: source, transformed: false };\n\t}\n\n\tlet awaitIndex = 0;\n\tlet transformed = false;\n\tconst lowered = source.replace(\n\t\tAWAIT_BLOCK_RE,\n\t\t(\n\t\t\tfullMatch,\n\t\t\tawaitExpression: string,\n\t\t\tpendingMarkup: string,\n\t\t\tthenIdentifier: string | undefined,\n\t\t\tthenMarkup: string,\n\t\t\tcatchIdentifier: string | undefined,\n\t\t\tcatchMarkup: string | undefined\n\t\t) => {\n\t\t\tconst trimmedAwaitExpression = awaitExpression.trim();\n\t\t\tif (!trimmedAwaitExpression) {\n\t\t\t\treturn fullMatch;\n\t\t\t}\n\n\t\t\tconst slotId = `absolute-svelte-await-${awaitIndex.toString(BASE_36_RADIX)}`;\n\t\t\tawaitIndex += 1;\n\t\t\ttransformed = true;\n\n\t\t\tconst thenValueIdentifier =\n\t\t\t\tthenIdentifier?.trim() || '__awaitValue';\n\t\t\tconst catchValueIdentifier =\n\t\t\t\tcatchIdentifier?.trim() || '__awaitError';\n\t\t\tconst fallbackHtml = markupToTemplateLiteral(pendingMarkup);\n\t\t\tconst resolvedHtml = markupToTemplateLiteral(thenMarkup);\n\t\t\tconst rejectedHtml =\n\t\t\t\ttypeof catchMarkup === 'string'\n\t\t\t\t\t? markupToTemplateLiteral(catchMarkup)\n\t\t\t\t\t: null;\n\t\t\tconst catchBranch = rejectedHtml\n\t\t\t\t? `catch (${catchValueIdentifier}) { return ${rejectedHtml}; }`\n\t\t\t\t: 'catch (_absoluteAwaitError) { throw _absoluteAwaitError; }';\n\n\t\t\treturn `<AbsoluteAwaitSlot id=\"${slotId}\" fallbackHtml={${fallbackHtml}} resolve={async () => { try { const ${thenValueIdentifier} = await (${trimmedAwaitExpression}); return ${resolvedHtml}; } ${catchBranch} }} />`;\n\t\t}\n\t);\n\n\tif (!transformed) {\n\t\treturn { code: source, transformed: false };\n\t}\n\n\tconst importLine =\n\t\t'import AbsoluteAwaitSlot from \"@absolutejs/absolute/svelte/components/AwaitSlot.svelte\";';\n\n\tif (lowered.includes('<script')) {\n\t\treturn {\n\t\t\tcode: lowered.replace(\n\t\t\t\t/<script(\\s[^>]*)?>/,\n\t\t\t\t(match) => `${match}\\n${importLine}\\n`\n\t\t\t),\n\t\t\ttransformed: true\n\t\t};\n\t}\n\n\treturn {\n\t\tcode: `<script lang=\"ts\">\\n${importLine}\\n</script>\\n${lowered}`,\n\t\ttransformed: true\n\t};\n};\n",
|
|
38
|
-
"import { createHash } from 'node:crypto';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { readFile } from 'node:fs/promises';\nimport { createRequire } from 'node:module';\nimport {\n\tdirname,\n\textname,\n\tisAbsolute,\n\tjoin,\n\trelative,\n\tresolve\n} from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport type { BunPlugin } from 'bun';\nimport type {\n\tLessPreprocessorOptions,\n\tPostCSSConfig,\n\tSassPreprocessorOptions,\n\tStylePreprocessorConfig,\n\tStylusPreprocessorOptions\n} from '../../types/build';\n\nconst CSS_EXTENSION_PATTERN = /\\.css$/i;\nconst STYLE_EXTENSION_PATTERN = /\\.(s[ac]ss|less|styl(?:us)?)$/i;\nconst STYLE_MODULE_EXTENSION_PATTERN = /\\.module\\.(s[ac]ss|less|styl(?:us)?)$/i;\nconst STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less|styl(?:us)?)$/i;\nconst importOptionalPeer = new Function(\n\t'specifier',\n\t'return import(specifier)'\n) as <T>(specifier: string) => Promise<T>;\nconst requireOptionalPeer = new Function(\n\t'specifier',\n\t'return require(specifier)'\n) as <T>(specifier: string) => T;\nconst requireFromCwd = createRequire(join(process.cwd(), 'package.json'));\n\nexport const isPreprocessableStylePath = (filePath: string) =>\n\tSTYLE_EXTENSION_PATTERN.test(filePath);\n\nexport const isStyleModulePath = (filePath: string) =>\n\tSTYLE_MODULE_EXTENSION_PATTERN.test(filePath);\n\nexport const isStylePath = (filePath: string) =>\n\t/\\.(css|s[ac]ss|less|styl(?:us)?)$/i.test(filePath);\n\nexport const getStyleBaseName = (filePath: string) =>\n\tfilePath.replace(/\\.(css|s[ac]ss|less|styl(?:us)?)$/i, '');\n\nconst getStyleLanguage = (filePathOrLanguage: string) => {\n\tconst normalized = filePathOrLanguage.toLowerCase();\n\tif (normalized === 'scss' || normalized.endsWith('.scss')) return 'scss';\n\tif (normalized === 'sass' || normalized.endsWith('.sass')) return 'sass';\n\tif (normalized === 'less' || normalized.endsWith('.less')) return 'less';\n\tif (\n\t\tnormalized === 'styl' ||\n\t\tnormalized === 'stylus' ||\n\t\tnormalized.endsWith('.styl') ||\n\t\tnormalized.endsWith('.stylus')\n\t)\n\t\treturn 'stylus';\n\n\treturn null;\n};\n\nconst missingDependencyError = (name: string, filePath: string) =>\n\tnew Error(\n\t\t`Unable to compile ${filePath}: install optional dependency \"${name}\" to use this stylesheet preprocessor.`\n\t);\n\n/* Re-throw a preprocessor error with the filename + a one-line summary\n prefixed so the dev server's `[hmr] error` log doesn't print\n `Server error: undefined`. Sass / Less / Stylus all attach useful\n metadata (line, column, snippet) to their errors but the property\n names differ — we surface whatever's available. */\nconst throwPreprocessorError = (\n\terror: unknown,\n\tfilePath: string,\n\tlanguage: StyleLanguage\n): never => {\n\tif (!(error instanceof Error)) {\n\t\tthrow new Error(\n\t\t\t`${language} compile failed in ${filePath}: ${String(error)}`\n\t\t);\n\t}\n\n\tconst detail = error as Error & {\n\t\tline?: number;\n\t\tcolumn?: number;\n\t\textract?: string[];\n\t\tformatted?: string;\n\t\tspan?: { start?: { line?: number; column?: number } };\n\t};\n\tconst sassLine = detail.span?.start?.line;\n\tconst sassCol = detail.span?.start?.column;\n\tconst line = detail.line ?? sassLine;\n\tconst column = detail.column ?? sassCol;\n\tconst location =\n\t\ttypeof line === 'number'\n\t\t\t? `:${line}${typeof column === 'number' ? `:${column}` : ''}`\n\t\t\t: '';\n\tconst message = detail.formatted ?? detail.message;\n\tconst wrapped = new Error(\n\t\t`${language} compile failed in ${filePath}${location}\\n${message}`\n\t);\n\twrapped.cause = error;\n\tthrow wrapped;\n};\n\nconst requireOptionalPeerSync = <T>(specifier: string) => {\n\ttry {\n\t\treturn requireFromCwd(specifier) as T;\n\t} catch {\n\t\treturn requireOptionalPeer<T>(specifier);\n\t}\n};\n\nconst normalizeLoadPaths = (filePath: string, paths: string[] = []) => [\n\tdirname(filePath),\n\tprocess.cwd(),\n\t...paths.map((path) => resolve(process.cwd(), path))\n];\n\ntype StyleLanguage = NonNullable<ReturnType<typeof getStyleLanguage>>;\n\ntype AliasEntry = {\n\tpattern: string;\n\treplacements: string[];\n};\n\nlet tsconfigAliasCache:\n\t| { cwd: string; aliases: AliasEntry[]; baseUrl: string }\n\t| undefined;\n\nconst stripJsonComments = (source: string) =>\n\tsource.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '').replace(/(^|[^:])\\/\\/.*$/gm, '$1');\n\nconst normalizeAliasEntries = (\n\taliases: Record<string, string | string[]> | undefined\n) =>\n\tObject.entries(aliases ?? {}).map(([pattern, value]) => ({\n\t\tpattern,\n\t\treplacements: Array.isArray(value) ? value : [value]\n\t}));\n\nconst readTsconfigAliases = () => {\n\tconst cwd = process.cwd();\n\tif (tsconfigAliasCache?.cwd === cwd) return tsconfigAliasCache;\n\n\tconst tsconfigPath = resolve(cwd, 'tsconfig.json');\n\tconst empty = { aliases: [], baseUrl: cwd, cwd };\n\tif (!existsSync(tsconfigPath)) {\n\t\ttsconfigAliasCache = empty;\n\t\treturn empty;\n\t}\n\n\ttry {\n\t\tconst parsed = JSON.parse(\n\t\t\tstripJsonComments(readFileSync(tsconfigPath, 'utf-8'))\n\t\t);\n\t\tconst compilerOptions = parsed.compilerOptions ?? {};\n\t\tconst baseUrl = resolve(cwd, compilerOptions.baseUrl ?? '.');\n\t\ttsconfigAliasCache = {\n\t\t\taliases: normalizeAliasEntries(compilerOptions.paths),\n\t\t\tbaseUrl,\n\t\t\tcwd\n\t\t};\n\t} catch {\n\t\ttsconfigAliasCache = empty;\n\t}\n\n\treturn tsconfigAliasCache;\n};\n\nconst getAliasEntries = (config: StylePreprocessorConfig | undefined) => {\n\tconst tsconfig = readTsconfigAliases();\n\treturn {\n\t\taliases: [\n\t\t\t...normalizeAliasEntries(config?.aliases),\n\t\t\t...tsconfig.aliases\n\t\t],\n\t\tbaseUrl: tsconfig.baseUrl\n\t};\n};\n\nconst aliasPatternToRegExp = (pattern: string) =>\n\tnew RegExp(\n\t\t`^${pattern\n\t\t\t.split('*')\n\t\t\t.map((part) => part.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n\t\t\t.join('(.+)')}$`\n\t);\n\nconst resolveAliasTargets = (\n\tspecifier: string,\n\tconfig: StylePreprocessorConfig | undefined\n) => {\n\tconst { aliases, baseUrl } = getAliasEntries(config);\n\tconst targets: string[] = [];\n\n\tfor (const alias of aliases) {\n\t\tconst match = specifier.match(aliasPatternToRegExp(alias.pattern));\n\t\tif (!match) continue;\n\t\tconst wildcard = match[1] ?? '';\n\t\tfor (const replacement of alias.replacements) {\n\t\t\ttargets.push(resolve(baseUrl, replacement.replace('*', wildcard)));\n\t\t}\n\t}\n\n\treturn targets;\n};\n\nconst getLanguageExtensions = (language: StyleLanguage) => {\n\tif (language === 'less') return ['.less', '.css'];\n\tif (language === 'stylus') return ['.styl', '.stylus', '.css'];\n\treturn ['.scss', '.sass', '.css'];\n};\n\nconst getCandidatePaths = (basePath: string, language: StyleLanguage) => {\n\tconst ext = extname(basePath);\n\tconst paths = ext\n\t\t? [basePath]\n\t\t: getLanguageExtensions(language).flatMap((extension) => [\n\t\t\t\t`${basePath}${extension}`,\n\t\t\t\tjoin(basePath, `index${extension}`)\n\t\t\t]);\n\n\tif (language === 'scss' || language === 'sass') {\n\t\treturn paths.flatMap((path) => {\n\t\t\tconst dir = dirname(path);\n\t\t\tconst base = path.slice(dir.length + 1);\n\t\t\treturn [path, join(dir, `_${base}`)];\n\t\t});\n\t}\n\n\treturn paths;\n};\n\nconst resolveImportPath = (\n\tspecifier: string,\n\tfromDirectory: string,\n\tloadPaths: string[],\n\tlanguage: StyleLanguage,\n\tconfig: StylePreprocessorConfig | undefined\n) => {\n\tconst rawCandidates = [\n\t\t...resolveAliasTargets(specifier, config),\n\t\tisAbsolute(specifier) ? specifier : resolve(fromDirectory, specifier),\n\t\t...loadPaths.map((path) => resolve(path, specifier))\n\t];\n\n\tfor (const candidate of rawCandidates.flatMap((path) =>\n\t\tgetCandidatePaths(path, language)\n\t)) {\n\t\tif (existsSync(candidate)) return candidate;\n\t}\n\n\treturn null;\n};\n\nconst isExternalCssUrl = (url: string) =>\n\t/^(?:[a-z][a-z0-9+.-]*:|\\/\\/|#|\\/)/i.test(url);\n\nconst splitCssUrl = (url: string) => {\n\tconst markerIndex = url.search(/[?#]/);\n\tif (markerIndex === -1) return { marker: '', path: url };\n\treturn {\n\t\tmarker: url.slice(markerIndex),\n\t\tpath: url.slice(0, markerIndex)\n\t};\n};\n\nconst rebaseCssUrls = (\n\tcontents: string,\n\tsourceFile: string,\n\tentryFile: string\n) => {\n\tconst sourceDir = dirname(sourceFile);\n\tconst entryDir = dirname(entryFile);\n\tif (sourceDir === entryDir) return contents;\n\n\treturn contents.replace(\n\t\t/url\\(\\s*(['\"]?)([^'\")]+)\\1\\s*\\)/gi,\n\t\t(match, quote: string, rawUrl: string) => {\n\t\t\tconst trimmedUrl = rawUrl.trim();\n\t\t\tif (!trimmedUrl || isExternalCssUrl(trimmedUrl)) return match;\n\t\t\tconst { marker, path } = splitCssUrl(trimmedUrl);\n\t\t\tconst rebased = relative(\n\t\t\t\tentryDir,\n\t\t\t\tresolve(sourceDir, path)\n\t\t\t).replace(/\\\\/g, '/');\n\t\t\tconst normalized = rebased.startsWith('.')\n\t\t\t\t? rebased\n\t\t\t\t: `./${rebased}`;\n\t\t\tconst nextQuote = quote || '\"';\n\t\t\treturn `url(${nextQuote}${normalized}${marker}${nextQuote})`;\n\t\t}\n\t);\n};\n\nconst rewriteAliasedStyleImports = (\n\tcontents: string,\n\tsourceFile: string,\n\tloadPaths: string[],\n\tlanguage: StyleLanguage,\n\tconfig: StylePreprocessorConfig | undefined\n) =>\n\tcontents.replace(\n\t\t/(@(?:use|forward|import|require)\\s+)([\"'])([^\"']+)\\2/g,\n\t\t(match, prefix: string, quote: string, specifier: string) => {\n\t\t\tif (\n\t\t\t\tspecifier.startsWith('.') ||\n\t\t\t\tisAbsolute(specifier) ||\n\t\t\t\tisExternalCssUrl(specifier)\n\t\t\t)\n\t\t\t\treturn match;\n\n\t\t\tconst resolved = resolveImportPath(\n\t\t\t\tspecifier,\n\t\t\t\tdirname(sourceFile),\n\t\t\t\tloadPaths,\n\t\t\t\tlanguage,\n\t\t\t\tconfig\n\t\t\t);\n\t\t\treturn resolved ? `${prefix}${quote}${resolved}${quote}` : match;\n\t\t}\n\t);\n\nconst preprocessLoadedStyle = (\n\tcontents: string,\n\tsourceFile: string,\n\tentryFile: string,\n\tloadPaths: string[] = [],\n\tlanguage?: StyleLanguage,\n\tconfig?: StylePreprocessorConfig\n) => {\n\tconst rebased = rebaseCssUrls(contents, sourceFile, entryFile);\n\treturn language\n\t\t? rewriteAliasedStyleImports(\n\t\t\t\trebased,\n\t\t\t\tsourceFile,\n\t\t\t\tloadPaths,\n\t\t\t\tlanguage,\n\t\t\t\tconfig\n\t\t\t)\n\t\t: rebased;\n};\n\nconst extractCssModuleExports = (css: string) => {\n\tconst exports: Record<string, string> = {};\n\tconst nextCss = css.replace(/:export\\s*\\{([^}]*)\\}/g, (_, body: string) => {\n\t\tfor (const declaration of body.split(';')) {\n\t\t\tconst separator = declaration.indexOf(':');\n\t\t\tif (separator === -1) continue;\n\t\t\tconst key = declaration.slice(0, separator).trim();\n\t\t\tconst value = declaration.slice(separator + 1).trim();\n\t\t\tif (key && value) exports[key] = value;\n\t\t}\n\t\treturn '';\n\t});\n\n\treturn { css: nextCss, exports };\n};\n\nconst getSassOptions = (\n\tconfig: StylePreprocessorConfig | undefined,\n\tlanguage: 'sass' | 'scss'\n): SassPreprocessorOptions => ({\n\t...(config?.sass ?? {}),\n\t...(language === 'scss' ? (config?.scss ?? {}) : {})\n});\n\nconst getLessOptions = (\n\tconfig: StylePreprocessorConfig | undefined\n): LessPreprocessorOptions => config?.less ?? {};\n\nconst getStylusOptions = (\n\tconfig: StylePreprocessorConfig | undefined\n): StylusPreprocessorOptions => config?.stylus ?? {};\n\nexport const createStyleTransformConfig = (\n\tstylePreprocessors?: StylePreprocessorConfig,\n\tpostcss?: PostCSSConfig\n): StylePreprocessorConfig | undefined =>\n\tpostcss === undefined\n\t\t? stylePreprocessors\n\t\t: { ...(stylePreprocessors ?? {}), postcss };\n\nconst withAdditionalData = (\n\tcontents: string,\n\tadditionalData: string | undefined\n) => (additionalData ? `${additionalData}\\n${contents}` : contents);\n\ntype PostCSSRuntimeConfig = {\n\toptions?: Record<string, unknown>;\n\tplugins?: unknown[] | Record<string, unknown>;\n};\n\nconst normalizePostcssModule = (mod: unknown) => {\n\tif (mod && typeof mod === 'object' && 'default' in mod) {\n\t\treturn (mod as { default?: unknown }).default ?? mod;\n\t}\n\n\treturn mod;\n};\n\nconst loadPostcssConfigFile = async (\n\tconfigPath: string\n): Promise<PostCSSRuntimeConfig> => {\n\tconst resolved = resolve(process.cwd(), configPath);\n\tconst loaded =\n\t\tresolved.endsWith('.cjs') || resolved.endsWith('.cts')\n\t\t\t? requireOptionalPeerSync<unknown>(resolved)\n\t\t\t: await importOptionalPeer<unknown>(\n\t\t\t\t\t`${new URL(`file://${resolved}`).href}?t=${Date.now()}`\n\t\t\t\t);\n\tconst config = normalizePostcssModule(loaded);\n\tconst value =\n\t\ttypeof config === 'function'\n\t\t\t? await (\n\t\t\t\t\tconfig as (context: {\n\t\t\t\t\t\tcwd: string;\n\t\t\t\t\t\tenv?: string;\n\t\t\t\t\t}) => unknown\n\t\t\t\t)({\n\t\t\t\t\tcwd: process.cwd(),\n\t\t\t\t\tenv: process.env.NODE_ENV\n\t\t\t\t})\n\t\t\t: config;\n\n\treturn (normalizePostcssModule(value) ?? {}) as PostCSSRuntimeConfig;\n};\n\nconst normalizePostcssPlugins = (\n\tplugins: unknown[] | Record<string, unknown> | undefined\n) => {\n\tif (!plugins) return [];\n\tif (Array.isArray(plugins)) return plugins.filter(Boolean);\n\n\tconst resolved: unknown[] = [];\n\tfor (const [specifier, options] of Object.entries(plugins)) {\n\t\tif (options === false) continue;\n\t\tconst mod = normalizePostcssModule(\n\t\t\trequireOptionalPeerSync<unknown>(specifier)\n\t\t);\n\t\tconst plugin =\n\t\t\ttypeof mod === 'function'\n\t\t\t\t? (mod as (options?: unknown) => unknown)(\n\t\t\t\t\t\toptions === true ? undefined : options\n\t\t\t\t\t)\n\t\t\t\t: mod;\n\t\tif (plugin) resolved.push(plugin);\n\t}\n\n\treturn resolved;\n};\n\nconst resolvePostcssConfig = async (\n\tconfig: StylePreprocessorConfig | undefined\n) => {\n\tconst inlineConfig = config?.postcss;\n\tif (!inlineConfig) return null;\n\n\tconst fileConfig = inlineConfig.config\n\t\t? await loadPostcssConfigFile(inlineConfig.config)\n\t\t: {};\n\tconst plugins = [\n\t\t...normalizePostcssPlugins(fileConfig.plugins),\n\t\t...normalizePostcssPlugins(inlineConfig.plugins)\n\t];\n\n\tif (plugins.length === 0) return null;\n\n\treturn {\n\t\toptions: {\n\t\t\t...(fileConfig.options ?? {}),\n\t\t\t...(inlineConfig.options ?? {})\n\t\t},\n\t\tplugins\n\t};\n};\n\nconst runPostcss = async (\n\tcss: string,\n\tfilePath: string,\n\tconfig: StylePreprocessorConfig | undefined\n) => {\n\tconst postcssConfig = await resolvePostcssConfig(config);\n\tif (!postcssConfig) return css;\n\n\tlet postcssModule: typeof import('postcss') & {\n\t\tdefault?: typeof import('postcss');\n\t};\n\ttry {\n\t\tpostcssModule =\n\t\t\tawait importOptionalPeer<typeof postcssModule>('postcss');\n\t} catch {\n\t\tthrow missingDependencyError('postcss', filePath);\n\t}\n\tconst postcss = postcssModule.default ?? postcssModule;\n\tconst result = await postcss(\n\t\tpostcssConfig.plugins as import('postcss').AcceptedPlugin[]\n\t).process(css, {\n\t\tfrom: filePath,\n\t\tmap: false,\n\t\t...postcssConfig.options\n\t});\n\n\treturn result.css;\n};\n\nconst createSassImporter = (\n\tentryFile: string,\n\tloadPaths: string[],\n\tlanguage: 'sass' | 'scss',\n\tconfig: StylePreprocessorConfig | undefined,\n\tdeps?: Set<string>\n) => ({\n\tcanonicalize(specifier: string, options: { containingUrl?: URL | null }) {\n\t\tconst fromDirectory = options.containingUrl\n\t\t\t? dirname(fileURLToPath(options.containingUrl))\n\t\t\t: dirname(entryFile);\n\t\tconst resolved = resolveImportPath(\n\t\t\tspecifier,\n\t\t\tfromDirectory,\n\t\t\tloadPaths,\n\t\t\tlanguage,\n\t\t\tconfig\n\t\t);\n\t\treturn resolved ? new URL(pathToFileURL(resolve(resolved)).href) : null;\n\t},\n\tload(canonicalUrl: URL) {\n\t\tconst filePath = fileURLToPath(canonicalUrl);\n\t\tdeps?.add(filePath);\n\t\tconst fileLanguage = getStyleLanguage(filePath);\n\t\tif (\n\t\t\tfileLanguage !== 'scss' &&\n\t\t\tfileLanguage !== 'sass' &&\n\t\t\tfileLanguage !== null\n\t\t)\n\t\t\treturn null;\n\n\t\treturn {\n\t\t\tcontents: preprocessLoadedStyle(\n\t\t\t\treadFileSync(filePath, 'utf-8'),\n\t\t\t\tfilePath,\n\t\t\t\tentryFile,\n\t\t\t\tloadPaths,\n\t\t\t\tlanguage,\n\t\t\t\tconfig\n\t\t\t),\n\t\t\tsyntax: filePath.endsWith('.sass')\n\t\t\t\t? ('indented' as const)\n\t\t\t\t: ('scss' as const)\n\t\t};\n\t}\n});\n\nconst createLessFileManager = (\n\tentryFile: string,\n\tloadPaths: string[],\n\tconfig: StylePreprocessorConfig | undefined,\n\tdeps?: Set<string>\n) => ({\n\tinstall(\n\t\tless: { FileManager: new () => Record<string, unknown> },\n\t\tpluginManager: { addFileManager(manager: unknown): void }\n\t) {\n\t\tconst baseManager = new less.FileManager();\n\t\tconst manager = Object.create(baseManager) as Record<string, unknown>;\n\t\tmanager.supports = (filename: string, currentDirectory: string) =>\n\t\t\tBoolean(\n\t\t\t\tresolveImportPath(\n\t\t\t\t\tfilename,\n\t\t\t\t\tresolve(currentDirectory),\n\t\t\t\t\tloadPaths,\n\t\t\t\t\t'less',\n\t\t\t\t\tconfig\n\t\t\t\t)\n\t\t\t);\n\t\tmanager.loadFile = async (\n\t\t\tfilename: string,\n\t\t\tcurrentDirectory: string\n\t\t) => {\n\t\t\tconst resolved = resolveImportPath(\n\t\t\t\tfilename,\n\t\t\t\tresolve(currentDirectory),\n\t\t\t\tloadPaths,\n\t\t\t\t'less',\n\t\t\t\tconfig\n\t\t\t);\n\t\t\tif (!resolved) {\n\t\t\t\tthrow new Error(`Unable to resolve Less import \"${filename}\"`);\n\t\t\t}\n\t\t\tdeps?.add(resolved);\n\n\t\t\treturn {\n\t\t\t\tcontents: preprocessLoadedStyle(\n\t\t\t\t\tawait readFile(resolved, 'utf-8'),\n\t\t\t\t\tresolved,\n\t\t\t\t\tentryFile,\n\t\t\t\t\tloadPaths,\n\t\t\t\t\t'less',\n\t\t\t\t\tconfig\n\t\t\t\t),\n\t\t\t\tfilename: resolved\n\t\t\t};\n\t\t};\n\t\tpluginManager.addFileManager(manager);\n\t}\n});\n\nconst renderStylus = async (\n\tcontents: string,\n\tfilePath: string,\n\tloadPaths: string[],\n\toptions: StylusPreprocessorOptions,\n\tdeps?: Set<string>\n) => {\n\tlet stylus: typeof import('stylus');\n\ttry {\n\t\tconst stylusModule = await importOptionalPeer<\n\t\t\ttypeof import('stylus') & { default?: typeof import('stylus') }\n\t\t>('stylus');\n\t\tstylus = stylusModule.default ?? stylusModule;\n\t} catch {\n\t\tthrow missingDependencyError('stylus', filePath);\n\t}\n\n\treturn new Promise<string>((resolveCss, reject) => {\n\t\tconst renderer = stylus(contents);\n\t\trenderer.set('filename', filePath);\n\t\tfor (const [key, value] of Object.entries(options.options ?? {})) {\n\t\t\trenderer.set(key, value);\n\t\t}\n\t\tfor (const path of loadPaths) renderer.include(path);\n\t\trenderer.render((error, css) => {\n\t\t\tif (error) {\n\t\t\t\treject(error);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Stylus exposes its dependency list after a successful render.\n\t\t\tif (deps) {\n\t\t\t\tconst stylusDeps = (\n\t\t\t\t\trenderer as unknown as { deps?: () => string[] }\n\t\t\t\t).deps?.();\n\t\t\t\tif (Array.isArray(stylusDeps)) {\n\t\t\t\t\tfor (const dep of stylusDeps) deps.add(resolve(dep));\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolveCss(css ?? '');\n\t\t});\n\t});\n};\n\n/* Compile-time bookkeeping shared with the dev server.\n\n `styleDependencyGraph` maps every entry stylesheet (anything that ran\n through `compileStyleSource`) to the absolute paths of every partial\n it imported during that compile. The dev rebuild trigger reads this to\n know which entries to invalidate when a partial like `_tokens.scss`\n changes.\n\n `styleOutputHashes` records the SHA-1 of each entry's last-emitted CSS\n so callers can skip re-broadcasting / re-writing identical output. */\nconst styleDependencyGraph = new Map<string, Set<string>>();\nconst styleOutputHashes = new Map<string, string>();\n\nconst recordStyleDeps = (entry: string, deps: Set<string>) => {\n\tconst key = resolve(entry);\n\tconst stripped = new Set<string>();\n\tfor (const dep of deps) {\n\t\tconst resolved = resolve(dep);\n\t\tif (resolved !== key) stripped.add(resolved);\n\t}\n\tstyleDependencyGraph.set(key, stripped);\n};\n\n/* Record that a JS/TS/Vue/Svelte/etc. file imports a stylesheet (typically\n a `.module.scss` or other style import via JS). This is the JS-side dep\n tracking that complements the CSS-side `@import` graph: when the style\n file changes, the dev server uses `findStyleEntriesImporting` to find\n the JS file that imports it and queues that for rebuild. Without this,\n editing `Foo.module.scss` would only re-emit the CSS module's own\n compiled output without re-running the bundler against the importing\n component, so the new hashed class names never reach the bundle. */\nexport const addStyleImporter = (importerPath: string, stylePath: string) => {\n\tconst key = resolve(importerPath);\n\tconst target = resolve(stylePath);\n\tconst deps = styleDependencyGraph.get(key) ?? new Set<string>();\n\tdeps.add(target);\n\tstyleDependencyGraph.set(key, deps);\n};\n\n/* Files that import the given path. Used by the dev server to rebuild\n importers when a partial changes — there's no import-graph traversal,\n so callers should pass already-resolved absolute paths. */\nexport const findStyleEntriesImporting = (changedPath: string) => {\n\tconst target = resolve(changedPath);\n\tconst importers: string[] = [];\n\tfor (const [entry, deps] of styleDependencyGraph) {\n\t\tif (deps.has(target)) importers.push(entry);\n\t}\n\n\treturn importers;\n};\n\n/* Hash the just-emitted CSS for an entry; returns `true` only when the\n output actually differs from the previous compile. The dev path uses\n this to suppress style-update broadcasts on whitespace-only edits. */\nexport const recordStyleOutput = (entry: string, css: string) => {\n\tconst key = resolve(entry);\n\tconst hash = createHash('sha1').update(css).digest('hex');\n\tconst previous = styleOutputHashes.get(key);\n\tstyleOutputHashes.set(key, hash);\n\n\treturn previous !== hash;\n};\n\n/* Drop cached state for an entry — used when the file is deleted or the\n dev server is shutting down. */\nexport const forgetStyleEntry = (entry: string) => {\n\tconst key = resolve(entry);\n\tstyleDependencyGraph.delete(key);\n\tstyleOutputHashes.delete(key);\n};\n\nexport const compileStyleSource = async (\n\tfilePath: string,\n\tsource?: string,\n\tlanguageHint?: string,\n\tconfig?: StylePreprocessorConfig\n) => {\n\tconst language = getStyleLanguage(languageHint ?? filePath);\n\tconst rawContents = source ?? (await readFile(filePath, 'utf-8'));\n\t// Collect every partial / @import / @use that the compiler touches.\n\t// Stored on `styleDependencyGraph` after compile so the dev server\n\t// can invalidate this entry when one of its imports changes.\n\tconst deps = new Set<string>();\n\n\tif (language === 'scss' || language === 'sass') {\n\t\tconst options = getSassOptions(config, language);\n\t\tconst packageName = options.implementation ?? 'sass';\n\t\tlet sass: typeof import('sass');\n\t\ttry {\n\t\t\tsass = await importOptionalPeer<typeof import('sass')>(packageName);\n\t\t} catch {\n\t\t\tthrow missingDependencyError(packageName, filePath);\n\t\t}\n\n\t\tconst contents = withAdditionalData(\n\t\t\trawContents,\n\t\t\toptions.additionalData\n\t\t);\n\t\tconst loadPaths = normalizeLoadPaths(filePath, options.loadPaths);\n\t\ttry {\n\t\t\tconst result = sass.compileString(contents, {\n\t\t\t\timporters: [\n\t\t\t\t\tcreateSassImporter(\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\tloadPaths,\n\t\t\t\t\t\tlanguage,\n\t\t\t\t\t\tconfig,\n\t\t\t\t\t\tdeps\n\t\t\t\t\t)\n\t\t\t\t],\n\t\t\t\tloadPaths,\n\t\t\t\tstyle: 'expanded',\n\t\t\t\tsyntax: language === 'sass' ? 'indented' : 'scss',\n\t\t\t\turl: new URL(pathToFileURL(resolve(filePath)).href)\n\t\t\t});\n\n\t\t\tconst css = await runPostcss(result.css, filePath, config);\n\t\t\t// Augment `deps` with `result.loadedUrls`. Detail:\n\t\t\t// resolves a relative `@use './partial'` via the\n\t\t\t// built-in filesystem loader (which it does whenever\n\t\t\t// the source has a `url:` set, which we always do),\n\t\t\t// the custom importer's `canonicalize`/`load` callbacks\n\t\t\t// don't fire — so `deps` would otherwise be empty.\n\t\t\t// `loadedUrls` always reflects every file Sass actually\n\t\t\t// touched, including the entry, so we filter the entry\n\t\t\t// out and add the rest.\n\t\t\tconst loadedUrls = (result.loadedUrls ?? []) as URL[];\n\t\t\tfor (const url of loadedUrls) {\n\t\t\t\tif (url.protocol !== 'file:') continue;\n\t\t\t\tconst dep = fileURLToPath(url);\n\t\t\t\tif (resolve(dep) === resolve(filePath)) continue;\n\t\t\t\tdeps.add(dep);\n\t\t\t}\n\t\t\trecordStyleDeps(filePath, deps);\n\n\t\t\treturn css;\n\t\t} catch (error) {\n\t\t\tthrowPreprocessorError(error, filePath, language);\n\t\t}\n\t}\n\n\tif (language === 'less') {\n\t\tconst options = getLessOptions(config);\n\t\ttype LessRender = typeof import('less').render;\n\t\tlet lessModule: {\n\t\t\tdefault?: { render: LessRender };\n\t\t\trender?: LessRender;\n\t\t};\n\t\ttry {\n\t\t\tlessModule = await importOptionalPeer<typeof lessModule>('less');\n\t\t} catch {\n\t\t\tthrow missingDependencyError('less', filePath);\n\t\t}\n\t\tconst less = lessModule.render ? lessModule : lessModule.default;\n\t\tconst render = less?.render;\n\t\tif (!render) throw missingDependencyError('less', filePath);\n\n\t\tconst contents = withAdditionalData(\n\t\t\trawContents,\n\t\t\toptions.additionalData\n\t\t);\n\t\tconst loadPaths = normalizeLoadPaths(filePath, options.paths);\n\t\ttry {\n\t\t\tconst result = await render(contents, {\n\t\t\t\t...(options.options ?? {}),\n\t\t\t\tfilename: filePath,\n\t\t\t\tpaths: loadPaths,\n\t\t\t\tplugins: [\n\t\t\t\t\t...((options.options?.plugins as unknown[]) ?? []),\n\t\t\t\t\tcreateLessFileManager(filePath, loadPaths, config, deps)\n\t\t\t\t]\n\t\t\t});\n\n\t\t\tconst css = await runPostcss(result.css, filePath, config);\n\t\t\trecordStyleDeps(filePath, deps);\n\n\t\t\treturn css;\n\t\t} catch (error) {\n\t\t\tthrowPreprocessorError(error, filePath, 'less');\n\t\t}\n\t}\n\n\tif (language === 'stylus') {\n\t\tconst options = getStylusOptions(config);\n\t\tconst loadPaths = normalizeLoadPaths(filePath, options.paths);\n\t\tconst contents = withAdditionalData(\n\t\t\tpreprocessLoadedStyle(\n\t\t\t\trawContents,\n\t\t\t\tfilePath,\n\t\t\t\tfilePath,\n\t\t\t\tloadPaths,\n\t\t\t\t'stylus',\n\t\t\t\tconfig\n\t\t\t),\n\t\t\toptions.additionalData\n\t\t);\n\n\t\ttry {\n\t\t\tconst css = await runPostcss(\n\t\t\t\tawait renderStylus(\n\t\t\t\t\tcontents,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tloadPaths,\n\t\t\t\t\toptions,\n\t\t\t\t\tdeps\n\t\t\t\t),\n\t\t\t\tfilePath,\n\t\t\t\tconfig\n\t\t\t);\n\t\t\trecordStyleDeps(filePath, deps);\n\n\t\t\treturn css;\n\t\t} catch (error) {\n\t\t\tthrowPreprocessorError(error, filePath, 'stylus');\n\t\t}\n\t}\n\n\treturn runPostcss(rawContents, filePath, config);\n};\n\nexport const createStylePreprocessorPlugin = (\n\tconfig?: StylePreprocessorConfig\n): BunPlugin => ({\n\tname: 'absolute-style-preprocessor',\n\tsetup(build) {\n\t\tconst cssModuleSources = new Map<\n\t\t\tstring,\n\t\t\t{ css: string; exports: Record<string, string> }\n\t\t>();\n\n\t\tbuild.onResolve({ filter: /^absolute-style-module:/ }, ({ path }) => ({\n\t\t\tnamespace: 'absolute-style-module',\n\t\t\tpath: path.slice('absolute-style-module:'.length)\n\t\t}));\n\n\t\tbuild.onLoad(\n\t\t\t{ filter: /\\.module\\.css$/i, namespace: 'absolute-style-module' },\n\t\t\tasync ({ path }) => {\n\t\t\t\tconst source = cssModuleSources.get(path);\n\t\t\t\tif (!source) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Unable to resolve CSS module source for ${path}`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tcontents: source.css,\n\t\t\t\t\tloader: 'css'\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\n\t\tbuild.onLoad({ filter: STYLE_EXTENSION_PATTERN }, async ({ path }) => {\n\t\t\tif (isStyleModulePath(path)) {\n\t\t\t\tconst cssModulePath = path.replace(\n\t\t\t\t\tSTYLE_EXTENSION_PATTERN,\n\t\t\t\t\t'.css'\n\t\t\t\t);\n\t\t\t\tconst compiled = await compileStyleSource(\n\t\t\t\t\tpath,\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\tconfig\n\t\t\t\t);\n\t\t\t\tconst { css, exports } = extractCssModuleExports(compiled);\n\t\t\t\tcssModuleSources.set(cssModulePath, { css, exports });\n\t\t\t\tconst exportSource =\n\t\t\t\t\tObject.keys(exports).length > 0\n\t\t\t\t\t\t? `import styles from ${JSON.stringify(`absolute-style-module:${cssModulePath}`)}; export default Object.assign({}, styles, ${JSON.stringify(exports)});`\n\t\t\t\t\t\t: `export { default } from ${JSON.stringify(`absolute-style-module:${cssModulePath}`)};`;\n\n\t\t\t\treturn {\n\t\t\t\t\tcontents: exportSource,\n\t\t\t\t\tloader: 'js'\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcontents: await compileStyleSource(\n\t\t\t\t\tpath,\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\tconfig\n\t\t\t\t),\n\t\t\t\tloader: 'css'\n\t\t\t};\n\t\t});\n\n\t\tbuild.onLoad({ filter: CSS_EXTENSION_PATTERN }, async ({ path }) => ({\n\t\t\tcontents: await compileStyleSource(\n\t\t\t\tpath,\n\t\t\t\tundefined,\n\t\t\t\tundefined,\n\t\t\t\tconfig\n\t\t\t),\n\t\t\tloader: 'css'\n\t\t}));\n\t}\n});\n\nexport const stylePreprocessorPlugin = createStylePreprocessorPlugin();\n\nexport const createSvelteStylePreprocessor = (\n\tconfig?: StylePreprocessorConfig\n) => ({\n\tstyle: async ({\n\t\tattributes,\n\t\tcontent,\n\t\tfilename\n\t}: {\n\t\tattributes: Record<string, string | boolean>;\n\t\tcontent: string;\n\t\tfilename?: string;\n\t}) => {\n\t\tconst language =\n\t\t\ttypeof attributes.lang === 'string'\n\t\t\t\t? attributes.lang\n\t\t\t\t: typeof attributes.type === 'string'\n\t\t\t\t\t? attributes.type.replace(/^text\\//, '')\n\t\t\t\t\t: null;\n\t\tif (!language || !STYLE_LANGUAGE_PATTERN.test(language)) return;\n\n\t\tconst path = filename ?? `style.${language}`;\n\n\t\treturn {\n\t\t\tcode: await compileStyleSource(path, content, language, config)\n\t\t};\n\t}\n});\n\n/* Pattern shared by `resolveCssImports{Sync,Async}` — top-level\n * `@import \"<path>\";` only. `@import url(...)` and media-qualified\n * imports pass through unchanged. */\n\nconst CSS_IMPORT_PATTERN = /@import\\s+[\"']([^\"']+)[\"']\\s*;?/g;\n\n/* Async counterpart to `resolveCssImportsSync`. Reads imported files\n * via `node:fs/promises.readFile` so the call doesn't block the dev\n * server's event loop on a deep `@import` chain. Same failure modes:\n * `@import url(...)` and media-qualified imports pass through. */\n\nconst resolveCssImportsAsync = async (\n\tcontent: string,\n\tbaseDir: string,\n\tvisited: Set<string>\n): Promise<string> => {\n\tconst matches = Array.from(content.matchAll(CSS_IMPORT_PATTERN));\n\tif (matches.length === 0) return content;\n\n\tlet cursor = 0;\n\tconst parts: string[] = [];\n\tfor (const match of matches) {\n\t\tconst importPath = match[1];\n\t\tif (importPath === undefined) continue;\n\t\tconst start = match.index ?? 0;\n\t\tconst end = start + match[0].length;\n\t\tparts.push(content.slice(cursor, start));\n\n\t\tconst fullPath = isAbsolute(importPath)\n\t\t\t? importPath\n\t\t\t: resolve(baseDir, importPath);\n\t\tif (visited.has(fullPath) || !existsSync(fullPath)) {\n\t\t\tparts.push(visited.has(fullPath) ? '' : match[0]);\n\t\t\tcursor = end;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst nextVisited = new Set(visited);\n\t\tnextVisited.add(fullPath);\n\t\tconst imported = await readFile(fullPath, 'utf-8');\n\t\tparts.push(\n\t\t\tawait resolveCssImportsAsync(\n\t\t\t\timported,\n\t\t\t\tdirname(fullPath),\n\t\t\t\tnextVisited\n\t\t\t)\n\t\t);\n\t\tcursor = end;\n\t}\n\tparts.push(content.slice(cursor));\n\n\treturn parts.join('');\n};\n\nexport const compileStyleFileIfNeeded = async (\n\tfilePath: string,\n\tconfig?: StylePreprocessorConfig\n) => {\n\tif (!isPreprocessableStylePath(filePath)) {\n\t\tconst raw = await readFile(filePath, 'utf-8');\n\t\tconst processed = await runPostcss(raw, filePath, config);\n\t\t// PostCSS only resolves `@import` when configured with\n\t\t// `postcss-import`. We always resolve them here so the inlined\n\t\t// `ɵcmp.styles` content is self-contained — no browser-side\n\t\t// fetch of bare CSS paths that would hit the dev server's\n\t\t// SPA wildcard route and trip Angular's router.\n\t\treturn resolveCssImportsAsync(\n\t\t\tprocessed,\n\t\t\tdirname(filePath),\n\t\t\tnew Set([filePath])\n\t\t);\n\t}\n\n\tconst compiled = await compileStyleSource(\n\t\tfilePath,\n\t\tundefined,\n\t\tundefined,\n\t\tconfig\n\t);\n\t// Sass leaves plain `.css` `@import` statements as-is per CSS spec;\n\t// post-Sass output may still contain them.\n\treturn resolveCssImportsAsync(\n\t\tcompiled,\n\t\tdirname(filePath),\n\t\tnew Set([filePath])\n\t);\n};\n\n/* Resolve top-level CSS `@import \"<path>\";` statements by reading the\n * imported file and inlining its content recursively. Necessary for\n * the sync styleUrls path because Angular component styles get\n * baked into `ɵcmp.styles[]` as plain strings — any unresolved\n * `@import` survives to the rendered `<style>` tag, where the browser\n * tries to fetch the bare path. The dev server has no static file at\n * that path (component CSS is bundled as JS in dev), so the request\n * falls through to the SSR catch-all and Angular's router throws\n * NG04002.\n *\n * Sass / SCSS files don't need this — Sass compiles its own\n * `@import / @use` graph in `sass.compileString`. This helper only\n * applies to plain `.css` content (and the post-Sass output, which\n * may itself contain plain CSS `@import \"x.css\"` statements that\n * Sass leaves as-is when the path ends in `.css`).\n *\n * Tracks visited paths to break cycles. Skips `@import url(...)`,\n * `@import \"...\" screen`, and other forms that need media-query\n * preservation — those fall through unchanged for now (Phase 3\n * follow-up). */\n\nconst resolveCssImportsSync = (\n\tcontent: string,\n\tbaseDir: string,\n\tvisited: Set<string>\n): string => {\n\treturn content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {\n\t\tconst fullPath = isAbsolute(importPath)\n\t\t\t? importPath\n\t\t\t: resolve(baseDir, importPath);\n\t\tif (visited.has(fullPath)) return '';\n\t\tif (!existsSync(fullPath)) return match;\n\n\t\tconst nextVisited = new Set(visited);\n\t\tnextVisited.add(fullPath);\n\t\tconst imported = readFileSync(fullPath, 'utf-8');\n\n\t\treturn resolveCssImportsSync(imported, dirname(fullPath), nextVisited);\n\t});\n};\n\nexport const compileStyleFileIfNeededSync = (\n\tfilePath: string,\n\tconfig?: StylePreprocessorConfig\n) => {\n\tconst rawContents = readFileSync(filePath, 'utf-8');\n\tconst language = getStyleLanguage(filePath);\n\tif (config?.postcss) {\n\t\tthrow new Error(\n\t\t\t`Unable to compile ${filePath}: PostCSS preprocessing is async-only.`\n\t\t);\n\t}\n\tif (language === 'scss' || language === 'sass') {\n\t\tconst options = getSassOptions(config, language);\n\t\tconst packageName = options.implementation ?? 'sass';\n\t\tlet sass: typeof import('sass');\n\t\ttry {\n\t\t\tsass = requireOptionalPeerSync<typeof import('sass')>(packageName);\n\t\t} catch {\n\t\t\tthrow missingDependencyError(packageName, filePath);\n\t\t}\n\n\t\tconst contents = withAdditionalData(\n\t\t\trawContents,\n\t\t\toptions.additionalData\n\t\t);\n\t\tconst loadPaths = normalizeLoadPaths(filePath, options.loadPaths);\n\t\tconst result = sass.compileString(contents, {\n\t\t\timporters: [\n\t\t\t\tcreateSassImporter(filePath, loadPaths, language, config)\n\t\t\t],\n\t\t\tloadPaths,\n\t\t\tstyle: 'expanded',\n\t\t\tsyntax: language === 'sass' ? 'indented' : 'scss',\n\t\t\turl: new URL(pathToFileURL(resolve(filePath)).href)\n\t\t});\n\t\t// Track every `@use` / `@import` dependency Sass loaded so\n\t\t// downstream HMR can find the entry stylesheet that needs to\n\t\t// re-emit when a shared partial (`_shared.scss`,\n\t\t// `_tokens.scss`) changes. `result.loadedUrls` includes the\n\t\t// entry itself plus everything it pulled in. Without this,\n\t\t// editing a shared partial silently keeps the entry's stale\n\t\t// CSS until a full restart.\n\t\tconst loadedUrls = (result.loadedUrls ?? []) as URL[];\n\t\tfor (const url of loadedUrls) {\n\t\t\tif (url.protocol !== 'file:') continue;\n\t\t\tconst dep = fileURLToPath(url);\n\t\t\tif (resolve(dep) === resolve(filePath)) continue;\n\t\t\taddStyleImporter(filePath, dep);\n\t\t}\n\t\t// Sass leaves plain `.css` `@import` statements alone (per CSS\n\t\t// spec, those are runtime-resolved). Resolve them here so the\n\t\t// inlined `ɵcmp.styles` content is self-contained.\n\t\treturn resolveCssImportsSync(\n\t\t\tresult.css,\n\t\t\tdirname(filePath),\n\t\t\tnew Set([filePath])\n\t\t);\n\t}\n\tif (language === 'less') {\n\t\tthrow new Error(\n\t\t\t`Unable to compile ${filePath}: Less styleUrl preprocessing is async-only. Import the Less file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`\n\t\t);\n\t}\n\tif (language === 'stylus') {\n\t\tthrow new Error(\n\t\t\t`Unable to compile ${filePath}: Stylus styleUrl preprocessing is async-only. Import the Stylus file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`\n\t\t);\n\t}\n\n\treturn resolveCssImportsSync(\n\t\trawContents,\n\t\tdirname(filePath),\n\t\tnew Set([filePath])\n\t);\n};\n\nexport const getCssOutputExtension = (filePath: string) =>\n\tisPreprocessableStylePath(filePath) ? '.css' : extname(filePath);\n",
|
|
39
|
-
"import type { Dirent } from 'node:fs';\nimport { mkdir, readdir } from 'node:fs/promises';\nimport { basename, dirname, extname, join, relative, resolve } from 'node:path';\nimport { resolvePackageImport } from '../build/resolvePackageImport';\nimport { lowerSvelteIslandSyntax } from '../svelte/lowerIslandSyntax';\nimport { lowerSvelteAwaitSlotSyntax } from '../svelte/lowerAwaitSlotSyntax';\nimport { createSvelteStylePreprocessor } from '../build/stylePreprocessor';\n\nconst serverCacheRoot = join(process.cwd(), '.absolutejs', 'islands', 'svelte');\n\nconst compiledModuleCache = new Map<string, string>();\nconst originalSourcePathCache = new Map<string, string>();\n\nconst transpiler = new Bun.Transpiler({\n\tloader: 'ts',\n\ttarget: 'browser'\n});\n\nconst ensureRelativeImportPath = (from: string, target: string) => {\n\tconst importPath = relative(dirname(from), target).replace(/\\\\/g, '/');\n\n\treturn importPath.startsWith('.') ? importPath : `./${importPath}`;\n};\n\nconst processDirectoryEntries = (\n\tentries: Dirent<string>[],\n\tdir: string,\n\ttargetFileName: string,\n\tstack: string[]\n) => {\n\tfor (const entry of entries) {\n\t\tconst entryPath = join(dir, entry.name);\n\t\tif (entry.isDirectory()) stack.push(entryPath);\n\n\t\tif (entry.isFile() && entry.name === targetFileName) {\n\t\t\treturn entryPath;\n\t\t}\n\t}\n\n\treturn null;\n};\n\nconst searchDirectoryLevel = async (dirs: string[], targetFileName: string) => {\n\tif (dirs.length === 0) return null;\n\n\tconst nextStack: string[] = [];\n\tconst dirEntries = await Promise.all(\n\t\tdirs.map(async (dir) => ({\n\t\t\tdir,\n\t\t\tentries: await readdir(dir, {\n\t\t\t\tencoding: 'utf-8',\n\t\t\t\twithFileTypes: true\n\t\t\t})\n\t\t}))\n\t);\n\n\tfor (const { dir, entries } of dirEntries) {\n\t\tconst found = processDirectoryEntries(\n\t\t\tentries,\n\t\t\tdir,\n\t\t\ttargetFileName,\n\t\t\tnextStack\n\t\t);\n\t\tif (found) return found;\n\t}\n\n\treturn searchDirectoryLevel(nextStack, targetFileName);\n};\n\nconst findSourceFileByBasename = async (\n\tsearchRoot: string,\n\ttargetFileName: string\n) => searchDirectoryLevel([searchRoot], targetFileName);\n\nconst normalizeBuiltSvelteFileName = (sourcePath: string) =>\n\tbasename(sourcePath).replace(/-[a-z0-9]{6,}(?=\\.svelte$)/i, '');\n\nconst resolveOriginalSourcePath = async (sourcePath: string) => {\n\tconst cachedPath = originalSourcePathCache.get(sourcePath);\n\tif (cachedPath !== undefined) {\n\t\treturn cachedPath;\n\t}\n\n\tif (\n\t\t!sourcePath.includes(\n\t\t\t`${join(process.cwd(), 'build')}${process.platform === 'win32' ? '' : '/'}`\n\t\t) &&\n\t\t!sourcePath.includes('/build/')\n\t) {\n\t\toriginalSourcePathCache.set(sourcePath, sourcePath);\n\n\t\treturn sourcePath;\n\t}\n\n\tconst resolvedSourcePath = await findSourceFileByBasename(\n\t\tjoin(process.cwd(), 'src'),\n\t\tnormalizeBuiltSvelteFileName(sourcePath)\n\t);\n\tconst nextPath = resolvedSourcePath ?? sourcePath;\n\toriginalSourcePathCache.set(sourcePath, nextPath);\n\n\treturn nextPath;\n};\n\nconst resolveRelativeModule = async (spec: string, from: string) => {\n\tif (!spec.startsWith('.')) {\n\t\treturn null;\n\t}\n\n\tconst basePath = resolve(dirname(from), spec);\n\tconst candidates = [\n\t\tbasePath,\n\t\t`${basePath}.ts`,\n\t\t`${basePath}.js`,\n\t\t`${basePath}.mjs`,\n\t\t`${basePath}.cjs`,\n\t\t`${basePath}.json`,\n\t\tjoin(basePath, 'index.ts'),\n\t\tjoin(basePath, 'index.js'),\n\t\tjoin(basePath, 'index.mjs'),\n\t\tjoin(basePath, 'index.cjs'),\n\t\tjoin(basePath, 'index.json')\n\t];\n\n\tconst existResults = await Promise.all(\n\t\tcandidates.map((candidate) => Bun.file(candidate).exists())\n\t);\n\tconst foundIndex = existResults.indexOf(true);\n\n\treturn foundIndex >= 0 ? (candidates[foundIndex] ?? null) : null;\n};\n\nconst getCachedModulePath = (sourcePath: string) => {\n\tconst relativeSourcePath = relative(process.cwd(), sourcePath).replace(\n\t\t/\\\\/g,\n\t\t'/'\n\t);\n\tconst normalizedSourcePath = relativeSourcePath.startsWith('..')\n\t\t? sourcePath.replace(/[:\\\\/]/g, '_')\n\t\t: relativeSourcePath;\n\n\treturn join(serverCacheRoot, `${normalizedSourcePath}.server.js`);\n};\n\nconst resolveSvelteImport = async (spec: string, from: string) => {\n\tif (!spec.startsWith('.') && !spec.startsWith('/')) {\n\t\tconst resolved = resolvePackageImport(spec);\n\n\t\treturn resolved && resolved.endsWith('.svelte') ? resolved : null;\n\t}\n\n\tif (spec.startsWith('/')) {\n\t\treturn spec;\n\t}\n\n\tif (!spec.startsWith('.')) {\n\t\treturn null;\n\t}\n\n\tconst explicitPath = resolve(dirname(from), spec);\n\tif (extname(explicitPath) === '.svelte') {\n\t\treturn explicitPath;\n\t}\n\n\tconst candidate = `${explicitPath}.svelte`;\n\tif ((await Bun.file(candidate).exists()) === true) {\n\t\treturn candidate;\n\t}\n\n\treturn null;\n};\n\nconst writeIfChanged = async (path: string, content: string) => {\n\tconst targetFile = Bun.file(path);\n\tconst exists = await targetFile.exists();\n\tif (exists) {\n\t\tconst currentContent = await targetFile.text();\n\t\tif (currentContent === content) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tawait Bun.write(path, content);\n};\n\nexport const compileSvelteServerModule = async (sourcePath: string) => {\n\tconst cachedModulePath = compiledModuleCache.get(sourcePath);\n\tif (cachedModulePath) {\n\t\treturn cachedModulePath;\n\t}\n\n\tconst resolutionSourcePath = await resolveOriginalSourcePath(sourcePath);\n\tconst source = await Bun.file(sourcePath).text();\n\tconst { compile, preprocess } = await import('svelte/compiler');\n\tconst loweredAwaitSource = lowerSvelteAwaitSlotSyntax(source);\n\tconst loweredSource = lowerSvelteIslandSyntax(\n\t\tloweredAwaitSource.code,\n\t\t'server'\n\t);\n\tconst preprocessed = await preprocess(\n\t\tloweredSource.code,\n\t\tcreateSvelteStylePreprocessor()\n\t);\n\tlet transpiled =\n\t\tsourcePath.endsWith('.ts') || sourcePath.endsWith('.svelte.ts')\n\t\t\t? transpiler.transformSync(preprocessed.code)\n\t\t\t: preprocessed.code;\n\tconst childImportSpecs = Array.from(\n\t\ttranspiled.matchAll(/from\\s+['\"]([^'\"]+)['\"]/g)\n\t)\n\t\t.map((match) => match[1])\n\t\t.filter((value): value is string => value !== undefined);\n\tconst resolvedChildModules = await Promise.all(\n\t\tchildImportSpecs.map((spec) =>\n\t\t\tresolveSvelteImport(spec, resolutionSourcePath)\n\t\t)\n\t);\n\tconst resolvedModuleImports = await Promise.all(\n\t\tchildImportSpecs.map((spec) =>\n\t\t\tresolveRelativeModule(spec, resolutionSourcePath)\n\t\t)\n\t);\n\tconst childModulePaths = new Map<string, string>();\n\tconst rewrittenModulePaths = new Map<string, string>();\n\n\tconst compiledChildren = await Promise.all(\n\t\tchildImportSpecs.map(async (spec, index) => {\n\t\t\tconst resolvedChild = resolvedChildModules[index];\n\t\t\tif (!spec || !resolvedChild) return null;\n\n\t\t\treturn {\n\t\t\t\tcompiledPath: await compileSvelteServerModule(resolvedChild),\n\t\t\t\tresolvedChild,\n\t\t\t\tspec\n\t\t\t};\n\t\t})\n\t);\n\n\tfor (const result of compiledChildren) {\n\t\tif (!result) continue;\n\t\tchildModulePaths.set(result.spec, result.compiledPath);\n\t\tchildModulePaths.set(result.resolvedChild, result.compiledPath);\n\t}\n\n\tfor (let index = 0; index < childImportSpecs.length; index += 1) {\n\t\tconst spec = childImportSpecs[index];\n\t\tconst resolvedModuleImport = resolvedModuleImports[index];\n\t\tif (!spec || !resolvedModuleImport) continue;\n\t\tif (resolvedChildModules[index]) continue;\n\n\t\trewrittenModulePaths.set(\n\t\t\tspec,\n\t\t\tensureRelativeImportPath(\n\t\t\t\tgetCachedModulePath(sourcePath),\n\t\t\t\tresolvedModuleImport\n\t\t\t)\n\t\t);\n\t}\n\n\tfor (const [spec, resolvedModuleImport] of rewrittenModulePaths) {\n\t\ttranspiled = transpiled.replaceAll(spec, resolvedModuleImport);\n\t}\n\n\tlet compiledCode = compile(transpiled, {\n\t\tcss: 'injected',\n\t\texperimental: {\n\t\t\tasync: loweredAwaitSource.transformed || loweredSource.transformed\n\t\t},\n\t\tfilename: resolutionSourcePath,\n\t\tgenerate: 'server'\n\t}).js.code;\n\n\tfor (const [spec, compiledChildPath] of childModulePaths) {\n\t\tcompiledCode = compiledCode.replaceAll(\n\t\t\tspec,\n\t\t\tensureRelativeImportPath(\n\t\t\t\tgetCachedModulePath(sourcePath),\n\t\t\t\tcompiledChildPath\n\t\t\t)\n\t\t);\n\t}\n\n\tfor (const [spec, resolvedModuleImport] of rewrittenModulePaths) {\n\t\tcompiledCode = compiledCode.replaceAll(spec, resolvedModuleImport);\n\t}\n\n\tconst compiledModulePath = getCachedModulePath(sourcePath);\n\tawait mkdir(dirname(compiledModulePath), { recursive: true });\n\tawait writeIfChanged(compiledModulePath, compiledCode);\n\tcompiledModuleCache.set(sourcePath, compiledModulePath);\n\n\treturn compiledModulePath;\n};\n",
|
|
40
|
-
"import { existsSync, readFileSync, realpathSync } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport { dirname, join, relative, resolve } from 'node:path';\nimport { Transpiler } from 'bun';\nimport { BASE_36_RADIX } from '../constants';\n\nconst ISLAND_COMPONENT_ID_LENGTH = 8;\n\nconst serverCacheRoot = join(process.cwd(), '.absolutejs', 'islands', 'vue');\n\nconst compiledModuleCache = new Map<string, string>();\n\nconst transpiler = new Transpiler({ loader: 'ts', target: 'browser' });\n\nconst ensureRelativeImportPath = (from: string, target: string) => {\n\tconst importPath = relative(dirname(from), target).replace(/\\\\/g, '/');\n\n\treturn importPath.startsWith('.') ? importPath : `./${importPath}`;\n};\n\nconst getCachedModulePath = (sourcePath: string) => {\n\tconst relativeSourcePath = relative(process.cwd(), sourcePath).replace(\n\t\t/\\\\/g,\n\t\t'/'\n\t);\n\tconst normalizedSourcePath = relativeSourcePath.startsWith('..')\n\t\t? sourcePath.replace(/[:\\\\/]/g, '_')\n\t\t: relativeSourcePath;\n\n\treturn join(serverCacheRoot, `${normalizedSourcePath}.server.js`);\n};\n\nconst writeIfChanged = async (path: string, content: string) => {\n\tconst targetFile = Bun.file(path);\n\tif (await targetFile.exists()) {\n\t\tconst currentContent = await targetFile.text();\n\t\tif (currentContent === content) return;\n\t}\n\n\tawait Bun.write(path, content);\n};\n\nconst stripExports = (code: string) =>\n\tcode.replace(/export\\s+default/, 'const script =');\n\nconst mergeVueImports = (code: string) => {\n\tconst lines = code.split('\\n');\n\tconst specifierSet = new Set<string>();\n\tconst vueImportRegex = /^import\\s+{([^}]+)}\\s+from\\s+['\"]vue['\"];?$/;\n\n\tlines.forEach((line) => {\n\t\tconst match = line.match(vueImportRegex);\n\t\tif (match?.[1])\n\t\t\tmatch[1]\n\t\t\t\t.split(',')\n\t\t\t\t.forEach((importSpecifier) =>\n\t\t\t\t\tspecifierSet.add(importSpecifier.trim())\n\t\t\t\t);\n\t});\n\n\tconst nonVueLines = lines.filter((line) => !vueImportRegex.test(line));\n\n\treturn specifierSet.size\n\t\t? [\n\t\t\t\t`import { ${[...specifierSet].join(', ')} } from \"vue\";`,\n\t\t\t\t...nonVueLines\n\t\t\t].join('\\n')\n\t\t: nonVueLines.join('\\n');\n};\n\nconst extractRelativeVueImports = (sourceCode: string) =>\n\tArray.from(sourceCode.matchAll(/import\\s+[\\s\\S]+?['\"]([^'\"]+)['\"]/g))\n\t\t.map((match) => match[1])\n\t\t.filter(\n\t\t\t(importPath): importPath is string =>\n\t\t\t\ttypeof importPath === 'string' &&\n\t\t\t\timportPath.startsWith('.') &&\n\t\t\t\timportPath.endsWith('.vue')\n\t\t);\n\n/* Compile a `.vue` SFC source file into a JS module suitable for a\n server-side `await import(...)`. Mirrors `compileSvelteServerModule`:\n the build-time pipeline already emits compiled SFCs to `build/...`,\n but the runtime SSR resolver may be handed a build reference that\n points back to the original `.vue` source (Vue island registry\n entries use the source path as their build reference). Bun has no\n runtime `.vue` loader, so this helper produces a cached JS file the\n resolver can dynamically import. */\nexport const compileVueServerModule = async (sourcePath: string) => {\n\tconst cachedModulePath = compiledModuleCache.get(sourcePath);\n\tif (cachedModulePath) return cachedModulePath;\n\n\tconst compiler = await import('@vue/compiler-sfc');\n\tconst source = await Bun.file(sourcePath).text();\n\tconst { descriptor } = compiler.parse(source, { filename: sourcePath });\n\tconst componentId = Bun.hash(sourcePath)\n\t\t.toString(BASE_36_RADIX)\n\t\t.slice(0, ISLAND_COMPONENT_ID_LENGTH);\n\n\tconst hasScript = descriptor.script || descriptor.scriptSetup;\n\tconst compiledScript = hasScript\n\t\t? compiler.compileScript(descriptor, {\n\t\t\t\tfs: {\n\t\t\t\t\tfileExists: existsSync,\n\t\t\t\t\trealpath: realpathSync,\n\t\t\t\t\treadFile: (file) =>\n\t\t\t\t\t\texistsSync(file)\n\t\t\t\t\t\t\t? readFileSync(file, 'utf-8')\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t},\n\t\t\t\tid: componentId,\n\t\t\t\tinlineTemplate: false\n\t\t\t})\n\t\t: { bindings: {}, content: 'export default {};' };\n\n\tconst renderCode = descriptor.template\n\t\t? compiler.compileTemplate({\n\t\t\t\tcompilerOptions: {\n\t\t\t\t\tbindingMetadata: compiledScript.bindings,\n\t\t\t\t\texpressionPlugins: ['typescript'],\n\t\t\t\t\tprefixIdentifiers: true,\n\t\t\t\t\tisCustomElement: (tag) => tag === 'absolute-island'\n\t\t\t\t},\n\t\t\t\tfilename: sourcePath,\n\t\t\t\tid: componentId,\n\t\t\t\tscoped: descriptor.styles.some(\n\t\t\t\t\t(styleBlock) => styleBlock.scoped\n\t\t\t\t),\n\t\t\t\tsource: descriptor.template.content,\n\t\t\t\tssr: true,\n\t\t\t\tssrCssVars: descriptor.cssVars\n\t\t\t}).code\n\t\t: 'const ssrRender = () => {};';\n\n\tconst childImportPaths = extractRelativeVueImports(compiledScript.content);\n\tconst compiledChildren = await Promise.all(\n\t\tchildImportPaths.map(async (relativeImport) => ({\n\t\t\tcompiledPath: await compileVueServerModule(\n\t\t\t\tresolve(dirname(sourcePath), relativeImport)\n\t\t\t),\n\t\t\tspec: relativeImport\n\t\t}))\n\t);\n\n\tconst strippedScript = stripExports(compiledScript.content);\n\tconst transpiledScript = transpiler.transformSync(strippedScript);\n\n\tconst assembled = mergeVueImports(\n\t\t[\n\t\t\ttranspiledScript,\n\t\t\trenderCode,\n\t\t\t'script.ssrRender = ssrRender;',\n\t\t\t'export default script;'\n\t\t].join('\\n')\n\t);\n\n\tconst compiledModulePath = getCachedModulePath(sourcePath);\n\tlet rewritten = assembled;\n\tfor (const child of compiledChildren) {\n\t\trewritten = rewritten.replaceAll(\n\t\t\tchild.spec,\n\t\t\tensureRelativeImportPath(compiledModulePath, child.compiledPath)\n\t\t);\n\t}\n\n\tawait mkdir(dirname(compiledModulePath), { recursive: true });\n\tawait writeIfChanged(compiledModulePath, rewritten);\n\tcompiledModuleCache.set(sourcePath, compiledModulePath);\n\n\treturn compiledModulePath;\n};\n",
|
|
41
|
-
"import type {\n\tIslandRegistry,\n\tIslandRegistryInput,\n\tRuntimeIslandRenderProps\n} from '../../types/island';\nimport {\n\trenderAngularIslandToHtml,\n\trenderReactIslandToHtml,\n\trenderSvelteIslandToHtml,\n\trenderVueIslandToHtml\n} from './islandSsr';\nimport { compileAngularServerModule } from './angularServerModule';\nimport { compileSvelteServerModule } from './svelteServerModule';\nimport { compileVueServerModule } from './vueServerModule';\nimport {\n\tgetIslandMarkerAttributes,\n\tserializeIslandAttributes\n} from './islandMarkupAttributes';\nimport { getIslandBuildReference, getIslandComponent } from './islands';\n\nlet islandSequence = 0;\nconst resolvedServerComponentCache = new Map<unknown, Promise<unknown>>();\nconst resolvedServerBuildComponentCache = new Map<string, Promise<unknown>>();\n\nconst nextIslandId = () => {\n\tislandSequence += 1;\n\n\treturn `island-${islandSequence}`;\n};\n\ntype AngularServerIslandComponent = import('@angular/core').Type<object>;\ntype ReactServerIslandComponent = import('react').ComponentType<\n\tRecord<string, unknown>\n>;\ntype SvelteServerIslandComponent = import('svelte').Component<\n\tRecord<string, unknown>\n>;\ntype VueServerIslandComponent = import('vue').Component<\n\tRecord<string, unknown>\n>;\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isReactServerIslandComponent = (\n\tvalue: unknown\n): value is ReactServerIslandComponent => typeof value === 'function';\n\nconst isSvelteServerIslandComponent = (\n\tvalue: unknown\n): value is SvelteServerIslandComponent => typeof value === 'function';\n\nconst isVueServerIslandComponent = (\n\tvalue: unknown\n): value is VueServerIslandComponent =>\n\ttypeof value === 'function' || isRecord(value);\n\nconst isAngularServerIslandComponent = (\n\tvalue: unknown\n): value is AngularServerIslandComponent => typeof value === 'function';\n\nconst resolveBuildReferencePath = (source: string, registryPath: string) => {\n\tif (source.startsWith('file://')) return new URL(source).pathname;\n\tif (source.startsWith('.')) return new URL(source, registryPath).pathname;\n\n\treturn source;\n};\n\nconst loadAndCompileServerBuildComponent = async (\n\tbuildReferencePath: string\n) => {\n\tconst compiledModulePath =\n\t\tawait compileSvelteServerModule(buildReferencePath);\n\tconst loadedModule = await import(compiledModulePath);\n\n\treturn 'default' in loadedModule ? loadedModule.default : loadedModule;\n};\n\nconst loadServerBuildComponent = async (buildReferencePath: string) => {\n\tconst cachedBuildComponent =\n\t\tresolvedServerBuildComponentCache.get(buildReferencePath);\n\tif (cachedBuildComponent) {\n\t\treturn cachedBuildComponent;\n\t}\n\n\tconst loadPromise = loadAndCompileServerBuildComponent(buildReferencePath);\n\tresolvedServerBuildComponentCache.set(buildReferencePath, loadPromise);\n\n\treturn loadPromise;\n};\n\nconst resolveRuntimeImportTarget = async (resolvedModulePath: string) => {\n\tif (resolvedModulePath.endsWith('.svelte')) {\n\t\treturn compileSvelteServerModule(resolvedModulePath);\n\t}\n\tif (resolvedModulePath.endsWith('.vue')) {\n\t\treturn compileVueServerModule(resolvedModulePath);\n\t}\n\n\treturn resolvedModulePath;\n};\n\nconst loadServerImportComponent = async (\n\tresolvedComponent: string,\n\texportName?: string\n) => {\n\tconst resolvedModulePath = resolvedComponent.startsWith('.')\n\t\t? new URL(resolvedComponent, import.meta.url).pathname\n\t\t: resolvedComponent;\n\tconst importTarget = await resolveRuntimeImportTarget(resolvedModulePath);\n\tconst loadedModule = await import(importTarget);\n\n\tif (exportName && exportName !== 'default' && exportName in loadedModule) {\n\t\treturn loadedModule[exportName];\n\t}\n\n\treturn 'default' in loadedModule ? loadedModule.default : loadedModule;\n};\n\nconst resolveIslandComponent = async (component: unknown) => {\n\tconst buildReference = getIslandBuildReference(component);\n\tconst buildReferencePath = buildReference?.source\n\t\t? resolveBuildReferencePath(buildReference.source, import.meta.url)\n\t\t: null;\n\tif (buildReferencePath?.endsWith('.svelte')) {\n\t\treturn loadServerBuildComponent(buildReferencePath);\n\t}\n\tif (buildReferencePath) {\n\t\treturn loadServerImportComponent(\n\t\t\tbuildReferencePath,\n\t\t\tbuildReference?.export\n\t\t);\n\t}\n\n\tconst resolvedComponent = getIslandComponent(component);\n\tif (typeof resolvedComponent !== 'string') {\n\t\treturn resolvedComponent;\n\t}\n\n\treturn loadServerImportComponent(resolvedComponent);\n};\n\nconst resolveServerIslandComponent = async (component: unknown) => {\n\tconst cachedResolvedComponent = resolvedServerComponentCache.get(component);\n\tif (cachedResolvedComponent) {\n\t\treturn cachedResolvedComponent;\n\t}\n\n\tconst resolutionPromise = resolveIslandComponent(component);\n\n\tresolvedServerComponentCache.set(component, resolutionPromise);\n\n\treturn resolutionPromise;\n};\n\nconst resolveReactServerIslandComponent = async (component: unknown) => {\n\tconst resolvedComponent = await resolveServerIslandComponent(component);\n\tif (!isReactServerIslandComponent(resolvedComponent)) {\n\t\tthrow new Error(\n\t\t\t'Resolved React island is not a valid React component.'\n\t\t);\n\t}\n\n\treturn resolvedComponent;\n};\n\nconst resolveSvelteServerIslandComponent = async (component: unknown) => {\n\tconst resolvedComponent = await resolveServerIslandComponent(component);\n\tif (!isSvelteServerIslandComponent(resolvedComponent)) {\n\t\tthrow new Error(\n\t\t\t'Resolved Svelte island is not a valid Svelte component.'\n\t\t);\n\t}\n\n\treturn resolvedComponent;\n};\n\nconst resolveVueServerIslandComponent = async (component: unknown) => {\n\tconst resolvedComponent = await resolveServerIslandComponent(component);\n\tif (!isVueServerIslandComponent(resolvedComponent)) {\n\t\tthrow new Error('Resolved Vue island is not a valid Vue component.');\n\t}\n\n\treturn resolvedComponent;\n};\n\nconst loadAngularServerBuildComponent = async (\n\tbuildReferencePath: string,\n\texportName?: string\n) => {\n\tconst serverModulePath =\n\t\tawait compileAngularServerModule(buildReferencePath);\n\tconst loadedModule = await import(serverModulePath);\n\tif (exportName && exportName !== 'default' && exportName in loadedModule) {\n\t\treturn loadedModule[exportName];\n\t}\n\n\treturn 'default' in loadedModule ? loadedModule.default : loadedModule;\n};\n\nconst resolveAngularServerIslandComponent = async (component: unknown) => {\n\t// In a production build the registry entry is a lazy build reference to the\n\t// component's raw `.ts`; compile it to a vendor-linked server module first so\n\t// it shares the render pipeline's Angular instance (see angularServerModule).\n\t// In dev the registry holds the real component, so fall through.\n\tconst buildReference = getIslandBuildReference(component);\n\tconst buildReferencePath = buildReference?.source\n\t\t? resolveBuildReferencePath(buildReference.source, import.meta.url)\n\t\t: null;\n\tconst resolvedComponent = buildReferencePath\n\t\t? await loadAngularServerBuildComponent(\n\t\t\t\tbuildReferencePath,\n\t\t\t\tbuildReference?.export\n\t\t\t)\n\t\t: await resolveServerIslandComponent(component);\n\tif (!isAngularServerIslandComponent(resolvedComponent)) {\n\t\tthrow new Error(\n\t\t\t'Resolved Angular island is not a valid Angular component.'\n\t\t);\n\t}\n\n\treturn resolvedComponent;\n};\n\nexport const renderIslandMarkup = async <T extends IslandRegistryInput>(\n\tregistry: IslandRegistry<T> | T,\n\tprops: RuntimeIslandRenderProps\n) => {\n\tconst result = await renderIslandResult(registry, props);\n\n\treturn `<div ${serializeIslandAttributes(result.attributes)}>${result.html}</div>`;\n};\nexport const renderIslandResult = async <T extends IslandRegistryInput>(\n\tregistry: IslandRegistry<T> | T,\n\tprops: RuntimeIslandRenderProps\n) => {\n\tconst islandId = nextIslandId();\n\tconst attributes = getIslandMarkerAttributes(props);\n\n\tif (props.framework === 'react') {\n\t\tconst entry = registry.react?.[props.component];\n\t\tif (!entry) {\n\t\t\tthrow new Error(\n\t\t\t\t`Island component \"${props.component}\" is not registered for framework \"react\".`\n\t\t\t);\n\t\t}\n\t\tconst component = await resolveReactServerIslandComponent(entry);\n\t\tconst html = await renderReactIslandToHtml(component, props.props);\n\n\t\treturn { attributes, html };\n\t}\n\n\tif (props.framework === 'svelte') {\n\t\tconst entry = registry.svelte?.[props.component];\n\t\tif (!entry) {\n\t\t\tthrow new Error(\n\t\t\t\t`Island component \"${props.component}\" is not registered for framework \"svelte\".`\n\t\t\t);\n\t\t}\n\t\tconst component = await resolveSvelteServerIslandComponent(entry);\n\t\tconst html = await renderSvelteIslandToHtml(component, props.props);\n\n\t\treturn { attributes, html };\n\t}\n\n\tif (props.framework === 'vue') {\n\t\tconst entry = registry.vue?.[props.component];\n\t\tif (!entry) {\n\t\t\tthrow new Error(\n\t\t\t\t`Island component \"${props.component}\" is not registered for framework \"vue\".`\n\t\t\t);\n\t\t}\n\t\tconst component = await resolveVueServerIslandComponent(entry);\n\t\tconst html = await renderVueIslandToHtml(component, props.props);\n\n\t\treturn { attributes, html };\n\t}\n\n\tif (props.framework === 'angular') {\n\t\tconst entry = registry.angular?.[props.component];\n\t\tif (!entry) {\n\t\t\tthrow new Error(\n\t\t\t\t`Island component \"${props.component}\" is not registered for framework \"angular\".`\n\t\t\t);\n\t\t}\n\t\tconst component = await resolveAngularServerIslandComponent(entry);\n\t\tconst html = await renderAngularIslandToHtml(\n\t\t\tcomponent,\n\t\t\tprops.props,\n\t\t\tislandId\n\t\t);\n\n\t\treturn {\n\t\t\tattributes: {\n\t\t\t\t...getIslandMarkerAttributes(props, islandId)\n\t\t\t},\n\t\t\thtml\n\t\t};\n\t}\n\n\tthrow new Error(\n\t\t`Framework \"${props.framework}\" is not implemented in this prototype.`\n\t);\n};\n",
|
|
42
|
-
"import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (\n\t\tprocess.env.NODE_ENV === 'production' ||\n\t\tisStreamingSlotCollectionActive()\n\t) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n",
|
|
43
|
-
"import type { StreamingSlot } from '../utils/streamingSlots';\nimport {\n\tsetStreamingSlotCollectionController,\n\tsetStreamingSlotRegistrar\n} from './streamingSlotRegistrar';\n\ntype SlotStore = Map<string, StreamingSlot>;\ntype AsyncLocalStorageType =\n\timport('node:async_hooks').AsyncLocalStorage<SlotStore>;\n\nconst STREAMING_SLOT_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotAsyncLocalStorage'\n);\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isAsyncLocalStorage = (value: unknown): value is AsyncLocalStorageType =>\n\tisObjectRecord(value) &&\n\t'getStore' in value &&\n\ttypeof value.getStore === 'function' &&\n\t'run' in value &&\n\ttypeof value.run === 'function';\n\nconst getStorageGlobal = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') {\n\t\treturn value;\n\t}\n\n\treturn isAsyncLocalStorage(value) ? value : undefined;\n};\n\nconst isServerRuntime = () =>\n\ttypeof process !== 'undefined' &&\n\ttypeof process.versions?.node === 'string';\n\nconst ensureAsyncLocalStorage = async () => {\n\tconst storage = getStorageGlobal();\n\tif (typeof storage !== 'undefined') {\n\t\treturn storage;\n\t}\n\tif (!isServerRuntime()) {\n\t\tReflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, null);\n\n\t\treturn getStorageGlobal();\n\t}\n\n\tconst mod = await import('node:async_hooks');\n\tReflect.set(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_STORAGE_KEY,\n\t\tnew mod.AsyncLocalStorage<SlotStore>()\n\t);\n\n\treturn getStorageGlobal();\n};\n\nconst getActiveSlotStore = () => {\n\tconst storage = getStorageGlobal();\n\tif (!storage) return undefined;\n\n\treturn storage.getStore();\n};\n\nconst registerStreamingSlot = (slot: StreamingSlot) => {\n\tconst store = getActiveSlotStore();\n\tif (!store) return;\n\tstore.set(slot.id, slot);\n};\n\nsetStreamingSlotRegistrar(registerStreamingSlot);\nsetStreamingSlotCollectionController({\n\tisCollecting: () => getActiveSlotStore() !== undefined\n});\n\nexport const hasActiveStreamingSlotRegistry = () =>\n\tgetActiveSlotStore() !== undefined;\n\nexport const runWithStreamingSlotRegistry = async <T>(\n\ttask: () => Promise<T> | T\n) => {\n\tconst storage = await ensureAsyncLocalStorage();\n\tif (!storage) {\n\t\tconst slots: StreamingSlot[] = [];\n\n\t\treturn {\n\t\t\tresult: await task(),\n\t\t\tslots\n\t\t};\n\t}\n\n\treturn storage.run(new Map<string, StreamingSlot>(), async () => {\n\t\tconst result = await task();\n\t\tconst store = storage.getStore();\n\n\t\treturn {\n\t\t\tresult,\n\t\t\tslots: store ? [...store.values()] : []\n\t\t};\n\t});\n};\n",
|
|
44
|
-
"import { computed, defineComponent, h, ref } from 'vue';\nimport {\n\tDEFAULT_QUALITY,\n\tbuildOptimizedUrl,\n\tgenerateBlurSvg,\n\tgenerateSrcSet\n} from '../../utils/imageClient';\n\ntype ImageLoader = (params: {\n\tsrc: string;\n\twidth: number;\n\tquality: number;\n}) => string;\n\ntype ImageStyle = Record<string, string | number>;\n\ntype ImageProps = {\n\tsrc: string;\n\talt: string;\n\twidth?: number;\n\theight?: number;\n\tfill?: boolean;\n\tquality?: number;\n\tsizes?: string;\n\tloader?: ImageLoader;\n\tunoptimized?: boolean;\n\tloading?: 'lazy' | 'eager';\n\tpriority?: boolean;\n\tplaceholder?: string;\n\tblurDataURL?: string;\n\tclassName?: string;\n\tstyle?: ImageStyle;\n\tonLoad?: (() => void) | ((event: Event) => void);\n\tonError?: (() => void) | ((event: Event) => void);\n\tcrossOrigin?: 'anonymous' | 'use-credentials' | '';\n\treferrerPolicy?:\n\t\t| ''\n\t\t| 'no-referrer'\n\t\t| 'no-referrer-when-downgrade'\n\t\t| 'origin'\n\t\t| 'origin-when-cross-origin'\n\t\t| 'same-origin'\n\t\t| 'strict-origin'\n\t\t| 'strict-origin-when-cross-origin'\n\t\t| 'unsafe-url';\n\tfetchPriority?: 'high' | 'low' | 'auto';\n\toverrideSrc?: string;\n};\n\nconst fillWrapperStyle: ImageStyle = {\n\tdisplay: 'block',\n\theight: '100%',\n\toverflow: 'hidden',\n\tposition: 'relative',\n\twidth: '100%'\n};\n\nexport const Image = defineComponent({\n\tname: 'AbsoluteImage',\n\tprops: {\n\t\talt: { required: true, type: String },\n\t\tblurDataURL: { default: undefined, type: String },\n\t\tclassName: { default: undefined, type: String },\n\t\tcrossOrigin: { default: undefined, type: String },\n\t\tfetchPriority: { default: undefined, type: String },\n\t\tfill: { default: false, type: Boolean },\n\t\theight: { default: undefined, type: Number },\n\t\tloader: { default: undefined, type: Function },\n\t\tloading: { default: 'lazy', type: String },\n\t\tonError: { default: undefined, type: Function },\n\t\tonLoad: { default: undefined, type: Function },\n\t\toverrideSrc: { default: undefined, type: String },\n\t\tplaceholder: { default: undefined, type: String },\n\t\tpriority: { default: false, type: Boolean },\n\t\tquality: { default: DEFAULT_QUALITY, type: Number },\n\t\treferrerPolicy: { default: undefined, type: String },\n\t\tsizes: { default: undefined, type: String },\n\t\tsrc: { required: true, type: String },\n\t\tstyle: { default: undefined, type: Object },\n\t\tunoptimized: { default: false, type: Boolean },\n\t\twidth: { default: undefined, type: Number }\n\t},\n\tsetup(props: ImageProps) {\n\t\tconst blurRemoved = ref(false);\n\n\t\tconst resolvedSrc = computed(() => {\n\t\t\tif (props.overrideSrc) return props.overrideSrc;\n\t\t\tif (props.unoptimized) return props.src;\n\t\t\tif (props.loader) {\n\t\t\t\treturn props.loader({\n\t\t\t\t\tquality: props.quality ?? DEFAULT_QUALITY,\n\t\t\t\t\tsrc: props.src,\n\t\t\t\t\twidth: props.width ?? 0\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (!props.width) {\n\t\t\t\treturn buildOptimizedUrl(\n\t\t\t\t\tprops.src,\n\t\t\t\t\t0,\n\t\t\t\t\tprops.quality ?? DEFAULT_QUALITY\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn buildOptimizedUrl(\n\t\t\t\tprops.src,\n\t\t\t\tprops.width,\n\t\t\t\tprops.quality ?? DEFAULT_QUALITY\n\t\t\t);\n\t\t});\n\n\t\tconst srcSet = computed(() =>\n\t\t\tprops.unoptimized\n\t\t\t\t? undefined\n\t\t\t\t: generateSrcSet(props.src, props.width, props.sizes)\n\t\t);\n\n\t\tconst resolvedSizes = computed(\n\t\t\t() => props.sizes ?? (props.fill ? '100vw' : undefined)\n\t\t);\n\n\t\tconst resolvedLoading = computed(() =>\n\t\t\tprops.priority ? 'eager' : (props.loading ?? 'lazy')\n\t\t);\n\n\t\tconst resolvedFetchPriority = computed(() =>\n\t\t\tprops.priority ? 'high' : props.fetchPriority\n\t\t);\n\n\t\tconst hasBlur = computed(\n\t\t\t() =>\n\t\t\t\tprops.placeholder === 'blur' ||\n\t\t\t\t(typeof props.placeholder === 'string' &&\n\t\t\t\t\tprops.placeholder !== 'empty' &&\n\t\t\t\t\tprops.placeholder.startsWith('data:'))\n\t\t);\n\n\t\tconst blurBackground = computed(() => {\n\t\t\tif (!hasBlur.value || blurRemoved.value) return undefined;\n\t\t\tif (\n\t\t\t\ttypeof props.placeholder === 'string' &&\n\t\t\t\tprops.placeholder !== 'blur' &&\n\t\t\t\tprops.placeholder.startsWith('data:')\n\t\t\t) {\n\t\t\t\treturn generateBlurSvg(props.placeholder);\n\t\t\t}\n\t\t\tif (props.blurDataURL) return generateBlurSvg(props.blurDataURL);\n\n\t\t\treturn undefined;\n\t\t});\n\n\t\tconst imgStyle = computed(() => {\n\t\t\tconst base: ImageStyle = {\n\t\t\t\t...(props.style ?? {}),\n\t\t\t\tcolor: 'transparent'\n\t\t\t};\n\t\t\tif (blurBackground.value) {\n\t\t\t\tbase.backgroundImage = blurBackground.value;\n\t\t\t\tbase.backgroundPosition = 'center';\n\t\t\t\tbase.backgroundRepeat = 'no-repeat';\n\t\t\t\tbase.backgroundSize = 'cover';\n\t\t\t}\n\t\t\tif (props.fill) {\n\t\t\t\tbase.height = '100%';\n\t\t\t\tbase.inset = '0';\n\t\t\t\tbase.objectFit = 'cover';\n\t\t\t\tbase.position = 'absolute';\n\t\t\t\tbase.width = '100%';\n\t\t\t}\n\n\t\t\treturn base;\n\t\t});\n\n\t\tconst handleLoad = (event: Event) => {\n\t\t\tblurRemoved.value = true;\n\t\t\tprops.onLoad?.(event);\n\t\t};\n\n\t\tconst handleError = (event: Event) => {\n\t\t\tprops.onError?.(event);\n\t\t};\n\n\t\treturn () => {\n\t\t\tconst imgNode = h('img', {\n\t\t\t\talt: props.alt,\n\t\t\t\tclass: props.className,\n\t\t\t\tcrossorigin: props.crossOrigin,\n\t\t\t\tdecoding: 'async',\n\t\t\t\tfetchpriority: resolvedFetchPriority.value,\n\t\t\t\theight: props.fill ? undefined : props.height,\n\t\t\t\tloading: resolvedLoading.value,\n\t\t\t\tonError: handleError,\n\t\t\t\tonLoad: handleLoad,\n\t\t\t\treferrerpolicy: props.referrerPolicy,\n\t\t\t\tsizes: resolvedSizes.value,\n\t\t\t\tsrc: resolvedSrc.value,\n\t\t\t\tsrcset: srcSet.value,\n\t\t\t\tstyle: imgStyle.value,\n\t\t\t\twidth: props.fill ? undefined : props.width\n\t\t\t});\n\n\t\t\treturn props.fill\n\t\t\t\t? h('span', { style: fillWrapperStyle }, [imgNode])\n\t\t\t\t: imgNode;\n\t\t};\n\t}\n});\n",
|
|
45
|
-
"/**\n * Client-safe image utilities — no node:fs, no Sharp, no Bun APIs.\n * These can be imported in both server and client (browser) contexts.\n */\n\nimport {\n\tIMAGE_DEFAULT_DEVICE_SIZES,\n\tIMAGE_DEFAULT_IMAGE_SIZES,\n\tIMAGE_DEFAULT_QUALITY\n} from '../constants';\n\nexport type { ImageProps } from '../../types/image';\n\nexport const DEFAULT_DEVICE_SIZES = IMAGE_DEFAULT_DEVICE_SIZES;\nexport const DEFAULT_IMAGE_SIZES = IMAGE_DEFAULT_IMAGE_SIZES;\nexport const DEFAULT_QUALITY = IMAGE_DEFAULT_QUALITY;\n\nexport const OPTIMIZATION_ENDPOINT = '/_absolute/image';\n\nexport const buildOptimizedUrl = (\n\tsrc: string,\n\twidth: number,\n\tquality: number,\n\tbasePath = OPTIMIZATION_ENDPOINT\n) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`;\n\nexport const getAllSizes = (deviceSizes?: number[], imageSizes?: number[]) => {\n\tconst device = deviceSizes ?? DEFAULT_DEVICE_SIZES;\n\n\tconst image = imageSizes ?? DEFAULT_IMAGE_SIZES;\n\n\treturn [...device, ...image].sort((left, right) => left - right);\n};\n\n/** Snap a target width UP to the nearest configured size */\nconst snapToSize = (target: number, sizes: number[]) => {\n\tfor (const size of sizes) {\n\t\tif (size >= target) return size;\n\t}\n\n\treturn sizes[sizes.length - 1] ?? target;\n};\n\nexport const generateBlurSvg = (base64Thumbnail: string) => {\n\tconst svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 320\"><filter id=\"b\" color-interpolation-filters=\"sRGB\"><feGaussianBlur stdDeviation=\"20\"/><feColorMatrix values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1\"/></filter><image filter=\"url(#b)\" x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" href=\"${base64Thumbnail}\"/></svg>`;\n\n\tconst encoded = encodeURIComponent(svg);\n\n\treturn `url(\"data:image/svg+xml,${encoded}\")`;\n};\nexport const generateSrcSet = (\n\tsrc: string,\n\twidth: number | undefined,\n\tsizes: string | undefined,\n\tdeviceSizes?: number[],\n\timageSizes?: number[]\n) => {\n\tconst quality = DEFAULT_QUALITY;\n\n\tif (sizes) {\n\t\tconst allSizes = getAllSizes(deviceSizes, imageSizes);\n\n\t\treturn allSizes\n\t\t\t.map(\n\t\t\t\t(sizeWidth) =>\n\t\t\t\t\t`${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`\n\t\t\t)\n\t\t\t.join(', ');\n\t}\n\n\tif (width) {\n\t\tconst allSizes = getAllSizes(deviceSizes, imageSizes);\n\n\t\tconst w1x = snapToSize(width, allSizes);\n\n\t\tconst w2x = snapToSize(width * 2, allSizes);\n\n\t\treturn `${buildOptimizedUrl(src, w1x, quality)} 1x, ${buildOptimizedUrl(src, w2x, quality)} 2x`;\n\t}\n\n\tconst devSizes = deviceSizes ?? DEFAULT_DEVICE_SIZES;\n\n\treturn devSizes\n\t\t.map(\n\t\t\t(sizeWidth) =>\n\t\t\t\t`${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`\n\t\t)\n\t\t.join(', ');\n};\n",
|
|
46
|
-
"import {\n\tcloneVNode,\n\tdefineComponent,\n\th,\n\tisVNode,\n\tonMounted,\n\tonBeforeUnmount,\n\tref,\n\tuseSSRContext,\n\ttype Slot,\n\ttype VNodeChild\n} from 'vue';\nimport {\n\tisStreamingSlotCollectionActive,\n\tregisterStreamingSlot,\n\twarnMissingStreamingSlotCollector\n} from '../../core/streamingSlotRegistrar';\n\nconst renderVueNodesToHtml = async (nodes: VNodeChild) => {\n\tconst { createSSRApp, h: createVNode } = await import('vue');\n\tconst { renderToString } = await import('vue/server-renderer');\n\n\tconst app = createSSRApp({\n\t\trender: () => createVNode('div', undefined, nodes ?? undefined)\n\t});\n\tconst html = await renderToString(app);\n\n\treturn html.replace(/^<div>|<\\/div>$/g, '');\n};\n\nconst hasFrameworkSlots = (\n\tdefaultSlot: Slot | undefined,\n\tfallbackSlot: Slot | undefined,\n\terrorSlot: Slot | undefined,\n\tpromise: Promise<unknown> | undefined\n) =>\n\tdefaultSlot !== undefined ||\n\tfallbackSlot !== undefined ||\n\terrorSlot !== undefined ||\n\tpromise !== undefined;\n\nconst allowMismatchOnSlotNodes: (nodes: VNodeChild) => VNodeChild = (nodes) => {\n\tif (Array.isArray(nodes)) {\n\t\treturn nodes.map((node) => allowMismatchOnSlotNodes(node));\n\t}\n\tif (isVNode(nodes)) {\n\t\treturn cloneVNode(nodes, {\n\t\t\t'data-allow-mismatch': ''\n\t\t});\n\t}\n\n\treturn nodes;\n};\n\nconst resolveSuspenseValue = async (\n\tresolve: (() => Promise<unknown> | unknown) | undefined,\n\tpromise: Promise<unknown> | undefined\n) => {\n\tif (resolve !== undefined) {\n\t\treturn resolve();\n\t}\n\n\tif (promise !== undefined) {\n\t\treturn promise;\n\t}\n\n\treturn undefined;\n};\n\ntype LegacySuspenseSlotRegistration = {\n\terrorHtml?: string;\n\tfallbackHtml: string;\n\tid: string;\n\tresolve: () => Promise<string> | string;\n\ttimeoutMs?: number;\n};\n\ntype SuspenseSlotProps = {\n\tclassName?: string;\n\terrorHtml?: string;\n\tfallbackHtml: string;\n\tid: string;\n\tpromise?: Promise<unknown>;\n\tresolve?: () => Promise<unknown> | unknown;\n\ttimeoutMs?: number;\n};\n\ntype VueSuspensePayload = {\n\tkind: 'vue-suspense';\n\tstate?: unknown;\n\tvalue?: unknown;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isVueSuspensePayload = (\n\tpayload: unknown\n): payload is VueSuspensePayload => {\n\tif (!isObjectRecord(payload)) {\n\t\treturn false;\n\t}\n\n\treturn payload.kind === 'vue-suspense';\n};\n\nconst hasEventDetailId = (event: Event, id: string) => {\n\tif (!(event instanceof CustomEvent)) {\n\t\treturn false;\n\t}\n\n\tconst { detail } = event;\n\tif (!detail || typeof detail !== 'object') {\n\t\treturn false;\n\t}\n\n\treturn detail.id === id;\n};\n\nconst toLegacySuspenseSlotRegistration = (\n\tprops: SuspenseSlotProps\n): LegacySuspenseSlotRegistration | null => {\n\tif (!props.resolve) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\terrorHtml: props.errorHtml,\n\t\tfallbackHtml: props.fallbackHtml,\n\t\tid: props.id,\n\t\ttimeoutMs: props.timeoutMs,\n\t\tresolve: async () => {\n\t\t\tconst resolved = await props.resolve?.();\n\n\t\t\treturn typeof resolved === 'string' ? resolved : '';\n\t\t}\n\t};\n};\n\nconst registerLegacySuspenseSlot = (props: LegacySuspenseSlotRegistration) => {\n\tregisterStreamingSlot({\n\t\terrorHtml: props.errorHtml,\n\t\tfallbackHtml: props.fallbackHtml,\n\t\tid: props.id,\n\t\tresolve: props.resolve,\n\t\ttimeoutMs: props.timeoutMs\n\t});\n};\n\nconst resolveStreamingSuspenseSlot = async (\n\tprops: SuspenseSlotProps,\n\tslots: Record<string, Slot | undefined>\n) => {\n\ttry {\n\t\tconst value = await resolveSuspenseValue(props.resolve, props.promise);\n\t\tconst nodes = allowMismatchOnSlotNodes(\n\t\t\tslots.default?.({ value }) ?? []\n\t\t);\n\t\tconst html = await renderVueNodesToHtml(nodes);\n\n\t\treturn {\n\t\t\thtml,\n\t\t\tkind: 'vue-suspense',\n\t\t\tvalue\n\t\t};\n\t} catch (error) {\n\t\tconst errorNodes = slots.error?.({ error });\n\t\tif (errorNodes !== undefined)\n\t\t\treturn renderVueNodesToHtml(allowMismatchOnSlotNodes(errorNodes));\n\t\tif (typeof props.errorHtml === 'string') return props.errorHtml;\n\n\t\tthrow error;\n\t}\n};\n\nconst registerSuspenseSlotForSsr = (\n\tprops: SuspenseSlotProps,\n\tslots: Record<string, Slot | undefined>,\n\tusesFrameworkSlots: boolean\n) => {\n\tif (!isStreamingSlotCollectionActive()) {\n\t\twarnMissingStreamingSlotCollector('SuspenseSlot');\n\t}\n\tconst legacyRegistration = toLegacySuspenseSlotRegistration(props);\n\tif (!usesFrameworkSlots && legacyRegistration) {\n\t\tregisterLegacySuspenseSlot(legacyRegistration);\n\n\t\treturn;\n\t}\n\n\tregisterStreamingSlot({\n\t\tid: props.id,\n\t\ttimeoutMs: props.timeoutMs,\n\t\tresolve: () => resolveStreamingSuspenseSlot(props, slots)\n\t});\n};\n\nconst applySuspensePayload = (\n\tpayload: VueSuspensePayload,\n\tstate: {\n\t\thasError: { value: boolean };\n\t\tisResolved: { value: boolean };\n\t\tresolvedValue: { value: unknown };\n\t}\n) => {\n\tstate.hasError.value = payload.state === 'error';\n\tstate.resolvedValue.value = payload.value;\n\tstate.isResolved.value = payload.state !== 'error';\n};\n\nexport const SuspenseSlot = defineComponent({\n\tname: 'AbsoluteSuspenseSlot',\n\tprops: {\n\t\tclassName: { default: undefined, type: String },\n\t\terrorHtml: { default: undefined, type: String },\n\t\tfallbackHtml: { default: '', type: String },\n\t\tid: { required: true, type: String },\n\t\tpromise: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Object\n\t\t},\n\t\tresolve: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Function\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props: SuspenseSlotProps, { slots }) {\n\t\tconst readPatchedDomState = () => {\n\t\t\tif (typeof document === 'undefined') return false;\n\t\t\tconst slotNode = document.getElementById(props.id);\n\t\t\tif (!slotNode) return false;\n\n\t\t\treturn (\n\t\t\t\tslotNode.getAttribute('data-absolute-slot-state') === 'resolved'\n\t\t\t);\n\t\t};\n\t\tconst isResolved = ref(false);\n\t\tconst resolvedValue = ref<unknown>(undefined);\n\t\tconst hasError = ref(false);\n\t\tconst hasPatchedDom = ref(readPatchedDomState());\n\t\tconst usesFrameworkSlots = hasFrameworkSlots(\n\t\t\tslots.default,\n\t\t\tslots.fallback,\n\t\t\tslots.error,\n\t\t\tprops.promise\n\t\t);\n\t\tconst isSsrRender = useSSRContext() !== undefined;\n\n\t\tif (isSsrRender) {\n\t\t\tregisterSuspenseSlotForSsr(props, slots, usesFrameworkSlots);\n\t\t}\n\n\t\tif (typeof window !== 'undefined' && usesFrameworkSlots) {\n\t\t\tconst consumers = (window.__ABS_SLOT_CONSUMERS__ =\n\t\t\t\twindow.__ABS_SLOT_CONSUMERS__ ?? {});\n\t\t\tlet runtimeReady = false;\n\t\t\tconsumers[props.id] = (payload) => {\n\t\t\t\tif (!runtimeReady) return false;\n\t\t\t\tif (!isVueSuspensePayload(payload)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tapplySuspensePayload(payload, {\n\t\t\t\t\thasError,\n\t\t\t\t\tisResolved,\n\t\t\t\t\tresolvedValue\n\t\t\t\t});\n\n\t\t\t\treturn true;\n\t\t\t};\n\t\t\tconst handlePatchedDom = (event: Event) => {\n\t\t\t\tif (hasEventDetailId(event, props.id)) {\n\t\t\t\t\thasPatchedDom.value = true;\n\t\t\t\t}\n\t\t\t};\n\t\t\tonMounted(() => {\n\t\t\t\thasPatchedDom.value = readPatchedDomState();\n\t\t\t\twindow.addEventListener(\n\t\t\t\t\t'absolutejs:slot-patch',\n\t\t\t\t\thandlePatchedDom\n\t\t\t\t);\n\t\t\t\truntimeReady = true;\n\t\t\t\twindow.__ABS_SLOT_FLUSH__?.();\n\t\t\t});\n\t\t\tonBeforeUnmount(() => {\n\t\t\t\twindow.removeEventListener(\n\t\t\t\t\t'absolutejs:slot-patch',\n\t\t\t\t\thandlePatchedDom\n\t\t\t\t);\n\t\t\t\tdelete window.__ABS_SLOT_CONSUMERS__?.[props.id];\n\t\t\t});\n\t\t}\n\n\t\tconst resolveSlotChildren = () => {\n\t\t\tif (hasPatchedDom.value) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (hasError.value) {\n\t\t\t\treturn (\n\t\t\t\t\tallowMismatchOnSlotNodes(\n\t\t\t\t\t\tslots.error?.({ error: undefined }) ??\n\t\t\t\t\t\t\tslots.fallback?.() ??\n\t\t\t\t\t\t\tundefined\n\t\t\t\t\t) ?? undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (isResolved.value) {\n\t\t\t\treturn (\n\t\t\t\t\tallowMismatchOnSlotNodes(\n\t\t\t\t\t\tslots.default?.({ value: resolvedValue.value }) ??\n\t\t\t\t\t\t\tundefined\n\t\t\t\t\t) ?? undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn allowMismatchOnSlotNodes(slots.fallback?.() ?? undefined);\n\t\t};\n\n\t\treturn () => {\n\t\t\tif (!usesFrameworkSlots) {\n\t\t\t\treturn h('div', {\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tinnerHTML: props.fallbackHtml\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn h(\n\t\t\t\t'div',\n\t\t\t\t{\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\t'data-allow-mismatch': '',\n\t\t\t\t\tid: props.id\n\t\t\t\t},\n\t\t\t\tresolveSlotChildren() ?? undefined\n\t\t\t);\n\t\t};\n\t}\n});\n",
|
|
47
|
-
"import { defineComponent, h, useSSRContext } from 'vue';\nimport {\n\tisStreamingSlotCollectionActive,\n\tregisterStreamingSlot,\n\twarnMissingStreamingSlotCollector\n} from '../../core/streamingSlotRegistrar';\n\ntype StreamSlotProps = {\n\tclassName?: string;\n\terrorHtml?: string;\n\tfallbackHtml: string;\n\tid: string;\n\tresolve: () => Promise<string> | string;\n\ttimeoutMs?: number;\n};\n\nexport const StreamSlot = defineComponent({\n\tname: 'AbsoluteStreamSlot',\n\tprops: {\n\t\tclassName: { default: undefined, type: String },\n\t\terrorHtml: { default: undefined, type: String },\n\t\tfallbackHtml: { default: '', type: String },\n\t\tid: { required: true, type: String },\n\t\tresolve: {\n\t\t\trequired: true,\n\t\t\ttype: Function\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props: StreamSlotProps) {\n\t\tif (useSSRContext() !== undefined) {\n\t\t\tregisterStreamSlotForSsr(props);\n\t\t}\n\n\t\treturn () =>\n\t\t\th('div', {\n\t\t\t\tclass: props.className,\n\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\tid: props.id,\n\t\t\t\tinnerHTML: props.fallbackHtml\n\t\t\t});\n\t}\n});\n\nconst registerStreamSlotForSsr = (props: StreamSlotProps) => {\n\tif (!isStreamingSlotCollectionActive()) {\n\t\twarnMissingStreamingSlotCollector('StreamSlot');\n\n\t\treturn;\n\t}\n\n\tregisterStreamingSlot({\n\t\terrorHtml: props.errorHtml,\n\t\tfallbackHtml: props.fallbackHtml,\n\t\tid: props.id,\n\t\tresolve: props.resolve,\n\t\ttimeoutMs: props.timeoutMs\n\t});\n};\n",
|
|
48
|
-
"import type { Component as VueComponent } from 'vue';\nimport { readdir } from 'node:fs/promises';\nimport { basename, dirname } from 'node:path';\nimport type { VuePropsOf, VueSetupApp } from '../../types/vue';\nimport { EXCLUDE_LAST_OFFSET } from '../constants';\nimport { injectInlineCss, readSiblingCss } from '../utils/inlinePageCss';\nimport { resolveSpaChildCss } from '../utils/spaRouteCss';\nimport { injectIslandPageContextStream } from '../core/islandPageContext';\nimport { getCurrentRouteRegistrationCallsite } from '../core/devRouteRegistrationCallsite';\nimport {\n\ttype StreamingSlotEnhancerOptions,\n\twithRegisteredStreamingSlots\n} from '../core/responseEnhancers';\nimport {\n\tcaptureStreamingSlotWarningCallsite,\n\trunWithStreamingSlotWarningScope\n} from '../core/streamingSlotWarningScope';\nimport { ssrErrorPage } from '../utils/ssrErrorPage';\nimport {\n\tderivePageName,\n\trenderConventionError\n} from '../utils/resolveConvention';\n\ntype VuePageRenderOptions = StreamingSlotEnhancerOptions & {\n\tcollectStreamingSlots?: boolean;\n};\n/** Hydration mode for the page bundle.\n * - `'auto'` (default): emit `<script>window.__INITIAL_PROPS__=…</script>`\n * plus the page's `<script type=\"module\">` index, mounting Vue on the\n * client.\n * - `'none'`: SSR-only. Skip both scripts entirely so the page ships\n * pure HTML — useful for marketing / docs pages that use Vue\n * templating + Tailwind without paying the runtime cost. The build\n * pipeline also skips emitting the per-page client bundle (and its\n * manifest entry) when this option is set at registration time —\n * `scanVueSsrOnlyPages` reads the literal `client: 'none'` token\n * from the handler source and excludes the matching .vue entry\n * from the client bundler pass. */\ntype VuePageClientMode =\n\t| { client: 'none'; indexPath?: string }\n\t| { client?: 'auto'; indexPath: string };\n\nexport type VuePageRequestInput<Component extends VueComponent> =\n\tVuePageRenderOptions &\n\t\tVuePageClientMode & {\n\t\t\theadTag?: `<head>${string}</head>`;\n\t\t\tpagePath: string;\n\t\t\tPage?: Component;\n\t\t\t/** The incoming Elysia request. Forwarded into the page\n\t\t\t * module's exported `setupApp(app, { url, isServer })` hook\n\t\t\t * (see compileVue's index generation) so plugins like\n\t\t\t * vue-router can navigate to the correct route before SSR. */\n\t\t\trequest?: Request;\n\t\t\t/** Sitemap metadata for this route. Statically read from the\n\t\t\t * handler source at registration time, so only literal-object\n\t\t\t * values are honoured. */\n\t\t\tsitemap?: import('../../types/sitemap').PageHandlerSitemapMetadata;\n\t\t} & (keyof VuePropsOf<Component> extends never\n\t\t\t? { props?: NoInfer<VuePropsOf<Component>> }\n\t\t\t: { props: NoInfer<VuePropsOf<Component>> });\ntype GenericVueComponent = VueComponent;\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isGenericVueComponent = (value: unknown): value is GenericVueComponent =>\n\ttypeof value === 'function' || isRecord(value);\n\nconst readHasIslands = (value: unknown) => {\n\tif (!isRecord(value)) return false;\n\tconst hasIslands = value['__ABSOLUTE_PAGE_HAS_ISLANDS__'];\n\n\treturn typeof hasIslands === 'boolean' ? hasIslands : false;\n};\n\nconst readSetupAppHook = (value: unknown) => {\n\tif (!isRecord(value)) return null;\n\tconst setupApp = value['setupApp'];\n\n\treturn typeof setupApp === 'function' ? (setupApp as VueSetupApp) : null;\n};\n\nconst readDefaultExport = (value: unknown) =>\n\tisRecord(value) ? value.default : undefined;\n\nconst resolveCurrentGeneratedVueModulePath = async (pagePath: string) => {\n\tconst pageDirectory = dirname(pagePath);\n\tconst expectedPrefix = `${basename(pagePath, '.js').split('.')[0]}.`;\n\n\ttry {\n\t\tconst pageEntries = await readdir(pageDirectory, {\n\t\t\twithFileTypes: true\n\t\t});\n\t\tconst matchingEntry = pageEntries.find(\n\t\t\t(entry) =>\n\t\t\t\tentry.isFile() &&\n\t\t\t\tentry.name.endsWith('.js') &&\n\t\t\t\t(entry.name ===\n\t\t\t\t\t`${expectedPrefix.slice(0, EXCLUDE_LAST_OFFSET)}.js` ||\n\t\t\t\t\tentry.name.startsWith(expectedPrefix))\n\t\t);\n\t\tif (!matchingEntry) {\n\t\t\treturn pagePath;\n\t\t}\n\n\t\treturn `${pageDirectory}/${matchingEntry.name}`;\n\t} catch {\n\t\treturn pagePath;\n\t}\n};\n\nconst resolveRequestRenderUrl = (request: Request | undefined) => {\n\tif (!request) return '/';\n\n\ttry {\n\t\tconst parsed = new URL(request.url);\n\n\t\treturn `${parsed.pathname}${parsed.search}`;\n\t} catch {\n\t\treturn '/';\n\t}\n};\n\nconst primeVueStream = async (stream: ReadableStream) => {\n\tconst reader = stream.getReader();\n\tconst firstChunk = await reader.read();\n\n\treturn { firstChunk, reader };\n};\n\n/* Dev-only: SSR-only Vue pages (`client: 'none'`) ship zero client JS by\n * design, which also means no WebSocket listener for HMR. To keep the\n * developer loop alive without reintroducing a framework runtime, inject\n * the same inlined HMR client bundle that HTML/HTMX pages get at build\n * time (see `injectHMRIntoHTMLFile` in `src/core/build.ts`). The bundle\n * is built lazily on first SSR-only request and cached for the life of\n * the dev server. Production builds never call this path. */\nlet cachedSsrOnlyHmrShim: Promise<string> | null = null;\n\nconst getSsrOnlyHmrShim = () => {\n\tif (cachedSsrOnlyHmrShim) return cachedSsrOnlyHmrShim;\n\tcachedSsrOnlyHmrShim = (async () => {\n\t\tconst { buildHMRClient } = await import('../dev/buildHMRClient');\n\t\tconst bundle = await buildHMRClient();\n\n\t\treturn `<script>window.__HMR_FRAMEWORK__=\"vue\";</script><script data-hmr-client>${bundle}</script>`;\n\t})();\n\n\treturn cachedSsrOnlyHmrShim;\n};\n\nexport const handleVuePageRequest = async <Component extends VueComponent>(\n\tinput: VuePageRequestInput<Component>\n) => {\n\tconst passedPageComponent = input.Page;\n\tconst userHeadTag = input.headTag ?? '<head></head>';\n\tconst resolvedOptions = input;\n\tconst resolvedPagePath = input.pagePath;\n\t// Inline per-page compiled CSS so scoped styles ship in the SSR head\n\t// instead of loading after client hydration. See utils/inlinePageCss.\n\t//\n\t// For SPA-shell pages (those that export `routes = defineRoutes([...])`),\n\t// also inline the matched child route's compiled CSS so the rendered\n\t// child component paints styled on first paint instead of waiting for\n\t// the lazy chunk to land. The page's `.spa.json` side manifest, written\n\t// in core/build.ts, lists every child route's compiled CSS path.\n\tconst [siblingCss, spaChildCss] = await Promise.all([\n\t\treadSiblingCss(resolvedPagePath),\n\t\tresolveSpaChildCss(resolvedPagePath, input.request?.url)\n\t]);\n\tconst resolvedHeadTag = injectInlineCss(\n\t\tinjectInlineCss(userHeadTag, siblingCss),\n\t\tspaChildCss\n\t);\n\tconst maybeProps = input.props;\n\tconst clientMode: 'auto' | 'none' = input.client ?? 'auto';\n\tconst resolvedIndexPath = input.indexPath;\n\tif (clientMode === 'auto' && !resolvedIndexPath) {\n\t\tthrow new Error(\n\t\t\t'handleVuePageRequest: `indexPath` is required when `client` is `\"auto\"` (the default). Pass `client: \"none\"` to ship a SSR-only page with no client bundle.'\n\t\t);\n\t}\n\n\ttry {\n\t\tconst handlerCallsite =\n\t\t\tresolvedOptions?.collectStreamingSlots === true\n\t\t\t\t? undefined\n\t\t\t\t: (getCurrentRouteRegistrationCallsite() ??\n\t\t\t\t\tcaptureStreamingSlotWarningCallsite());\n\t\tconst renderPageResponse = async () => {\n\t\t\tconst resolvePageComponent = async () => {\n\t\t\t\tif (isGenericVueComponent(passedPageComponent)) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcomponent: passedPageComponent,\n\t\t\t\t\t\thasIslands: readHasIslands(passedPageComponent),\n\t\t\t\t\t\troutes: null as unknown[] | null,\n\t\t\t\t\t\tsetupApp: null as VueSetupApp | null\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst generatedPagePath =\n\t\t\t\t\tawait resolveCurrentGeneratedVueModulePath(\n\t\t\t\t\t\tresolvedPagePath\n\t\t\t\t\t);\n\t\t\t\tconst importedPageModule: unknown = await import(\n\t\t\t\t\tgeneratedPagePath\n\t\t\t\t);\n\t\t\t\tconst importedPageComponent =\n\t\t\t\t\treadDefaultExport(importedPageModule) ?? importedPageModule;\n\t\t\t\tif (!isGenericVueComponent(importedPageComponent)) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Invalid Vue page module: ${generatedPagePath}`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tcomponent: importedPageComponent,\n\t\t\t\t\thasIslands: readHasIslands(importedPageModule),\n\t\t\t\t\tsetupApp: readSetupAppHook(importedPageModule)\n\t\t\t\t};\n\t\t\t};\n\n\t\t\tconst resolvedPage = await resolvePageComponent();\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToWebStream } = await import('vue/server-renderer');\n\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(resolvedPage.component, maybeProps ?? null)\n\t\t\t});\n\n\t\t\tlet pendingRedirect: { location: string; status: number } | null =\n\t\t\t\tnull;\n\t\t\tif (resolvedPage.setupApp) {\n\t\t\t\tconst url = resolveRequestRenderUrl(input.request);\n\t\t\t\t// `router` is null here — when the page exports `routes`, the\n\t\t\t\t// auto-wrapper compileVue injects creates the router using the\n\t\t\t\t// page's bundled vue-router and rebinds ctx.router before\n\t\t\t\t// calling the user's setupApp. The runtime never sees its own\n\t\t\t\t// vue-router instance; that's by design — vue-router is\n\t\t\t\t// inlined in the page bundle, so a separate runtime instance\n\t\t\t\t// would carry mismatched provide/inject symbols.\n\t\t\t\tawait resolvedPage.setupApp(app, {\n\t\t\t\t\tisServer: true,\n\t\t\t\t\trouter: null,\n\t\t\t\t\turl,\n\t\t\t\t\tsetRedirect: (location, status) => {\n\t\t\t\t\t\tpendingRedirect = {\n\t\t\t\t\t\t\tlocation,\n\t\t\t\t\t\t\tstatus: status ?? 302\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (pendingRedirect !== null) {\n\t\t\t\tconst redirect: { location: string; status: number } =\n\t\t\t\t\tpendingRedirect;\n\n\t\t\t\treturn new Response(null, {\n\t\t\t\t\theaders: { Location: redirect.location },\n\t\t\t\t\tstatus: redirect.status\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst bodyStream = renderToWebStream(app);\n\t\t\tconst { firstChunk, reader } = await primeVueStream(bodyStream);\n\n\t\t\tconst head = `<!DOCTYPE html><html>${resolvedHeadTag}<body><div id=\"root\">`;\n\t\t\tconst ssrOnlyHmrShim =\n\t\t\t\tclientMode === 'none' && process.env.NODE_ENV === 'development'\n\t\t\t\t\t? await getSsrOnlyHmrShim()\n\t\t\t\t\t: '';\n\t\t\tconst tail =\n\t\t\t\tclientMode === 'none'\n\t\t\t\t\t? `</div>${ssrOnlyHmrShim}</body></html>`\n\t\t\t\t\t: `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(\n\t\t\t\t\t\t\tmaybeProps ?? {}\n\t\t\t\t\t\t)}</script><script type=\"module\" src=\"${resolvedIndexPath}\"></script></body></html>`;\n\n\t\t\tconst stream = new ReadableStream({\n\t\t\t\tstart(controller) {\n\t\t\t\t\tcontroller.enqueue(head);\n\t\t\t\t\tif (!firstChunk.done) {\n\t\t\t\t\t\tcontroller.enqueue(firstChunk.value);\n\t\t\t\t\t}\n\t\t\t\t\tif (firstChunk.done) {\n\t\t\t\t\t\tcontroller.enqueue(tail);\n\t\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst pumpLoop = () => {\n\t\t\t\t\t\treader\n\t\t\t\t\t\t\t.read()\n\t\t\t\t\t\t\t.then(({ done, value }) =>\n\t\t\t\t\t\t\t\tdone\n\t\t\t\t\t\t\t\t\t? (controller.enqueue(tail),\n\t\t\t\t\t\t\t\t\t\tcontroller.close())\n\t\t\t\t\t\t\t\t\t: (controller.enqueue(value), pumpLoop())\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.catch((err) => controller.error(err));\n\t\t\t\t\t};\n\t\t\t\t\tpumpLoop();\n\t\t\t\t}\n\t\t\t});\n\t\t\tconst htmlStream = injectIslandPageContextStream(stream, {\n\t\t\t\thasIslands: resolvedPage.hasIslands\n\t\t\t});\n\n\t\t\treturn new Response(htmlStream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' }\n\t\t\t});\n\t\t};\n\n\t\treturn await runWithStreamingSlotWarningScope(\n\t\t\t() =>\n\t\t\t\tresolvedOptions?.collectStreamingSlots === true\n\t\t\t\t\t? withRegisteredStreamingSlots(\n\t\t\t\t\t\t\trenderPageResponse,\n\t\t\t\t\t\t\tresolvedOptions\n\t\t\t\t\t\t)\n\t\t\t\t\t: renderPageResponse(),\n\t\t\t{ handlerCallsite }\n\t\t);\n\t} catch (error) {\n\t\tconsole.error('[SSR] Vue render error:', error);\n\n\t\tconst pageName = derivePageName(resolvedPagePath);\n\t\tconst conventionResponse = await renderConventionError(\n\t\t\t'vue',\n\t\t\tpageName,\n\t\t\terror\n\t\t);\n\t\tif (conventionResponse) return conventionResponse;\n\n\t\treturn new Response(ssrErrorPage('vue', error), {\n\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\tstatus: 500\n\t\t});\n\t}\n};\n",
|
|
49
|
-
"/** Read the per-page compiled CSS sidecar that the build emitted next to\n * the SSR JS, and splice it into the SSR head as an inline <style>\n * block. Used by each framework's page handler so scoped/per-page\n * styles are present on first paint instead of loading client-side\n * after hydration (which produces a one-frame flash of unstyled\n * chrome — sidebar/logo/cards).\n *\n * The CSS sidecar is written by `core/build.ts` after the server and\n * CSS Bun.build passes finish: for each SSR JS output, a `.css` file\n * with the same basename + hash is placed beside it. The handler\n * derives the sidecar path from the SSR JS path it already has\n * (`pagePath` / `index`) so there's no manifest lookup, no extra\n * argument the user must thread through, and no chance of getting\n * the URL hash wrong.\n *\n * Content-hashed filenames mean the sidecar is immutable for the\n * lifetime of a build, so the read is memoised by absolute path and\n * the handler hits `readFile` at most once per page per process. */\nconst siblingCssCache = new Map<string, string>();\n\nexport const injectInlineCss = <T extends string>(\n\theadTag: T,\n\tcss: string\n) => {\n\tif (!css) return headTag;\n\tconst styleBlock = `<style data-absolute-page-css>${css}</style>`;\n\n\treturn headTag.replace('</head>', `${styleBlock}</head>`) as T;\n};\nexport const readSiblingCss = async (\n\tsiblingJsPath: string | undefined\n) => {\n\tif (!siblingJsPath) return '';\n\tconst cssPath = siblingJsPath.replace(/\\.js$/, '.css');\n\tif (cssPath === siblingJsPath) return '';\n\tconst cached = siblingCssCache.get(cssPath);\n\tif (cached !== undefined) return cached;\n\tconst { readFile } = await import('node:fs/promises');\n\ttry {\n\t\tconst css = await readFile(cssPath, 'utf-8');\n\t\tsiblingCssCache.set(cssPath, css);\n\n\t\treturn css;\n\t} catch {\n\t\t// No sidecar — page has no compiled styles, or dev-mode build\n\t\t// hasn't written one yet. Cache the miss so we don't repeatedly\n\t\t// stat a known-absent path.\n\t\tsiblingCssCache.set(cssPath, '');\n\n\t\treturn '';\n\t}\n};\n",
|
|
50
|
-
"/** SPA child-route CSS resolver.\n *\n * Each Vue page that registers `export const routes = defineRoutes([...])`\n * is the SSR entry for an SPA shell. Child routes are lazily imported\n * (`component: () => import('./Dashboard.vue')...`) so Bun.build emits\n * them as separate chunks with their own CSS bundles.\n *\n * Without this resolver, the SSR head only inlines the parent page's\n * own compiled CSS — when the browser lands on `/portal/dashboard`,\n * Dashboard's markup paints unstyled until the lazy chunk loads. This\n * module reads a side manifest the build writes alongside each SPA\n * page (`<pagePath>.spa.json`), matches the request URL against the\n * registered child routes, and returns the matched child's CSS so the\n * page handler can inline it next to the parent's.\n *\n * See `core/build.ts` for the build-time side-manifest emission and\n * `vue/pageHandler.ts` for the call site. */\nimport { readFile } from 'node:fs/promises';\n\ntype SpaRouteEntry = {\n\t/** Vue-router-style path pattern from `defineRoutes` — supports\n\t * `:param` segments. We use a simple matcher (not vue-router's full\n\t * one) since SSR only needs to identify *which* component will\n\t * render, not extract param values. */\n\tpath: string;\n\t/** Absolute disk path to the route component's sibling compiled\n\t * CSS, written by core/build.ts. Empty string means the route has\n\t * no styles to inline (e.g. a redirect or a component that doesn't\n\t * use `<style scoped>`). */\n\tcssPath: string;\n};\n\nconst sideManifestCache = new Map<string, SpaRouteEntry[]>();\n\nconst readSideManifest = async (\n\tsideManifestPath: string\n) => {\n\tconst cached = sideManifestCache.get(sideManifestPath);\n\tif (cached !== undefined) return cached;\n\ttry {\n\t\tconst raw = await readFile(sideManifestPath, 'utf-8');\n\t\tconst parsed = JSON.parse(raw);\n\t\tconst routes: SpaRouteEntry[] = Array.isArray(parsed) ? parsed : [];\n\t\tsideManifestCache.set(sideManifestPath, routes);\n\n\t\treturn routes;\n\t} catch {\n\t\t// No side manifest — page doesn't define SPA child routes, or\n\t\t// the build hasn't written it yet. Cache the miss.\n\t\tsideManifestCache.set(sideManifestPath, []);\n\n\t\treturn [];\n\t}\n};\n\n/** Translate a vue-router-style path pattern into a RegExp that matches\n * the same set of URLs. Supports `:param` (segment), `:param(\\\\d+)`\n * (segment with custom regex), and trailing `*` wildcards. Anchored to\n * `^…$` so partial matches don't sneak through. */\nconst compilePathToRegExp = (pattern: string) => {\n\t// Escape regex metachars, then unescape the colon/wildcard tokens we\n\t// re-introduce below.\n\tconst escaped = pattern.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\tconst withParams = escaped\n\t\t.replace(/:([a-zA-Z_$][a-zA-Z0-9_$]*)/g, '[^/]+')\n\t\t.replace(/\\\\\\*/g, '.*');\n\n\treturn new RegExp(`^${withParams}$`);\n};\n\nconst routeMatchers = new Map<string, RegExp>();\n\nconst matcherFor = (pattern: string) => {\n\tconst cached = routeMatchers.get(pattern);\n\tif (cached !== undefined) return cached;\n\tconst compiled = compilePathToRegExp(pattern);\n\trouteMatchers.set(pattern, compiled);\n\n\treturn compiled;\n};\n\n/** Find the route whose path pattern matches the given URL pathname.\n * Routes are tried in declaration order; the first match wins. */\nconst findMatchingRoute = (\n\troutes: SpaRouteEntry[],\n\tpathname: string\n) => {\n\tfor (const route of routes) {\n\t\tif (matcherFor(route.path).test(pathname)) return route;\n\t}\n\n\treturn null;\n};\n\nconst childCssCache = new Map<string, string>();\n\nconst readChildCss = async (cssPath: string) => {\n\tif (!cssPath) return '';\n\tconst cached = childCssCache.get(cssPath);\n\tif (cached !== undefined) return cached;\n\ttry {\n\t\tconst css = await readFile(cssPath, 'utf-8');\n\t\tchildCssCache.set(cssPath, css);\n\n\t\treturn css;\n\t} catch {\n\t\tchildCssCache.set(cssPath, '');\n\n\t\treturn '';\n\t}\n};\n\n/** Resolve the matched SPA child route's compiled CSS for a request.\n * Returns the CSS text (possibly empty) so the page handler can\n * inline it alongside the parent page's own sibling CSS. */\nexport const resolveSpaChildCss = async (\n\tsiblingJsPath: string | undefined,\n\trequestUrl: string | undefined\n) => {\n\tif (!siblingJsPath || !requestUrl) return '';\n\tconst sideManifestPath = siblingJsPath.replace(/\\.js$/, '.spa.json');\n\tif (sideManifestPath === siblingJsPath) return '';\n\tconst routes = await readSideManifest(sideManifestPath);\n\tif (routes.length === 0) return '';\n\tlet pathname: string;\n\ttry {\n\t\tpathname = new URL(requestUrl).pathname;\n\t} catch {\n\t\t// `requestUrl` may be a bare path in tests — fall back to it as-is.\n\t\tpathname = requestUrl.split('?')[0] ?? requestUrl;\n\t}\n\tconst matched = findMatchingRoute(routes, pathname);\n\tif (!matched) return '';\n\n\treturn readChildCss(matched.cssPath);\n};\n",
|
|
51
|
-
"const BOOTSTRAP_MANIFEST_KEY = 'BootstrapClient';\nconst ISLAND_MARKER = 'data-island=\"true\"';\nconst MANIFEST_MARKER = '__ABSOLUTE_MANIFEST__';\nconst ISLAND_STATE_MARKER = '__ABS_ISLAND_STATE__';\nconst CLOSING_HEAD_TAG = '</head>';\n\ndeclare global {\n\tvar __absoluteManifest: Record<string, string> | undefined;\n\tvar __ABS_ISLAND_STATE__:\n\t\t| Record<string, Record<string, unknown>>\n\t\t| undefined;\n}\n\nconst buildIslandsHeadMarkup = (manifest: Record<string, string>) => {\n\tconst manifestScript = `<script>window.__ABSOLUTE_MANIFEST__ = ${JSON.stringify(manifest)}</script>`;\n\tconst islandStateScript = `<script>window.__ABS_ISLAND_STATE__ = ${JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {})}</script>`;\n\tconst bootstrapPath = manifest[BOOTSTRAP_MANIFEST_KEY];\n\tconst bootstrapScript = bootstrapPath\n\t\t? `<script type=\"module\" src=\"${bootstrapPath}\"></script>`\n\t\t: '';\n\n\treturn `${manifestScript}${islandStateScript}${bootstrapScript}`;\n};\n\nconst injectHeadMarkup = (html: string, markup: string) => {\n\tconst closingHeadIndex = html.indexOf('</head>');\n\tif (closingHeadIndex >= 0) {\n\t\treturn `${html.slice(0, closingHeadIndex)}${markup}${html.slice(closingHeadIndex)}`;\n\t}\n\n\tconst openingBodyIndex = html.indexOf('<body');\n\tif (openingBodyIndex >= 0) {\n\t\tconst bodyStart = html.indexOf('>', openingBodyIndex);\n\t\tif (bodyStart >= 0) {\n\t\t\treturn `${html.slice(0, openingBodyIndex)}<head>${markup}</head>${html.slice(openingBodyIndex)}`;\n\t\t}\n\t}\n\n\treturn `<!DOCTYPE html><html><head>${markup}</head><body>${html}</body></html>`;\n};\n\nconst streamChunkToString = (\n\tvalue: string | Uint8Array,\n\tdecoder: TextDecoder\n) =>\n\ttypeof value === 'string' ? value : decoder.decode(value, { stream: true });\n\nconst flushSafePendingText = (\n\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\tencoder: TextEncoder,\n\tpending: string,\n\tlookbehind: number\n) => {\n\tif (pending.length <= lookbehind) {\n\t\treturn pending;\n\t}\n\n\tconst safeText = pending.slice(0, pending.length - lookbehind);\n\tcontroller.enqueue(encoder.encode(safeText));\n\n\treturn pending.slice(-lookbehind);\n};\n\nconst updateInjectedState = (\n\tconsumed: { done: boolean; injected: boolean; pending: string },\n\tinjected: boolean,\n\tpending: string\n) => {\n\tif (consumed.done) {\n\t\treturn { done: true, injected, pending };\n\t}\n\n\treturn {\n\t\tdone: false,\n\t\tinjected: consumed.injected,\n\t\tpending: consumed.pending\n\t};\n};\n\nconst readStreamChunk = async (\n\treader: ReadableStreamDefaultReader<string | Uint8Array>\n) => {\n\tconst { done, value } = await reader.read();\n\tif (done || !value) {\n\t\treturn { done, value: undefined };\n\t}\n\n\treturn { done, value };\n};\n\nconst pipeStreamWithHeadInjection = (\n\tstream: ReadableStream<string | Uint8Array>,\n\tmarkup: string\n) => {\n\tconst encoder = new TextEncoder();\n\tconst decoder = new TextDecoder();\n\tconst lookbehind = CLOSING_HEAD_TAG.length - 1;\n\tconst processPending = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\tpending: string,\n\t\tinjected: boolean\n\t) => {\n\t\tif (injected) {\n\t\t\tcontroller.enqueue(encoder.encode(pending));\n\n\t\t\treturn { injected, pending: '' };\n\t\t}\n\n\t\tconst headIndex = pending.indexOf(CLOSING_HEAD_TAG);\n\t\tif (headIndex >= 0) {\n\t\t\tconst next = `${pending.slice(0, headIndex)}${markup}${pending.slice(headIndex)}`;\n\t\t\tcontroller.enqueue(encoder.encode(next));\n\n\t\t\treturn { injected: true, pending: '' };\n\t\t}\n\n\t\treturn {\n\t\t\tinjected,\n\t\t\tpending: flushSafePendingText(\n\t\t\t\tcontroller,\n\t\t\t\tencoder,\n\t\t\t\tpending,\n\t\t\t\tlookbehind\n\t\t\t)\n\t\t};\n\t};\n\tconst finishHeadInjectionStream = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\tpending: string,\n\t\tinjected: boolean\n\t) => {\n\t\tlet finalPending = pending + decoder.decode();\n\t\tif (!injected) {\n\t\t\tfinalPending = injectHeadMarkup(finalPending, markup);\n\t\t}\n\t\tif (finalPending.length > 0) {\n\t\t\tcontroller.enqueue(encoder.encode(finalPending));\n\t\t}\n\t\tcontroller.close();\n\t};\n\tconst consumeHeadChunk = async (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\treader: ReadableStreamDefaultReader<string | Uint8Array>,\n\t\tpending: string,\n\t\tinjected: boolean\n\t) => {\n\t\tconst { done, value } = await readStreamChunk(reader);\n\t\tif (done || !value) {\n\t\t\treturn { done, injected, pending };\n\t\t}\n\n\t\tconst processed = processPending(\n\t\t\tcontroller,\n\t\t\tpending + streamChunkToString(value, decoder),\n\t\t\tinjected\n\t\t);\n\n\t\treturn {\n\t\t\tdone,\n\t\t\tinjected: processed.injected,\n\t\t\tpending: processed.pending\n\t\t};\n\t};\n\tconst runHeadInjectionLoop = async (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\treader: ReadableStreamDefaultReader<string | Uint8Array>\n\t) => {\n\t\tconst consumeNextHeadChunk = async (\n\t\t\tinjected: boolean,\n\t\t\tpending: string\n\t\t) => {\n\t\t\tconst consumed = await consumeHeadChunk(\n\t\t\t\tcontroller,\n\t\t\t\treader,\n\t\t\t\tpending,\n\t\t\t\tinjected\n\t\t\t);\n\t\t\tconst nextState = updateInjectedState(consumed, injected, pending);\n\t\t\tif (nextState.done) {\n\t\t\t\treturn { injected, pending };\n\t\t\t}\n\n\t\t\treturn consumeNextHeadChunk(nextState.injected, nextState.pending);\n\t\t};\n\n\t\treturn consumeNextHeadChunk(false, '');\n\t};\n\n\treturn new ReadableStream<Uint8Array>({\n\t\tasync start(controller) {\n\t\t\tconst reader = stream.getReader();\n\n\t\t\ttry {\n\t\t\t\tconst { injected, pending } = await runHeadInjectionLoop(\n\t\t\t\t\tcontroller,\n\t\t\t\t\treader\n\t\t\t\t);\n\t\t\t\tfinishHeadInjectionStream(controller, pending, injected);\n\t\t\t} catch (error) {\n\t\t\t\tcontroller.error(error);\n\t\t\t}\n\t\t}\n\t});\n};\n\n// `held` is the buffer kept from `</head>` onward once `sawHead` is true;\n// `pending` is the not-yet-flushed text before `</head>`; `injected` flips on\n// once the scripts have been emitted and the rest can stream straight through.\ntype IslandMarkerStreamState = {\n\theld: string;\n\tinjected: boolean;\n\tpending: string;\n\tsawHead: boolean;\n};\n\n// Streaming injector for pages whose island presence isn't known up front.\n// The manifest/state/bootstrap scripts must land in `<head>` — React 19\n// tolerates hoistable elements (scripts/links/…) there during hydration, but\n// injecting them inline in the body (e.g. just before the first island marker)\n// makes them a sibling inside a host-React-rendered element, which breaks\n// hydration with a structural mismatch. `</head>` is streamed before any body\n// island, so we flush the head immediately, then hold from `</head>` onward\n// until we can confirm whether the body actually contains an island. If it\n// does, we inject right before the held `</head>`; if it doesn't, we flush the\n// held content untouched so island-free pages don't pull in the runtime.\nconst pipeStreamWithIslandMarkerDetection = (\n\tstream: ReadableStream<string | Uint8Array>,\n\tmarkup: string\n) => {\n\tconst encoder = new TextEncoder();\n\tconst decoder = new TextDecoder();\n\tconst headLookbehind = CLOSING_HEAD_TAG.length - 1;\n\n\tconst enqueue = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\ttext: string\n\t) => {\n\t\tif (text.length > 0) {\n\t\t\tcontroller.enqueue(encoder.encode(text));\n\t\t}\n\t};\n\t// From `</head>` onward: hold until an island marker confirms the page has\n\t// islands, then inject the scripts just before the held `</head>`.\n\tconst processHolding = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\theld: string\n\t) => {\n\t\tif (!held.includes(ISLAND_MARKER)) {\n\t\t\treturn { held, injected: false, pending: '', sawHead: true };\n\t\t}\n\t\tenqueue(controller, `${markup}${held}`);\n\n\t\treturn { held: '', injected: true, pending: '', sawHead: true };\n\t};\n\t// Before `</head>`: flush safe text and watch for the head close tag.\n\tconst processHead = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\tpending: string\n\t) => {\n\t\tconst headIndex = pending.indexOf(CLOSING_HEAD_TAG);\n\t\tif (headIndex < 0) {\n\t\t\treturn {\n\t\t\t\theld: '',\n\t\t\t\tinjected: false,\n\t\t\t\tpending: flushSafePendingText(\n\t\t\t\t\tcontroller,\n\t\t\t\t\tencoder,\n\t\t\t\t\tpending,\n\t\t\t\t\theadLookbehind\n\t\t\t\t),\n\t\t\t\tsawHead: false\n\t\t\t};\n\t\t}\n\t\tenqueue(controller, pending.slice(0, headIndex));\n\n\t\treturn processHolding(controller, pending.slice(headIndex));\n\t};\n\tconst processChunk = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\tstate: IslandMarkerStreamState,\n\t\tchunk: string\n\t) => {\n\t\tif (state.injected) {\n\t\t\tenqueue(controller, chunk);\n\n\t\t\treturn state;\n\t\t}\n\t\tif (!state.sawHead) {\n\t\t\treturn processHead(controller, state.pending + chunk);\n\t\t}\n\n\t\treturn processHolding(controller, state.held + chunk);\n\t};\n\tconst finishMarkerStream = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\tstate: IslandMarkerStreamState\n\t) => {\n\t\tconst tail = decoder.decode();\n\t\t// `injected` → tail only; `sawHead` (held, no islands) → flush as-is;\n\t\t// otherwise no `</head>` was ever seen, so pass the buffer through.\n\t\tconst remainder = state.injected\n\t\t\t? tail\n\t\t\t: (state.sawHead ? state.held : state.pending) + tail;\n\t\tenqueue(controller, remainder);\n\t\tcontroller.close();\n\t};\n\tconst runMarkerLoop = (\n\t\tcontroller: ReadableStreamDefaultController<Uint8Array>,\n\t\treader: ReadableStreamDefaultReader<string | Uint8Array>\n\t) => {\n\t\tconst consumeNext = async (state: IslandMarkerStreamState) => {\n\t\t\tconst { done, value } = await readStreamChunk(reader);\n\t\t\tif (done || !value) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\treturn consumeNext(\n\t\t\t\tprocessChunk(\n\t\t\t\t\tcontroller,\n\t\t\t\t\tstate,\n\t\t\t\t\tstreamChunkToString(value, decoder)\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\n\t\treturn consumeNext({\n\t\t\theld: '',\n\t\t\tinjected: false,\n\t\t\tpending: '',\n\t\t\tsawHead: false\n\t\t});\n\t};\n\n\treturn new ReadableStream<Uint8Array>({\n\t\tasync start(controller) {\n\t\t\tconst reader = stream.getReader();\n\n\t\t\ttry {\n\t\t\t\tconst finalState = await runMarkerLoop(controller, reader);\n\t\t\t\tfinishMarkerStream(controller, finalState);\n\t\t\t} catch (error) {\n\t\t\t\tcontroller.error(error);\n\t\t\t}\n\t\t}\n\t});\n};\n\nexport const htmlContainsIslands = (html: string) =>\n\thtml.includes(ISLAND_MARKER);\nexport const injectIslandPageContext = (\n\thtml: string,\n\toptions?: { hasIslands?: boolean }\n) => {\n\tconst manifest = globalThis.__absoluteManifest;\n\tconst hasIslands = options?.hasIslands ?? htmlContainsIslands(html);\n\tif (!manifest || !hasIslands) {\n\t\treturn html;\n\t}\n\n\tif (html.includes(MANIFEST_MARKER) || html.includes(ISLAND_STATE_MARKER)) {\n\t\treturn html;\n\t}\n\n\treturn injectHeadMarkup(html, buildIslandsHeadMarkup(manifest));\n};\n\nexport const injectIslandPageContextStream = (\n\tstream: ReadableStream<string | Uint8Array>,\n\toptions?: { hasIslands?: boolean }\n) => {\n\tconst manifest = globalThis.__absoluteManifest;\n\tif (!manifest) return stream;\n\tconst markup = buildIslandsHeadMarkup(manifest);\n\n\tif (options?.hasIslands === true) {\n\t\treturn pipeStreamWithHeadInjection(stream, markup);\n\t}\n\tif (options?.hasIslands === false) {\n\t\treturn stream;\n\t}\n\n\treturn pipeStreamWithIslandMarkerDetection(stream, markup);\n};\nexport const setCurrentIslandManifest = (manifest: Record<string, string>) => {\n\tglobalThis.__absoluteManifest = manifest;\n};\n",
|
|
52
|
-
"import {\n\tappendStreamingSlotPatchesToStream,\n\ttype AppendStreamingSlotsOptions,\n\ttype StreamingSlotPolicy,\n\ttype StreamingSlot\n} from '../utils/streamingSlots';\nimport { runWithStreamingSlotRegistry } from './streamingSlotRegistry';\n\ntype ResponseLike = Response | Promise<Response>;\n\nexport type StreamingSlotEnhancerOptions = Omit<\n\tAppendStreamingSlotsOptions,\n\t'injectRuntime'\n> & {\n\tstreamingSlots?: StreamingSlot[];\n\tpolicy?: StreamingSlotPolicy;\n};\n\nconst toResponse = async (responseLike: ResponseLike) => responseLike;\n\nconst cloneHeaders = (response: Response) => {\n\tconst headers = new Headers(response.headers);\n\n\treturn headers;\n};\n\nexport const enhanceHtmlResponseWithStreamingSlots = (\n\tresponse: Response,\n\t{\n\t\tnonce,\n\t\tonError,\n\t\truntimePlacement,\n\t\truntimePreludeScript,\n\t\tstreamingSlots = [],\n\t\tpolicy\n\t}: StreamingSlotEnhancerOptions = {}\n) => {\n\tif (!response.body || streamingSlots.length === 0) {\n\t\treturn response;\n\t}\n\n\tconst body = appendStreamingSlotPatchesToStream(\n\t\tresponse.body,\n\t\tstreamingSlots,\n\t\t{\n\t\t\tnonce,\n\t\t\tonError,\n\t\t\tpolicy,\n\t\t\truntimePlacement,\n\t\t\truntimePreludeScript\n\t\t}\n\t);\n\n\treturn new Response(body, {\n\t\theaders: cloneHeaders(response),\n\t\tstatus: response.status,\n\t\tstatusText: response.statusText\n\t});\n};\n\nexport const withStreamingSlots = async (\n\tresponseLike: ResponseLike,\n\toptions: StreamingSlotEnhancerOptions = {}\n) =>\n\tenhanceHtmlResponseWithStreamingSlots(\n\t\tawait toResponse(responseLike),\n\t\toptions\n\t);\n\nconst mergeStreamingSlots = (\n\tregistered: StreamingSlot[],\n\texplicit: StreamingSlot[]\n) => {\n\tconst merged = new Map<string, StreamingSlot>();\n\tfor (const slot of registered) merged.set(slot.id, slot);\n\tfor (const slot of explicit) merged.set(slot.id, slot);\n\n\treturn [...merged.values()];\n};\n\nexport const withRegisteredStreamingSlots = async (\n\trenderResponse: () => ResponseLike,\n\toptions: StreamingSlotEnhancerOptions = {}\n) => {\n\tconst { result, slots } =\n\t\tawait runWithStreamingSlotRegistry(renderResponse);\n\tconst explicit = options.streamingSlots ?? [];\n\n\treturn withStreamingSlots(result, {\n\t\t...options,\n\t\tstreamingSlots: mergeStreamingSlots(slots, explicit)\n\t});\n};\n",
|
|
53
|
-
"import { AsyncLocalStorage } from 'node:async_hooks';\nimport { logWarn } from '../utils/logger';\nimport { setStreamingSlotWarningController } from './streamingSlotRegistrar';\n\ntype WarningStore = {\n\thandlerCallsite?: string;\n\thasWarned: boolean;\n};\n\ntype WarningStorage = AsyncLocalStorage<WarningStore>;\n\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningAsyncLocalStorage'\n);\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isAsyncLocalStorage = (value: unknown): value is WarningStorage =>\n\tisObjectRecord(value) &&\n\t'getStore' in value &&\n\ttypeof value.getStore === 'function' &&\n\t'run' in value &&\n\ttypeof value.run === 'function';\n\nconst getWarningStorage = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') {\n\t\treturn undefined;\n\t}\n\n\treturn isAsyncLocalStorage(value) ? value : undefined;\n};\n\nconst ensureWarningStorage = () => {\n\tconst existing = getWarningStorage();\n\tif (existing) {\n\t\treturn existing;\n\t}\n\n\tconst storage = new AsyncLocalStorage<WarningStore>();\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, storage);\n\n\treturn storage;\n};\n\nconst normalizeCallsitePath = (value: string) =>\n\tvalue\n\t\t.replace(`${process.cwd()}/`, '')\n\t\t.replace(process.cwd(), '')\n\t\t.replace(/^\\.\\/+/, '');\n\nconst formatWarningCallsite = (callsite: string) => {\n\tconst match = callsite.match(/^(.*?)(:\\d+:\\d+)$/);\n\tif (!match) {\n\t\treturn `\\x1b[36m${callsite}\\x1b[0m`;\n\t}\n\n\treturn `\\x1b[36m${match[1]}\\x1b[33m${match[2]}\\x1b[0m`;\n};\n\nconst shouldIgnoreWarningFrame = (frame: string) =>\n\tframe.includes('/node_modules/') ||\n\tframe.includes('/dist/') ||\n\tframe.includes('/src/react/pageHandler.') ||\n\tframe.includes('/src/vue/pageHandler.') ||\n\tframe.includes('/src/svelte/pageHandler.') ||\n\tframe.includes('/src/angular/pageHandler.') ||\n\tframe.includes('/src/core/streamingSlotWarningScope.');\n\nconst getWarningLocation = (frame: string) =>\n\tframe.match(/\\((\\/[^)]+:\\d+:\\d+)\\)$/)?.[1] ??\n\tframe.match(/at (\\/[^ ]+:\\d+:\\d+)$/)?.[1];\n\nconst extractCallsiteFromStack = (stack: string) => {\n\tconst location = stack\n\t\t.split('\\n')\n\t\t.slice(1)\n\t\t.map((line) => line.trim())\n\t\t.filter((frame) => !shouldIgnoreWarningFrame(frame))\n\t\t.map((frame) => getWarningLocation(frame))\n\t\t.find((frameLocation) => frameLocation !== undefined);\n\n\treturn location ? normalizeCallsitePath(location) : undefined;\n};\n\nconst buildMissingCollectorWarning = (\n\tprimitiveName: string,\n\thandlerCallsite?: string\n) =>\n\t`${primitiveName} rendered during SSR without streaming slot collection enabled. Add { collectStreamingSlots: true } to this page handler to enable out-of-order streaming for this route.${handlerCallsite ? ` Update ${formatWarningCallsite(handlerCallsite)}.` : ''}`;\n\nsetStreamingSlotWarningController({\n\tmaybeWarn: (primitiveName: string) => {\n\t\tconst store = getWarningStorage()?.getStore();\n\t\tif (!store || store.hasWarned) {\n\t\t\treturn;\n\t\t}\n\n\t\tstore.hasWarned = true;\n\t\tlogWarn(\n\t\t\tbuildMissingCollectorWarning(primitiveName, store.handlerCallsite)\n\t\t);\n\t}\n});\n\nexport const captureStreamingSlotWarningCallsite = () => {\n\tif (process.env.NODE_ENV === 'production') {\n\t\treturn undefined;\n\t}\n\n\tconst { stack } = new Error();\n\tif (!stack) {\n\t\treturn undefined;\n\t}\n\n\treturn extractCallsiteFromStack(stack);\n};\n\nexport const runWithStreamingSlotWarningScope = <T>(\n\ttask: () => Promise<T> | T,\n\tmetadata?: {\n\t\thandlerCallsite?: string;\n\t}\n) =>\n\tensureWarningStorage().run(\n\t\t{ handlerCallsite: metadata?.handlerCallsite, hasWarned: false },\n\t\ttask\n\t);\n",
|
|
54
|
-
"import { basename } from 'node:path';\nimport type { ConventionsMap, ErrorPageProps } from '../../types/conventions';\nimport { toPascal } from './stringModifiers';\n\n// Use globalThis so the conventions map is shared across all bundles.\n// The main bundle (dist/index.js) calls setConventions, but framework\n// bundles (dist/svelte/index.js, etc.) need to read the same map.\nconst CONVENTIONS_KEY = '__absoluteConventions';\n\nconst isConventionsMap = (value: unknown): value is ConventionsMap =>\n\tBoolean(value) && typeof value === 'object';\n\nconst getMap = () => {\n\tconst value: unknown = Reflect.get(globalThis, CONVENTIONS_KEY);\n\tif (isConventionsMap(value)) return value;\n\n\tconst empty: ConventionsMap = {};\n\n\treturn empty;\n};\n\nexport const derivePageName = (pagePath: string) => {\n\tconst base = basename(pagePath);\n\t// Strip hash and extension: \"SvelteExample.abc123.js\" → \"SvelteExample\"\n\tconst dotIndex = base.indexOf('.');\n\tconst name = dotIndex > 0 ? base.slice(0, dotIndex) : base;\n\n\treturn toPascal(name);\n};\nexport const getConventions = () => getMap();\n\nconst normalizeConventionPageName = (name: string) =>\n\ttoPascal(name).replace(/\\d+$/, '');\n\nexport const hasErrorConvention = (framework: keyof ConventionsMap) => {\n\tconst conventions = getMap()[framework];\n\tif (!conventions) return false;\n\tif (conventions.defaults?.error) return true;\n\n\treturn Object.values(conventions.pages ?? {}).some((page) =>\n\t\tBoolean(page.error)\n\t);\n};\nexport const resolveErrorConventionPath = (\n\tframework: keyof ConventionsMap,\n\tpageName: string\n) => {\n\tconst conventions = getMap()[framework];\n\tif (!conventions) return undefined;\n\n\tconst exact = conventions.pages?.[pageName]?.error;\n\tif (exact) return exact;\n\n\tconst normalizedPageName = normalizeConventionPageName(pageName);\n\tfor (const [candidate, page] of Object.entries(conventions.pages ?? {})) {\n\t\tif (normalizeConventionPageName(candidate) === normalizedPageName) {\n\t\t\treturn page.error ?? conventions.defaults?.error;\n\t\t}\n\t}\n\n\treturn conventions.defaults?.error;\n};\nexport const resolveNotFoundConventionPath = (\n\tframework: keyof ConventionsMap\n) => getMap()[framework]?.defaults?.notFound;\nexport const setConventions = (map: ConventionsMap) => {\n\tReflect.set(globalThis, CONVENTIONS_KEY, map);\n};\n\nconst isDev = () => process.env.NODE_ENV === 'development';\n\nconst buildErrorProps = (error: unknown): ErrorPageProps => {\n\tif (error instanceof Error) {\n\t\treturn {\n\t\t\tname: error.name,\n\t\t\tmessage: error.message,\n\t\t\t...(isDev() && error.stack ? { stack: error.stack } : {})\n\t\t};\n\t}\n\n\treturn { message: String(error), name: 'Error' };\n};\n\nconst renderReactError = async (\n\tconventionPath: string,\n\terrorProps: ErrorPageProps\n) => {\n\tconst { createElement } = await import('react');\n\tconst { renderToReadableStream } = await import('react-dom/server');\n\tconst mod = await import(conventionPath);\n\tconst ErrorComponent = mod.default;\n\tif (typeof ErrorComponent !== 'function') return null;\n\n\tconst element = createElement(ErrorComponent, errorProps);\n\tconst stream = await renderToReadableStream(element);\n\n\treturn new Response(stream, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 500\n\t});\n};\n\nconst renderSvelteError = async (\n\tconventionPath: string,\n\terrorProps: ErrorPageProps\n) => {\n\tconst { render } = await import('svelte/server');\n\tconst mod = await import(conventionPath);\n\tconst ErrorComponent = mod.default;\n\tif (!ErrorComponent) return null;\n\n\tconst { head, body } = render(ErrorComponent, {\n\t\tprops: errorProps\n\t});\n\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 500\n\t});\n};\n\nconst unescapeVueStyles = (ssrBody: string) => {\n\tlet styles = '';\n\tconst body = ssrBody.replace(\n\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t(_, css: string) => {\n\t\t\tstyles += `<style>${css\n\t\t\t\t.replace(/"/g, '\"')\n\t\t\t\t.replace(/&/g, '&')\n\t\t\t\t.replace(/</g, '<')\n\t\t\t\t.replace(/>/g, '>')}</style>`;\n\n\t\t\treturn '';\n\t\t}\n\t);\n\n\treturn { body, styles };\n};\n\nconst renderVueError = async (\n\tconventionPath: string,\n\terrorProps: ErrorPageProps\n) => {\n\tconst { createSSRApp, h } = await import('vue');\n\tconst { renderToString } = await import('vue/server-renderer');\n\tconst mod = await import(conventionPath);\n\tconst ErrorComponent = mod.default;\n\tif (!ErrorComponent) return null;\n\n\tconst app = createSSRApp({\n\t\trender: () => h(ErrorComponent, errorProps)\n\t});\n\tconst rawBody = await renderToString(app);\n\n\t// Vue SSR escapes quotes inside <component is=\"style\"> tags.\n\t// Extract style content, unescape it, and move to <head>.\n\tconst { styles, body } = unescapeVueStyles(rawBody);\n\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 500\n\t});\n};\n\nconst renderAngularError = async (\n\tconventionPath: string,\n\terrorProps: ErrorPageProps\n) => {\n\t// Angular convention error pages use the simple function-style renderer.\n\t// Class-style components (templateUrl/styleUrl trio) routed through the\n\t// full Angular SSR pipeline are tracked separately — see CLAUDE.md.\n\tconst mod = await import(conventionPath);\n\tconst renderFn = mod.default;\n\tif (typeof renderFn !== 'function') return null;\n\n\tconst html = renderFn(errorProps);\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 500\n\t});\n};\n\nconst escapeHtml = (value: string) =>\n\tvalue\n\t\t.replace(/&/g, '&')\n\t\t.replace(/</g, '<')\n\t\t.replace(/>/g, '>')\n\t\t.replace(/\"/g, '"')\n\t\t.replace(/'/g, ''');\n\nconst replaceErrorTokens = (template: string, errorProps: ErrorPageProps) =>\n\ttemplate\n\t\t.replace(/\\{\\{\\s*name\\s*\\}\\}/g, escapeHtml(errorProps.name))\n\t\t.replace(/\\{\\{\\s*message\\s*\\}\\}/g, escapeHtml(errorProps.message))\n\t\t.replace(\n\t\t\t/\\{\\{\\s*stack\\s*\\}\\}/g,\n\t\t\terrorProps.stack ? escapeHtml(errorProps.stack) : ''\n\t\t);\n\nconst renderHtmlError = async (\n\tconventionPath: string,\n\terrorProps: ErrorPageProps\n) => {\n\tconst template = await Bun.file(conventionPath).text();\n\tconst html = replaceErrorTokens(template, errorProps);\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 500\n\t});\n};\n\nconst logConventionRenderError = (\n\tframework: keyof ConventionsMap,\n\tlabel: string,\n\trenderError: unknown\n) => {\n\tconst message = renderError instanceof Error ? renderError.message : '';\n\tif (\n\t\tmessage.includes('Cannot find module') ||\n\t\tmessage.includes('Cannot find package') ||\n\t\tmessage.includes('not found in module')\n\t) {\n\t\tconsole.error(\n\t\t\t`[SSR] Convention ${label} page for ${framework} failed: missing framework package. ` +\n\t\t\t\t`Ensure the ${framework} runtime is installed (e.g. bun add ${framework === 'react' ? 'react react-dom' : framework}).`\n\t\t);\n\n\t\treturn;\n\t}\n\n\tconsole.error(\n\t\t`[SSR] Failed to render ${framework} convention ${label} page:`,\n\t\trenderError\n\t);\n};\n\n// Phase 1 Ember adapter: convention pages aren't wired yet (no\n// renderEmberError analog ships in v1). Returning null falls through to\n// the generic ssrErrorPage. Phase 1.5 replaces this stub with a real\n// renderer once the convention scanner knows about .gjs/.gts files.\nconst renderEmberError = async () => null;\nconst renderEmberNotFound = async () => null;\n\nconst ERROR_RENDERERS: Record<\n\tkeyof ConventionsMap,\n\t(\n\t\tconventionPath: string,\n\t\terrorProps: ErrorPageProps\n\t) => Promise<Response | null>\n> = {\n\tangular: renderAngularError,\n\tember: renderEmberError,\n\thtml: renderHtmlError,\n\treact: renderReactError,\n\tsvelte: renderSvelteError,\n\tvue: renderVueError\n};\n\nconst tryFrameworkErrorConvention = async (\n\tframework: keyof ConventionsMap,\n\tpageName: string,\n\terrorProps: ErrorPageProps,\n\terror: unknown\n) => {\n\tlet conventionPath = resolveErrorConventionPath(framework, pageName);\n\tif (!conventionPath && error instanceof Error && error.stack) {\n\t\tfor (const match of error.stack.matchAll(\n\t\t\t/^\\s*at\\s+([A-Za-z_$][\\w$]*)/gm\n\t\t)) {\n\t\t\tconst candidate = match[1];\n\t\t\tif (!candidate) continue;\n\n\t\t\tconventionPath = resolveErrorConventionPath(framework, candidate);\n\t\t\tif (conventionPath) break;\n\t\t}\n\t}\n\tif (!conventionPath) return null;\n\n\tconst renderer = ERROR_RENDERERS[framework];\n\tif (!renderer) return null;\n\n\ttry {\n\t\treturn await renderer(conventionPath, errorProps);\n\t} catch (renderError) {\n\t\tlogConventionRenderError(framework, 'error', renderError);\n\t}\n\n\treturn null;\n};\n\nexport const renderConventionError = async (\n\tframework: keyof ConventionsMap,\n\tpageName: string,\n\terror: unknown\n) => {\n\tconst errorProps = buildErrorProps(error);\n\n\tconst frameworkResponse = await tryFrameworkErrorConvention(\n\t\tframework,\n\t\tpageName,\n\t\terrorProps,\n\t\terror\n\t);\n\tif (frameworkResponse) return frameworkResponse;\n\n\t// Universal fallback: any project can ship a plain `error.html` in\n\t// the html pages dir as the last-resort branded error page before\n\t// the inline ssrErrorPage() takes over.\n\tif (framework !== 'html') {\n\t\tconst htmlResponse = await tryFrameworkErrorConvention(\n\t\t\t'html',\n\t\t\tpageName,\n\t\t\terrorProps,\n\t\t\terror\n\t\t);\n\t\tif (htmlResponse) return htmlResponse;\n\t}\n\n\treturn null;\n};\n\nconst renderReactNotFound = async (conventionPath: string) => {\n\tconst { createElement } = await import('react');\n\tconst { renderToReadableStream } = await import('react-dom/server');\n\tconst mod = await import(conventionPath);\n\tconst NotFoundComponent = mod.default;\n\tif (typeof NotFoundComponent !== 'function') return null;\n\n\tconst element = createElement(NotFoundComponent);\n\tconst stream = await renderToReadableStream(element);\n\n\treturn new Response(stream, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 404\n\t});\n};\n\nconst renderSvelteNotFound = async (conventionPath: string) => {\n\tconst { render } = await import('svelte/server');\n\tconst mod = await import(conventionPath);\n\tconst NotFoundComponent = mod.default;\n\tif (!NotFoundComponent) return null;\n\n\tconst { head, body } = render(NotFoundComponent);\n\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 404\n\t});\n};\n\nconst renderVueNotFound = async (conventionPath: string) => {\n\tconst { createSSRApp, h } = await import('vue');\n\tconst { renderToString } = await import('vue/server-renderer');\n\tconst mod = await import(conventionPath);\n\tconst NotFoundComponent = mod.default;\n\tif (!NotFoundComponent) return null;\n\n\tconst app = createSSRApp({\n\t\trender: () => h(NotFoundComponent)\n\t});\n\tconst rawBody = await renderToString(app);\n\n\tconst { styles, body } = unescapeVueStyles(rawBody);\n\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 404\n\t});\n};\n\nconst renderAngularNotFound = async (conventionPath: string) => {\n\tconst mod = await import(conventionPath);\n\tconst renderFn = mod.default;\n\tif (typeof renderFn !== 'function') return null;\n\n\tconst html = renderFn();\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 404\n\t});\n};\n\nconst renderHtmlNotFound = async (conventionPath: string) => {\n\tconst html = await Bun.file(conventionPath).text();\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' },\n\t\tstatus: 404\n\t});\n};\n\nconst NOT_FOUND_RENDERERS: Record<\n\tkeyof ConventionsMap,\n\t(conventionPath: string) => Promise<Response | null>\n> = {\n\tangular: renderAngularNotFound,\n\tember: renderEmberNotFound,\n\thtml: renderHtmlNotFound,\n\treact: renderReactNotFound,\n\tsvelte: renderSvelteNotFound,\n\tvue: renderVueNotFound\n};\n\nexport const renderConventionNotFound = async (\n\tframework: keyof ConventionsMap\n) => {\n\tconst conventionPath = resolveNotFoundConventionPath(framework);\n\tif (!conventionPath) return null;\n\n\tconst renderer = NOT_FOUND_RENDERERS[framework];\n\tif (!renderer) return null;\n\n\ttry {\n\t\treturn await renderer(conventionPath);\n\t} catch (renderError) {\n\t\tlogConventionRenderError(framework, 'not-found', renderError);\n\t}\n\n\treturn null;\n};\n\nconst NOT_FOUND_PRIORITY: (keyof ConventionsMap)[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular',\n\t'html'\n];\n\nexport const renderFirstNotFound = async () => {\n\tconst renderNext = async (frameworks: (keyof ConventionsMap)[]) => {\n\t\tconst [framework, ...remaining] = frameworks;\n\t\tif (!framework) {\n\t\t\treturn null;\n\t\t}\n\t\tif (!getMap()[framework]?.defaults?.notFound) {\n\t\t\treturn renderNext(remaining);\n\t\t}\n\n\t\tconst response = await renderConventionNotFound(framework);\n\t\tif (response) {\n\t\t\treturn response;\n\t\t}\n\n\t\treturn renderNext(remaining);\n\t};\n\n\treturn renderNext(NOT_FOUND_PRIORITY);\n};\n",
|
|
55
|
-
"/**\n * vue-router redirect bridge for SSR.\n *\n * vue-router doesn't expose Angular-style providers, but it doesn't need\n * them — after `await router.push(url); await router.isReady()`, the\n * router's `currentRoute.value.fullPath` reflects the final destination\n * after every guard, redirect rule, and `next('/foo')` call has run.\n *\n * If that final path differs from the URL the server received, a redirect\n * happened. The Vue page handler exposes a `setRedirect` callback in the\n * `setupApp` context so the user's setup hook can short-circuit the\n * render and emit a 302 instead of producing HTML for a route the user\n * never asked for.\n *\n * Usage:\n *\n * import { applyVueRouterRedirect } from '@absolutejs/absolute/vue';\n *\n * export const setupApp = async (app, { url, isServer, setRedirect }) => {\n * const router = createRouter({ ... });\n * app.use(router);\n * if (isServer) await router.push(url);\n * await router.isReady();\n * if (isServer) applyVueRouterRedirect(router, url, setRedirect);\n * };\n */\n\n// Structural shape of the only fields we read from a vue-router instance.\n// Avoids depending on `vue-router` types — the user installs vue-router\n// themselves; the absolutejs package shouldn't pull it into every consumer's\n// type-check just for one helper.\ntype VueRouterLike = {\n\tcurrentRoute: { value: { fullPath: string } };\n};\n\nconst DEFAULT_REDIRECT_STATUS = 302;\n\nconst normalisePathname = (raw: string) => {\n\ttry {\n\t\tconst parsed = new URL(raw, 'http://placeholder.local/');\n\n\t\treturn `${parsed.pathname}${parsed.search}`;\n\t} catch {\n\t\treturn raw;\n\t}\n};\n\n/**\n * Compare the requested URL against vue-router's current resolved path\n * after `router.push(url); await router.isReady()`. If different — a\n * guard redirected, a redirect rule fired, or the user manually\n * navigated inside `setupApp` — invoke `setRedirect` so the Vue page\n * handler emits an HTTP redirect instead of rendering.\n *\n * Status defaults to `302`. Pass a different status (e.g. `301` or `308`)\n * for permanent redirects.\n */\nexport const applyVueRouterRedirect = (\n\trouter: VueRouterLike,\n\trequestedUrl: string,\n\tsetRedirect: (location: string, status?: number) => void,\n\tstatus: number = DEFAULT_REDIRECT_STATUS\n) => {\n\tconst finalPath = router.currentRoute.value.fullPath;\n\tconst requestedPath = normalisePathname(requestedUrl);\n\tif (finalPath === requestedPath) return;\n\tsetRedirect(finalPath, status);\n};\n",
|
|
56
|
-
"import type { VueRoutes, VueSetupApp } from '../../types/vue';\n\n/** Identity helper that types a Vue page's `setupApp` export without\n * forcing the user to `import type { VueSetupApp }` every time. Use as\n * `export const setupApp = defineVueSetupApp(async (app, ctx) => { ... });` */\nexport const defineRoutes = <T extends VueRoutes>(routes: T) => routes;\nexport const defineVueSetupApp = (hook: VueSetupApp) => hook;\n",
|
|
57
|
-
"import { defineComponent, h, onServerPrefetch } from 'vue';\nimport type { RuntimeIslandRenderProps } from '../../types/island';\nimport { preserveIslandMarkup } from '../client/preserveIslandMarkup';\nimport { requireCurrentIslandRegistry } from '../core/currentIslandRegistry';\nimport { getIslandMarkerAttributes } from '../core/islandMarkupAttributes';\nimport { normalizeRuntimeIslandRenderProps } from '../core/normalizeIslandProps';\nimport { renderIslandResult } from '../core/renderIslandMarkup';\n\nconst defineRuntimeIslandComponent = (\n\tsetup: (props: RuntimeIslandRenderProps) => () => ReturnType<typeof h>\n) =>\n\tdefineComponent({\n\t\tname: 'AbsoluteIsland',\n\t\tprops: {\n\t\t\tcomponent: {\n\t\t\t\trequired: true,\n\t\t\t\ttype: String\n\t\t\t},\n\t\t\tframework: {\n\t\t\t\trequired: true,\n\t\t\t\ttype: String\n\t\t\t},\n\t\t\thydrate: {\n\t\t\t\trequired: false,\n\t\t\t\ttype: String\n\t\t\t},\n\t\t\t/* Accept either an object (the Vue-idiomatic\n\t\t\t `:props=\"{ ... }\"` form) or a JSON-serialized string\n\t\t\t (mirrors the HTML `<absolute-island>` surface, so the\n\t\t\t same template fragment is portable across hosts).\n\t\t\t `normalizeRuntimeIslandRenderProps` validates the\n\t\t\t shape at runtime. */\n\t\t\tprops: {\n\t\t\t\trequired: false,\n\t\t\t\ttype: [Object, String]\n\t\t\t}\n\t\t},\n\t\tsetup: (rawProps) => setup(normalizeRuntimeIslandRenderProps(rawProps))\n\t});\n\nexport const Island = defineRuntimeIslandComponent((props) => {\n\tconst isBrowser = typeof window !== 'undefined';\n\tlet markerAttributes = getIslandMarkerAttributes(props);\n\tlet html = '';\n\n\tonServerPrefetch(async () => {\n\t\tconst result = await renderIslandResult(\n\t\t\trequireCurrentIslandRegistry(),\n\t\t\tprops\n\t\t);\n\t\t({ attributes: markerAttributes, html } = result);\n\t});\n\n\treturn () => {\n\t\tconst preserved = isBrowser ? preserveIslandMarkup(props) : null;\n\n\t\treturn h('div', {\n\t\t\t...(preserved?.attributes ?? markerAttributes),\n\t\t\t'data-allow-mismatch': '',\n\t\t\tinnerHTML: isBrowser ? preserved?.innerHTML : html\n\t\t});\n\t};\n});\n",
|
|
58
|
-
"import type { RuntimeIslandRenderProps } from '../../types/island';\nimport { getIslandMarkerAttributes } from '../core/islandMarkupAttributes';\n\ntype PreservedIslandMarkup = {\n\tattributes: Record<string, string>;\n\tinnerHTML: string;\n};\n\ntype IslandMarkerElement = HTMLElement & {\n\tdataset: DOMStringMap & {\n\t\tcomponent?: string;\n\t\tframework?: string;\n\t\thydrate?: string;\n\t\tisland?: string;\n\t\tislandId?: string;\n\t\tprops?: string;\n\t};\n};\n\nconst getSnapshotMap = () => {\n\tif (typeof window === 'undefined') {\n\t\treturn null;\n\t}\n\n\twindow.__ABS_SERVER_ISLAND_HTML__ ??= new Map<\n\t\tstring,\n\t\tPreservedIslandMarkup[]\n\t>();\n\n\treturn window.__ABS_SERVER_ISLAND_HTML__;\n};\n\nconst getIslandSignature = (props: RuntimeIslandRenderProps) => {\n\tconst attributes = getIslandMarkerAttributes(props);\n\n\treturn [\n\t\tattributes['data-component'],\n\t\tattributes['data-framework'],\n\t\tattributes['data-hydrate'],\n\t\tattributes['data-props']\n\t].join('::');\n};\n\nconst isMatchingIslandElement = (\n\telement: Element,\n\tprops: RuntimeIslandRenderProps\n): element is IslandMarkerElement => {\n\tif (!(element instanceof HTMLElement)) {\n\t\treturn false;\n\t}\n\n\tconst attributes = getIslandMarkerAttributes(props);\n\n\treturn (\n\t\telement.dataset.island === 'true' &&\n\t\telement.dataset.component === attributes['data-component'] &&\n\t\telement.dataset.framework === attributes['data-framework'] &&\n\t\t(element.dataset.hydrate ?? 'load') === attributes['data-hydrate'] &&\n\t\t(element.dataset.props ?? '{}') === attributes['data-props']\n\t);\n};\n\nconst snapshotIslandElement = (\n\telement: HTMLElement,\n\tsnapshotMap: Map<string, PreservedIslandMarkup[]>\n) => {\n\tconst signature = [\n\t\telement.dataset.component,\n\t\telement.dataset.framework,\n\t\telement.dataset.hydrate ?? 'load',\n\t\telement.dataset.props ?? '{}'\n\t].join('::');\n\tconst existing = snapshotMap.get(signature) ?? [];\n\tconst attributes = Object.fromEntries(\n\t\telement\n\t\t\t.getAttributeNames()\n\t\t\t.map((name) => [name, element.getAttribute(name) ?? ''])\n\t);\n\texisting.push({\n\t\tattributes,\n\t\tinnerHTML: element.innerHTML\n\t});\n\tsnapshotMap.set(signature, existing);\n};\n\nexport const initializeIslandMarkupSnapshot = () => {\n\tif (typeof document === 'undefined') {\n\t\treturn;\n\t}\n\n\tconst snapshotMap = getSnapshotMap();\n\tif (!snapshotMap || snapshotMap.size > 0) {\n\t\treturn;\n\t}\n\n\tconst elements = Array.from(\n\t\tdocument.querySelectorAll<HTMLElement>('[data-island=\"true\"]')\n\t);\n\tfor (const element of elements) {\n\t\tsnapshotIslandElement(element, snapshotMap);\n\t}\n};\n\nexport const preserveIslandMarkup = (props: RuntimeIslandRenderProps) => {\n\tif (typeof document === 'undefined') {\n\t\treturn {\n\t\t\tattributes: getIslandMarkerAttributes(props),\n\t\t\tinnerHTML: ''\n\t\t};\n\t}\n\n\tconst snapshotMap = getSnapshotMap();\n\tconst signature = getIslandSignature(props);\n\t// Islands that share a signature (same component, framework, hydrate mode\n\t// and serialized props) produce byte-identical SSR markup, so the first\n\t// captured snapshot is correct for every instance. Returning it\n\t// unconditionally keeps this stateless: React may call the component many\n\t// times during a single hydration (StrictMode double-render, hydration\n\t// retries, mismatch regeneration), and a per-call claim counter would run\n\t// past the snapshot list and yield empty markup — making the host render\n\t// `dangerouslySetInnerHTML={{ __html: '' }}` and wipe the island's\n\t// server-rendered DOM before the island runtime can hydrate it.\n\tconst snapshotCandidate = snapshotMap?.get(signature)?.[0];\n\tif (snapshotCandidate) {\n\t\treturn snapshotCandidate;\n\t}\n\n\t// Snapshot not captured yet (the island runtime module hasn't evaluated):\n\t// fall back to reading the live SSR DOM directly.\n\tconst liveCandidate = Array.from(\n\t\tdocument.querySelectorAll('[data-island=\"true\"]')\n\t).find((element) => isMatchingIslandElement(element, props));\n\tif (!liveCandidate) {\n\t\treturn {\n\t\t\tattributes: getIslandMarkerAttributes(props),\n\t\t\tinnerHTML: ''\n\t\t};\n\t}\n\n\treturn {\n\t\tattributes: Object.fromEntries(\n\t\t\tliveCandidate\n\t\t\t\t.getAttributeNames()\n\t\t\t\t.map((name) => [name, liveCandidate.getAttribute(name) ?? ''])\n\t\t),\n\t\tinnerHTML: liveCandidate.innerHTML\n\t};\n};\n",
|
|
59
|
-
"import type { IslandFramework, IslandHydrate } from '../../types/island';\n\n/* `<Island>` (Vue/Svelte/React/Angular component form) historically took\n `props` as an object, while `<absolute-island>` (custom-element form\n used in HTML/HTMX hosts) takes `props` as a JSON-serialized string.\n The two surfaces have the same mental model — \"render an island\" —\n but a value that's valid in one shape would silently break in the\n other. This helper normalizes whichever shape arrives at runtime. */\nconst EMPTY_PROPS: Record<string, unknown> = {};\n\nconst ISLAND_FRAMEWORKS: readonly IslandFramework[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular',\n\t'ember'\n];\n\nconst ISLAND_HYDRATE_MODES: readonly IslandHydrate[] = [\n\t'load',\n\t'idle',\n\t'visible',\n\t'none'\n];\n\nconst isIslandFramework = (value: string): value is IslandFramework =>\n\tISLAND_FRAMEWORKS.some((framework) => framework === value);\n\nconst isIslandHydrate = (value: string): value is IslandHydrate =>\n\tISLAND_HYDRATE_MODES.some((mode) => mode === value);\n\ntype RawIslandProps = {\n\tcomponent: string;\n\tframework: string;\n\thydrate?: string | undefined;\n\tprops: unknown;\n};\n\nexport const normalizeRuntimeIslandRenderProps = (raw: RawIslandProps) => {\n\tconst { component, framework, hydrate, props } = raw;\n\tif (!isIslandFramework(framework)) {\n\t\tthrow new Error(`Unknown island framework: \"${framework}\".`);\n\t}\n\n\tif (hydrate !== undefined && !isIslandHydrate(hydrate)) {\n\t\tthrow new Error(`Unknown island hydrate mode: \"${hydrate}\".`);\n\t}\n\n\treturn {\n\t\tcomponent,\n\t\tframework,\n\t\thydrate,\n\t\tprops: normalizeIslandProps(props)\n\t};\n};\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst safeJsonParseObject = (raw: string) => {\n\tconst trimmed = raw.trim();\n\tif (!trimmed) return EMPTY_PROPS;\n\n\ttry {\n\t\tconst parsed: unknown = JSON.parse(trimmed);\n\n\t\treturn isPlainObject(parsed) ? parsed : EMPTY_PROPS;\n\t} catch {\n\t\treturn EMPTY_PROPS;\n\t}\n};\n\nexport const normalizeIslandProps = (value: unknown) => {\n\tif (typeof value === 'string') return safeJsonParseObject(value);\n\tif (isPlainObject(value)) return value;\n\n\treturn EMPTY_PROPS;\n};\n",
|
|
60
|
-
"import { defineComponent, h, onServerPrefetch } from 'vue';\nimport type {\n\tIslandRegistry,\n\tIslandRegistryInput,\n\tRuntimeIslandRenderProps\n} from '../../types/island';\nimport { getIslandMarkerAttributes } from '../core/islandMarkupAttributes';\nimport { renderIslandResult } from '../core/renderIslandMarkup';\n\nconst defineRuntimeIslandComponent = (\n\tsetup: (props: RuntimeIslandRenderProps) => () => ReturnType<typeof h>\n) =>\n\tdefineComponent({\n\t\tname: 'AbsoluteIsland',\n\t\tprops: {\n\t\t\tcomponent: {\n\t\t\t\trequired: true,\n\t\t\t\ttype: String\n\t\t\t},\n\t\t\tframework: {\n\t\t\t\trequired: true,\n\t\t\t\ttype: String\n\t\t\t},\n\t\t\thydrate: {\n\t\t\t\trequired: false,\n\t\t\t\ttype: String\n\t\t\t},\n\t\t\tprops: {\n\t\t\t\trequired: true,\n\t\t\t\ttype: Object\n\t\t\t}\n\t\t},\n\t\tsetup\n\t});\n\nexport const createTypedIsland = <T extends IslandRegistryInput>(\n\tregistry: IslandRegistry<T>\n) =>\n\tdefineRuntimeIslandComponent((props) => {\n\t\tconst isBrowser = typeof window !== 'undefined';\n\t\tlet markerAttributes = getIslandMarkerAttributes(props);\n\t\tlet html = '';\n\n\t\tonServerPrefetch(async () => {\n\t\t\tconst result = await renderIslandResult(registry, props);\n\t\t\t({ attributes: markerAttributes, html } = result);\n\t\t});\n\n\t\treturn () =>\n\t\t\th('div', {\n\t\t\t\t...markerAttributes,\n\t\t\t\t'data-allow-mismatch': '',\n\t\t\t\tinnerHTML: isBrowser ? undefined : html\n\t\t\t});\n\t});\n",
|
|
61
|
-
"import { customRef, onBeforeUnmount } from 'vue';\nimport type { StoreApi } from 'zustand/vanilla';\nimport {\n\treadIslandStore,\n\tsubscribeIslandStore,\n\ttype IslandStoreState\n} from '../client/islandStore';\n\nexport const useIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => {\n\tlet current = readIslandStore(store, selector);\n\tlet unsubscribe: (() => void) | undefined;\n\n\tconst state = customRef<TSelected>((track, trigger) => {\n\t\tunsubscribe = subscribeIslandStore(store, selector, (value) => {\n\t\t\tcurrent = value;\n\t\t\ttrigger();\n\t\t});\n\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\n\t\t\t\treturn current;\n\t\t\t},\n\t\t\tset() {}\n\t\t};\n\t});\n\n\tonBeforeUnmount(() => {\n\t\tunsubscribe?.();\n\t});\n\n\treturn state;\n};\n",
|
|
62
|
-
"const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);\n\nexport { createStore };\n",
|
|
63
|
-
"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",
|
|
64
|
-
"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\t| Map<string, Set<IslandStoreInstance>>\n\t\t| 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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