@nativescript/vite 8.0.0-beta.0 → 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.
Files changed (577) hide show
  1. package/README.md +73 -14
  2. package/bin/cli.cjs +8 -14
  3. package/configuration/angular.d.ts +35 -2
  4. package/configuration/angular.js +541 -216
  5. package/configuration/angular.js.map +1 -1
  6. package/configuration/base.js +227 -77
  7. package/configuration/base.js.map +1 -1
  8. package/configuration/javascript.js +17 -96
  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 +58 -6
  13. package/configuration/solid.js.map +1 -1
  14. package/configuration/typescript.js +15 -96
  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/commonjs-plugins.d.ts +5 -2
  31. package/helpers/commonjs-plugins.js +126 -0
  32. package/helpers/commonjs-plugins.js.map +1 -1
  33. package/helpers/config-as-json.js +10 -0
  34. package/helpers/config-as-json.js.map +1 -1
  35. package/helpers/css-platform-plugin.d.ts +14 -0
  36. package/helpers/css-platform-plugin.js +43 -25
  37. package/helpers/css-platform-plugin.js.map +1 -1
  38. package/helpers/dev-host.d.ts +360 -0
  39. package/helpers/dev-host.js +694 -0
  40. package/helpers/dev-host.js.map +1 -0
  41. package/helpers/dynamic-import-plugin.d.ts +2 -1
  42. package/helpers/dynamic-import-plugin.js +59 -53
  43. package/helpers/dynamic-import-plugin.js.map +1 -1
  44. package/helpers/esbuild-platform-resolver.js +9 -6
  45. package/helpers/esbuild-platform-resolver.js.map +1 -1
  46. package/helpers/external-configs.d.ts +10 -4
  47. package/helpers/external-configs.js +63 -15
  48. package/helpers/external-configs.js.map +1 -1
  49. package/helpers/flavor.d.ts +13 -0
  50. package/helpers/flavor.js +18 -1
  51. package/helpers/flavor.js.map +1 -1
  52. package/helpers/global-defines.d.ts +117 -0
  53. package/helpers/global-defines.js +209 -11
  54. package/helpers/global-defines.js.map +1 -1
  55. package/helpers/hmr-scope.d.ts +26 -0
  56. package/helpers/hmr-scope.js +67 -0
  57. package/helpers/hmr-scope.js.map +1 -0
  58. package/helpers/import-meta-path.d.ts +4 -0
  59. package/helpers/import-meta-path.js +5 -0
  60. package/helpers/import-meta-path.js.map +1 -0
  61. package/helpers/import-specifier.d.ts +1 -0
  62. package/helpers/import-specifier.js +18 -0
  63. package/helpers/import-specifier.js.map +1 -0
  64. package/helpers/init.js +6 -20
  65. package/helpers/init.js.map +1 -1
  66. package/helpers/logging.d.ts +1 -0
  67. package/helpers/logging.js +65 -4
  68. package/helpers/logging.js.map +1 -1
  69. package/helpers/main-entry.d.ts +8 -2
  70. package/helpers/main-entry.js +622 -120
  71. package/helpers/main-entry.js.map +1 -1
  72. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  73. package/helpers/nativeclass-esbuild-plugin.js +6 -1
  74. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  75. package/helpers/nativeclass-transform.d.ts +13 -0
  76. package/helpers/nativeclass-transform.js +42 -131
  77. package/helpers/nativeclass-transform.js.map +1 -1
  78. package/helpers/nativeclass-transformer-plugin.d.ts +19 -1
  79. package/helpers/nativeclass-transformer-plugin.js +324 -37
  80. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  81. package/helpers/nativescript-package-resolver.js +10 -62
  82. package/helpers/nativescript-package-resolver.js.map +1 -1
  83. package/helpers/normalize-id.d.ts +42 -0
  84. package/helpers/normalize-id.js +60 -0
  85. package/helpers/normalize-id.js.map +1 -0
  86. package/helpers/ns-core-external-urls.d.ts +32 -0
  87. package/helpers/ns-core-external-urls.js +107 -0
  88. package/helpers/ns-core-external-urls.js.map +1 -0
  89. package/helpers/ns-core-url.d.ts +106 -0
  90. package/helpers/ns-core-url.js +225 -0
  91. package/helpers/ns-core-url.js.map +1 -0
  92. package/helpers/optimize-deps.d.ts +16 -0
  93. package/helpers/optimize-deps.js +17 -0
  94. package/helpers/optimize-deps.js.map +1 -0
  95. package/helpers/package-platform-aliases.js +34 -49
  96. package/helpers/package-platform-aliases.js.map +1 -1
  97. package/helpers/platform-types.d.ts +2 -0
  98. package/helpers/platform-types.js +2 -0
  99. package/helpers/platform-types.js.map +1 -0
  100. package/helpers/postcss-platform-config.d.ts +17 -1
  101. package/helpers/postcss-platform-config.js +20 -37
  102. package/helpers/postcss-platform-config.js.map +1 -1
  103. package/helpers/project.d.ts +35 -0
  104. package/helpers/project.js +120 -2
  105. package/helpers/project.js.map +1 -1
  106. package/helpers/resolve-main-field-platform.d.ts +20 -0
  107. package/helpers/resolve-main-field-platform.js +49 -0
  108. package/helpers/resolve-main-field-platform.js.map +1 -0
  109. package/helpers/resolver.js +17 -2
  110. package/helpers/resolver.js.map +1 -1
  111. package/helpers/theme-core-plugins.js +1 -1
  112. package/helpers/theme-core-plugins.js.map +1 -1
  113. package/helpers/ts-config-paths.d.ts +32 -0
  114. package/helpers/ts-config-paths.js +156 -27
  115. package/helpers/ts-config-paths.js.map +1 -1
  116. package/helpers/typescript-check.d.ts +2 -1
  117. package/helpers/typescript-check.js +4 -4
  118. package/helpers/typescript-check.js.map +1 -1
  119. package/helpers/ui-registration.d.ts +21 -0
  120. package/helpers/ui-registration.js +156 -0
  121. package/helpers/ui-registration.js.map +1 -0
  122. package/helpers/utils.d.ts +9 -0
  123. package/helpers/utils.js +22 -2
  124. package/helpers/utils.js.map +1 -1
  125. package/helpers/vite-package-version.d.ts +7 -0
  126. package/helpers/vite-package-version.js +44 -0
  127. package/helpers/vite-package-version.js.map +1 -0
  128. package/helpers/workers.d.ts +40 -19
  129. package/helpers/workers.js +312 -13
  130. package/helpers/workers.js.map +1 -1
  131. package/hmr/client/css-handler.d.ts +2 -1
  132. package/hmr/client/css-handler.js +95 -23
  133. package/hmr/client/css-handler.js.map +1 -1
  134. package/hmr/client/css-update-overlay.d.ts +18 -0
  135. package/hmr/client/css-update-overlay.js +27 -0
  136. package/hmr/client/css-update-overlay.js.map +1 -0
  137. package/hmr/client/framework-client-strategy.d.ts +87 -0
  138. package/hmr/client/framework-client-strategy.js +18 -0
  139. package/hmr/client/framework-client-strategy.js.map +1 -0
  140. package/hmr/client/hmr-pending-overlay.d.ts +13 -0
  141. package/hmr/client/hmr-pending-overlay.js +41 -0
  142. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  143. package/hmr/client/hot-context.d.ts +67 -0
  144. package/hmr/client/hot-context.js +307 -0
  145. package/hmr/client/hot-context.js.map +1 -0
  146. package/hmr/client/index.d.ts +9 -1
  147. package/hmr/client/index.js +91 -1418
  148. package/hmr/client/index.js.map +1 -1
  149. package/hmr/client/overlay-driver.d.ts +10 -0
  150. package/hmr/client/overlay-driver.js +33 -0
  151. package/hmr/client/overlay-driver.js.map +1 -0
  152. package/hmr/client/protocol-dispatch.d.ts +8 -0
  153. package/hmr/client/protocol-dispatch.js +308 -0
  154. package/hmr/client/protocol-dispatch.js.map +1 -0
  155. package/hmr/client/root-reset.d.ts +15 -0
  156. package/hmr/client/root-reset.js +358 -0
  157. package/hmr/client/root-reset.js.map +1 -0
  158. package/hmr/client/strategy-loader.d.ts +24 -0
  159. package/hmr/client/strategy-loader.js +100 -0
  160. package/hmr/client/strategy-loader.js.map +1 -0
  161. package/hmr/client/update-pipeline.d.ts +27 -0
  162. package/hmr/client/update-pipeline.js +464 -0
  163. package/hmr/client/update-pipeline.js.map +1 -0
  164. package/hmr/client/utils.d.ts +14 -1
  165. package/hmr/client/utils.js +265 -54
  166. package/hmr/client/utils.js.map +1 -1
  167. package/hmr/client/ws-transport.d.ts +21 -0
  168. package/hmr/client/ws-transport.js +323 -0
  169. package/hmr/client/ws-transport.js.map +1 -0
  170. package/hmr/entry-runtime.d.ts +11 -0
  171. package/hmr/entry-runtime.js +566 -43
  172. package/hmr/entry-runtime.js.map +1 -1
  173. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  174. package/hmr/frameworks/angular/build/angular-linker.js +113 -0
  175. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  176. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  177. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  178. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  179. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  180. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  181. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  182. package/hmr/frameworks/angular/build/inline-decorator-component-templates.d.ts +3 -0
  183. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js +231 -0
  184. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  185. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  186. package/hmr/frameworks/angular/build/js-lexer.js +182 -0
  187. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  188. package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
  189. package/hmr/frameworks/angular/build/linker-stats.js +29 -0
  190. package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
  191. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  192. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  193. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  194. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.d.ts +1 -0
  195. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  196. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  197. package/hmr/frameworks/angular/build/synthesize-injectable-factories.d.ts +3 -0
  198. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js +241 -0
  199. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  200. package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
  201. package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
  202. package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
  203. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  204. package/hmr/frameworks/angular/build/util.js +155 -0
  205. package/hmr/frameworks/angular/build/util.js.map +1 -0
  206. package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
  207. package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
  208. package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
  209. package/hmr/frameworks/angular/client/index.d.ts +2 -1
  210. package/hmr/frameworks/angular/client/index.js +637 -23
  211. package/hmr/frameworks/angular/client/index.js.map +1 -1
  212. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  213. package/hmr/frameworks/angular/client/strategy.js +19 -0
  214. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  215. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  216. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  217. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  218. package/hmr/frameworks/angular/server/linker.js +37 -6
  219. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  220. package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
  221. package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
  222. package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
  223. package/hmr/frameworks/angular/server/strategy.js +697 -18
  224. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  225. package/hmr/frameworks/angular/server/websocket-angular-entry.d.ts +2 -0
  226. package/hmr/frameworks/angular/server/websocket-angular-entry.js +68 -0
  227. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  228. package/hmr/frameworks/angular/server/websocket-angular-hot-update.d.ts +94 -0
  229. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +485 -0
  230. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  231. package/hmr/frameworks/react/client/strategy.d.ts +12 -0
  232. package/hmr/frameworks/react/client/strategy.js +27 -0
  233. package/hmr/frameworks/react/client/strategy.js.map +1 -0
  234. package/hmr/frameworks/react/server/strategy.d.ts +2 -0
  235. package/hmr/frameworks/react/server/strategy.js +230 -0
  236. package/hmr/frameworks/react/server/strategy.js.map +1 -0
  237. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  238. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  239. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  240. package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
  241. package/hmr/frameworks/solid/client/app-runtime.js +252 -0
  242. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
  243. package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
  244. package/hmr/frameworks/solid/client/strategy.js +391 -0
  245. package/hmr/frameworks/solid/client/strategy.js.map +1 -0
  246. package/hmr/frameworks/solid/server/strategy.js +293 -16
  247. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  248. package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
  249. package/hmr/frameworks/typescript/client/strategy.js +418 -0
  250. package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
  251. package/hmr/frameworks/typescript/server/strategy.js +48 -16
  252. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  253. package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
  254. package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
  255. package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
  256. package/hmr/frameworks/vue/client/index.d.ts +10 -1
  257. package/hmr/frameworks/vue/client/index.js +287 -562
  258. package/hmr/frameworks/vue/client/index.js.map +1 -1
  259. package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
  260. package/hmr/frameworks/vue/client/navigate-app.js +178 -0
  261. package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
  262. package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
  263. package/hmr/frameworks/vue/client/strategy.js +152 -0
  264. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  265. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
  266. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
  267. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  268. package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
  269. package/hmr/frameworks/vue/server/compiler.js +3 -1
  270. package/hmr/frameworks/vue/server/compiler.js.map +1 -1
  271. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  272. package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
  273. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  274. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  275. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  276. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  277. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  278. package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
  279. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  280. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
  281. package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
  282. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  283. package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
  284. package/hmr/frameworks/vue/server/strategy.js +291 -7
  285. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  286. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  287. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  288. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  289. package/hmr/helpers/ast-normalizer.d.ts +3 -1
  290. package/hmr/helpers/ast-normalizer.js +131 -24
  291. package/hmr/helpers/ast-normalizer.js.map +1 -1
  292. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  293. package/hmr/helpers/cjs-named-exports.js +152 -0
  294. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  295. package/hmr/helpers/package-exports.d.ts +16 -0
  296. package/hmr/helpers/package-exports.js +396 -0
  297. package/hmr/helpers/package-exports.js.map +1 -0
  298. package/hmr/helpers/vendor-rewrite.d.ts +1 -1
  299. package/hmr/helpers/vendor-rewrite.js +5 -3
  300. package/hmr/helpers/vendor-rewrite.js.map +1 -1
  301. package/hmr/server/boot-recording.d.ts +51 -0
  302. package/hmr/server/boot-recording.js +214 -0
  303. package/hmr/server/boot-recording.js.map +1 -0
  304. package/hmr/server/constants.d.ts +1 -0
  305. package/hmr/server/constants.js +21 -4
  306. package/hmr/server/constants.js.map +1 -1
  307. package/hmr/server/content-css-update.d.ts +54 -0
  308. package/hmr/server/content-css-update.js +78 -0
  309. package/hmr/server/content-css-update.js.map +1 -0
  310. package/hmr/server/core-bundle.d.ts +140 -0
  311. package/hmr/server/core-bundle.js +614 -0
  312. package/hmr/server/core-bundle.js.map +1 -0
  313. package/hmr/server/core-sanitize.d.ts +130 -4
  314. package/hmr/server/core-sanitize.js +393 -32
  315. package/hmr/server/core-sanitize.js.map +1 -1
  316. package/hmr/server/css-connect-sync.d.ts +28 -0
  317. package/hmr/server/css-connect-sync.js +59 -0
  318. package/hmr/server/css-connect-sync.js.map +1 -0
  319. package/hmr/server/css-device-module.d.ts +28 -0
  320. package/hmr/server/css-device-module.js +44 -0
  321. package/hmr/server/css-device-module.js.map +1 -0
  322. package/hmr/server/css-update-message.d.ts +23 -0
  323. package/hmr/server/css-update-message.js +41 -0
  324. package/hmr/server/css-update-message.js.map +1 -0
  325. package/hmr/server/deps-bundle.d.ts +233 -0
  326. package/hmr/server/deps-bundle.js +1022 -0
  327. package/hmr/server/deps-bundle.js.map +1 -0
  328. package/hmr/server/device-transform-helpers.d.ts +24 -0
  329. package/hmr/server/device-transform-helpers.js +408 -0
  330. package/hmr/server/device-transform-helpers.js.map +1 -0
  331. package/hmr/server/framework-strategy.d.ts +182 -11
  332. package/hmr/server/hmr-module-graph.d.ts +37 -0
  333. package/hmr/server/hmr-module-graph.js +215 -0
  334. package/hmr/server/hmr-module-graph.js.map +1 -0
  335. package/hmr/server/import-map.d.ts +99 -0
  336. package/hmr/server/import-map.js +294 -0
  337. package/hmr/server/import-map.js.map +1 -0
  338. package/hmr/server/index.d.ts +2 -1
  339. package/hmr/server/index.js +7 -16
  340. package/hmr/server/index.js.map +1 -1
  341. package/hmr/server/node-builtins-route.d.ts +12 -0
  342. package/hmr/server/node-builtins-route.js +86 -0
  343. package/hmr/server/node-builtins-route.js.map +1 -0
  344. package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
  345. package/hmr/server/ns-core-cjs-shape.js +271 -0
  346. package/hmr/server/ns-core-cjs-shape.js.map +1 -0
  347. package/hmr/server/ns-m-response-memo.d.ts +10 -0
  348. package/hmr/server/ns-m-response-memo.js +33 -0
  349. package/hmr/server/ns-m-response-memo.js.map +1 -0
  350. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  351. package/hmr/server/ns-rt-bridge.js +131 -0
  352. package/hmr/server/ns-rt-bridge.js.map +1 -0
  353. package/hmr/server/ns-rt-route.d.ts +5 -0
  354. package/hmr/server/ns-rt-route.js +39 -0
  355. package/hmr/server/ns-rt-route.js.map +1 -0
  356. package/hmr/server/perf-instrumentation.d.ts +114 -0
  357. package/hmr/server/perf-instrumentation.js +197 -0
  358. package/hmr/server/perf-instrumentation.js.map +1 -0
  359. package/hmr/server/process-code-for-device.d.ts +44 -0
  360. package/hmr/server/process-code-for-device.js +834 -0
  361. package/hmr/server/process-code-for-device.js.map +1 -0
  362. package/hmr/server/require-guard.d.ts +1 -0
  363. package/hmr/server/require-guard.js +12 -0
  364. package/hmr/server/require-guard.js.map +1 -0
  365. package/hmr/server/rewrite-imports.d.ts +2 -0
  366. package/hmr/server/rewrite-imports.js +631 -0
  367. package/hmr/server/rewrite-imports.js.map +1 -0
  368. package/hmr/server/route-helpers.d.ts +7 -0
  369. package/hmr/server/route-helpers.js +13 -0
  370. package/hmr/server/route-helpers.js.map +1 -0
  371. package/hmr/server/runtime-graph-filter.d.ts +5 -0
  372. package/hmr/server/runtime-graph-filter.js +28 -0
  373. package/hmr/server/runtime-graph-filter.js.map +1 -0
  374. package/hmr/server/server-origin.d.ts +2 -0
  375. package/hmr/server/server-origin.js +88 -0
  376. package/hmr/server/server-origin.js.map +1 -0
  377. package/hmr/server/shared-transform-request.d.ts +12 -0
  378. package/hmr/server/shared-transform-request.js +143 -0
  379. package/hmr/server/shared-transform-request.js.map +1 -0
  380. package/hmr/server/socket-utils.d.ts +10 -0
  381. package/hmr/server/socket-utils.js +14 -0
  382. package/hmr/server/socket-utils.js.map +1 -0
  383. package/hmr/server/transform-cache-invalidation.d.ts +37 -0
  384. package/hmr/server/transform-cache-invalidation.js +156 -0
  385. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  386. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  387. package/hmr/server/vendor-bare-module-shims.js +80 -0
  388. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  389. package/hmr/server/vite-plugin.d.ts +22 -1
  390. package/hmr/server/vite-plugin.js +655 -58
  391. package/hmr/server/vite-plugin.js.map +1 -1
  392. package/hmr/server/websocket-core-bridge.d.ts +68 -0
  393. package/hmr/server/websocket-core-bridge.js +370 -0
  394. package/hmr/server/websocket-core-bridge.js.map +1 -0
  395. package/hmr/server/websocket-device-transform.d.ts +3 -0
  396. package/hmr/server/websocket-device-transform.js +7 -0
  397. package/hmr/server/websocket-device-transform.js.map +1 -0
  398. package/hmr/server/websocket-graph-upsert.d.ts +21 -0
  399. package/hmr/server/websocket-graph-upsert.js +33 -0
  400. package/hmr/server/websocket-graph-upsert.js.map +1 -0
  401. package/hmr/server/websocket-hmr-pending.d.ts +29 -0
  402. package/hmr/server/websocket-hmr-pending.js +33 -0
  403. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  404. package/hmr/server/websocket-hot-update.d.ts +80 -0
  405. package/hmr/server/websocket-hot-update.js +295 -0
  406. package/hmr/server/websocket-hot-update.js.map +1 -0
  407. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  408. package/hmr/server/websocket-import-map-route.js +51 -0
  409. package/hmr/server/websocket-import-map-route.js.map +1 -0
  410. package/hmr/server/websocket-module-bindings.d.ts +21 -0
  411. package/hmr/server/websocket-module-bindings.js +504 -0
  412. package/hmr/server/websocket-module-bindings.js.map +1 -0
  413. package/hmr/server/websocket-module-specifiers.d.ts +96 -0
  414. package/hmr/server/websocket-module-specifiers.js +819 -0
  415. package/hmr/server/websocket-module-specifiers.js.map +1 -0
  416. package/hmr/server/websocket-ns-core.d.ts +34 -0
  417. package/hmr/server/websocket-ns-core.js +414 -0
  418. package/hmr/server/websocket-ns-core.js.map +1 -0
  419. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  420. package/hmr/server/websocket-ns-entry.js +163 -0
  421. package/hmr/server/websocket-ns-entry.js.map +1 -0
  422. package/hmr/server/websocket-ns-m-paths.d.ts +19 -0
  423. package/hmr/server/websocket-ns-m-paths.js +115 -0
  424. package/hmr/server/websocket-ns-m-paths.js.map +1 -0
  425. package/hmr/server/websocket-ns-m-request.d.ts +46 -0
  426. package/hmr/server/websocket-ns-m-request.js +197 -0
  427. package/hmr/server/websocket-ns-m-request.js.map +1 -0
  428. package/hmr/server/websocket-ns-m.d.ts +52 -0
  429. package/hmr/server/websocket-ns-m.js +590 -0
  430. package/hmr/server/websocket-ns-m.js.map +1 -0
  431. package/hmr/server/websocket-served-module-helpers.d.ts +89 -0
  432. package/hmr/server/websocket-served-module-helpers.js +935 -0
  433. package/hmr/server/websocket-served-module-helpers.js.map +1 -0
  434. package/hmr/server/websocket-txn.d.ts +6 -0
  435. package/hmr/server/websocket-txn.js +42 -0
  436. package/hmr/server/websocket-txn.js.map +1 -0
  437. package/hmr/server/websocket-vendor-unifier.d.ts +9 -0
  438. package/hmr/server/websocket-vendor-unifier.js +46 -0
  439. package/hmr/server/websocket-vendor-unifier.js.map +1 -0
  440. package/hmr/server/websocket.d.ts +7 -17
  441. package/hmr/server/websocket.js +723 -5376
  442. package/hmr/server/websocket.js.map +1 -1
  443. package/hmr/shared/ns-globals.d.ts +107 -0
  444. package/hmr/shared/ns-globals.js +29 -0
  445. package/hmr/shared/ns-globals.js.map +1 -0
  446. package/hmr/shared/package-classifier.d.ts +9 -0
  447. package/hmr/shared/package-classifier.js +58 -0
  448. package/hmr/shared/package-classifier.js.map +1 -0
  449. package/hmr/shared/protocol.d.ts +157 -0
  450. package/hmr/shared/protocol.js +28 -0
  451. package/hmr/shared/protocol.js.map +1 -0
  452. package/hmr/shared/runtime/boot-complete.d.ts +14 -0
  453. package/hmr/shared/runtime/boot-complete.js +32 -0
  454. package/hmr/shared/runtime/boot-complete.js.map +1 -0
  455. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  456. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  457. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  458. package/hmr/shared/runtime/boot-progress.d.ts +44 -0
  459. package/hmr/shared/runtime/boot-progress.js +134 -0
  460. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  461. package/hmr/shared/runtime/boot-timeline.d.ts +17 -0
  462. package/hmr/shared/runtime/boot-timeline.js +40 -0
  463. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  464. package/hmr/shared/runtime/browser-runtime-contract.d.ts +97 -0
  465. package/hmr/shared/runtime/browser-runtime-contract.js +66 -0
  466. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
  467. package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
  468. package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
  469. package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
  470. package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
  471. package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
  472. package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
  473. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  474. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  475. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  476. package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
  477. package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
  478. package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
  479. package/hmr/shared/runtime/dev-overlay.d.ts +39 -0
  480. package/hmr/shared/runtime/dev-overlay.js +292 -0
  481. package/hmr/shared/runtime/dev-overlay.js.map +1 -0
  482. package/hmr/shared/runtime/global-scope.d.ts +18 -0
  483. package/hmr/shared/runtime/global-scope.js +21 -0
  484. package/hmr/shared/runtime/global-scope.js.map +1 -0
  485. package/hmr/shared/runtime/hooks.js +2 -1
  486. package/hmr/shared/runtime/hooks.js.map +1 -1
  487. package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
  488. package/hmr/shared/runtime/launch-bridge.js +98 -0
  489. package/hmr/shared/runtime/launch-bridge.js.map +1 -0
  490. package/hmr/shared/runtime/module-provenance.d.ts +1 -0
  491. package/hmr/shared/runtime/module-provenance.js +64 -0
  492. package/hmr/shared/runtime/module-provenance.js.map +1 -0
  493. package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
  494. package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
  495. package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
  496. package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
  497. package/hmr/shared/runtime/overlay-flag.js +34 -0
  498. package/hmr/shared/runtime/overlay-flag.js.map +1 -0
  499. package/hmr/shared/runtime/platform-polyfills.d.ts +26 -0
  500. package/hmr/shared/runtime/platform-polyfills.js +122 -0
  501. package/hmr/shared/runtime/platform-polyfills.js.map +1 -0
  502. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  503. package/hmr/shared/runtime/root-placeholder-view.js +311 -0
  504. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  505. package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
  506. package/hmr/shared/runtime/root-placeholder.js +778 -83
  507. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  508. package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
  509. package/hmr/shared/runtime/session-bootstrap.js +350 -0
  510. package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
  511. package/hmr/shared/runtime/vendor-bootstrap.js +54 -16
  512. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  513. package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
  514. package/hmr/shared/runtime/vendor-resolve.js +45 -0
  515. package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
  516. package/hmr/shared/runtime/worker-tracking.d.ts +28 -0
  517. package/hmr/shared/runtime/worker-tracking.js +114 -0
  518. package/hmr/shared/runtime/worker-tracking.js.map +1 -0
  519. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  520. package/hmr/shared/vendor/manifest-collect.js +909 -0
  521. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  522. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  523. package/hmr/shared/vendor/manifest-loader.js +5 -3
  524. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  525. package/hmr/shared/vendor/manifest.d.ts +12 -0
  526. package/hmr/shared/vendor/manifest.js +341 -545
  527. package/hmr/shared/vendor/manifest.js.map +1 -1
  528. package/hmr/shared/vendor/registry.d.ts +2 -0
  529. package/hmr/shared/vendor/registry.js +118 -7
  530. package/hmr/shared/vendor/registry.js.map +1 -1
  531. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  532. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  533. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  534. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
  535. package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
  536. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  537. package/index.d.ts +1 -0
  538. package/index.js +5 -0
  539. package/index.js.map +1 -1
  540. package/package.json +76 -14
  541. package/runtime/core-aliases-early.js +103 -81
  542. package/runtime/core-aliases-early.js.map +1 -1
  543. package/shims/react-jsx-runtime.d.ts +4 -0
  544. package/shims/react-jsx-runtime.js +61 -0
  545. package/shims/react-jsx-runtime.js.map +1 -0
  546. package/shims/solid-jsx-runtime.d.ts +7 -0
  547. package/shims/solid-jsx-runtime.js +17 -0
  548. package/shims/solid-jsx-runtime.js.map +1 -0
  549. package/helpers/angular/angular-linker.d.ts +0 -13
  550. package/helpers/angular/angular-linker.js +0 -189
  551. package/helpers/angular/angular-linker.js.map +0 -1
  552. package/helpers/angular/shared-linker.d.ts +0 -4
  553. package/helpers/angular/shared-linker.js +0 -39
  554. package/helpers/angular/shared-linker.js.map +0 -1
  555. package/helpers/angular/util.js +0 -67
  556. package/helpers/angular/util.js.map +0 -1
  557. package/helpers/module-runner-patch.d.ts +0 -3
  558. package/helpers/module-runner-patch.js +0 -63
  559. package/helpers/module-runner-patch.js.map +0 -1
  560. package/helpers/prelink-angular.d.ts +0 -2
  561. package/helpers/prelink-angular.js +0 -117
  562. package/helpers/prelink-angular.js.map +0 -1
  563. package/hmr/shared/runtime/http-only-boot.d.ts +0 -1
  564. package/hmr/shared/runtime/http-only-boot.js +0 -124
  565. package/hmr/shared/runtime/http-only-boot.js.map +0 -1
  566. package/hmr/vendor-bootstrap.d.ts +0 -3
  567. package/hmr/vendor-bootstrap.js +0 -32
  568. package/hmr/vendor-bootstrap.js.map +0 -1
  569. package/shims/react-reconciler-constants.d.ts +0 -14
  570. package/shims/react-reconciler-constants.js +0 -21
  571. package/shims/react-reconciler-constants.js.map +0 -1
  572. package/shims/react-reconciler.d.ts +0 -8
  573. package/shims/react-reconciler.js +0 -15
  574. package/shims/react-reconciler.js.map +0 -1
  575. package/transformers/NativeClass/index.d.ts +0 -2
  576. package/transformers/NativeClass/index.js +0 -222
  577. package/transformers/NativeClass/index.js.map +0 -1
