@nativescript/vite 8.0.0-alpha.3 → 8.0.0-alpha.31

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 (356) hide show
  1. package/README.md +51 -11
  2. package/configuration/angular.d.ts +34 -1
  3. package/configuration/angular.js +373 -163
  4. package/configuration/angular.js.map +1 -1
  5. package/configuration/base.js +184 -14
  6. package/configuration/base.js.map +1 -1
  7. package/configuration/javascript.js +5 -72
  8. package/configuration/javascript.js.map +1 -1
  9. package/configuration/solid.js +27 -1
  10. package/configuration/solid.js.map +1 -1
  11. package/configuration/typescript.js +5 -75
  12. package/configuration/typescript.js.map +1 -1
  13. package/helpers/app-components.d.ts +2 -1
  14. package/helpers/app-components.js.map +1 -1
  15. package/helpers/app-css-state.d.ts +8 -0
  16. package/helpers/app-css-state.js +8 -0
  17. package/helpers/app-css-state.js.map +1 -0
  18. package/helpers/bundler-context.d.ts +11 -0
  19. package/helpers/bundler-context.js +71 -0
  20. package/helpers/bundler-context.js.map +1 -0
  21. package/helpers/config-as-json.js +10 -0
  22. package/helpers/config-as-json.js.map +1 -1
  23. package/helpers/dev-host.d.ts +341 -0
  24. package/helpers/dev-host.js +617 -0
  25. package/helpers/dev-host.js.map +1 -0
  26. package/helpers/esbuild-platform-resolver.js +4 -1
  27. package/helpers/esbuild-platform-resolver.js.map +1 -1
  28. package/helpers/global-defines.d.ts +51 -0
  29. package/helpers/global-defines.js +77 -0
  30. package/helpers/global-defines.js.map +1 -1
  31. package/helpers/hmr-scope.d.ts +26 -0
  32. package/helpers/hmr-scope.js +67 -0
  33. package/helpers/hmr-scope.js.map +1 -0
  34. package/helpers/init.js +0 -18
  35. package/helpers/init.js.map +1 -1
  36. package/helpers/logging.d.ts +1 -0
  37. package/helpers/logging.js +63 -3
  38. package/helpers/logging.js.map +1 -1
  39. package/helpers/main-entry.d.ts +2 -1
  40. package/helpers/main-entry.js +430 -47
  41. package/helpers/main-entry.js.map +1 -1
  42. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  43. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  44. package/helpers/nativeclass-transform.js.map +1 -1
  45. package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
  46. package/helpers/nativeclass-transformer-plugin.js +157 -14
  47. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  48. package/helpers/nativescript-package-resolver.js +8 -3
  49. package/helpers/nativescript-package-resolver.js.map +1 -1
  50. package/helpers/normalize-id.d.ts +42 -0
  51. package/helpers/normalize-id.js +60 -0
  52. package/helpers/normalize-id.js.map +1 -0
  53. package/helpers/ns-core-url.d.ts +88 -0
  54. package/helpers/ns-core-url.js +191 -0
  55. package/helpers/ns-core-url.js.map +1 -0
  56. package/helpers/package-platform-aliases.js +4 -3
  57. package/helpers/package-platform-aliases.js.map +1 -1
  58. package/helpers/platform-types.d.ts +2 -0
  59. package/helpers/platform-types.js +2 -0
  60. package/helpers/platform-types.js.map +1 -0
  61. package/helpers/project.d.ts +35 -0
  62. package/helpers/project.js +120 -2
  63. package/helpers/project.js.map +1 -1
  64. package/helpers/resolver.js +17 -2
  65. package/helpers/resolver.js.map +1 -1
  66. package/helpers/ts-config-paths.d.ts +14 -0
  67. package/helpers/ts-config-paths.js +89 -8
  68. package/helpers/ts-config-paths.js.map +1 -1
  69. package/helpers/typescript-check.d.ts +2 -1
  70. package/helpers/typescript-check.js.map +1 -1
  71. package/helpers/workers.d.ts +20 -19
  72. package/helpers/workers.js +624 -4
  73. package/helpers/workers.js.map +1 -1
  74. package/hmr/client/css-handler.d.ts +1 -0
  75. package/hmr/client/css-handler.js +33 -20
  76. package/hmr/client/css-handler.js.map +1 -1
  77. package/hmr/client/css-update-overlay.d.ts +18 -0
  78. package/hmr/client/css-update-overlay.js +27 -0
  79. package/hmr/client/css-update-overlay.js.map +1 -0
  80. package/hmr/client/framework-client-strategy.d.ts +73 -0
  81. package/hmr/client/framework-client-strategy.js +19 -0
  82. package/hmr/client/framework-client-strategy.js.map +1 -0
  83. package/hmr/client/hmr-pending-overlay.d.ts +27 -0
  84. package/hmr/client/hmr-pending-overlay.js +50 -0
  85. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  86. package/hmr/client/index.js +459 -164
  87. package/hmr/client/index.js.map +1 -1
  88. package/hmr/client/utils.d.ts +6 -1
  89. package/hmr/client/utils.js +184 -8
  90. package/hmr/client/utils.js.map +1 -1
  91. package/hmr/entry-runtime.d.ts +2 -1
  92. package/hmr/entry-runtime.js +252 -65
  93. package/hmr/entry-runtime.js.map +1 -1
  94. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  95. package/hmr/frameworks/angular/build/angular-linker.js +109 -0
  96. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  97. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  98. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  99. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  100. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  101. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  102. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  103. package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
  104. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  105. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  106. package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
  107. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  108. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  109. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  110. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  111. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  112. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  113. package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
  114. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  115. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  116. package/hmr/frameworks/angular/build/util.js +155 -0
  117. package/hmr/frameworks/angular/build/util.js.map +1 -0
  118. package/hmr/frameworks/angular/client/index.d.ts +1 -0
  119. package/hmr/frameworks/angular/client/index.js +778 -20
  120. package/hmr/frameworks/angular/client/index.js.map +1 -1
  121. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  122. package/hmr/frameworks/angular/client/strategy.js +19 -0
  123. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  124. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  125. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  126. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  127. package/hmr/frameworks/angular/server/linker.js +1 -4
  128. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  129. package/hmr/frameworks/angular/server/strategy.js +448 -12
  130. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  131. package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
  132. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  133. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +17 -11
  134. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +336 -0
  135. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  136. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  137. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  138. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  139. package/hmr/frameworks/solid/server/strategy.js +360 -16
  140. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  141. package/hmr/frameworks/typescript/server/strategy.js +28 -14
  142. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  143. package/hmr/frameworks/vue/client/index.js +30 -199
  144. package/hmr/frameworks/vue/client/index.js.map +1 -1
  145. package/hmr/frameworks/vue/client/strategy.d.ts +7 -0
  146. package/hmr/frameworks/vue/client/strategy.js +83 -0
  147. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  148. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +82 -0
  149. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +133 -0
  150. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  151. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  152. package/hmr/frameworks/vue/server/sfc-route-assemble.js +706 -0
  153. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  154. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  155. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  156. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  157. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  158. package/hmr/frameworks/vue/server/sfc-route-serve.js +457 -0
  159. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  160. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +19 -0
  161. package/hmr/frameworks/vue/server/sfc-route-shared.js +14 -0
  162. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  163. package/hmr/frameworks/vue/server/strategy.js +244 -0
  164. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  165. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  166. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  167. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  168. package/hmr/helpers/ast-normalizer.js +52 -5
  169. package/hmr/helpers/ast-normalizer.js.map +1 -1
  170. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  171. package/hmr/helpers/cjs-named-exports.js +152 -0
  172. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  173. package/hmr/helpers/package-exports.d.ts +16 -0
  174. package/hmr/helpers/package-exports.js +396 -0
  175. package/hmr/helpers/package-exports.js.map +1 -0
  176. package/hmr/server/constants.js +13 -4
  177. package/hmr/server/constants.js.map +1 -1
  178. package/hmr/server/core-sanitize.d.ts +90 -7
  179. package/hmr/server/core-sanitize.js +211 -56
  180. package/hmr/server/core-sanitize.js.map +1 -1
  181. package/hmr/server/device-transform-helpers.d.ts +24 -0
  182. package/hmr/server/device-transform-helpers.js +327 -0
  183. package/hmr/server/device-transform-helpers.js.map +1 -0
  184. package/hmr/server/framework-strategy.d.ts +95 -11
  185. package/hmr/server/hmr-module-graph.d.ts +37 -0
  186. package/hmr/server/hmr-module-graph.js +214 -0
  187. package/hmr/server/hmr-module-graph.js.map +1 -0
  188. package/hmr/server/import-map.d.ts +11 -2
  189. package/hmr/server/import-map.js +59 -40
  190. package/hmr/server/import-map.js.map +1 -1
  191. package/hmr/server/index.js +7 -16
  192. package/hmr/server/index.js.map +1 -1
  193. package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
  194. package/hmr/server/ns-core-cjs-shape.js +271 -0
  195. package/hmr/server/ns-core-cjs-shape.js.map +1 -0
  196. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  197. package/hmr/server/ns-rt-bridge.js +131 -0
  198. package/hmr/server/ns-rt-bridge.js.map +1 -0
  199. package/hmr/server/ns-rt-route.d.ts +5 -0
  200. package/hmr/server/ns-rt-route.js +35 -0
  201. package/hmr/server/ns-rt-route.js.map +1 -0
  202. package/hmr/server/perf-instrumentation.d.ts +114 -0
  203. package/hmr/server/perf-instrumentation.js +195 -0
  204. package/hmr/server/perf-instrumentation.js.map +1 -0
  205. package/hmr/server/process-code-for-device.d.ts +15 -0
  206. package/hmr/server/process-code-for-device.js +654 -0
  207. package/hmr/server/process-code-for-device.js.map +1 -0
  208. package/hmr/server/require-guard.d.ts +1 -0
  209. package/hmr/server/require-guard.js +12 -0
  210. package/hmr/server/require-guard.js.map +1 -0
  211. package/hmr/server/rewrite-imports.d.ts +2 -0
  212. package/hmr/server/rewrite-imports.js +604 -0
  213. package/hmr/server/rewrite-imports.js.map +1 -0
  214. package/hmr/server/route-helpers.d.ts +7 -0
  215. package/hmr/server/route-helpers.js +13 -0
  216. package/hmr/server/route-helpers.js.map +1 -0
  217. package/hmr/server/server-origin.d.ts +12 -0
  218. package/hmr/server/server-origin.js +66 -0
  219. package/hmr/server/server-origin.js.map +1 -0
  220. package/hmr/server/shared-transform-request.js +12 -5
  221. package/hmr/server/shared-transform-request.js.map +1 -1
  222. package/hmr/server/transform-cache-invalidation.d.ts +11 -0
  223. package/hmr/server/transform-cache-invalidation.js +84 -0
  224. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  225. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  226. package/hmr/server/vendor-bare-module-shims.js +80 -0
  227. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  228. package/hmr/server/vite-plugin.js +60 -42
  229. package/hmr/server/vite-plugin.js.map +1 -1
  230. package/hmr/server/websocket-core-bridge.d.ts +41 -6
  231. package/hmr/server/websocket-core-bridge.js +72 -75
  232. package/hmr/server/websocket-core-bridge.js.map +1 -1
  233. package/hmr/server/websocket-css-hot-update.d.ts +33 -0
  234. package/hmr/server/websocket-css-hot-update.js +65 -0
  235. package/hmr/server/websocket-css-hot-update.js.map +1 -0
  236. package/hmr/server/websocket-device-transform.d.ts +3 -0
  237. package/hmr/server/websocket-device-transform.js +7 -0
  238. package/hmr/server/websocket-device-transform.js.map +1 -0
  239. package/hmr/server/websocket-graph-upsert.d.ts +15 -0
  240. package/hmr/server/websocket-graph-upsert.js +20 -0
  241. package/hmr/server/websocket-graph-upsert.js.map +1 -1
  242. package/hmr/server/websocket-hmr-pending.d.ts +37 -0
  243. package/hmr/server/websocket-hmr-pending.js +55 -0
  244. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  245. package/hmr/server/websocket-hot-update.d.ts +77 -0
  246. package/hmr/server/websocket-hot-update.js +330 -0
  247. package/hmr/server/websocket-hot-update.js.map +1 -0
  248. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  249. package/hmr/server/websocket-import-map-route.js +46 -0
  250. package/hmr/server/websocket-import-map-route.js.map +1 -0
  251. package/hmr/server/websocket-module-bindings.js +3 -3
  252. package/hmr/server/websocket-module-bindings.js.map +1 -1
  253. package/hmr/server/websocket-module-specifiers.d.ts +66 -2
  254. package/hmr/server/websocket-module-specifiers.js +202 -19
  255. package/hmr/server/websocket-module-specifiers.js.map +1 -1
  256. package/hmr/server/websocket-ns-core.d.ts +21 -0
  257. package/hmr/server/websocket-ns-core.js +306 -0
  258. package/hmr/server/websocket-ns-core.js.map +1 -0
  259. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  260. package/hmr/server/websocket-ns-entry.js +150 -0
  261. package/hmr/server/websocket-ns-entry.js.map +1 -0
  262. package/hmr/server/websocket-ns-m-paths.d.ts +3 -0
  263. package/hmr/server/websocket-ns-m-paths.js +92 -0
  264. package/hmr/server/websocket-ns-m-paths.js.map +1 -0
  265. package/hmr/server/websocket-ns-m-request.d.ts +45 -0
  266. package/hmr/server/websocket-ns-m-request.js +196 -0
  267. package/hmr/server/websocket-ns-m-request.js.map +1 -0
  268. package/hmr/server/websocket-ns-m.d.ts +33 -0
  269. package/hmr/server/websocket-ns-m.js +748 -0
  270. package/hmr/server/websocket-ns-m.js.map +1 -0
  271. package/hmr/server/websocket-served-module-helpers.d.ts +39 -0
  272. package/hmr/server/websocket-served-module-helpers.js +654 -0
  273. package/hmr/server/websocket-served-module-helpers.js.map +1 -0
  274. package/hmr/server/websocket-txn.d.ts +6 -0
  275. package/hmr/server/websocket-txn.js +39 -0
  276. package/hmr/server/websocket-txn.js.map +1 -0
  277. package/hmr/server/websocket-vendor-unifier.d.ts +9 -0
  278. package/hmr/server/websocket-vendor-unifier.js +46 -0
  279. package/hmr/server/websocket-vendor-unifier.js.map +1 -0
  280. package/hmr/server/websocket.d.ts +8 -39
  281. package/hmr/server/websocket.js +602 -6049
  282. package/hmr/server/websocket.js.map +1 -1
  283. package/hmr/shared/ns-globals.d.ts +118 -0
  284. package/hmr/shared/ns-globals.js +27 -0
  285. package/hmr/shared/ns-globals.js.map +1 -0
  286. package/hmr/shared/protocol.d.ts +136 -0
  287. package/hmr/shared/protocol.js +28 -0
  288. package/hmr/shared/protocol.js.map +1 -0
  289. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  290. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  291. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  292. package/hmr/shared/runtime/boot-progress.d.ts +40 -0
  293. package/hmr/shared/runtime/boot-progress.js +128 -0
  294. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  295. package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
  296. package/hmr/shared/runtime/boot-timeline.js +52 -0
  297. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  298. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  299. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  300. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  301. package/hmr/shared/runtime/dev-overlay.d.ts +75 -26
  302. package/hmr/shared/runtime/dev-overlay.js +990 -260
  303. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  304. package/hmr/shared/runtime/module-provenance.js +1 -4
  305. package/hmr/shared/runtime/module-provenance.js.map +1 -1
  306. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  307. package/hmr/shared/runtime/root-placeholder-view.js +310 -0
  308. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  309. package/hmr/shared/runtime/root-placeholder.js +352 -194
  310. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  311. package/hmr/shared/runtime/session-bootstrap.js +164 -1
  312. package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
  313. package/hmr/shared/runtime/vendor-bootstrap.js +1 -9
  314. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  315. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  316. package/hmr/shared/vendor/manifest-collect.js +512 -0
  317. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  318. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  319. package/hmr/shared/vendor/manifest-loader.js +3 -2
  320. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  321. package/hmr/shared/vendor/manifest.d.ts +1 -7
  322. package/hmr/shared/vendor/manifest.js +102 -741
  323. package/hmr/shared/vendor/manifest.js.map +1 -1
  324. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  325. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  326. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  327. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +16 -0
  328. package/hmr/shared/vendor/vendor-esbuild-plugins.js +203 -0
  329. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  330. package/index.d.ts +1 -0
  331. package/index.js +5 -0
  332. package/index.js.map +1 -1
  333. package/package.json +55 -11
  334. package/runtime/core-aliases-early.js +17 -41
  335. package/runtime/core-aliases-early.js.map +1 -1
  336. package/helpers/angular/angular-linker.d.ts +0 -13
  337. package/helpers/angular/angular-linker.js +0 -194
  338. package/helpers/angular/angular-linker.js.map +0 -1
  339. package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
  340. package/helpers/angular/shared-linker.d.ts +0 -11
  341. package/helpers/angular/shared-linker.js +0 -75
  342. package/helpers/angular/shared-linker.js.map +0 -1
  343. package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
  344. package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
  345. package/helpers/angular/util.js +0 -67
  346. package/helpers/angular/util.js.map +0 -1
  347. package/helpers/prelink-angular.d.ts +0 -2
  348. package/helpers/prelink-angular.js +0 -117
  349. package/helpers/prelink-angular.js.map +0 -1
  350. package/hmr/server/websocket-angular-entry.js.map +0 -1
  351. package/hmr/server/websocket-angular-hot-update.js +0 -239
  352. package/hmr/server/websocket-angular-hot-update.js.map +0 -1
  353. /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
  354. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
  355. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
  356. /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Ambient typings for the `__NS_*` / `__ns*` globals the HMR runtime stashes on
