@nativescript/vite 8.0.0-alpha.7 → 8.0.0-alpha.70

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.
Files changed (554) hide show
  1. package/README.md +51 -11
  2. package/bin/cli.cjs +8 -14
  3. package/configuration/angular.d.ts +34 -1
  4. package/configuration/angular.js +293 -172
  5. package/configuration/angular.js.map +1 -1
  6. package/configuration/base.js +177 -110
  7. package/configuration/base.js.map +1 -1
  8. package/configuration/javascript.js +14 -93
  9. package/configuration/javascript.js.map +1 -1
  10. package/configuration/react.js +41 -73
  11. package/configuration/react.js.map +1 -1
  12. package/configuration/solid.js +51 -6
  13. package/configuration/solid.js.map +1 -1
  14. package/configuration/typescript.js +12 -93
  15. package/configuration/typescript.js.map +1 -1
  16. package/helpers/app-components.d.ts +2 -1
  17. package/helpers/app-components.js.map +1 -1
  18. package/helpers/app-css-refresh.d.ts +31 -0
  19. package/helpers/app-css-refresh.js +43 -0
  20. package/helpers/app-css-refresh.js.map +1 -0
  21. package/helpers/app-css-state.d.ts +17 -0
  22. package/helpers/app-css-state.js +51 -0
  23. package/helpers/app-css-state.js.map +1 -0
  24. package/helpers/bundler-context.d.ts +11 -0
  25. package/helpers/bundler-context.js +71 -0
  26. package/helpers/bundler-context.js.map +1 -0
  27. package/helpers/cli-flags.d.ts +12 -0
  28. package/helpers/cli-flags.js +34 -0
  29. package/helpers/cli-flags.js.map +1 -1
  30. package/helpers/css-platform-plugin.d.ts +14 -0
  31. package/helpers/css-platform-plugin.js +43 -25
  32. package/helpers/css-platform-plugin.js.map +1 -1
  33. package/helpers/dev-host.d.ts +360 -0
  34. package/helpers/dev-host.js +694 -0
  35. package/helpers/dev-host.js.map +1 -0
  36. package/helpers/dynamic-import-plugin.js +9 -4
  37. package/helpers/dynamic-import-plugin.js.map +1 -1
  38. package/helpers/esbuild-platform-resolver.js +4 -1
  39. package/helpers/esbuild-platform-resolver.js.map +1 -1
  40. package/helpers/external-configs.d.ts +10 -12
  41. package/helpers/external-configs.js +58 -35
  42. package/helpers/external-configs.js.map +1 -1
  43. package/helpers/flavor.d.ts +13 -0
  44. package/helpers/flavor.js +17 -0
  45. package/helpers/flavor.js.map +1 -1
  46. package/helpers/global-defines.d.ts +101 -33
  47. package/helpers/global-defines.js +187 -64
  48. package/helpers/global-defines.js.map +1 -1
  49. package/helpers/hmr-scope.d.ts +26 -0
  50. package/helpers/hmr-scope.js +67 -0
  51. package/helpers/hmr-scope.js.map +1 -0
  52. package/helpers/init.js +0 -18
  53. package/helpers/init.js.map +1 -1
  54. package/helpers/logging.js +29 -1
  55. package/helpers/logging.js.map +1 -1
  56. package/helpers/main-entry.d.ts +4 -1
  57. package/helpers/main-entry.js +366 -47
  58. package/helpers/main-entry.js.map +1 -1
  59. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  60. package/helpers/nativeclass-esbuild-plugin.js +6 -1
  61. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  62. package/helpers/nativeclass-transform.d.ts +13 -0
  63. package/helpers/nativeclass-transform.js +37 -7
  64. package/helpers/nativeclass-transform.js.map +1 -1
  65. package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
  66. package/helpers/nativeclass-transformer-plugin.js +163 -15
  67. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  68. package/helpers/nativescript-package-resolver.js +10 -62
  69. package/helpers/nativescript-package-resolver.js.map +1 -1
  70. package/helpers/normalize-id.d.ts +42 -0
  71. package/helpers/normalize-id.js +60 -0
  72. package/helpers/normalize-id.js.map +1 -0
  73. package/helpers/ns-core-external-urls.d.ts +32 -0
  74. package/helpers/ns-core-external-urls.js +107 -0
  75. package/helpers/ns-core-external-urls.js.map +1 -0
  76. package/helpers/ns-core-url.d.ts +26 -3
  77. package/helpers/ns-core-url.js +66 -8
  78. package/helpers/ns-core-url.js.map +1 -1
  79. package/helpers/optimize-deps.d.ts +16 -0
  80. package/helpers/optimize-deps.js +17 -0
  81. package/helpers/optimize-deps.js.map +1 -0
  82. package/helpers/package-platform-aliases.js +34 -49
  83. package/helpers/package-platform-aliases.js.map +1 -1
  84. package/helpers/platform-types.d.ts +2 -0
  85. package/helpers/platform-types.js +2 -0
  86. package/helpers/platform-types.js.map +1 -0
  87. package/helpers/postcss-platform-config.d.ts +17 -1
  88. package/helpers/postcss-platform-config.js +20 -37
  89. package/helpers/postcss-platform-config.js.map +1 -1
  90. package/helpers/project.d.ts +35 -0
  91. package/helpers/project.js +120 -2
  92. package/helpers/project.js.map +1 -1
  93. package/helpers/resolve-main-field-platform.d.ts +20 -0
  94. package/helpers/resolve-main-field-platform.js +49 -0
  95. package/helpers/resolve-main-field-platform.js.map +1 -0
  96. package/helpers/resolver.js +17 -2
  97. package/helpers/resolver.js.map +1 -1
  98. package/helpers/theme-core-plugins.js +1 -1
  99. package/helpers/theme-core-plugins.js.map +1 -1
  100. package/helpers/ts-config-paths.d.ts +32 -0
  101. package/helpers/ts-config-paths.js +156 -27
  102. package/helpers/ts-config-paths.js.map +1 -1
  103. package/helpers/typescript-check.d.ts +2 -1
  104. package/helpers/typescript-check.js +4 -4
  105. package/helpers/typescript-check.js.map +1 -1
  106. package/helpers/ui-registration.d.ts +21 -0
  107. package/helpers/ui-registration.js +156 -0
  108. package/helpers/ui-registration.js.map +1 -0
  109. package/helpers/utils.d.ts +9 -0
  110. package/helpers/utils.js +22 -2
  111. package/helpers/utils.js.map +1 -1
  112. package/helpers/vite-package-version.d.ts +7 -0
  113. package/helpers/vite-package-version.js +44 -0
  114. package/helpers/vite-package-version.js.map +1 -0
  115. package/helpers/workers.d.ts +40 -19
  116. package/helpers/workers.js +324 -13
  117. package/helpers/workers.js.map +1 -1
  118. package/hmr/client/css-handler.d.ts +2 -1
  119. package/hmr/client/css-handler.js +63 -32
  120. package/hmr/client/css-handler.js.map +1 -1
  121. package/hmr/client/css-update-overlay.d.ts +18 -0
  122. package/hmr/client/css-update-overlay.js +27 -0
  123. package/hmr/client/css-update-overlay.js.map +1 -0
  124. package/hmr/client/framework-client-strategy.d.ts +87 -0
  125. package/hmr/client/framework-client-strategy.js +18 -0
  126. package/hmr/client/framework-client-strategy.js.map +1 -0
  127. package/hmr/client/hmr-pending-overlay.d.ts +0 -14
  128. package/hmr/client/hmr-pending-overlay.js +2 -11
  129. package/hmr/client/hmr-pending-overlay.js.map +1 -1
  130. package/hmr/client/hot-context.d.ts +67 -0
  131. package/hmr/client/hot-context.js +307 -0
  132. package/hmr/client/hot-context.js.map +1 -0
  133. package/hmr/client/index.d.ts +9 -1
  134. package/hmr/client/index.js +70 -1970
  135. package/hmr/client/index.js.map +1 -1
  136. package/hmr/client/overlay-driver.d.ts +10 -0
  137. package/hmr/client/overlay-driver.js +33 -0
  138. package/hmr/client/overlay-driver.js.map +1 -0
  139. package/hmr/client/protocol-dispatch.d.ts +8 -0
  140. package/hmr/client/protocol-dispatch.js +308 -0
  141. package/hmr/client/protocol-dispatch.js.map +1 -0
  142. package/hmr/client/root-reset.d.ts +15 -0
  143. package/hmr/client/root-reset.js +358 -0
  144. package/hmr/client/root-reset.js.map +1 -0
  145. package/hmr/client/strategy-loader.d.ts +24 -0
  146. package/hmr/client/strategy-loader.js +83 -0
  147. package/hmr/client/strategy-loader.js.map +1 -0
  148. package/hmr/client/update-pipeline.d.ts +27 -0
  149. package/hmr/client/update-pipeline.js +464 -0
  150. package/hmr/client/update-pipeline.js.map +1 -0
  151. package/hmr/client/utils.d.ts +9 -1
  152. package/hmr/client/utils.js +117 -97
  153. package/hmr/client/utils.js.map +1 -1
  154. package/hmr/client/ws-transport.d.ts +21 -0
  155. package/hmr/client/ws-transport.js +323 -0
  156. package/hmr/client/ws-transport.js.map +1 -0
  157. package/hmr/entry-runtime.d.ts +2 -1
  158. package/hmr/entry-runtime.js +282 -71
  159. package/hmr/entry-runtime.js.map +1 -1
  160. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  161. package/hmr/frameworks/angular/build/angular-linker.js +113 -0
  162. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  163. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  164. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  165. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  166. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  167. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  168. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  169. package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
  170. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  171. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  172. package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
  173. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  174. package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
  175. package/hmr/frameworks/angular/build/linker-stats.js +29 -0
  176. package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
  177. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  178. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  179. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  180. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  181. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  182. package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
  183. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  184. package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
  185. package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
  186. package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
  187. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  188. package/hmr/frameworks/angular/build/util.js +155 -0
  189. package/hmr/frameworks/angular/build/util.js.map +1 -0
  190. package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
  191. package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
  192. package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
  193. package/hmr/frameworks/angular/client/index.d.ts +0 -1
  194. package/hmr/frameworks/angular/client/index.js +459 -223
  195. package/hmr/frameworks/angular/client/index.js.map +1 -1
  196. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  197. package/hmr/frameworks/angular/client/strategy.js +19 -0
  198. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  199. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  200. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  201. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  202. package/hmr/frameworks/angular/server/linker.js +1 -4
  203. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  204. package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
  205. package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
  206. package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
  207. package/hmr/frameworks/angular/server/strategy.js +677 -13
  208. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  209. package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
  210. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  211. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +28 -11
  212. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.js +191 -105
  213. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  214. package/hmr/frameworks/react/client/strategy.d.ts +12 -0
  215. package/hmr/frameworks/react/client/strategy.js +27 -0
  216. package/hmr/frameworks/react/client/strategy.js.map +1 -0
  217. package/hmr/frameworks/react/server/strategy.d.ts +2 -0
  218. package/hmr/frameworks/react/server/strategy.js +230 -0
  219. package/hmr/frameworks/react/server/strategy.js.map +1 -0
  220. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  221. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  222. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  223. package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
  224. package/hmr/frameworks/solid/client/app-runtime.js +252 -0
  225. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
  226. package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
  227. package/hmr/frameworks/solid/client/strategy.js +391 -0
  228. package/hmr/frameworks/solid/client/strategy.js.map +1 -0
  229. package/hmr/frameworks/solid/server/strategy.js +293 -16
  230. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  231. package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
  232. package/hmr/frameworks/typescript/client/strategy.js +418 -0
  233. package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
  234. package/hmr/frameworks/typescript/server/strategy.js +40 -14
  235. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  236. package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
  237. package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
  238. package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
  239. package/hmr/frameworks/vue/client/index.d.ts +10 -1
  240. package/hmr/frameworks/vue/client/index.js +287 -562
  241. package/hmr/frameworks/vue/client/index.js.map +1 -1
  242. package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
  243. package/hmr/frameworks/vue/client/navigate-app.js +178 -0
  244. package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
  245. package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
  246. package/hmr/frameworks/vue/client/strategy.js +152 -0
  247. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  248. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
  249. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
  250. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  251. package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
  252. package/hmr/frameworks/vue/server/compiler.js +3 -1
  253. package/hmr/frameworks/vue/server/compiler.js.map +1 -1
  254. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  255. package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
  256. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  257. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  258. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  259. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  260. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  261. package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
  262. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  263. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
  264. package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
  265. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  266. package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
  267. package/hmr/frameworks/vue/server/strategy.js +291 -7
  268. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  269. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  270. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  271. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  272. package/hmr/helpers/ast-normalizer.d.ts +3 -1
  273. package/hmr/helpers/ast-normalizer.js +109 -14
  274. package/hmr/helpers/ast-normalizer.js.map +1 -1
  275. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  276. package/hmr/helpers/cjs-named-exports.js +152 -0
  277. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  278. package/hmr/helpers/package-exports.d.ts +16 -0
  279. package/hmr/helpers/package-exports.js +396 -0
  280. package/hmr/helpers/package-exports.js.map +1 -0
  281. package/hmr/helpers/vendor-rewrite.d.ts +1 -1
  282. package/hmr/helpers/vendor-rewrite.js +5 -3
  283. package/hmr/helpers/vendor-rewrite.js.map +1 -1
  284. package/hmr/server/boot-recording.d.ts +51 -0
  285. package/hmr/server/boot-recording.js +214 -0
  286. package/hmr/server/boot-recording.js.map +1 -0
  287. package/hmr/server/constants.js +20 -5
  288. package/hmr/server/constants.js.map +1 -1
  289. package/hmr/server/content-css-update.d.ts +54 -0
  290. package/hmr/server/content-css-update.js +78 -0
  291. package/hmr/server/content-css-update.js.map +1 -0
  292. package/hmr/server/core-bundle.d.ts +140 -0
  293. package/hmr/server/core-bundle.js +614 -0
  294. package/hmr/server/core-bundle.js.map +1 -0
  295. package/hmr/server/core-sanitize.d.ts +86 -7
  296. package/hmr/server/core-sanitize.js +164 -39
  297. package/hmr/server/core-sanitize.js.map +1 -1
  298. package/hmr/server/css-connect-sync.d.ts +28 -0
  299. package/hmr/server/css-connect-sync.js +59 -0
  300. package/hmr/server/css-connect-sync.js.map +1 -0
  301. package/hmr/server/css-device-module.d.ts +28 -0
  302. package/hmr/server/css-device-module.js +44 -0
  303. package/hmr/server/css-device-module.js.map +1 -0
  304. package/hmr/server/css-update-message.d.ts +23 -0
  305. package/hmr/server/css-update-message.js +41 -0
  306. package/hmr/server/css-update-message.js.map +1 -0
  307. package/hmr/server/deps-bundle.d.ts +233 -0
  308. package/hmr/server/deps-bundle.js +1022 -0
  309. package/hmr/server/deps-bundle.js.map +1 -0
  310. package/hmr/server/device-transform-helpers.d.ts +24 -0
  311. package/hmr/server/device-transform-helpers.js +408 -0
  312. package/hmr/server/device-transform-helpers.js.map +1 -0
  313. package/hmr/server/framework-strategy.d.ts +182 -11
  314. package/hmr/server/hmr-module-graph.d.ts +37 -0
  315. package/hmr/server/hmr-module-graph.js +215 -0
  316. package/hmr/server/hmr-module-graph.js.map +1 -0
  317. package/hmr/server/import-map.d.ts +51 -19
  318. package/hmr/server/import-map.js +136 -66
  319. package/hmr/server/import-map.js.map +1 -1
  320. package/hmr/server/index.js +7 -16
  321. package/hmr/server/index.js.map +1 -1
  322. package/hmr/server/node-builtins-route.d.ts +12 -0
  323. package/hmr/server/node-builtins-route.js +86 -0
  324. package/hmr/server/node-builtins-route.js.map +1 -0
  325. package/hmr/server/ns-core-cjs-shape.js +1 -1
  326. package/hmr/server/ns-core-cjs-shape.js.map +1 -1
  327. package/hmr/server/ns-m-response-memo.d.ts +10 -0
  328. package/hmr/server/ns-m-response-memo.js +33 -0
  329. package/hmr/server/ns-m-response-memo.js.map +1 -0
  330. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  331. package/hmr/server/ns-rt-bridge.js +131 -0
  332. package/hmr/server/ns-rt-bridge.js.map +1 -0
  333. package/hmr/server/ns-rt-route.d.ts +5 -0
  334. package/hmr/server/ns-rt-route.js +39 -0
  335. package/hmr/server/ns-rt-route.js.map +1 -0
  336. package/hmr/server/perf-instrumentation.d.ts +1 -1
  337. package/hmr/server/perf-instrumentation.js +3 -1
  338. package/hmr/server/perf-instrumentation.js.map +1 -1
  339. package/hmr/server/process-code-for-device.d.ts +44 -0
  340. package/hmr/server/process-code-for-device.js +834 -0
  341. package/hmr/server/process-code-for-device.js.map +1 -0
  342. package/hmr/server/require-guard.d.ts +1 -0
  343. package/hmr/server/require-guard.js +12 -0
  344. package/hmr/server/require-guard.js.map +1 -0
  345. package/hmr/server/rewrite-imports.d.ts +2 -0
  346. package/hmr/server/rewrite-imports.js +631 -0
  347. package/hmr/server/rewrite-imports.js.map +1 -0
  348. package/hmr/server/route-helpers.d.ts +7 -0
  349. package/hmr/server/route-helpers.js +13 -0
  350. package/hmr/server/route-helpers.js.map +1 -0
  351. package/hmr/server/runtime-graph-filter.js +8 -1
  352. package/hmr/server/runtime-graph-filter.js.map +1 -1
  353. package/hmr/server/server-origin.d.ts +2 -0
  354. package/hmr/server/server-origin.js +88 -0
  355. package/hmr/server/server-origin.js.map +1 -0
  356. package/hmr/server/shared-transform-request.js +1 -2
  357. package/hmr/server/shared-transform-request.js.map +1 -1
  358. package/hmr/server/socket-utils.d.ts +10 -0
  359. package/hmr/server/socket-utils.js +14 -0
  360. package/hmr/server/socket-utils.js.map +1 -0
  361. package/hmr/server/transform-cache-invalidation.d.ts +37 -0
  362. package/hmr/server/transform-cache-invalidation.js +156 -0
  363. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  364. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  365. package/hmr/server/vendor-bare-module-shims.js +80 -0
  366. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  367. package/hmr/server/vite-plugin.d.ts +1 -0
  368. package/hmr/server/vite-plugin.js +227 -53
  369. package/hmr/server/vite-plugin.js.map +1 -1
  370. package/hmr/server/websocket-core-bridge.d.ts +51 -4
  371. package/hmr/server/websocket-core-bridge.js +62 -49
  372. package/hmr/server/websocket-core-bridge.js.map +1 -1
  373. package/hmr/server/websocket-device-transform.d.ts +3 -0
  374. package/hmr/server/websocket-device-transform.js +7 -0
  375. package/hmr/server/websocket-device-transform.js.map +1 -0
  376. package/hmr/server/websocket-hmr-pending.d.ts +2 -16
  377. package/hmr/server/websocket-hmr-pending.js +0 -22
  378. package/hmr/server/websocket-hmr-pending.js.map +1 -1
  379. package/hmr/server/websocket-hot-update.d.ts +80 -0
  380. package/hmr/server/websocket-hot-update.js +295 -0
  381. package/hmr/server/websocket-hot-update.js.map +1 -0
  382. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  383. package/hmr/server/websocket-import-map-route.js +51 -0
  384. package/hmr/server/websocket-import-map-route.js.map +1 -0
  385. package/hmr/server/websocket-module-bindings.d.ts +15 -0
  386. package/hmr/server/websocket-module-bindings.js +38 -5
  387. package/hmr/server/websocket-module-bindings.js.map +1 -1
  388. package/hmr/server/websocket-module-specifiers.d.ts +66 -7
  389. package/hmr/server/websocket-module-specifiers.js +219 -49
  390. package/hmr/server/websocket-module-specifiers.js.map +1 -1
  391. package/hmr/server/websocket-ns-core.d.ts +34 -0
  392. package/hmr/server/websocket-ns-core.js +414 -0
  393. package/hmr/server/websocket-ns-core.js.map +1 -0
  394. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  395. package/hmr/server/websocket-ns-entry.js +164 -0
  396. package/hmr/server/websocket-ns-entry.js.map +1 -0
  397. package/hmr/server/websocket-ns-m-paths.d.ts +19 -3
  398. package/hmr/server/websocket-ns-m-paths.js +98 -75
  399. package/hmr/server/websocket-ns-m-paths.js.map +1 -1
  400. package/hmr/server/websocket-ns-m-request.d.ts +13 -2
  401. package/hmr/server/websocket-ns-m-request.js +20 -11
  402. package/hmr/server/websocket-ns-m-request.js.map +1 -1
  403. package/hmr/server/websocket-ns-m.d.ts +52 -0
  404. package/hmr/server/websocket-ns-m.js +590 -0
  405. package/hmr/server/websocket-ns-m.js.map +1 -0
  406. package/hmr/server/websocket-served-module-helpers.d.ts +57 -4
  407. package/hmr/server/websocket-served-module-helpers.js +462 -141
  408. package/hmr/server/websocket-served-module-helpers.js.map +1 -1
  409. package/hmr/server/websocket-txn.js +6 -9
  410. package/hmr/server/websocket-txn.js.map +1 -1
  411. package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
  412. package/hmr/server/websocket-vendor-unifier.js +4 -9
  413. package/hmr/server/websocket-vendor-unifier.js.map +1 -1
  414. package/hmr/server/websocket.d.ts +7 -40
  415. package/hmr/server/websocket.js +653 -6734
  416. package/hmr/server/websocket.js.map +1 -1
  417. package/hmr/shared/ns-globals.d.ts +106 -0
  418. package/hmr/shared/ns-globals.js +29 -0
  419. package/hmr/shared/ns-globals.js.map +1 -0
  420. package/hmr/shared/protocol.d.ts +157 -0
  421. package/hmr/shared/protocol.js +28 -0
  422. package/hmr/shared/protocol.js.map +1 -0
  423. package/hmr/shared/runtime/boot-complete.d.ts +14 -0
  424. package/hmr/shared/runtime/boot-complete.js +32 -0
  425. package/hmr/shared/runtime/boot-complete.js.map +1 -0
  426. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  427. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  428. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  429. package/hmr/shared/runtime/boot-progress.d.ts +44 -0
  430. package/hmr/shared/runtime/boot-progress.js +134 -0
  431. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  432. package/hmr/shared/runtime/boot-timeline.d.ts +1 -1
  433. package/hmr/shared/runtime/boot-timeline.js +8 -19
  434. package/hmr/shared/runtime/boot-timeline.js.map +1 -1
  435. package/hmr/shared/runtime/browser-runtime-contract.d.ts +43 -24
  436. package/hmr/shared/runtime/browser-runtime-contract.js +21 -9
  437. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
  438. package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
  439. package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
  440. package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
  441. package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
  442. package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
  443. package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
  444. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  445. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  446. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  447. package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
  448. package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
  449. package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
  450. package/hmr/shared/runtime/dev-overlay.d.ts +23 -69
  451. package/hmr/shared/runtime/dev-overlay.js +67 -1023
  452. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  453. package/hmr/shared/runtime/global-scope.d.ts +18 -0
  454. package/hmr/shared/runtime/global-scope.js +21 -0
  455. package/hmr/shared/runtime/global-scope.js.map +1 -0
  456. package/hmr/shared/runtime/hooks.js +2 -1
  457. package/hmr/shared/runtime/hooks.js.map +1 -1
  458. package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
  459. package/hmr/shared/runtime/launch-bridge.js +98 -0
  460. package/hmr/shared/runtime/launch-bridge.js.map +1 -0
  461. package/hmr/shared/runtime/module-provenance.js +4 -6
  462. package/hmr/shared/runtime/module-provenance.js.map +1 -1
  463. package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
  464. package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
  465. package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
  466. package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
  467. package/hmr/shared/runtime/overlay-flag.js +34 -0
  468. package/hmr/shared/runtime/overlay-flag.js.map +1 -0
  469. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  470. package/hmr/shared/runtime/root-placeholder-view.js +311 -0
  471. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  472. package/hmr/shared/runtime/root-placeholder.js +401 -206
  473. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  474. package/hmr/shared/runtime/session-bootstrap.js +203 -58
  475. package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
  476. package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
  477. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  478. package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
  479. package/hmr/shared/runtime/vendor-resolve.js +45 -0
  480. package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
  481. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  482. package/hmr/shared/vendor/manifest-collect.js +909 -0
  483. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  484. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  485. package/hmr/shared/vendor/manifest-loader.js +5 -3
  486. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  487. package/hmr/shared/vendor/manifest.d.ts +12 -7
  488. package/hmr/shared/vendor/manifest.js +180 -826
  489. package/hmr/shared/vendor/manifest.js.map +1 -1
  490. package/hmr/shared/vendor/registry.d.ts +2 -0
  491. package/hmr/shared/vendor/registry.js +14 -0
  492. package/hmr/shared/vendor/registry.js.map +1 -1
  493. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  494. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  495. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  496. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
  497. package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
  498. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  499. package/index.d.ts +1 -0
  500. package/index.js +5 -0
  501. package/index.js.map +1 -1
  502. package/package.json +65 -13
  503. package/runtime/core-aliases-early.js +28 -57
  504. package/runtime/core-aliases-early.js.map +1 -1
  505. package/shims/react-jsx-runtime.d.ts +4 -0
  506. package/shims/react-jsx-runtime.js +61 -0
  507. package/shims/react-jsx-runtime.js.map +1 -0
  508. package/helpers/angular/angular-linker.d.ts +0 -13
  509. package/helpers/angular/angular-linker.js +0 -194
  510. package/helpers/angular/angular-linker.js.map +0 -1
  511. package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
  512. package/helpers/angular/shared-linker.d.ts +0 -11
  513. package/helpers/angular/shared-linker.js +0 -75
  514. package/helpers/angular/shared-linker.js.map +0 -1
  515. package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
  516. package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
  517. package/helpers/angular/util.js +0 -67
  518. package/helpers/angular/util.js.map +0 -1
  519. package/helpers/module-runner-patch.d.ts +0 -3
  520. package/helpers/module-runner-patch.js +0 -63
  521. package/helpers/module-runner-patch.js.map +0 -1
  522. package/helpers/prelink-angular.d.ts +0 -2
  523. package/helpers/prelink-angular.js +0 -117
  524. package/helpers/prelink-angular.js.map +0 -1
  525. package/hmr/server/websocket-angular-entry.js.map +0 -1
  526. package/hmr/server/websocket-angular-hot-update.js.map +0 -1
  527. package/hmr/server/websocket-ns-m-finalize.d.ts +0 -22
  528. package/hmr/server/websocket-ns-m-finalize.js +0 -88
  529. package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
  530. package/hmr/server/websocket-runtime-compat.d.ts +0 -19
  531. package/hmr/server/websocket-runtime-compat.js +0 -287
  532. package/hmr/server/websocket-runtime-compat.js.map +0 -1
  533. package/hmr/server/websocket-vue-sfc.d.ts +0 -27
  534. package/hmr/server/websocket-vue-sfc.js +0 -1114
  535. package/hmr/server/websocket-vue-sfc.js.map +0 -1
  536. package/hmr/shared/runtime/http-only-boot.d.ts +0 -2
  537. package/hmr/shared/runtime/http-only-boot.js +0 -171
  538. package/hmr/shared/runtime/http-only-boot.js.map +0 -1
  539. package/hmr/vendor-bootstrap.d.ts +0 -3
  540. package/hmr/vendor-bootstrap.js +0 -32
  541. package/hmr/vendor-bootstrap.js.map +0 -1
  542. package/shims/react-reconciler-constants.d.ts +0 -14
  543. package/shims/react-reconciler-constants.js +0 -21
  544. package/shims/react-reconciler-constants.js.map +0 -1
  545. package/shims/react-reconciler.d.ts +0 -8
  546. package/shims/react-reconciler.js +0 -15
  547. package/shims/react-reconciler.js.map +0 -1
  548. package/transformers/NativeClass/index.d.ts +0 -2
  549. package/transformers/NativeClass/index.js +0 -222
  550. package/transformers/NativeClass/index.js.map +0 -1
  551. /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
  552. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
  553. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
  554. /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