@@ -1,22 +1,91 @@
1
- import { Application, Frame } from '@nativescript/core';
2
- const VERBOSE = !!globalThis.__NS_ENV_VERBOSE__;
3
- // CSS helper function
4
- export function applyCssText(cssText) {
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';
8
+ function getPreferredCssApplier() {
9
+ try {
10
+ const applier = getGlobalScope().__NS_HMR_APPLY_CSS__;
11
+ if (typeof applier === 'function') {
12
+ return applier;
13
+ }
14
+ }
15
+ catch { }
16
+ return null;
17
+ }
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 };
23
+ }
24
+ return {};
25
+ }
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) {
5
34
  if (typeof cssText !== 'string' || !cssText.length)
6
35
  return;
7
36
  try {
8
- if (Application.addCss) {
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
+ }
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();
56
+ const Application = getCore('Application');
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) {
9
71
  Application.addCss(cssText);
10
72
  if (VERBOSE)
11
- console.info('[ns-hmr] Applied app CSS');
73
+ console.info('[ns-hmr] CSS applied via addCss (additive fallback)');
12
74
  }
13
- else {
14
- const topFrame = Frame.topmost?.();
15
- const curPage = topFrame?.currentPage;
16
- curPage.addCss(cssText);
17
- if (VERBOSE)
18
- console.info('[ns-hmr] Applied page CSS');
75
+ // NS caches computed styles — re-trigger styling on the root
76
+ // (propagates to descendants via `eachDescendant`).
77
+ try {
78
+ const rootView = Application?.getRootView?.();
79
+ if (rootView && typeof rootView._onCssStateChange === 'function') {
80
+ rootView._onCssStateChange();
81
+ }
82
+ else if (rootView) {
83
+ const cls = rootView.className || '';
84
+ rootView.className = cls + ' ';
85
+ rootView.className = cls;
86
+ }
19
87
  }
88
+ catch { }
20
89
  }
21
90
  catch (e) {
22
91
  console.warn('[ns-hmr] CSS apply failed:', e?.message || String(e));
@@ -25,12 +94,11 @@ export function applyCssText(cssText) {
25
94
  // Fetch helper
26
95
  export async function fetchText(url) {
27
96
  try {
28
- const g = globalThis;
97
+ const g = getGlobalScope();
29
98
  if (typeof g.fetch === 'function') {
30
99
  const res = await g.fetch(url);
31
100
  return await res.text();
32
101
  }
33
- // Fallback to NativeScript Http if available
34
102
  const Http = g.Http;
35
103
  if (Http && Http.getString) {
36
104
  return await Http.getString(url);
@@ -46,22 +114,26 @@ export async function fetchText(url) {
46
114
  }
47
115
  // Handle CSS updates from Vite
48
116
  export async function handleCssUpdates(cssUpdates, httpOrigin) {
117
+ if (VERBOSE)
118
+ console.info('[ns-hmr] handleCssUpdates called, updates:', cssUpdates?.length, 'origin:', httpOrigin);
49
119
  for (const update of cssUpdates) {
50
120
  try {
51
- const path = update.path || update.acceptedPath || '';
52
- if (!path || !httpOrigin)
121
+ const cssPath = update.path || update.acceptedPath || '';
122
+ if (!cssPath || !httpOrigin)
53
123
  continue;
54
- // Compose URL like the Vite client (ensure raw content and cache-bust)
55
- const hasQuery = path.includes('?');
56
- const tParam = `t=${encodeURIComponent(String(update.timestamp || Date.now()))}`;
57
- const directParam = hasQuery ? '&direct=1' : '?direct=1';
58
- const tSuffix = (hasQuery ? '&' : '?') + tParam;
59
- const url = httpOrigin + path + directParam + tSuffix;
124
+ // Build URL: origin + path + ?direct=1&t=<timestamp>
125
+ const timestamp = update.timestamp || Date.now();
126
+ const sep = cssPath.includes('?') ? '&' : '?';
127
+ const url = `${httpOrigin}${cssPath}${sep}direct=1&t=${timestamp}`;
60
128
  if (VERBOSE)
61
129
  console.info('[ns-hmr] Fetching CSS:', url);
62
130
  const cssText = await fetchText(url);
63
131
  if (cssText) {
64
- 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);
65
137
  }
66
138
  }
67
139
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"css-handler.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/css-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACxD,MAAM,OAAO,GAAG,CAAC,CAAE,UAAkB,CAAC,kBAAkB,CAAC;AAEzD,sBAAsB;AACtB,MAAM,UAAU,YAAY,CAAC,OAAe;IAC3C,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO;IAE3D,IAAI,CAAC;QACJ,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;YACxB,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC5B,IAAI,OAAO;gBAAE,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACvD,CAAC;aAAM,CAAC;YACP,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,QAAQ,EAAE,WAAW,CAAC;YACtC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACxB,IAAI,OAAO;gBAAE,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAA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AAI,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"}
@@ -0,0 +1,13 @@
1
+ export type HmrOverlayApiLike = {
2
+ setUpdateStage?: (stage: string, info?: {
3
+ detail?: string;
4
+ }) => unknown;
5
+ } | null | undefined;
6
+ export type HmrPendingHandlerDeps = {
7
+ /** Resolves the live overlay API. Returning null/undefined is treated as "no overlay installed". */
8
+ getOverlay: () => HmrOverlayApiLike;
9
+ /** Override the build-time gate for testing. Defaults to reading `__NS_HMR_PROGRESS_OVERLAY_ENABLED__` (or `true` when undefined). */
10
+ overlayEnabled?: boolean;
11
+ };
12
+ export declare function buildHmrPendingDetail(filePath: string | undefined): string;
13
+ export declare function applyHmrPendingFrame(filePath: string | undefined, deps: HmrPendingHandlerDeps): boolean;
@@ -0,0 +1,41 @@
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
+ import { resolveOverlayEnabled } from './overlay-driver.js';
16
+ export function buildHmrPendingDetail(filePath) {
17
+ if (!filePath || filePath === '<unknown>')
18
+ return 'Preparing update';
19
+ return `Updating ${filePath}`;
20
+ }
21
+ export function applyHmrPendingFrame(filePath, deps) {
22
+ if (!resolveOverlayEnabled(deps.overlayEnabled))
23
+ return false;
24
+ let api;
25
+ try {
26
+ api = deps.getOverlay();
27
+ }
28
+ catch {
29
+ return false;
30
+ }
31
+ if (!api || typeof api.setUpdateStage !== 'function')
32
+ return false;
33
+ try {
34
+ api.setUpdateStage('received', { detail: buildHmrPendingDetail(filePath) });
35
+ return true;
36
+ }
37
+ catch {
38
+ return false;
39
+ }
40
+ }
41
+ //# sourceMappingURL=hmr-pending-overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hmr-pending-overlay.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/hmr-pending-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAgB5D,MAAM,UAAU,qBAAqB,CAAC,QAA4B;IACjE,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,WAAW;QAAE,OAAO,kBAAkB,CAAC;IACrE,OAAO,YAAY,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAA4B,EAAE,IAA2B;IAC7F,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,cAAc,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,GAAsB,CAAC;IAC3B,IAAI,CAAC;QACJ,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,cAAc,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IACnE,IAAI,CAAC;QACJ,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * JS-owned `import.meta.hot` implementation (Vite-style injected hot contexts).
3
+ *
4
+ * `import.meta.hot` is HMR *policy* and lives entirely in this package — the
5
+ * native runtimes expose no hot API. The dev server injects
6
+ *
7
+ * import.meta.hot = globalThis.__NS_HOT_REGISTRY__?.createHotContext('<canonical-id>')
8
+ *
9
+ * at the top of every served app module (see `processCodeForDevice`), and this
10
+ * module owns every registry the hot API needs. The registry is installed on
11
+ * `globalThis.__NS_HOT_REGISTRY__` by `installNsHotRegistry()`, which the
12
+ * `/__ns_dev__/client` bootstrap runs before the entry graph evaluates.
13
+ *
14
+ * Process-wide singleton: state is stashed on globalThis so that a second
15
+ * copy of this module (e.g. loaded under a different URL) shares the same
16
+ * registries instead of splitting them.
17
+ *
18
+ * No circulars — don't import from other hmr/client/* modules here.
19
+ */
20
+ export interface NsHotEventPayload {
21
+ [key: string]: unknown;
22
+ }
23
+ type HotCallback = (...args: unknown[]) => unknown;
24
+ export interface NsHotRegistry {
25
+ createHotContext(ownerId: string): NsHotContext;
26
+ canonicalHotKey(id: string): string;
27
+ /** Drain `hot.dispose(cb)` callbacks (all modules, or a key subset). Returns count executed. */
28
+ runDispose(keys?: readonly string[]): number;
29
+ /** Drain `hot.prune(cb)` callbacks (all modules, or a key subset). Returns count executed. */
30
+ runPrune(keys?: readonly string[]): number;
31
+ /** True when any module (or any module in the key subset) called `hot.decline()`. */
32
+ hasDeclined(keys?: readonly string[]): boolean;
33
+ /** Fire `hot.on(event, cb)` listeners. Returns the number of listeners invoked. */
34
+ dispatchHotEvent(event: string, payload?: unknown): number;
35
+ listHotEventListeners(): Record<string, number>;
36
+ /** Wire `hot.send(...)` to the active WebSocket (installed by the full client). */
37
+ setSendToServer(fn: ((event: string, data?: unknown) => void) | null): void;
38
+ /** Override the full-reload behavior (`hot.invalidate()`, declined modules). */
39
+ setFullReloadHandler(fn: ((message?: string) => void) | null): void;
40
+ requestFullReload(message?: string): void;
41
+ }
42
+ export interface NsHotContext {
43
+ readonly data: Record<string, unknown>;
44
+ accept(...args: unknown[]): void;
45
+ acceptExports(exportNames: string[], cb?: HotCallback): void;
46
+ dispose(cb: HotCallback): void;
47
+ prune(cb: HotCallback): void;
48
+ decline(): void;
49
+ invalidate(message?: string): void;
50
+ on(event: string, cb: HotCallback): void;
51
+ off(event: string, cb: HotCallback): void;
52
+ send(event: string, data?: unknown): void;
53
+ }
54
+ declare global {
55
+ var __NS_HOT_REGISTRY__: NsHotRegistry | undefined;
56
+ var __NS_DEV_ENTRY_URL__: string | undefined;
57
+ }
58
+ /**
59
+ * Install (or return the already-installed) process-wide hot registry.
60
+ * Idempotent — safe to call from the bootstrap client, the full client and
61
+ * tests; the first installation wins.
62
+ */
63
+ export declare function installNsHotRegistry(): NsHotRegistry;
64
+ /** Read the installed registry (installing lazily so callers never race). */
65
+ export declare function getNsHotRegistry(): NsHotRegistry;
66
+ export declare function createHotContext(ownerId: string): NsHotContext;
67
+ export {};