@nativescript/vite 8.0.0-alpha.9 → 8.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -14
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +34 -1
- package/configuration/angular.js +196 -217
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +152 -104
- package/configuration/base.js.map +1 -1
- package/configuration/javascript.js +14 -93
- package/configuration/javascript.js.map +1 -1
- package/configuration/react.js +41 -73
- package/configuration/react.js.map +1 -1
- package/configuration/solid.js +51 -6
- package/configuration/solid.js.map +1 -1
- package/configuration/typescript.js +11 -92
- package/configuration/typescript.js.map +1 -1
- package/framework.d.ts +22 -0
- package/framework.js +18 -0
- package/framework.js.map +1 -0
- package/helpers/app-components.d.ts +2 -1
- package/helpers/app-components.js.map +1 -1
- package/helpers/app-css-refresh.d.ts +31 -0
- package/helpers/app-css-refresh.js +43 -0
- package/helpers/app-css-refresh.js.map +1 -0
- package/helpers/app-css-state.d.ts +17 -0
- package/helpers/app-css-state.js +51 -0
- package/helpers/app-css-state.js.map +1 -0
- package/helpers/bundler-context.d.ts +11 -0
- package/helpers/bundler-context.js +71 -0
- package/helpers/bundler-context.js.map +1 -0
- package/helpers/cli-flags.d.ts +12 -0
- package/helpers/cli-flags.js +34 -0
- package/helpers/cli-flags.js.map +1 -1
- package/helpers/css-platform-plugin.d.ts +14 -0
- package/helpers/css-platform-plugin.js +43 -25
- package/helpers/css-platform-plugin.js.map +1 -1
- package/helpers/dev-host.d.ts +360 -0
- package/helpers/dev-host.js +694 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/dynamic-import-plugin.d.ts +2 -1
- package/helpers/dynamic-import-plugin.js +59 -53
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +4 -1
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -12
- package/helpers/external-configs.js +58 -35
- package/helpers/external-configs.js.map +1 -1
- package/helpers/flavor.d.ts +31 -0
- package/helpers/flavor.js +53 -2
- package/helpers/flavor.js.map +1 -1
- package/helpers/global-defines.d.ts +100 -33
- package/helpers/global-defines.js +192 -66
- package/helpers/global-defines.js.map +1 -1
- package/helpers/hmr-scope.d.ts +26 -0
- package/helpers/hmr-scope.js +67 -0
- package/helpers/hmr-scope.js.map +1 -0
- package/helpers/init.js +24 -26
- package/helpers/init.js.map +1 -1
- package/helpers/logging.d.ts +11 -1
- package/helpers/logging.js +45 -2
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +4 -1
- package/helpers/main-entry.js +293 -40
- package/helpers/main-entry.js.map +1 -1
- package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
- package/helpers/nativeclass-esbuild-plugin.js +6 -1
- package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
- package/helpers/nativeclass-transform.d.ts +13 -0
- package/helpers/nativeclass-transform.js +37 -7
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.js +8 -3
- package/helpers/nativeclass-transformer-plugin.js.map +1 -1
- package/helpers/nativescript-package-resolver.js +10 -62
- package/helpers/nativescript-package-resolver.js.map +1 -1
- package/helpers/normalize-id.d.ts +42 -0
- package/helpers/normalize-id.js +60 -0
- package/helpers/normalize-id.js.map +1 -0
- package/helpers/ns-core-external-urls.d.ts +32 -0
- package/helpers/ns-core-external-urls.js +107 -0
- package/helpers/ns-core-external-urls.js.map +1 -0
- package/helpers/ns-core-url.d.ts +26 -3
- package/helpers/ns-core-url.js +66 -8
- package/helpers/ns-core-url.js.map +1 -1
- package/helpers/optimize-deps.d.ts +16 -0
- package/helpers/optimize-deps.js +17 -0
- package/helpers/optimize-deps.js.map +1 -0
- package/helpers/package-platform-aliases.js +34 -49
- package/helpers/package-platform-aliases.js.map +1 -1
- package/helpers/platform-types.d.ts +2 -0
- package/helpers/platform-types.js +2 -0
- package/helpers/platform-types.js.map +1 -0
- package/helpers/postcss-platform-config.d.ts +17 -1
- package/helpers/postcss-platform-config.js +20 -37
- package/helpers/postcss-platform-config.js.map +1 -1
- package/helpers/resolve-main-field-platform.d.ts +20 -0
- package/helpers/resolve-main-field-platform.js +49 -0
- package/helpers/resolve-main-field-platform.js.map +1 -0
- package/helpers/resolver.js +17 -2
- package/helpers/resolver.js.map +1 -1
- package/helpers/theme-core-plugins.js +1 -1
- package/helpers/theme-core-plugins.js.map +1 -1
- package/helpers/ts-config-paths.d.ts +32 -0
- package/helpers/ts-config-paths.js +143 -62
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +3 -3
- package/helpers/typescript-check.js +4 -4
- package/helpers/typescript-check.js.map +1 -1
- package/helpers/ui-registration.d.ts +21 -0
- package/helpers/ui-registration.js +156 -0
- package/helpers/ui-registration.js.map +1 -0
- package/helpers/utils.d.ts +9 -0
- package/helpers/utils.js +22 -2
- package/helpers/utils.js.map +1 -1
- package/helpers/vite-package-version.d.ts +7 -0
- package/helpers/vite-package-version.js +44 -0
- package/helpers/vite-package-version.js.map +1 -0
- package/helpers/workers.d.ts +33 -0
- package/helpers/workers.js +237 -10
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +63 -32
- package/hmr/client/css-handler.js.map +1 -1
- package/hmr/client/css-update-overlay.d.ts +18 -0
- package/hmr/client/css-update-overlay.js +27 -0
- package/hmr/client/css-update-overlay.js.map +1 -0
- package/hmr/client/framework-client-strategy.d.ts +117 -0
- package/hmr/client/framework-client-strategy.js +18 -0
- package/hmr/client/framework-client-strategy.js.map +1 -0
- package/hmr/client/framework.d.ts +31 -0
- package/hmr/client/framework.js +17 -0
- package/hmr/client/framework.js.map +1 -0
- package/hmr/client/hmr-pending-overlay.d.ts +0 -14
- package/hmr/client/hmr-pending-overlay.js +2 -11
- package/hmr/client/hmr-pending-overlay.js.map +1 -1
- package/hmr/client/hot-context.d.ts +89 -0
- package/hmr/client/hot-context.js +404 -0
- package/hmr/client/hot-context.js.map +1 -0
- package/hmr/client/index.d.ts +9 -1
- package/hmr/client/index.js +70 -1970
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/overlay-driver.d.ts +10 -0
- package/hmr/client/overlay-driver.js +33 -0
- package/hmr/client/overlay-driver.js.map +1 -0
- package/hmr/client/protocol-dispatch.d.ts +8 -0
- package/hmr/client/protocol-dispatch.js +308 -0
- package/hmr/client/protocol-dispatch.js.map +1 -0
- package/hmr/client/root-reset.d.ts +15 -0
- package/hmr/client/root-reset.js +358 -0
- package/hmr/client/root-reset.js.map +1 -0
- package/hmr/client/strategy-loader.d.ts +24 -0
- package/hmr/client/strategy-loader.js +136 -0
- package/hmr/client/strategy-loader.js.map +1 -0
- package/hmr/client/update-pipeline.d.ts +27 -0
- package/hmr/client/update-pipeline.js +489 -0
- package/hmr/client/update-pipeline.js.map +1 -0
- package/hmr/client/utils.d.ts +9 -1
- package/hmr/client/utils.js +117 -97
- package/hmr/client/utils.js.map +1 -1
- package/hmr/client/ws-transport.d.ts +21 -0
- package/hmr/client/ws-transport.js +323 -0
- package/hmr/client/ws-transport.js.map +1 -0
- package/hmr/entry-runtime.d.ts +2 -1
- package/hmr/entry-runtime.js +279 -44
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/framework-flavors.d.ts +59 -0
- package/hmr/framework-flavors.js +108 -0
- package/hmr/framework-flavors.js.map +1 -0
- package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
- package/hmr/frameworks/angular/build/angular-linker.js +113 -0
- package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/inject-component-hmr-registration.js +2 -70
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
- package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
- package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
- package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
- package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
- package/hmr/frameworks/angular/build/linker-stats.js +29 -0
- package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
- package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
- package/hmr/frameworks/angular/build/shared-linker.js +128 -0
- package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
- package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
- package/hmr/frameworks/angular/build/util.js.map +1 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
- package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
- package/hmr/frameworks/angular/client/index.d.ts +0 -1
- package/hmr/frameworks/angular/client/index.js +360 -194
- package/hmr/frameworks/angular/client/index.js.map +1 -1
- package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
- package/hmr/frameworks/angular/client/strategy.js +19 -0
- package/hmr/frameworks/angular/client/strategy.js.map +1 -0
- package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
- package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
- package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
- package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
- package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
- package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
- package/hmr/frameworks/angular/server/strategy.js +668 -13
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
- package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +27 -11
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.js +179 -107
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
- package/hmr/frameworks/react/client/strategy.d.ts +12 -0
- package/hmr/frameworks/react/client/strategy.js +27 -0
- package/hmr/frameworks/react/client/strategy.js.map +1 -0
- package/hmr/frameworks/react/server/strategy.d.ts +2 -0
- package/hmr/frameworks/react/server/strategy.js +230 -0
- package/hmr/frameworks/react/server/strategy.js.map +1 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
- package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
- package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
- package/hmr/frameworks/solid/client/app-runtime.js +252 -0
- package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
- package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
- package/hmr/frameworks/solid/client/strategy.js +391 -0
- package/hmr/frameworks/solid/client/strategy.js.map +1 -0
- package/hmr/frameworks/solid/server/strategy.js +293 -16
- package/hmr/frameworks/solid/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
- package/hmr/frameworks/typescript/client/strategy.js +418 -0
- package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
- package/hmr/frameworks/typescript/server/strategy.js +40 -14
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
- package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
- package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +10 -1
- package/hmr/frameworks/vue/client/index.js +270 -521
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
- package/hmr/frameworks/vue/client/navigate-app.js +178 -0
- package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
- package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
- package/hmr/frameworks/vue/client/strategy.js +152 -0
- package/hmr/frameworks/vue/client/strategy.js.map +1 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
- package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
- package/hmr/frameworks/vue/server/compiler.js +3 -1
- package/hmr/frameworks/vue/server/compiler.js.map +1 -1
- package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
- package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
- package/hmr/frameworks/vue/server/strategy.js +291 -7
- package/hmr/frameworks/vue/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
- package/hmr/helpers/ast-normalizer.d.ts +3 -1
- package/hmr/helpers/ast-normalizer.js +109 -14
- package/hmr/helpers/ast-normalizer.js.map +1 -1
- package/hmr/helpers/package-exports.d.ts +16 -0
- package/hmr/helpers/package-exports.js +396 -0
- package/hmr/helpers/package-exports.js.map +1 -0
- package/hmr/helpers/vendor-rewrite.d.ts +1 -1
- package/hmr/helpers/vendor-rewrite.js +5 -3
- package/hmr/helpers/vendor-rewrite.js.map +1 -1
- package/hmr/server/boot-recording.d.ts +51 -0
- package/hmr/server/boot-recording.js +214 -0
- package/hmr/server/boot-recording.js.map +1 -0
- package/hmr/server/constants.js +7 -1
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/content-css-update.d.ts +54 -0
- package/hmr/server/content-css-update.js +78 -0
- package/hmr/server/content-css-update.js.map +1 -0
- package/hmr/server/core-bundle.d.ts +140 -0
- package/hmr/server/core-bundle.js +614 -0
- package/hmr/server/core-bundle.js.map +1 -0
- package/hmr/server/core-sanitize.d.ts +86 -7
- package/hmr/server/core-sanitize.js +155 -37
- package/hmr/server/core-sanitize.js.map +1 -1
- package/hmr/server/css-connect-sync.d.ts +28 -0
- package/hmr/server/css-connect-sync.js +59 -0
- package/hmr/server/css-connect-sync.js.map +1 -0
- package/hmr/server/css-device-module.d.ts +28 -0
- package/hmr/server/css-device-module.js +44 -0
- package/hmr/server/css-device-module.js.map +1 -0
- package/hmr/server/css-update-message.d.ts +23 -0
- package/hmr/server/css-update-message.js +41 -0
- package/hmr/server/css-update-message.js.map +1 -0
- package/hmr/server/deps-bundle.d.ts +233 -0
- package/hmr/server/deps-bundle.js +1022 -0
- package/hmr/server/deps-bundle.js.map +1 -0
- package/hmr/server/device-transform-helpers.d.ts +24 -0
- package/hmr/server/device-transform-helpers.js +408 -0
- package/hmr/server/device-transform-helpers.js.map +1 -0
- package/hmr/server/framework-strategy.d.ts +182 -11
- package/hmr/server/hmr-module-graph.d.ts +37 -0
- package/hmr/server/hmr-module-graph.js +215 -0
- package/hmr/server/hmr-module-graph.js.map +1 -0
- package/hmr/server/import-map.d.ts +57 -23
- package/hmr/server/import-map.js +142 -70
- package/hmr/server/import-map.js.map +1 -1
- package/hmr/server/index.js +7 -16
- package/hmr/server/index.js.map +1 -1
- package/hmr/server/node-builtins-route.d.ts +12 -0
- package/hmr/server/node-builtins-route.js +86 -0
- package/hmr/server/node-builtins-route.js.map +1 -0
- package/hmr/server/ns-m-response-memo.d.ts +10 -0
- package/hmr/server/ns-m-response-memo.js +33 -0
- package/hmr/server/ns-m-response-memo.js.map +1 -0
- package/hmr/server/ns-rt-bridge.d.ts +51 -0
- package/hmr/server/ns-rt-bridge.js +131 -0
- package/hmr/server/ns-rt-bridge.js.map +1 -0
- package/hmr/server/ns-rt-route.d.ts +5 -0
- package/hmr/server/ns-rt-route.js +39 -0
- package/hmr/server/ns-rt-route.js.map +1 -0
- package/hmr/server/perf-instrumentation.d.ts +1 -1
- package/hmr/server/perf-instrumentation.js +3 -1
- package/hmr/server/perf-instrumentation.js.map +1 -1
- package/hmr/server/process-code-for-device.d.ts +54 -0
- package/hmr/server/process-code-for-device.js +832 -0
- package/hmr/server/process-code-for-device.js.map +1 -0
- package/hmr/server/require-guard.d.ts +1 -0
- package/hmr/server/require-guard.js +12 -0
- package/hmr/server/require-guard.js.map +1 -0
- package/hmr/server/rewrite-imports.d.ts +2 -0
- package/hmr/server/rewrite-imports.js +631 -0
- package/hmr/server/rewrite-imports.js.map +1 -0
- package/hmr/server/route-helpers.d.ts +7 -0
- package/hmr/server/route-helpers.js +13 -0
- package/hmr/server/route-helpers.js.map +1 -0
- package/hmr/server/runtime-graph-filter.js +8 -1
- package/hmr/server/runtime-graph-filter.js.map +1 -1
- package/hmr/server/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +88 -0
- package/hmr/server/server-origin.js.map +1 -0
- package/hmr/server/shared-transform-request.js +1 -2
- package/hmr/server/shared-transform-request.js.map +1 -1
- package/hmr/server/socket-utils.d.ts +10 -0
- package/hmr/server/socket-utils.js +14 -0
- package/hmr/server/socket-utils.js.map +1 -0
- package/hmr/server/transform-cache-invalidation.d.ts +37 -0
- package/hmr/server/transform-cache-invalidation.js +156 -0
- package/hmr/server/transform-cache-invalidation.js.map +1 -0
- package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
- package/hmr/server/vendor-bare-module-shims.js +80 -0
- package/hmr/server/vendor-bare-module-shims.js.map +1 -0
- package/hmr/server/vite-plugin.d.ts +1 -0
- package/hmr/server/vite-plugin.js +211 -53
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +51 -4
- package/hmr/server/websocket-core-bridge.js +62 -49
- package/hmr/server/websocket-core-bridge.js.map +1 -1
- package/hmr/server/websocket-device-transform.d.ts +3 -0
- package/hmr/server/websocket-device-transform.js +7 -0
- package/hmr/server/websocket-device-transform.js.map +1 -0
- package/hmr/server/websocket-hmr-pending.d.ts +2 -16
- package/hmr/server/websocket-hmr-pending.js +0 -22
- package/hmr/server/websocket-hmr-pending.js.map +1 -1
- package/hmr/server/websocket-hot-update.d.ts +80 -0
- package/hmr/server/websocket-hot-update.js +299 -0
- package/hmr/server/websocket-hot-update.js.map +1 -0
- package/hmr/server/websocket-import-map-route.d.ts +15 -0
- package/hmr/server/websocket-import-map-route.js +51 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.d.ts +15 -0
- package/hmr/server/websocket-module-bindings.js +36 -3
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +2 -5
- package/hmr/server/websocket-module-specifiers.js +42 -30
- package/hmr/server/websocket-module-specifiers.js.map +1 -1
- package/hmr/server/websocket-ns-core.d.ts +34 -0
- package/hmr/server/websocket-ns-core.js +414 -0
- package/hmr/server/websocket-ns-core.js.map +1 -0
- package/hmr/server/websocket-ns-entry.d.ts +21 -0
- package/hmr/server/websocket-ns-entry.js +163 -0
- package/hmr/server/websocket-ns-entry.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +19 -3
- package/hmr/server/websocket-ns-m-paths.js +98 -75
- package/hmr/server/websocket-ns-m-paths.js.map +1 -1
- package/hmr/server/websocket-ns-m-request.d.ts +2 -1
- package/hmr/server/websocket-ns-m-request.js +3 -2
- package/hmr/server/websocket-ns-m-request.js.map +1 -1
- package/hmr/server/websocket-ns-m.d.ts +52 -0
- package/hmr/server/websocket-ns-m.js +592 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +65 -3
- package/hmr/server/websocket-served-module-helpers.js +457 -140
- package/hmr/server/websocket-served-module-helpers.js.map +1 -1
- package/hmr/server/websocket-txn.js +6 -9
- package/hmr/server/websocket-txn.js.map +1 -1
- package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
- package/hmr/server/websocket-vendor-unifier.js +4 -9
- package/hmr/server/websocket-vendor-unifier.js.map +1 -1
- package/hmr/server/websocket.d.ts +6 -40
- package/hmr/server/websocket.js +661 -6751
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +108 -0
- package/hmr/shared/ns-globals.js +29 -0
- package/hmr/shared/ns-globals.js.map +1 -0
- package/hmr/shared/protocol.d.ts +157 -0
- package/hmr/shared/protocol.js +28 -0
- package/hmr/shared/protocol.js.map +1 -0
- package/hmr/shared/runtime/boot-complete.d.ts +14 -0
- package/hmr/shared/runtime/boot-complete.js +32 -0
- package/hmr/shared/runtime/boot-complete.js.map +1 -0
- package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
- package/hmr/shared/runtime/boot-progress.d.ts +44 -0
- package/hmr/shared/runtime/boot-progress.js +134 -0
- package/hmr/shared/runtime/boot-progress.js.map +1 -0
- package/hmr/shared/runtime/boot-timeline.d.ts +1 -1
- package/hmr/shared/runtime/boot-timeline.js +8 -19
- package/hmr/shared/runtime/boot-timeline.js.map +1 -1
- package/hmr/shared/runtime/browser-runtime-contract.d.ts +58 -25
- package/hmr/shared/runtime/browser-runtime-contract.js +21 -9
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
- package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
- package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
- package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
- package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
- package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
- package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
- package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay.d.ts +23 -69
- package/hmr/shared/runtime/dev-overlay.js +67 -1011
- package/hmr/shared/runtime/dev-overlay.js.map +1 -1
- package/hmr/shared/runtime/global-scope.d.ts +18 -0
- package/hmr/shared/runtime/global-scope.js +21 -0
- package/hmr/shared/runtime/global-scope.js.map +1 -0
- package/hmr/shared/runtime/hooks.js +2 -1
- package/hmr/shared/runtime/hooks.js.map +1 -1
- package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
- package/hmr/shared/runtime/launch-bridge.js +98 -0
- package/hmr/shared/runtime/launch-bridge.js.map +1 -0
- package/hmr/shared/runtime/module-provenance.js +3 -2
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
- package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
- package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
- package/hmr/shared/runtime/overlay-flag.js +34 -0
- package/hmr/shared/runtime/overlay-flag.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
- package/hmr/shared/runtime/root-placeholder-view.js +311 -0
- package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder.js +382 -157
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +209 -54
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-bootstrap.js +2 -1
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
- package/hmr/shared/runtime/vendor-resolve.js +45 -0
- package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
- package/hmr/shared/runtime/worker-tracking.d.ts +28 -0
- package/hmr/shared/runtime/worker-tracking.js +114 -0
- package/hmr/shared/runtime/worker-tracking.js.map +1 -0
- package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +909 -0
- package/hmr/shared/vendor/manifest-collect.js.map +1 -0
- package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
- package/hmr/shared/vendor/manifest-loader.js +5 -3
- package/hmr/shared/vendor/manifest-loader.js.map +1 -1
- package/hmr/shared/vendor/manifest.d.ts +10 -35
- package/hmr/shared/vendor/manifest.js +154 -978
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/hmr/shared/vendor/registry.d.ts +2 -0
- package/hmr/shared/vendor/registry.js +14 -0
- package/hmr/shared/vendor/registry.js.map +1 -1
- package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
- package/hmr/shared/vendor/vendor-device-shim.js +208 -0
- package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
- package/package.json +70 -13
- package/runtime/core-aliases-early.js +11 -16
- package/runtime/core-aliases-early.js.map +1 -1
- package/shims/react-jsx-runtime.d.ts +4 -0
- package/shims/react-jsx-runtime.js +61 -0
- package/shims/react-jsx-runtime.js.map +1 -0
- package/helpers/angular/angular-linker.d.ts +0 -13
- package/helpers/angular/angular-linker.js +0 -185
- package/helpers/angular/angular-linker.js.map +0 -1
- package/helpers/angular/inject-component-hmr-registration.js.map +0 -1
- package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
- package/helpers/angular/shared-linker.d.ts +0 -11
- package/helpers/angular/shared-linker.js +0 -75
- package/helpers/angular/shared-linker.js.map +0 -1
- package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
- package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
- package/helpers/angular/util.js.map +0 -1
- package/helpers/module-runner-patch.d.ts +0 -3
- package/helpers/module-runner-patch.js +0 -63
- package/helpers/module-runner-patch.js.map +0 -1
- package/helpers/prelink-angular.d.ts +0 -2
- package/helpers/prelink-angular.js +0 -114
- package/helpers/prelink-angular.js.map +0 -1
- package/hmr/server/websocket-angular-entry.js.map +0 -1
- package/hmr/server/websocket-angular-hot-update.js.map +0 -1
- package/hmr/server/websocket-ns-m-finalize.d.ts +0 -22
- package/hmr/server/websocket-ns-m-finalize.js +0 -88
- package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
- package/hmr/server/websocket-runtime-compat.d.ts +0 -19
- package/hmr/server/websocket-runtime-compat.js +0 -287
- package/hmr/server/websocket-runtime-compat.js.map +0 -1
- package/hmr/server/websocket-vue-sfc.d.ts +0 -27
- package/hmr/server/websocket-vue-sfc.js +0 -1069
- package/hmr/server/websocket-vue-sfc.js.map +0 -1
- package/hmr/shared/runtime/http-only-boot.d.ts +0 -2
- package/hmr/shared/runtime/http-only-boot.js +0 -171
- package/hmr/shared/runtime/http-only-boot.js.map +0 -1
- package/hmr/vendor-bootstrap.d.ts +0 -3
- package/hmr/vendor-bootstrap.js +0 -32
- package/hmr/vendor-bootstrap.js.map +0 -1
- package/shims/react-reconciler-constants.d.ts +0 -14
- package/shims/react-reconciler-constants.js +0 -21
- package/shims/react-reconciler-constants.js.map +0 -1
- package/shims/react-reconciler.d.ts +0 -8
- package/shims/react-reconciler.js +0 -15
- package/shims/react-reconciler.js.map +0 -1
- package/transformers/NativeClass/index.d.ts +0 -2
- package/transformers/NativeClass/index.js +0 -222
- package/transformers/NativeClass/index.js.map +0 -1
- /package/{helpers/angular → hmr/frameworks/angular/build}/inject-component-hmr-registration.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/util.js +0 -0
- /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
|
@@ -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,117 @@
|
|
|
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
|
+
* Decide whether a changed module goes through the shared evict + re-import
|
|
75
|
+
* queue in this realm. Return `false` for a module whose fresh body must
|
|
76
|
+
* not evaluate here — a worker script only a worker isolate ever loaded,
|
|
77
|
+
* a type-only module nothing imports. Declined ids are handed to
|
|
78
|
+
* {@link applyUnqueuedChanges} instead. Defaults to `true`.
|
|
79
|
+
*/
|
|
80
|
+
shouldQueueReimport?(id: string): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Apply the changed modules {@link shouldQueueReimport} declined, in the
|
|
83
|
+
* same delta. Runs only after boot, for real edits, and only when at least
|
|
84
|
+
* one id was declined.
|
|
85
|
+
*/
|
|
86
|
+
applyUnqueuedChanges?(ids: string[]): void | Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* A full graph arrived after boot with hashes that differ from the client's
|
|
89
|
+
* mirror — a reconnect after a dev-server restart, or version drift. The
|
|
90
|
+
* shared fallback re-imports every changed module piecemeal, outside any
|
|
91
|
+
* accept/dispose sequencing. Return `true` to take over (Octane requests
|
|
92
|
+
* one ordered graph reload instead); `changedIds` is the inferred set.
|
|
93
|
+
*/
|
|
94
|
+
handleGraphResync?(changedIds: string[]): boolean | Promise<boolean>;
|
|
95
|
+
/**
|
|
96
|
+
* Runs once per queue drain, BEFORE the changed modules are evicted from
|
|
97
|
+
* the runtime registry. The only point at which a framework can still reach
|
|
98
|
+
* the module instances about to be replaced — their `hot.accept` callbacks
|
|
99
|
+
* and `hot.dispose` registrations are reset when the fresh bodies evaluate
|
|
100
|
+
* (Octane: Vite-parity accept/dispose sequencing).
|
|
101
|
+
*/
|
|
102
|
+
beforeBatchEvict?(drained: string[]): void;
|
|
103
|
+
/**
|
|
104
|
+
* Post-process one freshly re-imported module during the queue drain
|
|
105
|
+
* (TypeScript/React: refresh the bundled module registry so Builder /
|
|
106
|
+
* `loadModule` resolves the NEW code-behind instead of the boot-bundle copy).
|
|
107
|
+
*/
|
|
108
|
+
afterModuleReimport?(id: string, mod: any): void;
|
|
109
|
+
/** Framework UI refresh after a re-import batch drains. */
|
|
110
|
+
refreshAfterBatch?(drained: string[], ctx: FrameworkClientBatchContext): void | Promise<void>;
|
|
111
|
+
/** Handle a framework hot-update protocol message (resolves true if consumed). */
|
|
112
|
+
handleHotUpdateMessage?(msg: any, ctx: FrameworkClientMessageContext): Promise<boolean>;
|
|
113
|
+
/** Handle the framework SFC registry message. */
|
|
114
|
+
handleSfcRegistry?(msg: any): void;
|
|
115
|
+
/** Handle the framework SFC registry-update message (drives its own overlay). */
|
|
116
|
+
handleSfcRegistryUpdate?(msg: any, graphVersion: number, ctx: FrameworkClientMessageContext): Promise<void>;
|
|
117
|
+
}
|
|
@@ -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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@nativescript/vite/hmr/client/framework.js` — the device-side surface a
|
|
3
|
+
* framework's client strategy is written against.
|
|
4
|
+
*
|
|
5
|
+
* A registered flavor's client module is served to the device through
|
|
6
|
+
* `/ns/m` and evaluates in the same realm as the shared HMR client. It must
|
|
7
|
+
* reach the client's singletons — the module graph mirror, the hot registry,
|
|
8
|
+
* the overlay — through this one module, so that both resolve to the same
|
|
9
|
+
* canonical URLs and therefore the same instances. Importing the client's
|
|
10
|
+
* internal files by path is not supported.
|
|
11
|
+
*/
|
|
12
|
+
export type { FrameworkClientStrategy, FrameworkClientBatchContext, FrameworkClientMessageContext, FrameworkClientMountContext, ClientGraphModule } from './framework-client-strategy.js';
|
|
13
|
+
export type { NsHotRegistry, NsHotContext } from './hot-context.js';
|
|
14
|
+
/** The process-wide `import.meta.hot` registry: accept/dispose callbacks, dependency acceptors, `hot.data`, events, full reload. */
|
|
15
|
+
export { getNsHotRegistry } from './hot-context.js';
|
|
16
|
+
/** Live mirror of the server's module graph (id → { deps, hash }). */
|
|
17
|
+
export { graph, getGraphVersion } from './utils.js';
|
|
18
|
+
/** Canonical-URL helpers and the evict + re-import primitives the shared queue uses. */
|
|
19
|
+
export { normalizeSpec, requestModuleFromServer, invalidateModulesByUrls, buildEvictionUrls, resolveHmrHttpOrigin, safeDynImport } from './utils.js';
|
|
20
|
+
/** `@nativescript/core` export lookup that resolves against the live core realm. */
|
|
21
|
+
export { getCore } from './utils.js';
|
|
22
|
+
export { ENV_VERBOSE } from './utils.js';
|
|
23
|
+
/** Drive the on-device "HMR update" overlay: 'received' | 'evicting' | 'reimporting' | 'rebooting' | 'complete'. */
|
|
24
|
+
export { setUpdateStage, getOverlayApi } from './overlay-driver.js';
|
|
25
|
+
export type { HmrUpdateOverlayStage } from './overlay-driver.js';
|
|
26
|
+
/** Swap the live root view for a freshly loaded component (the reset path). */
|
|
27
|
+
export { performResetRoot } from './root-reset.js';
|
|
28
|
+
export { getGlobalScope } from '../shared/runtime/global-scope.js';
|
|
29
|
+
/** The `ns:module` builtin as the runtime exposes it (`invalidateModules`, `getLoadedModuleUrls`, …); `{}` off-device. */
|
|
30
|
+
export { readNsRuntimeDevHostApi } from '../shared/runtime/browser-runtime-contract.js';
|
|
31
|
+
export type { NsRuntimeDevHostApi } from '../shared/runtime/browser-runtime-contract.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** The process-wide `import.meta.hot` registry: accept/dispose callbacks, dependency acceptors, `hot.data`, events, full reload. */
|
|
2
|
+
export { getNsHotRegistry } from './hot-context.js';
|
|
3
|
+
/** Live mirror of the server's module graph (id → { deps, hash }). */
|
|
4
|
+
export { graph, getGraphVersion } from './utils.js';
|
|
5
|
+
/** Canonical-URL helpers and the evict + re-import primitives the shared queue uses. */
|
|
6
|
+
export { normalizeSpec, requestModuleFromServer, invalidateModulesByUrls, buildEvictionUrls, resolveHmrHttpOrigin, safeDynImport } from './utils.js';
|
|
7
|
+
/** `@nativescript/core` export lookup that resolves against the live core realm. */
|
|
8
|
+
export { getCore } from './utils.js';
|
|
9
|
+
export { ENV_VERBOSE } from './utils.js';
|
|
10
|
+
/** Drive the on-device "HMR update" overlay: 'received' | 'evicting' | 'reimporting' | 'rebooting' | 'complete'. */
|
|
11
|
+
export { setUpdateStage, getOverlayApi } from './overlay-driver.js';
|
|
12
|
+
/** Swap the live root view for a freshly loaded component (the reset path). */
|
|
13
|
+
export { performResetRoot } from './root-reset.js';
|
|
14
|
+
export { getGlobalScope } from '../shared/runtime/global-scope.js';
|
|
15
|
+
/** The `ns:module` builtin as the runtime exposes it (`invalidateModules`, `getLoadedModuleUrls`, …); `{}` off-device. */
|
|
16
|
+
export { readNsRuntimeDevHostApi } from '../shared/runtime/browser-runtime-contract.js';
|
|
17
|
+
//# sourceMappingURL=framework.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/framework.ts"],"names":[],"mappings":"AAcA,oIAAoI;AACpI,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,sEAAsE;AACtE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACpD,wFAAwF;AACxF,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrJ,oFAAoF;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,oHAAoH;AACpH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpE,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,0HAA0H;AAC1H,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC"}
|
|
@@ -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,89 @@
|
|
|
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
|
+
/**
|
|
34
|
+
* Accept callbacks registered by `key`'s CURRENT evaluation (a copy; an
|
|
35
|
+
* argument-less `hot.accept()` contributes a no-op). They belong to the
|
|
36
|
+
* module instance being replaced, so a framework strategy must read them
|
|
37
|
+
* BEFORE eviction — `createHotContext` resets them the moment the fresh body
|
|
38
|
+
* evaluates — and invoke them with the fresh namespace afterwards (Vite's
|
|
39
|
+
* accept contract). A non-empty result is what makes a module a
|
|
40
|
+
* self-accepting HMR boundary.
|
|
41
|
+
*/
|
|
42
|
+
getAcceptCallbacks(key: string): HotCallback[];
|
|
43
|
+
/**
|
|
44
|
+
* Modules whose CURRENT evaluation accepts updates to `depKey` through the
|
|
45
|
+
* dependency form of `hot.accept`. Each callback takes the array Vite
|
|
46
|
+
* passes (`[freshNamespace]`, `[undefined]` when the dependency does not
|
|
47
|
+
* evaluate in this realm). Same lifetime rule as `getAcceptCallbacks`.
|
|
48
|
+
*/
|
|
49
|
+
getDepAcceptors(depKey: string): Array<{
|
|
50
|
+
owner: string;
|
|
51
|
+
callback: HotCallback;
|
|
52
|
+
}>;
|
|
53
|
+
/** True when `ownerKey`'s current evaluation accepts `depKey` via the dependency form. */
|
|
54
|
+
acceptsDep(ownerKey: string, depKey: string): boolean;
|
|
55
|
+
/** Fire `hot.on(event, cb)` listeners. Returns the number of listeners invoked. */
|
|
56
|
+
dispatchHotEvent(event: string, payload?: unknown): number;
|
|
57
|
+
listHotEventListeners(): Record<string, number>;
|
|
58
|
+
/** Wire `hot.send(...)` to the active WebSocket (installed by the full client). */
|
|
59
|
+
setSendToServer(fn: ((event: string, data?: unknown) => void) | null): void;
|
|
60
|
+
/** Override the full-reload behavior (`hot.invalidate()`, declined modules). */
|
|
61
|
+
setFullReloadHandler(fn: ((message?: string) => void) | null): void;
|
|
62
|
+
requestFullReload(message?: string): void;
|
|
63
|
+
}
|
|
64
|
+
export interface NsHotContext {
|
|
65
|
+
readonly data: Record<string, unknown>;
|
|
66
|
+
accept(...args: unknown[]): void;
|
|
67
|
+
acceptExports(exportNames: string[], cb?: HotCallback): void;
|
|
68
|
+
dispose(cb: HotCallback): void;
|
|
69
|
+
prune(cb: HotCallback): void;
|
|
70
|
+
decline(): void;
|
|
71
|
+
invalidate(message?: string): void;
|
|
72
|
+
on(event: string, cb: HotCallback): void;
|
|
73
|
+
off(event: string, cb: HotCallback): void;
|
|
74
|
+
send(event: string, data?: unknown): void;
|
|
75
|
+
}
|
|
76
|
+
declare global {
|
|
77
|
+
var __NS_HOT_REGISTRY__: NsHotRegistry | undefined;
|
|
78
|
+
var __NS_DEV_ENTRY_URL__: string | undefined;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Install (or return the already-installed) process-wide hot registry.
|
|
82
|
+
* Idempotent — safe to call from the bootstrap client, the full client and
|
|
83
|
+
* tests; the first installation wins.
|
|
84
|
+
*/
|
|
85
|
+
export declare function installNsHotRegistry(): NsHotRegistry;
|
|
86
|
+
/** Read the installed registry (installing lazily so callers never race). */
|
|
87
|
+
export declare function getNsHotRegistry(): NsHotRegistry;
|
|
88
|
+
export declare function createHotContext(ownerId: string): NsHotContext;
|
|
89
|
+
export {};
|