@nativescript/vite 8.0.0-alpha.9 → 8.0.0-rc.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 +73 -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 +151 -103
- 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/helpers/app-components.d.ts +2 -1
- package/helpers/app-components.js.map +1 -1
- package/helpers/app-css-refresh.d.ts +31 -0
- package/helpers/app-css-refresh.js +43 -0
- package/helpers/app-css-refresh.js.map +1 -0
- package/helpers/app-css-state.d.ts +17 -0
- package/helpers/app-css-state.js +51 -0
- package/helpers/app-css-state.js.map +1 -0
- package/helpers/bundler-context.d.ts +11 -0
- package/helpers/bundler-context.js +71 -0
- package/helpers/bundler-context.js.map +1 -0
- package/helpers/cli-flags.d.ts +12 -0
- package/helpers/cli-flags.js +34 -0
- package/helpers/cli-flags.js.map +1 -1
- package/helpers/css-platform-plugin.d.ts +14 -0
- package/helpers/css-platform-plugin.js +43 -25
- package/helpers/css-platform-plugin.js.map +1 -1
- package/helpers/dev-host.d.ts +360 -0
- package/helpers/dev-host.js +694 -0
- package/helpers/dev-host.js.map +1 -0
- package/helpers/dynamic-import-plugin.d.ts +2 -1
- package/helpers/dynamic-import-plugin.js +59 -53
- package/helpers/dynamic-import-plugin.js.map +1 -1
- package/helpers/esbuild-platform-resolver.js +4 -1
- package/helpers/esbuild-platform-resolver.js.map +1 -1
- package/helpers/external-configs.d.ts +10 -12
- package/helpers/external-configs.js +58 -35
- package/helpers/external-configs.js.map +1 -1
- package/helpers/flavor.d.ts +13 -0
- package/helpers/flavor.js +18 -1
- package/helpers/flavor.js.map +1 -1
- package/helpers/global-defines.d.ts +99 -33
- package/helpers/global-defines.js +187 -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 +6 -20
- package/helpers/init.js.map +1 -1
- package/helpers/logging.js +29 -1
- package/helpers/logging.js.map +1 -1
- package/helpers/main-entry.d.ts +4 -1
- package/helpers/main-entry.js +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 +2 -1
- package/helpers/typescript-check.js +4 -4
- package/helpers/typescript-check.js.map +1 -1
- package/helpers/ui-registration.d.ts +21 -0
- package/helpers/ui-registration.js +156 -0
- package/helpers/ui-registration.js.map +1 -0
- package/helpers/utils.d.ts +9 -0
- package/helpers/utils.js +22 -2
- package/helpers/utils.js.map +1 -1
- package/helpers/vite-package-version.d.ts +7 -0
- package/helpers/vite-package-version.js +44 -0
- package/helpers/vite-package-version.js.map +1 -0
- package/helpers/workers.d.ts +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 +87 -0
- package/hmr/client/framework-client-strategy.js +18 -0
- package/hmr/client/framework-client-strategy.js.map +1 -0
- package/hmr/client/hmr-pending-overlay.d.ts +0 -14
- package/hmr/client/hmr-pending-overlay.js +2 -11
- package/hmr/client/hmr-pending-overlay.js.map +1 -1
- package/hmr/client/hot-context.d.ts +67 -0
- package/hmr/client/hot-context.js +307 -0
- package/hmr/client/hot-context.js.map +1 -0
- package/hmr/client/index.d.ts +9 -1
- package/hmr/client/index.js +70 -1970
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/overlay-driver.d.ts +10 -0
- package/hmr/client/overlay-driver.js +33 -0
- package/hmr/client/overlay-driver.js.map +1 -0
- package/hmr/client/protocol-dispatch.d.ts +8 -0
- package/hmr/client/protocol-dispatch.js +308 -0
- package/hmr/client/protocol-dispatch.js.map +1 -0
- package/hmr/client/root-reset.d.ts +15 -0
- package/hmr/client/root-reset.js +358 -0
- package/hmr/client/root-reset.js.map +1 -0
- package/hmr/client/strategy-loader.d.ts +24 -0
- package/hmr/client/strategy-loader.js +100 -0
- package/hmr/client/strategy-loader.js.map +1 -0
- package/hmr/client/update-pipeline.d.ts +27 -0
- package/hmr/client/update-pipeline.js +464 -0
- package/hmr/client/update-pipeline.js.map +1 -0
- package/hmr/client/utils.d.ts +9 -1
- package/hmr/client/utils.js +117 -97
- package/hmr/client/utils.js.map +1 -1
- package/hmr/client/ws-transport.d.ts +21 -0
- package/hmr/client/ws-transport.js +323 -0
- package/hmr/client/ws-transport.js.map +1 -0
- package/hmr/entry-runtime.d.ts +2 -1
- package/hmr/entry-runtime.js +279 -44
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
- package/hmr/frameworks/angular/build/angular-linker.js +113 -0
- package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
- package/{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 +44 -0
- package/hmr/server/process-code-for-device.js +834 -0
- package/hmr/server/process-code-for-device.js.map +1 -0
- package/hmr/server/require-guard.d.ts +1 -0
- package/hmr/server/require-guard.js +12 -0
- package/hmr/server/require-guard.js.map +1 -0
- package/hmr/server/rewrite-imports.d.ts +2 -0
- package/hmr/server/rewrite-imports.js +631 -0
- package/hmr/server/rewrite-imports.js.map +1 -0
- package/hmr/server/route-helpers.d.ts +7 -0
- package/hmr/server/route-helpers.js +13 -0
- package/hmr/server/route-helpers.js.map +1 -0
- package/hmr/server/runtime-graph-filter.js +8 -1
- package/hmr/server/runtime-graph-filter.js.map +1 -1
- package/hmr/server/server-origin.d.ts +2 -0
- package/hmr/server/server-origin.js +88 -0
- package/hmr/server/server-origin.js.map +1 -0
- package/hmr/server/shared-transform-request.js +1 -2
- package/hmr/server/shared-transform-request.js.map +1 -1
- package/hmr/server/socket-utils.d.ts +10 -0
- package/hmr/server/socket-utils.js +14 -0
- package/hmr/server/socket-utils.js.map +1 -0
- package/hmr/server/transform-cache-invalidation.d.ts +37 -0
- package/hmr/server/transform-cache-invalidation.js +156 -0
- package/hmr/server/transform-cache-invalidation.js.map +1 -0
- package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
- package/hmr/server/vendor-bare-module-shims.js +80 -0
- package/hmr/server/vendor-bare-module-shims.js.map +1 -0
- package/hmr/server/vite-plugin.d.ts +1 -0
- package/hmr/server/vite-plugin.js +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 +295 -0
- package/hmr/server/websocket-hot-update.js.map +1 -0
- package/hmr/server/websocket-import-map-route.d.ts +15 -0
- package/hmr/server/websocket-import-map-route.js +51 -0
- package/hmr/server/websocket-import-map-route.js.map +1 -0
- package/hmr/server/websocket-module-bindings.d.ts +15 -0
- package/hmr/server/websocket-module-bindings.js +36 -3
- package/hmr/server/websocket-module-bindings.js.map +1 -1
- package/hmr/server/websocket-module-specifiers.d.ts +0 -5
- package/hmr/server/websocket-module-specifiers.js +29 -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 +590 -0
- package/hmr/server/websocket-ns-m.js.map +1 -0
- package/hmr/server/websocket-served-module-helpers.d.ts +56 -3
- package/hmr/server/websocket-served-module-helpers.js +444 -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 +7 -40
- package/hmr/server/websocket.js +661 -6751
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/ns-globals.d.ts +107 -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 +63 -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
package/helpers/utils.d.ts
CHANGED
|
@@ -31,3 +31,12 @@ export declare function getProjectAppPath(): string;
|
|
|
31
31
|
export declare function getProjectAppRelativePath(subPath?: string): string;
|
|
32
32
|
export declare function getProjectAppAbsolutePath(subPath?: string): string;
|
|
33
33
|
export declare function getProjectAppVirtualPath(subPath?: string): string;
|
|
34
|
+
export declare const GLOBAL_APP_CSS_CANDIDATES: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the project's global stylesheet, preferring `app.css` and falling
|
|
37
|
+
* back to `styles.css`. Returns the absolute filesystem path of the first
|
|
38
|
+
* candidate that exists under the app directory, or `null` when none are
|
|
39
|
+
* present. All call sites share this single resolver so the entry generator,
|
|
40
|
+
* the virtual-module loader, and the HMR watcher always agree on the same file.
|
|
41
|
+
*/
|
|
42
|
+
export declare function resolveProjectGlobalCssPath(projectRoot?: string): string | null;
|
package/helpers/utils.js
CHANGED
|
@@ -7,7 +7,6 @@ const require = createRequire(import.meta.url);
|
|
|
7
7
|
// get the name from the package for the output
|
|
8
8
|
const packageJson = getPackageJson();
|
|
9
9
|
export function nsConfigToJson() {
|
|
10
|
-
let configObject;
|
|
11
10
|
const tsPath = getProjectFilePath('nativescript.config.ts');
|
|
12
11
|
const tsCode = fs.readFileSync(tsPath, 'utf-8');
|
|
13
12
|
// a) Transpile your TS config to CommonJS so we can require() it
|
|
@@ -20,7 +19,7 @@ export function nsConfigToJson() {
|
|
|
20
19
|
const module = { exports: {} };
|
|
21
20
|
const requireFunc = (id) => require(id);
|
|
22
21
|
new Function('exports', 'require', 'module', '__filename', '__dirname', cjsCode)(module.exports, requireFunc, module, tsPath, path.dirname(tsPath));
|
|
23
|
-
configObject = module.exports.default ?? module.exports;
|
|
22
|
+
const configObject = module.exports.default ?? module.exports;
|
|
24
23
|
// ensure the config has a name
|
|
25
24
|
configObject.name = packageJson.name;
|
|
26
25
|
// ensure the main entry is set to "bundle"
|
|
@@ -140,4 +139,25 @@ export function getProjectAppVirtualPath(subPath = '') {
|
|
|
140
139
|
const rel = getProjectAppRelativePath(subPath).replace(/^\/+/, '');
|
|
141
140
|
return `/${rel.replace(/\/+/g, '/')}`;
|
|
142
141
|
}
|
|
142
|
+
// Global stylesheet candidates under the app directory, in priority order.
|
|
143
|
+
// `app.css` is the NativeScript convention; `styles.css` is common in web
|
|
144
|
+
// projects that share a codebase with NativeScript (e.g. Vite / TanStack
|
|
145
|
+
// Start), so it is used as a fallback when `app.css` is absent.
|
|
146
|
+
export const GLOBAL_APP_CSS_CANDIDATES = ['app.css', 'styles.css'];
|
|
147
|
+
/**
|
|
148
|
+
* Resolve the project's global stylesheet, preferring `app.css` and falling
|
|
149
|
+
* back to `styles.css`. Returns the absolute filesystem path of the first
|
|
150
|
+
* candidate that exists under the app directory, or `null` when none are
|
|
151
|
+
* present. All call sites share this single resolver so the entry generator,
|
|
152
|
+
* the virtual-module loader, and the HMR watcher always agree on the same file.
|
|
153
|
+
*/
|
|
154
|
+
export function resolveProjectGlobalCssPath(projectRoot = getProjectRootPath()) {
|
|
155
|
+
for (const name of GLOBAL_APP_CSS_CANDIDATES) {
|
|
156
|
+
const abs = path.resolve(projectRoot, getProjectAppRelativePath(name));
|
|
157
|
+
if (fs.existsSync(abs)) {
|
|
158
|
+
return abs;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
143
163
|
//# sourceMappingURL=utils.js.map
|
package/helpers/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEtF,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,+CAA+C;AAC/C,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;AAErC,MAAM,UAAU,cAAc;IAC7B,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/utils.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,kBA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MG;AACH,MAAM,UAAU,2BAA2B,CAAC,cAAsB,kBAAkB,EAAE;IACrF,KAAK,MAAM,IAAI,IAAI,yBAAyB,EAAE,CAAC;QAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,OAAO,GAAG,CAAC;QACZ,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version of this @nativescript/vite package (not the app's dependency
|
|
3
|
+
* declaration) — used by the startup banner and disk-cache keys. Resolution
|
|
4
|
+
* prefers the package export map, then walks up from this module to the
|
|
5
|
+
* package root (the export map does not always expose package.json).
|
|
6
|
+
*/
|
|
7
|
+
export declare function getVitePackageVersion(): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
let cachedVersion = null;
|
|
5
|
+
/**
|
|
6
|
+
* Version of this @nativescript/vite package (not the app's dependency
|
|
7
|
+
* declaration) — used by the startup banner and disk-cache keys. Resolution
|
|
8
|
+
* prefers the package export map, then walks up from this module to the
|
|
9
|
+
* package root (the export map does not always expose package.json).
|
|
10
|
+
*/
|
|
11
|
+
export function getVitePackageVersion() {
|
|
12
|
+
if (cachedVersion)
|
|
13
|
+
return cachedVersion;
|
|
14
|
+
try {
|
|
15
|
+
const req = createRequire(import.meta.url);
|
|
16
|
+
const pkg = req('@nativescript/vite/package.json');
|
|
17
|
+
if (typeof pkg?.version === 'string') {
|
|
18
|
+
cachedVersion = pkg.version;
|
|
19
|
+
return cachedVersion;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch { }
|
|
23
|
+
try {
|
|
24
|
+
let dir = path.dirname(new URL(import.meta.url).pathname);
|
|
25
|
+
for (let i = 0; i < 6; i++) {
|
|
26
|
+
const candidate = path.join(dir, 'package.json');
|
|
27
|
+
if (existsSync(candidate)) {
|
|
28
|
+
const parsed = JSON.parse(readFileSync(candidate, 'utf-8'));
|
|
29
|
+
if (parsed?.name === '@nativescript/vite' && typeof parsed.version === 'string') {
|
|
30
|
+
cachedVersion = parsed.version;
|
|
31
|
+
return cachedVersion;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const parent = path.dirname(dir);
|
|
35
|
+
if (parent === dir)
|
|
36
|
+
break;
|
|
37
|
+
dir = parent;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch { }
|
|
41
|
+
cachedVersion = 'unknown';
|
|
42
|
+
return cachedVersion;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=vite-package-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-package-version.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/vite-package-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,IAAI,aAAa,GAAkB,IAAI,CAAC;AAExC;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACpC,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IACxC,IAAI,CAAC;QACJ,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC3C,MAAM,GAAG,GAAG,GAAG,CAAC,iCAAiC,CAAC,CAAC;QACnD,IAAI,OAAO,GAAG,EAAE,OAAO,KAAK,QAAQ,EAAE,CAAC;YACtC,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC;YAC5B,OAAO,aAAa,CAAC;QACtB,CAAC;IACF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,IAAI,CAAC;QACJ,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;QAC1D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YACjD,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;gBAC5D,IAAI,MAAM,EAAE,IAAI,KAAK,oBAAoB,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;oBACjF,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC;oBAC/B,OAAO,aAAa,CAAC;gBACtB,CAAC;YACF,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,MAAM,KAAK,GAAG;gBAAE,MAAM;YAC1B,GAAG,GAAG,MAAM,CAAC;QACd,CAAC;IACF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,aAAa,GAAG,SAAS,CAAC;IAC1B,OAAO,aAAa,CAAC;AACtB,CAAC"}
|
package/helpers/workers.d.ts
CHANGED
|
@@ -4,7 +4,40 @@ export interface WorkerPluginsOptions {
|
|
|
4
4
|
verbose?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export declare function nativescriptWorkerLoaderStubPlugin(): Plugin;
|
|
7
|
+
/**
|
|
8
|
+
* Rewrite every code-level `import.meta` usage in a worker module so the
|
|
9
|
+
* emitted classic script can compile.
|
|
10
|
+
*
|
|
11
|
+
* Workers are emitted as classic scripts (the NS worker bootstrap `require()`s
|
|
12
|
+
* them), where ANY code-level `import.meta` token is a compile-time
|
|
13
|
+
* SyntaxError — the runtime reports "Cannot compile script" the moment the
|
|
14
|
+
* worker starts, so the failure looks arbitrary per-worker. Beyond the
|
|
15
|
+
* `.url`/`.dirname` static substitutions, HMR helpers pulled into worker
|
|
16
|
+
* graphs (e.g. @nativescript/angular's hmr view-cache) read `import.meta.hot`
|
|
17
|
+
* / `import.meta["hot"]` / `import.meta["webpackHot"]` defensively behind
|
|
18
|
+
* try/catch — every remaining member access is rewritten to `(undefined)`;
|
|
19
|
+
* workers never have HMR.
|
|
20
|
+
*
|
|
21
|
+
* Bare `import.meta` tokens (no member access) are left alone on purpose:
|
|
22
|
+
* every observed occurrence lives inside string literals (e.g. acorn's parser
|
|
23
|
+
* error messages when a JS parser is bundled into a worker), where they are
|
|
24
|
+
* harmless and rewriting would corrupt library data.
|
|
25
|
+
*
|
|
26
|
+
* Returns `null` when the module contains no `import.meta` at all. None of
|
|
27
|
+
* the replacements add or remove lines, so existing line-level mappings stay
|
|
28
|
+
* valid — the explicit `map: null` also keeps Rolldown from flagging
|
|
29
|
+
* SOURCEMAP_BROKEN on every worker chunk.
|
|
30
|
+
*/
|
|
31
|
+
export declare function neutralizeWorkerImportMeta(code: string): {
|
|
32
|
+
code: string;
|
|
33
|
+
map: null;
|
|
34
|
+
} | null;
|
|
7
35
|
export declare function getWorkerPlugins(platformOrOpts: string | WorkerPluginsOptions): any[];
|
|
36
|
+
export interface WorkerHmrUrlPluginOptions {
|
|
37
|
+
verbose?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare function viteWorkerAssetPathToNsMUrl(assetPath: string, projectRoot: string, workspaceRoot: string | null): string | null;
|
|
40
|
+
export declare function workerHmrUrlPlugin(opts?: WorkerHmrUrlPluginOptions): Plugin;
|
|
8
41
|
export declare function workerUrlPlugin(): {
|
|
9
42
|
name: string;
|
|
10
43
|
generateBundle(options: any, bundle: any): void;
|
package/helpers/workers.js
CHANGED
|
@@ -3,6 +3,8 @@ import { nsConfigToJson, resolveNativeScriptPlatformFile } from './utils.js';
|
|
|
3
3
|
import { createTsConfigPathsResolver, getTsConfigData } from './ts-config-paths.js';
|
|
4
4
|
import { packagePlatformResolverPlugin } from './package-platform-aliases.js';
|
|
5
5
|
import { nativescriptPackageResolver } from './nativescript-package-resolver.js';
|
|
6
|
+
import { findMonorepoWorkspaceRoot, getProjectRootPath } from './project.js';
|
|
7
|
+
import { normalizeModuleId } from './normalize-id.js';
|
|
6
8
|
// Stub out webpack-style `nativescript-worker-loader!./worker.js` imports.
|
|
7
9
|
// Some packages (e.g. `nativescript-sqlite-commercial`) still ship a webpack 4
|
|
8
10
|
// branch like:
|
|
@@ -33,6 +35,43 @@ export function nativescriptWorkerLoaderStubPlugin() {
|
|
|
33
35
|
},
|
|
34
36
|
};
|
|
35
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Rewrite every code-level `import.meta` usage in a worker module so the
|
|
40
|
+
* emitted classic script can compile.
|
|
41
|
+
*
|
|
42
|
+
* Workers are emitted as classic scripts (the NS worker bootstrap `require()`s
|
|
43
|
+
* them), where ANY code-level `import.meta` token is a compile-time
|
|
44
|
+
* SyntaxError — the runtime reports "Cannot compile script" the moment the
|
|
45
|
+
* worker starts, so the failure looks arbitrary per-worker. Beyond the
|
|
46
|
+
* `.url`/`.dirname` static substitutions, HMR helpers pulled into worker
|
|
47
|
+
* graphs (e.g. @nativescript/angular's hmr view-cache) read `import.meta.hot`
|
|
48
|
+
* / `import.meta["hot"]` / `import.meta["webpackHot"]` defensively behind
|
|
49
|
+
* try/catch — every remaining member access is rewritten to `(undefined)`;
|
|
50
|
+
* workers never have HMR.
|
|
51
|
+
*
|
|
52
|
+
* Bare `import.meta` tokens (no member access) are left alone on purpose:
|
|
53
|
+
* every observed occurrence lives inside string literals (e.g. acorn's parser
|
|
54
|
+
* error messages when a JS parser is bundled into a worker), where they are
|
|
55
|
+
* harmless and rewriting would corrupt library data.
|
|
56
|
+
*
|
|
57
|
+
* Returns `null` when the module contains no `import.meta` at all. None of
|
|
58
|
+
* the replacements add or remove lines, so existing line-level mappings stay
|
|
59
|
+
* valid — the explicit `map: null` also keeps Rolldown from flagging
|
|
60
|
+
* SOURCEMAP_BROKEN on every worker chunk.
|
|
61
|
+
*/
|
|
62
|
+
export function neutralizeWorkerImportMeta(code) {
|
|
63
|
+
if (!code.includes('import.meta')) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
const rewritten = code
|
|
67
|
+
.replace(/import\.meta\.dirname/g, '""')
|
|
68
|
+
.replace(/import\.meta\.url/g, '"file:///app/"')
|
|
69
|
+
// import.meta["hot"], import.meta['webpackHot'], ...
|
|
70
|
+
.replace(/import\.meta\s*\[\s*(['"])[^'"\]]*\1\s*\]/g, '(undefined)')
|
|
71
|
+
// import.meta.hot, import.meta.env, ...
|
|
72
|
+
.replace(/import\.meta\.\w+/g, '(undefined)');
|
|
73
|
+
return { code: rewritten, map: null };
|
|
74
|
+
}
|
|
36
75
|
// Worker bundles run as separate Rolldown builds and do NOT inherit `config.plugins`
|
|
37
76
|
// at build time (see https://vite.dev/config/worker-options#worker-plugins). To match
|
|
38
77
|
// the main bundle's module resolution behavior, mirror the bare-specifier resolvers
|
|
@@ -87,7 +126,9 @@ export function getWorkerPlugins(platformOrOpts) {
|
|
|
87
126
|
// Use the existing NativeScript platform file resolver
|
|
88
127
|
const platformResolvedFile = resolveNativeScriptPlatformFile(testPath, platform);
|
|
89
128
|
if (platformResolvedFile) {
|
|
90
|
-
|
|
129
|
+
// Canonicalize so the worker bundle dedupes core the same way
|
|
130
|
+
// the main bundle does (forward slash + uppercase Windows drive).
|
|
131
|
+
return normalizeModuleId(platformResolvedFile);
|
|
91
132
|
}
|
|
92
133
|
}
|
|
93
134
|
return null;
|
|
@@ -99,15 +140,7 @@ export function getWorkerPlugins(platformOrOpts) {
|
|
|
99
140
|
{
|
|
100
141
|
name: 'worker-import-meta-handler',
|
|
101
142
|
transform(code, id) {
|
|
102
|
-
|
|
103
|
-
if (code.includes('import.meta.dirname')) {
|
|
104
|
-
code = code.replace(/import\.meta\.dirname/g, '""');
|
|
105
|
-
}
|
|
106
|
-
// Replace import.meta.url with a static value for workers
|
|
107
|
-
if (code.includes('import.meta.url')) {
|
|
108
|
-
code = code.replace(/import\.meta\.url/g, '"file:///app/"');
|
|
109
|
-
}
|
|
110
|
-
return code;
|
|
143
|
+
return neutralizeWorkerImportMeta(code);
|
|
111
144
|
},
|
|
112
145
|
},
|
|
113
146
|
];
|
|
@@ -122,6 +155,200 @@ export function getWorkerPlugins(platformOrOpts) {
|
|
|
122
155
|
plugins.push(nativescriptWorkerLoaderStubPlugin());
|
|
123
156
|
return plugins;
|
|
124
157
|
}
|
|
158
|
+
// In dev/HMR mode, Vite's `workerImportMetaUrlPlugin` rewrites
|
|
159
|
+
// `new Worker(new URL('./foo.worker', import.meta.url))` into
|
|
160
|
+
// `new Worker(new URL(/* @vite-ignore */"/src/.../foo.worker.ts?worker_file&type=classic", '' + import.meta.url))`.
|
|
161
|
+
// That output breaks under NativeScript for two independent reasons:
|
|
162
|
+
//
|
|
163
|
+
// 1. TypeError on `new URL(spec, '' + import.meta.url)`: the iOS V8
|
|
164
|
+
// runtime's `InitializeImportMetaObject` (Runtime.mm) blindly prefixes
|
|
165
|
+
// the module registry key with `file://`, so HTTP-served modules get
|
|
166
|
+
// `import.meta.url = "file://http://localhost:5173/ns/m/..."` — a
|
|
167
|
+
// malformed base URL. The worker creation site (unlike other served
|
|
168
|
+
// `new URL` sites) has no try/catch.
|
|
169
|
+
// 2. Even with a valid base, the URL points at Vite's `?worker_file`
|
|
170
|
+
// middleware, whose bundle's internal `/src/...` and `/@fs/...` imports
|
|
171
|
+
// bypass the `/ns/m/` pipeline — the worker crashes on its first
|
|
172
|
+
// transitive import.
|
|
173
|
+
//
|
|
174
|
+
// The rewrite uses `__NS_HTTP_ORIGIN__` (set by `hmr/entry-runtime.ts`) so
|
|
175
|
+
// non-localhost origins work. Production counterpart: `workerUrlPlugin()`.
|
|
176
|
+
// Matches Vite-emitted dev shape:
|
|
177
|
+
// new Worker(new URL(/* @vite-ignore */ "/src/.../foo.worker.ts?worker_file&type=classic", '' + import.meta.url))
|
|
178
|
+
// The `/* @vite-ignore */` and `'' +` coercion are constants Vite always emits
|
|
179
|
+
// (see `workerImportMetaUrlPlugin` in vite/dist/node/chunks/node.js), so we
|
|
180
|
+
// match them as fixed structure rather than as optional fragments. The asset
|
|
181
|
+
// path can use single, double, or template-literal quotes.
|
|
182
|
+
const WORKER_VITE_DEV_RE = /new\s+Worker\s*\(\s*new\s+URL\s*\(\s*\/\*\s*@vite-ignore\s*\*\/\s*(['"`])([^'"`]+)\1\s*,\s*(?:'\s*'|"\s*"|`\s*`)\s*\+\s*import\.meta\.url\s*\)\s*(,\s*\{[^}]*\})?\s*\)/g;
|
|
183
|
+
const SKIP_TRANSFORM_ID_RE = /(?:^|\/)(?:node_modules|\.vite)\//;
|
|
184
|
+
// Strip Vite's `?worker_file&type=classic` query suffix (and any extension) so
|
|
185
|
+
// the resulting URL matches the canonical `/ns/m/<rel-without-ext>` shape that
|
|
186
|
+
// the NS HMR pipeline serves. Exported for unit testing.
|
|
187
|
+
export function viteWorkerAssetPathToNsMUrl(assetPath, projectRoot, workspaceRoot) {
|
|
188
|
+
if (typeof assetPath !== 'string' || !assetPath) {
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
// Vite emits asset paths in two shapes during dev/HMR:
|
|
192
|
+
// 1. Project-relative: "/src/.../foo.worker.ts?worker_file&type=classic"
|
|
193
|
+
// 2. Absolute fs: "/@fs/Users/.../src/.../foo.worker.ts?worker_file&type=classic"
|
|
194
|
+
// We only need to match #1 here — the project-relative form Vite uses for
|
|
195
|
+
// project-local files. Absolute-fs paths come from outside the project root
|
|
196
|
+
// (e.g. workspace libs in a monorepo), and we hand those off to Vite's
|
|
197
|
+
// default behavior rather than try to map them into `/ns/m/`.
|
|
198
|
+
const queryIdx = assetPath.indexOf('?');
|
|
199
|
+
const cleanPath = queryIdx === -1 ? assetPath : assetPath.slice(0, queryIdx);
|
|
200
|
+
const query = queryIdx === -1 ? '' : assetPath.slice(queryIdx);
|
|
201
|
+
// Confirm this is the worker_file query Vite emits — leaves non-worker URLs
|
|
202
|
+
// (e.g. asset URLs from `assetImportMetaUrlPlugin`) alone.
|
|
203
|
+
if (!/[?&]worker_file(?:&|=|$)/.test(query)) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
// Project-relative: "/src/..." → "/ns/m/src/..."
|
|
207
|
+
if (cleanPath.startsWith('/') && !cleanPath.startsWith('/@fs/')) {
|
|
208
|
+
// Strip the rewritable extension so the URL matches the canonical
|
|
209
|
+
// `/ns/m/<rel-without-ext>` shape served by the HMR middleware.
|
|
210
|
+
const noExt = cleanPath.replace(/\.(?:ts|tsx|mjs|cjs|js|jsx)$/, '');
|
|
211
|
+
return `/ns/m${noExt}`;
|
|
212
|
+
}
|
|
213
|
+
// Absolute-fs: "/@fs/abs/path/..." — try to map into project or workspace roots.
|
|
214
|
+
if (cleanPath.startsWith('/@fs/')) {
|
|
215
|
+
const absPath = cleanPath.slice('/@fs'.length); // keep leading '/'
|
|
216
|
+
const toPosix = (value) => value.replace(/\\/g, '/');
|
|
217
|
+
const stripTrailing = (value) => value.replace(/\/+$/, '');
|
|
218
|
+
const target = toPosix(absPath);
|
|
219
|
+
const projectPosix = stripTrailing(toPosix(path.resolve(projectRoot)));
|
|
220
|
+
const workspacePosix = workspaceRoot ? stripTrailing(toPosix(path.resolve(workspaceRoot))) : null;
|
|
221
|
+
const tryRoot = (root) => {
|
|
222
|
+
if (!root)
|
|
223
|
+
return null;
|
|
224
|
+
if (target === root)
|
|
225
|
+
return '/ns/m';
|
|
226
|
+
if (target.startsWith(`${root}/`)) {
|
|
227
|
+
const rel = target.slice(root.length); // includes leading '/'
|
|
228
|
+
const noExt = rel.replace(/\.(?:ts|tsx|mjs|cjs|js|jsx)$/, '');
|
|
229
|
+
return `/ns/m${noExt}`;
|
|
230
|
+
}
|
|
231
|
+
return null;
|
|
232
|
+
};
|
|
233
|
+
return tryRoot(projectPosix) ?? tryRoot(workspacePosix);
|
|
234
|
+
}
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
// Runtime helper injected (only) into HMR-transformed modules that
|
|
238
|
+
// instantiate a Worker. Wraps each `new Worker(...)` in
|
|
239
|
+
// `__nsHmrTrackWorker(...)`, registering a per-module
|
|
240
|
+
// `import.meta.hot.dispose(cb)` (Vite spec): when the module is replaced,
|
|
241
|
+
// the disposer terminates exactly the workers this module spawned.
|
|
242
|
+
//
|
|
243
|
+
// Session-wide cleanup for spawns that re-run WITHOUT their module being
|
|
244
|
+
// replaced (e.g. an Angular reboot re-running `AppComponent`'s constructor)
|
|
245
|
+
// is NOT this helper's job: the dev session's global `Worker` constructor
|
|
246
|
+
// interception (`hmr/shared/runtime/worker-tracking.ts`) records every
|
|
247
|
+
// construction — including these wrapped ones — in
|
|
248
|
+
// `globalThis.__NS_HMR_WORKERS__`, and the HMR client sweeps that set
|
|
249
|
+
// before framework reboots.
|
|
250
|
+
//
|
|
251
|
+
// `terminate()` is the only cleanup primitive (guarded by try/catch so an
|
|
252
|
+
// already-dead worker can't break the HMR cycle); both paths are idempotent.
|
|
253
|
+
// A `terminated` event listener would be cleaner than a Set of references,
|
|
254
|
+
// but iOS Worker doesn't fire that event reliably.
|
|
255
|
+
const HMR_WORKER_DISPOSE_HELPER = [
|
|
256
|
+
'/* Injected by @nativescript/vite workerHmrUrlPlugin (HMR worker auto-dispose) */',
|
|
257
|
+
'const __nsHmrTrackWorker = /* @__PURE__ */ (function () {',
|
|
258
|
+
// Per-module Set so `import.meta.hot.dispose` only terminates workers
|
|
259
|
+
// SPAWNED BY THIS MODULE (Vite spec semantics).
|
|
260
|
+
'\tconst __nsModuleWorkers = new Set();',
|
|
261
|
+
'\tlet __nsDisposeRegistered = false;',
|
|
262
|
+
'\treturn function __nsHmrTrackWorker(w) {',
|
|
263
|
+
'\t\tif (!w) return w;',
|
|
264
|
+
// Dispose callbacks are consumed when they fire (drained per HMR cycle),
|
|
265
|
+
// so the disposer re-arms itself by resetting `__nsDisposeRegistered` —
|
|
266
|
+
// exactly one registration per cycle, not per spawn.
|
|
267
|
+
'\t\t__nsModuleWorkers.add(w);',
|
|
268
|
+
'\t\tif (!__nsDisposeRegistered && typeof import.meta !== "undefined" && import.meta && import.meta.hot && typeof import.meta.hot.dispose === "function") {',
|
|
269
|
+
'\t\t\t__nsDisposeRegistered = true;',
|
|
270
|
+
'\t\t\timport.meta.hot.dispose(function () {',
|
|
271
|
+
'\t\t\t\tfor (const __nsW of __nsModuleWorkers) {',
|
|
272
|
+
'\t\t\t\t\ttry { typeof __nsW.terminate === "function" && __nsW.terminate(); } catch (_e) {}',
|
|
273
|
+
'\t\t\t\t}',
|
|
274
|
+
'\t\t\t\t__nsModuleWorkers.clear();',
|
|
275
|
+
'\t\t\t\t__nsDisposeRegistered = false;',
|
|
276
|
+
'\t\t\t});',
|
|
277
|
+
'\t\t}',
|
|
278
|
+
'\t\treturn w;',
|
|
279
|
+
'\t};',
|
|
280
|
+
'})();',
|
|
281
|
+
'',
|
|
282
|
+
].join('\n');
|
|
283
|
+
export function workerHmrUrlPlugin(opts) {
|
|
284
|
+
const { verbose } = opts || {};
|
|
285
|
+
let projectRoot = '';
|
|
286
|
+
let workspaceRoot = null;
|
|
287
|
+
return {
|
|
288
|
+
name: 'nativescript-worker-hmr-url-transform',
|
|
289
|
+
// Run AFTER Vite's built-in `workerImportMetaUrlPlugin` (and AFTER
|
|
290
|
+
// the Angular plugin, which discards upstream `code` by re-compiling
|
|
291
|
+
// from disk). At this point Vite has already rewritten the user's
|
|
292
|
+
// `new Worker(new URL('./foo', import.meta.url))` into its dev shape
|
|
293
|
+
// `new Worker(new URL(/* @vite-ignore */"/src/.../foo.worker.ts?worker_file&type=classic", '' + import.meta.url))`.
|
|
294
|
+
// We match that shape and replace it with a plain string URL that
|
|
295
|
+
// routes through `/ns/m/` so the worker's internal imports get the
|
|
296
|
+
// same HMR treatment as the main thread.
|
|
297
|
+
enforce: 'post',
|
|
298
|
+
// Dev/HMR only — `workerUrlPlugin()` below handles the production build.
|
|
299
|
+
apply: 'serve',
|
|
300
|
+
configResolved(config) {
|
|
301
|
+
projectRoot = path.resolve(config.root || getProjectRootPath());
|
|
302
|
+
workspaceRoot = findMonorepoWorkspaceRoot(projectRoot);
|
|
303
|
+
},
|
|
304
|
+
transform(code, id) {
|
|
305
|
+
if (!code || code.indexOf('new Worker') === -1 || code.indexOf('import.meta.url') === -1) {
|
|
306
|
+
return null;
|
|
307
|
+
}
|
|
308
|
+
// `id` may carry a Vite query suffix (`?vue&type=script`, `?used`, …);
|
|
309
|
+
// strip it so path matching works against real fs paths.
|
|
310
|
+
const cleanId = id.split('?', 1)[0];
|
|
311
|
+
if (!cleanId || SKIP_TRANSFORM_ID_RE.test(cleanId)) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
let modified = false;
|
|
315
|
+
let workerWraps = 0;
|
|
316
|
+
let newCode = code.replace(WORKER_VITE_DEV_RE, (match, _quote, assetPath, options) => {
|
|
317
|
+
const nsmUrl = viteWorkerAssetPathToNsMUrl(assetPath, projectRoot, workspaceRoot);
|
|
318
|
+
if (!nsmUrl) {
|
|
319
|
+
if (verbose) {
|
|
320
|
+
// eslint-disable-next-line no-console
|
|
321
|
+
console.warn(`[ns-worker-hmr] worker asset path ${JSON.stringify(assetPath)} in ${cleanId} can't be mapped to /ns/m/; leaving Vite's default behavior in place`);
|
|
322
|
+
}
|
|
323
|
+
return match;
|
|
324
|
+
}
|
|
325
|
+
modified = true;
|
|
326
|
+
workerWraps++;
|
|
327
|
+
const optionsTail = options ? options : '';
|
|
328
|
+
// `__nsHmrTrackWorker` registers the worker for HMR cleanup and
|
|
329
|
+
// returns the instance unchanged, so the wrap is transparent.
|
|
330
|
+
return `__nsHmrTrackWorker(new Worker((typeof globalThis !== "undefined" && typeof globalThis.__NS_HTTP_ORIGIN__ === "string" ? globalThis.__NS_HTTP_ORIGIN__ : "") + ${JSON.stringify(nsmUrl)}${optionsTail}))`;
|
|
331
|
+
});
|
|
332
|
+
if (!modified) {
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
// Inject the helper prelude exactly once at the top of the
|
|
336
|
+
// module. The helper closure self-tracks workers and lazily
|
|
337
|
+
// registers the `import.meta.hot.dispose()` callback on the
|
|
338
|
+
// first wrap, so injecting it unconditionally (whether or not
|
|
339
|
+
// HMR is wired up at module-eval time) is safe.
|
|
340
|
+
newCode = HMR_WORKER_DISPOSE_HELPER + newCode;
|
|
341
|
+
if (verbose) {
|
|
342
|
+
// eslint-disable-next-line no-console
|
|
343
|
+
console.log(`[ns-worker-hmr] rewrote ${workerWraps} Vite worker URL${workerWraps === 1 ? '' : 's'} → /ns/m/ in ${cleanId} (with per-module HMR auto-dispose)`);
|
|
344
|
+
}
|
|
345
|
+
// Returning null for the source map keeps Vite's downstream sourcemap
|
|
346
|
+
// composition simple; the per-Worker line shift is small and the
|
|
347
|
+
// frame is rarely the one a developer is debugging.
|
|
348
|
+
return { code: newCode, map: null };
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
}
|
|
125
352
|
export function workerUrlPlugin() {
|
|
126
353
|
return {
|
|
127
354
|
name: 'nativescript-worker-url-transform',
|
package/helpers/workers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workers.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/workers.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,6BAA6B,EAAE,MAAM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,OAAO,sBAAsB,QAAQ,IAAI,CAAC;wBAC3C,CAAC,CAAC,CAAC;oBACJ,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare const APP_CSS_TAG = "app.css";
|
|
2
|
+
export declare function applyCssText(cssText: string, tag?: string): void;
|
|
2
3
|
export declare function fetchText(url: string): Promise<string>;
|
|
3
4
|
export declare function handleCssUpdates(cssUpdates: any[], httpOrigin: string): Promise<void>;
|
|
4
5
|
export declare function handleCustomCss(cssText: string): void;
|