@nativescript/vite 8.0.0-alpha.7 → 8.0.0-alpha.71
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 +54 -14
- 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.d.ts +2 -1
- package/helpers/dynamic-import-plugin.js +59 -53
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +4 -1
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -12
- package/helpers/external-configs.js +58 -35
- package/helpers/external-configs.js.map +1 -1
- package/helpers/flavor.d.ts +13 -0
- package/helpers/flavor.js +18 -1
- 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 +6 -20
- 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
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { getCore } from './utils.js';
|
|
2
|
+
import { getGlobalScope } from '../shared/runtime/global-scope.js';
|
|
3
|
+
const VERBOSE = !!getGlobalScope().__NS_ENV_VERBOSE__;
|
|
4
|
+
// Must match the tag used by the boot virtual `app.css` emitter in
|
|
5
|
+
// `helpers/main-entry.ts` and `entry-runtime.ts::APP_CSS_TAG` so HMR's
|
|
6
|
+
// remove/add pair replaces the boot-time selectors instead of stacking.
|
|
7
|
+
export const APP_CSS_TAG = 'app.css';
|
|
2
8
|
function getPreferredCssApplier() {
|
|
3
9
|
try {
|
|
4
|
-
const applier =
|
|
10
|
+
const applier = getGlobalScope().__NS_HMR_APPLY_CSS__;
|
|
5
11
|
if (typeof applier === 'function') {
|
|
6
12
|
return applier;
|
|
7
13
|
}
|
|
@@ -9,50 +15,71 @@ function getPreferredCssApplier() {
|
|
|
9
15
|
catch { }
|
|
10
16
|
return null;
|
|
11
17
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const ns = reg.get('@nativescript/core');
|
|
18
|
-
return ns?.[name] || (ns?.default ?? ns)?.[name];
|
|
19
|
-
}
|
|
20
|
-
const req = g.__nsVendorRequire || g.__nsRequire || g.require;
|
|
21
|
-
if (typeof req === 'function') {
|
|
22
|
-
const ns = req('@nativescript/core');
|
|
23
|
-
return ns?.[name] || (ns?.default ?? ns)?.[name];
|
|
24
|
-
}
|
|
18
|
+
function resolveTaggedCssApi() {
|
|
19
|
+
const add = getCore('addTaggedAdditionalCSS');
|
|
20
|
+
const remove = getCore('removeTaggedAdditionalCSS');
|
|
21
|
+
if (typeof add === 'function' && typeof remove === 'function') {
|
|
22
|
+
return { add, remove };
|
|
25
23
|
}
|
|
26
|
-
|
|
27
|
-
return globalThis[name];
|
|
24
|
+
return {};
|
|
28
25
|
}
|
|
29
|
-
// CSS helper: apply CSS and refresh the current page so new styles render
|
|
30
|
-
|
|
26
|
+
// CSS helper: apply CSS and refresh the current page so new styles render.
|
|
27
|
+
//
|
|
28
|
+
// `tag` scopes the remove+add tagged pair. It defaults to {@link APP_CSS_TAG}
|
|
29
|
+
// (`'app.css'`) so a global stylesheet edit replaces the boot-time selectors.
|
|
30
|
+
// Component `styleUrls` edits pass the style file's own path as the tag so a
|
|
31
|
+
// component's rules replace independently — applying a component's CSS under
|
|
32
|
+
// the shared `app.css` tag would otherwise wipe the global stylesheet.
|
|
33
|
+
export function applyCssText(cssText, tag = APP_CSS_TAG) {
|
|
31
34
|
if (typeof cssText !== 'string' || !cssText.length)
|
|
32
35
|
return;
|
|
33
36
|
try {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
// The HTTP-core-realm applier (entry-runtime's `__NS_HMR_APPLY_CSS__`)
|
|
38
|
+
// always replaces under the global `app.css` tag, so it is only correct
|
|
39
|
+
// for GLOBAL stylesheet updates — routing a component-tagged update
|
|
40
|
+
// through it would wipe the global stylesheet and install the
|
|
41
|
+
// component's rules in its place. Component tags take the tagged
|
|
42
|
+
// remove+add path below.
|
|
43
|
+
if (tag === APP_CSS_TAG) {
|
|
44
|
+
const applyInHttpCoreRealm = getPreferredCssApplier();
|
|
45
|
+
if (applyInHttpCoreRealm) {
|
|
46
|
+
applyInHttpCoreRealm(cssText, true);
|
|
47
|
+
if (VERBOSE)
|
|
48
|
+
console.info('[ns-hmr] CSS applied through HTTP core realm');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
40
51
|
}
|
|
52
|
+
// Replace selectors via remove + add tagged pair so deleted
|
|
53
|
+
// rules disappear (the additive `Application.addCss` cannot
|
|
54
|
+
// undo previously installed selectors).
|
|
55
|
+
const taggedCss = resolveTaggedCssApi();
|
|
41
56
|
const Application = getCore('Application');
|
|
42
|
-
|
|
57
|
+
let appliedTagged = false;
|
|
58
|
+
if (taggedCss.add && taggedCss.remove) {
|
|
59
|
+
try {
|
|
60
|
+
taggedCss.remove(tag);
|
|
61
|
+
taggedCss.add(cssText, tag);
|
|
62
|
+
appliedTagged = true;
|
|
63
|
+
if (VERBOSE)
|
|
64
|
+
console.info(`[ns-hmr] CSS applied via tagged replace (tag=${tag})`);
|
|
65
|
+
}
|
|
66
|
+
catch (taggedError) {
|
|
67
|
+
console.warn('[ns-hmr] tagged CSS replace failed, falling back to addCss:', taggedError?.message || String(taggedError));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (!appliedTagged && Application && Application.addCss) {
|
|
43
71
|
Application.addCss(cssText);
|
|
44
72
|
if (VERBOSE)
|
|
45
|
-
console.info('[ns-hmr] CSS applied
|
|
73
|
+
console.info('[ns-hmr] CSS applied via addCss (additive fallback)');
|
|
46
74
|
}
|
|
47
|
-
//
|
|
48
|
-
//
|
|
75
|
+
// NS caches computed styles — re-trigger styling on the root
|
|
76
|
+
// (propagates to descendants via `eachDescendant`).
|
|
49
77
|
try {
|
|
50
78
|
const rootView = Application?.getRootView?.();
|
|
51
79
|
if (rootView && typeof rootView._onCssStateChange === 'function') {
|
|
52
80
|
rootView._onCssStateChange();
|
|
53
81
|
}
|
|
54
82
|
else if (rootView) {
|
|
55
|
-
// Force a style recalculation by toggling the root's class
|
|
56
83
|
const cls = rootView.className || '';
|
|
57
84
|
rootView.className = cls + ' ';
|
|
58
85
|
rootView.className = cls;
|
|
@@ -67,7 +94,7 @@ export function applyCssText(cssText) {
|
|
|
67
94
|
// Fetch helper
|
|
68
95
|
export async function fetchText(url) {
|
|
69
96
|
try {
|
|
70
|
-
const g =
|
|
97
|
+
const g = getGlobalScope();
|
|
71
98
|
if (typeof g.fetch === 'function') {
|
|
72
99
|
const res = await g.fetch(url);
|
|
73
100
|
return await res.text();
|
|
@@ -102,7 +129,11 @@ export async function handleCssUpdates(cssUpdates, httpOrigin) {
|
|
|
102
129
|
console.info('[ns-hmr] Fetching CSS:', url);
|
|
103
130
|
const cssText = await fetchText(url);
|
|
104
131
|
if (cssText) {
|
|
105
|
-
|
|
132
|
+
// `tag` scopes the replace: app entry CSS (no tag) uses the
|
|
133
|
+
// default `app.css` tag; component `styleUrls` edits carry their
|
|
134
|
+
// own path so they replace independently of the global stylesheet.
|
|
135
|
+
const tag = typeof update.tag === 'string' && update.tag ? update.tag : undefined;
|
|
136
|
+
applyCssText(cssText, tag);
|
|
106
137
|
}
|
|
107
138
|
}
|
|
108
139
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-handler.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/css-handler.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"css-handler.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/css-handler.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detail strings for the HMR-applying overlay's CSS update frames.
|
|
3
|
+
*
|
|
4
|
+
* The overlay uses generic per-stage `phase` labels ("Re-importing
|
|
5
|
+
* entry", "Update applied"). These pure helpers produce the matching
|
|
6
|
+
* `detail` line so a CSS-only HMR cycle has a sensible progression
|
|
7
|
+
* from 'received' → 'reimporting' → 'complete' rather than getting
|
|
8
|
+
* stuck on the 'received' (5%) frame.
|
|
9
|
+
*
|
|
10
|
+
* Path-specific detail is intentionally omitted: the broadcast path
|
|
11
|
+
* for an out-of-scope `@import` edit is rewritten to `/src/app.css`
|
|
12
|
+
* (so Vite's PostCSS pipeline re-resolves the import chain), which
|
|
13
|
+
* doesn't match the file the user actually edited. The 'received'
|
|
14
|
+
* frame already surfaces the original edited path via the
|
|
15
|
+
* `ns:hmr-pending` payload, so the later frames don't need to.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildCssApplyingDetail(count: number): string;
|
|
18
|
+
export declare function buildCssAppliedDetail(count: number): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detail strings for the HMR-applying overlay's CSS update frames.
|
|
3
|
+
*
|
|
4
|
+
* The overlay uses generic per-stage `phase` labels ("Re-importing
|
|
5
|
+
* entry", "Update applied"). These pure helpers produce the matching
|
|
6
|
+
* `detail` line so a CSS-only HMR cycle has a sensible progression
|
|
7
|
+
* from 'received' → 'reimporting' → 'complete' rather than getting
|
|
8
|
+
* stuck on the 'received' (5%) frame.
|
|
9
|
+
*
|
|
10
|
+
* Path-specific detail is intentionally omitted: the broadcast path
|
|
11
|
+
* for an out-of-scope `@import` edit is rewritten to `/src/app.css`
|
|
12
|
+
* (so Vite's PostCSS pipeline re-resolves the import chain), which
|
|
13
|
+
* doesn't match the file the user actually edited. The 'received'
|
|
14
|
+
* frame already surfaces the original edited path via the
|
|
15
|
+
* `ns:hmr-pending` payload, so the later frames don't need to.
|
|
16
|
+
*/
|
|
17
|
+
export function buildCssApplyingDetail(count) {
|
|
18
|
+
if (!Number.isFinite(count) || count <= 1)
|
|
19
|
+
return 'Applying CSS update';
|
|
20
|
+
return `Applying ${count} CSS updates`;
|
|
21
|
+
}
|
|
22
|
+
export function buildCssAppliedDetail(count) {
|
|
23
|
+
if (!Number.isFinite(count) || count <= 1)
|
|
24
|
+
return 'CSS update applied';
|
|
25
|
+
return `${count} CSS updates applied`;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=css-update-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-update-overlay.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/css-update-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,UAAU,sBAAsB,CAAC,KAAa;IACnD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,qBAAqB,CAAC;IACxE,OAAO,YAAY,KAAK,cAAc,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAa;IAClD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,oBAAoB,CAAC;IACvE,OAAO,GAAG,KAAK,sBAAsB,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side framework strategy contract (device HMR runtime).
|
|
3
|
+
*
|
|
4
|
+
* The server-side seam (`hmr/server/framework-strategy.ts`) has a mirror here:
|
|
5
|
+
* each framework that needs bespoke on-device HMR behavior implements this and
|
|
6
|
+
* is selected by `TARGET_FLAVOR` (Vue, Angular, Solid, TypeScript, React all
|
|
7
|
+
* ship one under `hmr/frameworks/<flavor>/client/`).
|
|
8
|
+
*
|
|
9
|
+
* All members are optional except `install`. A missing hook means "use the
|
|
10
|
+
* shared default".
|
|
11
|
+
*
|
|
12
|
+
* Keeping this file free of any framework import is deliberate: it lets the
|
|
13
|
+
* shared client depend only on the contract, so the concrete per-flavor module
|
|
14
|
+
* can later be loaded through a single dynamic `import()` (the device-bundle
|
|
15
|
+
* win) without the shared client statically pulling in every framework client.
|
|
16
|
+
*/
|
|
17
|
+
export interface ClientGraphModule {
|
|
18
|
+
id: string;
|
|
19
|
+
deps: string[];
|
|
20
|
+
hash: string;
|
|
21
|
+
}
|
|
22
|
+
/** Shared state handed to {@link FrameworkClientStrategy.selectMountCandidate}. */
|
|
23
|
+
export interface FrameworkClientMountContext {
|
|
24
|
+
graph: Map<string, ClientGraphModule>;
|
|
25
|
+
appMainEntrySpec: string;
|
|
26
|
+
}
|
|
27
|
+
/** Shared helpers handed to {@link FrameworkClientStrategy.refreshAfterBatch}. */
|
|
28
|
+
export interface FrameworkClientBatchContext {
|
|
29
|
+
setUpdateOverlayStage: (stage: any, opts?: any) => void;
|
|
30
|
+
/** Wall-clock (ms) when the queue drain started, for "Updated … in Nms". */
|
|
31
|
+
startedAt: number;
|
|
32
|
+
/** Live client module graph (id → {id, deps, hash}) for reverse-import propagation. */
|
|
33
|
+
graph?: Map<string, ClientGraphModule>;
|
|
34
|
+
/** Swap the live root view to a freshly loaded component (resolves true on success). */
|
|
35
|
+
performResetRoot?: (component: any) => Promise<boolean> | any;
|
|
36
|
+
/** Resolves the live dev-overlay API (null/undefined when not installed). */
|
|
37
|
+
getOverlay?: () => any;
|
|
38
|
+
}
|
|
39
|
+
/** Shared helpers handed to the framework message hooks. */
|
|
40
|
+
export interface FrameworkClientMessageContext {
|
|
41
|
+
getCore: (name: string) => any;
|
|
42
|
+
verbose: boolean;
|
|
43
|
+
performResetRoot: (component: any) => any;
|
|
44
|
+
getOverlay: () => any;
|
|
45
|
+
}
|
|
46
|
+
export interface FrameworkClientStrategy {
|
|
47
|
+
readonly flavor: string;
|
|
48
|
+
/**
|
|
49
|
+
* When false, the in-place authoritative-frame `navigate()` fast path is
|
|
50
|
+
* skipped in favor of a full `resetRootView`. Vue requires this. Absent
|
|
51
|
+
* strategy/flag defaults to `true` (the legacy `flavor !== 'vue'` behavior).
|
|
52
|
+
*/
|
|
53
|
+
readonly allowNavigateFastPath?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* When true, the shared queue drives the apply-progress overlay's
|
|
56
|
+
* 'evicting'/'reimporting' frames around its drain (Solid). Frameworks that
|
|
57
|
+
* drive the overlay from their own update path (Angular, Vue) leave this
|
|
58
|
+
* unset so the queue stays silent.
|
|
59
|
+
*/
|
|
60
|
+
readonly drivesQueueOverlayStages?: boolean;
|
|
61
|
+
/** One-time client install (dev shims / HMR hooks). Runs at strategy resolve. */
|
|
62
|
+
install(): void;
|
|
63
|
+
/** Install the hardware-back wrapper once a resetRoot fn + core accessor exist. */
|
|
64
|
+
installBackWrapper?(performResetRoot: (comp: any) => void, getCore: (name: string) => any): void;
|
|
65
|
+
/** Pick the initial/rescue mount component id from the module graph (+ registry). */
|
|
66
|
+
selectMountCandidate?(ctx: FrameworkClientMountContext): string | null;
|
|
67
|
+
/** Load the component to mount for `candidate` (e.g. Vue SFC assembly). */
|
|
68
|
+
loadComponentForMount?(candidate: string): Promise<any>;
|
|
69
|
+
/** Build the NS root view for `newComponent` (framework-specific mount). */
|
|
70
|
+
createRoot?(newComponent: any, state: any): any;
|
|
71
|
+
/** Record changed-module metadata from a delta payload (framework bookkeeping). */
|
|
72
|
+
recordPayloadChanges?(changed: any[], graphVersion: number): void;
|
|
73
|
+
/**
|
|
74
|
+
* Post-process one freshly re-imported module during the queue drain
|
|
75
|
+
* (TypeScript/React: refresh the bundled module registry so Builder /
|
|
76
|
+
* `loadModule` resolves the NEW code-behind instead of the boot-bundle copy).
|
|
77
|
+
*/
|
|
78
|
+
afterModuleReimport?(id: string, mod: any): void;
|
|
79
|
+
/** Framework UI refresh after a re-import batch drains. */
|
|
80
|
+
refreshAfterBatch?(drained: string[], ctx: FrameworkClientBatchContext): void | Promise<void>;
|
|
81
|
+
/** Handle a framework hot-update protocol message (resolves true if consumed). */
|
|
82
|
+
handleHotUpdateMessage?(msg: any, ctx: FrameworkClientMessageContext): Promise<boolean>;
|
|
83
|
+
/** Handle the framework SFC registry message. */
|
|
84
|
+
handleSfcRegistry?(msg: any): void;
|
|
85
|
+
/** Handle the framework SFC registry-update message (drives its own overlay). */
|
|
86
|
+
handleSfcRegistryUpdate?(msg: any, graphVersion: number, ctx: FrameworkClientMessageContext): Promise<void>;
|
|
87
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side framework strategy contract (device HMR runtime).
|
|
3
|
+
*
|
|
4
|
+
* The server-side seam (`hmr/server/framework-strategy.ts`) has a mirror here:
|
|
5
|
+
* each framework that needs bespoke on-device HMR behavior implements this and
|
|
6
|
+
* is selected by `TARGET_FLAVOR` (Vue, Angular, Solid, TypeScript, React all
|
|
7
|
+
* ship one under `hmr/frameworks/<flavor>/client/`).
|
|
8
|
+
*
|
|
9
|
+
* All members are optional except `install`. A missing hook means "use the
|
|
10
|
+
* shared default".
|
|
11
|
+
*
|
|
12
|
+
* Keeping this file free of any framework import is deliberate: it lets the
|
|
13
|
+
* shared client depend only on the contract, so the concrete per-flavor module
|
|
14
|
+
* can later be loaded through a single dynamic `import()` (the device-bundle
|
|
15
|
+
* win) without the shared client statically pulling in every framework client.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=framework-client-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-client-strategy.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/framework-client-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client-side helper for `ns:hmr-pending`.
|
|
3
|
-
*
|
|
4
|
-
* Server emits `ns:hmr-pending` immediately when `handleHotUpdate`
|
|
5
|
-
* fires, BEFORE doing any graph upserts / transforms / dependency
|
|
6
|
-
* analysis. The client uses that hint to drive the HMR-applying
|
|
7
|
-
* overlay's 'received' frame so the user sees an instant reaction
|
|
8
|
-
* to their save instead of waiting ~7–200ms for the framework
|
|
9
|
-
* payload (`ns:angular-update` / `ns:css-updates`) to arrive.
|
|
10
|
-
*
|
|
11
|
-
* This module is intentionally a tiny pure helper so the gating
|
|
12
|
-
* (`__NS_HMR_PROGRESS_OVERLAY_ENABLED__`) and detail-string formatting
|
|
13
|
-
* can be unit-tested without booting the full HMR client.
|
|
14
|
-
*/
|
|
15
1
|
export type HmrOverlayApiLike = {
|
|
16
2
|
setUpdateStage?: (stage: string, info?: {
|
|
17
3
|
detail?: string;
|
|
@@ -12,23 +12,14 @@
|
|
|
12
12
|
* (`__NS_HMR_PROGRESS_OVERLAY_ENABLED__`) and detail-string formatting
|
|
13
13
|
* can be unit-tested without booting the full HMR client.
|
|
14
14
|
*/
|
|
15
|
+
import { resolveOverlayEnabled } from './overlay-driver.js';
|
|
15
16
|
export function buildHmrPendingDetail(filePath) {
|
|
16
17
|
if (!filePath || filePath === '<unknown>')
|
|
17
18
|
return 'Preparing update';
|
|
18
19
|
return `Updating ${filePath}`;
|
|
19
20
|
}
|
|
20
21
|
export function applyHmrPendingFrame(filePath, deps) {
|
|
21
|
-
|
|
22
|
-
? deps.overlayEnabled
|
|
23
|
-
: (() => {
|
|
24
|
-
try {
|
|
25
|
-
return typeof __NS_HMR_PROGRESS_OVERLAY_ENABLED__ === 'boolean' ? __NS_HMR_PROGRESS_OVERLAY_ENABLED__ : true;
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
})();
|
|
31
|
-
if (!enabled)
|
|
22
|
+
if (!resolveOverlayEnabled(deps.overlayEnabled))
|
|
32
23
|
return false;
|
|
33
24
|
let api;
|
|
34
25
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmr-pending-overlay.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/hmr-pending-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"hmr-pending-overlay.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/hmr-pending-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAgB5D,MAAM,UAAU,qBAAqB,CAAC,QAA4B;IACjE,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,WAAW;QAAE,OAAO,kBAAkB,CAAC;IACrE,OAAO,YAAY,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAA4B,EAAE,IAA2B;IAC7F,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,cAAc,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,GAAsB,CAAC;IAC3B,IAAI,CAAC;QACJ,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,cAAc,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IACnE,IAAI,CAAC;QACJ,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JS-owned `import.meta.hot` implementation (Vite-style injected hot contexts).
|
|
3
|
+
*
|
|
4
|
+
* `import.meta.hot` is HMR *policy* and lives entirely in this package — the
|
|
5
|
+
* native runtimes expose no hot API. The dev server injects
|
|
6
|
+
*
|
|
7
|
+
* import.meta.hot = globalThis.__NS_HOT_REGISTRY__?.createHotContext('<canonical-id>')
|
|
8
|
+
*
|
|
9
|
+
* at the top of every served app module (see `processCodeForDevice`), and this
|
|
10
|
+
* module owns every registry the hot API needs. The registry is installed on
|
|
11
|
+
* `globalThis.__NS_HOT_REGISTRY__` by `installNsHotRegistry()`, which the
|
|
12
|
+
* `/__ns_dev__/client` bootstrap runs before the entry graph evaluates.
|
|
13
|
+
*
|
|
14
|
+
* Process-wide singleton: state is stashed on globalThis so that a second
|
|
15
|
+
* copy of this module (e.g. loaded under a different URL) shares the same
|
|
16
|
+
* registries instead of splitting them.
|
|
17
|
+
*
|
|
18
|
+
* No circulars — don't import from other hmr/client/* modules here.
|
|
19
|
+
*/
|
|
20
|
+
export interface NsHotEventPayload {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
type HotCallback = (...args: unknown[]) => unknown;
|
|
24
|
+
export interface NsHotRegistry {
|
|
25
|
+
createHotContext(ownerId: string): NsHotContext;
|
|
26
|
+
canonicalHotKey(id: string): string;
|
|
27
|
+
/** Drain `hot.dispose(cb)` callbacks (all modules, or a key subset). Returns count executed. */
|
|
28
|
+
runDispose(keys?: readonly string[]): number;
|
|
29
|
+
/** Drain `hot.prune(cb)` callbacks (all modules, or a key subset). Returns count executed. */
|
|
30
|
+
runPrune(keys?: readonly string[]): number;
|
|
31
|
+
/** True when any module (or any module in the key subset) called `hot.decline()`. */
|
|
32
|
+
hasDeclined(keys?: readonly string[]): boolean;
|
|
33
|
+
/** Fire `hot.on(event, cb)` listeners. Returns the number of listeners invoked. */
|
|
34
|
+
dispatchHotEvent(event: string, payload?: unknown): number;
|
|
35
|
+
listHotEventListeners(): Record<string, number>;
|
|
36
|
+
/** Wire `hot.send(...)` to the active WebSocket (installed by the full client). */
|
|
37
|
+
setSendToServer(fn: ((event: string, data?: unknown) => void) | null): void;
|
|
38
|
+
/** Override the full-reload behavior (`hot.invalidate()`, declined modules). */
|
|
39
|
+
setFullReloadHandler(fn: ((message?: string) => void) | null): void;
|
|
40
|
+
requestFullReload(message?: string): void;
|
|
41
|
+
}
|
|
42
|
+
export interface NsHotContext {
|
|
43
|
+
readonly data: Record<string, unknown>;
|
|
44
|
+
accept(...args: unknown[]): void;
|
|
45
|
+
acceptExports(exportNames: string[], cb?: HotCallback): void;
|
|
46
|
+
dispose(cb: HotCallback): void;
|
|
47
|
+
prune(cb: HotCallback): void;
|
|
48
|
+
decline(): void;
|
|
49
|
+
invalidate(message?: string): void;
|
|
50
|
+
on(event: string, cb: HotCallback): void;
|
|
51
|
+
off(event: string, cb: HotCallback): void;
|
|
52
|
+
send(event: string, data?: unknown): void;
|
|
53
|
+
}
|
|
54
|
+
declare global {
|
|
55
|
+
var __NS_HOT_REGISTRY__: NsHotRegistry | undefined;
|
|
56
|
+
var __NS_DEV_ENTRY_URL__: string | undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Install (or return the already-installed) process-wide hot registry.
|
|
60
|
+
* Idempotent — safe to call from the bootstrap client, the full client and
|
|
61
|
+
* tests; the first installation wins.
|
|
62
|
+
*/
|
|
63
|
+
export declare function installNsHotRegistry(): NsHotRegistry;
|
|
64
|
+
/** Read the installed registry (installing lazily so callers never race). */
|
|
65
|
+
export declare function getNsHotRegistry(): NsHotRegistry;
|
|
66
|
+
export declare function createHotContext(ownerId: string): NsHotContext;
|
|
67
|
+
export {};
|