@nativescript/vite 8.0.0-beta.0 → 8.0.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (586) hide show
  1. package/README.md +89 -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 +228 -78
  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/framework.d.ts +22 -0
  17. package/framework.js +18 -0
  18. package/framework.js.map +1 -0
  19. package/helpers/app-components.d.ts +2 -1
  20. package/helpers/app-components.js.map +1 -1
  21. package/helpers/app-css-refresh.d.ts +31 -0
  22. package/helpers/app-css-refresh.js +43 -0
  23. package/helpers/app-css-refresh.js.map +1 -0
  24. package/helpers/app-css-state.d.ts +17 -0
  25. package/helpers/app-css-state.js +51 -0
  26. package/helpers/app-css-state.js.map +1 -0
  27. package/helpers/bundler-context.d.ts +11 -0
  28. package/helpers/bundler-context.js +71 -0
  29. package/helpers/bundler-context.js.map +1 -0
  30. package/helpers/cli-flags.d.ts +12 -0
  31. package/helpers/cli-flags.js +34 -0
  32. package/helpers/cli-flags.js.map +1 -1
  33. package/helpers/commonjs-plugins.d.ts +5 -2
  34. package/helpers/commonjs-plugins.js +126 -0
  35. package/helpers/commonjs-plugins.js.map +1 -1
  36. package/helpers/config-as-json.js +10 -0
  37. package/helpers/config-as-json.js.map +1 -1
  38. package/helpers/css-platform-plugin.d.ts +14 -0
  39. package/helpers/css-platform-plugin.js +43 -25
  40. package/helpers/css-platform-plugin.js.map +1 -1
  41. package/helpers/dev-host.d.ts +360 -0
  42. package/helpers/dev-host.js +694 -0
  43. package/helpers/dev-host.js.map +1 -0
  44. package/helpers/dynamic-import-plugin.d.ts +2 -1
  45. package/helpers/dynamic-import-plugin.js +59 -53
  46. package/helpers/dynamic-import-plugin.js.map +1 -1
  47. package/helpers/esbuild-platform-resolver.js +9 -6
  48. package/helpers/esbuild-platform-resolver.js.map +1 -1
  49. package/helpers/external-configs.d.ts +10 -4
  50. package/helpers/external-configs.js +63 -15
  51. package/helpers/external-configs.js.map +1 -1
  52. package/helpers/flavor.d.ts +31 -0
  53. package/helpers/flavor.js +53 -2
  54. package/helpers/flavor.js.map +1 -1
  55. package/helpers/global-defines.d.ts +118 -0
  56. package/helpers/global-defines.js +214 -11
  57. package/helpers/global-defines.js.map +1 -1
  58. package/helpers/hmr-scope.d.ts +26 -0
  59. package/helpers/hmr-scope.js +67 -0
  60. package/helpers/hmr-scope.js.map +1 -0
  61. package/helpers/import-meta-path.d.ts +4 -0
  62. package/helpers/import-meta-path.js +5 -0
  63. package/helpers/import-meta-path.js.map +1 -0
  64. package/helpers/import-specifier.d.ts +1 -0
  65. package/helpers/import-specifier.js +18 -0
  66. package/helpers/import-specifier.js.map +1 -0
  67. package/helpers/init.js +24 -26
  68. package/helpers/init.js.map +1 -1
  69. package/helpers/logging.d.ts +12 -1
  70. package/helpers/logging.js +81 -5
  71. package/helpers/logging.js.map +1 -1
  72. package/helpers/main-entry.d.ts +8 -2
  73. package/helpers/main-entry.js +622 -120
  74. package/helpers/main-entry.js.map +1 -1
  75. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  76. package/helpers/nativeclass-esbuild-plugin.js +6 -1
  77. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  78. package/helpers/nativeclass-transform.d.ts +13 -0
  79. package/helpers/nativeclass-transform.js +42 -131
  80. package/helpers/nativeclass-transform.js.map +1 -1
  81. package/helpers/nativeclass-transformer-plugin.d.ts +19 -1
  82. package/helpers/nativeclass-transformer-plugin.js +324 -37
  83. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  84. package/helpers/nativescript-package-resolver.js +10 -62
  85. package/helpers/nativescript-package-resolver.js.map +1 -1
  86. package/helpers/normalize-id.d.ts +42 -0
  87. package/helpers/normalize-id.js +60 -0
  88. package/helpers/normalize-id.js.map +1 -0
  89. package/helpers/ns-core-external-urls.d.ts +32 -0
  90. package/helpers/ns-core-external-urls.js +107 -0
  91. package/helpers/ns-core-external-urls.js.map +1 -0
  92. package/helpers/ns-core-url.d.ts +106 -0
  93. package/helpers/ns-core-url.js +225 -0
  94. package/helpers/ns-core-url.js.map +1 -0
  95. package/helpers/optimize-deps.d.ts +16 -0
  96. package/helpers/optimize-deps.js +17 -0
  97. package/helpers/optimize-deps.js.map +1 -0
  98. package/helpers/package-platform-aliases.js +34 -49
  99. package/helpers/package-platform-aliases.js.map +1 -1
  100. package/helpers/platform-types.d.ts +2 -0
  101. package/helpers/platform-types.js +2 -0
  102. package/helpers/platform-types.js.map +1 -0
  103. package/helpers/postcss-platform-config.d.ts +17 -1
  104. package/helpers/postcss-platform-config.js +20 -37
  105. package/helpers/postcss-platform-config.js.map +1 -1
  106. package/helpers/project.d.ts +35 -0
  107. package/helpers/project.js +120 -2
  108. package/helpers/project.js.map +1 -1
  109. package/helpers/resolve-main-field-platform.d.ts +20 -0
  110. package/helpers/resolve-main-field-platform.js +49 -0
  111. package/helpers/resolve-main-field-platform.js.map +1 -0
  112. package/helpers/resolver.js +17 -2
  113. package/helpers/resolver.js.map +1 -1
  114. package/helpers/theme-core-plugins.js +1 -1
  115. package/helpers/theme-core-plugins.js.map +1 -1
  116. package/helpers/ts-config-paths.d.ts +32 -0
  117. package/helpers/ts-config-paths.js +156 -27
  118. package/helpers/ts-config-paths.js.map +1 -1
  119. package/helpers/typescript-check.d.ts +3 -3
  120. package/helpers/typescript-check.js +4 -4
  121. package/helpers/typescript-check.js.map +1 -1
  122. package/helpers/ui-registration.d.ts +21 -0
  123. package/helpers/ui-registration.js +156 -0
  124. package/helpers/ui-registration.js.map +1 -0
  125. package/helpers/utils.d.ts +9 -0
  126. package/helpers/utils.js +22 -2
  127. package/helpers/utils.js.map +1 -1
  128. package/helpers/vite-package-version.d.ts +7 -0
  129. package/helpers/vite-package-version.js +44 -0
  130. package/helpers/vite-package-version.js.map +1 -0
  131. package/helpers/workers.d.ts +40 -19
  132. package/helpers/workers.js +312 -13
  133. package/helpers/workers.js.map +1 -1
  134. package/hmr/client/css-handler.d.ts +2 -1
  135. package/hmr/client/css-handler.js +95 -23
  136. package/hmr/client/css-handler.js.map +1 -1
  137. package/hmr/client/css-update-overlay.d.ts +18 -0
  138. package/hmr/client/css-update-overlay.js +27 -0
  139. package/hmr/client/css-update-overlay.js.map +1 -0
  140. package/hmr/client/framework-client-strategy.d.ts +117 -0
  141. package/hmr/client/framework-client-strategy.js +18 -0
  142. package/hmr/client/framework-client-strategy.js.map +1 -0
  143. package/hmr/client/framework.d.ts +31 -0
  144. package/hmr/client/framework.js +17 -0
  145. package/hmr/client/framework.js.map +1 -0
  146. package/hmr/client/hmr-pending-overlay.d.ts +13 -0
  147. package/hmr/client/hmr-pending-overlay.js +41 -0
  148. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  149. package/hmr/client/hot-context.d.ts +89 -0
  150. package/hmr/client/hot-context.js +404 -0
  151. package/hmr/client/hot-context.js.map +1 -0
  152. package/hmr/client/index.d.ts +9 -1
  153. package/hmr/client/index.js +91 -1418
  154. package/hmr/client/index.js.map +1 -1
  155. package/hmr/client/overlay-driver.d.ts +10 -0
  156. package/hmr/client/overlay-driver.js +33 -0
  157. package/hmr/client/overlay-driver.js.map +1 -0
  158. package/hmr/client/protocol-dispatch.d.ts +8 -0
  159. package/hmr/client/protocol-dispatch.js +308 -0
  160. package/hmr/client/protocol-dispatch.js.map +1 -0
  161. package/hmr/client/root-reset.d.ts +15 -0
  162. package/hmr/client/root-reset.js +358 -0
  163. package/hmr/client/root-reset.js.map +1 -0
  164. package/hmr/client/strategy-loader.d.ts +24 -0
  165. package/hmr/client/strategy-loader.js +136 -0
  166. package/hmr/client/strategy-loader.js.map +1 -0
  167. package/hmr/client/update-pipeline.d.ts +27 -0
  168. package/hmr/client/update-pipeline.js +489 -0
  169. package/hmr/client/update-pipeline.js.map +1 -0
  170. package/hmr/client/utils.d.ts +14 -1
  171. package/hmr/client/utils.js +265 -54
  172. package/hmr/client/utils.js.map +1 -1
  173. package/hmr/client/ws-transport.d.ts +21 -0
  174. package/hmr/client/ws-transport.js +323 -0
  175. package/hmr/client/ws-transport.js.map +1 -0
  176. package/hmr/entry-runtime.d.ts +11 -0
  177. package/hmr/entry-runtime.js +566 -43
  178. package/hmr/entry-runtime.js.map +1 -1
  179. package/hmr/framework-flavors.d.ts +59 -0
  180. package/hmr/framework-flavors.js +108 -0
  181. package/hmr/framework-flavors.js.map +1 -0
  182. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  183. package/hmr/frameworks/angular/build/angular-linker.js +113 -0
  184. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  185. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  186. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  187. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  188. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  189. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  190. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  191. package/hmr/frameworks/angular/build/inline-decorator-component-templates.d.ts +3 -0
  192. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js +231 -0
  193. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  194. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  195. package/hmr/frameworks/angular/build/js-lexer.js +182 -0
  196. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  197. package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
  198. package/hmr/frameworks/angular/build/linker-stats.js +29 -0
  199. package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
  200. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  201. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  202. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  203. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.d.ts +1 -0
  204. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  205. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  206. package/hmr/frameworks/angular/build/synthesize-injectable-factories.d.ts +3 -0
  207. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js +241 -0
  208. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  209. package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
  210. package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
  211. package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
  212. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  213. package/hmr/frameworks/angular/build/util.js +155 -0
  214. package/hmr/frameworks/angular/build/util.js.map +1 -0
  215. package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
  216. package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
  217. package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
  218. package/hmr/frameworks/angular/client/index.d.ts +2 -1
  219. package/hmr/frameworks/angular/client/index.js +637 -23
  220. package/hmr/frameworks/angular/client/index.js.map +1 -1
  221. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  222. package/hmr/frameworks/angular/client/strategy.js +19 -0
  223. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  224. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  225. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  226. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  227. package/hmr/frameworks/angular/server/linker.js +37 -6
  228. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  229. package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
  230. package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
  231. package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
  232. package/hmr/frameworks/angular/server/strategy.js +697 -18
  233. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  234. package/hmr/frameworks/angular/server/websocket-angular-entry.d.ts +2 -0
  235. package/hmr/frameworks/angular/server/websocket-angular-entry.js +68 -0
  236. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  237. package/hmr/frameworks/angular/server/websocket-angular-hot-update.d.ts +94 -0
  238. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +485 -0
  239. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  240. package/hmr/frameworks/react/client/strategy.d.ts +12 -0
  241. package/hmr/frameworks/react/client/strategy.js +27 -0
  242. package/hmr/frameworks/react/client/strategy.js.map +1 -0
  243. package/hmr/frameworks/react/server/strategy.d.ts +2 -0
  244. package/hmr/frameworks/react/server/strategy.js +230 -0
  245. package/hmr/frameworks/react/server/strategy.js.map +1 -0
  246. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  247. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  248. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  249. package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
  250. package/hmr/frameworks/solid/client/app-runtime.js +252 -0
  251. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
  252. package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
  253. package/hmr/frameworks/solid/client/strategy.js +391 -0
  254. package/hmr/frameworks/solid/client/strategy.js.map +1 -0
  255. package/hmr/frameworks/solid/server/strategy.js +293 -16
  256. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  257. package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
  258. package/hmr/frameworks/typescript/client/strategy.js +418 -0
  259. package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
  260. package/hmr/frameworks/typescript/server/strategy.js +48 -16
  261. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  262. package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
  263. package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
  264. package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
  265. package/hmr/frameworks/vue/client/index.d.ts +10 -1
  266. package/hmr/frameworks/vue/client/index.js +287 -562
  267. package/hmr/frameworks/vue/client/index.js.map +1 -1
  268. package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
  269. package/hmr/frameworks/vue/client/navigate-app.js +178 -0
  270. package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
  271. package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
  272. package/hmr/frameworks/vue/client/strategy.js +152 -0
  273. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  274. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
  275. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
  276. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  277. package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
  278. package/hmr/frameworks/vue/server/compiler.js +3 -1
  279. package/hmr/frameworks/vue/server/compiler.js.map +1 -1
  280. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  281. package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
  282. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  283. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  284. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  285. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  286. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  287. package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
  288. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  289. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
  290. package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
  291. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  292. package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
  293. package/hmr/frameworks/vue/server/strategy.js +291 -7
  294. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  295. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  296. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  297. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  298. package/hmr/helpers/ast-normalizer.d.ts +3 -1
  299. package/hmr/helpers/ast-normalizer.js +131 -24
  300. package/hmr/helpers/ast-normalizer.js.map +1 -1
  301. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  302. package/hmr/helpers/cjs-named-exports.js +152 -0
  303. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  304. package/hmr/helpers/package-exports.d.ts +16 -0
  305. package/hmr/helpers/package-exports.js +396 -0
  306. package/hmr/helpers/package-exports.js.map +1 -0
  307. package/hmr/helpers/vendor-rewrite.d.ts +1 -1
  308. package/hmr/helpers/vendor-rewrite.js +5 -3
  309. package/hmr/helpers/vendor-rewrite.js.map +1 -1
  310. package/hmr/server/boot-recording.d.ts +51 -0
  311. package/hmr/server/boot-recording.js +214 -0
  312. package/hmr/server/boot-recording.js.map +1 -0
  313. package/hmr/server/constants.d.ts +1 -0
  314. package/hmr/server/constants.js +21 -4
  315. package/hmr/server/constants.js.map +1 -1
  316. package/hmr/server/content-css-update.d.ts +54 -0
  317. package/hmr/server/content-css-update.js +78 -0
  318. package/hmr/server/content-css-update.js.map +1 -0
  319. package/hmr/server/core-bundle.d.ts +140 -0
  320. package/hmr/server/core-bundle.js +614 -0
  321. package/hmr/server/core-bundle.js.map +1 -0
  322. package/hmr/server/core-sanitize.d.ts +130 -4
  323. package/hmr/server/core-sanitize.js +393 -32
  324. package/hmr/server/core-sanitize.js.map +1 -1
  325. package/hmr/server/css-connect-sync.d.ts +28 -0
  326. package/hmr/server/css-connect-sync.js +59 -0
  327. package/hmr/server/css-connect-sync.js.map +1 -0
  328. package/hmr/server/css-device-module.d.ts +28 -0
  329. package/hmr/server/css-device-module.js +44 -0
  330. package/hmr/server/css-device-module.js.map +1 -0
  331. package/hmr/server/css-update-message.d.ts +23 -0
  332. package/hmr/server/css-update-message.js +41 -0
  333. package/hmr/server/css-update-message.js.map +1 -0
  334. package/hmr/server/deps-bundle.d.ts +233 -0
  335. package/hmr/server/deps-bundle.js +1022 -0
  336. package/hmr/server/deps-bundle.js.map +1 -0
  337. package/hmr/server/device-transform-helpers.d.ts +24 -0
  338. package/hmr/server/device-transform-helpers.js +408 -0
  339. package/hmr/server/device-transform-helpers.js.map +1 -0
  340. package/hmr/server/framework-strategy.d.ts +182 -11
  341. package/hmr/server/hmr-module-graph.d.ts +37 -0
  342. package/hmr/server/hmr-module-graph.js +215 -0
  343. package/hmr/server/hmr-module-graph.js.map +1 -0
  344. package/hmr/server/import-map.d.ts +99 -0
  345. package/hmr/server/import-map.js +294 -0
  346. package/hmr/server/import-map.js.map +1 -0
  347. package/hmr/server/index.d.ts +2 -1
  348. package/hmr/server/index.js +7 -16
  349. package/hmr/server/index.js.map +1 -1
  350. package/hmr/server/node-builtins-route.d.ts +12 -0
  351. package/hmr/server/node-builtins-route.js +86 -0
  352. package/hmr/server/node-builtins-route.js.map +1 -0
  353. package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
  354. package/hmr/server/ns-core-cjs-shape.js +271 -0
  355. package/hmr/server/ns-core-cjs-shape.js.map +1 -0
  356. package/hmr/server/ns-m-response-memo.d.ts +10 -0
  357. package/hmr/server/ns-m-response-memo.js +33 -0
  358. package/hmr/server/ns-m-response-memo.js.map +1 -0
  359. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  360. package/hmr/server/ns-rt-bridge.js +131 -0
  361. package/hmr/server/ns-rt-bridge.js.map +1 -0
  362. package/hmr/server/ns-rt-route.d.ts +5 -0
  363. package/hmr/server/ns-rt-route.js +39 -0
  364. package/hmr/server/ns-rt-route.js.map +1 -0
  365. package/hmr/server/perf-instrumentation.d.ts +114 -0
  366. package/hmr/server/perf-instrumentation.js +197 -0
  367. package/hmr/server/perf-instrumentation.js.map +1 -0
  368. package/hmr/server/process-code-for-device.d.ts +54 -0
  369. package/hmr/server/process-code-for-device.js +832 -0
  370. package/hmr/server/process-code-for-device.js.map +1 -0
  371. package/hmr/server/require-guard.d.ts +1 -0
  372. package/hmr/server/require-guard.js +12 -0
  373. package/hmr/server/require-guard.js.map +1 -0
  374. package/hmr/server/rewrite-imports.d.ts +2 -0
  375. package/hmr/server/rewrite-imports.js +631 -0
  376. package/hmr/server/rewrite-imports.js.map +1 -0
  377. package/hmr/server/route-helpers.d.ts +7 -0
  378. package/hmr/server/route-helpers.js +13 -0
  379. package/hmr/server/route-helpers.js.map +1 -0
  380. package/hmr/server/runtime-graph-filter.d.ts +5 -0
  381. package/hmr/server/runtime-graph-filter.js +28 -0
  382. package/hmr/server/runtime-graph-filter.js.map +1 -0
  383. package/hmr/server/server-origin.d.ts +2 -0
  384. package/hmr/server/server-origin.js +88 -0
  385. package/hmr/server/server-origin.js.map +1 -0
  386. package/hmr/server/shared-transform-request.d.ts +12 -0
  387. package/hmr/server/shared-transform-request.js +143 -0
  388. package/hmr/server/shared-transform-request.js.map +1 -0
  389. package/hmr/server/socket-utils.d.ts +10 -0
  390. package/hmr/server/socket-utils.js +14 -0
  391. package/hmr/server/socket-utils.js.map +1 -0
  392. package/hmr/server/transform-cache-invalidation.d.ts +37 -0
  393. package/hmr/server/transform-cache-invalidation.js +156 -0
  394. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  395. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  396. package/hmr/server/vendor-bare-module-shims.js +80 -0
  397. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  398. package/hmr/server/vite-plugin.d.ts +22 -1
  399. package/hmr/server/vite-plugin.js +655 -58
  400. package/hmr/server/vite-plugin.js.map +1 -1
  401. package/hmr/server/websocket-core-bridge.d.ts +68 -0
  402. package/hmr/server/websocket-core-bridge.js +370 -0
  403. package/hmr/server/websocket-core-bridge.js.map +1 -0
  404. package/hmr/server/websocket-device-transform.d.ts +3 -0
  405. package/hmr/server/websocket-device-transform.js +7 -0
  406. package/hmr/server/websocket-device-transform.js.map +1 -0
  407. package/hmr/server/websocket-graph-upsert.d.ts +21 -0
  408. package/hmr/server/websocket-graph-upsert.js +33 -0
  409. package/hmr/server/websocket-graph-upsert.js.map +1 -0
  410. package/hmr/server/websocket-hmr-pending.d.ts +29 -0
  411. package/hmr/server/websocket-hmr-pending.js +33 -0
  412. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  413. package/hmr/server/websocket-hot-update.d.ts +80 -0
  414. package/hmr/server/websocket-hot-update.js +299 -0
  415. package/hmr/server/websocket-hot-update.js.map +1 -0
  416. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  417. package/hmr/server/websocket-import-map-route.js +51 -0
  418. package/hmr/server/websocket-import-map-route.js.map +1 -0
  419. package/hmr/server/websocket-module-bindings.d.ts +21 -0
  420. package/hmr/server/websocket-module-bindings.js +504 -0
  421. package/hmr/server/websocket-module-bindings.js.map +1 -0
  422. package/hmr/server/websocket-module-specifiers.d.ts +98 -0
  423. package/hmr/server/websocket-module-specifiers.js +832 -0
  424. package/hmr/server/websocket-module-specifiers.js.map +1 -0
  425. package/hmr/server/websocket-ns-core.d.ts +34 -0
  426. package/hmr/server/websocket-ns-core.js +414 -0
  427. package/hmr/server/websocket-ns-core.js.map +1 -0
  428. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  429. package/hmr/server/websocket-ns-entry.js +163 -0
  430. package/hmr/server/websocket-ns-entry.js.map +1 -0
  431. package/hmr/server/websocket-ns-m-paths.d.ts +19 -0
  432. package/hmr/server/websocket-ns-m-paths.js +115 -0
  433. package/hmr/server/websocket-ns-m-paths.js.map +1 -0
  434. package/hmr/server/websocket-ns-m-request.d.ts +46 -0
  435. package/hmr/server/websocket-ns-m-request.js +197 -0
  436. package/hmr/server/websocket-ns-m-request.js.map +1 -0
  437. package/hmr/server/websocket-ns-m.d.ts +52 -0
  438. package/hmr/server/websocket-ns-m.js +592 -0
  439. package/hmr/server/websocket-ns-m.js.map +1 -0
  440. package/hmr/server/websocket-served-module-helpers.d.ts +98 -0
  441. package/hmr/server/websocket-served-module-helpers.js +948 -0
  442. package/hmr/server/websocket-served-module-helpers.js.map +1 -0
  443. package/hmr/server/websocket-txn.d.ts +6 -0
  444. package/hmr/server/websocket-txn.js +42 -0
  445. package/hmr/server/websocket-txn.js.map +1 -0
  446. package/hmr/server/websocket-vendor-unifier.d.ts +9 -0
  447. package/hmr/server/websocket-vendor-unifier.js +46 -0
  448. package/hmr/server/websocket-vendor-unifier.js.map +1 -0
  449. package/hmr/server/websocket.d.ts +6 -17
  450. package/hmr/server/websocket.js +723 -5376
  451. package/hmr/server/websocket.js.map +1 -1
  452. package/hmr/shared/ns-globals.d.ts +108 -0
  453. package/hmr/shared/ns-globals.js +29 -0
  454. package/hmr/shared/ns-globals.js.map +1 -0
  455. package/hmr/shared/package-classifier.d.ts +9 -0
  456. package/hmr/shared/package-classifier.js +58 -0
  457. package/hmr/shared/package-classifier.js.map +1 -0
  458. package/hmr/shared/protocol.d.ts +157 -0
  459. package/hmr/shared/protocol.js +28 -0
  460. package/hmr/shared/protocol.js.map +1 -0
  461. package/hmr/shared/runtime/boot-complete.d.ts +14 -0
  462. package/hmr/shared/runtime/boot-complete.js +32 -0
  463. package/hmr/shared/runtime/boot-complete.js.map +1 -0
  464. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  465. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  466. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  467. package/hmr/shared/runtime/boot-progress.d.ts +44 -0
  468. package/hmr/shared/runtime/boot-progress.js +134 -0
  469. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  470. package/hmr/shared/runtime/boot-timeline.d.ts +17 -0
  471. package/hmr/shared/runtime/boot-timeline.js +40 -0
  472. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  473. package/hmr/shared/runtime/browser-runtime-contract.d.ts +97 -0
  474. package/hmr/shared/runtime/browser-runtime-contract.js +66 -0
  475. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
  476. package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
  477. package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
  478. package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
  479. package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
  480. package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
  481. package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
  482. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  483. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  484. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  485. package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
  486. package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
  487. package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
  488. package/hmr/shared/runtime/dev-overlay.d.ts +39 -0
  489. package/hmr/shared/runtime/dev-overlay.js +292 -0
  490. package/hmr/shared/runtime/dev-overlay.js.map +1 -0
  491. package/hmr/shared/runtime/global-scope.d.ts +18 -0
  492. package/hmr/shared/runtime/global-scope.js +21 -0
  493. package/hmr/shared/runtime/global-scope.js.map +1 -0
  494. package/hmr/shared/runtime/hooks.js +2 -1
  495. package/hmr/shared/runtime/hooks.js.map +1 -1
  496. package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
  497. package/hmr/shared/runtime/launch-bridge.js +98 -0
  498. package/hmr/shared/runtime/launch-bridge.js.map +1 -0
  499. package/hmr/shared/runtime/module-provenance.d.ts +1 -0
  500. package/hmr/shared/runtime/module-provenance.js +64 -0
  501. package/hmr/shared/runtime/module-provenance.js.map +1 -0
  502. package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
  503. package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
  504. package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
  505. package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
  506. package/hmr/shared/runtime/overlay-flag.js +34 -0
  507. package/hmr/shared/runtime/overlay-flag.js.map +1 -0
  508. package/hmr/shared/runtime/platform-polyfills.d.ts +26 -0
  509. package/hmr/shared/runtime/platform-polyfills.js +122 -0
  510. package/hmr/shared/runtime/platform-polyfills.js.map +1 -0
  511. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  512. package/hmr/shared/runtime/root-placeholder-view.js +311 -0
  513. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  514. package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
  515. package/hmr/shared/runtime/root-placeholder.js +778 -83
  516. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  517. package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
  518. package/hmr/shared/runtime/session-bootstrap.js +350 -0
  519. package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
  520. package/hmr/shared/runtime/vendor-bootstrap.js +54 -16
  521. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  522. package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
  523. package/hmr/shared/runtime/vendor-resolve.js +45 -0
  524. package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
  525. package/hmr/shared/runtime/worker-tracking.d.ts +28 -0
  526. package/hmr/shared/runtime/worker-tracking.js +114 -0
  527. package/hmr/shared/runtime/worker-tracking.js.map +1 -0
  528. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  529. package/hmr/shared/vendor/manifest-collect.js +909 -0
  530. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  531. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  532. package/hmr/shared/vendor/manifest-loader.js +5 -3
  533. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  534. package/hmr/shared/vendor/manifest.d.ts +12 -0
  535. package/hmr/shared/vendor/manifest.js +341 -545
  536. package/hmr/shared/vendor/manifest.js.map +1 -1
  537. package/hmr/shared/vendor/registry.d.ts +2 -0
  538. package/hmr/shared/vendor/registry.js +118 -7
  539. package/hmr/shared/vendor/registry.js.map +1 -1
  540. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  541. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  542. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  543. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
  544. package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
  545. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  546. package/index.d.ts +1 -0
  547. package/index.js +5 -0
  548. package/index.js.map +1 -1
  549. package/package.json +83 -14
  550. package/runtime/core-aliases-early.js +103 -81
  551. package/runtime/core-aliases-early.js.map +1 -1
  552. package/shims/react-jsx-runtime.d.ts +4 -0
  553. package/shims/react-jsx-runtime.js +61 -0
  554. package/shims/react-jsx-runtime.js.map +1 -0
  555. package/shims/solid-jsx-runtime.d.ts +7 -0
  556. package/shims/solid-jsx-runtime.js +17 -0
  557. package/shims/solid-jsx-runtime.js.map +1 -0
  558. package/helpers/angular/angular-linker.d.ts +0 -13
  559. package/helpers/angular/angular-linker.js +0 -189
  560. package/helpers/angular/angular-linker.js.map +0 -1
  561. package/helpers/angular/shared-linker.d.ts +0 -4
  562. package/helpers/angular/shared-linker.js +0 -39
  563. package/helpers/angular/shared-linker.js.map +0 -1
  564. package/helpers/angular/util.js +0 -67
  565. package/helpers/angular/util.js.map +0 -1
  566. package/helpers/module-runner-patch.d.ts +0 -3
  567. package/helpers/module-runner-patch.js +0 -63
  568. package/helpers/module-runner-patch.js.map +0 -1
  569. package/helpers/prelink-angular.d.ts +0 -2
  570. package/helpers/prelink-angular.js +0 -117
  571. package/helpers/prelink-angular.js.map +0 -1
  572. package/hmr/shared/runtime/http-only-boot.d.ts +0 -1
  573. package/hmr/shared/runtime/http-only-boot.js +0 -124
  574. package/hmr/shared/runtime/http-only-boot.js.map +0 -1
  575. package/hmr/vendor-bootstrap.d.ts +0 -3
  576. package/hmr/vendor-bootstrap.js +0 -32
  577. package/hmr/vendor-bootstrap.js.map +0 -1
  578. package/shims/react-reconciler-constants.d.ts +0 -14
  579. package/shims/react-reconciler-constants.js +0 -21
  580. package/shims/react-reconciler-constants.js.map +0 -1
  581. package/shims/react-reconciler.d.ts +0 -8
  582. package/shims/react-reconciler.js +0 -15
  583. package/shims/react-reconciler.js.map +0 -1
  584. package/transformers/NativeClass/index.d.ts +0 -2
  585. package/transformers/NativeClass/index.js +0 -222
  586. 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,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AC,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,117 @@
