@nativescript/vite 8.0.0-alpha.9 → 8.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -14
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +34 -1
- package/configuration/angular.js +196 -217
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +152 -104
- 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 +11 -92
- package/configuration/typescript.js.map +1 -1
- package/framework.d.ts +22 -0
- package/framework.js +18 -0
- package/framework.js.map +1 -0
- 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 +31 -0
- package/helpers/flavor.js +53 -2
- package/helpers/flavor.js.map +1 -1
- package/helpers/global-defines.d.ts +100 -33
- package/helpers/global-defines.js +192 -66
- 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 +24 -26
- package/helpers/init.js.map +1 -1
- package/helpers/logging.d.ts +11 -1
- package/helpers/logging.js +45 -2
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +4 -1
- package/helpers/main-entry.js +293 -40
- 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.js +8 -3
- 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/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 +143 -62
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +3 -3
- 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 +33 -0
- package/helpers/workers.js +237 -10
- 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 +117 -0
- package/hmr/client/framework-client-strategy.js +18 -0
- package/hmr/client/framework-client-strategy.js.map +1 -0
- package/hmr/client/framework.d.ts +31 -0
- package/hmr/client/framework.js +17 -0
- package/hmr/client/framework.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 +89 -0
- package/hmr/client/hot-context.js +404 -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 +136 -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 +489 -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 +279 -44
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/framework-flavors.d.ts +59 -0
- package/hmr/framework-flavors.js +108 -0
- package/hmr/framework-flavors.js.map +1 -0
- 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/{helpers/angular → hmr/frameworks/angular/build}/inject-component-hmr-registration.js +2 -70
- 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/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 +360 -194
- 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/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 +668 -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 +27 -11
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.js +179 -107
- 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 +270 -521
- 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/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 +7 -1
- 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 +155 -37
- 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 +57 -23
- package/hmr/server/import-map.js +142 -70
- 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-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 +54 -0
- package/hmr/server/process-code-for-device.js +832 -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 +211 -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 +299 -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 +36 -3
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +2 -5
- package/hmr/server/websocket-module-specifiers.js +42 -30
- 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 +163 -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 +2 -1
- package/hmr/server/websocket-ns-m-request.js +3 -2
- 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 +592 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +65 -3
- package/hmr/server/websocket-served-module-helpers.js +457 -140
- 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 +6 -40
- package/hmr/server/websocket.js +661 -6751
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +108 -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 +58 -25
- 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 -1011
- 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 +3 -2
- 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 +382 -157
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +209 -54
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-bootstrap.js +2 -1
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
- package/hmr/shared/runtime/vendor-resolve.js +45 -0
- package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
- package/hmr/shared/runtime/worker-tracking.d.ts +28 -0
- package/hmr/shared/runtime/worker-tracking.js +114 -0
- package/hmr/shared/runtime/worker-tracking.js.map +1 -0
- package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +909 -0
- package/hmr/shared/vendor/manifest-collect.js.map +1 -0
- package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
- package/hmr/shared/vendor/manifest-loader.js +5 -3
- package/hmr/shared/vendor/manifest-loader.js.map +1 -1
- package/hmr/shared/vendor/manifest.d.ts +10 -35
- package/hmr/shared/vendor/manifest.js +154 -978
- 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/package.json +70 -13
- package/runtime/core-aliases-early.js +11 -16
- 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 -185
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/inject-component-hmr-registration.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.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 -114
- 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 -1069
- 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}/inject-component-hmr-registration.d.ts +0 -0
- /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/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/util.js +0 -0
- /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Root-view replacement — the "make the new code visible" half of an HMR cycle.
|
|
3
|
+
*
|
|
4
|
+
* `performResetRoot` swaps the app's root for a freshly-created component
|
|
5
|
+
* (delegating construction to the flavor strategy's `createRoot`). Two paths:
|
|
6
|
+
* an in-place `Frame.navigate` fast path for subsequent updates, and a full
|
|
7
|
+
* `Application.resetRootView` for first mount / Frame roots / flavors that
|
|
8
|
+
* opt out of the fast path.
|
|
9
|
+
*
|
|
10
|
+
* Realm rule applies here as everywhere in the client: core classes are
|
|
11
|
+
* resolved through `getCore` / the vendor realm at call time, never via static
|
|
12
|
+
* `@nativescript/core` imports.
|
|
13
|
+
*/
|
|
14
|
+
import { getRootFrame, setRootFrame, getCore, ENV_VERBOSE } from './utils.js';
|
|
15
|
+
import { getGlobalScope } from '../shared/runtime/global-scope.js';
|
|
16
|
+
import { resolveVendorModule } from '../shared/runtime/vendor-resolve.js';
|
|
17
|
+
import { getClientStrategy } from './strategy-loader.js';
|
|
18
|
+
const VERBOSE = ENV_VERBOSE;
|
|
19
|
+
// Ensure core aliases are present on globalThis early so that /ns/rt exports resolve to functions
|
|
20
|
+
// before any SFCs are evaluated during HTTP-only dev boot.
|
|
21
|
+
export function ensureCoreAliasesOnGlobalThis() {
|
|
22
|
+
const g = globalThis;
|
|
23
|
+
try {
|
|
24
|
+
const F = getCore('Frame') || g.Frame;
|
|
25
|
+
const A = getCore('Application') || g.Application;
|
|
26
|
+
const P = getCore('Page') || g.Page;
|
|
27
|
+
// Publish to globalThis if missing
|
|
28
|
+
try {
|
|
29
|
+
if (F && !g.Frame)
|
|
30
|
+
g.Frame = F;
|
|
31
|
+
}
|
|
32
|
+
catch { }
|
|
33
|
+
try {
|
|
34
|
+
if (A && (!g.Application || typeof g.Application.run !== 'function' || typeof g.Application.on !== 'function' || typeof g.Application.resetRootView !== 'function')) {
|
|
35
|
+
g.Application = A;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch { }
|
|
39
|
+
try {
|
|
40
|
+
if (P && !g.Page)
|
|
41
|
+
g.Page = P;
|
|
42
|
+
}
|
|
43
|
+
catch { }
|
|
44
|
+
}
|
|
45
|
+
catch { }
|
|
46
|
+
}
|
|
47
|
+
export async function performResetRoot(newComponent) {
|
|
48
|
+
// Guard against re-entrant or rapid successive resets
|
|
49
|
+
try {
|
|
50
|
+
globalThis.__NS_DEV_RESET_IN_PROGRESS__ = true;
|
|
51
|
+
}
|
|
52
|
+
catch { }
|
|
53
|
+
try {
|
|
54
|
+
ensureCoreAliasesOnGlobalThis();
|
|
55
|
+
}
|
|
56
|
+
catch { }
|
|
57
|
+
if (VERBOSE) {
|
|
58
|
+
console.log('[hmr-client] Single-path: replace current root Page');
|
|
59
|
+
console.log('[hmr-client] Component details:', {
|
|
60
|
+
componentName: newComponent?.__name,
|
|
61
|
+
componentFile: newComponent?.__file,
|
|
62
|
+
hasRender: !!newComponent?.render,
|
|
63
|
+
hasSetup: !!newComponent?.setup,
|
|
64
|
+
componentKeys: Object.keys(newComponent || {}),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
function createRootFactory() {
|
|
68
|
+
let rootKind = 'page';
|
|
69
|
+
let cachedRoot = undefined;
|
|
70
|
+
const state = {
|
|
71
|
+
getRootKind: () => rootKind,
|
|
72
|
+
setRootKind: (k) => {
|
|
73
|
+
rootKind = k;
|
|
74
|
+
},
|
|
75
|
+
getCachedRoot: () => cachedRoot,
|
|
76
|
+
setCachedRoot: (r) => {
|
|
77
|
+
cachedRoot = r;
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
const factory = {
|
|
81
|
+
get kind() {
|
|
82
|
+
return rootKind;
|
|
83
|
+
},
|
|
84
|
+
create: () => {
|
|
85
|
+
if (cachedRoot)
|
|
86
|
+
return cachedRoot;
|
|
87
|
+
try {
|
|
88
|
+
const strategy = getClientStrategy();
|
|
89
|
+
if (strategy?.createRoot) {
|
|
90
|
+
// Vue mounts an app root; TypeScript/React treat the component
|
|
91
|
+
// as a factory or direct NS view (and may flip rootKind to
|
|
92
|
+
// 'frame' via `state`).
|
|
93
|
+
cachedRoot = strategy.createRoot(newComponent, state);
|
|
94
|
+
}
|
|
95
|
+
return cachedRoot;
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
console.warn('[hmr-client] createRootFactory failed', e);
|
|
99
|
+
if (VERBOSE)
|
|
100
|
+
console.warn('[hmr-client] [createRoot] stack', e?.stack);
|
|
101
|
+
const GPage = getCore('Page');
|
|
102
|
+
rootKind = 'page';
|
|
103
|
+
cachedRoot = GPage ? new GPage() : {};
|
|
104
|
+
return cachedRoot;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
return factory;
|
|
109
|
+
}
|
|
110
|
+
// Android readiness before any root changes
|
|
111
|
+
const App = getCore('Application') || getGlobalScope().Application;
|
|
112
|
+
const isAndroid = !!(App && App.android !== undefined);
|
|
113
|
+
if (isAndroid) {
|
|
114
|
+
const isReady = () => {
|
|
115
|
+
try {
|
|
116
|
+
const a = App.android;
|
|
117
|
+
const act = a && (a.foregroundActivity || a.startActivity);
|
|
118
|
+
return !!act;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const waitFor = async (pred, ms = 6000, step = 60) => {
|
|
125
|
+
const start = Date.now();
|
|
126
|
+
while (Date.now() - start < ms) {
|
|
127
|
+
if (pred())
|
|
128
|
+
return true;
|
|
129
|
+
await new Promise((r) => setTimeout(r, step));
|
|
130
|
+
}
|
|
131
|
+
return pred();
|
|
132
|
+
};
|
|
133
|
+
const withEvents = async (ms = 6000) => {
|
|
134
|
+
try {
|
|
135
|
+
const a = App.android;
|
|
136
|
+
if (!a || typeof a.on !== 'function' || typeof a.off !== 'function') {
|
|
137
|
+
if (VERBOSE)
|
|
138
|
+
console.log('[hmr-client] [android] events API not available; polling');
|
|
139
|
+
return await waitFor(isReady, ms, 60);
|
|
140
|
+
}
|
|
141
|
+
if (isReady()) {
|
|
142
|
+
if (VERBOSE)
|
|
143
|
+
console.log('[hmr-client] [android] activity already ready');
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
return await new Promise((resolve) => {
|
|
147
|
+
let done = false;
|
|
148
|
+
const tWait = Date.now();
|
|
149
|
+
const finish = (ok) => {
|
|
150
|
+
if (done)
|
|
151
|
+
return;
|
|
152
|
+
done = true;
|
|
153
|
+
try {
|
|
154
|
+
a.off(a.activityStartedEvent || 'activityStarted', onAny);
|
|
155
|
+
a.off(a.activityResumedEvent || 'activityResumed', onAny);
|
|
156
|
+
}
|
|
157
|
+
catch { }
|
|
158
|
+
if (VERBOSE)
|
|
159
|
+
console.log('[hmr-client] [android] readiness result', {
|
|
160
|
+
ok,
|
|
161
|
+
elapsedMs: Date.now() - tWait,
|
|
162
|
+
});
|
|
163
|
+
resolve(ok);
|
|
164
|
+
};
|
|
165
|
+
const onAny = (evt) => {
|
|
166
|
+
if (VERBOSE)
|
|
167
|
+
console.log('[hmr-client] [android] activity event', {
|
|
168
|
+
type: evt?.eventName || 'unknown',
|
|
169
|
+
});
|
|
170
|
+
if (isReady())
|
|
171
|
+
finish(true);
|
|
172
|
+
};
|
|
173
|
+
try {
|
|
174
|
+
a.on(a.activityStartedEvent || 'activityStarted', onAny);
|
|
175
|
+
a.on(a.activityResumedEvent || 'activityResumed', onAny);
|
|
176
|
+
if (VERBOSE)
|
|
177
|
+
console.log('[hmr-client] [android] waiting for activity events…');
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
return resolve(waitFor(isReady, ms, 60));
|
|
181
|
+
}
|
|
182
|
+
setTimeout(() => finish(isReady()), ms);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
return await waitFor(isReady, ms, 60);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const ok = await withEvents(6000);
|
|
190
|
+
if (!ok && VERBOSE)
|
|
191
|
+
console.warn('[hmr-client] [android] activity not ready; proceeding with best-effort');
|
|
192
|
+
}
|
|
193
|
+
// Create the new root first to determine whether it is a Page or a Frame
|
|
194
|
+
const rootFactory = createRootFactory();
|
|
195
|
+
const preparedRoot = rootFactory.create();
|
|
196
|
+
const isFrameRoot = (() => {
|
|
197
|
+
try {
|
|
198
|
+
const name = String(preparedRoot?.constructor?.name || '').replace(/^_+/, '');
|
|
199
|
+
return /^Frame(\$\d+)?$/.test(name);
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
})();
|
|
205
|
+
// Prefer resetRootView on initial boot (placeholder present) or on iOS to avoid early createRootView races
|
|
206
|
+
let hadPlaceholder = false;
|
|
207
|
+
let isIOS = false;
|
|
208
|
+
try {
|
|
209
|
+
hadPlaceholder = !!globalThis.__NS_DEV_PLACEHOLDER_ROOT_EARLY__;
|
|
210
|
+
}
|
|
211
|
+
catch { }
|
|
212
|
+
try {
|
|
213
|
+
const AppAny = getCore('Application') || getGlobalScope().Application;
|
|
214
|
+
isIOS = !!(AppAny && AppAny.ios !== undefined);
|
|
215
|
+
}
|
|
216
|
+
catch { }
|
|
217
|
+
// Preferred policy:
|
|
218
|
+
// - If this is the very first mount (placeholder present), or if the new root is a Frame,
|
|
219
|
+
// perform a full root replacement via resetRootView so we never couple with the placeholder.
|
|
220
|
+
// - Otherwise (subsequent HMR updates with an authoritative Frame already in place), re-use the
|
|
221
|
+
// current app Frame and navigate to the new Page. This avoids a brief flash that can occur
|
|
222
|
+
// when swapping the entire root view on Android. The placeholder is never involved here.
|
|
223
|
+
const gAnyForPolicy = getGlobalScope();
|
|
224
|
+
const placeholderFrame = (() => {
|
|
225
|
+
try {
|
|
226
|
+
return gAnyForPolicy.__NS_DEV_PLACEHOLDER_ROOT_VIEW__ || null;
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
})();
|
|
232
|
+
let existingAppFrame = null;
|
|
233
|
+
try {
|
|
234
|
+
existingAppFrame = getRootFrame() || getCore('Frame')?.topmost?.() || null;
|
|
235
|
+
}
|
|
236
|
+
catch { }
|
|
237
|
+
const isAuthoritativeFrame = !!existingAppFrame && existingAppFrame !== placeholderFrame;
|
|
238
|
+
// Vue: skip the in-place navigate path. After `app.mount(NSVRoot)` in getRootForVue the
|
|
239
|
+
// new Page already has a parent (the freshly-constructed NSVRoot), so an attempt to navigate
|
|
240
|
+
// the existing app Frame to that same Page completes silently without ever rebinding the
|
|
241
|
+
// page to the Frame — the screen keeps showing the previous render. resetRootView with a
|
|
242
|
+
// fresh Frame correctly reparents the Page and is the proven path that produces visible
|
|
243
|
+
// in-place updates for SFC HMR cycles. Non-Vue flavors keep the legacy navigate fast path.
|
|
244
|
+
const allowNavigateFastPath = getClientStrategy()?.allowNavigateFastPath ?? true;
|
|
245
|
+
if (allowNavigateFastPath && !hadPlaceholder && !isFrameRoot && isAuthoritativeFrame && typeof existingAppFrame.navigate === 'function') {
|
|
246
|
+
try {
|
|
247
|
+
const navEntry = {
|
|
248
|
+
create: () => preparedRoot,
|
|
249
|
+
clearHistory: true,
|
|
250
|
+
animated: false,
|
|
251
|
+
};
|
|
252
|
+
existingAppFrame.navigate(navEntry);
|
|
253
|
+
setRootFrame(existingAppFrame);
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
catch (e) {
|
|
257
|
+
console.warn('[hmr-client] authoritative navigate fallback to resetRootView due to error', e);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (VERBOSE)
|
|
261
|
+
console.log('[hmr-client] full root replacement via resetRootView (placeholder will be discarded)', { isFrameRoot, isIOS, hadPlaceholder });
|
|
262
|
+
// Fallback or preferred path: resetRootView with a creator that builds a fresh Frame and navigates to the new Page
|
|
263
|
+
try {
|
|
264
|
+
const App2 = getCore('Application') || getGlobalScope().Application;
|
|
265
|
+
if (!App2 || typeof App2.resetRootView !== 'function') {
|
|
266
|
+
console.warn('[hmr-client] Application.resetRootView unavailable');
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
// iOS-specific: if the cached window was left in an invalid state (boolean false), clear it so
|
|
270
|
+
// setWindowContent can recreate a proper UIWindow. This can occur in rare early-boot races.
|
|
271
|
+
try {
|
|
272
|
+
const isIos = !!(App2 && App2.ios !== undefined);
|
|
273
|
+
if (isIos) {
|
|
274
|
+
let win = undefined;
|
|
275
|
+
try {
|
|
276
|
+
win = App2.window;
|
|
277
|
+
}
|
|
278
|
+
catch { }
|
|
279
|
+
if (win === false) {
|
|
280
|
+
if (VERBOSE)
|
|
281
|
+
console.warn('[hmr-client] iOS Application.window is boolean false; attempting to clear cached window');
|
|
282
|
+
try {
|
|
283
|
+
const helpers = resolveVendorModule('@nativescript/core/application/helpers-common');
|
|
284
|
+
const setter = helpers && (helpers.setiOSWindow || helpers.default?.setiOSWindow);
|
|
285
|
+
if (typeof setter === 'function') {
|
|
286
|
+
try {
|
|
287
|
+
setter(undefined);
|
|
288
|
+
if (VERBOSE)
|
|
289
|
+
console.log('[hmr-client] cleared cached iOS window via helpers-common');
|
|
290
|
+
}
|
|
291
|
+
catch { }
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
catch { }
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
catch { }
|
|
299
|
+
// Use the previously created preparedRoot
|
|
300
|
+
const entry = {
|
|
301
|
+
create: () => {
|
|
302
|
+
if (!isFrameRoot) {
|
|
303
|
+
const F = getCore('Frame');
|
|
304
|
+
const fr = new F();
|
|
305
|
+
if (VERBOSE)
|
|
306
|
+
console.log('[hmr-client] resetRootView:create new Frame', {
|
|
307
|
+
type: fr?.constructor?.name,
|
|
308
|
+
});
|
|
309
|
+
const navEntry = {
|
|
310
|
+
create: () => preparedRoot,
|
|
311
|
+
clearHistory: true,
|
|
312
|
+
animated: false,
|
|
313
|
+
};
|
|
314
|
+
try {
|
|
315
|
+
fr.navigate(navEntry);
|
|
316
|
+
}
|
|
317
|
+
catch (e) {
|
|
318
|
+
console.warn('[hmr-client] resetRootView:create navigate failed', e);
|
|
319
|
+
}
|
|
320
|
+
setRootFrame(fr);
|
|
321
|
+
return fr;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
const fr = preparedRoot;
|
|
325
|
+
setRootFrame(fr);
|
|
326
|
+
return fr;
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
// Always use an entry with a create() function to avoid cross‑realm instanceof checks on Android.
|
|
331
|
+
App2.resetRootView(entry);
|
|
332
|
+
// After authoritative reset, it's safe to detach the early placeholder launch handler
|
|
333
|
+
try {
|
|
334
|
+
const restore = globalThis.__NS_DEV_RESTORE_PLACEHOLDER__;
|
|
335
|
+
if (typeof restore === 'function') {
|
|
336
|
+
restore();
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
catch { }
|
|
340
|
+
return true;
|
|
341
|
+
}
|
|
342
|
+
catch (e) {
|
|
343
|
+
console.warn('[hmr-client] resetRootView failed', e);
|
|
344
|
+
try {
|
|
345
|
+
if (VERBOSE)
|
|
346
|
+
console.warn('[hmr-client] resetRootView stack', e?.stack);
|
|
347
|
+
}
|
|
348
|
+
catch { }
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
finally {
|
|
352
|
+
try {
|
|
353
|
+
globalThis.__NS_DEV_RESET_IN_PROGRESS__ = false;
|
|
354
|
+
}
|
|
355
|
+
catch { }
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
//# sourceMappingURL=root-reset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-reset.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/root-reset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,OAAO,GAAG,WAAW,CAAC;AAE5B,kGAAkG;AAClG,2DA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AC;IACb,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC;YACJ,IAAI,OAAO;gBAAE,OAAO,CAAC,IAAI,CAAC,kCAAkC,EAAG,CAAS,EAAE,KAAK,CAAC,CAAC;QAClF,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QACV,OAAO,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACV,IAAI,CAAC;YACJ,UAAU,CAAC,4BAA4B,GAAG,KAAK,CAAC;QACjD,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flavor detection + framework client-strategy loading.
|
|
3
|
+
*
|
|
4
|
+
* The shared client talks to frameworks only through the client-strategy seam
|
|
5
|
+
* (`framework-client-strategy.ts`). The strategy is loaded by ONE dynamic
|
|
6
|
+
* per-flavor `import()` so a device only ever fetches its OWN framework's client
|
|
7
|
+
* module — a Vue app never fetches the Angular client, and vice versa.
|
|
8
|
+
*
|
|
9
|
+
* The load is async (one HTTP-ESM fetch on device), so `CLIENT_STRATEGY_READY`
|
|
10
|
+
* is awaited at the top of `handleHmrMessage` before any message is processed —
|
|
11
|
+
* every strategy call site downstream of message processing therefore observes a
|
|
12
|
+
* fully-installed strategy. `install()` itself is best-effort (idempotent dev
|
|
13
|
+
* shims) and not boot-critical, so resolving it slightly after module load is
|
|
14
|
+
* safe.
|
|
15
|
+
*/
|
|
16
|
+
import type { FrameworkClientStrategy } from './framework-client-strategy.js';
|
|
17
|
+
export declare const TARGET_FLAVOR: string;
|
|
18
|
+
export declare const TS_LIKE_FLAVOR: boolean;
|
|
19
|
+
export declare const APP_ROOT_VIRTUAL: any;
|
|
20
|
+
export declare const APP_VIRTUAL_WITH_SLASH: any;
|
|
21
|
+
export declare const APP_MAIN_ENTRY_SPEC: string;
|
|
22
|
+
export declare const CLIENT_STRATEGY_READY: Promise<void>;
|
|
23
|
+
/** Undefined until `CLIENT_STRATEGY_READY` resolves (or when the flavor ships no client strategy). */
|
|
24
|
+
export declare function getClientStrategy(): FrameworkClientStrategy | undefined;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flavor detection + framework client-strategy loading.
|
|
3
|
+
*
|
|
4
|
+
* The shared client talks to frameworks only through the client-strategy seam
|
|
5
|
+
* (`framework-client-strategy.ts`). The strategy is loaded by ONE dynamic
|
|
6
|
+
* per-flavor `import()` so a device only ever fetches its OWN framework's client
|
|
7
|
+
* module — a Vue app never fetches the Angular client, and vice versa.
|
|
8
|
+
*
|
|
9
|
+
* The load is async (one HTTP-ESM fetch on device), so `CLIENT_STRATEGY_READY`
|
|
10
|
+
* is awaited at the top of `handleHmrMessage` before any message is processed —
|
|
11
|
+
* every strategy call site downstream of message processing therefore observes a
|
|
12
|
+
* fully-installed strategy. `install()` itself is best-effort (idempotent dev
|
|
13
|
+
* shims) and not boot-critical, so resolving it slightly after module load is
|
|
14
|
+
* safe.
|
|
15
|
+
*/
|
|
16
|
+
import { getGlobalScope } from '../shared/runtime/global-scope.js';
|
|
17
|
+
import { ENV_VERBOSE, resolveHmrHttpOrigin } from './utils.js';
|
|
18
|
+
const VERBOSE = ENV_VERBOSE;
|
|
19
|
+
function resolveTargetFlavor() {
|
|
20
|
+
try {
|
|
21
|
+
if (typeof __NS_TARGET_FLAVOR__ !== 'undefined' && __NS_TARGET_FLAVOR__) {
|
|
22
|
+
return __NS_TARGET_FLAVOR__;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch { }
|
|
26
|
+
try {
|
|
27
|
+
const g = getGlobalScope();
|
|
28
|
+
if (typeof g.__NS_TARGET_FLAVOR__ === 'string' && g.__NS_TARGET_FLAVOR__) {
|
|
29
|
+
return g.__NS_TARGET_FLAVOR__;
|
|
30
|
+
}
|
|
31
|
+
if (typeof g.__NS_HMR_BROWSER_RUNTIME_TARGET_FLAVOR__ === 'string' && g.__NS_HMR_BROWSER_RUNTIME_TARGET_FLAVOR__) {
|
|
32
|
+
return g.__NS_HMR_BROWSER_RUNTIME_TARGET_FLAVOR__;
|
|
33
|
+
}
|
|
34
|
+
if (typeof g.__reboot_ng_modules__ === 'function') {
|
|
35
|
+
return 'angular';
|
|
36
|
+
}
|
|
37
|
+
if (g.__VUE_HMR_RUNTIME__ || g.__NS_HMR_VUE_SFC_REGISTRY__) {
|
|
38
|
+
return 'vue';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch { }
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
export const TARGET_FLAVOR = resolveTargetFlavor();
|
|
45
|
+
// React reuses the generic TypeScript HMR path on BOTH server and client: it has
|
|
46
|
+
// no Fast Refresh, so a module edit drives a plain module reload / root reset
|
|
47
|
+
// (the React tree re-renders), exactly like the `typescript` flavor. The server
|
|
48
|
+
// strategy is `{ ...typescriptServerStrategy, flavor: 'react' }`; this mirrors that
|
|
49
|
+
// on the client so the `typescript`-gated update branches also run for React
|
|
50
|
+
// (otherwise a React edit is received but never applied — the overlay sticks).
|
|
51
|
+
export const TS_LIKE_FLAVOR = TARGET_FLAVOR === 'typescript' || TARGET_FLAVOR === 'react';
|
|
52
|
+
try {
|
|
53
|
+
if (TARGET_FLAVOR && !globalThis.__NS_TARGET_FLAVOR__) {
|
|
54
|
+
globalThis.__NS_TARGET_FLAVOR__ = TARGET_FLAVOR;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch { }
|
|
58
|
+
// Define substitution does NOT reach this file (served raw from node_modules),
|
|
59
|
+
// so prefer the globalThis seed planted by the entry's defines-seed module —
|
|
60
|
+
// the '/src' literal is a last-resort default and is WRONG for 'app/'-rooted
|
|
61
|
+
// projects.
|
|
62
|
+
export const APP_ROOT_VIRTUAL = (typeof __NS_APP_ROOT_VIRTUAL__ === 'string' && __NS_APP_ROOT_VIRTUAL__) || (typeof getGlobalScope().__NS_APP_ROOT_VIRTUAL__ === 'string' && getGlobalScope().__NS_APP_ROOT_VIRTUAL__) || '/src';
|
|
63
|
+
export const APP_VIRTUAL_WITH_SLASH = APP_ROOT_VIRTUAL.endsWith('/') ? APP_ROOT_VIRTUAL : `${APP_ROOT_VIRTUAL}/`;
|
|
64
|
+
export const APP_MAIN_ENTRY_SPEC = `${APP_VIRTUAL_WITH_SLASH}app.ts`;
|
|
65
|
+
const CLIENT_STRATEGY_FLAVORS = new Set(['vue', 'angular', 'solid', 'typescript', 'react']);
|
|
66
|
+
let CLIENT_STRATEGY;
|
|
67
|
+
// A flavor registered from outside the package (`registerFrameworkFlavor`)
|
|
68
|
+
// ships its client strategy in its own package; the dev server seeds that
|
|
69
|
+
// module's device path so the loader never has to know the package.
|
|
70
|
+
function resolveRegisteredClientStrategyUrl() {
|
|
71
|
+
let devicePath;
|
|
72
|
+
try {
|
|
73
|
+
devicePath = typeof __NS_CLIENT_STRATEGY_URL__ === 'string' ? __NS_CLIENT_STRATEGY_URL__ : undefined;
|
|
74
|
+
}
|
|
75
|
+
catch { }
|
|
76
|
+
if (!devicePath) {
|
|
77
|
+
try {
|
|
78
|
+
devicePath = getGlobalScope().__NS_CLIENT_STRATEGY_URL__;
|
|
79
|
+
}
|
|
80
|
+
catch { }
|
|
81
|
+
}
|
|
82
|
+
if (typeof devicePath !== 'string' || !devicePath)
|
|
83
|
+
return undefined;
|
|
84
|
+
if (/^https?:\/\//.test(devicePath))
|
|
85
|
+
return devicePath;
|
|
86
|
+
const origin = resolveHmrHttpOrigin();
|
|
87
|
+
return origin ? origin + devicePath : devicePath;
|
|
88
|
+
}
|
|
89
|
+
function pickClientStrategyExport(mod, flavor) {
|
|
90
|
+
const candidates = [mod?.default, mod?.clientStrategy, mod?.[`${flavor}ClientStrategy`]];
|
|
91
|
+
return candidates.find((candidate) => candidate && typeof candidate.install === 'function');
|
|
92
|
+
}
|
|
93
|
+
// The strategy module's URL, absolute and dot-segment free. The runtime keys
|
|
94
|
+
// its module registry by the specifier it is handed, so a `../` specifier from
|
|
95
|
+
// a dev-served module would register the strategy under a non-canonical URL
|
|
96
|
+
// (`…/hmr/client/../frameworks/…`) — a second identity next to the canonical
|
|
97
|
+
// one, fetched outside the async graph walk. Resolving against
|
|
98
|
+
// `import.meta.url` here hands the loader the canonical URL up front.
|
|
99
|
+
function resolveClientStrategyUrl(flavor) {
|
|
100
|
+
const relative = `../frameworks/${flavor}/client/strategy.js`;
|
|
101
|
+
try {
|
|
102
|
+
const base = import.meta.url;
|
|
103
|
+
if (typeof base === 'string' && /^https?:\/\//.test(base)) {
|
|
104
|
+
return new URL(relative, base).href;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch { }
|
|
108
|
+
return relative;
|
|
109
|
+
}
|
|
110
|
+
function clientStrategyModuleUrl(flavor) {
|
|
111
|
+
if (CLIENT_STRATEGY_FLAVORS.has(flavor))
|
|
112
|
+
return resolveClientStrategyUrl(flavor);
|
|
113
|
+
return resolveRegisteredClientStrategyUrl();
|
|
114
|
+
}
|
|
115
|
+
const CLIENT_STRATEGY_URL = TARGET_FLAVOR ? clientStrategyModuleUrl(TARGET_FLAVOR) : undefined;
|
|
116
|
+
export const CLIENT_STRATEGY_READY = TARGET_FLAVOR && CLIENT_STRATEGY_URL
|
|
117
|
+
? import(/* @vite-ignore */ CLIENT_STRATEGY_URL)
|
|
118
|
+
.then((mod) => {
|
|
119
|
+
CLIENT_STRATEGY = pickClientStrategyExport(mod, TARGET_FLAVOR);
|
|
120
|
+
if (!CLIENT_STRATEGY) {
|
|
121
|
+
console.warn(`[hmr-client] ${CLIENT_STRATEGY_URL} exports no client strategy for flavor "${TARGET_FLAVOR}" (expected default, clientStrategy or ${TARGET_FLAVOR}ClientStrategy)`);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (VERBOSE)
|
|
125
|
+
console.log('[hmr-client] client strategy loaded for flavor:', TARGET_FLAVOR);
|
|
126
|
+
CLIENT_STRATEGY.install();
|
|
127
|
+
})
|
|
128
|
+
.catch((err) => {
|
|
129
|
+
console.warn('[hmr-client] failed to load client strategy for', TARGET_FLAVOR, err);
|
|
130
|
+
})
|
|
131
|
+
: Promise.resolve();
|
|
132
|
+
/** Undefined until `CLIENT_STRATEGY_READY` resolves (or when the flavor ships no client strategy). */
|
|
133
|
+
export function getClientStrategy() {
|
|
134
|
+
return CLIENT_STRATEGY;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=strategy-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy-loader.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/strategy-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAG/D,MAAM,OAAO,GAAG,WAAW,CAAC;AAE5B,SAAS,mBAAmB;IAC3B,IAAI,CAAC;QACJ,IAAI,OAAO,oBAAoB,KAAK,WAAW,IAAI,oBAAoB,EAAE,CAAC;YACzE,OAAO,oBAAoB,CAAC;QAC7B,CAAC;IACF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACJ,MAAM,CAAC,GAAQ,cAAc,EAAE,CAAC;QAChC,IAAI,OAAO,CAAC,CAAC,oBAAoB,KAAK,QAAQ,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;YAC1E,OAAO,CAAC,CAAC,oBAAoB,CAAC;QAC/B,CAAC;QACD,IAAI,OAAO,CAAC,CAAC,wCAAwC,KAAK,QAAQ,IAAI,CAAC,CAAC,wCAAwC,EAAE,CAAC;YAClH,OAAO,CAAC,CAAC,wCAAwC,CAAC;QACnD,CAAC;QACD,IAAI,OAAO,CAAC,CAAC,qBAAqB,KAAK,UAAU,EAAE,CAAC;Y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CAAC,CAAC;IACrF,CAAC,CAAC;IACJ,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;AAEtB,sGAAsG;AACtG,MAAM,UAAU,iBAAiB;IAChC,OAAO,eAAe,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update pipeline — graph state + the evict-then-reimport queue.
|
|
3
|
+
*
|
|
4
|
+
* Owns the client's view of the module graph (full-graph / delta application)
|
|
5
|
+
* and the changed-module queue that turns a delta into fresh module bodies on
|
|
6
|
+
* device. The ordering inside `processQueue` is load-bearing: explicit
|
|
7
|
+
* eviction MUST complete before re-import, or V8's module registry serves the
|
|
8
|
+
* stale cached module and the drain becomes a silent no-op.
|
|
9
|
+
*/
|
|
10
|
+
export declare function hasReceivedFirstFullGraph(): boolean;
|
|
11
|
+
export declare function markFullGraphReceived(): void;
|
|
12
|
+
export declare function applyFullGraph(payload: any): void;
|
|
13
|
+
export declare function applyDelta(payload: any): void;
|
|
14
|
+
export declare function processQueue(): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Full-graph resync fallback: the server chose to broadcast a fresh graph
|
|
17
|
+
* instead of a delta (reconnect, version drift). Infer which modules changed
|
|
18
|
+
* by hash-diffing against the previous snapshot and evict + re-import them —
|
|
19
|
+
* same V8-cache pitfall as `processQueue`, same eviction-first ordering.
|
|
20
|
+
* Without re-import, HTTP ESM caching means module bodies (and side effects)
|
|
21
|
+
* won't re-run.
|
|
22
|
+
*/
|
|
23
|
+
export declare function reimportInferredFullGraphChanges(prevGraph: Map<string, {
|
|
24
|
+
id: string;
|
|
25
|
+
deps: string[];
|
|
26
|
+
hash: string;
|
|
27
|
+
}>): Promise<void>;
|