@nativescript/vite 8.0.0-alpha.7 → 8.0.0-alpha.70
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 +293 -172
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +177 -110
- package/configuration/base.js.map +1 -1
- package/configuration/javascript.js +14 -93
- package/configuration/javascript.js.map +1 -1
- package/configuration/react.js +41 -73
- package/configuration/react.js.map +1 -1
- package/configuration/solid.js +51 -6
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +12 -93
- package/configuration/typescript.js.map +1 -1
- package/helpers/app-components.d.ts +2 -1
- package/helpers/app-components.js.map +1 -1
- package/helpers/app-css-refresh.d.ts +31 -0
- package/helpers/app-css-refresh.js +43 -0
- package/helpers/app-css-refresh.js.map +1 -0
- package/helpers/app-css-state.d.ts +17 -0
- package/helpers/app-css-state.js +51 -0
- package/helpers/app-css-state.js.map +1 -0
- package/helpers/bundler-context.d.ts +11 -0
- package/helpers/bundler-context.js +71 -0
- package/helpers/bundler-context.js.map +1 -0
- package/helpers/cli-flags.d.ts +12 -0
- package/helpers/cli-flags.js +34 -0
- package/helpers/cli-flags.js.map +1 -1
- package/helpers/css-platform-plugin.d.ts +14 -0
- package/helpers/css-platform-plugin.js +43 -25
- package/helpers/css-platform-plugin.js.map +1 -1
- package/helpers/dev-host.d.ts +360 -0
- package/helpers/dev-host.js +694 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/dynamic-import-plugin.js +9 -4
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +4 -1
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -12
- package/helpers/external-configs.js +58 -35
- package/helpers/external-configs.js.map +1 -1
- package/helpers/flavor.d.ts +13 -0
- package/helpers/flavor.js +17 -0
- package/helpers/flavor.js.map +1 -1
- package/helpers/global-defines.d.ts +101 -33
- package/helpers/global-defines.js +187 -64
- package/helpers/global-defines.js.map +1 -1
- package/helpers/hmr-scope.d.ts +26 -0
- package/helpers/hmr-scope.js +67 -0
- package/helpers/hmr-scope.js.map +1 -0
- package/helpers/init.js +0 -18
- package/helpers/init.js.map +1 -1
- package/helpers/logging.js +29 -1
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +4 -1
- package/helpers/main-entry.js +366 -47
- package/helpers/main-entry.js.map +1 -1
- package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
- package/helpers/nativeclass-esbuild-plugin.js +6 -1
- package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
- package/helpers/nativeclass-transform.d.ts +13 -0
- package/helpers/nativeclass-transform.js +37 -7
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
- package/helpers/nativeclass-transformer-plugin.js +163 -15
- package/helpers/nativeclass-transformer-plugin.js.map +1 -1
- package/helpers/nativescript-package-resolver.js +10 -62
- package/helpers/nativescript-package-resolver.js.map +1 -1
- package/helpers/normalize-id.d.ts +42 -0
- package/helpers/normalize-id.js +60 -0
- package/helpers/normalize-id.js.map +1 -0
- package/helpers/ns-core-external-urls.d.ts +32 -0
- package/helpers/ns-core-external-urls.js +107 -0
- package/helpers/ns-core-external-urls.js.map +1 -0
- package/helpers/ns-core-url.d.ts +26 -3
- package/helpers/ns-core-url.js +66 -8
- package/helpers/ns-core-url.js.map +1 -1
- package/helpers/optimize-deps.d.ts +16 -0
- package/helpers/optimize-deps.js +17 -0
- package/helpers/optimize-deps.js.map +1 -0
- package/helpers/package-platform-aliases.js +34 -49
- package/helpers/package-platform-aliases.js.map +1 -1
- package/helpers/platform-types.d.ts +2 -0
- package/helpers/platform-types.js +2 -0
- package/helpers/platform-types.js.map +1 -0
- package/helpers/postcss-platform-config.d.ts +17 -1
- package/helpers/postcss-platform-config.js +20 -37
- package/helpers/postcss-platform-config.js.map +1 -1
- package/helpers/project.d.ts +35 -0
- package/helpers/project.js +120 -2
- package/helpers/project.js.map +1 -1
- package/helpers/resolve-main-field-platform.d.ts +20 -0
- package/helpers/resolve-main-field-platform.js +49 -0
- package/helpers/resolve-main-field-platform.js.map +1 -0
- package/helpers/resolver.js +17 -2
- package/helpers/resolver.js.map +1 -1
- package/helpers/theme-core-plugins.js +1 -1
- package/helpers/theme-core-plugins.js.map +1 -1
- package/helpers/ts-config-paths.d.ts +32 -0
- package/helpers/ts-config-paths.js +156 -27
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +2 -1
- package/helpers/typescript-check.js +4 -4
- package/helpers/typescript-check.js.map +1 -1
- package/helpers/ui-registration.d.ts +21 -0
- package/helpers/ui-registration.js +156 -0
- package/helpers/ui-registration.js.map +1 -0
- package/helpers/utils.d.ts +9 -0
- package/helpers/utils.js +22 -2
- package/helpers/utils.js.map +1 -1
- package/helpers/vite-package-version.d.ts +7 -0
- package/helpers/vite-package-version.js +44 -0
- package/helpers/vite-package-version.js.map +1 -0
- package/helpers/workers.d.ts +40 -19
- package/helpers/workers.js +324 -13
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +63 -32
- package/hmr/client/css-handler.js.map +1 -1
- package/hmr/client/css-update-overlay.d.ts +18 -0
- package/hmr/client/css-update-overlay.js +27 -0
- package/hmr/client/css-update-overlay.js.map +1 -0
- package/hmr/client/framework-client-strategy.d.ts +87 -0
- package/hmr/client/framework-client-strategy.js +18 -0
- package/hmr/client/framework-client-strategy.js.map +1 -0
- package/hmr/client/hmr-pending-overlay.d.ts +0 -14
- package/hmr/client/hmr-pending-overlay.js +2 -11
- package/hmr/client/hmr-pending-overlay.js.map +1 -1
- package/hmr/client/hot-context.d.ts +67 -0
- package/hmr/client/hot-context.js +307 -0
- package/hmr/client/hot-context.js.map +1 -0
- package/hmr/client/index.d.ts +9 -1
- package/hmr/client/index.js +70 -1970
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/overlay-driver.d.ts +10 -0
- package/hmr/client/overlay-driver.js +33 -0
- package/hmr/client/overlay-driver.js.map +1 -0
- package/hmr/client/protocol-dispatch.d.ts +8 -0
- package/hmr/client/protocol-dispatch.js +308 -0
- package/hmr/client/protocol-dispatch.js.map +1 -0
- package/hmr/client/root-reset.d.ts +15 -0
- package/hmr/client/root-reset.js +358 -0
- package/hmr/client/root-reset.js.map +1 -0
- package/hmr/client/strategy-loader.d.ts +24 -0
- package/hmr/client/strategy-loader.js +83 -0
- package/hmr/client/strategy-loader.js.map +1 -0
- package/hmr/client/update-pipeline.d.ts +27 -0
- package/hmr/client/update-pipeline.js +464 -0
- package/hmr/client/update-pipeline.js.map +1 -0
- package/hmr/client/utils.d.ts +9 -1
- package/hmr/client/utils.js +117 -97
- package/hmr/client/utils.js.map +1 -1
- package/hmr/client/ws-transport.d.ts +21 -0
- package/hmr/client/ws-transport.js +323 -0
- package/hmr/client/ws-transport.js.map +1 -0
- package/hmr/entry-runtime.d.ts +2 -1
- package/hmr/entry-runtime.js +282 -71
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
- package/hmr/frameworks/angular/build/angular-linker.js +113 -0
- package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
- package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
- package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
- package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
- package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
- package/hmr/frameworks/angular/build/linker-stats.js +29 -0
- package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
- package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
- package/hmr/frameworks/angular/build/shared-linker.js +128 -0
- package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
- package/hmr/frameworks/angular/build/util.js +155 -0
- package/hmr/frameworks/angular/build/util.js.map +1 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
- package/hmr/frameworks/angular/client/index.d.ts +0 -1
- package/hmr/frameworks/angular/client/index.js +459 -223
- package/hmr/frameworks/angular/client/index.js.map +1 -1
- package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
- package/hmr/frameworks/angular/client/strategy.js +19 -0
- package/hmr/frameworks/angular/client/strategy.js.map +1 -0
- package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
- package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
- package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
- package/hmr/frameworks/angular/server/linker.js +1 -4
- package/hmr/frameworks/angular/server/linker.js.map +1 -1
- package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
- package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
- package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
- package/hmr/frameworks/angular/server/strategy.js +677 -13
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
- package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +28 -11
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.js +191 -105
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
- package/hmr/frameworks/react/client/strategy.d.ts +12 -0
- package/hmr/frameworks/react/client/strategy.js +27 -0
- package/hmr/frameworks/react/client/strategy.js.map +1 -0
- package/hmr/frameworks/react/server/strategy.d.ts +2 -0
- package/hmr/frameworks/react/server/strategy.js +230 -0
- package/hmr/frameworks/react/server/strategy.js.map +1 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
- package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
- package/hmr/frameworks/solid/client/app-runtime.js +252 -0
- package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
- package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
- package/hmr/frameworks/solid/client/strategy.js +391 -0
- package/hmr/frameworks/solid/client/strategy.js.map +1 -0
- package/hmr/frameworks/solid/server/strategy.js +293 -16
- package/hmr/frameworks/solid/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
- package/hmr/frameworks/typescript/client/strategy.js +418 -0
- package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
- package/hmr/frameworks/typescript/server/strategy.js +40 -14
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
- package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
- package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +10 -1
- package/hmr/frameworks/vue/client/index.js +287 -562
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
- package/hmr/frameworks/vue/client/navigate-app.js +178 -0
- package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
- package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
- package/hmr/frameworks/vue/client/strategy.js +152 -0
- package/hmr/frameworks/vue/client/strategy.js.map +1 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
- package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
- package/hmr/frameworks/vue/server/compiler.js +3 -1
- package/hmr/frameworks/vue/server/compiler.js.map +1 -1
- package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
- package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
- package/hmr/frameworks/vue/server/strategy.js +291 -7
- package/hmr/frameworks/vue/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
- package/hmr/helpers/ast-normalizer.d.ts +3 -1
- package/hmr/helpers/ast-normalizer.js +109 -14
- package/hmr/helpers/ast-normalizer.js.map +1 -1
- package/hmr/helpers/cjs-named-exports.d.ts +23 -0
- package/hmr/helpers/cjs-named-exports.js +152 -0
- package/hmr/helpers/cjs-named-exports.js.map +1 -0
- package/hmr/helpers/package-exports.d.ts +16 -0
- package/hmr/helpers/package-exports.js +396 -0
- package/hmr/helpers/package-exports.js.map +1 -0
- package/hmr/helpers/vendor-rewrite.d.ts +1 -1
- package/hmr/helpers/vendor-rewrite.js +5 -3
- package/hmr/helpers/vendor-rewrite.js.map +1 -1
- package/hmr/server/boot-recording.d.ts +51 -0
- package/hmr/server/boot-recording.js +214 -0
- package/hmr/server/boot-recording.js.map +1 -0
- package/hmr/server/constants.js +20 -5
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/content-css-update.d.ts +54 -0
- package/hmr/server/content-css-update.js +78 -0
- package/hmr/server/content-css-update.js.map +1 -0
- package/hmr/server/core-bundle.d.ts +140 -0
- package/hmr/server/core-bundle.js +614 -0
- package/hmr/server/core-bundle.js.map +1 -0
- package/hmr/server/core-sanitize.d.ts +86 -7
- package/hmr/server/core-sanitize.js +164 -39
- package/hmr/server/core-sanitize.js.map +1 -1
- package/hmr/server/css-connect-sync.d.ts +28 -0
- package/hmr/server/css-connect-sync.js +59 -0
- package/hmr/server/css-connect-sync.js.map +1 -0
- package/hmr/server/css-device-module.d.ts +28 -0
- package/hmr/server/css-device-module.js +44 -0
- package/hmr/server/css-device-module.js.map +1 -0
- package/hmr/server/css-update-message.d.ts +23 -0
- package/hmr/server/css-update-message.js +41 -0
- package/hmr/server/css-update-message.js.map +1 -0
- package/hmr/server/deps-bundle.d.ts +233 -0
- package/hmr/server/deps-bundle.js +1022 -0
- package/hmr/server/deps-bundle.js.map +1 -0
- package/hmr/server/device-transform-helpers.d.ts +24 -0
- package/hmr/server/device-transform-helpers.js +408 -0
- package/hmr/server/device-transform-helpers.js.map +1 -0
- package/hmr/server/framework-strategy.d.ts +182 -11
- package/hmr/server/hmr-module-graph.d.ts +37 -0
- package/hmr/server/hmr-module-graph.js +215 -0
- package/hmr/server/hmr-module-graph.js.map +1 -0
- package/hmr/server/import-map.d.ts +51 -19
- package/hmr/server/import-map.js +136 -66
- package/hmr/server/import-map.js.map +1 -1
- package/hmr/server/index.js +7 -16
- package/hmr/server/index.js.map +1 -1
- package/hmr/server/node-builtins-route.d.ts +12 -0
- package/hmr/server/node-builtins-route.js +86 -0
- package/hmr/server/node-builtins-route.js.map +1 -0
- package/hmr/server/ns-core-cjs-shape.js +1 -1
- package/hmr/server/ns-core-cjs-shape.js.map +1 -1
- package/hmr/server/ns-m-response-memo.d.ts +10 -0
- package/hmr/server/ns-m-response-memo.js +33 -0
- package/hmr/server/ns-m-response-memo.js.map +1 -0
- package/hmr/server/ns-rt-bridge.d.ts +51 -0
- package/hmr/server/ns-rt-bridge.js +131 -0
- package/hmr/server/ns-rt-bridge.js.map +1 -0
- package/hmr/server/ns-rt-route.d.ts +5 -0
- package/hmr/server/ns-rt-route.js +39 -0
- package/hmr/server/ns-rt-route.js.map +1 -0
- package/hmr/server/perf-instrumentation.d.ts +1 -1
- package/hmr/server/perf-instrumentation.js +3 -1
- package/hmr/server/perf-instrumentation.js.map +1 -1
- package/hmr/server/process-code-for-device.d.ts +44 -0
- package/hmr/server/process-code-for-device.js +834 -0
- package/hmr/server/process-code-for-device.js.map +1 -0
- package/hmr/server/require-guard.d.ts +1 -0
- package/hmr/server/require-guard.js +12 -0
- package/hmr/server/require-guard.js.map +1 -0
- package/hmr/server/rewrite-imports.d.ts +2 -0
- package/hmr/server/rewrite-imports.js +631 -0
- package/hmr/server/rewrite-imports.js.map +1 -0
- package/hmr/server/route-helpers.d.ts +7 -0
- package/hmr/server/route-helpers.js +13 -0
- package/hmr/server/route-helpers.js.map +1 -0
- package/hmr/server/runtime-graph-filter.js +8 -1
- package/hmr/server/runtime-graph-filter.js.map +1 -1
- package/hmr/server/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +88 -0
- package/hmr/server/server-origin.js.map +1 -0
- package/hmr/server/shared-transform-request.js +1 -2
- package/hmr/server/shared-transform-request.js.map +1 -1
- package/hmr/server/socket-utils.d.ts +10 -0
- package/hmr/server/socket-utils.js +14 -0
- package/hmr/server/socket-utils.js.map +1 -0
- package/hmr/server/transform-cache-invalidation.d.ts +37 -0
- package/hmr/server/transform-cache-invalidation.js +156 -0
- package/hmr/server/transform-cache-invalidation.js.map +1 -0
- package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
- package/hmr/server/vendor-bare-module-shims.js +80 -0
- package/hmr/server/vendor-bare-module-shims.js.map +1 -0
- package/hmr/server/vite-plugin.d.ts +1 -0
- package/hmr/server/vite-plugin.js +227 -53
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +51 -4
- package/hmr/server/websocket-core-bridge.js +62 -49
- package/hmr/server/websocket-core-bridge.js.map +1 -1
- package/hmr/server/websocket-device-transform.d.ts +3 -0
- package/hmr/server/websocket-device-transform.js +7 -0
- package/hmr/server/websocket-device-transform.js.map +1 -0
- package/hmr/server/websocket-hmr-pending.d.ts +2 -16
- package/hmr/server/websocket-hmr-pending.js +0 -22
- package/hmr/server/websocket-hmr-pending.js.map +1 -1
- package/hmr/server/websocket-hot-update.d.ts +80 -0
- package/hmr/server/websocket-hot-update.js +295 -0
- package/hmr/server/websocket-hot-update.js.map +1 -0
- package/hmr/server/websocket-import-map-route.d.ts +15 -0
- package/hmr/server/websocket-import-map-route.js +51 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.d.ts +15 -0
- package/hmr/server/websocket-module-bindings.js +38 -5
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +66 -7
- package/hmr/server/websocket-module-specifiers.js +219 -49
- package/hmr/server/websocket-module-specifiers.js.map +1 -1
- package/hmr/server/websocket-ns-core.d.ts +34 -0
- package/hmr/server/websocket-ns-core.js +414 -0
- package/hmr/server/websocket-ns-core.js.map +1 -0
- package/hmr/server/websocket-ns-entry.d.ts +21 -0
- package/hmr/server/websocket-ns-entry.js +164 -0
- package/hmr/server/websocket-ns-entry.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +19 -3
- package/hmr/server/websocket-ns-m-paths.js +98 -75
- package/hmr/server/websocket-ns-m-paths.js.map +1 -1
- package/hmr/server/websocket-ns-m-request.d.ts +13 -2
- package/hmr/server/websocket-ns-m-request.js +20 -11
- package/hmr/server/websocket-ns-m-request.js.map +1 -1
- package/hmr/server/websocket-ns-m.d.ts +52 -0
- package/hmr/server/websocket-ns-m.js +590 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +57 -4
- package/hmr/server/websocket-served-module-helpers.js +462 -141
- package/hmr/server/websocket-served-module-helpers.js.map +1 -1
- package/hmr/server/websocket-txn.js +6 -9
- package/hmr/server/websocket-txn.js.map +1 -1
- package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
- package/hmr/server/websocket-vendor-unifier.js +4 -9
- package/hmr/server/websocket-vendor-unifier.js.map +1 -1
- package/hmr/server/websocket.d.ts +7 -40
- package/hmr/server/websocket.js +653 -6734
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +106 -0
- package/hmr/shared/ns-globals.js +29 -0
- package/hmr/shared/ns-globals.js.map +1 -0
- package/hmr/shared/protocol.d.ts +157 -0
- package/hmr/shared/protocol.js +28 -0
- package/hmr/shared/protocol.js.map +1 -0
- package/hmr/shared/runtime/boot-complete.d.ts +14 -0
- package/hmr/shared/runtime/boot-complete.js +32 -0
- package/hmr/shared/runtime/boot-complete.js.map +1 -0
- package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
- package/hmr/shared/runtime/boot-progress.d.ts +44 -0
- package/hmr/shared/runtime/boot-progress.js +134 -0
- package/hmr/shared/runtime/boot-progress.js.map +1 -0
- package/hmr/shared/runtime/boot-timeline.d.ts +1 -1
- package/hmr/shared/runtime/boot-timeline.js +8 -19
- package/hmr/shared/runtime/boot-timeline.js.map +1 -1
- package/hmr/shared/runtime/browser-runtime-contract.d.ts +43 -24
- package/hmr/shared/runtime/browser-runtime-contract.js +21 -9
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
- package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
- package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
- package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
- package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
- package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
- package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
- package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay.d.ts +23 -69
- package/hmr/shared/runtime/dev-overlay.js +67 -1023
- package/hmr/shared/runtime/dev-overlay.js.map +1 -1
- package/hmr/shared/runtime/global-scope.d.ts +18 -0
- package/hmr/shared/runtime/global-scope.js +21 -0
- package/hmr/shared/runtime/global-scope.js.map +1 -0
- package/hmr/shared/runtime/hooks.js +2 -1
- package/hmr/shared/runtime/hooks.js.map +1 -1
- package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
- package/hmr/shared/runtime/launch-bridge.js +98 -0
- package/hmr/shared/runtime/launch-bridge.js.map +1 -0
- package/hmr/shared/runtime/module-provenance.js +4 -6
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
- package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
- package/hmr/shared/runtime/overlay-flag.js +34 -0
- package/hmr/shared/runtime/overlay-flag.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
- package/hmr/shared/runtime/root-placeholder-view.js +311 -0
- package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder.js +401 -206
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +203 -58
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
- package/hmr/shared/runtime/vendor-resolve.js +45 -0
- package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
- package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +909 -0
- package/hmr/shared/vendor/manifest-collect.js.map +1 -0
- package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
- package/hmr/shared/vendor/manifest-loader.js +5 -3
- package/hmr/shared/vendor/manifest-loader.js.map +1 -1
- package/hmr/shared/vendor/manifest.d.ts +12 -7
- package/hmr/shared/vendor/manifest.js +180 -826
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/hmr/shared/vendor/registry.d.ts +2 -0
- package/hmr/shared/vendor/registry.js +14 -0
- package/hmr/shared/vendor/registry.js.map +1 -1
- package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
- package/hmr/shared/vendor/vendor-device-shim.js +208 -0
- package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +65 -13
- package/runtime/core-aliases-early.js +28 -57
- package/runtime/core-aliases-early.js.map +1 -1
- package/shims/react-jsx-runtime.d.ts +4 -0
- package/shims/react-jsx-runtime.js +61 -0
- package/shims/react-jsx-runtime.js.map +1 -0
- package/helpers/angular/angular-linker.d.ts +0 -13
- package/helpers/angular/angular-linker.js +0 -194
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
- package/helpers/angular/shared-linker.d.ts +0 -11
- package/helpers/angular/shared-linker.js +0 -75
- package/helpers/angular/shared-linker.js.map +0 -1
- package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
- package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
- package/helpers/angular/util.js +0 -67
- package/helpers/angular/util.js.map +0 -1
- package/helpers/module-runner-patch.d.ts +0 -3
- package/helpers/module-runner-patch.js +0 -63
- package/helpers/module-runner-patch.js.map +0 -1
- package/helpers/prelink-angular.d.ts +0 -2
- package/helpers/prelink-angular.js +0 -117
- package/helpers/prelink-angular.js.map +0 -1
- package/hmr/server/websocket-angular-entry.js.map +0 -1
- package/hmr/server/websocket-angular-hot-update.js.map +0 -1
- package/hmr/server/websocket-ns-m-finalize.d.ts +0 -22
- package/hmr/server/websocket-ns-m-finalize.js +0 -88
- package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
- package/hmr/server/websocket-runtime-compat.d.ts +0 -19
- package/hmr/server/websocket-runtime-compat.js +0 -287
- package/hmr/server/websocket-runtime-compat.js.map +0 -1
- package/hmr/server/websocket-vue-sfc.d.ts +0 -27
- package/hmr/server/websocket-vue-sfc.js +0 -1114
- package/hmr/server/websocket-vue-sfc.js.map +0 -1
- package/hmr/shared/runtime/http-only-boot.d.ts +0 -2
- package/hmr/shared/runtime/http-only-boot.js +0 -171
- package/hmr/shared/runtime/http-only-boot.js.map +0 -1
- package/hmr/vendor-bootstrap.d.ts +0 -3
- package/hmr/vendor-bootstrap.js +0 -32
- package/hmr/vendor-bootstrap.js.map +0 -1
- package/shims/react-reconciler-constants.d.ts +0 -14
- package/shims/react-reconciler-constants.js +0 -21
- package/shims/react-reconciler-constants.js.map +0 -1
- package/shims/react-reconciler.d.ts +0 -8
- package/shims/react-reconciler.js +0 -15
- package/shims/react-reconciler.js.map +0 -1
- package/transformers/NativeClass/index.d.ts +0 -2
- package/transformers/NativeClass/index.js +0 -222
- package/transformers/NativeClass/index.js.map +0 -1
- /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
- /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { ENV_VERBOSE as VERBOSE, getCore, normalizeSpec, resolveHmrHttpOrigin } from '../../../client/utils.js';
|
|
2
|
+
import { getGlobalScope } from '../../../shared/runtime/global-scope.js';
|
|
3
|
+
// Define substitution does not reach this raw-served file; prefer the
|
|
4
|
+
// globalThis seed from the entry's defines-seed module ('app/'-rooted
|
|
5
|
+
// projects would otherwise get the wrong '/src' default).
|
|
6
|
+
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';
|
|
7
|
+
const APP_VIRTUAL_WITH_SLASH = APP_ROOT_VIRTUAL.endsWith('/') ? APP_ROOT_VIRTUAL : `${APP_ROOT_VIRTUAL}/`;
|
|
8
|
+
/**
|
|
9
|
+
* Map a served/graph module id (e.g. `/app/modal-page.xml`) to its app-root
|
|
10
|
+
* relative path (`modal-page.xml`). Single mapping point — the raw-asset
|
|
11
|
+
* re-registration, page-navigation targets, and modal matching all derive
|
|
12
|
+
* from this; keep them in sync by construction.
|
|
13
|
+
*/
|
|
14
|
+
function toAppRelativePath(id) {
|
|
15
|
+
try {
|
|
16
|
+
const spec = normalizeSpec(id);
|
|
17
|
+
const appVirtual = APP_VIRTUAL_WITH_SLASH.replace(/^\//, '');
|
|
18
|
+
let relPath = spec.startsWith('/') ? spec.slice(1) : spec;
|
|
19
|
+
if (relPath.startsWith(appVirtual))
|
|
20
|
+
relPath = relPath.slice(appVirtual.length);
|
|
21
|
+
return relPath || null;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** App-root relative module name (no extension) for page-shaped files, else null. */
|
|
28
|
+
function toAppModuleName(id) {
|
|
29
|
+
const relPath = toAppRelativePath(id);
|
|
30
|
+
if (!relPath || !/\.(xml|ts|js)$/i.test(relPath))
|
|
31
|
+
return null;
|
|
32
|
+
return relPath.replace(/\.(xml|ts|js)$/i, '');
|
|
33
|
+
}
|
|
34
|
+
const openModalRecords = [];
|
|
35
|
+
let modalTrackingInstalled = false;
|
|
36
|
+
function ensureModalTracking() {
|
|
37
|
+
if (modalTrackingInstalled)
|
|
38
|
+
return;
|
|
39
|
+
try {
|
|
40
|
+
const View = getCore('View') || getGlobalScope().View;
|
|
41
|
+
const proto = View?.prototype;
|
|
42
|
+
if (!proto || typeof proto.showModal !== 'function')
|
|
43
|
+
return;
|
|
44
|
+
const orig = proto.showModal;
|
|
45
|
+
if (orig.__nsHmrModalTracked) {
|
|
46
|
+
modalTrackingInstalled = true;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const wrapped = function (...args) {
|
|
50
|
+
const result = orig.apply(this, args);
|
|
51
|
+
try {
|
|
52
|
+
if (typeof args[0] === 'string' && result) {
|
|
53
|
+
// Mirror core's getModalOptions arg shapes: (moduleName, options)
|
|
54
|
+
// or the deprecated positional form.
|
|
55
|
+
const options = args.length === 2 && args[1] && typeof args[1] === 'object' ? args[1] : { context: args[1], closeCallback: args[2], fullscreen: args[3], animated: args[4], stretched: args[5] };
|
|
56
|
+
const moduleName = String(args[0])
|
|
57
|
+
.replace(/^\.\//, '')
|
|
58
|
+
.replace(/\.(xml|ts|js)$/i, '');
|
|
59
|
+
openModalRecords.push({ moduleName, options, parent: this, modal: result });
|
|
60
|
+
if (VERBOSE)
|
|
61
|
+
console.log('[hmr][modal] tracked open modal', moduleName);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch { }
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
67
|
+
wrapped.__nsHmrModalTracked = true;
|
|
68
|
+
proto.showModal = wrapped;
|
|
69
|
+
modalTrackingInstalled = true;
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
if (VERBOSE)
|
|
73
|
+
console.warn('[hmr][modal] tracking install failed', e);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Enumerate the modals that are currently presented AND were opened by module
|
|
78
|
+
* name, with everything needed to re-present them.
|
|
79
|
+
*
|
|
80
|
+
* Source of truth is core's live modal stack (`_getRootModalViews()`):
|
|
81
|
+
* - `modal._moduleName` — set by the Builder on every createViewFromEntry
|
|
82
|
+
* view (longstanding, used by livesync), so available on any core.
|
|
83
|
+
* - `modal._modalOptions` — the original ShowModalOptions, stored by core's
|
|
84
|
+
* `_showNativeModalView` (newer cores). For older cores the showModal
|
|
85
|
+
* wrap's records (see ensureModalTracking) fill the gap.
|
|
86
|
+
* - `modal._modalParent` — the presenting view.
|
|
87
|
+
* Stale wrap records are pruned against the live stack while we're here.
|
|
88
|
+
*/
|
|
89
|
+
function getOpenStringModuleModals() {
|
|
90
|
+
const out = [];
|
|
91
|
+
try {
|
|
92
|
+
const App = getCore('Application');
|
|
93
|
+
const root = App?.getRootView?.() || App?._rootView;
|
|
94
|
+
const stack = root?._getRootModalViews?.() || [];
|
|
95
|
+
// Prune wrap records whose modal is gone (keeps the fallback list small).
|
|
96
|
+
for (let i = openModalRecords.length - 1; i >= 0; i--) {
|
|
97
|
+
if (!stack.includes(openModalRecords[i].modal)) {
|
|
98
|
+
openModalRecords.splice(i, 1);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
for (const modal of stack) {
|
|
102
|
+
const record = openModalRecords.find((r) => r.modal === modal);
|
|
103
|
+
const rawModuleName = typeof modal?._moduleName === 'string' && modal._moduleName ? modal._moduleName : record?.moduleName;
|
|
104
|
+
const parent = modal?._modalParent || record?.parent;
|
|
105
|
+
const options = modal?._modalOptions || record?.options;
|
|
106
|
+
if (!rawModuleName || !parent)
|
|
107
|
+
continue;
|
|
108
|
+
const moduleName = String(rawModuleName)
|
|
109
|
+
.replace(/^\.\//, '')
|
|
110
|
+
.replace(/\.(xml|ts|js)$/i, '');
|
|
111
|
+
out.push({ moduleName, options, parent, modal });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
if (VERBOSE)
|
|
116
|
+
console.warn('[hmr][modal] open-modal enumeration failed', e);
|
|
117
|
+
}
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Close and re-present an open modal so it rebuilds from the freshly
|
|
122
|
+
* re-registered XML/code-behind. Core clears the modal stack synchronously on
|
|
123
|
+
* close but the NATIVE dismissal completes asynchronously; iOS refuses a
|
|
124
|
+
* present while a dismissal is in flight. Newer cores fire `closedModally` on
|
|
125
|
+
* the modal at exactly that completion point — preferred signal. Older cores
|
|
126
|
+
* fall back to polling `isLoaded` (flipped by `_tearDownUI` in the same
|
|
127
|
+
* completion callback).
|
|
128
|
+
*/
|
|
129
|
+
async function reshowOpenModal(record) {
|
|
130
|
+
const { parent, modal, moduleName, options } = record;
|
|
131
|
+
await new Promise((resolve) => {
|
|
132
|
+
let settled = false;
|
|
133
|
+
const finish = () => {
|
|
134
|
+
if (!settled) {
|
|
135
|
+
settled = true;
|
|
136
|
+
resolve();
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
let eventArmed = false;
|
|
140
|
+
try {
|
|
141
|
+
if (typeof modal.once === 'function') {
|
|
142
|
+
modal.once('closedModally', finish);
|
|
143
|
+
eventArmed = true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
catch { }
|
|
147
|
+
// Poll fallback (also the safety net if the event never fires —
|
|
148
|
+
// e.g. an interactive-dismiss cancellation).
|
|
149
|
+
const deadline = Date.now() + 2000;
|
|
150
|
+
const poll = () => {
|
|
151
|
+
if (settled)
|
|
152
|
+
return;
|
|
153
|
+
let stillLoaded = false;
|
|
154
|
+
try {
|
|
155
|
+
stillLoaded = !!modal.isLoaded;
|
|
156
|
+
}
|
|
157
|
+
catch { }
|
|
158
|
+
if ((!eventArmed && !stillLoaded) || Date.now() > deadline) {
|
|
159
|
+
finish();
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
setTimeout(poll, 50);
|
|
163
|
+
};
|
|
164
|
+
setTimeout(poll, 50);
|
|
165
|
+
try {
|
|
166
|
+
modal.closeModal();
|
|
167
|
+
}
|
|
168
|
+
catch (e) {
|
|
169
|
+
if (VERBOSE)
|
|
170
|
+
console.warn('[hmr][modal] close failed for', moduleName, e);
|
|
171
|
+
finish();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
// One settle beat so the platform finishes releasing the presentation
|
|
175
|
+
// before the new present begins.
|
|
176
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
177
|
+
try {
|
|
178
|
+
parent.showModal(moduleName, { ...(options || {}), animated: false });
|
|
179
|
+
if (VERBOSE)
|
|
180
|
+
console.log('[hmr][modal] re-presented', moduleName);
|
|
181
|
+
}
|
|
182
|
+
catch (e) {
|
|
183
|
+
console.warn('[hmr][modal] re-present failed for', moduleName, e);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Modal-aware UI refresh for the typescript (XML) flavor after a queue drain:
|
|
188
|
+
* re-fetch changed raw assets into the bundled module registry, then either
|
|
189
|
+
* navigate in-place to a changed page, re-present open modals whose files
|
|
190
|
+
* changed, or fall back to a full `resetRootView(app-root)`.
|
|
191
|
+
*/
|
|
192
|
+
async function applyTypescriptRefresh(drained) {
|
|
193
|
+
try {
|
|
194
|
+
const g = getGlobalScope();
|
|
195
|
+
const App = getCore('Application') || g.Application;
|
|
196
|
+
if (!App || typeof App.resetRootView !== 'function') {
|
|
197
|
+
if (VERBOSE)
|
|
198
|
+
console.warn('[hmr][queue] TS flavor: Application.resetRootView unavailable; skipping UI refresh');
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
// Re-fetch changed XML/CSS files and update the bundled module registry
|
|
202
|
+
// so Builder.createViewFromEntry picks up fresh content.
|
|
203
|
+
const rawAssetIds = drained.filter((id) => /\.(xml|css|scss|sass|less)$/i.test(id));
|
|
204
|
+
if (rawAssetIds.length && typeof g.registerModule === 'function') {
|
|
205
|
+
const origin = resolveHmrHttpOrigin();
|
|
206
|
+
if (origin) {
|
|
207
|
+
for (const id of rawAssetIds) {
|
|
208
|
+
try {
|
|
209
|
+
const spec = normalizeSpec(id);
|
|
210
|
+
// Fetch the raw file content directly from Vite's dev server.
|
|
211
|
+
// Use the project-relative path which Vite serves as static files.
|
|
212
|
+
const fetchUrl = origin + (spec.startsWith('/') ? spec : '/' + spec);
|
|
213
|
+
if (VERBOSE)
|
|
214
|
+
console.log('[hmr][queue] fetching raw asset', { id, fetchUrl });
|
|
215
|
+
const resp = await fetch(fetchUrl);
|
|
216
|
+
if (resp.ok) {
|
|
217
|
+
const rawContent = await resp.text();
|
|
218
|
+
// Register under all nickname variants the module registry uses.
|
|
219
|
+
// The bundler context registers XML as e.g., './main-page.xml' and 'main-page.xml'
|
|
220
|
+
const relPath = toAppRelativePath(id);
|
|
221
|
+
if (!relPath)
|
|
222
|
+
continue;
|
|
223
|
+
const nicknames = ['./' + relPath, relPath];
|
|
224
|
+
// Also add without extension for CSS
|
|
225
|
+
const extIdx = relPath.lastIndexOf('.');
|
|
226
|
+
if (extIdx > 0) {
|
|
227
|
+
const baseName = relPath.slice(0, extIdx);
|
|
228
|
+
if (!relPath.endsWith('.xml'))
|
|
229
|
+
nicknames.push(baseName, './' + baseName);
|
|
230
|
+
}
|
|
231
|
+
for (const name of nicknames) {
|
|
232
|
+
if (VERBOSE)
|
|
233
|
+
console.log('[hmr][queue] re-registering module', name);
|
|
234
|
+
g.registerModule(name, () => rawContent);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
else if (VERBOSE) {
|
|
238
|
+
console.warn('[hmr][queue] raw asset fetch failed', id, resp.status);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
catch (e) {
|
|
242
|
+
if (VERBOSE)
|
|
243
|
+
console.warn('[hmr][queue] raw asset refresh failed for', id, e);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// Modal-aware refresh: pages currently PRESENTED AS MODALS must be
|
|
249
|
+
// closed + re-presented in place — navigating the top frame to a
|
|
250
|
+
// modal's page would push it as a frame page, and resetRootView
|
|
251
|
+
// would dismiss the modal entirely. State comes from core's live
|
|
252
|
+
// modal stack (_moduleName/_modalOptions/_modalParent); the
|
|
253
|
+
// showModal wrap only backfills options on older cores.
|
|
254
|
+
ensureModalTracking();
|
|
255
|
+
const openModals = getOpenStringModuleModals();
|
|
256
|
+
const changedModuleNames = new Set(drained.map(toAppModuleName).filter(Boolean));
|
|
257
|
+
const modalsToReshow = openModals.filter((record) => changedModuleNames.has(record.moduleName));
|
|
258
|
+
const reshowModuleNames = new Set(modalsToReshow.map((record) => record.moduleName));
|
|
259
|
+
// Determine if we can navigate in-place to a changed page
|
|
260
|
+
// instead of resetting all the way back to app-root.
|
|
261
|
+
// This keeps the user on the page they're editing for faster iteration.
|
|
262
|
+
const changedXmlPages = drained
|
|
263
|
+
.filter((id) => /\.xml$/i.test(id))
|
|
264
|
+
.map((id) => toAppModuleName(id))
|
|
265
|
+
.filter((m) => m && m !== 'app-root' && !reshowModuleNames.has(m));
|
|
266
|
+
// Resolve the topmost Frame from the bundled realm.
|
|
267
|
+
// Frame.topmost() relies on an internal frameStack array, so we must
|
|
268
|
+
// call it on the bundled-realm class. Multiple strategies to find it:
|
|
269
|
+
const FrameClass = getCore('Frame') || g.Frame;
|
|
270
|
+
let topFrame = null;
|
|
271
|
+
// 1) Try the vendor-realm static topmost()
|
|
272
|
+
try {
|
|
273
|
+
topFrame = FrameClass?.topmost?.();
|
|
274
|
+
}
|
|
275
|
+
catch { }
|
|
276
|
+
// 2) Try getting the root view from Application — if it's a Frame, use it
|
|
277
|
+
if (!topFrame) {
|
|
278
|
+
try {
|
|
279
|
+
const rootView = App.getRootView?.() || App._rootView;
|
|
280
|
+
if (rootView) {
|
|
281
|
+
// rootView could be a Frame itself, or contain a Frame
|
|
282
|
+
const isFrame = rootView.constructor?.name === 'Frame' || rootView.navigate;
|
|
283
|
+
if (isFrame) {
|
|
284
|
+
topFrame = rootView;
|
|
285
|
+
}
|
|
286
|
+
else if (rootView.getChildAt) {
|
|
287
|
+
// Walk direct children looking for a Frame
|
|
288
|
+
for (let i = 0; i < (rootView.getChildrenCount?.() || 0); i++) {
|
|
289
|
+
const child = rootView.getChildAt(i);
|
|
290
|
+
if (child?.constructor?.name === 'Frame' || child?.navigate) {
|
|
291
|
+
topFrame = child;
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
catch { }
|
|
299
|
+
}
|
|
300
|
+
if (VERBOSE)
|
|
301
|
+
console.log('[hmr][queue] TS: changedXmlPages=', changedXmlPages, 'topFrame=', !!topFrame, 'modalsToReshow=', modalsToReshow.length);
|
|
302
|
+
if (changedXmlPages.length > 0 && topFrame) {
|
|
303
|
+
// Navigate the current frame to the changed page directly.
|
|
304
|
+
// Use the last changed XML page (most specific).
|
|
305
|
+
const moduleName = changedXmlPages[changedXmlPages.length - 1];
|
|
306
|
+
if (VERBOSE)
|
|
307
|
+
console.log('[hmr][queue] TS: navigating in-place to', moduleName);
|
|
308
|
+
try {
|
|
309
|
+
topFrame.navigate({ moduleName, clearHistory: false, animated: false });
|
|
310
|
+
}
|
|
311
|
+
catch (navErr) {
|
|
312
|
+
console.warn('[hmr][queue] TS flavor: in-place navigate failed, falling back to resetRootView', navErr);
|
|
313
|
+
App.resetRootView({ moduleName: 'app-root' });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
else if (modalsToReshow.length === 0) {
|
|
317
|
+
// No frame page to refresh and no open modal owns the change —
|
|
318
|
+
// fall back to a full root reset. (Skipped when an open modal is
|
|
319
|
+
// being re-presented below: resetRootView would dismiss it.)
|
|
320
|
+
if (VERBOSE)
|
|
321
|
+
console.log('[hmr][queue] TS flavor: resetRootView(app-root) after changes');
|
|
322
|
+
App.resetRootView({ moduleName: 'app-root' });
|
|
323
|
+
}
|
|
324
|
+
// Re-present any open modals whose XML/code-behind changed. The
|
|
325
|
+
// modules were already re-registered above (raw XML assets + fresh
|
|
326
|
+
// code-behind exports), so the re-presented modal rebuilds from
|
|
327
|
+
// the new content while the page beneath it stays put.
|
|
328
|
+
for (const record of modalsToReshow) {
|
|
329
|
+
await reshowOpenModal(record);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
catch (e) {
|
|
333
|
+
console.warn('[hmr][queue] TS flavor: resetRootView(app-root) failed', e);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* TypeScript (plain XML) flavor client strategy. React reuses everything here
|
|
338
|
+
* except `refreshAfterBatch` (see `frameworks/react/client/strategy.ts`) —
|
|
339
|
+
* mirroring the server's `{ ...typescriptServerStrategy, flavor: 'react' }`.
|
|
340
|
+
*/
|
|
341
|
+
export const typescriptClientStrategy = {
|
|
342
|
+
flavor: 'typescript',
|
|
343
|
+
install() {
|
|
344
|
+
// Record string-module modals from the moment the client is up so an
|
|
345
|
+
// already-open modal can be re-presented when its files change.
|
|
346
|
+
// Installed at strategy resolve (not first-update time) because the wrap
|
|
347
|
+
// can only observe showModal calls made AFTER it lands. Retried briefly
|
|
348
|
+
// because getCore('View') may not resolve until the vendor realm
|
|
349
|
+
// finishes booting.
|
|
350
|
+
const tryInstallModalTracking = (attempts) => {
|
|
351
|
+
ensureModalTracking();
|
|
352
|
+
if (!modalTrackingInstalled && attempts > 0) {
|
|
353
|
+
setTimeout(() => tryInstallModalTracking(attempts - 1), 250);
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
tryInstallModalTracking(40);
|
|
357
|
+
},
|
|
358
|
+
createRoot(newComponent, state) {
|
|
359
|
+
// Treat the component as a factory or direct NS view.
|
|
360
|
+
let root = null;
|
|
361
|
+
try {
|
|
362
|
+
if (typeof newComponent === 'function') {
|
|
363
|
+
root = newComponent();
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
root = newComponent;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
catch (e) {
|
|
370
|
+
console.warn('[hmr-client][ts] root factory invocation failed', e);
|
|
371
|
+
}
|
|
372
|
+
// Heuristic: if the root "looks" like a Frame, prefer frame semantics
|
|
373
|
+
try {
|
|
374
|
+
const name = String(root?.constructor?.name || '').replace(/^_+/, '');
|
|
375
|
+
if (/^Frame(\$\d+)?$/.test(name)) {
|
|
376
|
+
state.setRootKind('frame');
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
catch { }
|
|
380
|
+
return root || {};
|
|
381
|
+
},
|
|
382
|
+
afterModuleReimport(id, mod) {
|
|
383
|
+
// Refresh the bundled module registry with the fresh exports so
|
|
384
|
+
// Builder.createViewFromEntry / loadModule('<page>') resolves the NEW
|
|
385
|
+
// code-behind (tap handlers, page events) instead of the stale module
|
|
386
|
+
// captured in the boot bundle. Without this, XML re-renders pick up new
|
|
387
|
+
// markup but keep old behavior.
|
|
388
|
+
if (!mod || !/\.(ts|js)$/i.test(id))
|
|
389
|
+
return;
|
|
390
|
+
try {
|
|
391
|
+
const g = getGlobalScope();
|
|
392
|
+
const moduleName = toAppModuleName(id);
|
|
393
|
+
if (moduleName && typeof g.registerModule === 'function') {
|
|
394
|
+
g.registerModule(moduleName, () => mod);
|
|
395
|
+
g.registerModule('./' + moduleName, () => mod);
|
|
396
|
+
if (VERBOSE)
|
|
397
|
+
console.log('[hmr][queue] re-registered code-behind', moduleName);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
catch (e) {
|
|
401
|
+
if (VERBOSE)
|
|
402
|
+
console.warn('[hmr][queue] code-behind re-register failed for', id, e);
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
async refreshAfterBatch(drained, ctx) {
|
|
406
|
+
// Always reset back to the conventional app root (or navigate in place /
|
|
407
|
+
// re-present modals). This preserves the shell (Frame, ActionBar, etc.)
|
|
408
|
+
// that the app's own bootstrapping wires up via `Application.run`.
|
|
409
|
+
await applyTypescriptRefresh(drained);
|
|
410
|
+
// Tell the overlay the cycle is done — without this the applying overlay
|
|
411
|
+
// sticks at 'received' (5%) forever even though the in-place navigate /
|
|
412
|
+
// resetRootView already applied the update.
|
|
413
|
+
ctx.setUpdateOverlayStage('complete', {
|
|
414
|
+
detail: `Total ${Math.max(0, Date.now() - ctx.startedAt)}ms`,
|
|
415
|
+
});
|
|
416
|
+
},
|
|
417
|
+
};
|
|
418
|
+
//# sourceMappingURL=strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../../../../../../packages/vite/hmr/frameworks/typescript/client/strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChH,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,sEAAsE;AACtE,sEAAsE;AACtE,0DAA0D;AAC1D,MAAM,gBAAgB,GAAG,CAAC,OAAO,uBAAuB,KAAK,QAAQ,IAAI,uBAAuB,CAAC,IAAI,CAAC,OAAO,cAAc,EAAE,CAAC,uBAAuB,KAAK,QAAQ,IAAI,cAAc,EAAE,CAAC,uBAAuB,CAAC,IAAI,MAAM,CAAC;AAC1N,MAAM,sBAAsB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,GAAG,CAAC;AAE1G;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,EAAU;IACpC,IAAI,CAAC;QACJ,MAAM,IAAI,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;QAC/B,MAAM,UAAU,GAAG,sBAAsB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7D,IAAI,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1D,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC;YAAE,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,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AG,CAAC,wCAAwC,EAAE,UAAU,CAAC,CAAC;YAChF,CAAC;QACF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,IAAI,OAAO;gBAAE,OAAO,CAAC,IAAI,CAAC,iDAAiD,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACrF,CAAC;IACF,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,OAAiB,EAAE,GAAgC;QAC1E,yEAAyE;QACzE,wEAAwE;QACxE,mEAAmE;QACnE,MAAM,sBAAsB,CAAC,OAAO,CAAC,CAAC;QACtC,yEAAyE;QACzE,wEAAwE;QACxE,4CAA4C;QAC5C,GAAG,CAAC,qBAAqB,CAAC,UAAU,EAAE;YACrC,MAAM,EAAE,SAAS,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,IAAI;SAC5D,CAAC,CAAC;IACJ,CAAC;CACD,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ensureRoutesDefaultExport } from '../../../server/websocket-served-module-helpers.js';
|
|
1
2
|
import { getProjectAppPath, getProjectAppVirtualPath } from '../../../../helpers/utils.js';
|
|
2
3
|
import * as path from 'path';
|
|
3
4
|
import { isRuntimeGraphExcludedPath, matchesRuntimeGraphModuleId, shouldIncludeRuntimeGraphFile, shouldSkipRuntimeGraphDirectoryName } from '../../../server/runtime-graph-filter.js';
|
|
5
|
+
import { runHotUpdatePrologue } from '../../../server/websocket-hot-update.js';
|
|
4
6
|
// TypeScript server strategy for NativeScript HMR.
|
|
5
7
|
// This is a lightweight strategy that treats app TS/JS files
|
|
6
8
|
// as HTTP-loaded modules, relying on the shared HMR pipeline
|
|
@@ -13,21 +15,45 @@ export const typescriptServerStrategy = {
|
|
|
13
15
|
// Treat any app TS/JS under the virtual app root as HMR-relevant.
|
|
14
16
|
return matchesRuntimeGraphModuleId(id, TS_APP_PREFIX, TS_FILE_PATTERN);
|
|
15
17
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
// HMR: reached via the dispatcher's delegation seam. Run the shared
|
|
19
|
+
// prologue (scope gate, pending overlay, common graph upsert, CSS), then —
|
|
20
|
+
// for an in-scope app file — emit a generic graph delta. We treat the changed
|
|
21
|
+
// file as a graph module with no deps so its hash/identity changes and the
|
|
22
|
+
// client sees a delta and can perform a TS root reset; the code body is not
|
|
23
|
+
// used for execution here.
|
|
24
|
+
async handleHotUpdate(ctx, deps) {
|
|
25
|
+
const state = await runHotUpdatePrologue(ctx, deps);
|
|
26
|
+
if (!state)
|
|
27
|
+
return;
|
|
28
|
+
const { root, metrics, emitSummary } = state;
|
|
29
|
+
const { moduleGraph, verbose, wss, isSocketClientOpen } = deps;
|
|
30
|
+
const { file } = ctx;
|
|
31
|
+
metrics.tAfterFramework = Date.now();
|
|
32
|
+
try {
|
|
33
|
+
const rel = '/' + path.posix.normalize(path.relative(root, file)).split(path.sep).join('/');
|
|
34
|
+
if (verbose)
|
|
35
|
+
console.log('[hmr-ws][ts] app file hot update', { file, rel });
|
|
36
|
+
moduleGraph.upsert(rel, '', [], { emitDeltaOnInsert: true });
|
|
37
|
+
// For this flavor the ns:hmr-delta broadcast IS the update delivery —
|
|
38
|
+
// count open sockets so the always-on summary line reflects reality
|
|
39
|
+
// instead of reporting recipients=0 for a delivered update.
|
|
40
|
+
try {
|
|
41
|
+
wss?.clients?.forEach((client) => {
|
|
42
|
+
if (isSocketClientOpen(client))
|
|
43
|
+
metrics.recipients += 1;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch { }
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
if (verbose)
|
|
50
|
+
console.warn('[hmr-ws][ts] failed to emit delta for', file, e);
|
|
51
|
+
}
|
|
52
|
+
emitSummary();
|
|
30
53
|
},
|
|
54
|
+
// preClean/rewriteFrameworkImports/postClean/canonicalizeFrameworkImports default to
|
|
55
|
+
// identity: plain TS apps rely on the generic pipeline (vendor bridge, /ns/entry-rt).
|
|
56
|
+
normalizeServedExports: ensureRoutesDefaultExport,
|
|
31
57
|
async processFile(ctx) {
|
|
32
58
|
// Ensure that any TS app module requested by the HTTP realm is transformed once,
|
|
33
59
|
// so that downstream helpers (rewriteImports, vendor bridge) see a stable shape.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../../../../../../packages/vite/hmr/frameworks/typescript/server/strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,mCAAmC,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../../../../../../packages/vite/hmr/frameworks/typescript/server/strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,mCAAmC,EAAE,MAAM,yCAAyC,CAAC;AACtL,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAG/E,mDAAmD;AACnD,6DAA6D;AAC7D,6DAA6D;AAC7D,sDAAsD;AAEtD,MAAM,aAAa,GAAG,GAAG,wBAAwB,EAAE,GAAG,CAAC;AACvD,MAAM,eAAe,GAAG,yBAA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;YAClC,CAAC;QACF,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,2BAA2B,OAAO,CAAC,MAAM,aAAa,CAAC,CAAC;QACrE,CAAC;IACF,CAAC;CACD,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reverse-import-graph propagation for non-SFC dependency edits (Vue flavor).
|
|
3
|
+
*
|
|
4
|
+
* Editing a `.vue` file flows through `ns:vue-sfc-registry-update` →
|
|
5
|
+
* `loadSfcComponent` → `performResetRoot`, so the screen always reflects the
|
|
6
|
+
* fresh artifact. Editing a plain `.ts`/`.js` module that an SFC imports does
|
|
7
|
+
* NOT produce a registry update — the shared queue only evicts and re-imports
|
|
8
|
+
* the changed module itself. The freshly-instantiated dep module is then
|
|
9
|
+
* sitting in V8's cache while the live component instance still holds bindings
|
|
10
|
+
* to the OLD module instance, so the visible UI never changes even though the
|
|
11
|
+
* overlay reports the update as applied.
|
|
12
|
+
*
|
|
13
|
+
* This walker finds the `.vue` boundaries that (transitively) import the
|
|
14
|
+
* changed modules so the Vue strategy can reload + remount them — the exact
|
|
15
|
+
* counterpart of the Solid flavor's `.tsx` boundary BFS in the shared queue.
|
|
16
|
+
*
|
|
17
|
+
* Pure function (graph in, boundaries out) so the propagation decision is unit
|
|
18
|
+
* testable without booting the device runtime.
|
|
19
|
+
*/
|
|
20
|
+
export interface DepGraphModuleLike {
|
|
21
|
+
id: string;
|
|
22
|
+
deps: string[];
|
|
23
|
+
}
|
|
24
|
+
export declare function normalizeDepGraphKey(id: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* BFS the reverse import graph from each changed non-`.vue` module up to the
|
|
27
|
+
* NEAREST `.vue` boundaries. SFC boundaries terminate the walk (remounting a
|
|
28
|
+
* boundary re-assembles its whole subtree, so walking past it would only
|
|
29
|
+
* produce redundant ancestors). Returns query-stripped `.vue` ids in BFS
|
|
30
|
+
* discovery order (nearest first), deduplicated.
|
|
31
|
+
*
|
|
32
|
+
* Changed ids that are themselves `.vue` files are ignored — those flow
|
|
33
|
+
* through the SFC registry-update path and never enter the shared re-import
|
|
34
|
+
* queue.
|
|
35
|
+
*/
|
|
36
|
+
export declare function findNearestSfcBoundaries(changedIds: readonly string[], graph: ReadonlyMap<string, DepGraphModuleLike>): string[];
|
|
37
|
+
/**
|
|
38
|
+
* Reverse-walk from a changed `.vue` file to its `.vue` importers (ancestors),
|
|
39
|
+
* nearest-first. Unlike {@link findNearestSfcBoundaries} this STARTS from a
|
|
40
|
+
* `.vue` and does not stop at the first boundary — it returns the full ancestor
|
|
41
|
+
* chain so the caller can remount the nearest one that's safely mountable as a
|
|
42
|
+
* root (a child SFC with required props is not). The changed file is excluded.
|
|
43
|
+
*/
|
|
44
|
+
export declare function findSfcAncestors(changedVuePath: string, graph: ReadonlyMap<string, DepGraphModuleLike>, maxAncestors?: number): string[];
|