@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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface CollectCssHotUpdatePathsOptions {
|
|
2
|
+
/** Absolute path of the file the watcher saw change. */
|
|
3
|
+
file: string;
|
|
4
|
+
/** Vite dev server `config.root` (project root for the NS app). */
|
|
5
|
+
root: string;
|
|
6
|
+
/** `nativescript.config#appPath` value. Defaults to `'src'`. */
|
|
7
|
+
appRootDir?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Absolute path to the project's primary CSS entry
|
|
10
|
+
* (`<root>/<appRootDir>/app.css`). Required to broadcast for
|
|
11
|
+
* out-of-scope CSS saves — workspace deps `@import`'d from
|
|
12
|
+
* `app.css` invalidate the `virtual:ns-app-css` module, which has
|
|
13
|
+
* no real `.file` to broadcast on its own.
|
|
14
|
+
*/
|
|
15
|
+
appEntryCss?: string | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Compute the root-relative POSIX path to broadcast in `ns:css-updates`
|
|
19
|
+
* for a given CSS hot-update.
|
|
20
|
+
*
|
|
21
|
+
* - **In-scope CSS edit** (`<root>/src|core|<appRootDir>/...css`):
|
|
22
|
+
* broadcast that file's path.
|
|
23
|
+
* - **Out-of-scope CSS edit** (workspace dep `@import`'d via
|
|
24
|
+
* `app.css`): broadcast `appEntryCss`. The runtime fetches
|
|
25
|
+
* `app.css?direct=1`, Vite re-runs PostCSS through the `@import`
|
|
26
|
+
* chain, and the merged CSS lands.
|
|
27
|
+
*
|
|
28
|
+
* NS only ever fetches the entry CSS at runtime, so a single
|
|
29
|
+
* `appEntryCss` broadcast covers every workspace-dep CSS save —
|
|
30
|
+
* regardless of how deep the `@import` chain goes. Returns `[]` for
|
|
31
|
+
* non-CSS files or when no broadcast target is available.
|
|
32
|
+
*/
|
|
33
|
+
export declare function collectCssHotUpdatePaths(options: CollectCssHotUpdatePathsOptions): string[];
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
const CSS_EXTENSION = /\.css(?:[?#].*)?$/i;
|
|
3
|
+
function toPosix(value) {
|
|
4
|
+
return value.replace(/\\/g, '/');
|
|
5
|
+
}
|
|
6
|
+
function stripQuery(value) {
|
|
7
|
+
const idx = value.search(/[?#]/);
|
|
8
|
+
return idx === -1 ? value : value.slice(0, idx);
|
|
9
|
+
}
|
|
10
|
+
function isInProjectScope(absPath, root, appRootDir) {
|
|
11
|
+
if (!absPath || !root)
|
|
12
|
+
return false;
|
|
13
|
+
const absPosix = stripQuery(toPosix(absPath));
|
|
14
|
+
const rootPosix = toPosix(root).replace(/\/$/, '');
|
|
15
|
+
const dirs = [`${rootPosix}/src`, `${rootPosix}/core`];
|
|
16
|
+
if (appRootDir && appRootDir !== 'src') {
|
|
17
|
+
dirs.push(`${rootPosix}/${appRootDir}`);
|
|
18
|
+
}
|
|
19
|
+
return dirs.some((dir) => absPosix === dir || absPosix.startsWith(`${dir}/`));
|
|
20
|
+
}
|
|
21
|
+
function toRootRelative(absPath, root) {
|
|
22
|
+
if (!absPath || !root)
|
|
23
|
+
return null;
|
|
24
|
+
const cleaned = stripQuery(toPosix(absPath));
|
|
25
|
+
const rootPosix = toPosix(root).replace(/\/$/, '');
|
|
26
|
+
if (cleaned !== rootPosix && !cleaned.startsWith(`${rootPosix}/`)) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const rel = path.posix.normalize(path.posix.relative(rootPosix, cleaned));
|
|
30
|
+
if (!rel || rel === '.' || rel.startsWith('..'))
|
|
31
|
+
return null;
|
|
32
|
+
return rel.startsWith('/') ? rel : `/${rel}`;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Compute the root-relative POSIX path to broadcast in `ns:css-updates`
|
|
36
|
+
* for a given CSS hot-update.
|
|
37
|
+
*
|
|
38
|
+
* - **In-scope CSS edit** (`<root>/src|core|<appRootDir>/...css`):
|
|
39
|
+
* broadcast that file's path.
|
|
40
|
+
* - **Out-of-scope CSS edit** (workspace dep `@import`'d via
|
|
41
|
+
* `app.css`): broadcast `appEntryCss`. The runtime fetches
|
|
42
|
+
* `app.css?direct=1`, Vite re-runs PostCSS through the `@import`
|
|
43
|
+
* chain, and the merged CSS lands.
|
|
44
|
+
*
|
|
45
|
+
* NS only ever fetches the entry CSS at runtime, so a single
|
|
46
|
+
* `appEntryCss` broadcast covers every workspace-dep CSS save —
|
|
47
|
+
* regardless of how deep the `@import` chain goes. Returns `[]` for
|
|
48
|
+
* non-CSS files or when no broadcast target is available.
|
|
49
|
+
*/
|
|
50
|
+
export function collectCssHotUpdatePaths(options) {
|
|
51
|
+
const { file, root, appRootDir, appEntryCss } = options;
|
|
52
|
+
if (!file || !root)
|
|
53
|
+
return [];
|
|
54
|
+
if (!CSS_EXTENSION.test(file))
|
|
55
|
+
return [];
|
|
56
|
+
if (isInProjectScope(file, root, appRootDir)) {
|
|
57
|
+
const rel = toRootRelative(file, root);
|
|
58
|
+
return rel ? [rel] : [];
|
|
59
|
+
}
|
|
60
|
+
if (!appEntryCss)
|
|
61
|
+
return [];
|
|
62
|
+
const rel = toRootRelative(appEntryCss, root);
|
|
63
|
+
return rel ? [rel] : [];
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=websocket-css-hot-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-css-hot-update.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-css-hot-update.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAmBxB,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C,SAAS,OAAO,CAAC,KAAa;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAChC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK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Q,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1E,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAwC;IAChF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IACxD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAC9B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAEzC,IAAI,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzB,CAAC;IAED,IAAI,CAAC,WAAW;QAAE,OAAO,EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9C,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Public entry point for the device code-transform subsystem (the HMR plugin's
|
|
2
|
+
// hot path). The implementation lives in three focused modules; consumers and
|
|
3
|
+
// spec suites import the subsystem's surface from here.
|
|
4
|
+
export { processCodeForDevice, cleanCode, collectImportDependencies } from './process-code-for-device.js';
|
|
5
|
+
export { rewriteImports, prepareAngularEntryForDevice } from './rewrite-imports.js';
|
|
6
|
+
export { shouldRemapImport } from './device-transform-helpers.js';
|
|
7
|
+
//# sourceMappingURL=websocket-device-transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-device-transform.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-device-transform.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,wDAAwD;AACxD,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -4,3 +4,18 @@ export declare function classifyGraphUpsert(existing: {
|
|
|
4
4
|
deps: string[];
|
|
5
5
|
} | undefined, nextHash: string, nextDeps: string[]): GraphUpsertClassification;
|
|
6
6
|
export declare function shouldBroadcastGraphUpsertDelta(classification: GraphUpsertClassification, emitDeltaOnInsert?: boolean, broadcastEnabled?: boolean): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Decide whether an upsert should advance the shared graphVersion
|
|
9
|
+
* counter. Serve-time warm-ups (and the background initial-graph walk) pass
|
|
10
|
+
* `bumpVersion: false` so graphVersion stays stable during cold boot — that
|
|
11
|
+
* stability is what lets the dynamic-import helper tag every first-session
|
|
12
|
+
* URL with a consistent `v1` instead of drifting between `live`, `v12`,
|
|
13
|
+
* `v433`... (which would produce double-loaded modules on iOS HTTP ESM).
|
|
14
|
+
* Real live edits (handleHotUpdate and framework hot-update handlers) leave
|
|
15
|
+
* `bumpVersion` unset or true and advance the counter as before.
|
|
16
|
+
*
|
|
17
|
+
* The helper also treats `unchanged` classifications as no-op: they bypass
|
|
18
|
+
* the graph set entirely in upsertGraphModule, so the version must not
|
|
19
|
+
* advance for them either.
|
|
20
|
+
*/
|
|
21
|
+
export declare function shouldBumpGraphVersion(classification: GraphUpsertClassification, bumpVersion?: boolean): boolean;
|
|
@@ -10,4 +10,24 @@ export function classifyGraphUpsert(existing, nextHash, nextDeps) {
|
|
|
10
10
|
export function shouldBroadcastGraphUpsertDelta(classification, emitDeltaOnInsert = false, broadcastEnabled = true) {
|
|
11
11
|
return broadcastEnabled && (classification === 'changed' || (classification === 'inserted' && emitDeltaOnInsert));
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Decide whether an upsert should advance the shared graphVersion
|
|
15
|
+
* counter. Serve-time warm-ups (and the background initial-graph walk) pass
|
|
16
|
+
* `bumpVersion: false` so graphVersion stays stable during cold boot — that
|
|
17
|
+
* stability is what lets the dynamic-import helper tag every first-session
|
|
18
|
+
* URL with a consistent `v1` instead of drifting between `live`, `v12`,
|
|
19
|
+
* `v433`... (which would produce double-loaded modules on iOS HTTP ESM).
|
|
20
|
+
* Real live edits (handleHotUpdate and framework hot-update handlers) leave
|
|
21
|
+
* `bumpVersion` unset or true and advance the counter as before.
|
|
22
|
+
*
|
|
23
|
+
* The helper also treats `unchanged` classifications as no-op: they bypass
|
|
24
|
+
* the graph set entirely in upsertGraphModule, so the version must not
|
|
25
|
+
* advance for them either.
|
|
26
|
+
*/
|
|
27
|
+
export function shouldBumpGraphVersion(classification, bumpVersion = true) {
|
|
28
|
+
if (classification === 'unchanged') {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return bumpVersion !== false;
|
|
32
|
+
}
|
|
13
33
|
//# sourceMappingURL=websocket-graph-upsert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket-graph-upsert.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-graph-upsert.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,mBAAmB,CAAC,QAAsD,EAAE,QAAgB,EAAE,QAAkB;IAC/H,IAAI,CAAC,QAAQ,EAAE,C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AAI,CAAC,cAAc,KAAK,SAAS,IAAI,CAAC,cAAc,KAAK,UAAU,IAAI,iBAAiB,CAAC,CAAC,CAAC;AACnH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CAAC,cAAyC,EAAE,cAAuB,IAAI;IAC5G,IAAI,cAAc,KAAK,WAAW,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,WAAW,KAAK,KAAK,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Early "pending" notification for HMR.
|
|
3
|
+
*
|
|
4
|
+
* When `handleHotUpdate(ctx)` first fires for a save event, the server
|
|
5
|
+
* spends 7–200ms doing graph upserts, transforms and dependency
|
|
6
|
+
* analysis BEFORE broadcasting `ns:angular-update` (or
|
|
7
|
+
* `ns:css-updates`). During that window the client has no idea a
|
|
8
|
+
* change is in flight, so the HMR-applying overlay only appears at
|
|
9
|
+
* the tail end of the cycle and the user perceives the dev loop as
|
|
10
|
+
* laggy.
|
|
11
|
+
*
|
|
12
|
+
* `ns:hmr-pending` is broadcast at the very start of `handleHotUpdate`
|
|
13
|
+
* with just the file path + classified kind. The client reacts by
|
|
14
|
+
* showing the 'received' overlay frame immediately. The authoritative
|
|
15
|
+
* payload (`ns:angular-update` / `ns:css-updates`) follows once the
|
|
16
|
+
* server is ready and walks the rest of the stage progression.
|
|
17
|
+
*
|
|
18
|
+
* This module is intentionally a pure helper so the message shape and
|
|
19
|
+
* narrowing rules can be verified without spinning up a Vite dev
|
|
20
|
+
* server.
|
|
21
|
+
*/
|
|
22
|
+
import type { HmrPendingKind, HmrPendingMessage } from '../shared/protocol.js';
|
|
23
|
+
export type { HmrPendingKind, HmrPendingMessage };
|
|
24
|
+
export declare function createHmrPendingMessage(input: {
|
|
25
|
+
origin: string;
|
|
26
|
+
path: string;
|
|
27
|
+
kind: string;
|
|
28
|
+
timestamp: number;
|
|
29
|
+
}): HmrPendingMessage;
|
|
30
|
+
/**
|
|
31
|
+
* Parser used by the client to identify a pending message regardless of
|
|
32
|
+
* which framework is active. We accept the message only when every
|
|
33
|
+
* expected field is present and well-formed — this guards against
|
|
34
|
+
* accidental matches on legacy server payloads or developer-written
|
|
35
|
+
* mocks during tests.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isHmrPendingMessage(value: unknown): value is HmrPendingMessage;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Early "pending" notification for HMR.
|
|
3
|
+
*
|
|
4
|
+
* When `handleHotUpdate(ctx)` first fires for a save event, the server
|
|
5
|
+
* spends 7–200ms doing graph upserts, transforms and dependency
|
|
6
|
+
* analysis BEFORE broadcasting `ns:angular-update` (or
|
|
7
|
+
* `ns:css-updates`). During that window the client has no idea a
|
|
8
|
+
* change is in flight, so the HMR-applying overlay only appears at
|
|
9
|
+
* the tail end of the cycle and the user perceives the dev loop as
|
|
10
|
+
* laggy.
|
|
11
|
+
*
|
|
12
|
+
* `ns:hmr-pending` is broadcast at the very start of `handleHotUpdate`
|
|
13
|
+
* with just the file path + classified kind. The client reacts by
|
|
14
|
+
* showing the 'received' overlay frame immediately. The authoritative
|
|
15
|
+
* payload (`ns:angular-update` / `ns:css-updates`) follows once the
|
|
16
|
+
* server is ready and walks the rest of the stage progression.
|
|
17
|
+
*
|
|
18
|
+
* This module is intentionally a pure helper so the message shape and
|
|
19
|
+
* narrowing rules can be verified without spinning up a Vite dev
|
|
20
|
+
* server.
|
|
21
|
+
*/
|
|
22
|
+
export function createHmrPendingMessage(input) {
|
|
23
|
+
const allowed = ['ts', 'css', 'html', 'unknown'];
|
|
24
|
+
const kind = allowed.includes(input.kind || '') ? input.kind : 'unknown';
|
|
25
|
+
return {
|
|
26
|
+
type: 'ns:hmr-pending',
|
|
27
|
+
origin: typeof input.origin === 'string' ? input.origin : '',
|
|
28
|
+
path: typeof input.path === 'string' ? input.path : '',
|
|
29
|
+
kind,
|
|
30
|
+
timestamp: typeof input.timestamp === 'number' && Number.isFinite(input.timestamp) ? input.timestamp : 0,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parser used by the client to identify a pending message regardless of
|
|
35
|
+
* which framework is active. We accept the message only when every
|
|
36
|
+
* expected field is present and well-formed — this guards against
|
|
37
|
+
* accidental matches on legacy server payloads or developer-written
|
|
38
|
+
* mocks during tests.
|
|
39
|
+
*/
|
|
40
|
+
export function isHmrPendingMessage(value) {
|
|
41
|
+
if (!value || typeof value !== 'object')
|
|
42
|
+
return false;
|
|
43
|
+
const v = value;
|
|
44
|
+
if (v.type !== 'ns:hmr-pending')
|
|
45
|
+
return false;
|
|
46
|
+
if (typeof v.path !== 'string' || !v.path)
|
|
47
|
+
return false;
|
|
48
|
+
if (typeof v.timestamp !== 'number' || !Number.isFinite(v.timestamp))
|
|
49
|
+
return false;
|
|
50
|
+
const allowed = ['ts', 'css', 'html', 'unknown'];
|
|
51
|
+
if (!allowed.includes(v.kind || ''))
|
|
52
|
+
return false;
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=websocket-hmr-pending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-hmr-pending.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/websocket-hmr-pending.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,MAAM,UAAU,uBAAuB,CAAC,KAAwE;IAC/G,MAAM,OAAO,GAAqB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACnE,MAAM,IAAI,GAAI,OAA6B,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,IAAuB,CAAC,CAAC,CAAC,SAAS,CAAC;IACpH,OAAO;QACN,IAAI,EAAE,gBAAgB;QACtB,MAAM,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|
+
import type { FrameworkServerStrategy } from './framework-strategy.js';
|
|
4
|
+
import type { HmrModuleGraph } from './hmr-module-graph.js';
|
|
5
|
+
import type { SharedTransformRequestRunner } from './shared-transform-request.js';
|
|
6
|
+
import type { BootstrapRootComponent } from '../frameworks/angular/server/angular-root-component.js';
|
|
7
|
+
/**
|
|
8
|
+
* Dependencies injected into each strategy's `handleHotUpdate` (and the shared
|
|
9
|
+
* {@link runHotUpdatePrologue} it runs first). These hold per-server instance
|
|
10
|
+
* state (`wss`, `moduleGraph`, the file maps, `sharedTransformRequest`) or are
|
|
11
|
+
* plugin-closure accessors. Pure transform helpers (`cleanCode`,
|
|
12
|
+
* `rewriteImports`, `processSfcCode`, `collectImportDependencies`) are NOT on the
|
|
13
|
+
* context — the strategies that need them import them directly from
|
|
14
|
+
* `websocket-device-transform.ts`. `getServerOrigin` is likewise imported
|
|
15
|
+
* directly here from `server-origin.ts` (spy via the module in tests).
|
|
16
|
+
*/
|
|
17
|
+
export interface NsHotUpdateContext {
|
|
18
|
+
wss: WebSocketServer | null;
|
|
19
|
+
moduleGraph: HmrModuleGraph;
|
|
20
|
+
strategy: FrameworkServerStrategy;
|
|
21
|
+
verbose: boolean;
|
|
22
|
+
sfcFileMap: Map<string, string>;
|
|
23
|
+
depFileMap: Map<string, string>;
|
|
24
|
+
sharedTransformRequest: SharedTransformRequestRunner;
|
|
25
|
+
getHmrSourceRootsCached: () => string[];
|
|
26
|
+
getBootstrapEntryRelPath: () => string;
|
|
27
|
+
isSocketClientOpen: (client: {
|
|
28
|
+
readyState?: number;
|
|
29
|
+
OPEN?: number;
|
|
30
|
+
} | null | undefined) => boolean;
|
|
31
|
+
getHmrSocketRole: (client: {
|
|
32
|
+
__nsHmrClientRole?: string;
|
|
33
|
+
} | null | undefined) => string;
|
|
34
|
+
shouldRemapImport: (spec: string) => boolean;
|
|
35
|
+
rememberAngularReloadSuppression: (root: string, file: string, ttlMs?: number) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the Angular bootstrap (root) component, or `null` when it
|
|
38
|
+
* can't be statically determined. Used to force root-component template
|
|
39
|
+
* edits through the reboot path instead of Analog's in-place update,
|
|
40
|
+
* which is destructive for the root view (see {@link BootstrapRootComponent}).
|
|
41
|
+
*/
|
|
42
|
+
getRootComponentIdentity: () => BootstrapRootComponent | null;
|
|
43
|
+
getGraphInitialPopulationPromise: () => Promise<void> | null;
|
|
44
|
+
appRootDir: string;
|
|
45
|
+
}
|
|
46
|
+
/** Always-on per-update timing + diagnostics, mutated in place across the prologue and the framework tail. */
|
|
47
|
+
export interface HmrUpdateMetrics {
|
|
48
|
+
file: string;
|
|
49
|
+
kind: string;
|
|
50
|
+
t0: number;
|
|
51
|
+
tAfterAwait: number;
|
|
52
|
+
tAfterFramework: number;
|
|
53
|
+
tEnd: number;
|
|
54
|
+
invalidated: number;
|
|
55
|
+
recipients: number;
|
|
56
|
+
narrowed: boolean | undefined;
|
|
57
|
+
emitted: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** Per-invocation locals computed by {@link runHotUpdatePrologue} and consumed by the per-flavor tail. */
|
|
60
|
+
export interface HotUpdatePrologueState {
|
|
61
|
+
root: string;
|
|
62
|
+
updateRel: string;
|
|
63
|
+
metrics: HmrUpdateMetrics;
|
|
64
|
+
emitSummary: () => void;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Shared, framework-agnostic prologue for every strategy's `handleHotUpdate`:
|
|
68
|
+
* scope gating, update-metrics setup, the `ns:hmr-pending` broadcast, awaiting the
|
|
69
|
+
* initial graph population, the common module-graph upsert, CSS hot-update +
|
|
70
|
+
* Tailwind content-CSS broadcast, and the project-scope filter. Returns `null`
|
|
71
|
+
* when one of those steps fully handles the change (every such path resolves to
|
|
72
|
+
* Vite's `undefined` result, so the caller just returns), otherwise the
|
|
73
|
+
* per-invocation {@link HotUpdatePrologueState} (`root`, `updateRel`, the live
|
|
74
|
+
* `metrics` object, the idempotent `emitSummary`) the per-flavor tail consumes.
|
|
75
|
+
* Exported so per-flavor strategies can own `prologue + their tail`.
|
|
76
|
+
*/
|
|
77
|
+
export declare function runHotUpdatePrologue(ctx: HmrContext, deps: NsHotUpdateContext): Promise<HotUpdatePrologueState | null>;
|