@absolutejs/absolute 0.19.0-beta.1043 → 0.19.0-beta.1044
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/browser.js +10358 -0
- package/dist/angular/browser.js.map +260 -0
- package/dist/angular/components/constants.js +101 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +58 -0
- package/dist/angular/components/core/streamingSlotRegistry.js +114 -0
- package/dist/angular/components/defer-slot-payload.js +6 -0
- package/dist/angular/components/defer-slot-templates.directive.js +44 -0
- package/dist/angular/components/defer-slot.component.js +152 -0
- package/dist/angular/components/image.component.js +202 -0
- package/dist/angular/components/index.js +4 -0
- package/dist/angular/components/stream-slot.component.js +102 -0
- package/dist/angular/hmrPreserveCore.ts +188 -0
- package/dist/angular/index.js +15793 -0
- package/dist/angular/index.js.map +299 -0
- package/dist/angular/server.js +6357 -0
- package/dist/angular/server.js.map +61 -0
- package/dist/build.js +27484 -0
- package/dist/build.js.map +146 -0
- package/dist/cli/config/client.js +527 -0
- package/dist/cli/config/server.js +37130 -0
- package/dist/cli/htmx/htmx.min.js +1 -0
- package/dist/cli/index.js +180130 -0
- package/dist/client/index.js +1267 -0
- package/dist/client/index.js.map +31 -0
- package/dist/core/streamingSlotRegistrar.js +138 -0
- package/dist/core/streamingSlotRegistrar.js.map +10 -0
- package/dist/core/streamingSlotRegistry.js +194 -0
- package/dist/core/streamingSlotRegistry.js.map +11 -0
- package/dist/dev/client/constants.ts +26 -0
- package/dist/dev/client/cssUtils.ts +311 -0
- package/dist/dev/client/domDiff.ts +226 -0
- package/dist/dev/client/domState.ts +423 -0
- package/dist/dev/client/domTracker.ts +61 -0
- package/dist/dev/client/errorOverlay.ts +445 -0
- package/dist/dev/client/frameworkDetect.ts +63 -0
- package/dist/dev/client/handlers/angularHmrShim.ts +88 -0
- package/dist/dev/client/handlers/angularRemount.ts +362 -0
- package/dist/dev/client/handlers/angularRemountWiring.ts +52 -0
- package/dist/dev/client/handlers/html.ts +364 -0
- package/dist/dev/client/handlers/htmx.ts +278 -0
- package/dist/dev/client/handlers/react.ts +108 -0
- package/dist/dev/client/handlers/rebuild.ts +153 -0
- package/dist/dev/client/handlers/svelte.ts +334 -0
- package/dist/dev/client/handlers/vue.ts +292 -0
- package/dist/dev/client/headPatch.ts +233 -0
- package/dist/dev/client/hmrClient.ts +352 -0
- package/dist/dev/client/hmrState.ts +14 -0
- package/dist/dev/client/hmrToast.ts +150 -0
- package/dist/dev/client/moduleVersions.ts +62 -0
- package/dist/dev/client/reactRefreshSetup.ts +31 -0
- package/dist/dev/client/vendor/lview/lViewOps.ts +196 -0
- package/dist/dev/client/vendor/lview/slotConstants.ts +44 -0
- package/dist/dev/client/vendor/reactRefreshRuntime.d.ts +12 -0
- package/dist/dev/client/vendor/reactRefreshRuntime.js +313 -0
- package/dist/image-client/imageClient.js +69 -0
- package/dist/index.js +36383 -0
- package/dist/index.js.map +320 -0
- package/dist/islands/browser.js +259 -0
- package/dist/islands/browser.js.map +15 -0
- package/dist/islands/index.js +2415 -0
- package/dist/islands/index.js.map +37 -0
- package/dist/react/browser.js +374 -0
- package/dist/react/browser.js.map +19 -0
- package/dist/react/components/browser/index.js +467 -0
- package/dist/react/components/index.js +684 -0
- package/dist/react/components/index.js.map +18 -0
- package/dist/react/hooks/index.js +285 -0
- package/dist/react/hooks/index.js.map +14 -0
- package/dist/react/index.js +4258 -0
- package/dist/react/index.js.map +56 -0
- package/dist/react/jsxDevRuntimeCompat.js +90 -0
- package/dist/react/jsxDevRuntimeCompat.js.map +10 -0
- package/dist/react/router/browser.js +95 -0
- package/dist/react/router/browser.js.map +10 -0
- package/dist/react/router/index.js +95 -0
- package/dist/react/router/index.js.map +10 -0
- package/dist/react/server.js +1895 -0
- package/dist/react/server.js.map +26 -0
- package/dist/src/angular/Island.browser.d.ts +34 -0
- package/dist/src/angular/Island.d.ts +29 -0
- package/dist/src/angular/angularDeps.d.ts +2 -0
- package/dist/src/angular/angularPatch.d.ts +1 -0
- package/dist/src/angular/animationProviders.d.ts +2 -0
- package/dist/src/angular/browser.d.ts +14 -0
- package/dist/src/angular/components/constants.d.ts +96 -0
- package/dist/src/angular/components/defer-slot-payload.d.ts +7 -0
- package/dist/src/angular/components/defer-slot-templates.directive.d.ts +21 -0
- package/dist/src/angular/components/defer-slot.component.d.ts +29 -0
- package/dist/src/angular/components/image.component.d.ts +42 -0
- package/dist/src/angular/components/index.d.ts +4 -0
- package/dist/src/angular/components/stream-slot.component.d.ts +20 -0
- package/dist/src/angular/composables/index.d.ts +6 -0
- package/dist/src/angular/composables/usePageContext.d.ts +16 -0
- package/dist/src/angular/composables/useResource.d.ts +57 -0
- package/dist/src/angular/composables/useSubscription.d.ts +33 -0
- package/dist/src/angular/composables/useTimers.d.ts +18 -0
- package/dist/src/angular/createIsland.browser.d.ts +2 -0
- package/dist/src/angular/createIsland.d.ts +2 -0
- package/dist/src/angular/deterministicEnv.d.ts +26 -0
- package/dist/src/angular/hmrPreserveCore.d.ts +21 -0
- package/dist/src/angular/httpTransferCache.d.ts +12 -0
- package/dist/src/angular/index.d.ts +14 -0
- package/dist/src/angular/injectorPatch.d.ts +1 -0
- package/dist/src/angular/islandStore.d.ts +9 -0
- package/dist/src/angular/islands.d.ts +4 -0
- package/dist/src/angular/lowerDeferSyntax.d.ts +18 -0
- package/dist/src/angular/lowerServerIslands.d.ts +1 -0
- package/dist/src/angular/pageHandler.d.ts +48 -0
- package/dist/src/angular/pendingTask.d.ts +1 -0
- package/dist/src/angular/preserveAcrossHmr.d.ts +12 -0
- package/dist/src/angular/renderIsland.d.ts +2 -0
- package/dist/src/angular/requestProviders.d.ts +5 -0
- package/dist/src/angular/resolveAngularPackage.d.ts +19 -0
- package/dist/src/angular/routerRedirectProviders.d.ts +6 -0
- package/dist/src/angular/server.d.ts +4 -0
- package/dist/src/angular/ssrRender.d.ts +13 -0
- package/dist/src/angular/ssrSanitizer.d.ts +3 -0
- package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/build/angularLinkerPlugin.d.ts +29 -0
- package/dist/src/build/buildAngularVendor.d.ts +40 -0
- package/dist/src/build/buildDepVendor.d.ts +2 -0
- package/dist/src/build/buildEmberVendor.d.ts +24 -0
- package/dist/src/build/buildReactVendor.d.ts +8 -0
- package/dist/src/build/buildSvelteVendor.d.ts +6 -0
- package/dist/src/build/buildVueVendor.d.ts +6 -0
- package/dist/src/build/chainInlineSourcemaps.d.ts +13 -0
- package/dist/src/build/compileAngular.d.ts +40 -0
- package/dist/src/build/compileEmber.d.ts +43 -0
- package/dist/src/build/compileSvelte.d.ts +14 -0
- package/dist/src/build/compileTailwind.d.ts +5 -0
- package/dist/src/build/compileVue.d.ts +22 -0
- package/dist/src/build/externalAssetPlugin.d.ts +2 -0
- package/dist/src/build/generateManifest.d.ts +2 -0
- package/dist/src/build/generateReactIndexes.d.ts +2 -0
- package/dist/src/build/htmlScriptHMRPlugin.d.ts +13 -0
- package/dist/src/build/index.d.ts +2 -0
- package/dist/src/build/islandEntries.d.ts +32 -0
- package/dist/src/build/islandRegistryTransform.d.ts +17 -0
- package/dist/src/build/nativeRewrite.d.ts +5 -0
- package/dist/src/build/optimizeHtmlImages.d.ts +2 -0
- package/dist/src/build/outputLogs.d.ts +1 -0
- package/dist/src/build/parseAngularConfigImports.d.ts +9 -0
- package/dist/src/build/parseVueSpaRoutes.d.ts +20 -0
- package/dist/src/build/resolvePackageImport.d.ts +9 -0
- package/dist/src/build/rewriteImports.d.ts +8 -0
- package/dist/src/build/rewriteImportsPlugin.d.ts +48 -0
- package/dist/src/build/rewriteReactImports.d.ts +7 -0
- package/dist/src/build/runAngularHandlerScan.d.ts +7 -0
- package/dist/src/build/scanAngularHandlerCalls.d.ts +13 -0
- package/dist/src/build/scanAngularPageRoutes.d.ts +10 -0
- package/dist/src/build/scanConventions.d.ts +5 -0
- package/dist/src/build/scanCssEntryPoints.d.ts +1 -0
- package/dist/src/build/scanEntryPoints.d.ts +1 -0
- package/dist/src/build/scanRouteRegistrations.d.ts +23 -0
- package/dist/src/build/scanVueSsrOnlyPages.d.ts +6 -0
- package/dist/src/build/staticIslandPages.d.ts +9 -0
- package/dist/src/build/stylePreprocessor.d.ts +26 -0
- package/dist/src/build/tailwindCompiler.d.ts +8 -0
- package/dist/src/build/updateAssetPaths.d.ts +1 -0
- package/dist/src/build/vendorEntrySource.d.ts +1 -0
- package/dist/src/build/verifyAngularCoreUniqueness.d.ts +2 -0
- package/dist/src/build/vueAutoRouterTransform.d.ts +1 -0
- package/dist/src/build/wrapHTMLScript.d.ts +17 -0
- package/dist/src/build.d.ts +2 -0
- package/dist/src/cli/add/dependencies.d.ts +12 -0
- package/dist/src/cli/cache.d.ts +15 -0
- package/dist/src/cli/config/absolute/AbsoluteConfigPanel.d.ts +6 -0
- package/dist/src/cli/config/absolute/editAbsoluteConfig.d.ts +5 -0
- package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +14 -0
- package/dist/src/cli/config/client.d.ts +1 -0
- package/dist/src/cli/config/configCert.d.ts +12 -0
- package/dist/src/cli/config/eslint/EslintPanel.d.ts +6 -0
- package/dist/src/cli/config/eslint/configAst.d.ts +18 -0
- package/dist/src/cli/config/eslint/editConfigRule.d.ts +6 -0
- package/dist/src/cli/config/eslint/eslintStyles.d.ts +1 -0
- package/dist/src/cli/config/eslint/resolveConfig.d.ts +3 -0
- package/dist/src/cli/config/eslint/serializeValue.d.ts +9 -0
- package/dist/src/cli/config/guards.d.ts +4 -0
- package/dist/src/cli/config/packageJson/PackageJsonPanel.d.ts +6 -0
- package/dist/src/cli/config/packageJson/editPackageJson.d.ts +9 -0
- package/dist/src/cli/config/packageJson/resolvePackageJson.d.ts +9 -0
- package/dist/src/cli/config/page/ConfigShell.d.ts +6 -0
- package/dist/src/cli/config/page/FieldEditor.d.ts +9 -0
- package/dist/src/cli/config/page/PanelHost.d.ts +6 -0
- package/dist/src/cli/config/page/configStyles.d.ts +1 -0
- package/dist/src/cli/config/panels.d.ts +7 -0
- package/dist/src/cli/config/prettier/PrettierPanel.d.ts +6 -0
- package/dist/src/cli/config/prettier/editPrettier.d.ts +5 -0
- package/dist/src/cli/config/prettier/resolvePrettier.d.ts +11 -0
- package/dist/src/cli/config/schema/fromJsonSchema.d.ts +3 -0
- package/dist/src/cli/config/schema/fromType.d.ts +2 -0
- package/dist/src/cli/config/schema/serialize.d.ts +1 -0
- package/dist/src/cli/config/server.d.ts +298 -0
- package/dist/src/cli/config/tsconfig/TsconfigPanel.d.ts +6 -0
- package/dist/src/cli/config/tsconfig/editTsconfig.d.ts +5 -0
- package/dist/src/cli/config/tsconfig/resolveTsconfig.d.ts +8 -0
- package/dist/src/cli/config/tsconfig/tsconfigStyles.d.ts +1 -0
- package/dist/src/cli/discoverInstances.d.ts +5 -0
- package/dist/src/cli/generate/componentTemplates.d.ts +7 -0
- package/dist/src/cli/generate/context.d.ts +30 -0
- package/dist/src/cli/generate/cssStrategy.d.ts +20 -0
- package/dist/src/cli/generate/frameworkKey.d.ts +3 -0
- package/dist/src/cli/generate/frameworks.d.ts +40 -0
- package/dist/src/cli/generate/generateApi.d.ts +3 -0
- package/dist/src/cli/generate/generateComponent.d.ts +4 -0
- package/dist/src/cli/generate/generatePage.d.ts +4 -0
- package/dist/src/cli/generate/naming.d.ts +5 -0
- package/dist/src/cli/generate/navData.d.ts +10 -0
- package/dist/src/cli/generate/outcome.d.ts +17 -0
- package/dist/src/cli/generate/pageTemplates.d.ts +11 -0
- package/dist/src/cli/generate/routeWiring.d.ts +40 -0
- package/dist/src/cli/generate/staticNav.d.ts +5 -0
- package/dist/src/cli/heapDiff.d.ts +1 -0
- package/dist/src/cli/htmx/install.d.ts +6 -0
- package/dist/src/cli/index.d.ts +2 -0
- package/dist/src/cli/inspectData.d.ts +12 -0
- package/dist/src/cli/inspectTui.d.ts +1 -0
- package/dist/src/cli/instanceStatus.d.ts +22 -0
- package/dist/src/cli/interactive.d.ts +2 -0
- package/dist/src/cli/psTui.d.ts +1 -0
- package/dist/src/cli/scripts/add.d.ts +1 -0
- package/dist/src/cli/scripts/analyze.d.ts +1 -0
- package/dist/src/cli/scripts/api.d.ts +1 -0
- package/dist/src/cli/scripts/build.d.ts +1 -0
- package/dist/src/cli/scripts/compile.d.ts +2 -0
- package/dist/src/cli/scripts/dev.d.ts +1 -0
- package/dist/src/cli/scripts/doctor.d.ts +1 -0
- package/dist/src/cli/scripts/env.d.ts +7 -0
- package/dist/src/cli/scripts/eslint.d.ts +16 -0
- package/dist/src/cli/scripts/generate.d.ts +1 -0
- package/dist/src/cli/scripts/htmx.d.ts +1 -0
- package/dist/src/cli/scripts/info.d.ts +1 -0
- package/dist/src/cli/scripts/inspect.d.ts +1 -0
- package/dist/src/cli/scripts/islands.d.ts +1 -0
- package/dist/src/cli/scripts/logs.d.ts +1 -0
- package/dist/src/cli/scripts/ls.d.ts +1 -0
- package/dist/src/cli/scripts/mem.d.ts +1 -0
- package/dist/src/cli/scripts/prettier.d.ts +3 -0
- package/dist/src/cli/scripts/ps.d.ts +1 -0
- package/dist/src/cli/scripts/remove.d.ts +1 -0
- package/dist/src/cli/scripts/routes.d.ts +1 -0
- package/dist/src/cli/scripts/start.d.ts +1 -0
- package/dist/src/cli/scripts/telemetry.d.ts +5 -0
- package/dist/src/cli/scripts/tunnelRelay.d.ts +9 -0
- package/dist/src/cli/scripts/typecheck.d.ts +1 -0
- package/dist/src/cli/scripts/workspace.d.ts +11 -0
- package/dist/src/cli/telemetryEvent.d.ts +1 -0
- package/dist/src/cli/tuiPrimitives.d.ts +14 -0
- package/dist/src/cli/utils.d.ts +15 -0
- package/dist/src/cli/workspaceTui.d.ts +44 -0
- package/dist/src/client/hydrators/react.d.ts +3 -0
- package/dist/src/client/hydrators/svelte.d.ts +2 -0
- package/dist/src/client/hydrators/vue.d.ts +2 -0
- package/dist/src/client/index.d.ts +4 -0
- package/dist/src/client/islandResolver.d.ts +2 -0
- package/dist/src/client/islandRuntime.d.ts +9 -0
- package/dist/src/client/islandStore.d.ts +22 -0
- package/dist/src/client/preserveIslandMarkup.d.ts +16 -0
- package/dist/src/client/streamSwap.d.ts +1 -0
- package/dist/src/constants.d.ts +96 -0
- package/dist/src/core/angularServerModule.d.ts +1 -0
- package/dist/src/core/build.d.ts +14 -0
- package/dist/src/core/currentIslandRegistry.d.ts +7 -0
- package/dist/src/core/devBuild.d.ts +23 -0
- package/dist/src/core/devRouteRegistrationCallsite.d.ts +4 -0
- package/dist/src/core/devVendorPaths.d.ts +17 -0
- package/dist/src/core/index.d.ts +7 -0
- package/dist/src/core/islandManifest.d.ts +3 -0
- package/dist/src/core/islandMarkupAttributes.d.ts +12 -0
- package/dist/src/core/islandPageContext.d.ts +12 -0
- package/dist/src/core/islandSsr.d.ts +6 -0
- package/dist/src/core/islands.d.ts +16 -0
- package/dist/src/core/loadIslandRegistry.d.ts +1 -0
- package/dist/src/core/lookup.d.ts +1 -0
- package/dist/src/core/normalizeIslandProps.d.ts +15 -0
- package/dist/src/core/pageHandlers.d.ts +5 -0
- package/dist/src/core/prepare.d.ts +417 -0
- package/dist/src/core/prerender.d.ts +31 -0
- package/dist/src/core/renderIslandMarkup.d.ts +13 -0
- package/dist/src/core/responseEnhancers.d.ts +10 -0
- package/dist/src/core/staticStreaming.d.ts +25 -0
- package/dist/src/core/streamingSlotRegistrar.d.ts +16 -0
- package/dist/src/core/streamingSlotRegistry.d.ts +2 -0
- package/dist/src/core/streamingSlotWarningScope.d.ts +4 -0
- package/dist/src/core/svelteServerModule.d.ts +1 -0
- package/dist/src/core/vueServerModule.d.ts +1 -0
- package/dist/src/core/wrapPageHandlerWithStreamingSlots.d.ts +2 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +58 -0
- package/dist/src/dev/angular/hmrCompiler.d.ts +2 -0
- package/dist/src/dev/angular/hmrImportGenerator.d.ts +3 -0
- package/dist/src/dev/angular/hmrInjectionPlugin.d.ts +8 -0
- package/dist/src/dev/angular/resolveOwningComponents.d.ts +16 -0
- package/dist/src/dev/angular/vendor/translator/api/ast_factory.d.ts +363 -0
- package/dist/src/dev/angular/vendor/translator/api/import_generator.d.ts +49 -0
- package/dist/src/dev/angular/vendor/translator/context.d.ts +18 -0
- package/dist/src/dev/angular/vendor/translator/translator.d.ts +75 -0
- package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +12 -0
- package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +66 -0
- package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +13 -0
- package/dist/src/dev/assetStore.d.ts +8 -0
- package/dist/src/dev/buildHMRClient.d.ts +1 -0
- package/dist/src/dev/clientManager.d.ts +33 -0
- package/dist/src/dev/configResolver.d.ts +16 -0
- package/dist/src/dev/dependencyGraph.d.ts +10 -0
- package/dist/src/dev/devCert.d.ts +11 -0
- package/dist/src/dev/fileHashTracker.d.ts +2 -0
- package/dist/src/dev/fileWatcher.d.ts +4 -0
- package/dist/src/dev/moduleMapper.d.ts +27 -0
- package/dist/src/dev/moduleServer.d.ts +24 -0
- package/dist/src/dev/moduleVersionTracker.d.ts +7 -0
- package/dist/src/dev/pathUtils.d.ts +8 -0
- package/dist/src/dev/reactComponentClassifier.d.ts +2 -0
- package/dist/src/dev/rebuildTrigger.d.ts +11 -0
- package/dist/src/dev/requestInspector.d.ts +43 -0
- package/dist/src/dev/serverEntryWatcher.d.ts +5 -0
- package/dist/src/dev/simpleHTMLHMR.d.ts +4 -0
- package/dist/src/dev/simpleHTMXHMR.d.ts +4 -0
- package/dist/src/dev/transformCache.d.ts +22 -0
- package/dist/src/dev/tunnel/client.d.ts +20 -0
- package/dist/src/dev/tunnel/protocol.d.ts +85 -0
- package/dist/src/dev/tunnel/relay.d.ts +28 -0
- package/dist/src/dev/webSocket.d.ts +9 -0
- package/dist/src/ember/browser.d.ts +24 -0
- package/dist/src/ember/index.d.ts +2 -0
- package/dist/src/ember/pageHandler.d.ts +35 -0
- package/dist/src/ember/server.d.ts +2 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/islands/browser.d.ts +3 -0
- package/dist/src/islands/index.d.ts +3 -0
- package/dist/src/islands/pageMetadata.d.ts +13 -0
- package/dist/src/islands/sourceMetadata.d.ts +10 -0
- package/dist/src/plugins/devtoolsJson.d.ts +58 -0
- package/dist/src/plugins/hmr.d.ts +163 -0
- package/dist/src/plugins/imageOptimizer.d.ts +67 -0
- package/dist/src/plugins/index.d.ts +3 -0
- package/dist/src/plugins/networking.d.ts +2 -0
- package/dist/src/plugins/pageRouter.d.ts +1 -0
- package/dist/src/react/Island.browser.d.ts +2 -0
- package/dist/src/react/Island.d.ts +2 -0
- package/dist/src/react/bridgeInternals.d.ts +1 -0
- package/dist/src/react/browser.d.ts +3 -0
- package/dist/src/react/components/Head.d.ts +2 -0
- package/dist/src/react/components/Image.d.ts +2 -0
- package/dist/src/react/components/JsonLd.d.ts +4 -0
- package/dist/src/react/components/StreamSlot.browser.d.ts +10 -0
- package/dist/src/react/components/StreamSlot.d.ts +10 -0
- package/dist/src/react/components/SuspenseSlot.browser.d.ts +22 -0
- package/dist/src/react/components/SuspenseSlot.d.ts +37 -0
- package/dist/src/react/components/browser/index.d.ts +5 -0
- package/dist/src/react/components/index.d.ts +5 -0
- package/dist/src/react/createIsland.browser.d.ts +2 -0
- package/dist/src/react/createIsland.d.ts +2 -0
- package/dist/src/react/hooks/index.d.ts +3 -0
- package/dist/src/react/hooks/useIslandStore.d.ts +3 -0
- package/dist/src/react/hooks/useMediaQuery.d.ts +7 -0
- package/dist/src/react/index.d.ts +4 -0
- package/dist/src/react/jsxDevRuntimeCompat.d.ts +8 -0
- package/dist/src/react/pageHandler.d.ts +25 -0
- package/dist/src/react/router/UniversalRouter.d.ts +43 -0
- package/dist/src/react/router/browser.d.ts +2 -0
- package/dist/src/react/router/index.d.ts +2 -0
- package/dist/src/react/server.d.ts +1 -0
- package/dist/src/react/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/svelte/browser.d.ts +4 -0
- package/dist/src/svelte/createIsland.browser.d.ts +2 -0
- package/dist/src/svelte/createIsland.d.ts +2 -0
- package/dist/src/svelte/index.d.ts +6 -0
- package/dist/src/svelte/islandStore.d.ts +5 -0
- package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +4 -0
- package/dist/src/svelte/lowerIslandSyntax.d.ts +4 -0
- package/dist/src/svelte/pageHandler.d.ts +28 -0
- package/dist/src/svelte/renderIsland.d.ts +2 -0
- package/dist/src/svelte/renderToPipeableStream.d.ts +12 -0
- package/dist/src/svelte/renderToReadableStream.d.ts +14 -0
- package/dist/src/svelte/renderToString.d.ts +9 -0
- package/dist/src/svelte/resolveIslandHtml.browser.d.ts +2 -0
- package/dist/src/svelte/resolveIslandHtml.d.ts +2 -0
- package/dist/src/svelte/router/browser.d.ts +4 -0
- package/dist/src/svelte/router/goto.d.ts +15 -0
- package/dist/src/svelte/router/hashMode.d.ts +16 -0
- package/dist/src/svelte/router/index.d.ts +4 -0
- package/dist/src/svelte/router/matchPath.d.ts +30 -0
- package/dist/src/svelte/router/page.svelte.d.ts +15 -0
- package/dist/src/svelte/router/prefetchCache.d.ts +17 -0
- package/dist/src/svelte/router/pushState.d.ts +13 -0
- package/dist/src/svelte/router/viewTransitions.d.ts +6 -0
- package/dist/src/svelte/server.d.ts +1 -0
- package/dist/src/svelte/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/utils/buildDirectoryLock.d.ts +28 -0
- package/dist/src/utils/cleanStaleOutputs.d.ts +1 -0
- package/dist/src/utils/cleanup.d.ts +9 -0
- package/dist/src/utils/commonAncestor.d.ts +1 -0
- package/dist/src/utils/defineConfig.d.ts +39 -0
- package/dist/src/utils/defineConvention.d.ts +3 -0
- package/dist/src/utils/defineEnv.d.ts +10 -0
- package/dist/src/utils/escapeScriptContent.d.ts +1 -0
- package/dist/src/utils/formatBytes.d.ts +2 -0
- package/dist/src/utils/generateHeadElement.d.ts +4 -0
- package/dist/src/utils/generateSitemap.d.ts +21 -0
- package/dist/src/utils/generatedDir.d.ts +3 -0
- package/dist/src/utils/getDurationString.d.ts +1 -0
- package/dist/src/utils/getEnv.d.ts +1 -0
- package/dist/src/utils/imageClient.d.ts +13 -0
- package/dist/src/utils/imageProcessing.d.ts +33 -0
- package/dist/src/utils/index.d.ts +11 -0
- package/dist/src/utils/inlinePageCss.d.ts +2 -0
- package/dist/src/utils/instanceRegistry.d.ts +13 -0
- package/dist/src/utils/jsonLd.d.ts +3 -0
- package/dist/src/utils/loadConfig.d.ts +55 -0
- package/dist/src/utils/logger.d.ts +56 -0
- package/dist/src/utils/networking.d.ts +2 -0
- package/dist/src/utils/normalizePath.d.ts +9 -0
- package/dist/src/utils/portScan.d.ts +22 -0
- package/dist/src/utils/projectRoot.d.ts +17 -0
- package/dist/src/utils/registerClientScript.d.ts +36 -0
- package/dist/src/utils/resolveConvention.d.ts +10 -0
- package/dist/src/utils/resolveDevPort.d.ts +24 -0
- package/dist/src/utils/runtimeMode.d.ts +3 -0
- package/dist/src/utils/spaRouteCss.d.ts +4 -0
- package/dist/src/utils/spaRouteTypes.d.ts +25 -0
- package/dist/src/utils/ssrErrorPage.d.ts +1 -0
- package/dist/src/utils/startupBanner.d.ts +10 -0
- package/dist/src/utils/startupTimings.d.ts +7 -0
- package/dist/src/utils/streamingSlotMetricSink.d.ts +18 -0
- package/dist/src/utils/streamingSlots.d.ts +76 -0
- package/dist/src/utils/stringModifiers.d.ts +3 -0
- package/dist/src/utils/userAgentFunctions.d.ts +1 -0
- package/dist/src/utils/validateSafePath.d.ts +1 -0
- package/dist/src/vue/Island.browser.d.ts +37 -0
- package/dist/src/vue/Island.d.ts +36 -0
- package/dist/src/vue/browser.d.ts +6 -0
- package/dist/src/vue/components/Image.d.ts +74 -0
- package/dist/src/vue/components/StreamSlot.d.ts +22 -0
- package/dist/src/vue/components/SuspenseSlot.d.ts +26 -0
- package/dist/src/vue/components/index.d.ts +3 -0
- package/dist/src/vue/createIsland.browser.d.ts +13 -0
- package/dist/src/vue/createIsland.d.ts +13 -0
- package/dist/src/vue/defineVuePage.d.ts +6 -0
- package/dist/src/vue/index.d.ts +9 -0
- package/dist/src/vue/pageHandler.d.ts +45 -0
- package/dist/src/vue/routerRedirectProviders.d.ts +45 -0
- package/dist/src/vue/server.d.ts +2 -0
- package/dist/src/vue/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/vue/useIslandStore.d.ts +3 -0
- package/dist/svelte/browser.js +309 -0
- package/dist/svelte/browser.js.map +19 -0
- package/dist/svelte/components/AwaitSlot.svelte +39 -0
- package/dist/svelte/components/AwaitSlot.svelte.d.ts +2 -0
- package/dist/svelte/components/Head.svelte +144 -0
- package/dist/svelte/components/Head.svelte.d.ts +2 -0
- package/dist/svelte/components/Image.svelte +164 -0
- package/dist/svelte/components/Image.svelte.d.ts +5 -0
- package/dist/svelte/components/Island.svelte +71 -0
- package/dist/svelte/components/Island.svelte.d.ts +5 -0
- package/dist/svelte/components/JsonLd.svelte +21 -0
- package/dist/svelte/components/JsonLd.svelte.d.ts +2 -0
- package/dist/svelte/components/StreamSlot.svelte +41 -0
- package/dist/svelte/components/StreamSlot.svelte.d.ts +2 -0
- package/dist/svelte/index.js +4371 -0
- package/dist/svelte/index.js.map +60 -0
- package/dist/svelte/router/Link.svelte +124 -0
- package/dist/svelte/router/Link.svelte.d.ts +21 -0
- package/dist/svelte/router/Route.svelte +54 -0
- package/dist/svelte/router/Route.svelte.d.ts +13 -0
- package/dist/svelte/router/Router.svelte +189 -0
- package/dist/svelte/router/Router.svelte.d.ts +16 -0
- package/dist/svelte/router/browser.ts +14 -0
- package/dist/svelte/router/goto.ts +89 -0
- package/dist/svelte/router/hashMode.ts +31 -0
- package/dist/svelte/router/index.ts +23 -0
- package/dist/svelte/router/matchPath.ts +136 -0
- package/dist/svelte/router/page.d.ts +15 -0
- package/dist/svelte/router/page.js +27 -0
- package/dist/svelte/router/prefetchCache.ts +85 -0
- package/dist/svelte/router/pushState.ts +35 -0
- package/dist/svelte/router/viewTransitions.ts +35 -0
- package/dist/svelte/server.js +2996 -0
- package/dist/svelte/server.js.map +33 -0
- package/dist/types/absoluteConfig.d.ts +22 -0
- package/dist/types/angular.d.ts +43 -0
- package/dist/types/build.d.ts +245 -0
- package/dist/types/cli.d.ts +74 -0
- package/dist/types/client.d.ts +70 -0
- package/dist/types/config.d.ts +50 -0
- package/dist/types/conventions.d.ts +26 -0
- package/dist/types/ember.d.ts +39 -0
- package/dist/types/env.d.ts +2 -0
- package/dist/types/eslintConfig.d.ts +68 -0
- package/dist/types/globals.d.ts +163 -0
- package/dist/types/image.d.ts +77 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/island.d.ts +52 -0
- package/dist/types/jsonLd.d.ts +300 -0
- package/dist/types/mediaQuery.d.ts +9 -0
- package/dist/types/messages.d.ts +152 -0
- package/dist/types/metadata.d.ts +51 -0
- package/dist/types/packageJson.d.ts +74 -0
- package/dist/types/packageJsonPanel.d.ts +29 -0
- package/dist/types/prettier.d.ts +26 -0
- package/dist/types/react.d.ts +2 -0
- package/dist/types/sitemap.d.ts +24 -0
- package/dist/types/style-module-shim.d.ts +29 -0
- package/dist/types/svelte.d.ts +2 -0
- package/dist/types/svelteRouter.d.ts +65 -0
- package/dist/types/svelteRouter.ts +91 -0
- package/dist/types/telemetry.d.ts +15 -0
- package/dist/types/tool.d.ts +11 -0
- package/dist/types/tsconfig.d.ts +31 -0
- package/dist/types/typeGuards.d.ts +2 -0
- package/dist/types/userAgentTypes.d.ts +2 -0
- package/dist/types/vue.d.ts +56 -0
- package/dist/types/websocket.d.ts +6 -0
- package/dist/vue/browser.js +512 -0
- package/dist/vue/browser.js.map +22 -0
- package/dist/vue/components/Image.js +264 -0
- package/dist/vue/components/Image.js.map +12 -0
- package/dist/vue/components/index.js +571 -0
- package/dist/vue/components/index.js.map +15 -0
- package/dist/vue/index.js +5238 -0
- package/dist/vue/index.js.map +69 -0
- package/dist/vue/server.js +2251 -0
- package/dist/vue/server.js.map +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import type {} from '../../../types/globals';
|
|
2
|
+
/* Per-component Tier 1 remount.
|
|
3
|
+
*
|
|
4
|
+
* When fastHmr reports a structural change for a component class,
|
|
5
|
+
* full app rebootstrap loses all sibling component state. Instead, we
|
|
6
|
+
* remount only the affected components: destroy each live instance +
|
|
7
|
+
* recreate at the same DOM host with the new factory.
|
|
8
|
+
*
|
|
9
|
+
* This uses public `createComponent` for the heavy lifting (it runs
|
|
10
|
+
* the new constructor, sets up DI, fires lifecycle hooks, renders the
|
|
11
|
+
* template, attaches change detection). We supplement with vendored
|
|
12
|
+
* LView slot manipulation to (a) find each live instance's parent
|
|
13
|
+
* LView slot and (b) splice the freshly-created LView into that slot
|
|
14
|
+
* so it participates in the parent's view tree instead of being a
|
|
15
|
+
* detached root.
|
|
16
|
+
*
|
|
17
|
+
* Lifecycle of one remount:
|
|
18
|
+
* 1. `applyMetadata` runs, returning `_Fresh` — a class with the
|
|
19
|
+
* full new body (fields + ctor + methods) and a `ɵfac` that
|
|
20
|
+
* delegates to the LIVE class's factory with `_Fresh` as the
|
|
21
|
+
* type override. The delegation preserves the bundle's resolved
|
|
22
|
+
* DI for explicit constructor params.
|
|
23
|
+
* 2. For each live instance: `createComponent(_Fresh, hostElement)`
|
|
24
|
+
* builds a fresh `ComponentRef` at the same host. Angular runs
|
|
25
|
+
* the new constructor (firing field initializers + lifecycle
|
|
26
|
+
* hooks) and renders the new template.
|
|
27
|
+
* 3. Splice the new LView into the parent's slot via vendored slot
|
|
28
|
+
* ops, replacing the old one in the parent's view tree.
|
|
29
|
+
* 4. Tear down the old LView (`executeOnDestroys` +
|
|
30
|
+
* `processCleanups`) so RxJS subscriptions, DOM event listeners,
|
|
31
|
+
* and `inject(DestroyRef).onDestroy(...)` callbacks all fire.
|
|
32
|
+
* 5. `ApplicationRef.tick()` so the parent's template re-runs
|
|
33
|
+
* against the new slot — re-applies `@Input` bindings and
|
|
34
|
+
* re-projects `<ng-content>` into the fresh child. */
|
|
35
|
+
|
|
36
|
+
import {
|
|
37
|
+
CONTEXT,
|
|
38
|
+
HOST,
|
|
39
|
+
PARENT,
|
|
40
|
+
T_HOST,
|
|
41
|
+
TVIEW
|
|
42
|
+
} from '../vendor/lview/slotConstants';
|
|
43
|
+
import {
|
|
44
|
+
executeOnDestroys,
|
|
45
|
+
isLView,
|
|
46
|
+
markLViewDestroyed,
|
|
47
|
+
processCleanups,
|
|
48
|
+
replaceLViewInTree,
|
|
49
|
+
type LView,
|
|
50
|
+
type TView,
|
|
51
|
+
type TNode
|
|
52
|
+
} from '../vendor/lview/lViewOps';
|
|
53
|
+
|
|
54
|
+
type AngularCoreNamespace = {
|
|
55
|
+
createComponent: (
|
|
56
|
+
type: unknown,
|
|
57
|
+
options: {
|
|
58
|
+
hostElement?: Element;
|
|
59
|
+
environmentInjector: unknown;
|
|
60
|
+
}
|
|
61
|
+
) => {
|
|
62
|
+
instance: unknown;
|
|
63
|
+
hostView: { _lView?: LView; detectChanges?: () => void };
|
|
64
|
+
destroy: () => void;
|
|
65
|
+
};
|
|
66
|
+
ApplicationRef?: unknown;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
type ComponentClass = new (...args: unknown[]) => unknown;
|
|
70
|
+
|
|
71
|
+
type LiveInstance = {
|
|
72
|
+
host: Element;
|
|
73
|
+
oldLView: LView;
|
|
74
|
+
parentLView: LView;
|
|
75
|
+
slotIndex: number;
|
|
76
|
+
tNode: TNode;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/* Walk the DOM looking for elements whose component instance is of
|
|
80
|
+
* `Class`. Each match resolves to its parent LView + slot index via
|
|
81
|
+
* the LContext stored on the host element under `__ngContext__`.
|
|
82
|
+
*
|
|
83
|
+
* We walk DOM (not Angular's TRACKED_LVIEWS map) because (a)
|
|
84
|
+
* TRACKED_LVIEWS isn't exported and (b) the DOM walk is bounded by
|
|
85
|
+
* page size, which is fast enough for HMR. */
|
|
86
|
+
const findLiveInstances = (Class: ComponentClass) => {
|
|
87
|
+
const results: LiveInstance[] = [];
|
|
88
|
+
const elements = document.querySelectorAll('*');
|
|
89
|
+
for (const el of Array.from(elements)) {
|
|
90
|
+
const ctx = (el as unknown as Record<string, unknown>).__ngContext__;
|
|
91
|
+
if (typeof ctx !== 'object' || ctx === null) continue;
|
|
92
|
+
const lContext = ctx as { lView?: LView; nodeIndex?: number };
|
|
93
|
+
if (!lContext.lView || lContext.nodeIndex === undefined) continue;
|
|
94
|
+
|
|
95
|
+
const slot = lContext.lView[lContext.nodeIndex];
|
|
96
|
+
if (!isLView(slot)) continue;
|
|
97
|
+
const ownLView = slot;
|
|
98
|
+
const instance = ownLView[CONTEXT];
|
|
99
|
+
if (!(instance instanceof Class)) continue;
|
|
100
|
+
|
|
101
|
+
const tNode = ownLView[T_HOST] as TNode | null;
|
|
102
|
+
const host = ownLView[HOST] as Element | null;
|
|
103
|
+
if (!tNode || !host) continue;
|
|
104
|
+
|
|
105
|
+
// Avoid double-recording the same LView (multiple DOM elements
|
|
106
|
+
// can land in the same component, all sharing __ngContext__)
|
|
107
|
+
if (results.some((r) => r.oldLView === ownLView)) continue;
|
|
108
|
+
|
|
109
|
+
results.push({
|
|
110
|
+
host,
|
|
111
|
+
oldLView: ownLView,
|
|
112
|
+
parentLView: lContext.lView,
|
|
113
|
+
slotIndex: lContext.nodeIndex,
|
|
114
|
+
tNode
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return results;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/* Run a public `createComponent` call to instantiate `Class` at
|
|
122
|
+
* `hostElement`. Pulls ApplicationRef + EnvironmentInjector through
|
|
123
|
+
* the live app's injector exposed on `window.__ANGULAR_APP__`. */
|
|
124
|
+
const createFreshAt = (
|
|
125
|
+
Class: ComponentClass,
|
|
126
|
+
hostElement: Element,
|
|
127
|
+
core: AngularCoreNamespace
|
|
128
|
+
): {
|
|
129
|
+
instance: unknown;
|
|
130
|
+
newLView: LView;
|
|
131
|
+
componentRef: ReturnType<AngularCoreNamespace['createComponent']>;
|
|
132
|
+
} | null => {
|
|
133
|
+
const w = window as unknown as {
|
|
134
|
+
__ANGULAR_APP__?: { injector: unknown };
|
|
135
|
+
};
|
|
136
|
+
const envInjector = w.__ANGULAR_APP__?.injector;
|
|
137
|
+
if (!envInjector) return null;
|
|
138
|
+
|
|
139
|
+
const ref = core.createComponent(Class, {
|
|
140
|
+
environmentInjector: envInjector,
|
|
141
|
+
hostElement
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const newLView = ref.hostView._lView;
|
|
145
|
+
if (!newLView) {
|
|
146
|
+
// Should never happen — _lView is always populated by Angular's
|
|
147
|
+
// internal createComponent path. If it is missing, our slot
|
|
148
|
+
// constants might be off; bail to caller for fallback.
|
|
149
|
+
ref.destroy();
|
|
150
|
+
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return { componentRef: ref, instance: ref.instance, newLView };
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/* Splice `newLView` into `parentLView` at `slotIndex`, replacing
|
|
158
|
+
* `oldLView`. After the splice, the new LView lives in the parent's
|
|
159
|
+
* view tree; the old one is detached.
|
|
160
|
+
*
|
|
161
|
+
* ALSO rewires the directive-instance slots in `parentLView` for
|
|
162
|
+
* this node from the OLD instance to the NEW one. Angular stores
|
|
163
|
+
* each directive instance at `parentLView[i]` for `i` in
|
|
164
|
+
* `[tNode.directiveStart, tNode.directiveEnd)`. Parent template
|
|
165
|
+
* binding ops like `ɵɵproperty('priority', value)` walk that range
|
|
166
|
+
* and write to `parentLView[i].priority` — if those slots still
|
|
167
|
+
* point at the OLD instance, parent CD writes to a dead reference
|
|
168
|
+
* and `@Input` bindings never make it to the new instance. */
|
|
169
|
+
const spliceLViewIntoParent = (
|
|
170
|
+
target: LiveInstance,
|
|
171
|
+
newLView: LView,
|
|
172
|
+
newInstance: unknown
|
|
173
|
+
) => {
|
|
174
|
+
const { parentLView, oldLView, slotIndex, tNode } = target;
|
|
175
|
+
replaceLViewInTree(parentLView, oldLView, newLView, slotIndex);
|
|
176
|
+
newLView[PARENT] = parentLView;
|
|
177
|
+
newLView[T_HOST] = tNode;
|
|
178
|
+
|
|
179
|
+
const oldInstance = oldLView[CONTEXT];
|
|
180
|
+
const tNodeWithDirectiveRange = tNode as TNode & {
|
|
181
|
+
directiveStart?: number;
|
|
182
|
+
directiveEnd?: number;
|
|
183
|
+
};
|
|
184
|
+
const start = tNodeWithDirectiveRange.directiveStart;
|
|
185
|
+
const end = tNodeWithDirectiveRange.directiveEnd;
|
|
186
|
+
if (typeof start === 'number' && typeof end === 'number') {
|
|
187
|
+
for (let i = start; i < end; i++) {
|
|
188
|
+
if (parentLView[i] === oldInstance) {
|
|
189
|
+
parentLView[i] = newInstance;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/* Fire onDestroy + cleanup on the OLD LView so subscriptions, event
|
|
196
|
+
* listeners, and `inject(DestroyRef).onDestroy(...)` callbacks all
|
|
197
|
+
* fire. Then mark the LView as destroyed so any subsequent
|
|
198
|
+
* tree-walk skips it. */
|
|
199
|
+
const teardownOldLView = (oldLView: LView) => {
|
|
200
|
+
const oldTView = oldLView[TVIEW] as TView | null;
|
|
201
|
+
if (oldTView) {
|
|
202
|
+
executeOnDestroys(oldTView, oldLView);
|
|
203
|
+
processCleanups(oldTView, oldLView);
|
|
204
|
+
}
|
|
205
|
+
markLViewDestroyed(oldLView);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/* Copy `@Input` field values from the OLD instance to the NEW one.
|
|
209
|
+
*
|
|
210
|
+
* This is needed because Angular's parent template emits binding ops
|
|
211
|
+
* like `ɵɵproperty('priority', true)` that compare against a cached
|
|
212
|
+
* binding slot in the parent's LView before writing. After our
|
|
213
|
+
* splice the CACHED value is unchanged (the parent's LView wasn't
|
|
214
|
+
* re-rendered), so the next parent CD sees `true === true (cached)`
|
|
215
|
+
* and SKIPS the write. The new instance's `priority` would stay at
|
|
216
|
+
* its default until the parent's binding expression result changes.
|
|
217
|
+
*
|
|
218
|
+
* Pre-seeding the new instance with the old value sidesteps this:
|
|
219
|
+
* by the time the parent's binding op might run, the new instance
|
|
220
|
+
* already has the correct value, and any future change will fire
|
|
221
|
+
* normally because the binding-cache invariant is preserved.
|
|
222
|
+
*
|
|
223
|
+
* `def.inputs` metadata format (modern Angular):
|
|
224
|
+
* - `{ propName: 'classFieldName' }` (simple alias)
|
|
225
|
+
* - `{ propName: ['publicName', 'classFieldName', transformFn?] }` */
|
|
226
|
+
const copyInputsFromOldToNew = (
|
|
227
|
+
oldInstance: unknown,
|
|
228
|
+
newInstance: unknown
|
|
229
|
+
) => {
|
|
230
|
+
if (!oldInstance || !newInstance) return;
|
|
231
|
+
const def = (newInstance as { constructor?: { ɵcmp?: unknown } })
|
|
232
|
+
.constructor?.ɵcmp as { inputs?: Record<string, unknown> } | undefined;
|
|
233
|
+
const inputs = def?.inputs;
|
|
234
|
+
if (!inputs) return;
|
|
235
|
+
|
|
236
|
+
// Modern Angular inputs format (since v17ish): the OBJECT KEY is
|
|
237
|
+
// the class property name; the value is either a string (binding
|
|
238
|
+
// name) or `[bindingName, flags, transformFn?]`. So the class
|
|
239
|
+
// field name is just `Object.keys(inputs)`.
|
|
240
|
+
for (const classField of Object.keys(inputs)) {
|
|
241
|
+
const oldRec = oldInstance as Record<string, unknown>;
|
|
242
|
+
const newRec = newInstance as Record<string, unknown>;
|
|
243
|
+
if (classField in oldRec) {
|
|
244
|
+
newRec[classField] = oldRec[classField];
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export type RemountResult = {
|
|
250
|
+
className: string;
|
|
251
|
+
remounted: number;
|
|
252
|
+
skipped: number;
|
|
253
|
+
error?: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
/* Public entry. Called by the bundle's HMR listener block when an
|
|
257
|
+
* `angular:component-remount` event arrives for this class.
|
|
258
|
+
*
|
|
259
|
+
* applyMetadata is the surgical module's default export — it patches
|
|
260
|
+
* `Class.ɵcmp` with the new component definition. We call it BEFORE
|
|
261
|
+
* createComponent so the fresh instance picks up the new template,
|
|
262
|
+
* dependencies, etc.
|
|
263
|
+
*
|
|
264
|
+
* locals + namespaces match `ɵɵreplaceMetadata`'s contract — passed
|
|
265
|
+
* through to applyMetadata. We're not using ɵɵreplaceMetadata here
|
|
266
|
+
* (it preserves instance state, defeating the point), but we mirror
|
|
267
|
+
* the calling convention so bundle-level code stays consistent. */
|
|
268
|
+
export const remountComponentClass = async (
|
|
269
|
+
Class: ComponentClass,
|
|
270
|
+
applyMetadata: (
|
|
271
|
+
Class: unknown,
|
|
272
|
+
namespaces: unknown[],
|
|
273
|
+
...locals: unknown[]
|
|
274
|
+
) => unknown,
|
|
275
|
+
namespaces: unknown[],
|
|
276
|
+
locals: unknown[],
|
|
277
|
+
core: AngularCoreNamespace,
|
|
278
|
+
className: string
|
|
279
|
+
): Promise<RemountResult> => {
|
|
280
|
+
let FreshClass = Class;
|
|
281
|
+
try {
|
|
282
|
+
// `applyMetadata` from a recent fastHmr build returns a `_Fresh`
|
|
283
|
+
// class with the new constructor + field initializers + the
|
|
284
|
+
// live class's `ɵcmp` re-bound. Older builds (or non-component
|
|
285
|
+
// surgical paths) return undefined; in that case the live
|
|
286
|
+
// class is used and `createComponent` will call its existing
|
|
287
|
+
// factory — no field-initializer refresh, but template /
|
|
288
|
+
// method patches still apply.
|
|
289
|
+
const returned = applyMetadata.apply(null, [
|
|
290
|
+
Class,
|
|
291
|
+
namespaces,
|
|
292
|
+
...locals
|
|
293
|
+
]);
|
|
294
|
+
if (typeof returned === 'function') {
|
|
295
|
+
FreshClass = returned as ComponentClass;
|
|
296
|
+
}
|
|
297
|
+
} catch (err) {
|
|
298
|
+
return {
|
|
299
|
+
className,
|
|
300
|
+
error: `applyMetadata threw: ${(err as Error).message}`,
|
|
301
|
+
remounted: 0,
|
|
302
|
+
skipped: 0
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const targets = findLiveInstances(Class);
|
|
307
|
+
if (targets.length === 0) {
|
|
308
|
+
return { className, remounted: 0, skipped: 0 };
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
let remounted = 0;
|
|
312
|
+
let skipped = 0;
|
|
313
|
+
|
|
314
|
+
for (const target of targets) {
|
|
315
|
+
try {
|
|
316
|
+
const fresh = createFreshAt(FreshClass, target.host, core);
|
|
317
|
+
if (!fresh) {
|
|
318
|
+
skipped++;
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
copyInputsFromOldToNew(target.oldLView[CONTEXT], fresh.instance);
|
|
323
|
+
spliceLViewIntoParent(target, fresh.newLView, fresh.instance);
|
|
324
|
+
teardownOldLView(target.oldLView);
|
|
325
|
+
|
|
326
|
+
fresh.componentRef.hostView.detectChanges?.();
|
|
327
|
+
remounted++;
|
|
328
|
+
} catch (err) {
|
|
329
|
+
console.error(
|
|
330
|
+
`[absolutejs] remount of ${className} failed at`,
|
|
331
|
+
target.host,
|
|
332
|
+
err
|
|
333
|
+
);
|
|
334
|
+
skipped++;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
if (remounted > 0) {
|
|
339
|
+
// Trigger an app-wide CD pass so the parent's template re-runs
|
|
340
|
+
// against the new child LView's slot. This is what re-applies
|
|
341
|
+
// `@Input` bindings (`<app-hero [foo]="bar">`) and re-projects
|
|
342
|
+
// `<ng-content>` content into the new instance — both are
|
|
343
|
+
// PARENT-template artifacts that Angular only re-evaluates
|
|
344
|
+
// during the parent's update pass, not during the child's
|
|
345
|
+
// fresh creation. Without this tick, a remounted component
|
|
346
|
+
// shows default field values until the user interacts and
|
|
347
|
+
// triggers a stray CD elsewhere.
|
|
348
|
+
const w = window as unknown as {
|
|
349
|
+
__ANGULAR_APP__?: { tick?: () => void };
|
|
350
|
+
};
|
|
351
|
+
try {
|
|
352
|
+
w.__ANGULAR_APP__?.tick?.();
|
|
353
|
+
} catch (err) {
|
|
354
|
+
console.error(
|
|
355
|
+
'[absolutejs] post-remount tick threw — partial state',
|
|
356
|
+
err
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return { className, remounted, skipped };
|
|
362
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type {} from '../../../types/globals';
|
|
2
|
+
/* Wire `globalThis.__absAngularRemount` so the injected
|
|
3
|
+
* `__ng_hmr_remount` blocks (in `hmrInjectionPlugin.ts`) can call into
|
|
4
|
+
* the shared remount implementation. The bundle's listener captures
|
|
5
|
+
* the class via closure and the metadata via dynamic import; everything
|
|
6
|
+
* else is generic, so the implementation is shared rather than baked
|
|
7
|
+
* into every component bundle. */
|
|
8
|
+
|
|
9
|
+
import { remountComponentClass, type RemountResult } from './angularRemount';
|
|
10
|
+
|
|
11
|
+
declare global {
|
|
12
|
+
|
|
13
|
+
var __absAngularRemount:
|
|
14
|
+
| ((
|
|
15
|
+
Class: new (...args: unknown[]) => unknown,
|
|
16
|
+
applyMetadata: (
|
|
17
|
+
Class: unknown,
|
|
18
|
+
namespaces: unknown[],
|
|
19
|
+
...locals: unknown[]
|
|
20
|
+
) => void,
|
|
21
|
+
namespaces: unknown[],
|
|
22
|
+
locals: unknown[],
|
|
23
|
+
core: {
|
|
24
|
+
createComponent: (
|
|
25
|
+
type: unknown,
|
|
26
|
+
options: {
|
|
27
|
+
hostElement?: Element;
|
|
28
|
+
environmentInjector: unknown;
|
|
29
|
+
}
|
|
30
|
+
) => {
|
|
31
|
+
instance: unknown;
|
|
32
|
+
hostView: {
|
|
33
|
+
_lView?: unknown[];
|
|
34
|
+
detectChanges?: () => void;
|
|
35
|
+
};
|
|
36
|
+
destroy: () => void;
|
|
37
|
+
};
|
|
38
|
+
ApplicationRef?: unknown;
|
|
39
|
+
},
|
|
40
|
+
className: string
|
|
41
|
+
) => Promise<RemountResult>)
|
|
42
|
+
| undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let installed = false;
|
|
46
|
+
|
|
47
|
+
export const installAngularRemountGlobal = () => {
|
|
48
|
+
if (installed) return;
|
|
49
|
+
if (typeof globalThis === 'undefined') return;
|
|
50
|
+
globalThis.__absAngularRemount = remountComponentClass;
|
|
51
|
+
installed = true;
|
|
52
|
+
};
|