3
+ * `globalThis`. One `declare global` here replaces the scattered
4
+ * `(globalThis as any).__NS_X` casts across the device client + entry runtime:
5
+ * consumers read/write `globalThis.__NS_X` directly and get a real type, and the
6
+ * per-file `declare const __NS_X__` duplicates collapse to this single source of
7
+ * truth.
8
+ *
9
+ * Conventions:
10
+ * - Every key is `var … | undefined` — `var` (not `const`/`let`) is what adds the
11
+ * property to `typeof globalThis`, so both bare references (Vite `define`
12
+ * substitutions like `__NS_ENV_VERBOSE__`) and `globalThis.__NS_X` access
13
+ * type-check; `| undefined` reflects that these are populated lazily at runtime.
14
+ * - Primitive flags/counters/urls get precise types. Keys holding framework
15
+ * instances, native objects, ASTs, module registries, or arbitrary diagnostic
16
+ * payloads are intentionally `any` — typing them precisely would couple this
17
+ * shared file to device internals and risk breaking write sites elsewhere in
18
+ * the package.
19
+ * - The runtime-config API keys (`__nsConfigureRuntime`, `__nsInvalidateModules`,
20
+ * `__nsReloadDevApp`, …) are deliberately NOT declared here; they are owned by
21
+ * `hmr/shared/runtime/browser-runtime-contract.ts`.
22
+ *
23
+ * This module emits no runtime code (ambient declaration only) and is picked up
24
+ * project-wide via the package tsconfig include (all .ts files).
25
+ */
26
+ declare global {
27
+ var __NS_APP_ROOT_VIRTUAL__: string | undefined;
28
+ var __NS_ENV_VERBOSE__: boolean | undefined;
29
+ var __NS_TARGET_FLAVOR__: string | undefined;
30
+ var __NS_HMR_PROGRESS_OVERLAY_ENABLED__: boolean | undefined;
31
+ var __NS_HMR_KICKSTART_MAX_URLS__: number | undefined;
32
+ var __NS_HMR_BOOT_COMPLETE__: boolean | undefined;
33
+ var __NS_HMR_HTTP_APP_CSS_APPLIED__: boolean | undefined;
34
+ var __NS_IMPORT_MAP_CONFIGURED__: boolean | undefined;
35
+ var __NS_ENTRY_OK__: boolean | undefined;
36
+ var __NS_DEV_RESET_IN_PROGRESS__: boolean | undefined;
37
+ var __NS_ANGULAR_HMR_CLIENT_INSTALLED__: boolean | undefined;
38
+ var __NS_ANGULAR_HMR_REGISTER_ONLY__: boolean | undefined;
39
+ var __NS_HMR_CLIENT_ACTIVE__: boolean | undefined;
40
+ var __NS_HMR_CLIENT_SOCKET_READY__: boolean | undefined;
41
+ var __NS_HMR_ALLOW_INITIAL_MOUNT__: boolean | undefined;
42
+ var __NS_HMR_INITIAL_MOUNT_IN_PROGRESS__: boolean | undefined;
43
+ var __NS_HMR_RESCUE_SCHEDULED__: boolean | undefined;
44
+ var __NS_HMR_BACK_WRAPPED__: boolean | undefined;
45
+ var __NS_HMR_DISABLE_ASM__: boolean | undefined;
46
+ var __NS_HMR_ASM_DIAG__: boolean | undefined;
47
+ var __NS_HMR_BOOT_MAIN_URL__: string | undefined;
48
+ var __NS_HMR_BOOT_MAIN_ATTEMPT__: number | undefined;
49
+ var __NS_HMR_BOOT_MAIN_ATTEMPTS__: number | undefined;
50
+ var __NS_HMR_BOOT_MODULE_COUNT__: number | undefined;
51
+ var __NS_HMR_BOOT_LAST_MODULE__: string | undefined;
52
+ var __NS_HMR_BOOT_LAST_PROGRESS__: number | undefined;
53
+ var __NS_HMR_BOOT_LAST_PROGRESS_AT__: number | undefined;
54
+ var __NS_HMR_BOOT_IMPORT_STARTED_AT__: number | undefined;
55
+ var __NS_HTTP_ORIGIN__: string | undefined;
56
+ var __NS_ENTRY_LAST_TARGET__: string | undefined;
57
+ var __NS_HMR_HOST: string | undefined;
58
+ var __NS_HMR_REALM__: string | undefined;
59
+ var __NS_RT_REALM__: string | undefined;
60
+ var __NS_HMR_BROWSER_RUNTIME_TARGET_FLAVOR__: string | undefined;
61
+ var __NS_HMR_GRAPH_VERSION__: number | undefined;
62
+ var __NS_HMR_IMPORT_NONCE__: number | undefined;
63
+ var __NS_HMR_APPLY_CSS__: ((cssText: string, refreshRoot?: boolean) => void) | undefined;
64
+ var __NS_HMR_APP_CSS__: string | undefined;
65
+ var __NS_HMR_APP_CSS_AST__: any;
66
+ var __NS_DISPATCH_HOT_EVENT__: ((event: string, payload?: unknown) => void) | undefined;
67
+ var __NS_HMR_IMPORT__: ((url: string) => Promise<unknown>) | undefined;
68
+ var __NS_HMR_ON_UPDATE__: ((payload: {
69
+ type: 'full-graph' | 'delta';
70
+ version: number;
71
+ changedIds: string[];
72
+ raw: any;
73
+ }) => void) | undefined;
74
+ var __NS_HMR_ON_NAVIGATE_BACK: (() => void) | undefined;
75
+ var __NS_DEV_RESTORE_PLACEHOLDER__: ((reason?: string) => void) | undefined;
76
+ var __nsAttemptBackRemount: (() => unknown) | undefined;
77
+ var __nsHmrRequestModule: ((spec: string) => Promise<string>) | undefined;
78
+ var __nsGetModuleExports: ((id: string) => any) | undefined;
79
+ var __nsKickstartHmrPrefetch: ((urls: string[], opts?: {
80
+ maxConcurrent: number;
81
+ timeoutMs: number;
82
+ }) => {
83
+ ok: boolean;
84
+ fetched: number;
85
+ ms: number;
86
+ } | null) | undefined;
87
+ var __ns_solid_hmr_subscribe: ((fn: (ev: {
88
+ kind: 'solid';
89
+ changedFiles: string[];
90
+ boundaries: string[];
91
+ }) => void) => () => void) | undefined;
92
+ var __NS_HMR_DEV_OVERLAY__: any;
93
+ var __NS_ENTRY_TRACE__: any;
94
+ var __NS_ENTRY_ERROR__: any;
95
+ var __NS_DEV_ORIGINAL_APP_RUN__: any;
96
+ var __NS_DEV_PLACEHOLDER_APPLICATION__: any;
97
+ var __NS_DEV_PLACEHOLDER_ROOT_VIEW__: any;
98
+ var __NS_DEV_PLACEHOLDER_ROOT_EARLY__: any;
99
+ var __NS_HMR_PINIA__: any;
100
+ var __NS_PINIA_SYMBOL__: symbol | undefined;
101
+ var __NS_VUE_APP__: any;
102
+ var __NS_HMR_CREATE_APP__: any;
103
+ var __NS_HMR_INSTALL_PLUGINS__: any;
104
+ var __NS_HMR_ORIG_ROOT_COMPONENT__: any;
105
+ var __NS_HMR_VUE_SFC_REGISTRY__: any;
106
+ var __NS_HMR_WORKERS__: any;
107
+ var __NS_UPDATE_ANGULAR_APP_OPTIONS__: any;
108
+ var __nsNavigateUsingApp: any;
109
+ var __nsHasDeclinedModule: any;
110
+ var __nsRunHmrDispose: any;
111
+ var __nsTerminateAllWorkers: any;
112
+ var __nsRequire: any;
113
+ var __nsVendorRequire: any;
114
+ var __nsVendorRegistry: any;
115
+ var __ns_router: any;
116
+ var __ns_solid_hmr_listener_set: any;
117
+ }
118
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Ambient typings for the `__NS_*` / `__ns*` globals the HMR runtime stashes on
3
+ * `globalThis`. One `declare global` here replaces the scattered
4
+ * `(globalThis as any).__NS_X` casts across the device client + entry runtime:
5
+ * consumers read/write `globalThis.__NS_X` directly and get a real type, and the
6
+ * per-file `declare const __NS_X__` duplicates collapse to this single source of
7
+ * truth.
8
+ *
9
+ * Conventions:
10
+ * - Every key is `var … | undefined` — `var` (not `const`/`let`) is what adds the
11
+ * property to `typeof globalThis`, so both bare references (Vite `define`
12
+ * substitutions like `__NS_ENV_VERBOSE__`) and `globalThis.__NS_X` access
13
+ * type-check; `| undefined` reflects that these are populated lazily at runtime.
14
+ * - Primitive flags/counters/urls get precise types. Keys holding framework
15
+ * instances, native objects, ASTs, module registries, or arbitrary diagnostic
16
+ * payloads are intentionally `any` — typing them precisely would couple this
17
+ * shared file to device internals and risk breaking write sites elsewhere in
18
+ * the package.
19
+ * - The runtime-config API keys (`__nsConfigureRuntime`, `__nsInvalidateModules`,
20
+ * `__nsReloadDevApp`, …) are deliberately NOT declared here; they are owned by
21
+ * `hmr/shared/runtime/browser-runtime-contract.ts`.
22
+ *
23
+ * This module emits no runtime code (ambient declaration only) and is picked up
24
+ * project-wide via the package tsconfig include (all .ts files).
25
+ */
26
+ export {};
27
+ //# sourceMappingURL=ns-globals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ns-globals.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/shared/ns-globals.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA4FH,OAAO,EAAE,CAAC"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Wire protocol for the `ns:*` HMR messages exchanged over the dev-server
3
+ * WebSocket between the Vite dev server and the on-device client.
4
+ *
5
+ * This is the single source of truth for message shapes. Server emit sites
6
+ * annotate their payload objects with the matching interface here, so a field
7
+ * rename or type drift becomes a compile error at the emit site instead of a
8
+ * silent runtime mismatch the device only discovers at parse time. The client
9
+ * dispatch (`switch (msg.type)`) consumes the `ServerToClientMessage` union and
10
+ * uses {@link assertNeverNsMessage} for exhaustiveness.
11
+ *
12
+ * Pure types + one pure helper only — this module is in `hmr/shared` and must
13
+ * not import from `hmr/server` or `hmr/client`.
14
+ *
15
+ * Direction is encoded by the two unions:
16
+ * - {@link ServerToClientMessage} — dev server → device (9 messages)
17
+ * - {@link ClientToServerMessage} — device → dev server (2 messages)
18
+ */
19
+ /** Module entry as carried inside the graph payloads (`ns:hmr-full-graph`, `ns:hmr-delta`). */
20
+ export interface GraphModulePayload {
21
+ id: string;
22
+ deps: string[];
23
+ hash: string;
24
+ }
25
+ /** A single CSS update item nested inside an `ns:css-updates` batch. */
26
+ export interface CssUpdateItem {
27
+ type: 'css-update';
28
+ path: string;
29
+ acceptedPath: string;
30
+ timestamp: number;
31
+ }
32
+ /** A single Vue SFC registry entry carried inside `ns:vue-sfc-registry`. */
33
+ export interface VueSfcRegistryEntry {
34
+ path: string;
35
+ fileName: string;
36
+ hmrId: string;
37
+ /** Always empty in HTTP-only mode (artifacts are fetched over HTTP, not pushed over WS). */
38
+ code: string;
39
+ }
40
+ /** Classified kind of a pending HMR update (used by `ns:hmr-pending`). */
41
+ export type HmrPendingKind = 'ts' | 'css' | 'html' | 'unknown';
42
+ /** Angular hot-update broadcast: the device evicts `evictPaths` and re-fetches. */
43
+ export interface AngularUpdateMessage {
44
+ type: 'ns:angular-update';
45
+ origin: string;
46
+ path: string;
47
+ version: number;
48
+ timestamp: number;
49
+ evictPaths: string[];
50
+ importerEntry: string;
51
+ /** Legacy fallback the Angular client still reads; not emitted by the current server. */
52
+ entryCandidates?: string[];
53
+ }
54
+ /** Batched CSS hot-update broadcast (direct `.css` saves and Tailwind/PostCSS content edits). */
55
+ export interface CssUpdatesMessage {
56
+ type: 'ns:css-updates';
57
+ origin: string;
58
+ updates: CssUpdateItem[];
59
+ }
60
+ /** Incremental module-graph delta broadcast on every graph mutation. */
61
+ export interface HmrDeltaMessage {
62
+ type: 'ns:hmr-delta';
63
+ baseVersion: number;
64
+ newVersion: number;
65
+ changed: GraphModulePayload[];
66
+ removed: string[];
67
+ }
68
+ /** Full module-graph snapshot sent on connect and in response to `ns:hmr-resync-request`. */
69
+ export interface HmrFullGraphMessage {
70
+ type: 'ns:hmr-full-graph';
71
+ version: number;
72
+ modules: GraphModulePayload[];
73
+ }
74
+ /** Early "change in flight" notification sent at the very start of `handleHotUpdate`. */
75
+ export interface HmrPendingMessage {
76
+ type: 'ns:hmr-pending';
77
+ origin: string;
78
+ path: string;
79
+ kind: HmrPendingKind;
80
+ timestamp: number;
81
+ }
82
+ /**
83
+ * Response to a legacy on-demand module fetch (Option A).
84
+ *
85
+ * No server emit site currently exists — the live module-fetch path resolves
86
+ * HTTP URLs directly — but the client still handles this shape, so it is part
87
+ * of the union for completeness. Shape is inferred from the consumer.
88
+ */
89
+ export interface ModuleResponseMessage {
90
+ type: 'ns:module-response';
91
+ requestId: number;
92
+ error?: string;
93
+ }
94
+ /** TypeScript-flavor module registry primed on connect; coalesced into the graph client-side. */
95
+ export interface TsModuleRegistryMessage {
96
+ type: 'ns:ts-module-registry';
97
+ modules: string[];
98
+ ts: number;
99
+ }
100
+ /** Vue SFC registry sent on connect and in response to `ns:hmr-sfc-registry-request`. */
101
+ export interface VueSfcRegistryMessage {
102
+ type: 'ns:vue-sfc-registry';
103
+ entries: VueSfcRegistryEntry[];
104
+ ts: number;
105
+ }
106
+ /** Mapping-only Vue SFC registry update emitted ahead of the artifact for a changed `.vue` file. */
107
+ export interface VueSfcRegistryUpdateMessage {
108
+ type: 'ns:vue-sfc-registry-update';
109
+ path: string;
110
+ fileName: string;
111
+ ts: number;
112
+ version: number;
113
+ }
114
+ /** Device asks for a fresh full graph when its delta base version drifts from the server's. */
115
+ export interface HmrResyncRequestMessage {
116
+ type: 'ns:hmr-resync-request';
117
+ }
118
+ /** Device asks the server to rebuild and re-broadcast the SFC registry. */
119
+ export interface HmrSfcRegistryRequestMessage {
120
+ type: 'ns:hmr-sfc-registry-request';
121
+ }
122
+ /** Every `ns:*` message the dev server can send to the device. */
123
+ export type ServerToClientMessage = AngularUpdateMessage | CssUpdatesMessage | HmrDeltaMessage | HmrFullGraphMessage | HmrPendingMessage | ModuleResponseMessage | TsModuleRegistryMessage | VueSfcRegistryMessage | VueSfcRegistryUpdateMessage;
124
+ /** Every `ns:*` message the device can send back to the dev server. */
125
+ export type ClientToServerMessage = HmrResyncRequestMessage | HmrSfcRegistryRequestMessage;
126
+ /** Any `ns:*` HMR message, regardless of direction. */
127
+ export type NsHmrMessage = ServerToClientMessage | ClientToServerMessage;
128
+ /** The `type` discriminant of any `ns:*` HMR message. */
129
+ export type NsHmrMessageType = NsHmrMessage['type'];
130
+ /**
131
+ * Exhaustiveness guard for `switch (msg.type)` dispatch over the message unions.
132
+ * Reaching it means a new message type was added to the union but not handled;
133
+ * TypeScript flags the unhandled branch at compile time and this throws if a
134
+ * truly unexpected payload arrives at runtime.
135
+ */
136
+ export declare function assertNeverNsMessage(message: never): never;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Wire protocol for the `ns:*` HMR messages exchanged over the dev-server
3
+ * WebSocket between the Vite dev server and the on-device client.
4
+ *
5
+ * This is the single source of truth for message shapes. Server emit sites
6
+ * annotate their payload objects with the matching interface here, so a field
7
+ * rename or type drift becomes a compile error at the emit site instead of a
8
+ * silent runtime mismatch the device only discovers at parse time. The client
9
+ * dispatch (`switch (msg.type)`) consumes the `ServerToClientMessage` union and
10
+ * uses {@link assertNeverNsMessage} for exhaustiveness.
11
+ *
12
+ * Pure types + one pure helper only — this module is in `hmr/shared` and must
13
+ * not import from `hmr/server` or `hmr/client`.
14
+ *
15
+ * Direction is encoded by the two unions:
16
+ * - {@link ServerToClientMessage} — dev server → device (9 messages)
17
+ * - {@link ClientToServerMessage} — device → dev server (2 messages)
18
+ */
19
+ /**
20
+ * Exhaustiveness guard for `switch (msg.type)` dispatch over the message unions.
21
+ * Reaching it means a new message type was added to the union but not handled;
22
+ * TypeScript flags the unhandled branch at compile time and this throws if a
23
+ * truly unexpected payload arrives at runtime.
24
+ */
25
+ export function assertNeverNsMessage(message) {
26
+ throw new Error(`Unhandled ns:* HMR message: ${JSON.stringify(message)}`);
27
+ }
28
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/shared/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAgJH;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAc;IAClD,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,69 @@
1
+ import type { HmrOverlaySnapshot } from './dev-overlay.js';
2
+ /**
3
+ * Calibrated palette for the boot placeholder card. The card is
4
+ * intentionally light so the small accent (brand badge + progress
5
+ * fill) reads as the only "live" element on the screen.
6
+ *
7
+ * Tones map to the snapshot tone enum from `dev-overlay.ts`:
8
+ * - `info` (default) — calm slate + NS blue
9
+ * - `error` — dusty rose-on-white surface
10
+ */
11
+ export type BootPlaceholderTone = 'info' | 'error';
12
+ export interface BootPlaceholderPalette {
13
+ pageBackground: string;
14
+ cardBackground: string;
15
+ cardShadow: string;
16
+ titleText: string;
17
+ phaseText: string;
18
+ detailText: string;
19
+ progressTrack: string;
20
+ progressFill: string;
21
+ activityIndicator: string;
22
+ }
23
+ /**
24
+ * Resolve the palette for a given tone. Unknown tones fall back to
25
+ * the calm `info` palette
26
+ */
27
+ export declare function getBootPlaceholderPalette(tone?: string | null): BootPlaceholderPalette;
28
+ /**
29
+ * Animation contract for the boot placeholder.
30
+ *
31
+ * `entranceDurationMs` covers the one-shot fade + scale that fires
32
+ * when the placeholder card first attaches to the visual tree.
33
+ * `entranceFromScale` is the starting scale before easeOut to 1.
34
+ *
35
+ * `progressDurationMs` is the per-update fade for the progress fill's
36
+ * `scaleX`. Pegged to 220 ms (just under the heartbeat's 250 ms tick)
37
+ * so consecutive ticks chain into continuous motion rather than
38
+ * waiting on the previous animation to settle.
39
+ *
40
+ * `brandPulseDurationMs` is one half-period of the brand badge's
41
+ * opacity pulse. A full cycle is `brandPulseDurationMs * 2`. Keeping
42
+ * it long (~1.2 s) makes the pulse feel ambient rather than nervous.
43
+ */
44
+ export declare const BOOT_PLACEHOLDER_MOTION: {
45
+ readonly entranceDurationMs: 380;
46
+ readonly entranceFromScale: 0.94;
47
+ readonly progressDurationMs: 220;
48
+ readonly brandPulseDurationMs: 1200;
49
+ readonly brandPulseMinOpacity: 0.55;
50
+ };
51
+ /**
52
+ * Convert a 0–100 progress percentage into an `scaleX` factor that
53
+ * the fill view can animate against. Clamps to [`minScale`, 1] so the
54
+ * fill never collapses to an invisible hairline
55
+ *
56
+ * The default `minScale` of 0.01 keeps the bar visible during the
57
+ * earliest moments of boot when progress is 0
58
+ */
59
+ export declare function computeBootProgressFillScale(progress: number | null | undefined, minScale?: number): number;
60
+ /**
61
+ * The "phase + percent" line we show as the primary status text
62
+ * inside the card
63
+ */
64
+ export declare function formatBootPrimaryLine(snapshot: Pick<HmrOverlaySnapshot, 'phase' | 'progress'> | null | undefined): string;
65
+ /**
66
+ * The secondary detail line (e.g. "Loading the module
67
+ * graph (6259ms)").
68
+ */
69
+ export declare function formatBootDetailLine(snapshot: Pick<HmrOverlaySnapshot, 'detail'> | null | undefined): string;
@@ -0,0 +1,101 @@
1
+ // Pure helpers for the cold-boot placeholder's visual treatment.
2
+ //
3
+ // The visible UI is constructed in `root-placeholder.ts` (an NS view
4
+ // tree attached to `Application` via `launchEvent`), and driven by the
5
+ // dev-overlay via `updateBootStatusLabel`. This file owns the bits
6
+ // that don't need a runtime view tree to make sense — colours,
7
+ // animation timings, the formula that turns a 0–100 progress into the
8
+ // fill bar's `scaleX`, and the split between the "phase + percent"
9
+ // primary line and the secondary detail line.
10
+ //
11
+ const INFO_PALETTE = {
12
+ pageBackground: '#F4F7FB',
13
+ cardBackground: '#FFFFFF',
14
+ cardShadow: '#0F172A',
15
+ titleText: '#0F172A',
16
+ phaseText: '#475569',
17
+ detailText: '#94A3B8',
18
+ progressTrack: '#E2E8F0',
19
+ progressFill: '#3B6FE5',
20
+ activityIndicator: '#3B6FE5',
21
+ };
22
+ const ERROR_PALETTE = {
23
+ pageBackground: '#FFF5F5',
24
+ cardBackground: '#FFFFFF',
25
+ cardShadow: '#7F1D1D',
26
+ titleText: '#7F1D1D',
27
+ phaseText: '#B91C1C',
28
+ detailText: '#DC2626',
29
+ progressTrack: '#FCA5A5',
30
+ progressFill: '#B41810',
31
+ activityIndicator: '#B41810',
32
+ };
33
+ /**
34
+ * Resolve the palette for a given tone. Unknown tones fall back to
35
+ * the calm `info` palette
36
+ */
37
+ export function getBootPlaceholderPalette(tone) {
38
+ if (tone === 'error')
39
+ return ERROR_PALETTE;
40
+ return INFO_PALETTE;
41
+ }
42
+ /**
43
+ * Animation contract for the boot placeholder.
44
+ *
45
+ * `entranceDurationMs` covers the one-shot fade + scale that fires
46
+ * when the placeholder card first attaches to the visual tree.
47
+ * `entranceFromScale` is the starting scale before easeOut to 1.
48
+ *
49
+ * `progressDurationMs` is the per-update fade for the progress fill's
50
+ * `scaleX`. Pegged to 220 ms (just under the heartbeat's 250 ms tick)
51
+ * so consecutive ticks chain into continuous motion rather than
52
+ * waiting on the previous animation to settle.
53
+ *
54
+ * `brandPulseDurationMs` is one half-period of the brand badge's
55
+ * opacity pulse. A full cycle is `brandPulseDurationMs * 2`. Keeping
56
+ * it long (~1.2 s) makes the pulse feel ambient rather than nervous.
57
+ */
58
+ export const BOOT_PLACEHOLDER_MOTION = {
59
+ entranceDurationMs: 380,
60
+ entranceFromScale: 0.94,
61
+ progressDurationMs: 220,
62
+ brandPulseDurationMs: 1200,
63
+ brandPulseMinOpacity: 0.55,
64
+ };
65
+ /**
66
+ * Convert a 0–100 progress percentage into an `scaleX` factor that
67
+ * the fill view can animate against. Clamps to [`minScale`, 1] so the
68
+ * fill never collapses to an invisible hairline
69
+ *
70
+ * The default `minScale` of 0.01 keeps the bar visible during the
71
+ * earliest moments of boot when progress is 0
72
+ */
73
+ export function computeBootProgressFillScale(progress, minScale = 0.01) {
74
+ const numeric = typeof progress === 'number' && Number.isFinite(progress) ? progress : 0;
75
+ const normalized = numeric / 100;
76
+ if (!Number.isFinite(normalized))
77
+ return minScale;
78
+ return Math.max(minScale, Math.min(1, normalized));
79
+ }
80
+ /**
81
+ * The "phase + percent" line we show as the primary status text
82
+ * inside the card
83
+ */
84
+ export function formatBootPrimaryLine(snapshot) {
85
+ if (!snapshot)
86
+ return '';
87
+ const progress = snapshot.progress;
88
+ const progressText = typeof progress === 'number' && Number.isFinite(progress) ? ` (${Math.round(progress)}%)` : '';
89
+ return `${snapshot.phase || ''}${progressText}`.trim();
90
+ }
91
+ /**
92
+ * The secondary detail line (e.g. "Loading the module
93
+ * graph (6259ms)").
94
+ */
95
+ export function formatBootDetailLine(snapshot) {
96
+ if (!snapshot)
97
+ return '';
98
+ const detail = snapshot.detail;
99
+ return typeof detail === 'string' ? detail : '';
100
+ }
101
+ //# sourceMappingURL=boot-placeholder-ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-placeholder-ui.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/boot-placeholder-ui.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,mEAAmE;AACnE,+DAA+D;AAC/D,sEAAsE;AACtE,mEAAmE;AACnE,8CAA8C;AAC9C,EAAE;AA2BF,MAAM,YAAY,GAA2B;IAC5C,cAAc,EAAE,SAAS;IACzB,cAAc,EAAE,SAAS;IACzB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,aAAa,EAAE,SAAS;IACxB,YAAY,EAAE,SAAS;IACvB,iBAAiB,EAAE,SAAS;CAC5B,CAAC;AAEF,MAAM,aAAa,GAA2B;IAC7C,cAAc,EAAE,SAAS;IACzB,cAAc,EAAE,SAAS;IACzB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,aAAa,EAAE,SAAS;IACxB,YAAY,EAAE,SAAS;IACvB,iBAAiB,EAAE,SAAS;CAC5B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAoB;IAC7D,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,aAAa,CAAC;IAC3C,OAAO,YAAY,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,kBAAkB,EAAE,GAAG;IACvB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,GAAG;IACvB,oBAAoB,EAAE,IAAI;IAC1B,oBAAoB,EAAE,IAAI;CACjB,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAAmC,EAAE,QAAQ,GAAG,IAAI;IAChG,MAAM,OAAO,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,MAAM,UAAU,GAAG,OAAO,GAAG,GAAG,CAAC;IACjC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;QAAE,OAAO,QAAQ,CAAC;IAClD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAA2E;IAChH,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACnC,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACpH,OAAO,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAA+D;IACnG,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC/B,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * `'importing-main'` is the long HTTP-module-load phase (5–10s for a
3
+ * real Angular app). The bar uses this range so the user sees ~62
4
+ * percentage points of motion during the phase that actually takes
5
+ * time, sandwiched between the cheap bootstrap stages
6
+ * ('configuring-import-map' = 26) and the post-import wait
7
+ * ('waiting-for-app' = 94 → 'app-root-committed' = 100).
8
+ */
9
+ export declare const BOOT_IMPORT_PROGRESS_MIN = 30;
10
+ export declare const BOOT_IMPORT_PROGRESS_MAX = 92;
11
+ /** Ceiling guards against rounding into `'waiting-for-app'` (94). */
12
+ export declare const BOOT_IMPORT_PROGRESS_CEILING = 94;
13
+ export declare function computeBootImportProgress(input: {
14
+ count?: number;
15
+ elapsedMs?: number;
16
+ }): number;
17
+ /**
18
+ * Render the second-line detail for the placeholder. Surfaces the
19
+ * count + last-loaded module path once the snippet has fired, or a
20
+ * generic "Loading the module graph (Nms)" line during
21
+ * the pre-snippet window.
22
+ */
23
+ export declare function formatBootImportDetail(input: {
24
+ count?: number;
25
+ lastModule?: string;
26
+ elapsedMs?: number;
27
+ }): string;
28
+ /**
29
+ * Ratchet a candidate boot-import progress value against the highest
30
+ * value any consumer has emitted so far (stored on
31
+ * `globalThis.__NS_HMR_BOOT_LAST_PROGRESS__`). Reset by
32
+ * `clearBootProgressState` between sessions.
33
+ */
34
+ export declare function applyMonotonicBootProgress(candidate: number): number;
35
+ /**
36
+ * Reset every boot-progress global so a re-bootstrapped session (e.g.
37
+ * after `__reboot_ng_modules__`) starts a fresh ratchet rather than
38
+ * inheriting the previous cycle's terminal values.
39
+ */
40
+ export declare function clearBootProgressState(): void;
@@ -0,0 +1,128 @@
1
+ // Pure helpers for the cold-boot "Importing the app entry" progress display.
2
+ //
3
+ // Pipeline:
4
+ // * Server-side `buildBootProgressSnippet` is injected at the top of
5
+ // every `__ns_boot__/b1`-tagged module and bumps the count /
6
+ // last-module globals (FULLY SYNCHRONOUS — see the snippet doc for
7
+ // why top-level await must stay out of boot-tagged modules).
8
+ // * `startBrowserRuntimeSession` stamps the time origin
9
+ // (`__NS_HMR_BOOT_IMPORT_STARTED_AT__`) right before
10
+ // `__nsStartDevSession`.
11
+ // * `startBootImportHeartbeat` reads both signals every 250 ms and
12
+ // re-asserts `'importing-main'` so the bar climbs even across long
13
+ // vendor stretches that don't tick the count axis. The iOS runtime's
14
+ // `MaybePumpJSThreadDuringBoot` keeps the JS-thread CFRunLoop ticking
15
+ // between synchronous fetches so the heartbeat's `setInterval` timer
16
+ // can fire during the cold-boot module walk.
17
+ //
18
+ // Monotonic ratchet (`applyMonotonicBootProgress`,
19
+ // `__NS_HMR_BOOT_LAST_PROGRESS__`): each tick can never undercut the
20
+ // previous one, preventing visible stutter when the count axis briefly
21
+ // wins over the time axis.
22
+ /**
23
+ * `'importing-main'` is the long HTTP-module-load phase (5–10s for a
24
+ * real Angular app). The bar uses this range so the user sees ~62
25
+ * percentage points of motion during the phase that actually takes
26
+ * time, sandwiched between the cheap bootstrap stages
27
+ * ('configuring-import-map' = 26) and the post-import wait
28
+ * ('waiting-for-app' = 94 → 'app-root-committed' = 100).
29
+ */
30
+ export const BOOT_IMPORT_PROGRESS_MIN = 30;
31
+ export const BOOT_IMPORT_PROGRESS_MAX = 92;
32
+ /** Ceiling guards against rounding into `'waiting-for-app'` (94). */
33
+ export const BOOT_IMPORT_PROGRESS_CEILING = 94;
34
+ const BOOT_IMPORT_PROGRESS_RANGE = BOOT_IMPORT_PROGRESS_MAX - BOOT_IMPORT_PROGRESS_MIN;
35
+ /**
36
+ * Compute the percentage shown next to "Importing the app entry".
37
+ *
38
+ * Sum of two clamped contributions:
39
+ * * `progressFromCount` — `__NS_HMR_BOOT_MODULE_COUNT__` bumped by the
40
+ * boot snippet (1 unit per 2 modules, cap 40).
41
+ * * `progressFromTime` — elapsed wall-clock since
42
+ * `__NS_HMR_BOOT_IMPORT_STARTED_AT__` (1 unit per 250 ms, cap
43
+ * matches the full 62-point range so time alone can drive the bar
44
+ * 30 → 92 if the count axis is starved).
45
+ *
46
+ * The count axis goes silent in long node_modules stretches and on
47
+ * Vite's rewrite chains where the served import URL skips the
48
+ * `__ns_boot__/b1` prefix; the time axis covers those gaps. Both
49
+ * contributions are summed, clamped to the 62-point range, then
50
+ * ceilinged so they cannot cross into 'waiting-for-app' (94+).
51
+ *
52
+ * Canonical values are pinned by `boot-progress.spec.ts`. The
53
+ * server-side snippet does NOT mirror this math — it only writes the
54
+ * counters; the heartbeat in `session-bootstrap.ts` is the sole caller.
55
+ */
56
+ const BOOT_IMPORT_COUNT_CONTRIBUTION_MAX = 40;
57
+ const BOOT_IMPORT_TIME_CONTRIBUTION_MAX = 62;
58
+ const BOOT_IMPORT_COUNT_DIVISOR = 2;
59
+ const BOOT_IMPORT_TIME_TICK_MS = 250;
60
+ export function computeBootImportProgress(input) {
61
+ // Coerce NaN / ±Infinity / negatives to 0 — `Math.max(0, NaN)` is NaN.
62
+ const rawCount = Number(input?.count ?? 0);
63
+ const rawElapsed = Number(input?.elapsedMs ?? 0);
64
+ const count = Number.isFinite(rawCount) ? Math.max(0, rawCount) : 0;
65
+ const elapsedMs = Number.isFinite(rawElapsed) ? Math.max(0, rawElapsed) : 0;
66
+ const progressFromCount = Math.min(BOOT_IMPORT_COUNT_CONTRIBUTION_MAX, Math.floor(count / BOOT_IMPORT_COUNT_DIVISOR));
67
+ const progressFromTime = Math.min(BOOT_IMPORT_TIME_CONTRIBUTION_MAX, Math.floor(elapsedMs / BOOT_IMPORT_TIME_TICK_MS));
68
+ const combined = BOOT_IMPORT_PROGRESS_MIN + Math.min(BOOT_IMPORT_PROGRESS_RANGE, progressFromCount + progressFromTime);
69
+ return Math.min(BOOT_IMPORT_PROGRESS_CEILING, combined);
70
+ }
71
+ /**
72
+ * Render the second-line detail for the placeholder. Surfaces the
73
+ * count + last-loaded module path once the snippet has fired, or a
74
+ * generic "Loading the module graph (Nms)" line during
75
+ * the pre-snippet window.
76
+ */
77
+ export function formatBootImportDetail(input) {
78
+ const count = Math.max(0, Number(input?.count ?? 0));
79
+ const lastModule = typeof input?.lastModule === 'string' ? input.lastModule : '';
80
+ const elapsedMs = Math.max(0, Number(input?.elapsedMs ?? 0));
81
+ if (count > 0) {
82
+ return lastModule ? `Evaluated ${count} modules\n${lastModule}` : `Evaluated ${count} modules`;
83
+ }
84
+ return `Loading the module graph (${elapsedMs}ms)`;
85
+ }
86
+ /**
87
+ * Ratchet a candidate boot-import progress value against the highest
88
+ * value any consumer has emitted so far (stored on
89
+ * `globalThis.__NS_HMR_BOOT_LAST_PROGRESS__`). Reset by
90
+ * `clearBootProgressState` between sessions.
91
+ */
92
+ export function applyMonotonicBootProgress(candidate) {
93
+ const g = globalThis;
94
+ const previousRaw = g.__NS_HMR_BOOT_LAST_PROGRESS__;
95
+ const previous = typeof previousRaw === 'number' && Number.isFinite(previousRaw) ? previousRaw : 0;
96
+ const next = Math.max(previous, Math.max(0, Number(candidate) || 0));
97
+ try {
98
+ g.__NS_HMR_BOOT_LAST_PROGRESS__ = next;
99
+ }
100
+ catch { }
101
+ return next;
102
+ }
103
+ /**
104
+ * Reset every boot-progress global so a re-bootstrapped session (e.g.
105
+ * after `__reboot_ng_modules__`) starts a fresh ratchet rather than
106
+ * inheriting the previous cycle's terminal values.
107
+ */
108
+ export function clearBootProgressState() {
109
+ const g = globalThis;
110
+ for (const key of [
111
+ '__NS_HMR_BOOT_MODULE_COUNT__',
112
+ '__NS_HMR_BOOT_LAST_MODULE__',
113
+ '__NS_HMR_BOOT_LAST_PROGRESS__',
114
+ '__NS_HMR_BOOT_LAST_PROGRESS_AT__',
115
+ '__NS_HMR_BOOT_IMPORT_STARTED_AT__',
116
+ // Defensive: an earlier snippet shape used this to throttle a
117
+ // top-level await yield. Removed — top-level await in a boot-tagged
118
+ // module trips the iOS 10s async-module deadline. Cleared in case a
119
+ // stale boot left it behind.
120
+ '__NS_HMR_BOOT_LAST_YIELD_AT__',
121
+ ]) {
122
+ try {
123
+ delete g[key];
124
+ }
125
+ catch { }
126
+ }
127
+ }
128
+ //# sourceMappingURL=boot-progress.js.map