@@ -1,7 +1,13 @@
1
- const VERBOSE = !!globalThis.__NS_ENV_VERBOSE__;
1
+ import { getCore } from './utils.js';
2
+ import { getGlobalScope } from '../shared/runtime/global-scope.js';
3
+ const VERBOSE = !!getGlobalScope().__NS_ENV_VERBOSE__;
4
+ // Must match the tag used by the boot virtual `app.css` emitter in
5
+ // `helpers/main-entry.ts` and `entry-runtime.ts::APP_CSS_TAG` so HMR's
6
+ // remove/add pair replaces the boot-time selectors instead of stacking.
7
+ export const APP_CSS_TAG = 'app.css';
2
8
  function getPreferredCssApplier() {
3
9
  try {
4
- const applier = globalThis.__NS_HMR_APPLY_CSS__;
10
+ const applier = getGlobalScope().__NS_HMR_APPLY_CSS__;
5
11
  if (typeof applier === 'function') {
6
12
  return applier;
7
13
  }
@@ -9,50 +15,71 @@ function getPreferredCssApplier() {
9
15
  catch { }
10
16
  return null;
11
17
  }
12
- function getCore(name) {
13
- try {
14
- const g = globalThis;
15
- const reg = g.__nsVendorRegistry;
16
- if (reg && reg.has('@nativescript/core')) {
17
- const ns = reg.get('@nativescript/core');
18
- return ns?.[name] || (ns?.default ?? ns)?.[name];
19
- }
20
- const req = g.__nsVendorRequire || g.__nsRequire || g.require;
21
- if (typeof req === 'function') {
22
- const ns = req('@nativescript/core');
23
- return ns?.[name] || (ns?.default ?? ns)?.[name];
24
- }
18
+ function resolveTaggedCssApi() {
19
+ const add = getCore('addTaggedAdditionalCSS');
20
+ const remove = getCore('removeTaggedAdditionalCSS');
21
+ if (typeof add === 'function' && typeof remove === 'function') {
22
+ return { add, remove };
25
23
  }
26
- catch { }
27
- return globalThis[name];
24
+ return {};
28
25
  }
29
- // CSS helper: apply CSS and refresh the current page so new styles render
30
- export function applyCssText(cssText) {
26
+ // CSS helper: apply CSS and refresh the current page so new styles render.
27
+ //
28
+ // `tag` scopes the remove+add tagged pair. It defaults to {@link APP_CSS_TAG}
29
+ // (`'app.css'`) so a global stylesheet edit replaces the boot-time selectors.
30
+ // Component `styleUrls` edits pass the style file's own path as the tag so a
31
+ // component's rules replace independently — applying a component's CSS under
32
+ // the shared `app.css` tag would otherwise wipe the global stylesheet.
33
+ export function applyCssText(cssText, tag = APP_CSS_TAG) {
31
34
  if (typeof cssText !== 'string' || !cssText.length)
32
35
  return;
33
36
  try {
34
- const applyInHttpCoreRealm = getPreferredCssApplier();
35
- if (applyInHttpCoreRealm) {
36
- applyInHttpCoreRealm(cssText, true);
37
- if (VERBOSE)
38
- console.info('[ns-hmr] CSS applied through HTTP core realm');
39
- return;
37
+ // The HTTP-core-realm applier (entry-runtime's `__NS_HMR_APPLY_CSS__`)
38
+ // always replaces under the global `app.css` tag, so it is only correct
39
+ // for GLOBAL stylesheet updates — routing a component-tagged update
40
+ // through it would wipe the global stylesheet and install the
41
+ // component's rules in its place. Component tags take the tagged
42
+ // remove+add path below.
43
+ if (tag === APP_CSS_TAG) {
44
+ const applyInHttpCoreRealm = getPreferredCssApplier();
45
+ if (applyInHttpCoreRealm) {
46
+ applyInHttpCoreRealm(cssText, true);
47
+ if (VERBOSE)
48
+ console.info('[ns-hmr] CSS applied through HTTP core realm');
49
+ return;
50
+ }
40
51
  }
52
+ // Replace selectors via remove + add tagged pair so deleted
53
+ // rules disappear (the additive `Application.addCss` cannot
54
+ // undo previously installed selectors).
55
+ const taggedCss = resolveTaggedCssApi();
41
56
  const Application = getCore('Application');
42
- if (Application && Application.addCss) {
57
+ let appliedTagged = false;
58
+ if (taggedCss.add && taggedCss.remove) {
59
+ try {
60
+ taggedCss.remove(tag);
61
+ taggedCss.add(cssText, tag);
62
+ appliedTagged = true;
63
+ if (VERBOSE)
64
+ console.info(`[ns-hmr] CSS applied via tagged replace (tag=${tag})`);
65
+ }
66
+ catch (taggedError) {
67
+ console.warn('[ns-hmr] tagged CSS replace failed, falling back to addCss:', taggedError?.message || String(taggedError));
68
+ }
69
+ }
70
+ if (!appliedTagged && Application && Application.addCss) {
43
71
  Application.addCss(cssText);
44
72
  if (VERBOSE)
45
- console.info('[ns-hmr] CSS applied, refreshing view');
73
+ console.info('[ns-hmr] CSS applied via addCss (additive fallback)');
46
74
  }
47
- // Trigger a view refresh so the new styles are rendered.
48
- // NativeScript caches computed styles — addCss alone won't repaint.
75
+ // NS caches computed styles — re-trigger styling on the root
76
+ // (propagates to descendants via `eachDescendant`).
49
77
  try {
50
78
  const rootView = Application?.getRootView?.();
51
79
  if (rootView && typeof rootView._onCssStateChange === 'function') {
52
80
  rootView._onCssStateChange();
53
81
  }
54
82
  else if (rootView) {
55
- // Force a style recalculation by toggling the root's class
56
83
  const cls = rootView.className || '';
57
84
  rootView.className = cls + ' ';
58
85
  rootView.className = cls;
@@ -67,7 +94,7 @@ export function applyCssText(cssText) {
67
94
  // Fetch helper
68
95
  export async function fetchText(url) {
69
96
  try {
70
- const g = globalThis;
97
+ const g = getGlobalScope();
71
98
  if (typeof g.fetch === 'function') {
72
99
  const res = await g.fetch(url);
73
100
  return await res.text();
@@ -102,7 +129,11 @@ export async function handleCssUpdates(cssUpdates, httpOrigin) {
102
129
  console.info('[ns-hmr] Fetching CSS:', url);
103
130
  const cssText = await fetchText(url);
104
131
  if (cssText) {
105
- applyCssText(cssText);
132
+ // `tag` scopes the replace: app entry CSS (no tag) uses the
133
+ // default `app.css` tag; component `styleUrls` edits carry their
134
+ // own path so they replace independently of the global stylesheet.
135
+ const tag = typeof update.tag === 'string' && update.tag ? update.tag : undefined;
136
+ applyCssText(cssText, tag);
106
137
  }
107
138
  }
108
139
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"css-handler.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/css-handler.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,CAAC,CAAE,UAAkB,CAAC,kBAAkB,CAAC;AAEzD,SAAS,sBAAsB;IAC9B,IAAI,CAAC;QACJ,MAAM,OAAO,GAAI,UAAkB,CAAC,oBAAoB,CAAC;QACzD,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YACnC,OAAO,OAAO,CAAC;QAChB,CAAC;IACF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,OAAO,CAAC,IAAY;IAC5B,IAAI,CAAC;QACJ,MAAM,CAAC,G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,GAAG,cAAc,SAAS,EAAE,CAAC;YAEnE,IAAI,OAAO;gBAAE,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;YACzD,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,CAAC;YACrC,IAAI,OAAO,EAAE,CAAC;gBACb,4DAA4D;gBAC5D,iEAAiE;gBACjE,mEAAmE;gBACnE,MAAM,GAAG,GAAG,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;gBAClF,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;YAC5B,CAAC;QACF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,CAAC,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAClF,CAAC;IACF,CAAC;AACF,CAAC;AAED,2BAA2B;AAC3B,MAAM,UAAU,eAAe,CAAC,OAAe;IAC9C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnD,YAAY,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;AACF,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Detail strings for the HMR-applying overlay's CSS update frames.
3
+ *
4
+ * The overlay uses generic per-stage `phase` labels ("Re-importing
5
+ * entry", "Update applied"). These pure helpers produce the matching
6
+ * `detail` line so a CSS-only HMR cycle has a sensible progression
7
+ * from 'received' → 'reimporting' → 'complete' rather than getting
8
+ * stuck on the 'received' (5%) frame.
9
+ *
10
+ * Path-specific detail is intentionally omitted: the broadcast path
11
+ * for an out-of-scope `@import` edit is rewritten to `/src/app.css`
12
+ * (so Vite's PostCSS pipeline re-resolves the import chain), which
13
+ * doesn't match the file the user actually edited. The 'received'
14
+ * frame already surfaces the original edited path via the
15
+ * `ns:hmr-pending` payload, so the later frames don't need to.
16
+ */
17
+ export declare function buildCssApplyingDetail(count: number): string;
18
+ export declare function buildCssAppliedDetail(count: number): string;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Detail strings for the HMR-applying overlay's CSS update frames.
3
+ *
4
+ * The overlay uses generic per-stage `phase` labels ("Re-importing
5
+ * entry", "Update applied"). These pure helpers produce the matching
6
+ * `detail` line so a CSS-only HMR cycle has a sensible progression
7
+ * from 'received' → 'reimporting' → 'complete' rather than getting
8
+ * stuck on the 'received' (5%) frame.
9
+ *
10
+ * Path-specific detail is intentionally omitted: the broadcast path
11
+ * for an out-of-scope `@import` edit is rewritten to `/src/app.css`
12
+ * (so Vite's PostCSS pipeline re-resolves the import chain), which
13
+ * doesn't match the file the user actually edited. The 'received'
14
+ * frame already surfaces the original edited path via the
15
+ * `ns:hmr-pending` payload, so the later frames don't need to.
16
+ */
17
+ export function buildCssApplyingDetail(count) {
18
+ if (!Number.isFinite(count) || count <= 1)
19
+ return 'Applying CSS update';
20
+ return `Applying ${count} CSS updates`;
21
+ }
22
+ export function buildCssAppliedDetail(count) {
23
+ if (!Number.isFinite(count) || count <= 1)
24
+ return 'CSS update applied';
25
+ return `${count} CSS updates applied`;
26
+ }
27
+ //# sourceMappingURL=css-update-overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-update-overlay.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/css-update-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,UAAU,sBAAsB,CAAC,KAAa;IACnD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,qBAAqB,CAAC;IACxE,OAAO,YAAY,KAAK,cAAc,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAa;IAClD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,oBAAoB,CAAC;IACvE,OAAO,GAAG,KAAK,sBAAsB,CAAC;AACvC,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Client-side framework strategy contract (device HMR runtime).
3
+ *
4
+ * The server-side seam (`hmr/server/framework-strategy.ts`) has a mirror here:
5
+ * each framework that needs bespoke on-device HMR behavior implements this and
6
+ * is selected by `TARGET_FLAVOR` (Vue, Angular, Solid, TypeScript, React all
7
+ * ship one under `hmr/frameworks/<flavor>/client/`).
8
+ *
9
+ * All members are optional except `install`. A missing hook means "use the
10
+ * shared default".
11
+ *
12
+ * Keeping this file free of any framework import is deliberate: it lets the
13
+ * shared client depend only on the contract, so the concrete per-flavor module
14
+ * can later be loaded through a single dynamic `import()` (the device-bundle
15
+ * win) without the shared client statically pulling in every framework client.
16
+ */
17
+ export interface ClientGraphModule {
18
+ id: string;
19
+ deps: string[];
20
+ hash: string;
21
+ }
22
+ /** Shared state handed to {@link FrameworkClientStrategy.selectMountCandidate}. */
23
+ export interface FrameworkClientMountContext {
24
+ graph: Map<string, ClientGraphModule>;
25
+ appMainEntrySpec: string;
26
+ }
27
+ /** Shared helpers handed to {@link FrameworkClientStrategy.refreshAfterBatch}. */
28
+ export interface FrameworkClientBatchContext {
29
+ setUpdateOverlayStage: (stage: any, opts?: any) => void;
30
+ /** Wall-clock (ms) when the queue drain started, for "Updated … in Nms". */
31
+ startedAt: number;
32
+ /** Live client module graph (id → {id, deps, hash}) for reverse-import propagation. */
33
+ graph?: Map<string, ClientGraphModule>;
34
+ /** Swap the live root view to a freshly loaded component (resolves true on success). */
35
+ performResetRoot?: (component: any) => Promise<boolean> | any;
36
+ /** Resolves the live dev-overlay API (null/undefined when not installed). */
37
+ getOverlay?: () => any;
38
+ }
39
+ /** Shared helpers handed to the framework message hooks. */
40
+ export interface FrameworkClientMessageContext {
41
+ getCore: (name: string) => any;
42
+ verbose: boolean;
43
+ performResetRoot: (component: any) => any;
44
+ getOverlay: () => any;
45
+ }
46
+ export interface FrameworkClientStrategy {
47
+ readonly flavor: string;
48
+ /**
49
+ * When false, the in-place authoritative-frame `navigate()` fast path is
50
+ * skipped in favor of a full `resetRootView`. Vue requires this. Absent
51
+ * strategy/flag defaults to `true` (the legacy `flavor !== 'vue'` behavior).
52
+ */
53
+ readonly allowNavigateFastPath?: boolean;
54
+ /**
55
+ * When true, the shared queue drives the apply-progress overlay's
56
+ * 'evicting'/'reimporting' frames around its drain (Solid). Frameworks that
57
+ * drive the overlay from their own update path (Angular, Vue) leave this
58
+ * unset so the queue stays silent.
59
+ */
60
+ readonly drivesQueueOverlayStages?: boolean;
61
+ /** One-time client install (dev shims / HMR hooks). Runs at strategy resolve. */
62
+ install(): void;
63
+ /** Install the hardware-back wrapper once a resetRoot fn + core accessor exist. */
64
+ installBackWrapper?(performResetRoot: (comp: any) => void, getCore: (name: string) => any): void;
65
+ /** Pick the initial/rescue mount component id from the module graph (+ registry). */
66
+ selectMountCandidate?(ctx: FrameworkClientMountContext): string | null;
67
+ /** Load the component to mount for `candidate` (e.g. Vue SFC assembly). */
68
+ loadComponentForMount?(candidate: string): Promise<any>;
69
+ /** Build the NS root view for `newComponent` (framework-specific mount). */
70
+ createRoot?(newComponent: any, state: any): any;
71
+ /** Record changed-module metadata from a delta payload (framework bookkeeping). */
72
+ recordPayloadChanges?(changed: any[], graphVersion: number): void;
73
+ /**
74
+ * Post-process one freshly re-imported module during the queue drain
75
+ * (TypeScript/React: refresh the bundled module registry so Builder /
76
+ * `loadModule` resolves the NEW code-behind instead of the boot-bundle copy).
77
+ */
78
+ afterModuleReimport?(id: string, mod: any): void;
79
+ /** Framework UI refresh after a re-import batch drains. */
80
+ refreshAfterBatch?(drained: string[], ctx: FrameworkClientBatchContext): void | Promise<void>;
81
+ /** Handle a framework hot-update protocol message (resolves true if consumed). */
82
+ handleHotUpdateMessage?(msg: any, ctx: FrameworkClientMessageContext): Promise<boolean>;
83
+ /** Handle the framework SFC registry message. */
84
+ handleSfcRegistry?(msg: any): void;
85
+ /** Handle the framework SFC registry-update message (drives its own overlay). */
86
+ handleSfcRegistryUpdate?(msg: any, graphVersion: number, ctx: FrameworkClientMessageContext): Promise<void>;
87
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Client-side framework strategy contract (device HMR runtime).
3
+ *
4
+ * The server-side seam (`hmr/server/framework-strategy.ts`) has a mirror here:
5
+ * each framework that needs bespoke on-device HMR behavior implements this and
6
+ * is selected by `TARGET_FLAVOR` (Vue, Angular, Solid, TypeScript, React all
7
+ * ship one under `hmr/frameworks/<flavor>/client/`).
8
+ *
9
+ * All members are optional except `install`. A missing hook means "use the
10
+ * shared default".
11
+ *
12
+ * Keeping this file free of any framework import is deliberate: it lets the
13
+ * shared client depend only on the contract, so the concrete per-flavor module
14
+ * can later be loaded through a single dynamic `import()` (the device-bundle
15
+ * win) without the shared client statically pulling in every framework client.
16
+ */
17
+ export {};
18
+ //# sourceMappingURL=framework-client-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-client-strategy.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/framework-client-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
@@ -1,17 +1,3 @@
1
- /**
2
- * Client-side helper for `ns:hmr-pending`.
3
- *
4
- * Server emits `ns:hmr-pending` immediately when `handleHotUpdate`
5
- * fires, BEFORE doing any graph upserts / transforms / dependency
6
- * analysis. The client uses that hint to drive the HMR-applying
7
- * overlay's 'received' frame so the user sees an instant reaction
8
- * to their save instead of waiting ~7–200ms for the framework
9
- * payload (`ns:angular-update` / `ns:css-updates`) to arrive.
10
- *
11
- * This module is intentionally a tiny pure helper so the gating
12
- * (`__NS_HMR_PROGRESS_OVERLAY_ENABLED__`) and detail-string formatting
13
- * can be unit-tested without booting the full HMR client.
14
- */
15
1
  export type HmrOverlayApiLike = {
16
2
  setUpdateStage?: (stage: string, info?: {
17
3
  detail?: string;
@@ -12,23 +12,14 @@
12
12
  * (`__NS_HMR_PROGRESS_OVERLAY_ENABLED__`) and detail-string formatting
13
13
  * can be unit-tested without booting the full HMR client.
14
14
  */
15
+ import { resolveOverlayEnabled } from './overlay-driver.js';
15
16
  export function buildHmrPendingDetail(filePath) {
16
17
  if (!filePath || filePath === '<unknown>')
17
18
  return 'Preparing update';
18
19
  return `Updating ${filePath}`;
19
20
  }
20
21
  export function applyHmrPendingFrame(filePath, deps) {
21
- const enabled = typeof deps.overlayEnabled === 'boolean'
22
- ? deps.overlayEnabled
23
- : (() => {
24
- try {
25
- return typeof __NS_HMR_PROGRESS_OVERLAY_ENABLED__ === 'boolean' ? __NS_HMR_PROGRESS_OVERLAY_ENABLED__ : true;
26
- }
27
- catch {
28
- return true;
29
- }
30
- })();
31
- if (!enabled)
22
+ if (!resolveOverlayEnabled(deps.overlayEnabled))
32
23
  return false;
33
24
  let api;
34
25
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"hmr-pending-overlay.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/hmr-pending-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAkBH,MAAM,UAAU,qBAAqB,CAAC,QAA4B;IACjE,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,WAAW;QAAE,OAAO,kBAAkB,CAAC;IACrE,OAAO,YAAY,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAA4B,EAAE,IAA2B;IAC7F,MAAM,OAAO,GACZ,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS;QACvC,CAAC,CAAC,IAAI,CAAC,cAAc;QACrB,CAAC,CAAC,CAAC,GAAG,EAAE;YACN,IAAI,CAAC;gBACJ,OAAO,OAAO,mCAAmC,KAAK,SAAS,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC9G,CAAC;YAAC,MAAM,CAAC;gBACR,OAA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G,IAAI,OAAO,GAAG,CAAC,cAAc,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IACnE,IAAI,CAAC;QACJ,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * JS-owned `import.meta.hot` implementation (Vite-style injected hot contexts).
3
+ *
4
+ * `import.meta.hot` is HMR *policy* and lives entirely in this package — the
5
+ * native runtimes expose no hot API. The dev server injects
6
+ *
7
+ * import.meta.hot = globalThis.__NS_HOT_REGISTRY__?.createHotContext('<canonical-id>')
8
+ *
9
+ * at the top of every served app module (see `processCodeForDevice`), and this
10
+ * module owns every registry the hot API needs. The registry is installed on
11
+ * `globalThis.__NS_HOT_REGISTRY__` by `installNsHotRegistry()`, which the
12
+ * `/__ns_dev__/client` bootstrap runs before the entry graph evaluates.
13
+ *
14
+ * Process-wide singleton: state is stashed on globalThis so that a second
15
+ * copy of this module (e.g. loaded under a different URL) shares the same
16
+ * registries instead of splitting them.
17
+ *
18
+ * No circulars — don't import from other hmr/client/* modules here.
19
+ */
20
+ export interface NsHotEventPayload {
21
+ [key: string]: unknown;
22
+ }
23
+ type HotCallback = (...args: unknown[]) => unknown;
24
+ export interface NsHotRegistry {
25
+ createHotContext(ownerId: string): NsHotContext;
26
+ canonicalHotKey(id: string): string;
27
+ /** Drain `hot.dispose(cb)` callbacks (all modules, or a key subset). Returns count executed. */
28
+ runDispose(keys?: readonly string[]): number;
29
+ /** Drain `hot.prune(cb)` callbacks (all modules, or a key subset). Returns count executed. */
30
+ runPrune(keys?: readonly string[]): number;
31
+ /** True when any module (or any module in the key subset) called `hot.decline()`. */
32
+ hasDeclined(keys?: readonly string[]): boolean;
33
+ /** Fire `hot.on(event, cb)` listeners. Returns the number of listeners invoked. */
34
+ dispatchHotEvent(event: string, payload?: unknown): number;
35
+ listHotEventListeners(): Record<string, number>;
36
+ /** Wire `hot.send(...)` to the active WebSocket (installed by the full client). */
37
+ setSendToServer(fn: ((event: string, data?: unknown) => void) | null): void;
38
+ /** Override the full-reload behavior (`hot.invalidate()`, declined modules). */
39
+ setFullReloadHandler(fn: ((message?: string) => void) | null): void;
40
+ requestFullReload(message?: string): void;
41
+ }
42
+ export interface NsHotContext {
43
+ readonly data: Record<string, unknown>;
44
+ accept(...args: unknown[]): void;
45
+ acceptExports(exportNames: string[], cb?: HotCallback): void;
46
+ dispose(cb: HotCallback): void;
47
+ prune(cb: HotCallback): void;
48
+ decline(): void;
49
+ invalidate(message?: string): void;
50
+ on(event: string, cb: HotCallback): void;
51
+ off(event: string, cb: HotCallback): void;
52
+ send(event: string, data?: unknown): void;
53
+ }
54
+ declare global {
55
+ var __NS_HOT_REGISTRY__: NsHotRegistry | undefined;
56
+ var __NS_DEV_ENTRY_URL__: string | undefined;
57
+ }
58
+ /**
59
+ * Install (or return the already-installed) process-wide hot registry.
60
+ * Idempotent — safe to call from the bootstrap client, the full client and
61
+ * tests; the first installation wins.
62
+ */
63
+ export declare function installNsHotRegistry(): NsHotRegistry;
64
+ /** Read the installed registry (installing lazily so callers never race). */
65
+ export declare function getNsHotRegistry(): NsHotRegistry;
66
+ export declare function createHotContext(ownerId: string): NsHotContext;
67
+ export {};