@nativescript/vite 8.0.0-alpha.7 → 8.0.0-alpha.71
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 +54 -14
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +34 -1
- package/configuration/angular.js +293 -172
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +177 -110
- package/configuration/base.js.map +1 -1
- package/configuration/javascript.js +14 -93
- package/configuration/javascript.js.map +1 -1
- package/configuration/react.js +41 -73
- package/configuration/react.js.map +1 -1
- package/configuration/solid.js +51 -6
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +12 -93
- 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/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 +4 -1
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -12
- package/helpers/external-configs.js +58 -35
- 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 +101 -33
- package/helpers/global-defines.js +187 -64
- 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/init.js +6 -20
- package/helpers/init.js.map +1 -1
- package/helpers/logging.js +29 -1
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +4 -1
- package/helpers/main-entry.js +366 -47
- 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 +37 -7
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
- package/helpers/nativeclass-transformer-plugin.js +163 -15
- 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 +26 -3
- package/helpers/ns-core-url.js +66 -8
- package/helpers/ns-core-url.js.map +1 -1
- 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 +324 -13
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +63 -32
- 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 +0 -14
- package/hmr/client/hmr-pending-overlay.js +2 -11
- package/hmr/client/hmr-pending-overlay.js.map +1 -1
- 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 +70 -1970
- 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 +83 -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 +9 -1
- package/hmr/client/utils.js +117 -97
- 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 +2 -1
- package/hmr/entry-runtime.js +282 -71
- 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/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
- 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/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
- 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.js +88 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
- 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 +0 -1
- package/hmr/frameworks/angular/client/index.js +459 -223
- 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 +1 -4
- 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 +677 -13
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
- package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +28 -11
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.js +191 -105
- 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 +40 -14
- 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 +109 -14
- 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.js +20 -5
- 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 +86 -7
- package/hmr/server/core-sanitize.js +164 -39
- 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 +51 -19
- package/hmr/server/import-map.js +136 -66
- package/hmr/server/import-map.js.map +1 -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.js +1 -1
- package/hmr/server/ns-core-cjs-shape.js.map +1 -1
- 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 +1 -1
- package/hmr/server/perf-instrumentation.js +3 -1
- package/hmr/server/perf-instrumentation.js.map +1 -1
- 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.js +8 -1
- package/hmr/server/runtime-graph-filter.js.map +1 -1
- 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.js +1 -2
- package/hmr/server/shared-transform-request.js.map +1 -1
- 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 +1 -0
- package/hmr/server/vite-plugin.js +227 -53
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +51 -4
- package/hmr/server/websocket-core-bridge.js +62 -49
- package/hmr/server/websocket-core-bridge.js.map +1 -1
- 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-hmr-pending.d.ts +2 -16
- package/hmr/server/websocket-hmr-pending.js +0 -22
- package/hmr/server/websocket-hmr-pending.js.map +1 -1
- 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 +15 -0
- package/hmr/server/websocket-module-bindings.js +38 -5
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +66 -7
- package/hmr/server/websocket-module-specifiers.js +219 -49
- package/hmr/server/websocket-module-specifiers.js.map +1 -1
- 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 +164 -0
- package/hmr/server/websocket-ns-entry.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +19 -3
- package/hmr/server/websocket-ns-m-paths.js +98 -75
- package/hmr/server/websocket-ns-m-paths.js.map +1 -1
- package/hmr/server/websocket-ns-m-request.d.ts +13 -2
- package/hmr/server/websocket-ns-m-request.js +20 -11
- package/hmr/server/websocket-ns-m-request.js.map +1 -1
- 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 +57 -4
- package/hmr/server/websocket-served-module-helpers.js +462 -141
- package/hmr/server/websocket-served-module-helpers.js.map +1 -1
- package/hmr/server/websocket-txn.js +6 -9
- package/hmr/server/websocket-txn.js.map +1 -1
- package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
- package/hmr/server/websocket-vendor-unifier.js +4 -9
- package/hmr/server/websocket-vendor-unifier.js.map +1 -1
- package/hmr/server/websocket.d.ts +7 -40
- package/hmr/server/websocket.js +653 -6734
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +106 -0
- package/hmr/shared/ns-globals.js +29 -0
- package/hmr/shared/ns-globals.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 +1 -1
- package/hmr/shared/runtime/boot-timeline.js +8 -19
- package/hmr/shared/runtime/boot-timeline.js.map +1 -1
- package/hmr/shared/runtime/browser-runtime-contract.d.ts +43 -24
- package/hmr/shared/runtime/browser-runtime-contract.js +21 -9
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
- 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 +23 -69
- package/hmr/shared/runtime/dev-overlay.js +67 -1023
- package/hmr/shared/runtime/dev-overlay.js.map +1 -1
- 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.js +4 -6
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- 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/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.js +401 -206
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +203 -58
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
- 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/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 -7
- package/hmr/shared/vendor/manifest.js +180 -826
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/hmr/shared/vendor/registry.d.ts +2 -0
- package/hmr/shared/vendor/registry.js +14 -0
- 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 +65 -13
- package/runtime/core-aliases-early.js +28 -57
- 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/helpers/angular/angular-linker.d.ts +0 -13
- package/helpers/angular/angular-linker.js +0 -194
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
- package/helpers/angular/shared-linker.d.ts +0 -11
- package/helpers/angular/shared-linker.js +0 -75
- package/helpers/angular/shared-linker.js.map +0 -1
- package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
- package/helpers/angular/synthesize-injectable-factories.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/server/websocket-angular-entry.js.map +0 -1
- package/hmr/server/websocket-angular-hot-update.js.map +0 -1
- package/hmr/server/websocket-ns-m-finalize.d.ts +0 -22
- package/hmr/server/websocket-ns-m-finalize.js +0 -88
- package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
- package/hmr/server/websocket-runtime-compat.d.ts +0 -19
- package/hmr/server/websocket-runtime-compat.js +0 -287
- package/hmr/server/websocket-runtime-compat.js.map +0 -1
- package/hmr/server/websocket-vue-sfc.d.ts +0 -27
- package/hmr/server/websocket-vue-sfc.js +0 -1114
- package/hmr/server/websocket-vue-sfc.js.map +0 -1
- package/hmr/shared/runtime/http-only-boot.d.ts +0 -2
- package/hmr/shared/runtime/http-only-boot.js +0 -171
- 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
- /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
- /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
|
@@ -1,1029 +1,38 @@
|
|
|
1
|
-
const BOOT_TITLE = 'NativeScript Vite preparing dev session...';
|
|
2
|
-
const DEFAULT_SNAPSHOT = {
|
|
3
|
-
visible: false,
|
|
4
|
-
mode: 'hidden',
|
|
5
|
-
badge: 'HMR',
|
|
6
|
-
title: BOOT_TITLE,
|
|
7
|
-
phase: '',
|
|
8
|
-
detail: '',
|
|
9
|
-
progress: null,
|
|
10
|
-
busy: false,
|
|
11
|
-
blocking: false,
|
|
12
|
-
tone: 'info',
|
|
13
|
-
};
|
|
14
|
-
function getOverlayGlobal() {
|
|
15
|
-
return globalThis;
|
|
16
|
-
}
|
|
17
|
-
function getRuntimeState() {
|
|
18
|
-
const g = getOverlayGlobal();
|
|
19
|
-
if (!g.__NS_HMR_DEV_OVERLAY_STATE__) {
|
|
20
|
-
g.__NS_HMR_DEV_OVERLAY_STATE__ = {
|
|
21
|
-
snapshot: { ...DEFAULT_SNAPSHOT },
|
|
22
|
-
bootRefs: null,
|
|
23
|
-
liveRefs: null,
|
|
24
|
-
iosRefs: null,
|
|
25
|
-
iosBuildFailed: false,
|
|
26
|
-
verbose: false,
|
|
27
|
-
updateAutoHideTimer: null,
|
|
28
|
-
updateCycleStartedAt: 0,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
const state = g.__NS_HMR_DEV_OVERLAY_STATE__;
|
|
32
|
-
// Backfill newer fields for legacy state objects (e.g. after hot reload)
|
|
33
|
-
// so we never observe an undefined iosRefs/iosBuildFailed at runtime.
|
|
34
|
-
if (typeof state.iosRefs === 'undefined')
|
|
35
|
-
state.iosRefs = null;
|
|
36
|
-
if (typeof state.iosBuildFailed === 'undefined')
|
|
37
|
-
state.iosBuildFailed = false;
|
|
38
|
-
if (typeof state.updateAutoHideTimer === 'undefined')
|
|
39
|
-
state.updateAutoHideTimer = null;
|
|
40
|
-
if (typeof state.updateCycleStartedAt !== 'number')
|
|
41
|
-
state.updateCycleStartedAt = 0;
|
|
42
|
-
return state;
|
|
43
|
-
}
|
|
44
|
-
function describeAttempt(info) {
|
|
45
|
-
const attempt = Number(info?.attempt || 0);
|
|
46
|
-
const attempts = Number(info?.attempts || 0);
|
|
47
|
-
if (!attempt || !attempts) {
|
|
48
|
-
return '';
|
|
49
|
-
}
|
|
50
|
-
return `Attempt ${attempt}/${attempts}`;
|
|
51
|
-
}
|
|
52
|
-
export function createBootOverlaySnapshot(stage, info) {
|
|
53
|
-
const attemptText = describeAttempt(info);
|
|
54
|
-
const phaseInfo = {
|
|
55
|
-
placeholder: {
|
|
56
|
-
visible: true,
|
|
57
|
-
mode: 'boot',
|
|
58
|
-
badge: 'BOOT',
|
|
59
|
-
title: BOOT_TITLE,
|
|
60
|
-
phase: 'Preparing the HTTP HMR bootstrap',
|
|
61
|
-
progress: 4,
|
|
62
|
-
busy: true,
|
|
63
|
-
blocking: true,
|
|
64
|
-
tone: 'info',
|
|
65
|
-
},
|
|
66
|
-
'probing-origin': {
|
|
67
|
-
visible: true,
|
|
68
|
-
mode: 'boot',
|
|
69
|
-
badge: 'BOOT',
|
|
70
|
-
title: BOOT_TITLE,
|
|
71
|
-
phase: 'Contacting the Vite dev server',
|
|
72
|
-
progress: 8,
|
|
73
|
-
busy: true,
|
|
74
|
-
blocking: true,
|
|
75
|
-
tone: 'info',
|
|
76
|
-
},
|
|
77
|
-
'loading-entry-runtime': {
|
|
78
|
-
visible: true,
|
|
79
|
-
mode: 'boot',
|
|
80
|
-
badge: 'BOOT',
|
|
81
|
-
title: BOOT_TITLE,
|
|
82
|
-
phase: 'Loading the entry runtime bridge',
|
|
83
|
-
progress: 16,
|
|
84
|
-
busy: true,
|
|
85
|
-
blocking: true,
|
|
86
|
-
tone: 'info',
|
|
87
|
-
},
|
|
88
|
-
'configuring-import-map': {
|
|
89
|
-
visible: true,
|
|
90
|
-
mode: 'boot',
|
|
91
|
-
badge: 'BOOT',
|
|
92
|
-
title: BOOT_TITLE,
|
|
93
|
-
phase: 'Configuring the import map',
|
|
94
|
-
progress: 26,
|
|
95
|
-
busy: true,
|
|
96
|
-
blocking: true,
|
|
97
|
-
tone: 'info',
|
|
98
|
-
},
|
|
99
|
-
'loading-runtime-bridge': {
|
|
100
|
-
visible: true,
|
|
101
|
-
mode: 'boot',
|
|
102
|
-
badge: 'BOOT',
|
|
103
|
-
title: BOOT_TITLE,
|
|
104
|
-
phase: 'Loading the NativeScript runtime bridge',
|
|
105
|
-
progress: 40,
|
|
106
|
-
busy: true,
|
|
107
|
-
blocking: true,
|
|
108
|
-
tone: 'info',
|
|
109
|
-
},
|
|
110
|
-
'loading-core-bridge': {
|
|
111
|
-
visible: true,
|
|
112
|
-
mode: 'boot',
|
|
113
|
-
badge: 'BOOT',
|
|
114
|
-
title: BOOT_TITLE,
|
|
115
|
-
phase: 'Loading the unified core bridge',
|
|
116
|
-
progress: 54,
|
|
117
|
-
busy: true,
|
|
118
|
-
blocking: true,
|
|
119
|
-
tone: 'info',
|
|
120
|
-
},
|
|
121
|
-
'preloading-style-scope': {
|
|
122
|
-
visible: true,
|
|
123
|
-
mode: 'boot',
|
|
124
|
-
badge: 'BOOT',
|
|
125
|
-
title: BOOT_TITLE,
|
|
126
|
-
phase: 'Preparing the shared style scope',
|
|
127
|
-
progress: 62,
|
|
128
|
-
busy: true,
|
|
129
|
-
blocking: true,
|
|
130
|
-
tone: 'info',
|
|
131
|
-
},
|
|
132
|
-
'installing-css': {
|
|
133
|
-
visible: true,
|
|
134
|
-
mode: 'boot',
|
|
135
|
-
badge: 'BOOT',
|
|
136
|
-
title: BOOT_TITLE,
|
|
137
|
-
phase: 'Applying the app stylesheet',
|
|
138
|
-
progress: 70,
|
|
139
|
-
busy: true,
|
|
140
|
-
blocking: true,
|
|
141
|
-
tone: 'info',
|
|
142
|
-
},
|
|
143
|
-
'importing-main': {
|
|
144
|
-
visible: true,
|
|
145
|
-
mode: 'boot',
|
|
146
|
-
badge: 'BOOT',
|
|
147
|
-
title: BOOT_TITLE,
|
|
148
|
-
phase: 'Importing the app entry',
|
|
149
|
-
progress: 82,
|
|
150
|
-
busy: true,
|
|
151
|
-
blocking: true,
|
|
152
|
-
tone: 'info',
|
|
153
|
-
},
|
|
154
|
-
'waiting-for-app': {
|
|
155
|
-
visible: true,
|
|
156
|
-
mode: 'boot',
|
|
157
|
-
badge: 'BOOT',
|
|
158
|
-
title: BOOT_TITLE,
|
|
159
|
-
phase: 'Waiting for the app root view',
|
|
160
|
-
progress: 94,
|
|
161
|
-
busy: true,
|
|
162
|
-
blocking: true,
|
|
163
|
-
tone: 'info',
|
|
164
|
-
},
|
|
165
|
-
'app-root-committed': {
|
|
166
|
-
visible: true,
|
|
167
|
-
mode: 'boot',
|
|
168
|
-
badge: 'READY',
|
|
169
|
-
title: BOOT_TITLE,
|
|
170
|
-
phase: 'Real app root committed',
|
|
171
|
-
progress: 100,
|
|
172
|
-
busy: false,
|
|
173
|
-
blocking: true,
|
|
174
|
-
tone: 'info',
|
|
175
|
-
},
|
|
176
|
-
ready: {
|
|
177
|
-
visible: true,
|
|
178
|
-
mode: 'boot',
|
|
179
|
-
badge: 'READY',
|
|
180
|
-
title: BOOT_TITLE,
|
|
181
|
-
phase: 'Boot complete',
|
|
182
|
-
progress: 100,
|
|
183
|
-
busy: false,
|
|
184
|
-
blocking: true,
|
|
185
|
-
tone: 'info',
|
|
186
|
-
},
|
|
187
|
-
error: {
|
|
188
|
-
visible: true,
|
|
189
|
-
mode: 'boot',
|
|
190
|
-
badge: 'RETRY',
|
|
191
|
-
title: BOOT_TITLE,
|
|
192
|
-
phase: 'Retrying after a boot failure',
|
|
193
|
-
progress: null,
|
|
194
|
-
busy: true,
|
|
195
|
-
blocking: true,
|
|
196
|
-
tone: 'error',
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
const base = phaseInfo[stage];
|
|
200
|
-
let detail = info?.detail || '';
|
|
201
|
-
if (!detail && stage === 'probing-origin' && info?.origin) {
|
|
202
|
-
detail = `Trying ${info.origin}`;
|
|
203
|
-
}
|
|
204
|
-
if (attemptText) {
|
|
205
|
-
detail = detail ? `${detail} ${attemptText}` : attemptText;
|
|
206
|
-
}
|
|
207
|
-
return {
|
|
208
|
-
...base,
|
|
209
|
-
detail,
|
|
210
|
-
progress: typeof info?.progress === 'number' || info?.progress === null ? info.progress : base.progress,
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
export function createConnectionOverlaySnapshot(stage, info) {
|
|
214
|
-
if (stage === 'healthy') {
|
|
215
|
-
return { ...DEFAULT_SNAPSHOT };
|
|
216
|
-
}
|
|
217
|
-
const phaseInfo = {
|
|
218
|
-
connecting: {
|
|
219
|
-
visible: true,
|
|
220
|
-
mode: 'connection',
|
|
221
|
-
badge: 'SOCKET',
|
|
222
|
-
title: 'Waiting for Vite dev server',
|
|
223
|
-
phase: 'Opening websocket connection',
|
|
224
|
-
detail: 'Live updates are paused until the connection is healthy.',
|
|
225
|
-
progress: null,
|
|
226
|
-
busy: true,
|
|
227
|
-
blocking: false,
|
|
228
|
-
tone: 'warn',
|
|
229
|
-
},
|
|
230
|
-
reconnecting: {
|
|
231
|
-
visible: true,
|
|
232
|
-
mode: 'connection',
|
|
233
|
-
badge: 'SOCKET',
|
|
234
|
-
title: 'HMR connection lost',
|
|
235
|
-
phase: 'Reconnecting Vite websocket',
|
|
236
|
-
detail: 'The app may be stale until the dev server reconnects.',
|
|
237
|
-
progress: null,
|
|
238
|
-
busy: true,
|
|
239
|
-
blocking: false,
|
|
240
|
-
tone: 'warn',
|
|
241
|
-
},
|
|
242
|
-
synchronizing: {
|
|
243
|
-
visible: true,
|
|
244
|
-
mode: 'connection',
|
|
245
|
-
badge: 'SYNC',
|
|
246
|
-
title: 'HMR connection restored',
|
|
247
|
-
phase: 'Synchronizing live-update state',
|
|
248
|
-
detail: 'Finalizing the module graph before dismissing the overlay.',
|
|
249
|
-
progress: 95,
|
|
250
|
-
busy: true,
|
|
251
|
-
blocking: false,
|
|
252
|
-
tone: 'info',
|
|
253
|
-
},
|
|
254
|
-
offline: {
|
|
255
|
-
visible: true,
|
|
256
|
-
mode: 'connection',
|
|
257
|
-
badge: 'OFFLINE',
|
|
258
|
-
title: 'Vite dev server offline',
|
|
259
|
-
phase: 'Please check your terminal.',
|
|
260
|
-
detail: 'The websocket and HTTP HMR path are both unavailable right now.',
|
|
261
|
-
progress: null,
|
|
262
|
-
busy: true,
|
|
263
|
-
blocking: false,
|
|
264
|
-
tone: 'error',
|
|
265
|
-
},
|
|
266
|
-
};
|
|
267
|
-
const base = phaseInfo[stage];
|
|
268
|
-
return {
|
|
269
|
-
...base,
|
|
270
|
-
detail: info?.detail || base.detail,
|
|
271
|
-
progress: typeof info?.progress === 'number' || info?.progress === null ? info.progress : base.progress,
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
// Snapshot factory for the HMR-applying overlay. Each stage owns a
|
|
275
|
-
// fixed phase string, badge, and progress %. We pick the percentages
|
|
276
|
-
// so users see continuous forward motion: the cheap stages (mutex
|
|
277
|
-
// acquire, eviction call) advance fast; the long tail (entry
|
|
278
|
-
// re-import + Angular reboot) sits at 60→90 so the bar keeps moving
|
|
279
|
-
// even when the V8 ESM walk dominates wall time.
|
|
280
|
-
//
|
|
281
|
-
// The 'complete' stage holds for a brief moment (the API auto-hides
|
|
282
|
-
// it via setUpdateStage) so the user gets visual closure ("the update
|
|
283
|
-
// landed") without staring at a frozen overlay; tone stays 'success'
|
|
284
|
-
// throughout so the colour scheme never flickers between phases.
|
|
285
|
-
const HMR_UPDATE_TITLE = 'HMR update applying...';
|
|
286
|
-
const HMR_UPDATE_DONE_TITLE = 'HMR update applied';
|
|
287
|
-
export function createUpdateOverlaySnapshot(stage, info) {
|
|
288
|
-
const phaseInfo = {
|
|
289
|
-
received: {
|
|
290
|
-
visible: true,
|
|
291
|
-
mode: 'update',
|
|
292
|
-
badge: 'HMR',
|
|
293
|
-
title: HMR_UPDATE_TITLE,
|
|
294
|
-
phase: 'Preparing update',
|
|
295
|
-
detail: '',
|
|
296
|
-
progress: 5,
|
|
297
|
-
busy: true,
|
|
298
|
-
blocking: false,
|
|
299
|
-
tone: 'success',
|
|
300
|
-
},
|
|
301
|
-
evicting: {
|
|
302
|
-
visible: true,
|
|
303
|
-
mode: 'update',
|
|
304
|
-
badge: 'HMR',
|
|
305
|
-
title: HMR_UPDATE_TITLE,
|
|
306
|
-
phase: 'Invalidating module cache',
|
|
307
|
-
detail: '',
|
|
308
|
-
progress: 30,
|
|
309
|
-
busy: true,
|
|
310
|
-
blocking: false,
|
|
311
|
-
tone: 'success',
|
|
312
|
-
},
|
|
313
|
-
reimporting: {
|
|
314
|
-
visible: true,
|
|
315
|
-
mode: 'update',
|
|
316
|
-
badge: 'HMR',
|
|
317
|
-
title: HMR_UPDATE_TITLE,
|
|
318
|
-
phase: 'Re-importing entry',
|
|
319
|
-
detail: '',
|
|
320
|
-
progress: 60,
|
|
321
|
-
busy: true,
|
|
322
|
-
blocking: false,
|
|
323
|
-
tone: 'success',
|
|
324
|
-
},
|
|
325
|
-
rebooting: {
|
|
326
|
-
visible: true,
|
|
327
|
-
mode: 'update',
|
|
328
|
-
badge: 'HMR',
|
|
329
|
-
title: HMR_UPDATE_TITLE,
|
|
330
|
-
phase: 'Rebooting Angular',
|
|
331
|
-
detail: '',
|
|
332
|
-
progress: 90,
|
|
333
|
-
busy: true,
|
|
334
|
-
blocking: false,
|
|
335
|
-
tone: 'success',
|
|
336
|
-
},
|
|
337
|
-
complete: {
|
|
338
|
-
visible: true,
|
|
339
|
-
mode: 'update',
|
|
340
|
-
badge: 'HMR',
|
|
341
|
-
title: HMR_UPDATE_DONE_TITLE,
|
|
342
|
-
phase: 'Update applied',
|
|
343
|
-
detail: '',
|
|
344
|
-
progress: 100,
|
|
345
|
-
busy: false,
|
|
346
|
-
blocking: false,
|
|
347
|
-
tone: 'success',
|
|
348
|
-
},
|
|
349
|
-
};
|
|
350
|
-
const base = phaseInfo[stage];
|
|
351
|
-
return {
|
|
352
|
-
...base,
|
|
353
|
-
detail: info?.detail || base.detail,
|
|
354
|
-
progress: typeof info?.progress === 'number' || info?.progress === null ? info.progress : base.progress,
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
function resolveCoreExport(name) {
|
|
358
|
-
const g = getOverlayGlobal();
|
|
359
|
-
try {
|
|
360
|
-
const reg = g.__nsVendorRegistry;
|
|
361
|
-
if (reg && typeof reg.get === 'function') {
|
|
362
|
-
const mod = reg.get('@nativescript/core');
|
|
363
|
-
const ns = (mod && (mod.default ?? mod)) || mod;
|
|
364
|
-
if (ns && ns[name]) {
|
|
365
|
-
return ns[name];
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
catch { }
|
|
370
|
-
try {
|
|
371
|
-
if (g && g[name]) {
|
|
372
|
-
return g[name];
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
catch { }
|
|
376
|
-
try {
|
|
377
|
-
const req = g.__nsVendorRequire || g.__nsRequire || g.require;
|
|
378
|
-
if (typeof req === 'function') {
|
|
379
|
-
const mod = req('@nativescript/core');
|
|
380
|
-
const ns = (mod && (mod.default ?? mod)) || mod;
|
|
381
|
-
if (ns && ns[name]) {
|
|
382
|
-
return ns[name];
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
catch { }
|
|
387
|
-
try {
|
|
388
|
-
const nativeReq = g.__nativeRequire;
|
|
389
|
-
if (typeof nativeReq === 'function') {
|
|
390
|
-
const mod = nativeReq('@nativescript/core', '/');
|
|
391
|
-
const ns = (mod && (mod.default ?? mod)) || mod;
|
|
392
|
-
if (ns && ns[name]) {
|
|
393
|
-
return ns[name];
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
catch { }
|
|
398
|
-
return undefined;
|
|
399
|
-
}
|
|
400
|
-
function asColor(value) {
|
|
401
|
-
try {
|
|
402
|
-
const Color = resolveCoreExport('Color');
|
|
403
|
-
if (Color) {
|
|
404
|
-
return new Color(value);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
catch { }
|
|
408
|
-
return value;
|
|
409
|
-
}
|
|
410
|
-
function formatStatusText(snapshot) {
|
|
411
|
-
const progressText = typeof snapshot.progress === 'number' ? ` (${Math.round(Number(snapshot.progress))}%)` : '';
|
|
412
|
-
const primary = `${snapshot.phase || ''}${progressText}`.trim();
|
|
413
|
-
return [primary, snapshot.detail].filter(Boolean).join('\n');
|
|
414
|
-
}
|
|
415
|
-
function buildBootOverlayRefs(snapshot) {
|
|
416
|
-
const Page = resolveCoreExport('Page');
|
|
417
|
-
const StackLayout = resolveCoreExport('StackLayout');
|
|
418
|
-
const Label = resolveCoreExport('Label');
|
|
419
|
-
const ActivityIndicator = resolveCoreExport('ActivityIndicator');
|
|
420
|
-
if (!Page || !StackLayout || !Label) {
|
|
421
|
-
return null;
|
|
422
|
-
}
|
|
423
|
-
const page = new Page();
|
|
424
|
-
page.actionBarHidden = true;
|
|
425
|
-
const root = new StackLayout();
|
|
426
|
-
root.padding = 24;
|
|
427
|
-
root.verticalAlignment = 'middle';
|
|
428
|
-
root.horizontalAlignment = 'stretch';
|
|
429
|
-
const titleLabel = new Label();
|
|
430
|
-
titleLabel.text = BOOT_TITLE;
|
|
431
|
-
titleLabel.textAlignment = 'center';
|
|
432
|
-
titleLabel.textWrap = true;
|
|
433
|
-
titleLabel.fontSize = 22;
|
|
434
|
-
titleLabel.fontWeight = '600';
|
|
435
|
-
const statusLabel = new Label();
|
|
436
|
-
statusLabel.textAlignment = 'center';
|
|
437
|
-
statusLabel.textWrap = true;
|
|
438
|
-
statusLabel.fontSize = 14;
|
|
439
|
-
statusLabel.marginTop = 12;
|
|
440
|
-
const activityIndicator = ActivityIndicator
|
|
441
|
-
? (() => {
|
|
442
|
-
const indicator = new ActivityIndicator();
|
|
443
|
-
indicator.marginTop = 16;
|
|
444
|
-
indicator.width = 28;
|
|
445
|
-
indicator.height = 28;
|
|
446
|
-
indicator.horizontalAlignment = 'center';
|
|
447
|
-
return indicator;
|
|
448
|
-
})()
|
|
449
|
-
: null;
|
|
450
|
-
root.addChild(titleLabel);
|
|
451
|
-
root.addChild(statusLabel);
|
|
452
|
-
if (activityIndicator) {
|
|
453
|
-
root.addChild(activityIndicator);
|
|
454
|
-
}
|
|
455
|
-
page.content = root;
|
|
456
|
-
const refs = {
|
|
457
|
-
page,
|
|
458
|
-
root,
|
|
459
|
-
titleLabel,
|
|
460
|
-
statusLabel,
|
|
461
|
-
activityIndicator,
|
|
462
|
-
};
|
|
463
|
-
applySnapshotToBootRefs(refs, snapshot);
|
|
464
|
-
return refs;
|
|
465
|
-
}
|
|
466
|
-
function applySnapshotToBootRefs(refs, snapshot) {
|
|
467
|
-
if (!refs) {
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
refs.page.actionBarHidden = true;
|
|
471
|
-
refs.page.backgroundColor = asColor(snapshot.tone === 'error' ? '#b4181068' : '#a1771683');
|
|
472
|
-
refs.root.visibility = snapshot.visible && snapshot.mode === 'boot' ? 'visible' : 'collapse';
|
|
473
|
-
refs.titleLabel.text = BOOT_TITLE;
|
|
474
|
-
refs.titleLabel.color = asColor(snapshot.tone === 'error' ? '#b41810e6' : '#563e3fb1');
|
|
475
|
-
refs.statusLabel.text = formatStatusText(snapshot) || 'Preparing the HTTP HMR bootstrap (4%)';
|
|
476
|
-
refs.statusLabel.color = asColor(snapshot.tone === 'error' ? '#b41810e6' : '#563e3fb1');
|
|
477
|
-
if (refs.activityIndicator) {
|
|
478
|
-
refs.activityIndicator.busy = !!snapshot.busy;
|
|
479
|
-
refs.activityIndicator.visibility = snapshot.visible && snapshot.mode === 'boot' && snapshot.busy ? 'visible' : 'collapse';
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
function findBootActivityIndicator() {
|
|
483
|
-
const g = getOverlayGlobal();
|
|
484
|
-
if (g.__NS_DEV_BOOT_ACTIVITY_INDICATOR__) {
|
|
485
|
-
return g.__NS_DEV_BOOT_ACTIVITY_INDICATOR__;
|
|
486
|
-
}
|
|
487
|
-
try {
|
|
488
|
-
const frame = g.__NS_DEV_PLACEHOLDER_ROOT_VIEW__;
|
|
489
|
-
if (!frame)
|
|
490
|
-
return null;
|
|
491
|
-
const page = frame.currentPage || frame._currentEntry?.resolvedPage;
|
|
492
|
-
const content = page?.content;
|
|
493
|
-
const children = content?.getChildrenCount?.() || 0;
|
|
494
|
-
if (children >= 3) {
|
|
495
|
-
const indicator = content.getChildAt?.(2);
|
|
496
|
-
if (indicator && typeof indicator.busy !== 'undefined') {
|
|
497
|
-
g.__NS_DEV_BOOT_ACTIVITY_INDICATOR__ = indicator;
|
|
498
|
-
return indicator;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
catch { }
|
|
503
|
-
return null;
|
|
504
|
-
}
|
|
505
|
-
function findBootStatusLabel() {
|
|
506
|
-
const g = getOverlayGlobal();
|
|
507
|
-
// Try direct reference first
|
|
508
|
-
if (g.__NS_DEV_BOOT_STATUS_LABEL__) {
|
|
509
|
-
return g.__NS_DEV_BOOT_STATUS_LABEL__;
|
|
510
|
-
}
|
|
511
|
-
// Fallback: walk from placeholder root view
|
|
512
|
-
try {
|
|
513
|
-
const frame = g.__NS_DEV_PLACEHOLDER_ROOT_VIEW__;
|
|
514
|
-
if (!frame)
|
|
515
|
-
return null;
|
|
516
|
-
const page = frame.currentPage || frame._currentEntry?.resolvedPage;
|
|
517
|
-
if (!page)
|
|
518
|
-
return null;
|
|
519
|
-
const content = page.content;
|
|
520
|
-
if (!content)
|
|
521
|
-
return null;
|
|
522
|
-
// StackLayout with children: titleLabel, statusLabel
|
|
523
|
-
const children = content.getChildrenCount?.() || 0;
|
|
524
|
-
if (children >= 2) {
|
|
525
|
-
const label = content.getChildAt?.(1);
|
|
526
|
-
if (label && typeof label.text !== 'undefined') {
|
|
527
|
-
// Cache for next time
|
|
528
|
-
g.__NS_DEV_BOOT_STATUS_LABEL__ = label;
|
|
529
|
-
return label;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
catch { }
|
|
534
|
-
return null;
|
|
535
|
-
}
|
|
536
|
-
function updateBootStatusLabel(snapshot) {
|
|
537
|
-
const newText = formatStatusText(snapshot) || 'Preparing the HTTP HMR bootstrap (4%)';
|
|
538
|
-
const statusLabel = findBootStatusLabel();
|
|
539
|
-
const activityIndicator = findBootActivityIndicator();
|
|
540
|
-
if (!statusLabel) {
|
|
541
|
-
if (activityIndicator) {
|
|
542
|
-
try {
|
|
543
|
-
activityIndicator.busy = !!snapshot.busy;
|
|
544
|
-
activityIndicator.visibility = snapshot.visible && snapshot.mode === 'boot' && snapshot.busy ? 'visible' : 'collapse';
|
|
545
|
-
}
|
|
546
|
-
catch { }
|
|
547
|
-
}
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
try {
|
|
551
|
-
statusLabel.text = newText;
|
|
552
|
-
statusLabel.color = asColor(snapshot.tone === 'error' ? '#b41810e6' : '#563e3fb1');
|
|
553
|
-
if (typeof statusLabel.requestLayout === 'function') {
|
|
554
|
-
statusLabel.requestLayout();
|
|
555
|
-
}
|
|
556
|
-
const parent = statusLabel.parent;
|
|
557
|
-
if (parent && typeof parent.requestLayout === 'function') {
|
|
558
|
-
parent.requestLayout();
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
catch { }
|
|
562
|
-
if (activityIndicator) {
|
|
563
|
-
try {
|
|
564
|
-
activityIndicator.busy = !!snapshot.busy;
|
|
565
|
-
activityIndicator.visibility = snapshot.visible && snapshot.mode === 'boot' && snapshot.busy ? 'visible' : 'collapse';
|
|
566
|
-
}
|
|
567
|
-
catch { }
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
function resolveActivePage() {
|
|
571
|
-
try {
|
|
572
|
-
const Frame = resolveCoreExport('Frame');
|
|
573
|
-
const frame = Frame?.topmost?.() || null;
|
|
574
|
-
const currentPage = frame?.currentPage || frame?._currentEntry?.resolvedPage || null;
|
|
575
|
-
if (currentPage) {
|
|
576
|
-
return currentPage;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
catch { }
|
|
580
|
-
try {
|
|
581
|
-
const Application = resolveCoreExport('Application');
|
|
582
|
-
const rootView = Application?.getRootView?.() || null;
|
|
583
|
-
if (rootView?.currentPage) {
|
|
584
|
-
return rootView.currentPage;
|
|
585
|
-
}
|
|
586
|
-
if (typeof rootView?.content !== 'undefined') {
|
|
587
|
-
return rootView;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
catch { }
|
|
591
|
-
return null;
|
|
592
|
-
}
|
|
593
|
-
function buildLiveOverlayView(snapshot) {
|
|
594
|
-
const GridLayout = resolveCoreExport('GridLayout');
|
|
595
|
-
const StackLayout = resolveCoreExport('StackLayout');
|
|
596
|
-
const Label = resolveCoreExport('Label');
|
|
597
|
-
if (!GridLayout || !StackLayout || !Label) {
|
|
598
|
-
return null;
|
|
599
|
-
}
|
|
600
|
-
const overlay = new GridLayout();
|
|
601
|
-
overlay.visibility = 'collapse';
|
|
602
|
-
overlay.width = '100%';
|
|
603
|
-
overlay.height = '100%';
|
|
604
|
-
overlay.horizontalAlignment = 'stretch';
|
|
605
|
-
overlay.verticalAlignment = 'stretch';
|
|
606
|
-
const panel = new StackLayout();
|
|
607
|
-
panel.horizontalAlignment = 'center';
|
|
608
|
-
panel.verticalAlignment = 'middle';
|
|
609
|
-
panel.width = 320;
|
|
610
|
-
panel.margin = 24;
|
|
611
|
-
panel.padding = 16;
|
|
612
|
-
const titleLabel = new Label();
|
|
613
|
-
titleLabel.textAlignment = 'center';
|
|
614
|
-
titleLabel.textWrap = true;
|
|
615
|
-
titleLabel.fontSize = 18;
|
|
616
|
-
titleLabel.fontWeight = '600';
|
|
617
|
-
const statusLabel = new Label();
|
|
618
|
-
statusLabel.textAlignment = 'center';
|
|
619
|
-
statusLabel.textWrap = true;
|
|
620
|
-
statusLabel.fontSize = 13;
|
|
621
|
-
statusLabel.marginTop = 10;
|
|
622
|
-
panel.addChild(titleLabel);
|
|
623
|
-
panel.addChild(statusLabel);
|
|
624
|
-
overlay.addChild(panel);
|
|
625
|
-
const refs = {
|
|
626
|
-
overlay,
|
|
627
|
-
titleLabel,
|
|
628
|
-
statusLabel,
|
|
629
|
-
};
|
|
630
|
-
applySnapshotToLiveRefs(refs, snapshot);
|
|
631
|
-
return refs;
|
|
632
|
-
}
|
|
633
|
-
function ensureLiveOverlayRefs(snapshot) {
|
|
634
|
-
const state = getRuntimeState();
|
|
635
|
-
const page = resolveActivePage();
|
|
636
|
-
if (!page) {
|
|
637
|
-
return null;
|
|
638
|
-
}
|
|
639
|
-
if (state.liveRefs) {
|
|
640
|
-
if (state.liveRefs.page === page && state.liveRefs.overlay?.parent) {
|
|
641
|
-
return state.liveRefs;
|
|
642
|
-
}
|
|
643
|
-
try {
|
|
644
|
-
state.liveRefs.overlay.visibility = 'collapse';
|
|
645
|
-
}
|
|
646
|
-
catch { }
|
|
647
|
-
state.liveRefs = null;
|
|
648
|
-
}
|
|
649
|
-
const GridLayout = resolveCoreExport('GridLayout');
|
|
650
|
-
if (!GridLayout || typeof page.content === 'undefined') {
|
|
651
|
-
return null;
|
|
652
|
-
}
|
|
653
|
-
let wrapper = page.content;
|
|
654
|
-
if (!wrapper || !wrapper.__ns_hmr_overlay_wrapper__) {
|
|
655
|
-
const currentContent = page.content || null;
|
|
656
|
-
wrapper = new GridLayout();
|
|
657
|
-
wrapper.width = '100%';
|
|
658
|
-
wrapper.height = '100%';
|
|
659
|
-
wrapper.__ns_hmr_overlay_wrapper__ = true;
|
|
660
|
-
try {
|
|
661
|
-
page.content = null;
|
|
662
|
-
}
|
|
663
|
-
catch { }
|
|
664
|
-
if (currentContent) {
|
|
665
|
-
wrapper.addChild(currentContent);
|
|
666
|
-
}
|
|
667
|
-
page.content = wrapper;
|
|
668
|
-
}
|
|
669
|
-
const liveView = buildLiveOverlayView(snapshot);
|
|
670
|
-
if (!liveView) {
|
|
671
|
-
return null;
|
|
672
|
-
}
|
|
673
|
-
wrapper.addChild(liveView.overlay);
|
|
674
|
-
state.liveRefs = {
|
|
675
|
-
page,
|
|
676
|
-
wrapper,
|
|
677
|
-
...liveView,
|
|
678
|
-
};
|
|
679
|
-
return state.liveRefs;
|
|
680
|
-
}
|
|
681
|
-
function applySnapshotToLiveRefs(refs, snapshot) {
|
|
682
|
-
if (!refs) {
|
|
683
|
-
return;
|
|
684
|
-
}
|
|
685
|
-
// 'update' mode shares the live (in-tree) overlay chrome with
|
|
686
|
-
// 'connection'. Both render a centered panel inside the page;
|
|
687
|
-
// only the colours and text change with the snapshot's tone.
|
|
688
|
-
const visible = snapshot.visible && (snapshot.mode === 'connection' || snapshot.mode === 'update');
|
|
689
|
-
refs.overlay.visibility = visible ? 'visible' : 'collapse';
|
|
690
|
-
// Backdrop tints by tone:
|
|
691
|
-
// error → red wash (matches existing UX)
|
|
692
|
-
// success → richer green wash; the previous 18% alpha was so
|
|
693
|
-
// subtle on light app backgrounds that users couldn't
|
|
694
|
-
// tell the overlay had even fired. 50% alpha keeps the
|
|
695
|
-
// underlying app legible while making the apply event
|
|
696
|
-
// unmistakable during the (often <300ms) cycle.
|
|
697
|
-
// default → warm orange (existing connection-overlay look)
|
|
698
|
-
const overlayBg = snapshot.tone === 'error' ? '#b4181068' : snapshot.tone === 'success' ? '#1f883d80' : '#a1771683';
|
|
699
|
-
refs.overlay.backgroundColor = asColor(overlayBg);
|
|
700
|
-
refs.titleLabel.text = snapshot.title;
|
|
701
|
-
const textColor = snapshot.tone === 'error' ? '#b41810e6' : snapshot.tone === 'success' ? '#0e6e2fff' : '#563e3fb1';
|
|
702
|
-
refs.titleLabel.color = asColor(textColor);
|
|
703
|
-
refs.statusLabel.text = formatStatusText(snapshot);
|
|
704
|
-
refs.statusLabel.color = asColor(textColor);
|
|
705
|
-
try {
|
|
706
|
-
const panel = refs.titleLabel.parent;
|
|
707
|
-
if (panel) {
|
|
708
|
-
// Slightly richer green-tinted panel for HMR-apply so the
|
|
709
|
-
// title/status text reads at a glance against the brighter
|
|
710
|
-
// backdrop wash. White panel for connection/error keeps
|
|
711
|
-
// existing UX intact.
|
|
712
|
-
const panelBg = snapshot.tone === 'success' ? '#E6F8E9FF' : '#FFFFFFFF';
|
|
713
|
-
panel.backgroundColor = asColor(panelBg);
|
|
714
|
-
panel.opacity = 1;
|
|
715
|
-
panel.padding = 16;
|
|
716
|
-
try {
|
|
717
|
-
panel.borderRadius = 12;
|
|
718
|
-
}
|
|
719
|
-
catch { }
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
catch { }
|
|
723
|
-
}
|
|
724
|
-
// pure helpers for iOS window promotion. Factored out so the layout
|
|
725
|
-
// math and window-level selection stay unit-testable without booting a
|
|
726
|
-
// simulator. See `dev-overlay.spec.ts`.
|
|
727
1
|
/**
|
|
728
|
-
*
|
|
729
|
-
*
|
|
730
|
-
*
|
|
731
|
-
*
|
|
2
|
+
* Dev overlay public API: boot / connection / update stage setters plus the
|
|
3
|
+
* auto-hide timing policy. Rendering is delegated to two backends behind the
|
|
4
|
+
* shared snapshot/state model (`dev-overlay-shared.ts`):
|
|
5
|
+
*
|
|
6
|
+
* - `dev-overlay-ios.ts` — dedicated UIWindow above `UIWindowLevelAlert`, so
|
|
7
|
+
* the overlay stacks above modals/sheets/system alerts (preferred on iOS)
|
|
8
|
+
* - `dev-overlay-tree.ts` — boot placeholder + in-tree toast chip (Android,
|
|
9
|
+
* and the fallback when the iOS window can't be built)
|
|
732
10
|
*/
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
*/
|
|
745
|
-
export function computeIosOverlayLayout(input) {
|
|
746
|
-
const viewWidth = Math.max(0, Number(input.viewWidth) || 0);
|
|
747
|
-
const viewHeight = Math.max(0, Number(input.viewHeight) || 0);
|
|
748
|
-
const safeInsets = {
|
|
749
|
-
top: Math.max(0, Number(input.safeInsets?.top ?? 0) || 0),
|
|
750
|
-
bottom: Math.max(0, Number(input.safeInsets?.bottom ?? 0) || 0),
|
|
751
|
-
left: Math.max(0, Number(input.safeInsets?.left ?? 0) || 0),
|
|
752
|
-
right: Math.max(0, Number(input.safeInsets?.right ?? 0) || 0),
|
|
753
|
-
};
|
|
754
|
-
const titleHeight = Math.max(0, Number(input.titleHeight) || 0);
|
|
755
|
-
const statusHeight = Math.max(0, Number(input.statusHeight) || 0);
|
|
756
|
-
const horizontalMargin = Math.max(0, Number(input.horizontalMargin ?? 24));
|
|
757
|
-
const maxPanelWidth = Math.max(0, Number(input.maxPanelWidth ?? 340));
|
|
758
|
-
const panelPadding = Math.max(0, Number(input.panelPadding ?? 16));
|
|
759
|
-
const interLabelSpacing = Math.max(0, Number(input.interLabelSpacing ?? 10));
|
|
760
|
-
const minTopInset = Math.max(0, Number(input.minTopInset ?? 20));
|
|
761
|
-
const available = Math.max(0, viewWidth - 2 * horizontalMargin - safeInsets.left - safeInsets.right);
|
|
762
|
-
const panelWidth = Math.min(maxPanelWidth, available);
|
|
763
|
-
const innerWidth = Math.max(0, panelWidth - 2 * panelPadding);
|
|
764
|
-
const spacing = titleHeight > 0 && statusHeight > 0 ? interLabelSpacing : 0;
|
|
765
|
-
const panelHeight = panelPadding * 2 + titleHeight + spacing + statusHeight;
|
|
766
|
-
const panelX = Math.max(0, (viewWidth - panelWidth) / 2);
|
|
767
|
-
// Center vertically, but never cross the top safe-area inset (notch/Dynamic Island).
|
|
768
|
-
const centered = (viewHeight - panelHeight) / 2;
|
|
769
|
-
const panelY = Math.max(safeInsets.top + minTopInset, centered);
|
|
770
|
-
return {
|
|
771
|
-
backdrop: { x: 0, y: 0, width: viewWidth, height: viewHeight },
|
|
772
|
-
panel: { x: panelX, y: panelY, width: panelWidth, height: panelHeight },
|
|
773
|
-
title: { x: panelPadding, y: panelPadding, width: innerWidth, height: titleHeight },
|
|
774
|
-
status: {
|
|
775
|
-
x: panelPadding,
|
|
776
|
-
y: panelPadding + titleHeight + spacing,
|
|
777
|
-
width: innerWidth,
|
|
778
|
-
height: statusHeight,
|
|
779
|
-
},
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
/**
|
|
783
|
-
* Returns the iOS UIKit symbols we rely on if we're running on an iOS runtime
|
|
784
|
-
* with the metadata bridge available. Returns null on Android, web, or in
|
|
785
|
-
* tests so callers can gracefully fall back to the in-tree overlay.
|
|
786
|
-
*/
|
|
787
|
-
function getIosOverlayHost() {
|
|
788
|
-
const g = getOverlayGlobal();
|
|
789
|
-
if (typeof g.UIWindow === 'undefined' || typeof g.UIApplication === 'undefined' || typeof g.UIViewController === 'undefined' || typeof g.UIView === 'undefined' || typeof g.UILabel === 'undefined' || typeof g.UIColor === 'undefined' || typeof g.UIFont === 'undefined' || typeof g.UIScreen === 'undefined') {
|
|
790
|
-
return null;
|
|
791
|
-
}
|
|
792
|
-
return {
|
|
793
|
-
UIWindow: g.UIWindow,
|
|
794
|
-
UIViewController: g.UIViewController,
|
|
795
|
-
UIView: g.UIView,
|
|
796
|
-
UILabel: g.UILabel,
|
|
797
|
-
UIColor: g.UIColor,
|
|
798
|
-
UIFont: g.UIFont,
|
|
799
|
-
UIApplication: g.UIApplication,
|
|
800
|
-
UIScreen: g.UIScreen,
|
|
801
|
-
UIWindowLevelAlert: typeof g.UIWindowLevelAlert === 'number' ? g.UIWindowLevelAlert : undefined,
|
|
802
|
-
};
|
|
803
|
-
}
|
|
11
|
+
import { DEFAULT_SNAPSHOT, createBootOverlaySnapshot, createConnectionOverlaySnapshot, createUpdateOverlaySnapshot } from './dev-overlay-snapshots.js';
|
|
12
|
+
import { getHmrDevOverlayPosition, getOverlayGlobal, getRuntimeState } from './dev-overlay-shared.js';
|
|
13
|
+
import { applySnapshotToBootRefs, applySnapshotToLiveRefs, buildBootOverlayRefs, ensureLiveOverlayRefs, updateBootStatusLabel } from './dev-overlay-tree.js';
|
|
14
|
+
import { applySnapshotToIosRefs, ensureIosOverlayRefs, getIosOverlayHost } from './dev-overlay-ios.js';
|
|
15
|
+
import { resolveOverlayEnabled } from './overlay-flag.js';
|
|
16
|
+
// Re-export the snapshot model and backend pure helpers so existing
|
|
17
|
+
// `./dev-overlay.js` importers keep working.
|
|
18
|
+
export { createBootOverlaySnapshot, createConnectionOverlaySnapshot, createUpdateOverlaySnapshot } from './dev-overlay-snapshots.js';
|
|
19
|
+
export { getHmrDevOverlayPosition } from './dev-overlay-shared.js';
|
|
20
|
+
export { computeAndroidToastMargin } from './dev-overlay-tree.js';
|
|
21
|
+
export { computeIosOverlayLayout, computeIosOverlayWindowLevel } from './dev-overlay-ios.js';
|
|
804
22
|
/**
|
|
805
|
-
*
|
|
806
|
-
*
|
|
807
|
-
*
|
|
808
|
-
*
|
|
809
|
-
* (older iOS versions or non-UI environments).
|
|
23
|
+
* Imperative setter for the live-overlay position. Re-applies the
|
|
24
|
+
* current snapshot so the change is visible without waiting for the
|
|
25
|
+
* next HMR cycle. Useful during dev to A/B between top/bottom/center
|
|
26
|
+
* without restarting the app.
|
|
810
27
|
*/
|
|
811
|
-
function
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
const windows = app?.windows;
|
|
815
|
-
if (!windows || typeof windows.count !== 'number')
|
|
816
|
-
return null;
|
|
817
|
-
for (let i = 0; i < windows.count; i++) {
|
|
818
|
-
const w = windows.objectAtIndex(i);
|
|
819
|
-
const scene = w && w.windowScene;
|
|
820
|
-
if (scene)
|
|
821
|
-
return scene;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
catch { }
|
|
825
|
-
return null;
|
|
826
|
-
}
|
|
827
|
-
function buildIosOverlayRefs(state) {
|
|
828
|
-
const host = getIosOverlayHost();
|
|
829
|
-
if (!host)
|
|
830
|
-
return null;
|
|
831
|
-
// Without a scene we can't build a modern UIWindow that actually renders.
|
|
832
|
-
// Fall back to the in-tree overlay rather than show nothing.
|
|
833
|
-
const scene = findActiveWindowScene(host);
|
|
834
|
-
if (!scene) {
|
|
835
|
-
if (state.verbose) {
|
|
836
|
-
try {
|
|
837
|
-
console.info('[ns-hmr-overlay] no active UIWindowScene; skipping iOS overlay promotion');
|
|
838
|
-
}
|
|
839
|
-
catch { }
|
|
840
|
-
}
|
|
841
|
-
return null;
|
|
842
|
-
}
|
|
843
|
-
try {
|
|
844
|
-
const { UIWindow, UIViewController, UIView, UILabel, UIColor, UIFont } = host;
|
|
845
|
-
const window = UIWindow.alloc().initWithWindowScene(scene);
|
|
846
|
-
window.windowLevel = computeIosOverlayWindowLevel(host.UIWindowLevelAlert ?? null);
|
|
847
|
-
window.backgroundColor = UIColor.clearColor;
|
|
848
|
-
window.hidden = true;
|
|
849
|
-
const controller = UIViewController.new();
|
|
850
|
-
controller.view.backgroundColor = UIColor.clearColor;
|
|
851
|
-
window.rootViewController = controller;
|
|
852
|
-
// UIViewAutoresizing bit masks. We mirror the UIKit constants here to
|
|
853
|
-
// avoid depending on symbols the metadata bridge does not always
|
|
854
|
-
// expose as top-level globals.
|
|
855
|
-
const FLEXIBLE_LEFT_MARGIN = 1 << 0;
|
|
856
|
-
const FLEXIBLE_WIDTH = 1 << 1;
|
|
857
|
-
const FLEXIBLE_RIGHT_MARGIN = 1 << 2;
|
|
858
|
-
const FLEXIBLE_TOP_MARGIN = 1 << 3;
|
|
859
|
-
const FLEXIBLE_HEIGHT = 1 << 4;
|
|
860
|
-
const FLEXIBLE_BOTTOM_MARGIN = 1 << 5;
|
|
861
|
-
const backdrop = UIView.new();
|
|
862
|
-
backdrop.backgroundColor = UIColor.colorWithRedGreenBlueAlpha(0, 0, 0, 0.35);
|
|
863
|
-
backdrop.autoresizingMask = FLEXIBLE_WIDTH | FLEXIBLE_HEIGHT;
|
|
864
|
-
controller.view.addSubview(backdrop);
|
|
865
|
-
const panel = UIView.new();
|
|
866
|
-
panel.backgroundColor = UIColor.whiteColor;
|
|
867
|
-
panel.autoresizingMask = FLEXIBLE_LEFT_MARGIN | FLEXIBLE_RIGHT_MARGIN | FLEXIBLE_TOP_MARGIN | FLEXIBLE_BOTTOM_MARGIN;
|
|
868
|
-
try {
|
|
869
|
-
panel.layer.cornerRadius = 14;
|
|
870
|
-
panel.layer.masksToBounds = true;
|
|
871
|
-
}
|
|
872
|
-
catch { }
|
|
873
|
-
controller.view.addSubview(panel);
|
|
874
|
-
const titleLabel = UILabel.new();
|
|
875
|
-
titleLabel.numberOfLines = 0;
|
|
876
|
-
titleLabel.textAlignment = 1; // NSTextAlignmentCenter
|
|
877
|
-
titleLabel.font = UIFont.boldSystemFontOfSize(16);
|
|
878
|
-
titleLabel.textColor = UIColor.blackColor;
|
|
879
|
-
panel.addSubview(titleLabel);
|
|
880
|
-
const statusLabel = UILabel.new();
|
|
881
|
-
statusLabel.numberOfLines = 0;
|
|
882
|
-
statusLabel.textAlignment = 1;
|
|
883
|
-
statusLabel.font = UIFont.systemFontOfSize(13);
|
|
884
|
-
statusLabel.textColor = UIColor.darkGrayColor;
|
|
885
|
-
panel.addSubview(statusLabel);
|
|
886
|
-
return { window, controller, backdrop, panel, titleLabel, statusLabel };
|
|
887
|
-
}
|
|
888
|
-
catch (err) {
|
|
889
|
-
try {
|
|
890
|
-
console.warn('[ns-hmr-overlay] iOS overlay construction failed:', err?.message || err);
|
|
891
|
-
}
|
|
892
|
-
catch { }
|
|
893
|
-
return null;
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
function ensureIosOverlayRefs(state) {
|
|
897
|
-
if (state.iosRefs)
|
|
898
|
-
return state.iosRefs;
|
|
899
|
-
if (state.iosBuildFailed)
|
|
900
|
-
return null;
|
|
901
|
-
const built = buildIosOverlayRefs(state);
|
|
902
|
-
if (built) {
|
|
903
|
-
state.iosRefs = built;
|
|
904
|
-
}
|
|
905
|
-
else {
|
|
906
|
-
// Remember failure so we don't hammer construction on every snapshot
|
|
907
|
-
// update — the in-tree path will take over for this session.
|
|
908
|
-
state.iosBuildFailed = true;
|
|
909
|
-
}
|
|
910
|
-
return state.iosRefs;
|
|
911
|
-
}
|
|
912
|
-
function layoutIosOverlayRefs(refs) {
|
|
913
|
-
try {
|
|
914
|
-
const bounds = refs.controller.view.bounds;
|
|
915
|
-
const viewWidth = Number(bounds?.size?.width) || 0;
|
|
916
|
-
const viewHeight = Number(bounds?.size?.height) || 0;
|
|
917
|
-
const raw = refs.controller.view.safeAreaInsets;
|
|
918
|
-
const safeInsets = raw
|
|
919
|
-
? {
|
|
920
|
-
top: Number(raw.top) || 0,
|
|
921
|
-
bottom: Number(raw.bottom) || 0,
|
|
922
|
-
left: Number(raw.left) || 0,
|
|
923
|
-
right: Number(raw.right) || 0,
|
|
924
|
-
}
|
|
925
|
-
: { top: 0, bottom: 0, left: 0, right: 0 };
|
|
926
|
-
// Ask UIKit what the labels want given the panel inner width. We use a
|
|
927
|
-
// generous height bound so nothing clips on long reconnect strings.
|
|
928
|
-
const panelPadding = 16;
|
|
929
|
-
const horizontalMargin = 24;
|
|
930
|
-
const maxPanelWidth = 340;
|
|
931
|
-
const innerWidth = Math.max(0, Math.min(maxPanelWidth, viewWidth - 2 * horizontalMargin - safeInsets.left - safeInsets.right) - 2 * panelPadding);
|
|
932
|
-
const titleFit = refs.titleLabel.sizeThatFits({ width: innerWidth, height: 10000 }) || { height: 0 };
|
|
933
|
-
const statusFit = refs.statusLabel.sizeThatFits({ width: innerWidth, height: 10000 }) || { height: 0 };
|
|
934
|
-
const layout = computeIosOverlayLayout({
|
|
935
|
-
viewWidth,
|
|
936
|
-
viewHeight,
|
|
937
|
-
safeInsets,
|
|
938
|
-
titleHeight: Number(titleFit.height) || 0,
|
|
939
|
-
statusHeight: Number(statusFit.height) || 0,
|
|
940
|
-
maxPanelWidth,
|
|
941
|
-
horizontalMargin,
|
|
942
|
-
panelPadding,
|
|
943
|
-
});
|
|
944
|
-
const toCgRect = (rect) => ({
|
|
945
|
-
origin: { x: rect.x, y: rect.y },
|
|
946
|
-
size: { width: rect.width, height: rect.height },
|
|
947
|
-
});
|
|
948
|
-
refs.backdrop.frame = toCgRect(layout.backdrop);
|
|
949
|
-
refs.panel.frame = toCgRect(layout.panel);
|
|
950
|
-
refs.titleLabel.frame = toCgRect(layout.title);
|
|
951
|
-
refs.statusLabel.frame = toCgRect(layout.status);
|
|
952
|
-
}
|
|
953
|
-
catch (err) {
|
|
954
|
-
try {
|
|
955
|
-
console.warn('[ns-hmr-overlay] iOS overlay layout failed:', err?.message || err);
|
|
956
|
-
}
|
|
957
|
-
catch { }
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
function applySnapshotToIosRefs(refs, snapshot) {
|
|
961
|
-
if (!refs)
|
|
962
|
-
return false;
|
|
963
|
-
try {
|
|
964
|
-
// 'update' mode rides the same dedicated UIWindow as
|
|
965
|
-
// 'connection' so the HMR apply overlay always stacks above
|
|
966
|
-
// modals/sheets/system alerts. The window is constructed
|
|
967
|
-
// lazily (ensureIosOverlayRefs) and reused for the lifetime of
|
|
968
|
-
// the dev session.
|
|
969
|
-
const visible = snapshot.visible && (snapshot.mode === 'connection' || snapshot.mode === 'update');
|
|
970
|
-
refs.window.hidden = !visible;
|
|
971
|
-
if (!visible)
|
|
972
|
-
return true;
|
|
973
|
-
refs.titleLabel.text = snapshot.title || '';
|
|
974
|
-
refs.statusLabel.text = formatStatusText(snapshot);
|
|
975
|
-
const host = getIosOverlayHost();
|
|
976
|
-
if (host) {
|
|
977
|
-
const { UIColor } = host;
|
|
978
|
-
const isError = snapshot.tone === 'error';
|
|
979
|
-
const isSuccess = snapshot.tone === 'success';
|
|
980
|
-
try {
|
|
981
|
-
if (isError) {
|
|
982
|
-
// Red panel + dark red text (existing UX).
|
|
983
|
-
refs.panel.backgroundColor = UIColor.colorWithRedGreenBlueAlpha(1, 0.96, 0.96, 1);
|
|
984
|
-
refs.titleLabel.textColor = UIColor.colorWithRedGreenBlueAlpha(0.7, 0.1, 0.06, 1);
|
|
985
|
-
refs.statusLabel.textColor = UIColor.colorWithRedGreenBlueAlpha(0.7, 0.1, 0.06, 0.9);
|
|
986
|
-
// Slightly stronger dimming on errors; users need to
|
|
987
|
-
// notice these.
|
|
988
|
-
refs.backdrop.backgroundColor = UIColor.colorWithRedGreenBlueAlpha(0, 0, 0, 0.35);
|
|
989
|
-
}
|
|
990
|
-
else if (isSuccess) {
|
|
991
|
-
// Slightly more saturated green panel + dark-green
|
|
992
|
-
// text. The previous 0.94/0.99/0.95 background was
|
|
993
|
-
// nearly indistinguishable from white on most
|
|
994
|
-
// devices; this bump keeps long detail strings
|
|
995
|
-
// readable while making the apply event obviously
|
|
996
|
-
// "happening right now".
|
|
997
|
-
refs.panel.backgroundColor = UIColor.colorWithRedGreenBlueAlpha(0.9, 0.97, 0.91, 1);
|
|
998
|
-
refs.titleLabel.textColor = UIColor.colorWithRedGreenBlueAlpha(0.05, 0.43, 0.18, 1);
|
|
999
|
-
refs.statusLabel.textColor = UIColor.colorWithRedGreenBlueAlpha(0.05, 0.43, 0.18, 1);
|
|
1000
|
-
// Bumped from 0.12 to 0.28. The 0.12 wash was so
|
|
1001
|
-
// faint on bright app backgrounds that the overlay
|
|
1002
|
-
// was effectively invisible during a fast cycle.
|
|
1003
|
-
// 0.28 still keeps the app readable underneath but
|
|
1004
|
-
// makes the HMR event visually unmistakable.
|
|
1005
|
-
refs.backdrop.backgroundColor = UIColor.colorWithRedGreenBlueAlpha(0, 0.15, 0.05, 0.28);
|
|
1006
|
-
}
|
|
1007
|
-
else {
|
|
1008
|
-
// Default (info / warn) — existing connection look.
|
|
1009
|
-
refs.panel.backgroundColor = UIColor.whiteColor;
|
|
1010
|
-
refs.titleLabel.textColor = UIColor.blackColor;
|
|
1011
|
-
refs.statusLabel.textColor = UIColor.darkGrayColor;
|
|
1012
|
-
refs.backdrop.backgroundColor = UIColor.colorWithRedGreenBlueAlpha(0, 0, 0, 0.35);
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
catch { }
|
|
1016
|
-
}
|
|
1017
|
-
layoutIosOverlayRefs(refs);
|
|
1018
|
-
return true;
|
|
1019
|
-
}
|
|
1020
|
-
catch (err) {
|
|
1021
|
-
try {
|
|
1022
|
-
console.warn('[ns-hmr-overlay] iOS overlay apply failed:', err?.message || err);
|
|
1023
|
-
}
|
|
1024
|
-
catch { }
|
|
1025
|
-
return false;
|
|
28
|
+
export function setHmrDevOverlayPosition(position) {
|
|
29
|
+
if (position !== 'top' && position !== 'bottom' && position !== 'center') {
|
|
30
|
+
return;
|
|
1026
31
|
}
|
|
32
|
+
const g = getOverlayGlobal();
|
|
33
|
+
g.__NS_HMR_OVERLAY_POSITION__ = position;
|
|
34
|
+
const state = getRuntimeState();
|
|
35
|
+
applyRuntimeSnapshot(state.snapshot);
|
|
1027
36
|
}
|
|
1028
37
|
function applyRuntimeSnapshot(snapshot) {
|
|
1029
38
|
const state = getRuntimeState();
|
|
@@ -1155,7 +164,17 @@ function createOverlayApi() {
|
|
|
1155
164
|
const state = getRuntimeState();
|
|
1156
165
|
clearUpdateAutoHideTimer(state);
|
|
1157
166
|
state.updateCycleStartedAt = 0;
|
|
1158
|
-
|
|
167
|
+
const next = createBootOverlaySnapshot(stage, info);
|
|
168
|
+
// Monotonic boot-progress ratchet: boot stages can fire out of
|
|
169
|
+
// order across boot paths (JS session bootstrap vs the
|
|
170
|
+
// http-bootloader fallback) and individual bases were tuned
|
|
171
|
+
// independently, so clamp boot→boot transitions to never go
|
|
172
|
+
// backwards. Non-boot snapshots (error/ready) bypass — they
|
|
173
|
+
// genuinely want to reset the visual.
|
|
174
|
+
if (next.mode === 'boot' && state.snapshot.mode === 'boot' && typeof next.progress === 'number' && typeof state.snapshot.progress === 'number' && next.progress < state.snapshot.progress) {
|
|
175
|
+
next.progress = state.snapshot.progress;
|
|
176
|
+
}
|
|
177
|
+
return applyRuntimeSnapshot(next);
|
|
1159
178
|
},
|
|
1160
179
|
setConnectionStage(stage, info) {
|
|
1161
180
|
const state = getRuntimeState();
|
|
@@ -1215,12 +234,37 @@ function createOverlayApi() {
|
|
|
1215
234
|
},
|
|
1216
235
|
};
|
|
1217
236
|
}
|
|
237
|
+
// When the overlay is opted out, every surface (boot / connection / update / pending)
|
|
238
|
+
// becomes a no-op so nothing is ever drawn. The boot placeholder root and the
|
|
239
|
+
// `__NS_HMR_BOOT_COMPLETE__` signal are owned by `root-placeholder.ts` and are
|
|
240
|
+
// unaffected, so boot + HMR keep working — the user just sees no progress UI.
|
|
241
|
+
function createNoopOverlayApi() {
|
|
242
|
+
const snapshot = () => getRuntimeState().snapshot;
|
|
243
|
+
return {
|
|
244
|
+
ensureBootPage() {
|
|
245
|
+
return null;
|
|
246
|
+
},
|
|
247
|
+
setBootStage() {
|
|
248
|
+
return snapshot();
|
|
249
|
+
},
|
|
250
|
+
setConnectionStage() {
|
|
251
|
+
return snapshot();
|
|
252
|
+
},
|
|
253
|
+
setUpdateStage() {
|
|
254
|
+
return snapshot();
|
|
255
|
+
},
|
|
256
|
+
hide() { },
|
|
257
|
+
getSnapshot() {
|
|
258
|
+
return snapshot();
|
|
259
|
+
},
|
|
260
|
+
};
|
|
261
|
+
}
|
|
1218
262
|
export function ensureHmrDevOverlayRuntimeInstalled(verbose) {
|
|
1219
263
|
const g = getOverlayGlobal();
|
|
1220
264
|
const state = getRuntimeState();
|
|
1221
265
|
state.verbose = state.verbose || !!verbose;
|
|
1222
266
|
if (!g.__NS_HMR_DEV_OVERLAY__) {
|
|
1223
|
-
g.__NS_HMR_DEV_OVERLAY__ = createOverlayApi();
|
|
267
|
+
g.__NS_HMR_DEV_OVERLAY__ = resolveOverlayEnabled() ? createOverlayApi() : createNoopOverlayApi();
|
|
1224
268
|
}
|
|
1225
269
|
return g.__NS_HMR_DEV_OVERLAY__;
|
|
1226
270
|
}
|