@nativescript/vite 8.0.0-alpha.5 → 8.0.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -11
- package/bin/cli.cjs +8 -14
- package/configuration/angular.d.ts +34 -1
- package/configuration/angular.js +376 -165
- package/configuration/angular.js.map +1 -1
- package/configuration/base.js +241 -51
- 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-state.d.ts +8 -0
- package/helpers/app-css-state.js +8 -0
- package/helpers/app-css-state.js.map +1 -0
- package/helpers/bundler-context.d.ts +11 -0
- package/helpers/bundler-context.js +71 -0
- package/helpers/bundler-context.js.map +1 -0
- package/helpers/cli-flags.d.ts +12 -0
- package/helpers/cli-flags.js +34 -0
- package/helpers/cli-flags.js.map +1 -1
- package/helpers/css-platform-plugin.d.ts +14 -0
- package/helpers/css-platform-plugin.js +43 -25
- package/helpers/css-platform-plugin.js.map +1 -1
- package/helpers/dev-host.d.ts +360 -0
- package/helpers/dev-host.js +694 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/dynamic-import-plugin.js +1 -1
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +4 -1
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -12
- package/helpers/external-configs.js +58 -35
- package/helpers/external-configs.js.map +1 -1
- package/helpers/global-defines.d.ts +142 -0
- package/helpers/global-defines.js +213 -11
- package/helpers/global-defines.js.map +1 -1
- package/helpers/hmr-scope.d.ts +26 -0
- package/helpers/hmr-scope.js +67 -0
- package/helpers/hmr-scope.js.map +1 -0
- package/helpers/init.js +0 -18
- package/helpers/init.js.map +1 -1
- package/helpers/logging.d.ts +1 -0
- package/helpers/logging.js +65 -4
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +3 -1
- package/helpers/main-entry.js +301 -53
- package/helpers/main-entry.js.map +1 -1
- package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
- package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
- package/helpers/nativeclass-transform.js +5 -6
- package/helpers/nativeclass-transform.js.map +1 -1
- package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
- package/helpers/nativeclass-transformer-plugin.js +157 -14
- package/helpers/nativeclass-transformer-plugin.js.map +1 -1
- package/helpers/nativescript-package-resolver.js +10 -62
- package/helpers/nativescript-package-resolver.js.map +1 -1
- package/helpers/normalize-id.d.ts +42 -0
- package/helpers/normalize-id.js +60 -0
- package/helpers/normalize-id.js.map +1 -0
- package/helpers/ns-core-url.d.ts +29 -7
- package/helpers/ns-core-url.js +69 -12
- 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 +14 -0
- package/helpers/ts-config-paths.js +90 -9
- package/helpers/ts-config-paths.js.map +1 -1
- package/helpers/typescript-check.d.ts +2 -1
- package/helpers/typescript-check.js +2 -2
- 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/workers.d.ts +20 -19
- package/helpers/workers.js +624 -4
- package/helpers/workers.js.map +1 -1
- package/hmr/client/css-handler.d.ts +2 -1
- package/hmr/client/css-handler.js +50 -26
- package/hmr/client/css-handler.js.map +1 -1
- package/hmr/client/css-update-overlay.d.ts +18 -0
- package/hmr/client/css-update-overlay.js +27 -0
- package/hmr/client/css-update-overlay.js.map +1 -0
- package/hmr/client/framework-client-strategy.d.ts +79 -0
- package/hmr/client/framework-client-strategy.js +19 -0
- package/hmr/client/framework-client-strategy.js.map +1 -0
- package/hmr/client/hmr-pending-overlay.d.ts +13 -0
- package/hmr/client/hmr-pending-overlay.js +60 -0
- package/hmr/client/hmr-pending-overlay.js.map +1 -0
- package/hmr/client/index.js +891 -220
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/utils.d.ts +7 -1
- package/hmr/client/utils.js +207 -29
- package/hmr/client/utils.js.map +1 -1
- package/hmr/entry-runtime.d.ts +2 -1
- package/hmr/entry-runtime.js +256 -69
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
- package/hmr/frameworks/angular/build/angular-linker.js +109 -0
- package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
- package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
- package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
- package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
- package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
- package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
- package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
- package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
- package/hmr/frameworks/angular/build/shared-linker.js +128 -0
- package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
- package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
- package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
- package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
- package/hmr/frameworks/angular/build/util.js +155 -0
- package/hmr/frameworks/angular/build/util.js.map +1 -0
- package/hmr/frameworks/angular/client/index.d.ts +1 -0
- package/hmr/frameworks/angular/client/index.js +859 -21
- package/hmr/frameworks/angular/client/index.js.map +1 -1
- package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
- package/hmr/frameworks/angular/client/strategy.js +19 -0
- package/hmr/frameworks/angular/client/strategy.js.map +1 -0
- package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
- package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
- package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
- package/hmr/frameworks/angular/server/linker.js +1 -4
- package/hmr/frameworks/angular/server/linker.js.map +1 -1
- package/hmr/frameworks/angular/server/strategy.js +460 -12
- package/hmr/frameworks/angular/server/strategy.js.map +1 -1
- package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
- package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
- package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +17 -11
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +336 -0
- package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
- package/hmr/frameworks/react/server/strategy.d.ts +2 -0
- package/hmr/frameworks/react/server/strategy.js +150 -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 +54 -0
- package/hmr/frameworks/solid/client/app-runtime.js +184 -0
- package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
- package/hmr/frameworks/solid/server/strategy.js +291 -16
- package/hmr/frameworks/solid/server/strategy.js.map +1 -1
- package/hmr/frameworks/typescript/server/strategy.js +38 -14
- package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/client/dep-propagation.d.ts +36 -0
- package/hmr/frameworks/vue/client/dep-propagation.js +101 -0
- package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
- package/hmr/frameworks/vue/client/index.d.ts +8 -0
- package/hmr/frameworks/vue/client/index.js +56 -243
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
- package/hmr/frameworks/vue/client/strategy.js +157 -0
- package/hmr/frameworks/vue/client/strategy.js.map +1 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +142 -0
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js +747 -0
- package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
- package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js +459 -0
- package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +38 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js +48 -0
- package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
- package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
- package/hmr/frameworks/vue/server/strategy.js +278 -1
- package/hmr/frameworks/vue/server/strategy.js.map +1 -1
- package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
- package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
- package/hmr/helpers/ast-normalizer.d.ts +3 -1
- package/hmr/helpers/ast-normalizer.js +77 -10
- package/hmr/helpers/ast-normalizer.js.map +1 -1
- package/hmr/helpers/cjs-named-exports.d.ts +23 -0
- package/hmr/helpers/cjs-named-exports.js +152 -0
- package/hmr/helpers/cjs-named-exports.js.map +1 -0
- package/hmr/helpers/package-exports.d.ts +16 -0
- package/hmr/helpers/package-exports.js +396 -0
- package/hmr/helpers/package-exports.js.map +1 -0
- package/hmr/server/constants.js +20 -5
- package/hmr/server/constants.js.map +1 -1
- package/hmr/server/core-sanitize.d.ts +86 -7
- package/hmr/server/core-sanitize.js +170 -45
- package/hmr/server/core-sanitize.js.map +1 -1
- package/hmr/server/device-transform-helpers.d.ts +24 -0
- package/hmr/server/device-transform-helpers.js +408 -0
- package/hmr/server/device-transform-helpers.js.map +1 -0
- package/hmr/server/framework-strategy.d.ts +108 -11
- package/hmr/server/hmr-module-graph.d.ts +37 -0
- package/hmr/server/hmr-module-graph.js +214 -0
- package/hmr/server/hmr-module-graph.js.map +1 -0
- package/hmr/server/import-map.d.ts +11 -2
- package/hmr/server/import-map.js +92 -45
- package/hmr/server/import-map.js.map +1 -1
- package/hmr/server/index.js +7 -16
- package/hmr/server/index.js.map +1 -1
- package/hmr/server/ns-core-cjs-shape.d.ts +2 -4
- package/hmr/server/ns-core-cjs-shape.js +4 -6
- package/hmr/server/ns-core-cjs-shape.js.map +1 -1
- package/hmr/server/ns-rt-bridge.d.ts +51 -0
- package/hmr/server/ns-rt-bridge.js +131 -0
- package/hmr/server/ns-rt-bridge.js.map +1 -0
- package/hmr/server/ns-rt-route.d.ts +5 -0
- package/hmr/server/ns-rt-route.js +38 -0
- package/hmr/server/ns-rt-route.js.map +1 -0
- package/hmr/server/perf-instrumentation.d.ts +114 -0
- package/hmr/server/perf-instrumentation.js +197 -0
- package/hmr/server/perf-instrumentation.js.map +1 -0
- package/hmr/server/process-code-for-device.d.ts +14 -0
- package/hmr/server/process-code-for-device.js +699 -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 +630 -0
- package/hmr/server/rewrite-imports.js.map +1 -0
- package/hmr/server/route-helpers.d.ts +7 -0
- package/hmr/server/route-helpers.js +13 -0
- package/hmr/server/route-helpers.js.map +1 -0
- package/hmr/server/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +83 -0
- package/hmr/server/server-origin.js.map +1 -0
- package/hmr/server/shared-transform-request.js +13 -7
- package/hmr/server/shared-transform-request.js.map +1 -1
- package/hmr/server/transform-cache-invalidation.d.ts +37 -0
- package/hmr/server/transform-cache-invalidation.js +156 -0
- package/hmr/server/transform-cache-invalidation.js.map +1 -0
- package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
- package/hmr/server/vendor-bare-module-shims.js +80 -0
- package/hmr/server/vendor-bare-module-shims.js.map +1 -0
- package/hmr/server/vite-plugin.js +78 -42
- package/hmr/server/vite-plugin.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +45 -4
- package/hmr/server/websocket-core-bridge.js +50 -48
- package/hmr/server/websocket-core-bridge.js.map +1 -1
- package/hmr/server/websocket-css-hot-update.d.ts +33 -0
- package/hmr/server/websocket-css-hot-update.js +65 -0
- package/hmr/server/websocket-css-hot-update.js.map +1 -0
- package/hmr/server/websocket-device-transform.d.ts +3 -0
- package/hmr/server/websocket-device-transform.js +7 -0
- package/hmr/server/websocket-device-transform.js.map +1 -0
- package/hmr/server/websocket-graph-upsert.d.ts +15 -0
- package/hmr/server/websocket-graph-upsert.js +20 -0
- package/hmr/server/websocket-graph-upsert.js.map +1 -1
- package/hmr/server/websocket-hmr-pending.d.ts +37 -0
- package/hmr/server/websocket-hmr-pending.js +55 -0
- package/hmr/server/websocket-hmr-pending.js.map +1 -0
- package/hmr/server/websocket-hot-update.d.ts +77 -0
- package/hmr/server/websocket-hot-update.js +360 -0
- package/hmr/server/websocket-hot-update.js.map +1 -0
- package/hmr/server/websocket-import-map-route.d.ts +15 -0
- package/hmr/server/websocket-import-map-route.js +50 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.js +3 -3
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +66 -2
- package/hmr/server/websocket-module-specifiers.js +191 -20
- package/hmr/server/websocket-module-specifiers.js.map +1 -1
- package/hmr/server/websocket-ns-core.d.ts +21 -0
- package/hmr/server/websocket-ns-core.js +311 -0
- package/hmr/server/websocket-ns-core.js.map +1 -0
- package/hmr/server/websocket-ns-entry.d.ts +21 -0
- package/hmr/server/websocket-ns-entry.js +164 -0
- package/hmr/server/websocket-ns-entry.js.map +1 -0
- package/hmr/server/websocket-ns-m-paths.d.ts +1 -1
- package/hmr/server/websocket-ns-m-paths.js +58 -13
- package/hmr/server/websocket-ns-m-paths.js.map +1 -1
- package/hmr/server/websocket-ns-m-request.d.ts +11 -1
- package/hmr/server/websocket-ns-m-request.js +18 -25
- package/hmr/server/websocket-ns-m-request.js.map +1 -1
- package/hmr/server/websocket-ns-m.d.ts +33 -0
- package/hmr/server/websocket-ns-m.js +752 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +49 -3
- package/hmr/server/websocket-served-module-helpers.js +403 -87
- package/hmr/server/websocket-served-module-helpers.js.map +1 -1
- package/hmr/server/websocket-txn.js +2 -8
- package/hmr/server/websocket-txn.js.map +1 -1
- package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
- package/hmr/server/websocket-vendor-unifier.js +4 -9
- package/hmr/server/websocket-vendor-unifier.js.map +1 -1
- package/hmr/server/websocket.d.ts +8 -39
- package/hmr/server/websocket.js +608 -6300
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +118 -0
- package/hmr/shared/ns-globals.js +29 -0
- package/hmr/shared/ns-globals.js.map +1 -0
- package/hmr/shared/protocol.d.ts +145 -0
- package/hmr/shared/protocol.js +28 -0
- package/hmr/shared/protocol.js.map +1 -0
- package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
- package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
- package/hmr/shared/runtime/boot-progress.d.ts +44 -0
- package/hmr/shared/runtime/boot-progress.js +133 -0
- package/hmr/shared/runtime/boot-progress.js.map +1 -0
- package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
- package/hmr/shared/runtime/boot-timeline.js +42 -0
- package/hmr/shared/runtime/boot-timeline.js.map +1 -0
- package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
- package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
- package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
- package/hmr/shared/runtime/dev-overlay.d.ts +119 -26
- package/hmr/shared/runtime/dev-overlay.js +1196 -262
- package/hmr/shared/runtime/dev-overlay.js.map +1 -1
- package/hmr/shared/runtime/global-scope.d.ts +18 -0
- package/hmr/shared/runtime/global-scope.js +21 -0
- package/hmr/shared/runtime/global-scope.js.map +1 -0
- package/hmr/shared/runtime/hooks.js +2 -1
- package/hmr/shared/runtime/hooks.js.map +1 -1
- package/hmr/shared/runtime/http-only-boot.js +7 -6
- package/hmr/shared/runtime/http-only-boot.js.map +1 -1
- package/hmr/shared/runtime/module-provenance.js +4 -6
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
- package/hmr/shared/runtime/root-placeholder-view.js +311 -0
- package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
- package/hmr/shared/runtime/root-placeholder.js +393 -200
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +168 -4
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
- package/hmr/shared/vendor/manifest-collect.js +549 -0
- package/hmr/shared/vendor/manifest-collect.js.map +1 -0
- package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
- package/hmr/shared/vendor/manifest-loader.js +5 -3
- package/hmr/shared/vendor/manifest-loader.js.map +1 -1
- package/hmr/shared/vendor/manifest.d.ts +1 -7
- package/hmr/shared/vendor/manifest.js +84 -819
- package/hmr/shared/vendor/manifest.js.map +1 -1
- package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
- package/hmr/shared/vendor/vendor-device-shim.js +208 -0
- package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +38 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js +296 -0
- package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
- package/hmr/vendor-bootstrap.d.ts +1 -3
- package/hmr/vendor-bootstrap.js +4 -6
- package/hmr/vendor-bootstrap.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +5 -0
- package/index.js.map +1 -1
- package/package.json +61 -11
- package/runtime/core-aliases-early.js +25 -55
- package/runtime/core-aliases-early.js.map +1 -1
- package/shims/react-jsx-runtime.d.ts +4 -0
- package/shims/react-jsx-runtime.js +37 -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/prelink-angular.d.ts +0 -2
- package/helpers/prelink-angular.js +0 -117
- package/helpers/prelink-angular.js.map +0 -1
- package/hmr/server/websocket-angular-entry.js.map +0 -1
- package/hmr/server/websocket-angular-hot-update.js +0 -239
- package/hmr/server/websocket-angular-hot-update.js.map +0 -1
- package/hmr/server/websocket-ns-m-finalize.d.ts +0 -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 -286
- 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 -1117
- package/hmr/server/websocket-vue-sfc.js.map +0 -1
- package/transformers/NativeClass/index.d.ts +0 -2
- package/transformers/NativeClass/index.js +0 -222
- package/transformers/NativeClass/index.js.map +0 -1
- /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
- /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
- /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { getProjectAppVirtualPath } from '../../../../helpers/utils.js';
|
|
2
|
+
import { isRuntimeGraphExcludedPath } from '../../../server/runtime-graph-filter.js';
|
|
3
|
+
import { canonicalizeTransformRequestCacheKey } from '../../../server/transform-cache-invalidation.js';
|
|
4
|
+
const APP_VIRTUAL_WITH_SLASH = `${getProjectAppVirtualPath()}/`;
|
|
5
|
+
export function collectGraphUpdateModulesForHotUpdate(options) {
|
|
6
|
+
const targets = new Map();
|
|
7
|
+
const addTarget = (mod) => {
|
|
8
|
+
const id = mod?.id?.replace(/\?.*$/, '');
|
|
9
|
+
if (!id)
|
|
10
|
+
return;
|
|
11
|
+
if (isRuntimeGraphExcludedPath(id))
|
|
12
|
+
return;
|
|
13
|
+
if (!targets.has(id)) {
|
|
14
|
+
targets.set(id, mod);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
if (options.flavor === 'angular' && /\.(html|htm)$/i.test(options.file)) {
|
|
18
|
+
const importerIdsSeen = [];
|
|
19
|
+
const importerIdsAccepted = [];
|
|
20
|
+
for (const mod of options.modules || []) {
|
|
21
|
+
for (const importer of mod?.importers || []) {
|
|
22
|
+
const importerId = importer?.id || '';
|
|
23
|
+
importerIdsSeen.push(importerId);
|
|
24
|
+
if (/\.[cm]?[jt]sx?(?:$|\?)/i.test(importerId)) {
|
|
25
|
+
addTarget(importer);
|
|
26
|
+
importerIdsAccepted.push(importerId);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const fellBackToFile = !targets.size;
|
|
31
|
+
if (fellBackToFile) {
|
|
32
|
+
addTarget(options.getModuleById(options.file.replace(/\.(html|htm)$/i, '.ts')));
|
|
33
|
+
addTarget(options.getModuleById(options.file.replace(/\.(html|htm)$/i, '.js')));
|
|
34
|
+
}
|
|
35
|
+
if (options.verbose) {
|
|
36
|
+
console.info(`[ns-hmr][server] collectGraphUpdateModulesForHotUpdate(html) file=${options.file} importersSeen=${importerIdsSeen.length} importersAccepted=${importerIdsAccepted.length} fellBackToFile=${fellBackToFile} targets=${targets.size}`);
|
|
37
|
+
if (importerIdsSeen.length) {
|
|
38
|
+
console.info(`[ns-hmr][server] importersSeen sample=`, importerIdsSeen.slice(0, 8));
|
|
39
|
+
}
|
|
40
|
+
if (importerIdsAccepted.length) {
|
|
41
|
+
console.info(`[ns-hmr][server] importersAccepted sample=`, importerIdsAccepted.slice(0, 8));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return Array.from(targets.values());
|
|
45
|
+
}
|
|
46
|
+
if (!options.file.endsWith('.vue')) {
|
|
47
|
+
addTarget(options.getModuleById(options.file) || options.getModuleById(options.file + '?vue'));
|
|
48
|
+
}
|
|
49
|
+
return Array.from(targets.values());
|
|
50
|
+
}
|
|
51
|
+
export function collectAngularHotUpdateRoots(options) {
|
|
52
|
+
const roots = [];
|
|
53
|
+
const seenIds = new Set();
|
|
54
|
+
const seenObjects = new Set();
|
|
55
|
+
const addRoot = (mod) => {
|
|
56
|
+
if (!mod) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (mod.id) {
|
|
60
|
+
if (isRuntimeGraphExcludedPath(mod.id)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (seenIds.has(mod.id)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
seenIds.add(mod.id);
|
|
67
|
+
roots.push(mod);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (seenObjects.has(mod)) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
seenObjects.add(mod);
|
|
74
|
+
roots.push(mod);
|
|
75
|
+
};
|
|
76
|
+
if (/\.(html|htm)$/i.test(options.file)) {
|
|
77
|
+
for (const mod of collectGraphUpdateModulesForHotUpdate({
|
|
78
|
+
file: options.file,
|
|
79
|
+
flavor: 'angular',
|
|
80
|
+
modules: options.modules,
|
|
81
|
+
getModuleById: options.getModuleById,
|
|
82
|
+
})) {
|
|
83
|
+
addRoot(mod);
|
|
84
|
+
}
|
|
85
|
+
return roots;
|
|
86
|
+
}
|
|
87
|
+
if (!/\.(m|c)?ts$/i.test(options.file)) {
|
|
88
|
+
return roots;
|
|
89
|
+
}
|
|
90
|
+
for (const mod of options.modules || []) {
|
|
91
|
+
addRoot(mod);
|
|
92
|
+
}
|
|
93
|
+
for (const mod of options.getModulesByFile?.(options.file) || []) {
|
|
94
|
+
addRoot(mod);
|
|
95
|
+
}
|
|
96
|
+
if (!roots.length) {
|
|
97
|
+
addRoot(options.getModuleById(options.file));
|
|
98
|
+
}
|
|
99
|
+
return roots;
|
|
100
|
+
}
|
|
101
|
+
// Angular narrowing: a TS/JS file needs to invalidate its transitive
|
|
102
|
+
// importers only when it carries Angular semantics (a top-level @Component,
|
|
103
|
+
// @Directive, @Pipe, @Injectable, or @NgModule decorator). Files that only
|
|
104
|
+
// export constants, types, enums, plain functions, or plain classes are
|
|
105
|
+
// "leaf" modules — ES modules' live bindings deliver the new exports to
|
|
106
|
+
// importers automatically once V8 re-evaluates the changed module. Forcing
|
|
107
|
+
// every importer to re-transform on a constants edit is what produces the
|
|
108
|
+
// large invalidation waves that dominate the `refresh` phase on
|
|
109
|
+
// constants-style edits in big apps.
|
|
110
|
+
//
|
|
111
|
+
// Regex anchors at line start with only whitespace before `@Decorator(` so
|
|
112
|
+
// we don't false-match on string literals, JSDoc references, or commented-
|
|
113
|
+
// out blocks. Tests pin the matching/non-matching shapes that have come up
|
|
114
|
+
// in real Angular sources.
|
|
115
|
+
const ANGULAR_SEMANTIC_DECORATOR_REGEX = /^[ \t]*@(?:Component|Directive|Pipe|Injectable|NgModule)\b\s*\(/m;
|
|
116
|
+
export function angularSourceHasSemanticDecorator(source) {
|
|
117
|
+
if (!source || source.length === 0)
|
|
118
|
+
return false;
|
|
119
|
+
return ANGULAR_SEMANTIC_DECORATOR_REGEX.test(source);
|
|
120
|
+
}
|
|
121
|
+
export function shouldInvalidateAngularTransitiveImporters(options) {
|
|
122
|
+
if (options.flavor !== 'angular') {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
// Template-only (.html/.htm) edits change the component's view but never
|
|
126
|
+
// its exported symbol shape, so importers of the component do not need to
|
|
127
|
+
// re-transform. Skipping the transitive walk here is the single biggest
|
|
128
|
+
// latency win for template HMR.
|
|
129
|
+
if (!/\.(?:(m|c)?[jt]sx?)$/i.test(options.file)) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
// When source is available, narrow to "files whose changes can affect
|
|
133
|
+
// the Angular semantics of their importers". Files without a top-level
|
|
134
|
+
// @Component/@Directive/@Pipe/@Injectable/@NgModule decorator are leaf
|
|
135
|
+
// modules — invalidating the file itself is sufficient. When source is
|
|
136
|
+
// undefined/null (e.g. ctx.read() failed or the caller didn't plumb it
|
|
137
|
+
// through), fall back to the conservative behavior: invalidate
|
|
138
|
+
// transitively.
|
|
139
|
+
if (typeof options.source === 'string') {
|
|
140
|
+
return angularSourceHasSemanticDecorator(options.source);
|
|
141
|
+
}
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
function isExtensionlessAngularAppTransformCandidate(id) {
|
|
145
|
+
return id.startsWith(APP_VIRTUAL_WITH_SLASH) && /\.(?:[mc]?[jt]sx?)$/i.test(id);
|
|
146
|
+
}
|
|
147
|
+
function addAngularTransformCacheInvalidationUrl(targets, rawId, projectRoot) {
|
|
148
|
+
const id = String(rawId || '');
|
|
149
|
+
if (!id) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const cacheKey = projectRoot ? canonicalizeTransformRequestCacheKey(id, projectRoot) : id;
|
|
153
|
+
targets.add(cacheKey);
|
|
154
|
+
const normalizedId = cacheKey.replace(/\?.*$/, '');
|
|
155
|
+
if (!isExtensionlessAngularAppTransformCandidate(normalizedId)) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
targets.add(normalizedId.replace(/\.(?:[mc]?[jt]sx?)$/i, ''));
|
|
159
|
+
}
|
|
160
|
+
export function collectAngularTransformCacheInvalidationUrls(options) {
|
|
161
|
+
const urls = new Set();
|
|
162
|
+
if (options.isTs) {
|
|
163
|
+
addAngularTransformCacheInvalidationUrl(urls, options.file, options.projectRoot);
|
|
164
|
+
}
|
|
165
|
+
for (const mod of options.hotUpdateRoots || []) {
|
|
166
|
+
addAngularTransformCacheInvalidationUrl(urls, mod?.id, options.projectRoot);
|
|
167
|
+
}
|
|
168
|
+
for (const mod of options.transitiveImporters || []) {
|
|
169
|
+
addAngularTransformCacheInvalidationUrl(urls, mod?.id, options.projectRoot);
|
|
170
|
+
}
|
|
171
|
+
return Array.from(urls);
|
|
172
|
+
}
|
|
173
|
+
// Stable URL + Explicit Invalidation.
|
|
174
|
+
//
|
|
175
|
+
// Compute the set of fully-qualified `/ns/m/<rel>` URLs that the runtime
|
|
176
|
+
// should drop from `g_moduleRegistry` before re-importing main.ts. The
|
|
177
|
+
// set must satisfy these invariants:
|
|
178
|
+
//
|
|
179
|
+
// * The changed file itself (so V8 fetches the new source).
|
|
180
|
+
// * Every transitive importer up to the entry (so the new exports are
|
|
181
|
+
// re-bound; ESM live bindings only "see" new exports if the importer
|
|
182
|
+
// re-evaluates).
|
|
183
|
+
// * No `/node_modules/` paths (vendor packages are stable in dev; evicting
|
|
184
|
+
// them would force unnecessary re-fetch + re-transform).
|
|
185
|
+
// * No virtual / runtime-graph-excluded ids (e.g. `\0` rollup virtuals).
|
|
186
|
+
// * No duplicates — the set is deduped on canonical relative path.
|
|
187
|
+
//
|
|
188
|
+
// The output URLs are origin-absolute (e.g.
|
|
189
|
+
// `http://localhost:5173/ns/m/src/main.ts`) so the runtime can feed the
|
|
190
|
+
// list directly into `__nsInvalidateModules` without any further
|
|
191
|
+
// resolution work. The runtime canonicalizer collapses any residual
|
|
192
|
+
// `__ns_hmr__/<tag>/` or `__ns_boot__/b1/` segments, so the effective
|
|
193
|
+
// registry key is `/ns/m/<rel>` regardless of any tag a stale V8 cache
|
|
194
|
+
// entry might still carry.
|
|
195
|
+
//
|
|
196
|
+
// Extensionless canonical key.
|
|
197
|
+
//
|
|
198
|
+
// Vite emits ES module import statements with extensions stripped (this
|
|
199
|
+
// is how `resolve.extensions` works for Angular/TS apps), so V8 in the
|
|
200
|
+
// NativeScript iOS runtime keys `g_moduleRegistry` by the extensionless
|
|
201
|
+
// URL it sees in the import statement. Concretely, an import like
|
|
202
|
+
// import { AppComponent } from './app.component';
|
|
203
|
+
// inside `main.ts` is rewritten by Vite to
|
|
204
|
+
// import { AppComponent } from '/ns/m/src/app/app.component';
|
|
205
|
+
// and V8 stores the resulting module under the key
|
|
206
|
+
// http://localhost:5173/ns/m/src/app/app.component
|
|
207
|
+
// (no `.ts` extension). The `moduleGraph` ids on the server, however,
|
|
208
|
+
// are absolute file paths that DO carry the extension, so a naive
|
|
209
|
+
// eviction set built from `mod.id` keys against `.../app.component.ts`
|
|
210
|
+
// — which never matches the registry entry. The runtime reports
|
|
211
|
+
// `[resolver][remove:miss]`, the cached module survives, ESM live
|
|
212
|
+
// bindings continue to point at the OLD constants module, and the user
|
|
213
|
+
// sees no visual update despite a clean HMR cycle.
|
|
214
|
+
//
|
|
215
|
+
// Workaround: for any path ending in `.ts/.tsx/.js/.jsx/.mjs/.mts/
|
|
216
|
+
// .cjs/.cts`, emit BOTH the extensioned URL AND the extension-stripped
|
|
217
|
+
// canonical URL. The runtime evicts whichever shape V8 actually has;
|
|
218
|
+
// the other is a harmless `remove:miss`. Cost: at most 2x URLs in
|
|
219
|
+
// `evictPaths` (still tiny relative to the JSON payload).
|
|
220
|
+
//
|
|
221
|
+
// Returning a `Set` of URLs (rather than an array) lets the caller
|
|
222
|
+
// collapse multiple sources (changed file + roots + transitive
|
|
223
|
+
// importers) without paying for an extra dedup pass.
|
|
224
|
+
function normalizeAngularEvictRelativeId(rawId, projectRoot) {
|
|
225
|
+
if (!rawId)
|
|
226
|
+
return null;
|
|
227
|
+
let id = String(rawId).split('?')[0].replace(/\\/g, '/');
|
|
228
|
+
if (!id)
|
|
229
|
+
return null;
|
|
230
|
+
if (id.startsWith('file://')) {
|
|
231
|
+
id = id.slice('file://'.length);
|
|
232
|
+
}
|
|
233
|
+
const root = projectRoot ? projectRoot.replace(/\\/g, '/').replace(/\/$/, '') : '';
|
|
234
|
+
if (root && id.startsWith(root)) {
|
|
235
|
+
id = id.slice(root.length);
|
|
236
|
+
}
|
|
237
|
+
if (!id.startsWith('/')) {
|
|
238
|
+
id = '/' + id;
|
|
239
|
+
}
|
|
240
|
+
if (id.includes('/node_modules/')) {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
if (isRuntimeGraphExcludedPath(id)) {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
// Reject virtual ids — they aren't fetchable over /ns/m/.
|
|
247
|
+
if (id.includes('\0') || id.includes('/@id/') || id.includes('/@fs/')) {
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
return id;
|
|
251
|
+
}
|
|
252
|
+
export function collectAngularEvictionUrls(options) {
|
|
253
|
+
const urls = new Set();
|
|
254
|
+
const origin = String(options.origin || '').replace(/\/$/, '');
|
|
255
|
+
const root = options.projectRoot;
|
|
256
|
+
const addRel = (rel) => {
|
|
257
|
+
if (!rel)
|
|
258
|
+
return;
|
|
259
|
+
// Final defense: never emit non-/ns/m URLs for eviction; the runtime
|
|
260
|
+
// would map them to a different cache namespace.
|
|
261
|
+
urls.add(`${origin}/ns/m${rel}`);
|
|
262
|
+
// V8 in the iOS runtime keys `g_moduleRegistry` by the URL Vite
|
|
263
|
+
// emitted in the *generated* import statement, which strips JS/TS
|
|
264
|
+
// extensions (see the extensionless-key block above). So the
|
|
265
|
+
// canonical registry key for an app TS/JS module is the
|
|
266
|
+
// extensionless form. Emit it alongside the `.ts` form so the
|
|
267
|
+
// explicit eviction matches whatever shape the runtime actually
|
|
268
|
+
// stored. This cannot false-positive: at most one of the two URLs
|
|
269
|
+
// maps to a real entry, and `__nsInvalidateModules` treats unknown
|
|
270
|
+
// keys as no-ops.
|
|
271
|
+
const extMatch = rel.match(/\.(?:[mc]?[jt]sx?)$/i);
|
|
272
|
+
if (extMatch) {
|
|
273
|
+
urls.add(`${origin}/ns/m${rel.slice(0, -extMatch[0].length)}`);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
addRel(normalizeAngularEvictRelativeId(options.file, root));
|
|
277
|
+
for (const mod of options.hotUpdateRoots || []) {
|
|
278
|
+
addRel(normalizeAngularEvictRelativeId(mod?.id || mod?.file, root));
|
|
279
|
+
}
|
|
280
|
+
for (const mod of options.transitiveImporters || []) {
|
|
281
|
+
addRel(normalizeAngularEvictRelativeId(mod?.id || mod?.file, root));
|
|
282
|
+
}
|
|
283
|
+
// The bootstrap entry must always be evicted: V8's `import(entry)` is a
|
|
284
|
+
// no-op if the cache entry is still live, and the entire HMR cycle
|
|
285
|
+
// hinges on re-evaluating main.ts. The transitive walk usually catches
|
|
286
|
+
// this naturally (every component reaches main via importer chains),
|
|
287
|
+
// but include it explicitly as an invariant — covers edge cases like a
|
|
288
|
+
// hand-rolled `@nativescript/hmr-strategy` overriding the candidates,
|
|
289
|
+
// or a pristine app whose graph hasn't yet linked main into the
|
|
290
|
+
// importer set.
|
|
291
|
+
if (typeof options.bootstrapEntry === 'string' && options.bootstrapEntry) {
|
|
292
|
+
addRel(normalizeAngularEvictRelativeId(options.bootstrapEntry, root));
|
|
293
|
+
}
|
|
294
|
+
return Array.from(urls);
|
|
295
|
+
}
|
|
296
|
+
export function shouldSuppressDefaultViteHotUpdate(options) {
|
|
297
|
+
if (options.flavor !== 'angular') {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
return /\.(html|htm|ts)$/i.test(options.file);
|
|
301
|
+
}
|
|
302
|
+
export function normalizeHotReloadMatchPath(raw, root) {
|
|
303
|
+
let normalized = String(raw || '')
|
|
304
|
+
.split('?')[0]
|
|
305
|
+
.replace(/\\/g, '/')
|
|
306
|
+
.replace(/^file:\/\//, '');
|
|
307
|
+
if (root) {
|
|
308
|
+
const rootNormalized = root.replace(/\\/g, '/');
|
|
309
|
+
if (normalized.startsWith(rootNormalized)) {
|
|
310
|
+
normalized = normalized.slice(rootNormalized.length);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (!normalized.startsWith('/')) {
|
|
314
|
+
normalized = `/${normalized}`;
|
|
315
|
+
}
|
|
316
|
+
return normalized;
|
|
317
|
+
}
|
|
318
|
+
export function shouldSuppressViteFullReloadPayload(options) {
|
|
319
|
+
const { payload, pendingEntries, root } = options;
|
|
320
|
+
const now = options.now ?? Date.now();
|
|
321
|
+
if (!payload || payload.type !== 'full-reload') {
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
const payloadPath = typeof payload.path === 'string' && payload.path !== '*' ? normalizeHotReloadMatchPath(payload.path, root) : null;
|
|
325
|
+
const payloadTriggeredBy = typeof payload.triggeredBy === 'string' ? normalizeHotReloadMatchPath(payload.triggeredBy, root) : null;
|
|
326
|
+
for (const entry of pendingEntries) {
|
|
327
|
+
if (!entry || entry.expiresAt <= now) {
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
if (payloadTriggeredBy === entry.absPath || payloadTriggeredBy === entry.relPath || payloadPath === entry.relPath || payloadPath === entry.absPath) {
|
|
331
|
+
return true;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
//# sourceMappingURL=websocket-angular-hot-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"websocket-angular-hot-update.js","sourceRoot":"","sources":["../../../../../../../packages/vite/hmr/frameworks/angular/server/websocket-angular-hot-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,oCAAoC,EAAE,MAAM,iDAAiD,CAAC;AAEvG,MAAM,sBAAsB,GAAG,GAAG,wBAAwB,EAAE,GAAG,CAAC;AAQhE,MAAM,UAAU,qCAAqC,CAAC,OAA+K;IACpO,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoC,CAAC;IAC5D,MAAM,SAAS,GAAG,CAAC,GAAqC,EAAE,EAAE;QAC3D,MAAM,EAAE,GAAG,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACzC,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,IAAI,0BAA0B,CAAC,EAAE,CAAC;YAAE,OAAO;QAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,GAAI,CAAC,CAAC;QACvB,CAAC;IACF,CAAC,CAAC;IAEF,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACzE,MAAM,eAAe,GAAa,EAAE,CAAC;QACrC,MAAM,mBAAmB,GAAa,EAAE,CAAC;QACzC,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;YACzC,KAAK,MAAM,QAAQ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,IAAI,KAAK,CAAC,SAAS,IAAI,GAAG,EAAE,CAAC;YACtC,SAAS;QACV,CAAC;QAED,IAAI,kBAAkB,KAAK,KAAK,CAAC,OAAO,IAAI,kBAAkB,KAAK,KAAK,CAAC,OAAO,IAAI,WAAW,KAAK,KAAK,CAAC,OAAO,IAAI,WAAW,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;YACpJ,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { typescriptServerStrategy } from '../../typescript/server/strategy.js';
|
|
5
|
+
// React server strategy for NativeScript HMR.
|
|
6
|
+
//
|
|
7
|
+
// React renders through DOMiNATIVE via `@nativescript-community/react` and runs
|
|
8
|
+
// WITHOUT React Fast Refresh (module-level reload, mirroring the Solid flavor's
|
|
9
|
+
// `hot: false`). It therefore needs no framework-specific HMR transform — it
|
|
10
|
+
// reuses the generic TypeScript strategy's device-module pipeline verbatim
|
|
11
|
+
// (HTTP-loaded modules, vendor bridge, shared graph delta on hot update).
|
|
12
|
+
//
|
|
13
|
+
// The important part is that this is REGISTERED in `STRATEGY_REGISTRY`: the
|
|
14
|
+
// server-side HMR plugin (which installs the `/ns/*` device routes — `/ns/core`,
|
|
15
|
+
// `/ns/import-map.json`, `/ns/m`, `/ns/entry-rt`, …) is only added for flavors
|
|
16
|
+
// with a registered strategy. Without it, a React project's dev server serves no
|
|
17
|
+
// `/ns/*` routes and the app fails at boot fetching `/ns/core/xhr` (404).
|
|
18
|
+
// ── React-ecosystem CJS named-export interop (the `transformNodeModule` hook) ──
|
|
19
|
+
//
|
|
20
|
+
// React and friends ship the classic prod/dev conditional re-export wrapper:
|
|
21
|
+
//
|
|
22
|
+
// if (process.env.NODE_ENV === 'production') module.exports = require('./cjs/x.production.js');
|
|
23
|
+
// else module.exports = require('./cjs/x.development.js');
|
|
24
|
+
//
|
|
25
|
+
// Served raw over `/ns/m`, that wrapper exposes ONLY a default export — the device's
|
|
26
|
+
// ESM loader can't see the names (`jsx`, `useSyncExternalStoreWithSelector`, …)
|
|
27
|
+
// because they materialize on `module.exports` only at runtime, through the
|
|
28
|
+
// conditional require. So a consumer's `import { useSyncExternalStoreWithSelector }`
|
|
29
|
+
// (or `{ jsx }` from react/jsx-runtime, etc.) fails with "does not provide an export
|
|
30
|
+
// named …". The non-HMR rolldown build bundles these fine; this only affects the
|
|
31
|
+
// HMR/dev `/ns/m` path.
|
|
32
|
+
//
|
|
33
|
+
// The DEVELOPMENT target file is plain CJS (`exports.x = …`), whose named exports
|
|
34
|
+
// the `/ns/m` pipeline DOES statically surface. So we rewrite the wrapper to
|
|
35
|
+
// re-export EXPLICIT names from its development target. (We can't `export *` — the
|
|
36
|
+
// device transform downgrades export-star to a side-effect import — so we read the
|
|
37
|
+
// dev file and list the names.) Generic: works for any such wrapper, no per-package
|
|
38
|
+
// shim.
|
|
39
|
+
const projectRequire = createRequire(path.join(process.cwd(), 'package.json'));
|
|
40
|
+
// react/jsx-runtime is the hottest of these (every JSX module imports it). Serve a
|
|
41
|
+
// self-contained shim built on React.createElement so it never depends on the
|
|
42
|
+
// internals of react's dev jsx-runtime file. (App-code imports are already routed
|
|
43
|
+
// here by the resolve alias in configuration/react.ts; this covers vendored
|
|
44
|
+
// importers served through `/ns/m`.)
|
|
45
|
+
const REACT_JSX_RUNTIME_RE = /(^|[\\/])react[\\/]jsx-(?:dev-)?runtime(?:[\\/.]|$)/;
|
|
46
|
+
const REACT_JSX_RUNTIME_SHIM = [
|
|
47
|
+
`import { createElement, Fragment as __NS_Fragment } from 'react';`,
|
|
48
|
+
`export const Fragment = __NS_Fragment;`,
|
|
49
|
+
`function __ns_jsx(type, config, maybeKey) {`,
|
|
50
|
+
` if (maybeKey !== undefined) return createElement(type, Object.assign({}, config || {}, { key: maybeKey }));`,
|
|
51
|
+
` return createElement(type, config);`,
|
|
52
|
+
`}`,
|
|
53
|
+
`export function jsx(type, config, maybeKey) { return __ns_jsx(type, config, maybeKey); }`,
|
|
54
|
+
`export function jsxs(type, config, maybeKey) { return __ns_jsx(type, config, maybeKey); }`,
|
|
55
|
+
`export function jsxDEV(type, config, maybeKey) { return __ns_jsx(type, config, maybeKey); }`,
|
|
56
|
+
].join('\n');
|
|
57
|
+
// Lex `exports.NAME = …` / `Object.defineProperty(exports, "NAME", …)` from a CJS
|
|
58
|
+
// development file (the prod/dev targets are plain CJS, statically lexable).
|
|
59
|
+
function lexCjsExportNames(filePath) {
|
|
60
|
+
let src = '';
|
|
61
|
+
try {
|
|
62
|
+
src = readFileSync(filePath, 'utf8');
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
const names = new Set();
|
|
68
|
+
for (const m of src.matchAll(/\bexports\.([A-Za-z_$][\w$]*)\s*=/g))
|
|
69
|
+
names.add(m[1]);
|
|
70
|
+
for (const m of src.matchAll(/Object\.defineProperty\(\s*exports\s*,\s*['"]([A-Za-z_$][\w$]*)['"]/g))
|
|
71
|
+
names.add(m[1]);
|
|
72
|
+
names.delete('default');
|
|
73
|
+
names.delete('__esModule');
|
|
74
|
+
return Array.from(names);
|
|
75
|
+
}
|
|
76
|
+
// Resolve a wrapper module's development-target relative require (`devRel`) to an
|
|
77
|
+
// absolute fs path. `moduleId` is the wrapper's id (an fs path, or a
|
|
78
|
+
// `…/node_modules/<pkg>/<sub>` url/id). We find the wrapper's fs path — directly if
|
|
79
|
+
// it's already absolute, otherwise by resolving its public package subpath spec —
|
|
80
|
+
// then join `devRel` against the wrapper's directory (the dev file is internal, so
|
|
81
|
+
// it can't be import-resolved directly under an `exports` map).
|
|
82
|
+
function resolveDevTargetPath(moduleId, devRel) {
|
|
83
|
+
const clean = (moduleId || '').replace(/[?#].*$/, '');
|
|
84
|
+
if (!clean)
|
|
85
|
+
return null;
|
|
86
|
+
let wrapperPath = null;
|
|
87
|
+
if (path.isAbsolute(clean) && existsSync(clean)) {
|
|
88
|
+
wrapperPath = clean;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const nm = clean.match(/node_modules[\\/]((?:@[^\\/]+[\\/])?[^\\/]+[\\/].*)$/);
|
|
92
|
+
if (nm) {
|
|
93
|
+
const subpath = nm[1].split(path.sep).join('/');
|
|
94
|
+
for (const spec of [subpath.replace(/\.(?:js|mjs|cjs)$/, ''), subpath]) {
|
|
95
|
+
try {
|
|
96
|
+
wrapperPath = projectRequire.resolve(spec);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
catch { }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!wrapperPath)
|
|
104
|
+
return null;
|
|
105
|
+
const devPath = path.resolve(path.dirname(wrapperPath), devRel);
|
|
106
|
+
return existsSync(devPath) ? devPath : null;
|
|
107
|
+
}
|
|
108
|
+
// If `code` is a prod/dev conditional re-export wrapper, return an ESM module that
|
|
109
|
+
// re-exports the development target's explicit named exports (+ default). Returns
|
|
110
|
+
// null otherwise so non-matching modules pass through untouched. Detection is
|
|
111
|
+
// intentionally narrow (requires the `module.exports = require(...)` indirection
|
|
112
|
+
// AND both a `.production.js` and `.development.js` target) so it only fires on the
|
|
113
|
+
// React-ecosystem prod/dev idiom.
|
|
114
|
+
function buildCondRequireReexport(code, moduleId) {
|
|
115
|
+
if (!/module\.exports\s*=\s*require\(/.test(code))
|
|
116
|
+
return null;
|
|
117
|
+
const devMatch = code.match(/require\(\s*['"]([^'"]+\.development\.js)['"]\s*\)/);
|
|
118
|
+
const hasProd = /require\(\s*['"][^'"]+\.production\.js['"]\s*\)/.test(code);
|
|
119
|
+
if (!devMatch || !hasProd)
|
|
120
|
+
return null;
|
|
121
|
+
const devRel = devMatch[1]; // e.g. '../cjs/use-sync-external-store-shim/with-selector.development.js'
|
|
122
|
+
// Resolve the dev target to an fs path so we can lex its export names. The dev
|
|
123
|
+
// file is an INTERNAL package file — usually exports-gated, so it can't be
|
|
124
|
+
// resolved as `pkg/cjs/…` directly. Instead resolve the (public) WRAPPER to its
|
|
125
|
+
// fs path and join the relative dev path against the wrapper's directory.
|
|
126
|
+
const devPath = resolveDevTargetPath(moduleId, devRel);
|
|
127
|
+
if (!devPath)
|
|
128
|
+
return null;
|
|
129
|
+
const names = lexCjsExportNames(devPath);
|
|
130
|
+
// Re-export by the ORIGINAL relative path so the device transform rewrites it to
|
|
131
|
+
// the dev target's `/ns/m` URL (served with real named exports). Explicit names
|
|
132
|
+
// only — `export *` is downgraded to a side-effect import by the device transform.
|
|
133
|
+
const target = JSON.stringify(devRel);
|
|
134
|
+
const lines = [];
|
|
135
|
+
if (names.length)
|
|
136
|
+
lines.push(`export { ${names.join(', ')} } from ${target};`);
|
|
137
|
+
lines.push(`export { default } from ${target};`);
|
|
138
|
+
return lines.join('\n');
|
|
139
|
+
}
|
|
140
|
+
export const reactServerStrategy = {
|
|
141
|
+
...typescriptServerStrategy,
|
|
142
|
+
flavor: 'react',
|
|
143
|
+
transformNodeModule(code, moduleId, _verbose) {
|
|
144
|
+
if (moduleId && REACT_JSX_RUNTIME_RE.test(moduleId)) {
|
|
145
|
+
return REACT_JSX_RUNTIME_SHIM;
|
|
146
|
+
}
|
|
147
|
+
return buildCondRequireReexport(code, moduleId || '') ?? code;
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../../../../../../packages/vite/hmr/frameworks/react/server/strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;A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mFAAmF;IACnF,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,KAAK,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,MAAM,GAAG,CAAC,CAAC;IAC/E,KAAK,CAAC,IAAI,CAAC,2BAA2B,MAAM,GAAG,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAA4B;IAC3D,GAAG,wBAAwB;IAC3B,MAAM,EAAE,OAAO;IACf,mBAAmB,CAAC,IAAY,EAAE,QAAgB,EAAE,QAAkB;QACrE,IAAI,QAAQ,IAAI,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrD,OAAO,sBAAsB,CAAC;QAC/B,CAAC;QACD,OAAO,wBAAwB,CAAC,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC;IAC/D,CAAC;CACD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find installed packages whose pre-bundle output would smuggle JSX into
|
|
3
|
+
* Vite's import-analysis stage. Returned names are safe to drop into
|
|
4
|
+
* `optimizeDeps.exclude` — the dev server will serve them through the
|
|
5
|
+
* normal module pipeline, where `vite-plugin-solid` can transform their
|
|
6
|
+
* original `.jsx`/`.tsx` files.
|
|
7
|
+
*
|
|
8
|
+
* The function is intentionally synchronous and best-effort: filesystem
|
|
9
|
+
* errors are swallowed, missing directories are skipped, and the scan
|
|
10
|
+
* caps at {@link MAX_SCAN_DEPTH} levels per package. Callers should
|
|
11
|
+
* treat the empty-array result as "no exclusions needed", not "scan
|
|
12
|
+
* failed". A nullable `monorepoRoot` is accepted so workspace hoisting
|
|
13
|
+
* is covered without forcing every caller to compute it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function findSolidPackagesShippingJsx(projectRoot: string, monorepoRoot?: string | null): string[];
|