@nativescript/vite 8.0.0-beta.0 → 8.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -14
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +35 -2
- package/configuration/angular.js +541 -216
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +227 -77
- package/configuration/base.js.map +1 -1
- package/configuration/javascript.js +17 -96
- package/configuration/javascript.js.map +1 -1
- package/configuration/react.js +41 -73
- package/configuration/react.js.map +1 -1
- package/configuration/solid.js +58 -6
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +15 -96
- package/configuration/typescript.js.map +1 -1
- package/helpers/app-components.d.ts +2 -1
- package/helpers/app-components.js.map +1 -1
- package/helpers/app-css-refresh.d.ts +31 -0
- package/helpers/app-css-refresh.js +43 -0
- package/helpers/app-css-refresh.js.map +1 -0
- package/helpers/app-css-state.d.ts +17 -0
- package/helpers/app-css-state.js +51 -0
- package/helpers/app-css-state.js.map +1 -0
- package/helpers/bundler-context.d.ts +11 -0
- package/helpers/bundler-context.js +71 -0
- package/helpers/bundler-context.js.map +1 -0
- package/helpers/cli-flags.d.ts +12 -0
- package/helpers/cli-flags.js +34 -0
- package/helpers/cli-flags.js.map +1 -1
- package/helpers/commonjs-plugins.d.ts +5 -2
- package/helpers/commonjs-plugins.js +126 -0
- package/helpers/commonjs-plugins.js.map +1 -1
- package/helpers/config-as-json.js +10 -0
- package/helpers/config-as-json.js.map +1 -1
- package/helpers/css-platform-plugin.d.ts +14 -0
- package/helpers/css-platform-plugin.js +43 -25
- package/helpers/css-platform-plugin.js.map +1 -1
- package/helpers/dev-host.d.ts +360 -0
- package/helpers/dev-host.js +694 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/dynamic-import-plugin.d.ts +2 -1
- package/helpers/dynamic-import-plugin.js +59 -53
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +9 -6
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -4
- package/helpers/external-configs.js +63 -15
- package/helpers/external-configs.js.map +1 -1
- package/helpers/flavor.d.ts +13 -0
- package/helpers/flavor.js +18 -1
- package/helpers/flavor.js.map +1 -1
- package/helpers/global-defines.d.ts +117 -0
- package/helpers/global-defines.js +209 -11
- package/helpers/global-defines.js.map +1 -1
- package/helpers/hmr-scope.d.ts +26 -0
- package/helpers/hmr-scope.js +67 -0
- package/helpers/hmr-scope.js.map +1 -0
- package/helpers/import-meta-path.d.ts +4 -0
- package/helpers/import-meta-path.js +5 -0
- package/helpers/import-meta-path.js.map +1 -0
- package/helpers/import-specifier.d.ts +1 -0
- package/helpers/import-specifier.js +18 -0
- package/helpers/import-specifier.js.map +1 -0
- package/helpers/init.js +6 -20
- package/helpers/init.js.map +1 -1
- package/helpers/logging.d.ts +1 -0
- package/helpers/logging.js +65 -4
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +8 -2
- package/helpers/main-entry.js +622 -120
- package/helpers/main-entry.js.map +1 -1
- package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
- package/helpers/nativeclass-esbuild-plugin.js +6 -1
- package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
- package/helpers/nativeclass-transform.d.ts +13 -0
- package/helpers/nativeclass-transform.js +42 -131
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.d.ts +19 -1
- package/helpers/nativeclass-transformer-plugin.js +324 -37
- package/helpers/nativeclass-transformer-plugin.js.map +1 -1
- package/helpers/nativescript-package-resolver.js +10 -62
- package/helpers/nativescript-package-resolver.js.map +1 -1
- package/helpers/normalize-id.d.ts +42 -0
- package/helpers/normalize-id.js +60 -0
- package/helpers/normalize-id.js.map +1 -0
- package/helpers/ns-core-external-urls.d.ts +32 -0
- package/helpers/ns-core-external-urls.js +107 -0
- package/helpers/ns-core-external-urls.js.map +1 -0
- package/helpers/ns-core-url.d.ts +106 -0
- package/helpers/ns-core-url.js +225 -0
- package/helpers/ns-core-url.js.map +1 -0
- package/helpers/optimize-deps.d.ts +16 -0
- package/helpers/optimize-deps.js +17 -0
- package/helpers/optimize-deps.js.map +1 -0
- package/helpers/package-platform-aliases.js +34 -49
- package/helpers/package-platform-aliases.js.map +1 -1
- package/helpers/platform-types.d.ts +2 -0
- package/helpers/platform-types.js +2 -0
- package/helpers/platform-types.js.map +1 -0
- package/helpers/postcss-platform-config.d.ts +17 -1
- package/helpers/postcss-platform-config.js +20 -37
- package/helpers/postcss-platform-config.js.map +1 -1
- package/helpers/project.d.ts +35 -0
- package/helpers/project.js +120 -2
- package/helpers/project.js.map +1 -1
- package/helpers/resolve-main-field-platform.d.ts +20 -0
- package/helpers/resolve-main-field-platform.js +49 -0
- package/helpers/resolve-main-field-platform.js.map +1 -0
- package/helpers/resolver.js +17 -2
- package/helpers/resolver.js.map +1 -1
- package/helpers/theme-core-plugins.js +1 -1
- package/helpers/theme-core-plugins.js.map +1 -1
- package/helpers/ts-config-paths.d.ts +32 -0
- package/helpers/ts-config-paths.js +156 -27
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +2 -1
- package/helpers/typescript-check.js +4 -4
- package/helpers/typescript-check.js.map +1 -1
- package/helpers/ui-registration.d.ts +21 -0
- package/helpers/ui-registration.js +156 -0
- package/helpers/ui-registration.js.map +1 -0
- package/helpers/utils.d.ts +9 -0
- package/helpers/utils.js +22 -2
- package/helpers/utils.js.map +1 -1
- package/helpers/vite-package-version.d.ts +7 -0
- package/helpers/vite-package-version.js +44 -0
- package/helpers/vite-package-version.js.map +1 -0
- package/helpers/workers.d.ts +40 -19
- package/helpers/workers.js +312 -13
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +95 -23
- package/hmr/client/css-handler.js.map +1 -1
- package/hmr/client/css-update-overlay.d.ts +18 -0
- package/hmr/client/css-update-overlay.js +27 -0
- package/hmr/client/css-update-overlay.js.map +1 -0
- package/hmr/client/framework-client-strategy.d.ts +87 -0
- package/hmr/client/framework-client-strategy.js +18 -0
- package/hmr/client/framework-client-strategy.js.map +1 -0
- package/hmr/client/hmr-pending-overlay.d.ts +13 -0
- package/hmr/client/hmr-pending-overlay.js +41 -0
- package/hmr/client/hmr-pending-overlay.js.map +1 -0
- package/hmr/client/hot-context.d.ts +67 -0
- package/hmr/client/hot-context.js +307 -0
- package/hmr/client/hot-context.js.map +1 -0
- package/hmr/client/index.d.ts +9 -1
- package/hmr/client/index.js +91 -1418
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/overlay-driver.d.ts +10 -0
- package/hmr/client/overlay-driver.js +33 -0
- package/hmr/client/overlay-driver.js.map +1 -0
- package/hmr/client/protocol-dispatch.d.ts +8 -0
- package/hmr/client/protocol-dispatch.js +308 -0
- package/hmr/client/protocol-dispatch.js.map +1 -0
- package/hmr/client/root-reset.d.ts +15 -0
- package/hmr/client/root-reset.js +358 -0
- package/hmr/client/root-reset.js.map +1 -0
- package/hmr/client/strategy-loader.d.ts +24 -0
- package/hmr/client/strategy-loader.js +100 -0
- package/hmr/client/strategy-loader.js.map +1 -0
- package/hmr/client/update-pipeline.d.ts +27 -0
- package/hmr/client/update-pipeline.js +464 -0
- package/hmr/client/update-pipeline.js.map +1 -0
- package/hmr/client/utils.d.ts +14 -1
- package/hmr/client/utils.js +265 -54
- package/hmr/client/utils.js.map +1 -1
- package/hmr/client/ws-transport.d.ts +21 -0
- package/hmr/client/ws-transport.js +323 -0
- package/hmr/client/ws-transport.js.map +1 -0
- package/hmr/entry-runtime.d.ts +11 -0
- package/hmr/entry-runtime.js +566 -43
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
- package/hmr/frameworks/angular/build/angular-linker.js +113 -0
- package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.d.ts +3 -0
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js +231 -0
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
- package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
- package/hmr/frameworks/angular/build/js-lexer.js +182 -0
- package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
- package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
- package/hmr/frameworks/angular/build/linker-stats.js +29 -0
- package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
- package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
- package/hmr/frameworks/angular/build/shared-linker.js +128 -0
- package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.d.ts +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.d.ts +3 -0
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js +241 -0
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
- package/hmr/frameworks/angular/build/util.js +155 -0
- package/hmr/frameworks/angular/build/util.js.map +1 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
- package/hmr/frameworks/angular/client/index.d.ts +2 -1
- package/hmr/frameworks/angular/client/index.js +637 -23
- package/hmr/frameworks/angular/client/index.js.map +1 -1
- package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
- package/hmr/frameworks/angular/client/strategy.js +19 -0
- package/hmr/frameworks/angular/client/strategy.js.map +1 -0
- package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
- package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
- package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
- package/hmr/frameworks/angular/server/linker.js +37 -6
- package/hmr/frameworks/angular/server/linker.js.map +1 -1
- package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
- package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
- package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
- package/hmr/frameworks/angular/server/strategy.js +697 -18
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/frameworks/angular/server/websocket-angular-entry.d.ts +2 -0
- package/hmr/frameworks/angular/server/websocket-angular-entry.js +68 -0
- package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.d.ts +94 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +485 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
- package/hmr/frameworks/react/client/strategy.d.ts +12 -0
- package/hmr/frameworks/react/client/strategy.js +27 -0
- package/hmr/frameworks/react/client/strategy.js.map +1 -0
- package/hmr/frameworks/react/server/strategy.d.ts +2 -0
- package/hmr/frameworks/react/server/strategy.js +230 -0
- package/hmr/frameworks/react/server/strategy.js.map +1 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
- package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
- package/hmr/frameworks/solid/client/app-runtime.js +252 -0
- package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
- package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
- package/hmr/frameworks/solid/client/strategy.js +391 -0
- package/hmr/frameworks/solid/client/strategy.js.map +1 -0
- package/hmr/frameworks/solid/server/strategy.js +293 -16
- package/hmr/frameworks/solid/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
- package/hmr/frameworks/typescript/client/strategy.js +418 -0
- package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
- package/hmr/frameworks/typescript/server/strategy.js +48 -16
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
- package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
- package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +10 -1
- package/hmr/frameworks/vue/client/index.js +287 -562
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
- package/hmr/frameworks/vue/client/navigate-app.js +178 -0
- package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
- package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
- package/hmr/frameworks/vue/client/strategy.js +152 -0
- package/hmr/frameworks/vue/client/strategy.js.map +1 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
- package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
- package/hmr/frameworks/vue/server/compiler.js +3 -1
- package/hmr/frameworks/vue/server/compiler.js.map +1 -1
- package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
- package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
- package/hmr/frameworks/vue/server/strategy.js +291 -7
- package/hmr/frameworks/vue/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
- package/hmr/helpers/ast-normalizer.d.ts +3 -1
- package/hmr/helpers/ast-normalizer.js +131 -24
- package/hmr/helpers/ast-normalizer.js.map +1 -1
- package/hmr/helpers/cjs-named-exports.d.ts +23 -0
- package/hmr/helpers/cjs-named-exports.js +152 -0
- package/hmr/helpers/cjs-named-exports.js.map +1 -0
- package/hmr/helpers/package-exports.d.ts +16 -0
- package/hmr/helpers/package-exports.js +396 -0
- package/hmr/helpers/package-exports.js.map +1 -0
- package/hmr/helpers/vendor-rewrite.d.ts +1 -1
- package/hmr/helpers/vendor-rewrite.js +5 -3
- package/hmr/helpers/vendor-rewrite.js.map +1 -1
- package/hmr/server/boot-recording.d.ts +51 -0
- package/hmr/server/boot-recording.js +214 -0
- package/hmr/server/boot-recording.js.map +1 -0
- package/hmr/server/constants.d.ts +1 -0
- package/hmr/server/constants.js +21 -4
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/content-css-update.d.ts +54 -0
- package/hmr/server/content-css-update.js +78 -0
- package/hmr/server/content-css-update.js.map +1 -0
- package/hmr/server/core-bundle.d.ts +140 -0
- package/hmr/server/core-bundle.js +614 -0
- package/hmr/server/core-bundle.js.map +1 -0
- package/hmr/server/core-sanitize.d.ts +130 -4
- package/hmr/server/core-sanitize.js +393 -32
- package/hmr/server/core-sanitize.js.map +1 -1
- package/hmr/server/css-connect-sync.d.ts +28 -0
- package/hmr/server/css-connect-sync.js +59 -0
- package/hmr/server/css-connect-sync.js.map +1 -0
- package/hmr/server/css-device-module.d.ts +28 -0
- package/hmr/server/css-device-module.js +44 -0
- package/hmr/server/css-device-module.js.map +1 -0
- package/hmr/server/css-update-message.d.ts +23 -0
- package/hmr/server/css-update-message.js +41 -0
- package/hmr/server/css-update-message.js.map +1 -0
- package/hmr/server/deps-bundle.d.ts +233 -0
- package/hmr/server/deps-bundle.js +1022 -0
- package/hmr/server/deps-bundle.js.map +1 -0
- package/hmr/server/device-transform-helpers.d.ts +24 -0
- package/hmr/server/device-transform-helpers.js +408 -0
- package/hmr/server/device-transform-helpers.js.map +1 -0
- package/hmr/server/framework-strategy.d.ts +182 -11
- package/hmr/server/hmr-module-graph.d.ts +37 -0
- package/hmr/server/hmr-module-graph.js +215 -0
- package/hmr/server/hmr-module-graph.js.map +1 -0
- package/hmr/server/import-map.d.ts +99 -0
- package/hmr/server/import-map.js +294 -0
- package/hmr/server/import-map.js.map +1 -0
- package/hmr/server/index.d.ts +2 -1
- package/hmr/server/index.js +7 -16
- package/hmr/server/index.js.map +1 -1
- package/hmr/server/node-builtins-route.d.ts +12 -0
- package/hmr/server/node-builtins-route.js +86 -0
- package/hmr/server/node-builtins-route.js.map +1 -0
- package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
- package/hmr/server/ns-core-cjs-shape.js +271 -0
- package/hmr/server/ns-core-cjs-shape.js.map +1 -0
- package/hmr/server/ns-m-response-memo.d.ts +10 -0
- package/hmr/server/ns-m-response-memo.js +33 -0
- package/hmr/server/ns-m-response-memo.js.map +1 -0
- package/hmr/server/ns-rt-bridge.d.ts +51 -0
- package/hmr/server/ns-rt-bridge.js +131 -0
- package/hmr/server/ns-rt-bridge.js.map +1 -0
- package/hmr/server/ns-rt-route.d.ts +5 -0
- package/hmr/server/ns-rt-route.js +39 -0
- package/hmr/server/ns-rt-route.js.map +1 -0
- package/hmr/server/perf-instrumentation.d.ts +114 -0
- package/hmr/server/perf-instrumentation.js +197 -0
- package/hmr/server/perf-instrumentation.js.map +1 -0
- package/hmr/server/process-code-for-device.d.ts +44 -0
- package/hmr/server/process-code-for-device.js +834 -0
- package/hmr/server/process-code-for-device.js.map +1 -0
- package/hmr/server/require-guard.d.ts +1 -0
- package/hmr/server/require-guard.js +12 -0
- package/hmr/server/require-guard.js.map +1 -0
- package/hmr/server/rewrite-imports.d.ts +2 -0
- package/hmr/server/rewrite-imports.js +631 -0
- package/hmr/server/rewrite-imports.js.map +1 -0
- package/hmr/server/route-helpers.d.ts +7 -0
- package/hmr/server/route-helpers.js +13 -0
- package/hmr/server/route-helpers.js.map +1 -0
- package/hmr/server/runtime-graph-filter.d.ts +5 -0
- package/hmr/server/runtime-graph-filter.js +28 -0
- package/hmr/server/runtime-graph-filter.js.map +1 -0
- package/hmr/server/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +88 -0
- package/hmr/server/server-origin.js.map +1 -0
- package/hmr/server/shared-transform-request.d.ts +12 -0
- package/hmr/server/shared-transform-request.js +143 -0
- package/hmr/server/shared-transform-request.js.map +1 -0
- package/hmr/server/socket-utils.d.ts +10 -0
- package/hmr/server/socket-utils.js +14 -0
- package/hmr/server/socket-utils.js.map +1 -0
- package/hmr/server/transform-cache-invalidation.d.ts +37 -0
- package/hmr/server/transform-cache-invalidation.js +156 -0
- package/hmr/server/transform-cache-invalidation.js.map +1 -0
- package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
- package/hmr/server/vendor-bare-module-shims.js +80 -0
- package/hmr/server/vendor-bare-module-shims.js.map +1 -0
- package/hmr/server/vite-plugin.d.ts +22 -1
- package/hmr/server/vite-plugin.js +655 -58
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +68 -0
- package/hmr/server/websocket-core-bridge.js +370 -0
- package/hmr/server/websocket-core-bridge.js.map +1 -0
- package/hmr/server/websocket-device-transform.d.ts +3 -0
- package/hmr/server/websocket-device-transform.js +7 -0
- package/hmr/server/websocket-device-transform.js.map +1 -0
- package/hmr/server/websocket-graph-upsert.d.ts +21 -0
- package/hmr/server/websocket-graph-upsert.js +33 -0
- package/hmr/server/websocket-graph-upsert.js.map +1 -0
- package/hmr/server/websocket-hmr-pending.d.ts +29 -0
- package/hmr/server/websocket-hmr-pending.js +33 -0
- package/hmr/server/websocket-hmr-pending.js.map +1 -0
- package/hmr/server/websocket-hot-update.d.ts +80 -0
- package/hmr/server/websocket-hot-update.js +295 -0
- package/hmr/server/websocket-hot-update.js.map +1 -0
- package/hmr/server/websocket-import-map-route.d.ts +15 -0
- package/hmr/server/websocket-import-map-route.js +51 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.d.ts +21 -0
- package/hmr/server/websocket-module-bindings.js +504 -0
- package/hmr/server/websocket-module-bindings.js.map +1 -0
- package/hmr/server/websocket-module-specifiers.d.ts +96 -0
- package/hmr/server/websocket-module-specifiers.js +819 -0
- package/hmr/server/websocket-module-specifiers.js.map +1 -0
- package/hmr/server/websocket-ns-core.d.ts +34 -0
- package/hmr/server/websocket-ns-core.js +414 -0
- package/hmr/server/websocket-ns-core.js.map +1 -0
- package/hmr/server/websocket-ns-entry.d.ts +21 -0
- package/hmr/server/websocket-ns-entry.js +163 -0
- package/hmr/server/websocket-ns-entry.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +19 -0
- package/hmr/server/websocket-ns-m-paths.js +115 -0
- package/hmr/server/websocket-ns-m-paths.js.map +1 -0
- package/hmr/server/websocket-ns-m-request.d.ts +46 -0
- package/hmr/server/websocket-ns-m-request.js +197 -0
- package/hmr/server/websocket-ns-m-request.js.map +1 -0
- package/hmr/server/websocket-ns-m.d.ts +52 -0
- package/hmr/server/websocket-ns-m.js +590 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +89 -0
- package/hmr/server/websocket-served-module-helpers.js +935 -0
- package/hmr/server/websocket-served-module-helpers.js.map +1 -0
- package/hmr/server/websocket-txn.d.ts +6 -0
- package/hmr/server/websocket-txn.js +42 -0
- package/hmr/server/websocket-txn.js.map +1 -0
- package/hmr/server/websocket-vendor-unifier.d.ts +9 -0
- package/hmr/server/websocket-vendor-unifier.js +46 -0
- package/hmr/server/websocket-vendor-unifier.js.map +1 -0
- package/hmr/server/websocket.d.ts +7 -17
- package/hmr/server/websocket.js +723 -5376
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +107 -0
- package/hmr/shared/ns-globals.js +29 -0
- package/hmr/shared/ns-globals.js.map +1 -0
- package/hmr/shared/package-classifier.d.ts +9 -0
- package/hmr/shared/package-classifier.js +58 -0
- package/hmr/shared/package-classifier.js.map +1 -0
- package/hmr/shared/protocol.d.ts +157 -0
- package/hmr/shared/protocol.js +28 -0
- package/hmr/shared/protocol.js.map +1 -0
- package/hmr/shared/runtime/boot-complete.d.ts +14 -0
- package/hmr/shared/runtime/boot-complete.js +32 -0
- package/hmr/shared/runtime/boot-complete.js.map +1 -0
- package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
- package/hmr/shared/runtime/boot-progress.d.ts +44 -0
- package/hmr/shared/runtime/boot-progress.js +134 -0
- package/hmr/shared/runtime/boot-progress.js.map +1 -0
- package/hmr/shared/runtime/boot-timeline.d.ts +17 -0
- package/hmr/shared/runtime/boot-timeline.js +40 -0
- package/hmr/shared/runtime/boot-timeline.js.map +1 -0
- package/hmr/shared/runtime/browser-runtime-contract.d.ts +97 -0
- package/hmr/shared/runtime/browser-runtime-contract.js +66 -0
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
- package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
- package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
- package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
- package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
- package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
- package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay.d.ts +39 -0
- package/hmr/shared/runtime/dev-overlay.js +292 -0
- package/hmr/shared/runtime/dev-overlay.js.map +1 -0
- package/hmr/shared/runtime/global-scope.d.ts +18 -0
- package/hmr/shared/runtime/global-scope.js +21 -0
- package/hmr/shared/runtime/global-scope.js.map +1 -0
- package/hmr/shared/runtime/hooks.js +2 -1
- package/hmr/shared/runtime/hooks.js.map +1 -1
- package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
- package/hmr/shared/runtime/launch-bridge.js +98 -0
- package/hmr/shared/runtime/launch-bridge.js.map +1 -0
- package/hmr/shared/runtime/module-provenance.d.ts +1 -0
- package/hmr/shared/runtime/module-provenance.js +64 -0
- package/hmr/shared/runtime/module-provenance.js.map +1 -0
- package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
- package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
- package/hmr/shared/runtime/overlay-flag.js +34 -0
- package/hmr/shared/runtime/overlay-flag.js.map +1 -0
- package/hmr/shared/runtime/platform-polyfills.d.ts +26 -0
- package/hmr/shared/runtime/platform-polyfills.js +122 -0
- package/hmr/shared/runtime/platform-polyfills.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
- package/hmr/shared/runtime/root-placeholder-view.js +311 -0
- package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
- package/hmr/shared/runtime/root-placeholder.js +778 -83
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
- package/hmr/shared/runtime/session-bootstrap.js +350 -0
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
- package/hmr/shared/runtime/vendor-bootstrap.js +54 -16
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
- package/hmr/shared/runtime/vendor-resolve.js +45 -0
- package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
- package/hmr/shared/runtime/worker-tracking.d.ts +28 -0
- package/hmr/shared/runtime/worker-tracking.js +114 -0
- package/hmr/shared/runtime/worker-tracking.js.map +1 -0
- package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +909 -0
- package/hmr/shared/vendor/manifest-collect.js.map +1 -0
- package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
- package/hmr/shared/vendor/manifest-loader.js +5 -3
- package/hmr/shared/vendor/manifest-loader.js.map +1 -1
- package/hmr/shared/vendor/manifest.d.ts +12 -0
- package/hmr/shared/vendor/manifest.js +341 -545
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/hmr/shared/vendor/registry.d.ts +2 -0
- package/hmr/shared/vendor/registry.js +118 -7
- package/hmr/shared/vendor/registry.js.map +1 -1
- package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
- package/hmr/shared/vendor/vendor-device-shim.js +208 -0
- package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +76 -14
- package/runtime/core-aliases-early.js +103 -81
- package/runtime/core-aliases-early.js.map +1 -1
- package/shims/react-jsx-runtime.d.ts +4 -0
- package/shims/react-jsx-runtime.js +61 -0
- package/shims/react-jsx-runtime.js.map +1 -0
- package/shims/solid-jsx-runtime.d.ts +7 -0
- package/shims/solid-jsx-runtime.js +17 -0
- package/shims/solid-jsx-runtime.js.map +1 -0
- package/helpers/angular/angular-linker.d.ts +0 -13
- package/helpers/angular/angular-linker.js +0 -189
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/shared-linker.d.ts +0 -4
- package/helpers/angular/shared-linker.js +0 -39
- package/helpers/angular/shared-linker.js.map +0 -1
- package/helpers/angular/util.js +0 -67
- package/helpers/angular/util.js.map +0 -1
- package/helpers/module-runner-patch.d.ts +0 -3
- package/helpers/module-runner-patch.js +0 -63
- package/helpers/module-runner-patch.js.map +0 -1
- package/helpers/prelink-angular.d.ts +0 -2
- package/helpers/prelink-angular.js +0 -117
- package/helpers/prelink-angular.js.map +0 -1
- package/hmr/shared/runtime/http-only-boot.d.ts +0 -1
- package/hmr/shared/runtime/http-only-boot.js +0 -124
- package/hmr/shared/runtime/http-only-boot.js.map +0 -1
- package/hmr/vendor-bootstrap.d.ts +0 -3
- package/hmr/vendor-bootstrap.js +0 -32
- package/hmr/vendor-bootstrap.js.map +0 -1
- package/shims/react-reconciler-constants.d.ts +0 -14
- package/shims/react-reconciler-constants.js +0 -21
- package/shims/react-reconciler-constants.js.map +0 -1
- package/shims/react-reconciler.d.ts +0 -8
- package/shims/react-reconciler.js +0 -15
- package/shims/react-reconciler.js.map +0 -1
- package/transformers/NativeClass/index.d.ts +0 -2
- package/transformers/NativeClass/index.js +0 -222
- package/transformers/NativeClass/index.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* eslint-disable no-var -- ambient global declarations must use `var`: only `var`
|
|
2
|
+
in `declare global` registers the property on `typeof globalThis` (see header). */
|
|
3
|
+
/**
|
|
4
|
+
* Ambient typings for the `__NS_*` / `__ns*` globals the HMR runtime stashes on
|
|
5
|
+
* `globalThis`. One `declare global` here replaces the scattered
|
|
6
|
+
* `(globalThis as any).__NS_X` casts across the device client + entry runtime:
|
|
7
|
+
* consumers read/write `globalThis.__NS_X` directly and get a real type, and the
|
|
8
|
+
* per-file `declare const __NS_X__` duplicates collapse to this single source of
|
|
9
|
+
* truth.
|
|
10
|
+
*
|
|
11
|
+
* Conventions:
|
|
12
|
+
* - Every key is `var … | undefined` — `var` (not `const`/`let`) is what adds the
|
|
13
|
+
* property to `typeof globalThis`, so both bare references (Vite `define`
|
|
14
|
+
* substitutions like `__NS_ENV_VERBOSE__`) and `globalThis.__NS_X` access
|
|
15
|
+
* type-check; `| undefined` reflects that these are populated lazily at runtime.
|
|
16
|
+
* - Primitive flags/counters/urls get precise types. Keys holding framework
|
|
17
|
+
* instances, native objects, ASTs, module registries, or arbitrary diagnostic
|
|
18
|
+
* payloads are intentionally `any` — typing them precisely would couple this
|
|
19
|
+
* shared file to device internals and risk breaking write sites elsewhere in
|
|
20
|
+
* the package.
|
|
21
|
+
* - The runtime dev-host API is NOT a global at all — it is the
|
|
22
|
+
* `ns:module` builtin module, read through
|
|
23
|
+
* `hmr/shared/runtime/browser-runtime-contract.ts`.
|
|
24
|
+
*
|
|
25
|
+
* This module emits no runtime code (ambient declaration only) and is picked up
|
|
26
|
+
* project-wide via the package tsconfig include (all .ts files).
|
|
27
|
+
*/
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=ns-globals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ns-globals.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/shared/ns-globals.ts"],"names":[],"mappings":"AAAA;qFACqF;AACrF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA0FH,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface PackageRuntimeInfo {
|
|
2
|
+
rootPackageName: string;
|
|
3
|
+
hasPackageJson: boolean;
|
|
4
|
+
hasExports: boolean;
|
|
5
|
+
mainEntries: Set<string>;
|
|
6
|
+
hasNativeScriptMetadata: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function extractRootPackageName(spec: string): string;
|
|
9
|
+
export declare function getPackageRuntimeInfo(spec: string, projectRoot: string): PackageRuntimeInfo;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
const packageRuntimeInfoCache = new Map();
|
|
5
|
+
export function extractRootPackageName(spec) {
|
|
6
|
+
if (!spec)
|
|
7
|
+
return '';
|
|
8
|
+
if (spec.startsWith('@')) {
|
|
9
|
+
const parts = spec.split('/');
|
|
10
|
+
return parts.length >= 2 ? `${parts[0]}/${parts[1]}` : spec;
|
|
11
|
+
}
|
|
12
|
+
return spec.split('/')[0];
|
|
13
|
+
}
|
|
14
|
+
export function getPackageRuntimeInfo(spec, projectRoot) {
|
|
15
|
+
const rootPackageName = extractRootPackageName(String(spec || ''));
|
|
16
|
+
if (!rootPackageName) {
|
|
17
|
+
return {
|
|
18
|
+
rootPackageName: '',
|
|
19
|
+
hasPackageJson: false,
|
|
20
|
+
hasExports: false,
|
|
21
|
+
mainEntries: new Set(),
|
|
22
|
+
hasNativeScriptMetadata: false,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const resolvedProjectRoot = path.resolve(projectRoot || process.cwd());
|
|
26
|
+
const cacheKey = `${resolvedProjectRoot}::${rootPackageName}`;
|
|
27
|
+
const cached = packageRuntimeInfoCache.get(cacheKey);
|
|
28
|
+
if (cached) {
|
|
29
|
+
return cached;
|
|
30
|
+
}
|
|
31
|
+
const info = {
|
|
32
|
+
rootPackageName,
|
|
33
|
+
hasPackageJson: false,
|
|
34
|
+
hasExports: false,
|
|
35
|
+
mainEntries: new Set(),
|
|
36
|
+
hasNativeScriptMetadata: false,
|
|
37
|
+
};
|
|
38
|
+
try {
|
|
39
|
+
const projectRequire = createRequire(path.join(resolvedProjectRoot, 'package.json'));
|
|
40
|
+
const packageJsonPath = projectRequire.resolve(`${rootPackageName}/package.json`);
|
|
41
|
+
const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
42
|
+
info.hasPackageJson = true;
|
|
43
|
+
info.hasExports = !!pkg.exports && typeof pkg.exports === 'object';
|
|
44
|
+
for (const field of ['module', 'main']) {
|
|
45
|
+
const value = pkg[field];
|
|
46
|
+
if (value && typeof value === 'string') {
|
|
47
|
+
info.mainEntries.add(value.replace(/^\.\//, ''));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
info.hasNativeScriptMetadata = (typeof pkg.nativescript === 'object' && pkg.nativescript !== null) || typeof pkg.peerDependencies?.['@nativescript/core'] === 'string' || typeof pkg.dependencies?.['@nativescript/core'] === 'string';
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// Package metadata unavailable — leave defaults and let callers fall back to heuristics.
|
|
54
|
+
}
|
|
55
|
+
packageRuntimeInfoCache.set(cacheKey, info);
|
|
56
|
+
return info;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=package-classifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-classifier.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/shared/package-classifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAU5C,MAAM,uBAAuB,GAAG,IAAI,GAAG,EAA8B,CAAC;AAEtE,MAAM,UAAU,sBAAsB,CAAC,IAAY;IAClD,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7D,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,WAAmB;IACtE,MAAM,eAAe,GAAG,sBAAsB,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IACnE,IAAI,CAAC,eAAe,EAAE,CAAC;QACtB,OAAO;YACN,eAAe,EAAE,EAAE;YACnB,cAAc,EAAE,KAAK;YACrB,UAAU,EAAE,KAAK;YACjB,WAAW,EAAE,IAAI,GAAG,EAAU;YAC9B,uBAAuB,EAAE,KAAK;SAC9B,CAAC;IACH,CAAC;IAED,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,GAAG,mBAAmB,KAAK,eAAe,EAAE,CAAC;IAC9D,MAAM,MAAM,GAAG,uBAAuB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrD,IAAI,MAAM,EAAE,CAAC;QACZ,OAAO,MAAM,CAAC;IACf,CAAC;IAED,MAAM,IAAI,GAAuB;QAChC,eAAe;QACf,cAAc,EAAE,KAAK;QACrB,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,IAAI,GAAG,EAAU;QAC9B,uBAAuB,EAAE,KAAK;KAC9B,CAAC;IAEF,IAAI,CAAC;QACJ,MAAM,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC,CAAC;QACrF,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,eAAe,eAAe,CAAC,CAAC;QAClF,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAO5D,CAAC;QAEF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC;QACnE,KAAK,MAAM,KAAK,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAU,EAAE,CAAC;YACjD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACxC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;YAClD,CAAC;QACF,CAAC;QACD,IAAI,CAAC,uBAAuB,GAAG,CAAC,OAAO,GAAG,CAAC,YAAY,KAAK,QAAQ,IAAI,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,IAAI,OAAO,GAAG,CAAC,gBAAgB,EAAE,CAAC,oBAAoB,CAAC,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,YAAY,EAAE,CAAC,oBAAoB,CAAC,KAAK,QAAQ,CAAC;IACxO,CAAC;IAAC,MAAM,CAAC;QACR,yFAAyF;IAC1F,CAAC;IAED,uBAAuB,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire protocol for the `ns:*` HMR messages exchanged over the dev-server
|
|
3
|
+
* WebSocket between the Vite dev server and the on-device client.
|
|
4
|
+
*
|
|
5
|
+
* This is the single source of truth for message shapes. Server emit sites
|
|
6
|
+
* annotate their payload objects with the matching interface here, so a field
|
|
7
|
+
* rename or type drift becomes a compile error at the emit site instead of a
|
|
8
|
+
* silent runtime mismatch the device only discovers at parse time. The client
|
|
9
|
+
* dispatch (`switch (msg.type)`) consumes the `ServerToClientMessage` union and
|
|
10
|
+
* uses {@link assertNeverNsMessage} for exhaustiveness.
|
|
11
|
+
*
|
|
12
|
+
* Pure types + one pure helper only — this module is in `hmr/shared` and must
|
|
13
|
+
* not import from `hmr/server` or `hmr/client`.
|
|
14
|
+
*
|
|
15
|
+
* Direction is encoded by the two unions:
|
|
16
|
+
* - {@link ServerToClientMessage} — dev server → device (9 messages)
|
|
17
|
+
* - {@link ClientToServerMessage} — device → dev server (2 messages)
|
|
18
|
+
*/
|
|
19
|
+
/** Module entry as carried inside the graph payloads (`ns:hmr-full-graph`, `ns:hmr-delta`). */
|
|
20
|
+
export interface GraphModulePayload {
|
|
21
|
+
id: string;
|
|
22
|
+
deps: string[];
|
|
23
|
+
hash: string;
|
|
24
|
+
}
|
|
25
|
+
/** A single CSS update item nested inside an `ns:css-updates` batch. */
|
|
26
|
+
export interface CssUpdateItem {
|
|
27
|
+
type: 'css-update';
|
|
28
|
+
path: string;
|
|
29
|
+
acceptedPath: string;
|
|
30
|
+
timestamp: number;
|
|
31
|
+
/**
|
|
32
|
+
* Tag for the client's `addTaggedAdditionalCSS`/`removeTaggedAdditionalCSS`
|
|
33
|
+
* remove+add pair, scoping the replace so repeated edits of the SAME source
|
|
34
|
+
* swap cleanly instead of stacking. Omitted for the app entry CSS (the
|
|
35
|
+
* client defaults to the shared `app.css` tag). Set to the component style
|
|
36
|
+
* file's own path for `styleUrls` edits so a component's rules replace
|
|
37
|
+
* independently of `app.css`.
|
|
38
|
+
*/
|
|
39
|
+
tag?: string;
|
|
40
|
+
}
|
|
41
|
+
/** A single Vue SFC registry entry carried inside `ns:vue-sfc-registry`. */
|
|
42
|
+
export interface VueSfcRegistryEntry {
|
|
43
|
+
path: string;
|
|
44
|
+
fileName: string;
|
|
45
|
+
hmrId: string;
|
|
46
|
+
/** Always empty in HTTP-only mode (artifacts are fetched over HTTP, not pushed over WS). */
|
|
47
|
+
code: string;
|
|
48
|
+
}
|
|
49
|
+
/** Classified kind of a pending HMR update (used by `ns:hmr-pending`). */
|
|
50
|
+
export type HmrPendingKind = 'ts' | 'css' | 'html' | 'unknown';
|
|
51
|
+
/** Angular hot-update broadcast: the device evicts `evictPaths` and re-fetches. */
|
|
52
|
+
export interface AngularUpdateMessage {
|
|
53
|
+
type: 'ns:angular-update';
|
|
54
|
+
origin: string;
|
|
55
|
+
path: string;
|
|
56
|
+
version: number;
|
|
57
|
+
timestamp: number;
|
|
58
|
+
evictPaths: string[];
|
|
59
|
+
importerEntry: string;
|
|
60
|
+
/**
|
|
61
|
+
* App stylesheet refresh produced by the same content-file edit. Angular
|
|
62
|
+
* applies it inside the serialized reboot cycle so CSS replacement cannot
|
|
63
|
+
* race view-tree teardown/recreation.
|
|
64
|
+
*/
|
|
65
|
+
cssUpdates?: CssUpdateItem[];
|
|
66
|
+
/** Legacy fallback the Angular client still reads; not emitted by the current server. */
|
|
67
|
+
entryCandidates?: string[];
|
|
68
|
+
}
|
|
69
|
+
/** Batched CSS hot-update broadcast (direct `.css` saves and Tailwind/PostCSS content edits). */
|
|
70
|
+
export interface CssUpdatesMessage {
|
|
71
|
+
type: 'ns:css-updates';
|
|
72
|
+
origin: string;
|
|
73
|
+
updates: CssUpdateItem[];
|
|
74
|
+
/**
|
|
75
|
+
* `connect-sync` marks the boot-time stylesheet sync pushed to a freshly
|
|
76
|
+
* connected full client; the client applies it silently (no overlay). Full
|
|
77
|
+
* rationale in `hmr/server/css-connect-sync.ts`.
|
|
78
|
+
*/
|
|
79
|
+
reason?: 'connect-sync';
|
|
80
|
+
}
|
|
81
|
+
/** Incremental module-graph delta broadcast on every graph mutation. */
|
|
82
|
+
export interface HmrDeltaMessage {
|
|
83
|
+
type: 'ns:hmr-delta';
|
|
84
|
+
baseVersion: number;
|
|
85
|
+
newVersion: number;
|
|
86
|
+
changed: GraphModulePayload[];
|
|
87
|
+
removed: string[];
|
|
88
|
+
}
|
|
89
|
+
/** Full module-graph snapshot sent on connect and in response to `ns:hmr-resync-request`. */
|
|
90
|
+
export interface HmrFullGraphMessage {
|
|
91
|
+
type: 'ns:hmr-full-graph';
|
|
92
|
+
version: number;
|
|
93
|
+
modules: GraphModulePayload[];
|
|
94
|
+
}
|
|
95
|
+
/** Early "change in flight" notification sent at the very start of `handleHotUpdate`. */
|
|
96
|
+
export interface HmrPendingMessage {
|
|
97
|
+
type: 'ns:hmr-pending';
|
|
98
|
+
origin: string;
|
|
99
|
+
path: string;
|
|
100
|
+
kind: HmrPendingKind;
|
|
101
|
+
timestamp: number;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Response to a legacy on-demand module fetch (Option A).
|
|
105
|
+
*
|
|
106
|
+
* No server emit site currently exists — the live module-fetch path resolves
|
|
107
|
+
* HTTP URLs directly — but the client still handles this shape, so it is part
|
|
108
|
+
* of the union for completeness. Shape is inferred from the consumer.
|
|
109
|
+
*/
|
|
110
|
+
export interface ModuleResponseMessage {
|
|
111
|
+
type: 'ns:module-response';
|
|
112
|
+
requestId: number;
|
|
113
|
+
error?: string;
|
|
114
|
+
}
|
|
115
|
+
/** TypeScript-flavor module registry primed on connect; coalesced into the graph client-side. */
|
|
116
|
+
export interface TsModuleRegistryMessage {
|
|
117
|
+
type: 'ns:ts-module-registry';
|
|
118
|
+
modules: string[];
|
|
119
|
+
ts: number;
|
|
120
|
+
}
|
|
121
|
+
/** Vue SFC registry sent on connect and in response to `ns:hmr-sfc-registry-request`. */
|
|
122
|
+
export interface VueSfcRegistryMessage {
|
|
123
|
+
type: 'ns:vue-sfc-registry';
|
|
124
|
+
entries: VueSfcRegistryEntry[];
|
|
125
|
+
ts: number;
|
|
126
|
+
}
|
|
127
|
+
/** Mapping-only Vue SFC registry update emitted ahead of the artifact for a changed `.vue` file. */
|
|
128
|
+
export interface VueSfcRegistryUpdateMessage {
|
|
129
|
+
type: 'ns:vue-sfc-registry-update';
|
|
130
|
+
path: string;
|
|
131
|
+
fileName: string;
|
|
132
|
+
ts: number;
|
|
133
|
+
version: number;
|
|
134
|
+
}
|
|
135
|
+
/** Device asks for a fresh full graph when its delta base version drifts from the server's. */
|
|
136
|
+
export interface HmrResyncRequestMessage {
|
|
137
|
+
type: 'ns:hmr-resync-request';
|
|
138
|
+
}
|
|
139
|
+
/** Device asks the server to rebuild and re-broadcast the SFC registry. */
|
|
140
|
+
export interface HmrSfcRegistryRequestMessage {
|
|
141
|
+
type: 'ns:hmr-sfc-registry-request';
|
|
142
|
+
}
|
|
143
|
+
/** Every `ns:*` message the dev server can send to the device. */
|
|
144
|
+
export type ServerToClientMessage = AngularUpdateMessage | CssUpdatesMessage | HmrDeltaMessage | HmrFullGraphMessage | HmrPendingMessage | ModuleResponseMessage | TsModuleRegistryMessage | VueSfcRegistryMessage | VueSfcRegistryUpdateMessage;
|
|
145
|
+
/** Every `ns:*` message the device can send back to the dev server. */
|
|
146
|
+
export type ClientToServerMessage = HmrResyncRequestMessage | HmrSfcRegistryRequestMessage;
|
|
147
|
+
/** Any `ns:*` HMR message, regardless of direction. */
|
|
148
|
+
export type NsHmrMessage = ServerToClientMessage | ClientToServerMessage;
|
|
149
|
+
/** The `type` discriminant of any `ns:*` HMR message. */
|
|
150
|
+
export type NsHmrMessageType = NsHmrMessage['type'];
|
|
151
|
+
/**
|
|
152
|
+
* Exhaustiveness guard for `switch (msg.type)` dispatch over the message unions.
|
|
153
|
+
* Reaching it means a new message type was added to the union but not handled;
|
|
154
|
+
* TypeScript flags the unhandled branch at compile time and this throws if a
|
|
155
|
+
* truly unexpected payload arrives at runtime.
|
|
156
|
+
*/
|
|
157
|
+
export declare function assertNeverNsMessage(message: never): never;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire protocol for the `ns:*` HMR messages exchanged over the dev-server
|
|
3
|
+
* WebSocket between the Vite dev server and the on-device client.
|
|
4
|
+
*
|
|
5
|
+
* This is the single source of truth for message shapes. Server emit sites
|
|
6
|
+
* annotate their payload objects with the matching interface here, so a field
|
|
7
|
+
* rename or type drift becomes a compile error at the emit site instead of a
|
|
8
|
+
* silent runtime mismatch the device only discovers at parse time. The client
|
|
9
|
+
* dispatch (`switch (msg.type)`) consumes the `ServerToClientMessage` union and
|
|
10
|
+
* uses {@link assertNeverNsMessage} for exhaustiveness.
|
|
11
|
+
*
|
|
12
|
+
* Pure types + one pure helper only — this module is in `hmr/shared` and must
|
|
13
|
+
* not import from `hmr/server` or `hmr/client`.
|
|
14
|
+
*
|
|
15
|
+
* Direction is encoded by the two unions:
|
|
16
|
+
* - {@link ServerToClientMessage} — dev server → device (9 messages)
|
|
17
|
+
* - {@link ClientToServerMessage} — device → dev server (2 messages)
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Exhaustiveness guard for `switch (msg.type)` dispatch over the message unions.
|
|
21
|
+
* Reaching it means a new message type was added to the union but not handled;
|
|
22
|
+
* TypeScript flags the unhandled branch at compile time and this throws if a
|
|
23
|
+
* truly unexpected payload arrives at runtime.
|
|
24
|
+
*/
|
|
25
|
+
export function assertNeverNsMessage(message) {
|
|
26
|
+
throw new Error(`Unhandled ns:* HMR message: ${JSON.stringify(message)}`);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/shared/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAqKH;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAc;IAClD,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flip the dev-boot-complete signal from JS.
|
|
3
|
+
*
|
|
4
|
+
* Sets the JS-visible `__NS_HMR_BOOT_COMPLETE__` global (every existing
|
|
5
|
+
* poller keys off it) AND — when the runtime exposes it — calls
|
|
6
|
+
* ns:module `setDevBootComplete(value)` so the native atomic that gates
|
|
7
|
+
* cold-boot-only behaviors (JS-thread runloop pump between synchronous
|
|
8
|
+
* fetches) is disarmed/re-armed in lockstep.
|
|
9
|
+
*
|
|
10
|
+
* Safe on runtimes without the native setter (Android today, tests): the
|
|
11
|
+
* JS global still flips and the native call is skipped.
|
|
12
|
+
*/
|
|
13
|
+
export declare function setDevBootComplete(value: boolean): void;
|
|
14
|
+
export declare function markDevBootComplete(): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getGlobalScope } from './global-scope.js';
|
|
2
|
+
import { readNsRuntimeDevHostApi } from './browser-runtime-contract.js';
|
|
3
|
+
/**
|
|
4
|
+
* Flip the dev-boot-complete signal from JS.
|
|
5
|
+
*
|
|
6
|
+
* Sets the JS-visible `__NS_HMR_BOOT_COMPLETE__` global (every existing
|
|
7
|
+
* poller keys off it) AND — when the runtime exposes it — calls
|
|
8
|
+
* ns:module `setDevBootComplete(value)` so the native atomic that gates
|
|
9
|
+
* cold-boot-only behaviors (JS-thread runloop pump between synchronous
|
|
10
|
+
* fetches) is disarmed/re-armed in lockstep.
|
|
11
|
+
*
|
|
12
|
+
* Safe on runtimes without the native setter (Android today, tests): the
|
|
13
|
+
* JS global still flips and the native call is skipped.
|
|
14
|
+
*/
|
|
15
|
+
export function setDevBootComplete(value) {
|
|
16
|
+
const g = getGlobalScope();
|
|
17
|
+
try {
|
|
18
|
+
g.__NS_HMR_BOOT_COMPLETE__ = value;
|
|
19
|
+
}
|
|
20
|
+
catch { }
|
|
21
|
+
try {
|
|
22
|
+
const nativeSetter = readNsRuntimeDevHostApi(g).setDevBootComplete;
|
|
23
|
+
if (typeof nativeSetter === 'function') {
|
|
24
|
+
nativeSetter(value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch { }
|
|
28
|
+
}
|
|
29
|
+
export function markDevBootComplete() {
|
|
30
|
+
setDevBootComplete(true);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=boot-complete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot-complete.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/boot-complete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAChD,MAAM,CAAC,GAAQ,cAAc,EAAE,CAAC;IAChC,IAAI,CAAC;QACJ,CAAC,CAAC,wBAAwB,GAAG,KAAK,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACJ,MAAM,YAAY,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC;QACnE,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE,CAAC;YACxC,YAAY,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACX,CAAC;AAED,MAAM,UAAU,mBAAmB;IAClC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { HmrOverlaySnapshot } from './dev-overlay.js';
|
|
2
|
+
/**
|
|
3
|
+
* Calibrated palette for the boot placeholder card. The card is
|
|
4
|
+
* intentionally light so the small accent (brand badge + progress
|
|
5
|
+
* fill) reads as the only "live" element on the screen.
|
|
6
|
+
*
|
|
7
|
+
* Tones map to the snapshot tone enum from `dev-overlay.ts`:
|
|
8
|
+
* - `info` (default) — calm slate + NS blue
|
|
9
|
+
* - `error` — dusty rose-on-white surface
|
|
10
|
+
*/
|
|
11
|
+
export type BootPlaceholderTone = 'info' | 'error';
|
|
12
|
+
export interface BootPlaceholderPalette {
|
|
13
|
+
pageBackground: string;
|
|
14
|
+
cardBackground: string;
|
|
15
|
+
cardShadow: string;
|
|
16
|
+
titleText: string;
|
|
17
|
+
phaseText: string;
|
|
18
|
+
detailText: string;
|
|
19
|
+
progressTrack: string;
|
|
20
|
+
progressFill: string;
|
|
21
|
+
activityIndicator: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the palette for a given tone. Unknown tones fall back to
|
|
25
|
+
* the calm `info` palette
|
|
26
|
+
*/
|
|
27
|
+
export declare function getBootPlaceholderPalette(tone?: string | null): BootPlaceholderPalette;
|
|
28
|
+
/**
|
|
29
|
+
* Animation contract for the boot placeholder.
|
|
30
|
+
*
|
|
31
|
+
* `entranceDurationMs` covers the one-shot fade + scale that fires
|
|
32
|
+
* when the placeholder card first attaches to the visual tree.
|
|
33
|
+
* `entranceFromScale` is the starting scale before easeOut to 1.
|
|
34
|
+
*
|
|
35
|
+
* `progressDurationMs` is the per-update fade for the progress fill's
|
|
36
|
+
* `scaleX`. Pegged to 220 ms (just under the heartbeat's 250 ms tick)
|
|
37
|
+
* so consecutive ticks chain into continuous motion rather than
|
|
38
|
+
* waiting on the previous animation to settle.
|
|
39
|
+
*
|
|
40
|
+
* `brandPulseDurationMs` is one half-period of the brand badge's
|
|
41
|
+
* opacity pulse. A full cycle is `brandPulseDurationMs * 2`. Keeping
|
|
42
|
+
* it long (~1.2 s) makes the pulse feel ambient rather than nervous.
|
|
43
|
+
*/
|
|
44
|
+
export declare const BOOT_PLACEHOLDER_MOTION: {
|
|
45
|
+
readonly entranceDurationMs: 380;
|
|
46
|
+
readonly entranceFromScale: 0.94;
|
|
47
|
+
readonly progressDurationMs: 220;
|
|
48
|
+
readonly brandPulseDurationMs: 1200;
|
|
49
|
+
readonly brandPulseMinOpacity: 0.55;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Convert a 0–100 progress percentage into an `scaleX` factor that
|
|
53
|
+
* the fill view can animate against. Clamps to [`minScale`, 1] so the
|
|
54
|
+
* fill never collapses to an invisible hairline
|
|
55
|
+
*
|
|
56
|
+
* The default `minScale` of 0.01 keeps the bar visible during the
|
|
57
|
+
* earliest moments of boot when progress is 0
|
|
58
|
+
*/
|
|
59
|
+
export declare function computeBootProgressFillScale(progress: number | null | undefined, minScale?: number): number;
|
|
60
|
+
/**
|
|
61
|
+
* The "phase + percent" line we show as the primary status text
|
|
62
|
+
* inside the card
|
|
63
|
+
*/
|
|
64
|
+
export declare function formatBootPrimaryLine(snapshot: Pick<HmrOverlaySnapshot, 'phase' | 'progress'> | null | undefined): string;
|
|
65
|
+
/**
|
|
66
|
+
* The secondary detail line (e.g. "Loading the module graph…" or
|
|
67
|
+
* "Evaluated 42 modules").
|
|
68
|
+
*/
|
|
69
|
+
export declare function formatBootDetailLine(snapshot: Pick<HmrOverlaySnapshot, 'detail'> | null | undefined): string;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// Pure helpers for the cold-boot placeholder's visual treatment.
|
|
2
|
+
//
|
|
3
|
+
// The visible UI is constructed in `root-placeholder.ts` (an NS view
|
|
4
|
+
// tree attached to `Application` via `launchEvent`), and driven by the
|
|
5
|
+
// dev-overlay via `updateBootStatusLabel`. This file owns the bits
|
|
6
|
+
// that don't need a runtime view tree to make sense — colours,
|
|
7
|
+
// animation timings, the formula that turns a 0–100 progress into the
|
|
8
|
+
// fill bar's `scaleX`, and the split between the "phase + percent"
|
|
9
|
+
// primary line and the secondary detail line.
|
|
10
|
+
//
|
|
11
|
+
const INFO_PALETTE = {
|
|
12
|
+
pageBackground: '#F4F7FB',
|
|
13
|
+
cardBackground: '#FFFFFF',
|
|
14
|
+
cardShadow: '#0F172A',
|
|
15
|
+
titleText: '#0F172A',
|
|
16
|
+
phaseText: '#475569',
|
|
17
|
+
detailText: '#94A3B8',
|
|
18
|
+
progressTrack: '#E2E8F0',
|
|
19
|
+
progressFill: '#3B6FE5',
|
|
20
|
+
activityIndicator: '#3B6FE5',
|
|
21
|
+
};
|
|
22
|
+
const ERROR_PALETTE = {
|
|
23
|
+
pageBackground: '#FFF5F5',
|
|
24
|
+
cardBackground: '#FFFFFF',
|
|
25
|
+
cardShadow: '#7F1D1D',
|
|
26
|
+
titleText: '#7F1D1D',
|
|
27
|
+
phaseText: '#B91C1C',
|
|
28
|
+
detailText: '#DC2626',
|
|
29
|
+
progressTrack: '#FCA5A5',
|
|
30
|
+
progressFill: '#B41810',
|
|
31
|
+
activityIndicator: '#B41810',
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Resolve the palette for a given tone. Unknown tones fall back to
|
|
35
|
+
* the calm `info` palette
|
|
36
|
+
*/
|
|
37
|
+
export function getBootPlaceholderPalette(tone) {
|
|
38
|
+
if (tone === 'error')
|
|
39
|
+
return ERROR_PALETTE;
|
|
40
|
+
return INFO_PALETTE;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Animation contract for the boot placeholder.
|
|
44
|
+
*
|
|
45
|
+
* `entranceDurationMs` covers the one-shot fade + scale that fires
|
|
46
|
+
* when the placeholder card first attaches to the visual tree.
|
|
47
|
+
* `entranceFromScale` is the starting scale before easeOut to 1.
|
|
48
|
+
*
|
|
49
|
+
* `progressDurationMs` is the per-update fade for the progress fill's
|
|
50
|
+
* `scaleX`. Pegged to 220 ms (just under the heartbeat's 250 ms tick)
|
|
51
|
+
* so consecutive ticks chain into continuous motion rather than
|
|
52
|
+
* waiting on the previous animation to settle.
|
|
53
|
+
*
|
|
54
|
+
* `brandPulseDurationMs` is one half-period of the brand badge's
|
|
55
|
+
* opacity pulse. A full cycle is `brandPulseDurationMs * 2`. Keeping
|
|
56
|
+
* it long (~1.2 s) makes the pulse feel ambient rather than nervous.
|
|
57
|
+
*/
|
|
58
|
+
export const BOOT_PLACEHOLDER_MOTION = {
|
|
59
|
+
entranceDurationMs: 380,
|
|
60
|
+
entranceFromScale: 0.94,
|
|
61
|
+
progressDurationMs: 220,
|
|
62
|
+
brandPulseDurationMs: 1200,
|
|
63
|
+
brandPulseMinOpacity: 0.55,
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Convert a 0–100 progress percentage into an `scaleX` factor that
|
|
67
|
+
* the fill view can animate against. Clamps to [`minScale`, 1] so the
|
|
68
|
+
* fill never collapses to an invisible hairline
|
|
69
|
+
*
|
|
70
|
+
* The default `minScale` of 0.01 keeps the bar visible during the
|
|
71
|
+
* earliest moments of boot when progress is 0
|
|
72
|
+
*/
|
|
73
|
+
export function computeBootProgressFillScale(progress, minScale = 0.01) {
|
|
74
|
+
const numeric = typeof progress === 'number' && Number.isFinite(progress) ? progress : 0;
|
|
75
|
+
const normalized = numeric / 100;
|
|
76
|
+
if (!Number.isFinite(normalized))
|
|
77
|
+
return minScale;
|
|
78
|
+
return Math.max(minScale, Math.min(1, normalized));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The "phase + percent" line we show as the primary status text
|
|
82
|
+
* inside the card
|
|
83
|
+
*/
|
|
84
|
+
export function formatBootPrimaryLine(snapshot) {
|
|
85
|
+
if (!snapshot)
|
|
86
|
+
return '';
|
|
87
|
+
const progress = snapshot.progress;
|
|
88
|
+
const progressText = typeof progress === 'number' && Number.isFinite(progress) ? ` (${Math.round(progress)}%)` : '';
|
|
89
|
+
return `${snapshot.phase || ''}${progressText}`.trim();
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The secondary detail line (e.g. "Loading the module graph…" or
|
|
93
|
+
* "Evaluated 42 modules").
|
|
94
|
+
*/
|
|
95
|
+
export function formatBootDetailLine(snapshot) {
|
|
96
|
+
if (!snapshot)
|
|
97
|
+
return '';
|
|
98
|
+
const detail = snapshot.detail;
|
|
99
|
+
return typeof detail === 'string' ? detail : '';
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=boot-placeholder-ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot-placeholder-ui.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/boot-placeholder-ui.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,mEAAmE;AACnE,+DAA+D;AAC/D,sEAAsE;AACtE,mEAAmE;AACnE,8CAA8C;AAC9C,EAAE;AA2BF,MAAM,YAAY,GAA2B;IAC5C,cAAc,EAAE,SAAS;IACzB,cAAc,EAAE,SAAS;IACzB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,aAAa,EAAE,SAAS;IACxB,YAAY,EAAE,SAAS;IACvB,iBAAiB,EAAE,SAAS;CAC5B,CAAC;AAEF,MAAM,aAAa,GAA2B;IAC7C,cAAc,EAAE,SAAS;IACzB,cAAc,EAAE,SAAS;IACzB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,aAAa,EAAE,SAAS;IACxB,YAAY,EAAE,SAAS;IACvB,iBAAiB,EAAE,SAAS;CAC5B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAoB;IAC7D,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,aAAa,CAAC;IAC3C,OAAO,YAAY,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,kBAAkB,EAAE,GAAG;IACvB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,GAAG;IACvB,oBAAoB,EAAE,IAAI;IAC1B,oBAAoB,EAAE,IAAI;CACjB,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAAmC,EAAE,QAAQ,GAAG,IAAI;IAChG,MAAM,OAAO,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,MAAM,UAAU,GAAG,OAAO,GAAG,GAAG,CAAC;IACjC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,QAAQ,CAAC;IAClD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAA2E;IAChH,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACnC,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACpH,OAAO,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAA+D;IACnG,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC/B,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `'importing-main'` is the long HTTP-module-load phase (5–10s for a
|
|
3
|
+
* real Angular app). The bar uses this range so the user sees ~62
|
|
4
|
+
* percentage points of motion during the phase that actually takes
|
|
5
|
+
* time, sandwiched between the cheap bootstrap stages
|
|
6
|
+
* ('configuring-import-map' = 26) and the post-import wait
|
|
7
|
+
* ('waiting-for-app' = 94 → 'app-root-committed' = 100).
|
|
8
|
+
*/
|
|
9
|
+
export declare const BOOT_IMPORT_PROGRESS_MIN = 30;
|
|
10
|
+
export declare const BOOT_IMPORT_PROGRESS_MAX = 92;
|
|
11
|
+
/** Ceiling guards against rounding into `'waiting-for-app'` (94). */
|
|
12
|
+
export declare const BOOT_IMPORT_PROGRESS_CEILING = 94;
|
|
13
|
+
export declare function computeBootImportProgress(input: {
|
|
14
|
+
count?: number;
|
|
15
|
+
elapsedMs?: number;
|
|
16
|
+
}): number;
|
|
17
|
+
/**
|
|
18
|
+
* Render the second-line detail for the placeholder. Surfaces the
|
|
19
|
+
* count + last-loaded module path once the snippet has fired, or a
|
|
20
|
+
* generic "Loading the module graph…" line during the pre-snippet
|
|
21
|
+
* window.
|
|
22
|
+
*
|
|
23
|
+
* No elapsed-ms readout: the primary line's percentage is the progress
|
|
24
|
+
* signal, and the heartbeat's `elapsedMs` is wall-clock since the import
|
|
25
|
+
* started — not a per-module timing — so surfacing it next to the
|
|
26
|
+
* percentage read as a confusing, inaccurate duration.
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatBootImportDetail(input: {
|
|
29
|
+
count?: number;
|
|
30
|
+
lastModule?: string;
|
|
31
|
+
}): string;
|
|
32
|
+
/**
|
|
33
|
+
* Ratchet a candidate boot-import progress value against the highest
|
|
34
|
+
* value any consumer has emitted so far (stored on
|
|
35
|
+
* `globalThis.__NS_HMR_BOOT_LAST_PROGRESS__`). Reset by
|
|
36
|
+
* `clearBootProgressState` between sessions.
|
|
37
|
+
*/
|
|
38
|
+
export declare function applyMonotonicBootProgress(candidate: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* Reset every boot-progress global so a re-bootstrapped session (e.g.
|
|
41
|
+
* after `__reboot_ng_modules__`) starts a fresh ratchet rather than
|
|
42
|
+
* inheriting the previous cycle's terminal values.
|
|
43
|
+
*/
|
|
44
|
+
export declare function clearBootProgressState(): void;
|