1
+ /**
2
+ * Client-side framework strategy contract (device HMR runtime).
3
+ *
4
+ * The server-side seam (`hmr/server/framework-strategy.ts`) has a mirror here:
5
+ * each framework that needs bespoke on-device HMR behavior implements this and
6
+ * is selected by `TARGET_FLAVOR` (Vue, Angular, Solid, TypeScript, React all
7
+ * ship one under `hmr/frameworks/<flavor>/client/`).
8
+ *
9
+ * All members are optional except `install`. A missing hook means "use the
10
+ * shared default".
11
+ *
12
+ * Keeping this file free of any framework import is deliberate: it lets the
13
+ * shared client depend only on the contract, so the concrete per-flavor module
14
+ * can later be loaded through a single dynamic `import()` (the device-bundle
15
+ * win) without the shared client statically pulling in every framework client.
16
+ */
17
+ export interface ClientGraphModule {
18
+ id: string;
19
+ deps: string[];
20
+ hash: string;
21
+ }
22
+ /** Shared state handed to {@link FrameworkClientStrategy.selectMountCandidate}. */
23
+ export interface FrameworkClientMountContext {
24
+ graph: Map<string, ClientGraphModule>;
25
+ appMainEntrySpec: string;
26
+ }
27
+ /** Shared helpers handed to {@link FrameworkClientStrategy.refreshAfterBatch}. */
28
+ export interface FrameworkClientBatchContext {
29
+ setUpdateOverlayStage: (stage: any, opts?: any) => void;
30
+ /** Wall-clock (ms) when the queue drain started, for "Updated … in Nms". */
31
+ startedAt: number;
32
+ /** Live client module graph (id → {id, deps, hash}) for reverse-import propagation. */
33
+ graph?: Map<string, ClientGraphModule>;
34
+ /** Swap the live root view to a freshly loaded component (resolves true on success). */
35
+ performResetRoot?: (component: any) => Promise<boolean> | any;
36
+ /** Resolves the live dev-overlay API (null/undefined when not installed). */
37
+ getOverlay?: () => any;
38
+ }
39
+ /** Shared helpers handed to the framework message hooks. */
40
+ export interface FrameworkClientMessageContext {
41
+ getCore: (name: string) => any;
42
+ verbose: boolean;
43
+ performResetRoot: (component: any) => any;
44
+ getOverlay: () => any;
45
+ }
46
+ export interface FrameworkClientStrategy {
47
+ readonly flavor: string;
48
+ /**
49
+ * When false, the in-place authoritative-frame `navigate()` fast path is
50
+ * skipped in favor of a full `resetRootView`. Vue requires this. Absent
51
+ * strategy/flag defaults to `true` (the legacy `flavor !== 'vue'` behavior).
52
+ */
53
+ readonly allowNavigateFastPath?: boolean;
54
+ /**
55
+ * When true, the shared queue drives the apply-progress overlay's
56
+ * 'evicting'/'reimporting' frames around its drain (Solid). Frameworks that
57
+ * drive the overlay from their own update path (Angular, Vue) leave this
58
+ * unset so the queue stays silent.
59
+ */
60
+ readonly drivesQueueOverlayStages?: boolean;
61
+ /** One-time client install (dev shims / HMR hooks). Runs at strategy resolve. */
62
+ install(): void;
63
+ /** Install the hardware-back wrapper once a resetRoot fn + core accessor exist. */
64
+ installBackWrapper?(performResetRoot: (comp: any) => void, getCore: (name: string) => any): void;
65
+ /** Pick the initial/rescue mount component id from the module graph (+ registry). */
66
+ selectMountCandidate?(ctx: FrameworkClientMountContext): string | null;
67
+ /** Load the component to mount for `candidate` (e.g. Vue SFC assembly). */
68
+ loadComponentForMount?(candidate: string): Promise<any>;
69
+ /** Build the NS root view for `newComponent` (framework-specific mount). */
70
+ createRoot?(newComponent: any, state: any): any;
71
+ /** Record changed-module metadata from a delta payload (framework bookkeeping). */
72
+ recordPayloadChanges?(changed: any[], graphVersion: number): void;
73
+ /**
74
+ * Decide whether a changed module goes through the shared evict + re-import
75
+ * queue in this realm. Return `false` for a module whose fresh body must
76
+ * not evaluate here — a worker script only a worker isolate ever loaded,
77
+ * a type-only module nothing imports. Declined ids are handed to
78
+ * {@link applyUnqueuedChanges} instead. Defaults to `true`.
79
+ */
80
+ shouldQueueReimport?(id: string): boolean;
81
+ /**
82
+ * Apply the changed modules {@link shouldQueueReimport} declined, in the
83
+ * same delta. Runs only after boot, for real edits, and only when at least
84
+ * one id was declined.
85
+ */
86
+ applyUnqueuedChanges?(ids: string[]): void | Promise<void>;
87
+ /**
88
+ * A full graph arrived after boot with hashes that differ from the client's
89
+ * mirror — a reconnect after a dev-server restart, or version drift. The
90
+ * shared fallback re-imports every changed module piecemeal, outside any
91
+ * accept/dispose sequencing. Return `true` to take over (Octane requests
92
+ * one ordered graph reload instead); `changedIds` is the inferred set.
93
+ */
94
+ handleGraphResync?(changedIds: string[]): boolean | Promise<boolean>;
95
+ /**
96
+ * Runs once per queue drain, BEFORE the changed modules are evicted from
97
+ * the runtime registry. The only point at which a framework can still reach
98
+ * the module instances about to be replaced — their `hot.accept` callbacks
99
+ * and `hot.dispose` registrations are reset when the fresh bodies evaluate
100
+ * (Octane: Vite-parity accept/dispose sequencing).
101
+ */
102
+ beforeBatchEvict?(drained: string[]): void;
103
+ /**
104
+ * Post-process one freshly re-imported module during the queue drain
105
+ * (TypeScript/React: refresh the bundled module registry so Builder /
106
+ * `loadModule` resolves the NEW code-behind instead of the boot-bundle copy).
107
+ */
108
+ afterModuleReimport?(id: string, mod: any): void;
109
+ /** Framework UI refresh after a re-import batch drains. */
110
+ refreshAfterBatch?(drained: string[], ctx: FrameworkClientBatchContext): void | Promise<void>;
111
+ /** Handle a framework hot-update protocol message (resolves true if consumed). */
112
+ handleHotUpdateMessage?(msg: any, ctx: FrameworkClientMessageContext): Promise<boolean>;
113
+ /** Handle the framework SFC registry message. */
114
+ handleSfcRegistry?(msg: any): void;
115
+ /** Handle the framework SFC registry-update message (drives its own overlay). */
116
+ handleSfcRegistryUpdate?(msg: any, graphVersion: number, ctx: FrameworkClientMessageContext): Promise<void>;
117
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Client-side framework strategy contract (device HMR runtime).
3
+ *
4
+ * The server-side seam (`hmr/server/framework-strategy.ts`) has a mirror here:
5
+ * each framework that needs bespoke on-device HMR behavior implements this and
6
+ * is selected by `TARGET_FLAVOR` (Vue, Angular, Solid, TypeScript, React all
7
+ * ship one under `hmr/frameworks/<flavor>/client/`).
8
+ *
9
+ * All members are optional except `install`. A missing hook means "use the
10
+ * shared default".
11
+ *
12
+ * Keeping this file free of any framework import is deliberate: it lets the
13
+ * shared client depend only on the contract, so the concrete per-flavor module
14
+ * can later be loaded through a single dynamic `import()` (the device-bundle
15
+ * win) without the shared client statically pulling in every framework client.
16
+ */
17
+ export {};
18
+ //# sourceMappingURL=framework-client-strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-client-strategy.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/framework-client-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * `@nativescript/vite/hmr/client/framework.js` — the device-side surface a
3
+ * framework's client strategy is written against.
4
+ *
5
+ * A registered flavor's client module is served to the device through
6
+ * `/ns/m` and evaluates in the same realm as the shared HMR client. It must
7
+ * reach the client's singletons — the module graph mirror, the hot registry,
8
+ * the overlay — through this one module, so that both resolve to the same
9
+ * canonical URLs and therefore the same instances. Importing the client's
10
+ * internal files by path is not supported.
11
+ */
12
+ export type { FrameworkClientStrategy, FrameworkClientBatchContext, FrameworkClientMessageContext, FrameworkClientMountContext, ClientGraphModule } from './framework-client-strategy.js';
13
+ export type { NsHotRegistry, NsHotContext } from './hot-context.js';
14
+ /** The process-wide `import.meta.hot` registry: accept/dispose callbacks, dependency acceptors, `hot.data`, events, full reload. */
15
+ export { getNsHotRegistry } from './hot-context.js';
16
+ /** Live mirror of the server's module graph (id → { deps, hash }). */
17
+ export { graph, getGraphVersion } from './utils.js';
18
+ /** Canonical-URL helpers and the evict + re-import primitives the shared queue uses. */
19
+ export { normalizeSpec, requestModuleFromServer, invalidateModulesByUrls, buildEvictionUrls, resolveHmrHttpOrigin, safeDynImport } from './utils.js';
20
+ /** `@nativescript/core` export lookup that resolves against the live core realm. */
21
+ export { getCore } from './utils.js';
22
+ export { ENV_VERBOSE } from './utils.js';
23
+ /** Drive the on-device "HMR update" overlay: 'received' | 'evicting' | 'reimporting' | 'rebooting' | 'complete'. */
24
+ export { setUpdateStage, getOverlayApi } from './overlay-driver.js';
25
+ export type { HmrUpdateOverlayStage } from './overlay-driver.js';
26
+ /** Swap the live root view for a freshly loaded component (the reset path). */
27
+ export { performResetRoot } from './root-reset.js';
28
+ export { getGlobalScope } from '../shared/runtime/global-scope.js';
29
+ /** The `ns:module` builtin as the runtime exposes it (`invalidateModules`, `getLoadedModuleUrls`, …); `{}` off-device. */
30
+ export { readNsRuntimeDevHostApi } from '../shared/runtime/browser-runtime-contract.js';
31
+ export type { NsRuntimeDevHostApi } from '../shared/runtime/browser-runtime-contract.js';
@@ -0,0 +1,17 @@
1
+ /** The process-wide `import.meta.hot` registry: accept/dispose callbacks, dependency acceptors, `hot.data`, events, full reload. */
2
+ export { getNsHotRegistry } from './hot-context.js';
3
+ /** Live mirror of the server's module graph (id → { deps, hash }). */
4
+ export { graph, getGraphVersion } from './utils.js';
5
+ /** Canonical-URL helpers and the evict + re-import primitives the shared queue uses. */
6
+ export { normalizeSpec, requestModuleFromServer, invalidateModulesByUrls, buildEvictionUrls, resolveHmrHttpOrigin, safeDynImport } from './utils.js';
7
+ /** `@nativescript/core` export lookup that resolves against the live core realm. */
8
+ export { getCore } from './utils.js';
9
+ export { ENV_VERBOSE } from './utils.js';
10
+ /** Drive the on-device "HMR update" overlay: 'received' | 'evicting' | 'reimporting' | 'rebooting' | 'complete'. */
11
+ export { setUpdateStage, getOverlayApi } from './overlay-driver.js';
12
+ /** Swap the live root view for a freshly loaded component (the reset path). */
13
+ export { performResetRoot } from './root-reset.js';
14
+ export { getGlobalScope } from '../shared/runtime/global-scope.js';
15
+ /** The `ns:module` builtin as the runtime exposes it (`invalidateModules`, `getLoadedModuleUrls`, …); `{}` off-device. */
16
+ export { readNsRuntimeDevHostApi } from '../shared/runtime/browser-runtime-contract.js';
17
+ //# sourceMappingURL=framework.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/framework.ts"],"names":[],"mappings":"AAcA,oIAAoI;AACpI,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,sEAAsE;AACtE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACpD,wFAAwF;AACxF,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrJ,oFAAoF;AACpF,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,oHAAoH;AACpH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpE,+EAA+E;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,0HAA0H;AAC1H,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC"}
@@ -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,89 @@
1
+ /**
2
+ * JS-owned `import.meta.hot` implementation (Vite-style injected hot contexts).
3
+ *
4
+ * `import.meta.hot` is HMR *policy* and lives entirely in this package — the
5
+ * native runtimes expose no hot API. The dev server injects
6
+ *
7
+ * import.meta.hot = globalThis.__NS_HOT_REGISTRY__?.createHotContext('<canonical-id>')
8
+ *
9
+ * at the top of every served app module (see `processCodeForDevice`), and this
10
+ * module owns every registry the hot API needs. The registry is installed on
11
+ * `globalThis.__NS_HOT_REGISTRY__` by `installNsHotRegistry()`, which the
12
+ * `/__ns_dev__/client` bootstrap runs before the entry graph evaluates.
13
+ *
14
+ * Process-wide singleton: state is stashed on globalThis so that a second
15
+ * copy of this module (e.g. loaded under a different URL) shares the same
16
+ * registries instead of splitting them.
17
+ *
18
+ * No circulars — don't import from other hmr/client/* modules here.
19
+ */
20
+ export interface NsHotEventPayload {
21
+ [key: string]: unknown;
22
+ }
23
+ type HotCallback = (...args: unknown[]) => unknown;
24
+ export interface NsHotRegistry {
25
+ createHotContext(ownerId: string): NsHotContext;
26
+ canonicalHotKey(id: string): string;
27
+ /** Drain `hot.dispose(cb)` callbacks (all modules, or a key subset). Returns count executed. */
28
+ runDispose(keys?: readonly string[]): number;
29
+ /** Drain `hot.prune(cb)` callbacks (all modules, or a key subset). Returns count executed. */
30
+ runPrune(keys?: readonly string[]): number;
31
+ /** True when any module (or any module in the key subset) called `hot.decline()`. */
32
+ hasDeclined(keys?: readonly string[]): boolean;
33
+ /**
34
+ * Accept callbacks registered by `key`'s CURRENT evaluation (a copy; an
35
+ * argument-less `hot.accept()` contributes a no-op). They belong to the
36
+ * module instance being replaced, so a framework strategy must read them
37
+ * BEFORE eviction — `createHotContext` resets them the moment the fresh body
38
+ * evaluates — and invoke them with the fresh namespace afterwards (Vite's
39
+ * accept contract). A non-empty result is what makes a module a
40
+ * self-accepting HMR boundary.
41
+ */
42
+ getAcceptCallbacks(key: string): HotCallback[];
43
+ /**
44
+ * Modules whose CURRENT evaluation accepts updates to `depKey` through the
45
+ * dependency form of `hot.accept`. Each callback takes the array Vite
46
+ * passes (`[freshNamespace]`, `[undefined]` when the dependency does not
47
+ * evaluate in this realm). Same lifetime rule as `getAcceptCallbacks`.
48
+ */
49
+ getDepAcceptors(depKey: string): Array<{
50
+ owner: string;
51
+ callback: HotCallback;
52
+ }>;
53
+ /** True when `ownerKey`'s current evaluation accepts `depKey` via the dependency form. */
54
+ acceptsDep(ownerKey: string, depKey: string): boolean;
55
+ /** Fire `hot.on(event, cb)` listeners. Returns the number of listeners invoked. */
56
+ dispatchHotEvent(event: string, payload?: unknown): number;
57
+ listHotEventListeners(): Record<string, number>;
58
+ /** Wire `hot.send(...)` to the active WebSocket (installed by the full client). */
59
+ setSendToServer(fn: ((event: string, data?: unknown) => void) | null): void;
60
+ /** Override the full-reload behavior (`hot.invalidate()`, declined modules). */
61
+ setFullReloadHandler(fn: ((message?: string) => void) | null): void;
62
+ requestFullReload(message?: string): void;
63
+ }
64
+ export interface NsHotContext {
65
+ readonly data: Record<string, unknown>;
66
+ accept(...args: unknown[]): void;
67
+ acceptExports(exportNames: string[], cb?: HotCallback): void;
68
+ dispose(cb: HotCallback): void;
69
+ prune(cb: HotCallback): void;
70
+ decline(): void;
71
+ invalidate(message?: string): void;
72
+ on(event: string, cb: HotCallback): void;
73
+ off(event: string, cb: HotCallback): void;
74
+ send(event: string, data?: unknown): void;
75
+ }
76
+ declare global {
77
+ var __NS_HOT_REGISTRY__: NsHotRegistry | undefined;
78
+ var __NS_DEV_ENTRY_URL__: string | undefined;
79
+ }
80
+ /**
81
+ * Install (or return the already-installed) process-wide hot registry.
82
+ * Idempotent — safe to call from the bootstrap client, the full client and
83
+ * tests; the first installation wins.
84
+ */
85
+ export declare function installNsHotRegistry(): NsHotRegistry;
86
+ /** Read the installed registry (installing lazily so callers never race). */
87
+ export declare function getNsHotRegistry(): NsHotRegistry;
88
+ export declare function createHotContext(ownerId: string): NsHotContext;
89
+ export {};