@nativescript/vite 8.0.0-alpha.4 → 8.0.0-alpha.41
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 +376 -165
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +256 -30
- package/configuration/base.js.map +1 -1
- package/configuration/javascript.js +12 -90
- package/configuration/javascript.js.map +1 -1
- package/configuration/solid.js +33 -4
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +10 -90
- 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/config-as-json.js +10 -0
- package/helpers/config-as-json.js.map +1 -1
- package/helpers/css-platform-plugin.d.ts +14 -0
- package/helpers/css-platform-plugin.js +43 -25
- package/helpers/css-platform-plugin.js.map +1 -1
- package/helpers/dev-host.d.ts +360 -0
- package/helpers/dev-host.js +692 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/dynamic-import-plugin.js +1 -1
- 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 +54 -35
- package/helpers/external-configs.js.map +1 -1
- package/helpers/global-defines.d.ts +128 -0
- package/helpers/global-defines.js +174 -11
- package/helpers/global-defines.js.map +1 -1
- package/helpers/hmr-scope.d.ts +26 -0
- package/helpers/hmr-scope.js +67 -0
- package/helpers/hmr-scope.js.map +1 -0
- package/helpers/init.js +0 -18
- package/helpers/init.js.map +1 -1
- package/helpers/logging.d.ts +1 -0
- package/helpers/logging.js +65 -4
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +3 -1
- package/helpers/main-entry.js +444 -50
- package/helpers/main-entry.js.map +1 -1
- package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
- package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
- package/helpers/nativeclass-transform.js +5 -6
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
- package/helpers/nativeclass-transformer-plugin.js +157 -14
- 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 +106 -0
- package/helpers/ns-core-url.js +225 -0
- package/helpers/ns-core-url.js.map +1 -0
- package/helpers/optimize-deps.d.ts +16 -0
- package/helpers/optimize-deps.js +17 -0
- package/helpers/optimize-deps.js.map +1 -0
- package/helpers/package-platform-aliases.js +34 -49
- package/helpers/package-platform-aliases.js.map +1 -1
- package/helpers/platform-types.d.ts +2 -0
- package/helpers/platform-types.js +2 -0
- package/helpers/platform-types.js.map +1 -0
- package/helpers/postcss-platform-config.d.ts +17 -1
- package/helpers/postcss-platform-config.js +20 -37
- package/helpers/postcss-platform-config.js.map +1 -1
- package/helpers/project.d.ts +35 -0
- package/helpers/project.js +120 -2
- package/helpers/project.js.map +1 -1
- package/helpers/resolve-main-field-platform.d.ts +20 -0
- package/helpers/resolve-main-field-platform.js +49 -0
- package/helpers/resolve-main-field-platform.js.map +1 -0
- package/helpers/resolver.js +17 -2
- package/helpers/resolver.js.map +1 -1
- package/helpers/theme-core-plugins.js +1 -1
- package/helpers/theme-core-plugins.js.map +1 -1
- package/helpers/ts-config-paths.d.ts +14 -0
- package/helpers/ts-config-paths.js +90 -9
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +2 -1
- 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.js +1 -2
- package/helpers/utils.js.map +1 -1
- package/helpers/workers.d.ts +20 -19
- package/helpers/workers.js +624 -4
- 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 +13 -0
- package/hmr/client/hmr-pending-overlay.js +60 -0
- package/hmr/client/hmr-pending-overlay.js.map +1 -0
- package/hmr/client/index.js +820 -212
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/utils.d.ts +7 -1
- package/hmr/client/utils.js +207 -29
- package/hmr/client/utils.js.map +1 -1
- package/hmr/entry-runtime.d.ts +2 -1
- package/hmr/entry-runtime.js +256 -69
- 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.d.ts +1 -0
- package/hmr/frameworks/angular/client/index.js +803 -21
- 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 +460 -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 +17 -11
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +336 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.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/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 +36 -0
- package/hmr/frameworks/vue/client/dep-propagation.js +101 -0
- package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +8 -0
- package/hmr/frameworks/vue/client/index.js +56 -243
- 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/sfc-route-assemble.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js +747 -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 +459 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +38 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js +48 -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 +278 -1
- 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/server/constants.js +20 -5
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/core-sanitize.d.ts +90 -7
- package/hmr/server/core-sanitize.js +211 -56
- package/hmr/server/core-sanitize.js.map +1 -1
- package/hmr/server/device-transform-helpers.d.ts +24 -0
- package/hmr/server/device-transform-helpers.js +369 -0
- package/hmr/server/device-transform-helpers.js.map +1 -0
- package/hmr/server/framework-strategy.d.ts +108 -11
- package/hmr/server/hmr-module-graph.d.ts +37 -0
- package/hmr/server/hmr-module-graph.js +214 -0
- package/hmr/server/hmr-module-graph.js.map +1 -0
- package/hmr/server/import-map.d.ts +11 -2
- package/hmr/server/import-map.js +95 -44
- 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 +204 -0
- package/hmr/server/ns-core-cjs-shape.js +271 -0
- package/hmr/server/ns-core-cjs-shape.js.map +1 -0
- package/hmr/server/ns-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 +38 -0
- package/hmr/server/ns-rt-route.js.map +1 -0
- package/hmr/server/perf-instrumentation.d.ts +114 -0
- package/hmr/server/perf-instrumentation.js +197 -0
- package/hmr/server/perf-instrumentation.js.map +1 -0
- package/hmr/server/process-code-for-device.d.ts +14 -0
- package/hmr/server/process-code-for-device.js +702 -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 +600 -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 +13 -7
- 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.js +72 -42
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +45 -6
- package/hmr/server/websocket-core-bridge.js +81 -77
- 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-graph-upsert.d.ts +15 -0
- package/hmr/server/websocket-graph-upsert.js +20 -0
- package/hmr/server/websocket-graph-upsert.js.map +1 -1
- package/hmr/server/websocket-hmr-pending.d.ts +37 -0
- package/hmr/server/websocket-hmr-pending.js +55 -0
- package/hmr/server/websocket-hmr-pending.js.map +1 -0
- 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 +203 -20
- package/hmr/server/websocket-module-specifiers.js.map +1 -1
- package/hmr/server/websocket-ns-core.d.ts +21 -0
- package/hmr/server/websocket-ns-core.js +311 -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 -1
- package/hmr/server/websocket-ns-m-paths.js +58 -13
- 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 +18 -25
- package/hmr/server/websocket-ns-m-request.js.map +1 -1
- package/hmr/server/websocket-ns-m.d.ts +33 -0
- package/hmr/server/websocket-ns-m.js +752 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +82 -0
- package/hmr/server/websocket-served-module-helpers.js +879 -0
- package/hmr/server/websocket-served-module-helpers.js.map +1 -0
- package/hmr/server/websocket-txn.js +2 -8
- 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 +8 -39
- package/hmr/server/websocket.js +514 -4030
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +118 -0
- package/hmr/shared/ns-globals.js +29 -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-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 +133 -0
- package/hmr/shared/runtime/boot-progress.js.map +1 -0
- package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
- package/hmr/shared/runtime/boot-timeline.js +42 -0
- package/hmr/shared/runtime/boot-timeline.js.map +1 -0
- 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 +119 -26
- package/hmr/shared/runtime/dev-overlay.js +1153 -261
- 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 +371 -197
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +168 -4
- 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 +512 -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 +102 -741
- package/hmr/shared/vendor/manifest.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 +16 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +203 -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 +55 -11
- package/runtime/core-aliases-early.js +25 -55
- package/runtime/core-aliases-early.js.map +1 -1
- 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 +0 -239
- package/hmr/server/websocket-angular-hot-update.js.map +0 -1
- package/hmr/server/websocket-ns-m-finalize.d.ts +0 -32
- package/hmr/server/websocket-ns-m-finalize.js +0 -73
- 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 -35
- package/hmr/server/websocket-vue-sfc.js +0 -1116
- 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
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { deriveHttpOrigin, getCore, getCurrentApp, getGraphVersion, getHMRWsUrl, getHttpOriginForVite, normalizeSpec, safeDynImport, safeReadDefault, setCurrentApp } from '../../../client/utils.js';
|
|
2
|
+
import { getGlobalScope } from '../../../shared/runtime/global-scope.js';
|
|
2
3
|
const APP_VIRTUAL_WITH_SLASH = (() => {
|
|
3
|
-
|
|
4
|
+
// Define substitution does not reach this raw-served file; prefer the
|
|
5
|
+
// globalThis seed from the entry's defines-seed module ('app/'-rooted
|
|
6
|
+
// projects would otherwise get the wrong '/src' default).
|
|
7
|
+
const root = (typeof __NS_APP_ROOT_VIRTUAL__ === 'string' && __NS_APP_ROOT_VIRTUAL__) || (typeof getGlobalScope().__NS_APP_ROOT_VIRTUAL__ === 'string' && getGlobalScope().__NS_APP_ROOT_VIRTUAL__) || '/src';
|
|
4
8
|
return root.replace(/\/+$/, '') + '/';
|
|
5
9
|
})();
|
|
6
10
|
// Optional runtime knob: allow disabling assembler path in favor of variant-only flow
|
|
@@ -16,7 +20,7 @@ export const sfcArtifactMap = new Map();
|
|
|
16
20
|
// Install dev shims for nativescript-vue navigation to observe and (optionally) rescue
|
|
17
21
|
export function installNsVueDevShims() {
|
|
18
22
|
try {
|
|
19
|
-
const g =
|
|
23
|
+
const g = getGlobalScope();
|
|
20
24
|
const reg = g.__nsVendorRegistry;
|
|
21
25
|
const req = reg?.get ? g.__nsVendorRequire || g.__nsRequire || g.require : g.__nsRequire || g.require;
|
|
22
26
|
const getMod = (id) => {
|
|
@@ -48,13 +52,11 @@ export function installNsVueDevShims() {
|
|
|
48
52
|
paramKeys: Object.keys(params || {}),
|
|
49
53
|
});
|
|
50
54
|
}
|
|
55
|
+
// eslint-disable-next-line prefer-rest-params -- forwards all args verbatim to the patched original (arity-preserving)
|
|
51
56
|
return orig.apply(this, arguments);
|
|
52
57
|
}
|
|
53
58
|
catch (e) {
|
|
54
|
-
|
|
55
|
-
console.warn('[diag][nv][navigateTo][error]', (e && e.message) || e);
|
|
56
|
-
}
|
|
57
|
-
catch { }
|
|
59
|
+
console.warn('[diag][nv][navigateTo][error]', (e && e.message) || e);
|
|
58
60
|
try {
|
|
59
61
|
// Rescue path: attempt navigation via authoritative app Frame
|
|
60
62
|
return globalThis.__nsNavigateUsingApp?.(component, params);
|
|
@@ -89,13 +91,13 @@ export function installNsVueDevShims() {
|
|
|
89
91
|
catch { }
|
|
90
92
|
}
|
|
91
93
|
// initial root component for back fallback
|
|
92
|
-
|
|
94
|
+
const ORIG_ROOT_COMPONENT = null;
|
|
93
95
|
// Ensure Vue runtime global functions exist before evaluating SFC artifacts that rely on globalThis.* indirections.
|
|
94
96
|
export function ensureVueGlobals() {
|
|
95
97
|
try {
|
|
96
98
|
const g = globalThis;
|
|
97
99
|
const vueAlready = g.defineComponent && g.resolveComponent && g.createVNode;
|
|
98
|
-
const req =
|
|
100
|
+
const req = getGlobalScope().__nsVendorRegistry?.get ? getGlobalScope().__nsVendorRequire || getGlobalScope().__nsRequire || getGlobalScope().require : getGlobalScope().__nsRequire || getGlobalScope().require;
|
|
99
101
|
const registry = globalThis.__nsVendorRegistry;
|
|
100
102
|
let nvMod = null;
|
|
101
103
|
let vueMod = null;
|
|
@@ -321,7 +323,7 @@ export function ensurePiniaOnApp(app) {
|
|
|
321
323
|
try {
|
|
322
324
|
if (!app || typeof app.use !== 'function')
|
|
323
325
|
return;
|
|
324
|
-
const g =
|
|
326
|
+
const g = getGlobalScope();
|
|
325
327
|
// If this app already has a Pinia provide, skip
|
|
326
328
|
try {
|
|
327
329
|
const prov = app?._context?.provides;
|
|
@@ -438,7 +440,7 @@ function installBuiltInComponentsOnApp(app) {
|
|
|
438
440
|
try {
|
|
439
441
|
if (!app || typeof app.component !== 'function')
|
|
440
442
|
return;
|
|
441
|
-
const g =
|
|
443
|
+
const g = getGlobalScope();
|
|
442
444
|
const reg = g.__nsVendorRegistry;
|
|
443
445
|
const req = reg?.get ? g.__nsVendorRequire || g.__nsRequire || g.require : g.__nsRequire || g.require;
|
|
444
446
|
if (typeof req !== 'function')
|
|
@@ -519,7 +521,7 @@ async function syncPiniaAcrossEsm(app) {
|
|
|
519
521
|
}
|
|
520
522
|
function bridgePiniaProvides(app, existingApp) {
|
|
521
523
|
try {
|
|
522
|
-
const g =
|
|
524
|
+
const g = getGlobalScope();
|
|
523
525
|
if (!app || !app._context)
|
|
524
526
|
return;
|
|
525
527
|
const newProv = app._context.provides || (app._context.provides = {});
|
|
@@ -688,6 +690,16 @@ export function recordVuePayloadChanges(changed, graphVersion) {
|
|
|
688
690
|
if (sawVue)
|
|
689
691
|
sfcChangedVersion = graphVersion;
|
|
690
692
|
}
|
|
693
|
+
/**
|
|
694
|
+
* True when the delta for `version` included a `.vue` change. The dep-change
|
|
695
|
+
* propagation in `refreshAfterBatch` uses this to stand down for mixed batches:
|
|
696
|
+
* the SFC registry-update path will already remount with a freshly assembled
|
|
697
|
+
* artifact at this version, which links against the re-imported deps — a second
|
|
698
|
+
* resetRoot from propagation would just double the work (and the flash).
|
|
699
|
+
*/
|
|
700
|
+
export function sfcChangedInVersion(version) {
|
|
701
|
+
return sfcChangedVersion != null && sfcChangedVersion === version && sfcChangedIds.size > 0;
|
|
702
|
+
}
|
|
691
703
|
async function waitForSfcMapping(id, timeoutMs = 350) {
|
|
692
704
|
if (!/\.vue$/i.test(id))
|
|
693
705
|
return true;
|
|
@@ -730,7 +742,7 @@ function resolveSfcVariantSpec(id, type, cacheBustTag) {
|
|
|
730
742
|
return base + `?vue&type=${type}`;
|
|
731
743
|
const safePath = base.startsWith('/') ? base : '/' + base;
|
|
732
744
|
const ver = typeof getGraphVersion() === 'number' && getGraphVersion() > 0 ? String(getGraphVersion()) : '0';
|
|
733
|
-
|
|
745
|
+
const url = origin + `/ns/sfc/${ver}` + safePath + `?vue&type=${type}`;
|
|
734
746
|
return url;
|
|
735
747
|
}
|
|
736
748
|
// Resolve deterministic SFC assembler ESM module
|
|
@@ -750,48 +762,12 @@ function resolveSfcAssemblerSpec(id, cacheBustTag) {
|
|
|
750
762
|
catch { }
|
|
751
763
|
return url;
|
|
752
764
|
}
|
|
753
|
-
// Resolve metadata endpoint for an SFC
|
|
754
|
-
function resolveSfcMetaSpec(id, cacheBustTag) {
|
|
755
|
-
const origin = getHttpOriginForVite() || deriveHttpOrigin(getHMRWsUrl());
|
|
756
|
-
const base = id.split('?')[0];
|
|
757
|
-
if (!origin)
|
|
758
|
-
return base;
|
|
759
|
-
const safePath = base.startsWith('/') ? base : '/' + base;
|
|
760
|
-
const ver = typeof getGraphVersion() === 'number' && getGraphVersion() > 0 ? String(getGraphVersion()) : '0';
|
|
761
|
-
let url = origin + `/ns/sfc-meta/${ver}` + `?path=${encodeURIComponent(safePath)}`;
|
|
762
|
-
return url;
|
|
763
|
-
}
|
|
764
|
-
async function fetchSfcMeta(id, tag) {
|
|
765
|
-
try {
|
|
766
|
-
const url = resolveSfcMetaSpec(id, tag + '_meta');
|
|
767
|
-
const res = await fetch(url, { method: 'GET' });
|
|
768
|
-
if (!res.ok)
|
|
769
|
-
return null;
|
|
770
|
-
const json = await res.json();
|
|
771
|
-
return json;
|
|
772
|
-
}
|
|
773
|
-
catch {
|
|
774
|
-
return null;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
765
|
// Safely load a component for a .vue SFC. Prefer deterministic assembler first to avoid
|
|
778
766
|
// any variant-compile or TDZ flakiness; only fall back to variant assembly if needed.
|
|
779
767
|
export async function loadSfcComponent(targetVuePath, tag) {
|
|
780
768
|
// Minimal mode removed: always go through deterministic assembler + device reset
|
|
781
769
|
// Ensure Vue globals exist BEFORE evaluating variant modules; their top-level aliasing reads globalThis.* once.
|
|
782
770
|
ensureVueGlobals();
|
|
783
|
-
// Consult metadata to choose optimal path
|
|
784
|
-
let meta = null;
|
|
785
|
-
try {
|
|
786
|
-
meta = await fetchSfcMeta(targetVuePath, tag);
|
|
787
|
-
}
|
|
788
|
-
catch { }
|
|
789
|
-
if (__NS_ENV_VERBOSE__ && meta) {
|
|
790
|
-
try {
|
|
791
|
-
console.log('[hmr][vue-reset][meta]', targetVuePath, meta);
|
|
792
|
-
}
|
|
793
|
-
catch { }
|
|
794
|
-
}
|
|
795
771
|
// Prefer deterministic assembler first so AST normalization (including nav helpers) always applies.
|
|
796
772
|
try {
|
|
797
773
|
if (!DISABLE_ASM) {
|
|
@@ -817,22 +793,13 @@ export async function loadSfcComponent(targetVuePath, tag) {
|
|
|
817
793
|
// Now import the template render implementation
|
|
818
794
|
const templateMod = await safeDynImport(resolveSfcVariantSpec(targetVuePath, 'template', tag + '_template'));
|
|
819
795
|
if (__NS_ENV_VERBOSE__) {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
catch { }
|
|
828
|
-
try {
|
|
829
|
-
console.log('[hmr][vue-reset][diag] templateMod:', {
|
|
830
|
-
render: typeof templateMod?.render,
|
|
831
|
-
});
|
|
832
|
-
}
|
|
833
|
-
catch { }
|
|
834
|
-
}
|
|
835
|
-
catch { }
|
|
796
|
+
const sKeys = scriptMod ? Object.keys(scriptMod).join(',') : '<none>';
|
|
797
|
+
const tKeys = templateMod ? Object.keys(templateMod).join(',') : '<none>';
|
|
798
|
+
console.log('[hmr][vue-reset][diag] variant-imports', targetVuePath, 'script.keys=', sKeys, 'template.keys=', tKeys);
|
|
799
|
+
console.log('[hmr][vue-reset][diag] scriptMod:', scriptMod);
|
|
800
|
+
console.log('[hmr][vue-reset][diag] templateMod:', {
|
|
801
|
+
render: typeof templateMod?.render,
|
|
802
|
+
});
|
|
836
803
|
}
|
|
837
804
|
// Only use variant assembly when the script provides a real component options object.
|
|
838
805
|
const render = templateMod?.render;
|
|
@@ -878,10 +845,7 @@ export async function loadSfcComponent(targetVuePath, tag) {
|
|
|
878
845
|
catch { }
|
|
879
846
|
}
|
|
880
847
|
if (__NS_ENV_VERBOSE__) {
|
|
881
|
-
|
|
882
|
-
console.log('[hmr][vue-reset][diag] assembled.component (from script default) keys=', Object.keys(base).join(','), 'has.render=', !!base.render, 'components=', Object.keys(base.components || {}).join(','));
|
|
883
|
-
}
|
|
884
|
-
catch { }
|
|
848
|
+
console.log('[hmr][vue-reset][diag] assembled.component (from script default) keys=', Object.keys(base).join(','), 'has.render=', !!base.render, 'components=', Object.keys(base.components || {}).join(','));
|
|
885
849
|
}
|
|
886
850
|
return base;
|
|
887
851
|
}
|
|
@@ -909,8 +873,8 @@ export async function loadSfcComponent(targetVuePath, tag) {
|
|
|
909
873
|
// Synthesize a minimal component and attach named exports as local components so template resolveComponent works.
|
|
910
874
|
try {
|
|
911
875
|
ensureVueGlobals();
|
|
912
|
-
const comp =
|
|
913
|
-
?
|
|
876
|
+
const comp = getGlobalScope().defineComponent
|
|
877
|
+
? getGlobalScope().defineComponent({
|
|
914
878
|
name: targetVuePath.split('/').pop() || 'AnonymousSFC',
|
|
915
879
|
render,
|
|
916
880
|
})
|
|
@@ -931,10 +895,7 @@ export async function loadSfcComponent(targetVuePath, tag) {
|
|
|
931
895
|
catch { }
|
|
932
896
|
}
|
|
933
897
|
if (__NS_ENV_VERBOSE__) {
|
|
934
|
-
|
|
935
|
-
console.log('[hmr][vue-reset][diag] synthesized.component keys=', Object.keys(comp).join(','), 'components=', Object.keys(comp.components || {}).join(','));
|
|
936
|
-
}
|
|
937
|
-
catch { }
|
|
898
|
+
console.log('[hmr][vue-reset][diag] synthesized.component keys=', Object.keys(comp).join(','), 'components=', Object.keys(comp.components || {}).join(','));
|
|
938
899
|
}
|
|
939
900
|
return comp;
|
|
940
901
|
}
|
|
@@ -977,7 +938,7 @@ export function getRootForVue(newComponent, state) {
|
|
|
977
938
|
if (__NS_ENV_VERBOSE__)
|
|
978
939
|
console.log('[hmr-client] [createRoot] begin');
|
|
979
940
|
ensureVueGlobals();
|
|
980
|
-
const g =
|
|
941
|
+
const g = getGlobalScope();
|
|
981
942
|
const AppFactory = g.createApp;
|
|
982
943
|
let RootCtor = g.NSVRoot;
|
|
983
944
|
// Hygiene: unmount any existing app instance to avoid duplicate lifecycle hooks
|
|
@@ -1160,16 +1121,13 @@ export function getRootForVue(newComponent, state) {
|
|
|
1160
1121
|
const vm = typeof app.runWithContext === 'function' ? app.runWithContext(() => app.mount(root)) : app.mount(root);
|
|
1161
1122
|
setCurrentApp(app);
|
|
1162
1123
|
if (__NS_ENV_VERBOSE__) {
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
});
|
|
1171
|
-
}
|
|
1172
|
-
catch { }
|
|
1124
|
+
console.log('[hmr-client] [createRoot] mount result', {
|
|
1125
|
+
hasEl: !!vm?.$el,
|
|
1126
|
+
elType: vm?.$el?.constructor?.name,
|
|
1127
|
+
hasNativeView: !!vm?.$el?.nativeView,
|
|
1128
|
+
nativeViewType: vm?.$el?.nativeView?.constructor?.name,
|
|
1129
|
+
elapsedMs: Date.now() - t0,
|
|
1130
|
+
});
|
|
1173
1131
|
}
|
|
1174
1132
|
const findNativeView = (element) => {
|
|
1175
1133
|
if (element?.nativeView)
|
|
@@ -1216,9 +1174,18 @@ export function getRootForVue(newComponent, state) {
|
|
|
1216
1174
|
}
|
|
1217
1175
|
return null;
|
|
1218
1176
|
};
|
|
1219
|
-
//
|
|
1220
|
-
//
|
|
1221
|
-
|
|
1177
|
+
// Resolve the top-level native view from the component output. The previous logic
|
|
1178
|
+
// preferred ANY Frame found anywhere in the tree via depth-first recursion, which
|
|
1179
|
+
// is wrong when the component root is a Page that contains nested Frames (e.g.
|
|
1180
|
+
// a TabView whose TabViewItems each wrap their content in a <Frame>). That picked
|
|
1181
|
+
// the FIRST nested Frame and set it as the app root via resetRootView, severing
|
|
1182
|
+
// it from its TabViewItem parent and leaving a white screen on HMR reload.
|
|
1183
|
+
// Only fall back to the deep Frame/Page lookups when the top-level view is neither
|
|
1184
|
+
// (e.g., a raw Layout that the user intends to host an inner Frame for navigation).
|
|
1185
|
+
const topLevelNativeView = findNativeView(vm?.$el);
|
|
1186
|
+
const topCtorName = topLevelNativeView ? String(topLevelNativeView?.constructor?.name || '').replace(/^_+/, '') : '';
|
|
1187
|
+
const topIsPageOrFrame = /^(Page|Frame)(\$\d+)?$/.test(topCtorName);
|
|
1188
|
+
const nativeView = topIsPageOrFrame ? topLevelNativeView : findFrameNativeView(vm?.$el) || findPageNativeView(vm?.$el) || topLevelNativeView;
|
|
1222
1189
|
const GPage = getCore('Page');
|
|
1223
1190
|
// Decide root type and cache it
|
|
1224
1191
|
if (nativeView) {
|
|
@@ -1243,160 +1210,6 @@ export function getRootForVue(newComponent, state) {
|
|
|
1243
1210
|
state.setCachedRoot(nativeView);
|
|
1244
1211
|
return state.getCachedRoot();
|
|
1245
1212
|
}
|
|
1246
|
-
// Treat Frame$N as Frame as well
|
|
1247
|
-
if (ctorName === 'Frame_OLD_NEVER_REACHED') {
|
|
1248
|
-
// If a Frame is produced, prefer adopting the Frame as the new root to ensure a single authoritative Frame.
|
|
1249
|
-
// Extracting the Page and navigating a placeholder Frame can split realms and break app-controlled navigation.
|
|
1250
|
-
let pageCandidate = undefined;
|
|
1251
|
-
try {
|
|
1252
|
-
pageCandidate = nativeView.currentPage || nativeView._currentEntry?.resolvedPage;
|
|
1253
|
-
}
|
|
1254
|
-
catch { }
|
|
1255
|
-
if (pageCandidate) {
|
|
1256
|
-
if (__NS_ENV_VERBOSE__)
|
|
1257
|
-
console.log('[hmr-client] [createRoot] Frame root with currentPage detected; adopting Frame as root');
|
|
1258
|
-
state.setRootKind('frame');
|
|
1259
|
-
state.setCachedRoot(nativeView);
|
|
1260
|
-
return state.getCachedRoot();
|
|
1261
|
-
}
|
|
1262
|
-
// No currentPage yet; construct a Page wrapper and mount the component inside it
|
|
1263
|
-
try {
|
|
1264
|
-
if (__NS_ENV_VERBOSE__)
|
|
1265
|
-
console.log('[hmr-client] [createRoot] no currentPage; creating Page wrapper for navigation-first');
|
|
1266
|
-
const registry = globalThis.__nsVendorRegistry;
|
|
1267
|
-
const req = registry?.get ? globalThis.__nsVendorRequire || globalThis.__nsRequire || globalThis.require : globalThis.__nsRequire || globalThis.require;
|
|
1268
|
-
let vueMod = null;
|
|
1269
|
-
if (registry && registry.has('vue'))
|
|
1270
|
-
vueMod = registry.get('vue');
|
|
1271
|
-
if (!vueMod && typeof req === 'function') {
|
|
1272
|
-
try {
|
|
1273
|
-
vueMod = req('vue');
|
|
1274
|
-
}
|
|
1275
|
-
catch { }
|
|
1276
|
-
}
|
|
1277
|
-
const h = vueMod?.h;
|
|
1278
|
-
const WrappedRoot = h
|
|
1279
|
-
? {
|
|
1280
|
-
name: 'HMRPageWrapper',
|
|
1281
|
-
setup() {
|
|
1282
|
-
return () => h('Page', null, [h(newComponent)]);
|
|
1283
|
-
},
|
|
1284
|
-
}
|
|
1285
|
-
: null;
|
|
1286
|
-
if (WrappedRoot) {
|
|
1287
|
-
const g = globalThis;
|
|
1288
|
-
const AppFactory = g.createApp;
|
|
1289
|
-
let app2 = AppFactory(WrappedRoot);
|
|
1290
|
-
try {
|
|
1291
|
-
const reg2 = g.__nsVendorRegistry;
|
|
1292
|
-
const req2 = reg2?.get ? g.__nsVendorRequire || g.__nsRequire || g.require : g.__nsRequire || g.require;
|
|
1293
|
-
let rh2 = null;
|
|
1294
|
-
if (reg2 && reg2.has('nativescript-vue/dist/runtimeHelpers'))
|
|
1295
|
-
rh2 = reg2.get('nativescript-vue/dist/runtimeHelpers');
|
|
1296
|
-
if (!rh2 && typeof req2 === 'function') {
|
|
1297
|
-
try {
|
|
1298
|
-
rh2 = req2('nativescript-vue/dist/runtimeHelpers');
|
|
1299
|
-
}
|
|
1300
|
-
catch { }
|
|
1301
|
-
}
|
|
1302
|
-
const setRootApp2a = rh2 && (rh2.setRootApp || rh2.default?.setRootApp);
|
|
1303
|
-
if (typeof setRootApp2a === 'function')
|
|
1304
|
-
setRootApp2a(app2);
|
|
1305
|
-
try {
|
|
1306
|
-
let nv2 = null;
|
|
1307
|
-
if (reg2 && reg2.has('nativescript-vue'))
|
|
1308
|
-
nv2 = reg2.get('nativescript-vue');
|
|
1309
|
-
if (!nv2 && typeof req2 === 'function') {
|
|
1310
|
-
try {
|
|
1311
|
-
nv2 = req2('nativescript-vue');
|
|
1312
|
-
}
|
|
1313
|
-
catch { }
|
|
1314
|
-
}
|
|
1315
|
-
const setRootApp2b = nv2 && (nv2.setRootApp || nv2.default?.setRootApp);
|
|
1316
|
-
if (typeof setRootApp2b === 'function')
|
|
1317
|
-
setRootApp2b(app2);
|
|
1318
|
-
}
|
|
1319
|
-
catch { }
|
|
1320
|
-
}
|
|
1321
|
-
catch { }
|
|
1322
|
-
try {
|
|
1323
|
-
const hook = globalThis.__NS_HMR_INSTALL_PLUGINS__;
|
|
1324
|
-
if (typeof hook === 'function')
|
|
1325
|
-
hook(app2);
|
|
1326
|
-
}
|
|
1327
|
-
catch { }
|
|
1328
|
-
try {
|
|
1329
|
-
ensurePiniaOnApp(app2);
|
|
1330
|
-
}
|
|
1331
|
-
catch { }
|
|
1332
|
-
try {
|
|
1333
|
-
bridgePiniaProvides(app2, getCurrentApp() || globalThis.__NS_VUE_APP__);
|
|
1334
|
-
}
|
|
1335
|
-
catch { }
|
|
1336
|
-
try {
|
|
1337
|
-
installBuiltInComponentsOnApp(app2);
|
|
1338
|
-
}
|
|
1339
|
-
catch { }
|
|
1340
|
-
const RootCtor2 = globalThis.NSVRoot || RootCtor;
|
|
1341
|
-
const root2 = new RootCtor2();
|
|
1342
|
-
const vm2 = typeof app2.runWithContext === 'function' ? app2.runWithContext(() => app2.mount(root2)) : app2.mount(root2);
|
|
1343
|
-
setCurrentApp(app2);
|
|
1344
|
-
const findNativeView2 = (element) => {
|
|
1345
|
-
if (element?.nativeView)
|
|
1346
|
-
return element.nativeView;
|
|
1347
|
-
const kids = element?.childNodes || element?.children || [];
|
|
1348
|
-
for (const c of kids) {
|
|
1349
|
-
const r = findNativeView2(c);
|
|
1350
|
-
if (r)
|
|
1351
|
-
return r;
|
|
1352
|
-
}
|
|
1353
|
-
return null;
|
|
1354
|
-
};
|
|
1355
|
-
const findPageNativeView2 = (element) => {
|
|
1356
|
-
if (!element)
|
|
1357
|
-
return null;
|
|
1358
|
-
const nv = element.nativeView;
|
|
1359
|
-
if (nv) {
|
|
1360
|
-
const ctorName = String(nv?.constructor?.name || '').replace(/^_+/, '');
|
|
1361
|
-
if (ctorName === 'Page' || /^Page(\$\d+)?$/.test(ctorName))
|
|
1362
|
-
return nv;
|
|
1363
|
-
}
|
|
1364
|
-
const kids = element?.childNodes || element?.children || [];
|
|
1365
|
-
for (const k of kids) {
|
|
1366
|
-
const r = findPageNativeView2(k);
|
|
1367
|
-
if (r)
|
|
1368
|
-
return r;
|
|
1369
|
-
}
|
|
1370
|
-
return null;
|
|
1371
|
-
};
|
|
1372
|
-
const nv2 = findPageNativeView2(vm2?.$el) || findNativeView2(vm2?.$el);
|
|
1373
|
-
const ctor2 = String(nv2?.constructor?.name || '').replace(/^_+/, '');
|
|
1374
|
-
if (ctor2 === 'Page' || /^Page(\$\d+)?$/.test(ctor2)) {
|
|
1375
|
-
// Hide wrapper ActionBar to avoid double bars when a Frame is nested inside
|
|
1376
|
-
try {
|
|
1377
|
-
nv2.actionBarHidden = true;
|
|
1378
|
-
}
|
|
1379
|
-
catch { }
|
|
1380
|
-
if (__NS_ENV_VERBOSE__)
|
|
1381
|
-
console.log('[hmr-client] [createRoot] Page wrapper created successfully');
|
|
1382
|
-
state.setRootKind('page');
|
|
1383
|
-
state.setCachedRoot(nv2);
|
|
1384
|
-
return state.getCachedRoot();
|
|
1385
|
-
}
|
|
1386
|
-
if (__NS_ENV_VERBOSE__)
|
|
1387
|
-
console.warn('[hmr-client] [createRoot] Page wrapper did not yield Page; got', ctor2);
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
catch (e) {
|
|
1391
|
-
if (__NS_ENV_VERBOSE__)
|
|
1392
|
-
console.warn('[hmr-client] [createRoot] Page wrapper attempt failed', e);
|
|
1393
|
-
}
|
|
1394
|
-
if (__NS_ENV_VERBOSE__)
|
|
1395
|
-
console.log('[hmr-client] [createRoot] root kind=frame (no currentPage)');
|
|
1396
|
-
state.setRootKind('frame');
|
|
1397
|
-
state.setCachedRoot(nativeView);
|
|
1398
|
-
return state.getCachedRoot();
|
|
1399
|
-
}
|
|
1400
1213
|
if (GPage) {
|
|
1401
1214
|
const page = new GPage();
|
|
1402
1215
|
page.content = nativeView;
|
|
@@ -1431,7 +1244,7 @@ export function getRootForVue(newComponent, state) {
|
|
|
1431
1244
|
*/
|
|
1432
1245
|
export function ensureBackWrapperInstalled(performResetRoot, getCore) {
|
|
1433
1246
|
try {
|
|
1434
|
-
const g =
|
|
1247
|
+
const g = getGlobalScope();
|
|
1435
1248
|
// Provide global back-remount hooks for bridges to call
|
|
1436
1249
|
if (!g.__nsAttemptBackRemount) {
|
|
1437
1250
|
g.__nsAttemptBackRemount = () => {
|