@nativescript/vite 8.0.0-alpha.6 → 8.0.0-alpha.61
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 +51 -11
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +34 -1
- package/configuration/angular.js +390 -165
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +244 -53
- 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-state.d.ts +8 -0
- package/helpers/app-css-state.js +8 -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.js +9 -4
- 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/global-defines.d.ts +100 -13
- package/helpers/global-defines.js +165 -28
- 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 +0 -18
- 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 +368 -53
- 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-url.d.ts +29 -7
- package/helpers/ns-core-url.js +69 -12
- 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 +2 -2
- 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 +48 -19
- package/helpers/workers.js +662 -13
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +50 -26
- 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 +79 -0
- package/hmr/client/framework-client-strategy.js +19 -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 +14 -4
- 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 +284 -0
- package/hmr/client/hot-context.js.map +1 -0
- package/hmr/client/index.js +922 -273
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/utils.d.ts +2 -1
- package/hmr/client/utils.js +111 -99
- package/hmr/client/utils.js.map +1 -1
- package/hmr/entry-runtime.d.ts +2 -1
- package/hmr/entry-runtime.js +279 -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 +109 -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/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/{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/client/index.js +542 -175
- 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/strategy.js +458 -12
- 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 +14 -11
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.js +108 -111
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.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 +246 -0
- package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
- package/hmr/frameworks/solid/server/strategy.js +291 -16
- package/hmr/frameworks/solid/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/server/strategy.js +38 -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 +9 -0
- package/hmr/frameworks/vue/client/index.js +251 -247
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
- package/hmr/frameworks/vue/client/strategy.js +157 -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 +142 -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 +286 -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 +77 -10
- 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-archive-route.d.ts +40 -0
- package/hmr/server/boot-archive-route.js +154 -0
- package/hmr/server/boot-archive-route.js.map +1 -0
- package/hmr/server/boot-closure-route.d.ts +49 -0
- package/hmr/server/boot-closure-route.js +144 -0
- package/hmr/server/boot-closure-route.js.map +1 -0
- package/hmr/server/boot-recording.d.ts +58 -0
- package/hmr/server/boot-recording.js +228 -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/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 +170 -45
- package/hmr/server/core-sanitize.js.map +1 -1
- 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/deps-bundle.d.ts +218 -0
- package/hmr/server/deps-bundle.js +998 -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 +113 -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 +13 -4
- package/hmr/server/import-map.js +94 -47
- 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/ns-core-cjs-shape.d.ts +2 -4
- package/hmr/server/ns-core-cjs-shape.js +4 -6
- 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 +6 -10
- package/hmr/server/perf-instrumentation.js +5 -6
- package/hmr/server/perf-instrumentation.js.map +1 -1
- package/hmr/server/process-code-for-device.d.ts +30 -0
- package/hmr/server/process-code-for-device.js +791 -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 +638 -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/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +83 -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/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 +180 -54
- 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 -54
- package/hmr/server/websocket-core-bridge.js.map +1 -1
- package/hmr/server/websocket-css-hot-update.d.ts +33 -0
- package/hmr/server/websocket-css-hot-update.js +65 -0
- package/hmr/server/websocket-css-hot-update.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-hmr-pending.d.ts +3 -9
- package/hmr/server/websocket-hmr-pending.js +1 -1
- package/hmr/server/websocket-hmr-pending.js.map +1 -1
- package/hmr/server/websocket-hot-update.d.ts +77 -0
- package/hmr/server/websocket-hot-update.js +360 -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 +50 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.js +3 -3
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +66 -2
- package/hmr/server/websocket-module-specifiers.js +191 -20
- 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 +1 -3
- package/hmr/server/websocket-ns-m-paths.js +25 -82
- package/hmr/server/websocket-ns-m-paths.js.map +1 -1
- package/hmr/server/websocket-ns-m-request.d.ts +11 -1
- package/hmr/server/websocket-ns-m-request.js +17 -9
- 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 +835 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +50 -4
- package/hmr/server/websocket-served-module-helpers.js +384 -86
- 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 -39
- package/hmr/server/websocket.js +643 -6716
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +108 -0
- package/hmr/shared/ns-globals.js +28 -0
- package/hmr/shared/ns-globals.js.map +1 -0
- package/hmr/shared/protocol.d.ts +145 -0
- package/hmr/shared/protocol.js +28 -0
- package/hmr/shared/protocol.js.map +1 -0
- package/hmr/shared/runtime/boot-archive-format.d.ts +16 -0
- package/hmr/shared/runtime/boot-archive-format.js +31 -0
- package/hmr/shared/runtime/boot-archive-format.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 +2 -1
- package/hmr/shared/runtime/boot-timeline.js +9 -22
- package/hmr/shared/runtime/boot-timeline.js.map +1 -1
- package/hmr/shared/runtime/browser-runtime-contract.d.ts +53 -22
- package/hmr/shared/runtime/browser-runtime-contract.js +6 -9
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
- 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.d.ts +76 -30
- package/hmr/shared/runtime/dev-overlay.js +767 -408
- 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/http-only-boot.js +7 -6
- package/hmr/shared/runtime/http-only-boot.js.map +1 -1
- package/hmr/shared/runtime/module-provenance.js +4 -6
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- 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 +398 -204
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +274 -55
- 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/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +549 -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 +1 -7
- package/hmr/shared/vendor/manifest.js +136 -825
- 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 +76 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +401 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
- package/hmr/vendor-bootstrap.d.ts +1 -3
- package/hmr/vendor-bootstrap.js +4 -6
- package/hmr/vendor-bootstrap.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +65 -11
- package/runtime/core-aliases-early.js +25 -55
- 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/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 -286
- 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/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
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { getGlobalScope } from './global-scope.js';
|
|
2
|
+
// Pure helpers for the cold-boot "Importing the app entry" progress display.
|
|
3
|
+
//
|
|
4
|
+
// Pipeline:
|
|
5
|
+
// * Server-side `buildBootProgressSnippet` is injected at the top of
|
|
6
|
+
// every served app module and bumps the count / last-module globals
|
|
7
|
+
// while `__NS_HMR_BOOT_COMPLETE__` is falsy (self-gating — the
|
|
8
|
+
// snippet no-ops after boot; FULLY SYNCHRONOUS — see the snippet
|
|
9
|
+
// doc for why top-level await must stay out of served modules).
|
|
10
|
+
// * `startBrowserRuntimeSession` stamps the time origin
|
|
11
|
+
// (`__NS_HMR_BOOT_IMPORT_STARTED_AT__`) right before the client +
|
|
12
|
+
// entry dynamic-import walk.
|
|
13
|
+
// * `startBootImportHeartbeat` reads both signals every 250 ms and
|
|
14
|
+
// re-asserts `'importing-main'` so the bar climbs even across long
|
|
15
|
+
// vendor stretches that don't tick the count axis. The iOS runtime's
|
|
16
|
+
// `MaybePumpJSThreadDuringBoot` keeps the JS-thread CFRunLoop ticking
|
|
17
|
+
// between synchronous fetches so the heartbeat's `setInterval` timer
|
|
18
|
+
// can fire during the cold-boot module walk.
|
|
19
|
+
//
|
|
20
|
+
// Monotonic ratchet (`applyMonotonicBootProgress`,
|
|
21
|
+
// `__NS_HMR_BOOT_LAST_PROGRESS__`): each tick can never undercut the
|
|
22
|
+
// previous one, preventing visible stutter when the count axis briefly
|
|
23
|
+
// wins over the time axis.
|
|
24
|
+
/**
|
|
25
|
+
* `'importing-main'` is the long HTTP-module-load phase (5–10s for a
|
|
26
|
+
* real Angular app). The bar uses this range so the user sees ~62
|
|
27
|
+
* percentage points of motion during the phase that actually takes
|
|
28
|
+
* time, sandwiched between the cheap bootstrap stages
|
|
29
|
+
* ('configuring-import-map' = 26) and the post-import wait
|
|
30
|
+
* ('waiting-for-app' = 94 → 'app-root-committed' = 100).
|
|
31
|
+
*/
|
|
32
|
+
export const BOOT_IMPORT_PROGRESS_MIN = 30;
|
|
33
|
+
export const BOOT_IMPORT_PROGRESS_MAX = 92;
|
|
34
|
+
/** Ceiling guards against rounding into `'waiting-for-app'` (94). */
|
|
35
|
+
export const BOOT_IMPORT_PROGRESS_CEILING = 94;
|
|
36
|
+
const BOOT_IMPORT_PROGRESS_RANGE = BOOT_IMPORT_PROGRESS_MAX - BOOT_IMPORT_PROGRESS_MIN;
|
|
37
|
+
/**
|
|
38
|
+
* Compute the percentage shown next to "Importing the app entry".
|
|
39
|
+
*
|
|
40
|
+
* Sum of two clamped contributions:
|
|
41
|
+
* * `progressFromCount` — `__NS_HMR_BOOT_MODULE_COUNT__` bumped by the
|
|
42
|
+
* boot snippet (1 unit per 2 modules, cap 40).
|
|
43
|
+
* * `progressFromTime` — elapsed wall-clock since
|
|
44
|
+
* `__NS_HMR_BOOT_IMPORT_STARTED_AT__` (1 unit per 250 ms, cap
|
|
45
|
+
* matches the full 62-point range so time alone can drive the bar
|
|
46
|
+
* 30 → 92 if the count axis is starved).
|
|
47
|
+
*
|
|
48
|
+
* The count axis goes silent in long node_modules stretches and on
|
|
49
|
+
* Vite's rewrite chains where the served import URL skips the
|
|
50
|
+
* `__ns_boot__/b1` prefix; the time axis covers those gaps. Both
|
|
51
|
+
* contributions are summed, clamped to the 62-point range, then
|
|
52
|
+
* ceilinged so they cannot cross into 'waiting-for-app' (94+).
|
|
53
|
+
*
|
|
54
|
+
* Canonical values are pinned by `boot-progress.spec.ts`. The
|
|
55
|
+
* server-side snippet does NOT mirror this math — it only writes the
|
|
56
|
+
* counters; the heartbeat in `session-bootstrap.ts` is the sole caller.
|
|
57
|
+
*/
|
|
58
|
+
const BOOT_IMPORT_COUNT_CONTRIBUTION_MAX = 40;
|
|
59
|
+
const BOOT_IMPORT_TIME_CONTRIBUTION_MAX = 62;
|
|
60
|
+
const BOOT_IMPORT_COUNT_DIVISOR = 2;
|
|
61
|
+
const BOOT_IMPORT_TIME_TICK_MS = 250;
|
|
62
|
+
export function computeBootImportProgress(input) {
|
|
63
|
+
// Coerce NaN / ±Infinity / negatives to 0 — `Math.max(0, NaN)` is NaN.
|
|
64
|
+
const rawCount = Number(input?.count ?? 0);
|
|
65
|
+
const rawElapsed = Number(input?.elapsedMs ?? 0);
|
|
66
|
+
const count = Number.isFinite(rawCount) ? Math.max(0, rawCount) : 0;
|
|
67
|
+
const elapsedMs = Number.isFinite(rawElapsed) ? Math.max(0, rawElapsed) : 0;
|
|
68
|
+
const progressFromCount = Math.min(BOOT_IMPORT_COUNT_CONTRIBUTION_MAX, Math.floor(count / BOOT_IMPORT_COUNT_DIVISOR));
|
|
69
|
+
const progressFromTime = Math.min(BOOT_IMPORT_TIME_CONTRIBUTION_MAX, Math.floor(elapsedMs / BOOT_IMPORT_TIME_TICK_MS));
|
|
70
|
+
const combined = BOOT_IMPORT_PROGRESS_MIN + Math.min(BOOT_IMPORT_PROGRESS_RANGE, progressFromCount + progressFromTime);
|
|
71
|
+
return Math.min(BOOT_IMPORT_PROGRESS_CEILING, combined);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Render the second-line detail for the placeholder. Surfaces the
|
|
75
|
+
* count + last-loaded module path once the snippet has fired, or a
|
|
76
|
+
* generic "Loading the module graph…" line during the pre-snippet
|
|
77
|
+
* window.
|
|
78
|
+
*
|
|
79
|
+
* No elapsed-ms readout: the primary line's percentage is the progress
|
|
80
|
+
* signal, and the heartbeat's `elapsedMs` is wall-clock since the import
|
|
81
|
+
* started — not a per-module timing — so surfacing it next to the
|
|
82
|
+
* percentage read as a confusing, inaccurate duration.
|
|
83
|
+
*/
|
|
84
|
+
export function formatBootImportDetail(input) {
|
|
85
|
+
const count = Math.max(0, Number(input?.count ?? 0));
|
|
86
|
+
const lastModule = typeof input?.lastModule === 'string' ? input.lastModule : '';
|
|
87
|
+
if (count > 0) {
|
|
88
|
+
return lastModule ? `Evaluated ${count} modules\n${lastModule}` : `Evaluated ${count} modules`;
|
|
89
|
+
}
|
|
90
|
+
return 'Loading the module graph…';
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Ratchet a candidate boot-import progress value against the highest
|
|
94
|
+
* value any consumer has emitted so far (stored on
|
|
95
|
+
* `globalThis.__NS_HMR_BOOT_LAST_PROGRESS__`). Reset by
|
|
96
|
+
* `clearBootProgressState` between sessions.
|
|
97
|
+
*/
|
|
98
|
+
export function applyMonotonicBootProgress(candidate) {
|
|
99
|
+
const g = getGlobalScope();
|
|
100
|
+
const previousRaw = g.__NS_HMR_BOOT_LAST_PROGRESS__;
|
|
101
|
+
const previous = typeof previousRaw === 'number' && Number.isFinite(previousRaw) ? previousRaw : 0;
|
|
102
|
+
const next = Math.max(previous, Math.max(0, Number(candidate) || 0));
|
|
103
|
+
try {
|
|
104
|
+
g.__NS_HMR_BOOT_LAST_PROGRESS__ = next;
|
|
105
|
+
}
|
|
106
|
+
catch { }
|
|
107
|
+
return next;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Reset every boot-progress global so a re-bootstrapped session (e.g.
|
|
111
|
+
* after `__reboot_ng_modules__`) starts a fresh ratchet rather than
|
|
112
|
+
* inheriting the previous cycle's terminal values.
|
|
113
|
+
*/
|
|
114
|
+
export function clearBootProgressState() {
|
|
115
|
+
const g = getGlobalScope();
|
|
116
|
+
for (const key of [
|
|
117
|
+
'__NS_HMR_BOOT_MODULE_COUNT__',
|
|
118
|
+
'__NS_HMR_BOOT_LAST_MODULE__',
|
|
119
|
+
'__NS_HMR_BOOT_LAST_PROGRESS__',
|
|
120
|
+
'__NS_HMR_BOOT_LAST_PROGRESS_AT__',
|
|
121
|
+
'__NS_HMR_BOOT_IMPORT_STARTED_AT__',
|
|
122
|
+
// Defensive: an earlier snippet shape used this to throttle a
|
|
123
|
+
// top-level await yield. Removed — top-level await in a boot-tagged
|
|
124
|
+
// module trips the iOS 10s async-module deadline. Cleared in case a
|
|
125
|
+
// stale boot left it behind.
|
|
126
|
+
'__NS_HMR_BOOT_LAST_YIELD_AT__',
|
|
127
|
+
]) {
|
|
128
|
+
try {
|
|
129
|
+
delete g[key];
|
|
130
|
+
}
|
|
131
|
+
catch { }
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=boot-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot-progress.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/boot-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,6EAA6E;AAC7E,EAAE;AACF,YAAY;AACZ,uEAAuE;AACvE,wEAAwE;AACxE,mEAAmE;AACnE,qEAAqE;AACrE,oEAAoE;AACpE,0DAA0D;AAC1D,sEAAsE;AACtE,iCAAiC;AACjC,qEAAqE;AACrE,uEAAuE;AACvE,yEAAyE;AACzE,0EAA0E;AAC1E,yEAAyE;AACzE,iDAAiD;AACjD,EAAE;AACF,mDAAmD;AACnD,qEAAqE;AACrE,uEAAuE;AACvE,2BAA2B;AAE3B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAC3C,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAA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EAAE,CAAC;IAChC,KAAK,MAAM,GAAG,IAAI;QACjB,8BAA8B;QAC9B,6BAA6B;QAC7B,+BAA+B;QAC/B,kCAAkC;QAClC,mCAAmC;QACnC,8DAA8D;QAC9D,oEAAoE;QACpE,oEAAoE;QACpE,6BAA6B;QAC7B,+BAA+B;KAC/B,EAAE,CAAC;QACH,IAAI,CAAC;YACJ,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;AACF,CAAC"}
|
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
// `session-bootstrap.ts` is the real boot path on modern runtimes with
|
|
4
|
-
// `__nsStartDevSession`. We record how long each segment takes and turn
|
|
5
|
-
// the result into a single-line, human-readable log that is always on
|
|
6
|
-
// (not behind the verbose flag) so anyone chasing regressions can see
|
|
7
|
-
// the shape of a cold boot without having to flip any switches.
|
|
8
|
-
//
|
|
9
|
-
// The trace is also mirrored onto `globalThis.__NS_BOOT_TRACE__` so a
|
|
10
|
-
// developer can `console.log(globalThis.__NS_BOOT_TRACE__)` from the
|
|
11
|
-
// device or pick it up via `js:evaluate` in test harnesses.
|
|
12
|
-
//
|
|
13
|
-
// See HMR_CORE_REALM_DETERMINISTIC_PLAN.md — "Post-D roadmap — dev-loop
|
|
14
|
-
// performance and UX" for the full context.
|
|
1
|
+
import { getGlobalScope } from './global-scope.js';
|
|
15
2
|
// Pure formatter so we can unit-test the exact string shape without
|
|
16
3
|
// touching `console.info` or `Date.now()`.
|
|
17
4
|
//
|
|
18
5
|
// Format:
|
|
19
|
-
// [ns-boot] ok total=1234ms session=45ms importMap=67ms
|
|
6
|
+
// [ns-boot] ok total=1234ms session=45ms importMap=67ms entry=1100ms
|
|
20
7
|
// [ns-boot] FAILED total=230ms session=45ms ...: <message>
|
|
21
8
|
//
|
|
22
9
|
// Segment entries are only included when a numeric `ms` was recorded —
|
|
@@ -36,18 +23,18 @@ export function formatBootTimeline(trace) {
|
|
|
36
23
|
}
|
|
37
24
|
push('session', trace.session);
|
|
38
25
|
push('importMap', trace.importMap);
|
|
39
|
-
push('
|
|
26
|
+
push('kickstart', trace.kickstart);
|
|
27
|
+
push('entry', trace.entry);
|
|
40
28
|
const suffix = trace.error?.message ? `: ${trace.error.message}` : '';
|
|
41
29
|
return `[ns-boot] ${status} ${parts.join(' ')}${suffix}`.replace(/\s+$/, '');
|
|
42
30
|
}
|
|
43
|
-
// Install the trace on `globalThis` so diagnostics can pick it up.
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
// block.
|
|
31
|
+
// Install the trace on `globalThis` so diagnostics can pick it up. The key
|
|
32
|
+
// is distinct from the entry-runtime trace (`__NS_ENTRY_TRACE__`), which the
|
|
33
|
+
// entry runtime writes for its own phases. Exported for tests; the runtime
|
|
34
|
+
// path calls this from the session-bootstrap finally block.
|
|
48
35
|
export function publishBootTrace(trace) {
|
|
49
36
|
try {
|
|
50
|
-
|
|
37
|
+
getGlobalScope().__NS_BOOT_TRACE__ = trace;
|
|
51
38
|
}
|
|
52
39
|
catch { }
|
|
53
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot-timeline.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/boot-timeline.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"boot-timeline.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/boot-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAmCnD,oEAAoE;AACpE,2CAA2C;AAC3C,EAAE;AACF,UAAU;AACV,uEAAuE;AACvE,6DAA6D;AAC7D,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,wEAAwE;AACxE,MAAM,UAAU,kBAAkB,CAAC,KAAgB;IAClD,MAAM,MAAM,GAAG,KAAK,CAAC,KAA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CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEtE,OAAO,aAAa,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,4DAA4D;AAC5D,MAAM,UAAU,gBAAgB,CAAC,KAAgB;IAChD,IAAI,CAAC;QACJ,cAAc,EAAE,CAAC,iBAAiB,GAAG,KAAK,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACX,CAAC"}
|
|
@@ -22,16 +22,6 @@ export interface NsDevSessionDescriptor {
|
|
|
22
22
|
hostModules?: NsHostModuleId[];
|
|
23
23
|
features?: NsDevFeatureFlags;
|
|
24
24
|
}
|
|
25
|
-
export interface NsRuntimeDevSessionConfig extends NsDevSessionDescriptor {
|
|
26
|
-
}
|
|
27
|
-
export interface NsStyleUpdatePayload {
|
|
28
|
-
url: string;
|
|
29
|
-
cssText: string;
|
|
30
|
-
}
|
|
31
|
-
export interface NsHotUpdateInvalidatePayload {
|
|
32
|
-
urls: string[];
|
|
33
|
-
updatedAt?: number;
|
|
34
|
-
}
|
|
35
25
|
export interface NsRuntimeImportMap {
|
|
36
26
|
imports: Record<string, string>;
|
|
37
27
|
}
|
|
@@ -39,26 +29,67 @@ export interface NsRuntimeConfigurePayload {
|
|
|
39
29
|
importMap: NsRuntimeImportMap;
|
|
40
30
|
volatilePatterns?: string[];
|
|
41
31
|
}
|
|
32
|
+
export interface NsKickstartPrefetchOptions {
|
|
33
|
+
maxConcurrent?: number;
|
|
34
|
+
timeoutMs?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface NsKickstartPrefetchResult {
|
|
37
|
+
ok: boolean;
|
|
38
|
+
fetched: number;
|
|
39
|
+
ms: number;
|
|
40
|
+
}
|
|
41
|
+
/** One `{url, body}` pair seeded into the native prewarm cache (boot archive). */
|
|
42
|
+
export interface NsSeedModuleBodyEntry {
|
|
43
|
+
url: string;
|
|
44
|
+
body: string;
|
|
45
|
+
}
|
|
46
|
+
export interface NsSeedModuleBodiesResult {
|
|
47
|
+
ok: boolean;
|
|
48
|
+
seeded: number;
|
|
49
|
+
bytes: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The native dev-host contract — mechanism only. The runtime exposes its
|
|
53
|
+
* mechanism primitives on the single `globalThis.__NS_DEV__` namespace
|
|
54
|
+
* object; every policy concern (boot orchestration, import.meta.hot, full
|
|
55
|
+
* reload, CSS apply, WebSocket protocol) lives in JS inside
|
|
56
|
+
* @nativescript/vite.
|
|
57
|
+
*
|
|
58
|
+
* Every member is optional: a non-dev environment (or a test) may expose
|
|
59
|
+
* none or only some of them, and callers degrade gracefully.
|
|
60
|
+
*/
|
|
42
61
|
export interface NsRuntimeDevHostApi {
|
|
62
|
+
/** `__NS_DEV__.configureRuntime` — import map + volatile URL patterns for the sync resolver. */
|
|
43
63
|
configureRuntime?: (config: NsRuntimeConfigurePayload) => void;
|
|
44
|
-
|
|
45
|
-
startDevSession: (config: NsRuntimeDevSessionConfig) => Promise<void>;
|
|
64
|
+
/** `__NS_DEV__.invalidateModules` — dual-cache eviction (V8 registry + prefetch cache + bust-next-fetch nonce). */
|
|
46
65
|
invalidateModules?: (urls: string[]) => void;
|
|
47
|
-
|
|
48
|
-
applyStyleUpdate?: (payload: NsStyleUpdatePayload) => void;
|
|
66
|
+
/** `__NS_DEV__.getLoadedModuleUrls` — registry introspection for JS-driven full reload. */
|
|
49
67
|
getLoadedModuleUrls?: () => string[];
|
|
68
|
+
/** `__NS_DEV__.kickstartPrefetch(urls)` — parallel HTTP body prewarm for an explicit URL list. */
|
|
69
|
+
kickstartPrefetch?: (urls: string[], options?: NsKickstartPrefetchOptions) => NsKickstartPrefetchResult | null;
|
|
70
|
+
/**
|
|
71
|
+
* `__NS_DEV__.seedModuleBodies(entries)` — batch prewarm-cache seeding: the
|
|
72
|
+
* bootstrap downloads `/__ns_dev__/boot-archive` (NDJSON) and seeds every
|
|
73
|
+
* `{url, body}` into the prewarm cache in one call, behind the same
|
|
74
|
+
* http(s)/JS-shape/allowlist gates as a kickstart fetch. Callers fall back
|
|
75
|
+
* to `kickstartPrefetch(urls)` when absent or nothing seeded.
|
|
76
|
+
*/
|
|
77
|
+
seedModuleBodies?: (entries: NsSeedModuleBodyEntry[]) => NsSeedModuleBodiesResult | null;
|
|
78
|
+
/** `__NS_DEV__.setDevBootComplete` — flips the native cold-boot gate + `__NS_HMR_BOOT_COMPLETE__`. */
|
|
79
|
+
setDevBootComplete?: (value?: boolean) => void;
|
|
80
|
+
/** `__NS_DEV__.terminateAllWorkers` — drains `Caches::Workers`; returns the count terminated (main isolate only). */
|
|
81
|
+
terminateAllWorkers?: () => number;
|
|
50
82
|
}
|
|
51
83
|
export declare function isNsDevPlatform(value: unknown): value is NsDevPlatform;
|
|
52
84
|
export declare function assertNsDevSessionDescriptor(session: unknown): asserts session is NsDevSessionDescriptor;
|
|
85
|
+
/**
|
|
86
|
+
* Resolve the dev host API from `globalThis.__NS_DEV__` — the one namespace
|
|
87
|
+
* object the runtime installs. Always read through this function rather than
|
|
88
|
+
* poking at the global so every consumer resolves the contract identically.
|
|
89
|
+
*/
|
|
53
90
|
export declare function readNsRuntimeDevHostApi(target?: Partial<typeof globalThis>): NsRuntimeDevHostApi;
|
|
54
91
|
declare global {
|
|
55
|
-
|
|
56
|
-
var
|
|
57
|
-
var __nsSupportsRuntimeConfigUrl: boolean | undefined;
|
|
58
|
-
var __nsStartDevSession: ((config: NsRuntimeDevSessionConfig) => Promise<void>) | undefined;
|
|
59
|
-
var __nsInvalidateModules: ((urls: string[]) => void) | undefined;
|
|
60
|
-
var __nsReloadDevApp: (() => Promise<void>) | undefined;
|
|
61
|
-
var __nsApplyStyleUpdate: ((payload: NsStyleUpdatePayload) => void) | undefined;
|
|
62
|
-
var __nsGetLoadedModuleUrls: (() => string[]) | undefined;
|
|
92
|
+
/** The dev host namespace object the runtime installs (see NsRuntimeDevHostApi). */
|
|
93
|
+
var __NS_DEV__: NsRuntimeDevHostApi | undefined;
|
|
63
94
|
}
|
|
64
95
|
export {};
|
|
@@ -39,16 +39,13 @@ export function assertNsDevSessionDescriptor(session) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Resolve the dev host API from `globalThis.__NS_DEV__` — the one namespace
|
|
44
|
+
* object the runtime installs. Always read through this function rather than
|
|
45
|
+
* poking at the global so every consumer resolves the contract identically.
|
|
46
|
+
*/
|
|
42
47
|
export function readNsRuntimeDevHostApi(target = globalThis) {
|
|
43
|
-
return {
|
|
44
|
-
configureRuntime: target.__nsConfigureDevRuntime ?? target.__nsConfigureRuntime,
|
|
45
|
-
supportsRuntimeConfigUrl: target.__nsSupportsRuntimeConfigUrl === true,
|
|
46
|
-
startDevSession: target.__nsStartDevSession,
|
|
47
|
-
invalidateModules: target.__nsInvalidateModules,
|
|
48
|
-
reloadDevApp: target.__nsReloadDevApp,
|
|
49
|
-
applyStyleUpdate: target.__nsApplyStyleUpdate,
|
|
50
|
-
getLoadedModuleUrls: target.__nsGetLoadedModuleUrls,
|
|
51
|
-
};
|
|
48
|
+
return target.__NS_DEV__ ?? {};
|
|
52
49
|
}
|
|
53
50
|
export {};
|
|
54
51
|
//# sourceMappingURL=browser-runtime-contract.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-runtime-contract.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/browser-runtime-contract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser-runtime-contract.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/browser-runtime-contract.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAA4B,CAAC;AACtE,MAAM,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IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YACzJ,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACpD,CAAC;IACF,CAAC;IAED,IAAI,SAAS,CAAC,gBAAgB,IAAI,IAAI,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzF,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,SAAS,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAChC,IAAI,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACjD,CAAC;IACF,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAqC,UAAU;IACtF,OAAO,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;AAChC,CAAC;AAOD,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type HmrOverlayTone = 'info' | 'warn' | 'error' | 'success';
|
|
2
|
+
type HmrOverlayMode = 'hidden' | 'boot' | 'connection' | 'update';
|
|
3
|
+
export type HmrOverlayPosition = 'top' | 'bottom' | 'center';
|
|
4
|
+
export type HmrBootStage = 'placeholder' | 'probing-origin' | 'loading-entry-runtime' | 'configuring-import-map' | 'loading-runtime-bridge' | 'loading-core-bridge' | 'preloading-style-scope' | 'installing-css' | 'importing-main' | 'waiting-for-app' | 'app-root-committed' | 'ready' | 'error';
|
|
5
|
+
export type HmrConnectionStage = 'connecting' | 'reconnecting' | 'synchronizing' | 'offline' | 'healthy';
|
|
6
|
+
export type HmrUpdateStage = 'received' | 'evicting' | 'reimporting' | 'rebooting' | 'complete';
|
|
7
|
+
export type HmrOverlayStageInfo = {
|
|
8
|
+
detail?: string;
|
|
9
|
+
origin?: string;
|
|
10
|
+
progress?: number | null;
|
|
11
|
+
attempt?: number;
|
|
12
|
+
attempts?: number;
|
|
13
|
+
};
|
|
14
|
+
export type HmrOverlaySnapshot = {
|
|
15
|
+
visible: boolean;
|
|
16
|
+
mode: HmrOverlayMode;
|
|
17
|
+
badge: string;
|
|
18
|
+
title: string;
|
|
19
|
+
phase: string;
|
|
20
|
+
detail: string;
|
|
21
|
+
progress: number | null;
|
|
22
|
+
busy: boolean;
|
|
23
|
+
blocking: boolean;
|
|
24
|
+
tone: HmrOverlayTone;
|
|
25
|
+
};
|
|
26
|
+
export declare const BOOT_TITLE = "NativeScript Vite preparing dev session...";
|
|
27
|
+
export declare const DEFAULT_SNAPSHOT: HmrOverlaySnapshot;
|
|
28
|
+
export declare function createBootOverlaySnapshot(stage: HmrBootStage, info?: HmrOverlayStageInfo): HmrOverlaySnapshot;
|
|
29
|
+
export declare function createConnectionOverlaySnapshot(stage: HmrConnectionStage, info?: HmrOverlayStageInfo): HmrOverlaySnapshot;
|
|
30
|
+
export declare function createUpdateOverlaySnapshot(stage: HmrUpdateStage, info?: HmrOverlayStageInfo): HmrOverlaySnapshot;
|
|
31
|
+
export {};
|