@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
@@ -0,0 +1,134 @@
1
+ import { getGlobalScope } from './global-scope.js';
2
+ // Pure helpers for the cold-boot "Importing the app entry" progress display.
3
+ //
4
+ // Pipeline:
5
+ // * Server-side `buildBootProgressSnippet` is injected at the top of
6
+ // every served app module and bumps the count / last-module globals
7
+ // while `__NS_HMR_BOOT_COMPLETE__` is falsy (self-gating — the
8
+ // snippet no-ops after boot; FULLY SYNCHRONOUS — see the snippet
9
+ // doc for why top-level await must stay out of served modules).
10
+ // * `startBrowserRuntimeSession` stamps the time origin
11
+ // (`__NS_HMR_BOOT_IMPORT_STARTED_AT__`) right before the client +
12
+ // entry dynamic-import walk.
13
+ // * `startBootImportHeartbeat` reads both signals every 250 ms and
14
+ // re-asserts `'importing-main'` so the bar climbs even across long
15
+ // vendor stretches that don't tick the count axis. The iOS runtime's
16
+ // `MaybePumpJSThreadDuringBoot` keeps the JS-thread CFRunLoop ticking
17
+ // between synchronous fetches so the heartbeat's `setInterval` timer
18
+ // can fire during the cold-boot module walk.
19
+ //
20
+ // Monotonic ratchet (`applyMonotonicBootProgress`,
21
+ // `__NS_HMR_BOOT_LAST_PROGRESS__`): each tick can never undercut the
22
+ // previous one, preventing visible stutter when the count axis briefly
23
+ // wins over the time axis.
24
+ /**
25
+ * `'importing-main'` is the long HTTP-module-load phase (5–10s for a
26
+ * real Angular app). The bar uses this range so the user sees ~62
27
+ * percentage points of motion during the phase that actually takes
28
+ * time, sandwiched between the cheap bootstrap stages
29
+ * ('configuring-import-map' = 26) and the post-import wait
30
+ * ('waiting-for-app' = 94 → 'app-root-committed' = 100).
31
+ */
32
+ export const BOOT_IMPORT_PROGRESS_MIN = 30;
33
+ export const BOOT_IMPORT_PROGRESS_MAX = 92;
34
+ /** Ceiling guards against rounding into `'waiting-for-app'` (94). */
35
+ export const BOOT_IMPORT_PROGRESS_CEILING = 94;
36
+ const BOOT_IMPORT_PROGRESS_RANGE = BOOT_IMPORT_PROGRESS_MAX - BOOT_IMPORT_PROGRESS_MIN;
37
+ /**
38
+ * Compute the percentage shown next to "Importing the app entry".
39
+ *
40
+ * Sum of two clamped contributions:
41
+ * * `progressFromCount` — `__NS_HMR_BOOT_MODULE_COUNT__` bumped by the
42
+ * boot snippet (1 unit per 2 modules, cap 40).
43
+ * * `progressFromTime` — elapsed wall-clock since
44
+ * `__NS_HMR_BOOT_IMPORT_STARTED_AT__` (1 unit per 250 ms, cap
45
+ * matches the full 62-point range so time alone can drive the bar
46
+ * 30 → 92 if the count axis is starved).
47
+ *
48
+ * The count axis goes silent in long node_modules stretches and on
49
+ * Vite's rewrite chains where the served import URL skips the
50
+ * `__ns_boot__/b1` prefix; the time axis covers those gaps. Both
51
+ * contributions are summed, clamped to the 62-point range, then
52
+ * ceilinged so they cannot cross into 'waiting-for-app' (94+).
53
+ *
54
+ * Canonical values are pinned by `boot-progress.spec.ts`. The
55
+ * server-side snippet does NOT mirror this math — it only writes the
56
+ * counters; the heartbeat in `session-bootstrap.ts` is the sole caller.
57
+ */
58
+ const BOOT_IMPORT_COUNT_CONTRIBUTION_MAX = 40;
59
+ const BOOT_IMPORT_TIME_CONTRIBUTION_MAX = 62;
60
+ const BOOT_IMPORT_COUNT_DIVISOR = 2;
61
+ const BOOT_IMPORT_TIME_TICK_MS = 250;
62
+ export function computeBootImportProgress(input) {
63
+ // Coerce NaN / ±Infinity / negatives to 0 — `Math.max(0, NaN)` is NaN.
64
+ const rawCount = Number(input?.count ?? 0);
65
+ const rawElapsed = Number(input?.elapsedMs ?? 0);
66
+ const count = Number.isFinite(rawCount) ? Math.max(0, rawCount) : 0;
67
+ const elapsedMs = Number.isFinite(rawElapsed) ? Math.max(0, rawElapsed) : 0;
68
+ const progressFromCount = Math.min(BOOT_IMPORT_COUNT_CONTRIBUTION_MAX, Math.floor(count / BOOT_IMPORT_COUNT_DIVISOR));
69
+ const progressFromTime = Math.min(BOOT_IMPORT_TIME_CONTRIBUTION_MAX, Math.floor(elapsedMs / BOOT_IMPORT_TIME_TICK_MS));
70
+ const combined = BOOT_IMPORT_PROGRESS_MIN + Math.min(BOOT_IMPORT_PROGRESS_RANGE, progressFromCount + progressFromTime);
71
+ return Math.min(BOOT_IMPORT_PROGRESS_CEILING, combined);
72
+ }
73
+ /**
74
+ * Render the second-line detail for the placeholder. Surfaces the
75
+ * count + last-loaded module path once the snippet has fired, or a
76
+ * generic "Loading the module graph…" line during the pre-snippet
77
+ * window.
78
+ *
79
+ * No elapsed-ms readout: the primary line's percentage is the progress
80
+ * signal, and the heartbeat's `elapsedMs` is wall-clock since the import
81
+ * started — not a per-module timing — so surfacing it next to the
82
+ * percentage read as a confusing, inaccurate duration.
83
+ */
84
+ export function formatBootImportDetail(input) {
85
+ const count = Math.max(0, Number(input?.count ?? 0));
86
+ const lastModule = typeof input?.lastModule === 'string' ? input.lastModule : '';
87
+ if (count > 0) {
88
+ return lastModule ? `Evaluated ${count} modules\n${lastModule}` : `Evaluated ${count} modules`;
89
+ }
90
+ return 'Loading the module graph…';
91
+ }
92
+ /**
93
+ * Ratchet a candidate boot-import progress value against the highest
94
+ * value any consumer has emitted so far (stored on
95
+ * `globalThis.__NS_HMR_BOOT_LAST_PROGRESS__`). Reset by
96
+ * `clearBootProgressState` between sessions.
97
+ */
98
+ export function applyMonotonicBootProgress(candidate) {
99
+ const g = getGlobalScope();
100
+ const previousRaw = g.__NS_HMR_BOOT_LAST_PROGRESS__;
101
+ const previous = typeof previousRaw === 'number' && Number.isFinite(previousRaw) ? previousRaw : 0;
102
+ const next = Math.max(previous, Math.max(0, Number(candidate) || 0));
103
+ try {
104
+ g.__NS_HMR_BOOT_LAST_PROGRESS__ = next;
105
+ }
106
+ catch { }
107
+ return next;
108
+ }
109
+ /**
110
+ * Reset every boot-progress global so a re-bootstrapped session (e.g.
111
+ * after `__reboot_ng_modules__`) starts a fresh ratchet rather than
112
+ * inheriting the previous cycle's terminal values.
113
+ */
114
+ export function clearBootProgressState() {
115
+ const g = getGlobalScope();
116
+ for (const key of [
117
+ '__NS_HMR_BOOT_MODULE_COUNT__',
118
+ '__NS_HMR_BOOT_LAST_MODULE__',
119
+ '__NS_HMR_BOOT_LAST_PROGRESS__',
120
+ '__NS_HMR_BOOT_LAST_PROGRESS_AT__',
121
+ '__NS_HMR_BOOT_IMPORT_STARTED_AT__',
122
+ // Defensive: an earlier snippet shape used this to throttle a
123
+ // top-level await yield. Removed — top-level await in a boot-tagged
124
+ // module trips the iOS 10s async-module deadline. Cleared in case a
125
+ // stale boot left it behind.
126
+ '__NS_HMR_BOOT_LAST_YIELD_AT__',
127
+ ]) {
128
+ try {
129
+ delete g[key];
130
+ }
131
+ catch { }
132
+ }
133
+ }
134
+ //# sourceMappingURL=boot-progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-progress.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/boot-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mB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C,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACnG,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrE,IAAI,CAAC;QACJ,CAAC,CAAC,6BAA6B,GAAG,IAAI,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO,IAAI,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB;IACrC,MAAM,CAAC,GAAQ,cAAc,EAAE,CAAC;IAChC,KAAK,MAAM,GAAG,IAAI;QACjB,8BAA8B;QAC9B,6BAA6B;QAC7B,+BAA+B;QAC/B,kCAAkC;QAClC,mCAAmC;QACnC,8DAA8D;QAC9D,oEAAoE;QACpE,oEAAoE;QACpE,6BAA6B;QAC7B,+BAA+B;KAC/B,EAAE,CAAC;QACH,IAAI,CAAC;YACJ,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;AACF,CAAC"}
@@ -0,0 +1,17 @@
1
+ export type BootTraceSegment = {
2
+ ok?: boolean;
3
+ ms?: number;
4
+ meta?: Record<string, unknown>;
5
+ };
6
+ export type BootTrace = {
7
+ t0: number;
8
+ t1?: number;
9
+ session?: BootTraceSegment;
10
+ importMap?: BootTraceSegment;
11
+ entry?: BootTraceSegment;
12
+ error?: {
13
+ message: string;
14
+ };
15
+ };
16
+ export declare function formatBootTimeline(trace: BootTrace): string;
17
+ export declare function publishBootTrace(trace: BootTrace): void;
@@ -0,0 +1,40 @@
1
+ import { getGlobalScope } from './global-scope.js';
2
+ // Pure formatter so we can unit-test the exact string shape without
3
+ // touching `console.info` or `Date.now()`.
4
+ //
5
+ // Format:
6
+ // [ns-boot] ok total=1234ms session=45ms importMap=67ms entry=1100ms
7
+ // [ns-boot] FAILED total=230ms session=45ms ...: <message>
8
+ //
9
+ // Segment entries are only included when a numeric `ms` was recorded —
10
+ // this keeps the log compact when a particular phase was skipped (e.g.
11
+ // `__NS_IMPORT_MAP_CONFIGURED__` dedup) or never reached (early error).
12
+ export function formatBootTimeline(trace) {
13
+ const status = trace.error ? 'FAILED' : 'ok';
14
+ const parts = [];
15
+ const push = (label, seg) => {
16
+ if (seg && typeof seg.ms === 'number' && Number.isFinite(seg.ms)) {
17
+ parts.push(`${label}=${Math.max(0, Math.round(seg.ms))}ms`);
18
+ }
19
+ };
20
+ const total = typeof trace.t0 === 'number' && typeof trace.t1 === 'number' ? trace.t1 - trace.t0 : undefined;
21
+ if (typeof total === 'number' && Number.isFinite(total)) {
22
+ parts.push(`total=${Math.max(0, Math.round(total))}ms`);
23
+ }
24
+ push('session', trace.session);
25
+ push('importMap', trace.importMap);
26
+ push('entry', trace.entry);
27
+ const suffix = trace.error?.message ? `: ${trace.error.message}` : '';
28
+ return `[ns-boot] ${status} ${parts.join(' ')}${suffix}`.replace(/\s+$/, '');
29
+ }
30
+ // Install the trace on `globalThis` so diagnostics can pick it up. The key
31
+ // is distinct from the entry-runtime trace (`__NS_ENTRY_TRACE__`), which the
32
+ // entry runtime writes for its own phases. Exported for tests; the runtime
33
+ // path calls this from the session-bootstrap finally block.
34
+ export function publishBootTrace(trace) {
35
+ try {
36
+ getGlobalScope().__NS_BOOT_TRACE__ = trace;
37
+ }
38
+ catch { }
39
+ }
40
+ //# sourceMappingURL=boot-timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boot-timeline.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/boot-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA8BnD,oEAAoE;AACpE,2CAA2C;AAC3C,EAAE;AACF,UAAU;AACV,uEAAuE;AACvE,6DAA6D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AM,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEtE,OAAO,aAAa,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED,2EAA2E;AAC3E,6EAA6E;AAC7E,2EAA2E;AAC3E,4DAA4D;AAC5D,MAAM,UAAU,gBAAgB,CAAC,KAAgB;IAChD,IAAI,CAAC;QACJ,cAAc,EAAE,CAAC,iBAAiB,GAAG,KAAK,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACX,CAAC"}
@@ -0,0 +1,97 @@
1
+ export type NsDevPlatform = 'ios' | 'android' | 'visionos';
2
+ export type NsHostModuleId = `ns-host://${string}`;
3
+ export declare const NS_HOST_RUNTIME_MODULE_ID: "ns-host://runtime";
4
+ export declare const NS_HOST_STYLE_ADAPTER_MODULE_ID: "ns-host://style-adapter";
5
+ export declare const NS_DEFAULT_HOST_MODULES: readonly ["ns-host://runtime", "ns-host://style-adapter"];
6
+ export declare const NS_DEV_SESSION_REQUIRED_FIELDS: readonly ["sessionId", "origin", "entryUrl", "clientUrl", "wsUrl", "platform"];
7
+ export interface NsDevFeatureFlags {
8
+ fullReload?: boolean;
9
+ cssHmr?: boolean;
10
+ errorOverlay?: boolean;
11
+ styleScopeHmr?: boolean;
12
+ }
13
+ export declare const NS_DEFAULT_DEV_FEATURE_FLAGS: Readonly<Required<Pick<NsDevFeatureFlags, 'fullReload' | 'cssHmr'>>>;
14
+ export interface NsDevSessionDescriptor {
15
+ sessionId: string;
16
+ origin: string;
17
+ entryUrl: string;
18
+ clientUrl: string;
19
+ wsUrl: string;
20
+ platform: NsDevPlatform;
21
+ runtimeConfigUrl?: string;
22
+ hostModules?: NsHostModuleId[];
23
+ features?: NsDevFeatureFlags;
24
+ }
25
+ export interface NsRuntimeImportMap {
26
+ imports: Record<string, string>;
27
+ }
28
+ /**
29
+ * The URL vocabulary the runtime's canonical-key function applies when
30
+ * keying its module registry. The *mechanism* (fragment strip, cache-buster
31
+ * param drop, param sort) is native because it runs inside the engine's
32
+ * synchronous resolve walk; this vocabulary is server policy and lives here,
33
+ * next to the server code that defines the routes it names.
34
+ */
35
+ export interface NsRuntimeCanonicalizationConfig {
36
+ /** Query param names that are pure cache busters and are dropped for dev endpoints (e.g. `t`, `v`, `import`). */
37
+ stripParams?: string[];
38
+ /** Path prefixes (StartsWith) identifying dev endpoints whose query may be normalized (e.g. `/ns/`, `/@id/`). */
39
+ forPathPrefixes?: string[];
40
+ /** Path substrings whose query IS the module identity and must be preserved verbatim (e.g. `/@ng/component`). */
41
+ preserveQueryFor?: string[];
42
+ }
43
+ export interface NsRuntimeConfigurePayload {
44
+ importMap: NsRuntimeImportMap;
45
+ volatilePatterns?: string[];
46
+ canonicalization?: NsRuntimeCanonicalizationConfig;
47
+ }
48
+ /**
49
+ * The native dev-host contract — mechanism only. The runtime exposes its
50
+ * mechanism primitives as the `ns:module` builtin module (reachable via
51
+ * `require("ns:module")`, `import ... from "ns:module"` and
52
+ * `import("ns:module")` — see the iOS runtime's docs/ns-builtin-modules.md);
53
+ * every policy concern (boot orchestration, import.meta.hot, full reload,
54
+ * CSS apply, worker teardown, WebSocket protocol) lives in JS inside
55
+ * @nativescript/vite. Worker teardown in particular is fully userland: the
56
+ * session bootstrap intercepts the global `Worker` constructor and the
57
+ * client sweeps tracked instances before framework reboots
58
+ * (`worker.terminate()` cascades to nested workers natively).
59
+ *
60
+ * Every member is optional: a non-dev environment (or a test) may expose
61
+ * none or only some of them, and callers degrade gracefully. Missing
62
+ * members are absent — never present-but-throwing — so feature checks work.
63
+ */
64
+ export interface NsRuntimeDevHostApi {
65
+ /** `configureLoader` — import map + volatile URL patterns + canonicalization vocabulary for the sync resolver. */
66
+ configureLoader?: (config: NsRuntimeConfigurePayload) => void;
67
+ /** `invalidateModules` — registry eviction + bust-next-fetch nonce. */
68
+ invalidateModules?: (urls: string[]) => void;
69
+ /** `getLoadedModuleUrls` — registry introspection for JS-driven full reload. */
70
+ getLoadedModuleUrls?: () => string[];
71
+ /** `createRequire` — a CommonJS `require` resolving against a local file path or `file:` URL. */
72
+ createRequire?: (filenameOrURL: string | URL) => (specifier: string) => unknown;
73
+ /** `createPumpingRequire` — like `createRequire`, but settles top-level-await graphs by pumping V8 tasks; boot-only options. */
74
+ createPumpingRequire?: (filenameOrURL: string | URL, options?: {
75
+ deadlineSeconds?: number;
76
+ onTimeout?: 'throw' | 'return-pending';
77
+ pumpRunLoop?: boolean;
78
+ }) => (specifier: string) => unknown;
79
+ /**
80
+ * `setDevBootComplete` — flips the native cold-boot gate. Only runtimes that
81
+ * let the client arm that gate expose it; current runtimes scope the gate
82
+ * to entry evaluation natively and omit the member.
83
+ */
84
+ setDevBootComplete?: (value?: boolean) => void;
85
+ }
86
+ export declare function isNsDevPlatform(value: unknown): value is NsDevPlatform;
87
+ export declare function assertNsDevSessionDescriptor(session: unknown): asserts session is NsDevSessionDescriptor;
88
+ /**
89
+ * Resolve the dev host API from the `ns:module` builtin module via the
90
+ * runtime's global CJS `require` (installed on the global object by
91
+ * ModuleInternal). Always read through this function rather than requiring
92
+ * the builtin directly so every consumer resolves the contract identically —
93
+ * and degrades to an empty surface off-device (tests, non-NativeScript
94
+ * environments, runtimes without the builtin).
95
+ */
96
+ export declare function readNsRuntimeDevHostApi(target?: Partial<typeof globalThis>): NsRuntimeDevHostApi;
97
+ export {};
@@ -0,0 +1,66 @@
1
+ export const NS_HOST_RUNTIME_MODULE_ID = 'ns-host://runtime';
2
+ export const NS_HOST_STYLE_ADAPTER_MODULE_ID = 'ns-host://style-adapter';
3
+ export const NS_DEFAULT_HOST_MODULES = [NS_HOST_RUNTIME_MODULE_ID, NS_HOST_STYLE_ADAPTER_MODULE_ID];
4
+ export const NS_DEV_SESSION_REQUIRED_FIELDS = ['sessionId', 'origin', 'entryUrl', 'clientUrl', 'wsUrl', 'platform'];
5
+ export const NS_DEFAULT_DEV_FEATURE_FLAGS = {
6
+ fullReload: true,
7
+ cssHmr: true,
8
+ };
9
+ function isNonEmptyString(value) {
10
+ return typeof value === 'string' && value.length > 0;
11
+ }
12
+ export function isNsDevPlatform(value) {
13
+ return value === 'ios' || value === 'android' || value === 'visionos';
14
+ }
15
+ export function assertNsDevSessionDescriptor(session) {
16
+ if (!session || typeof session !== 'object') {
17
+ throw new Error('Invalid NativeScript dev session descriptor');
18
+ }
19
+ const candidate = session;
20
+ for (const key of NS_DEV_SESSION_REQUIRED_FIELDS) {
21
+ if (!isNonEmptyString(candidate[key])) {
22
+ throw new Error(`Missing dev session field: ${key}`);
23
+ }
24
+ }
25
+ if (!isNsDevPlatform(candidate.platform)) {
26
+ throw new Error(`Invalid dev session platform: ${String(candidate.platform)}`);
27
+ }
28
+ if (candidate.hostModules != null) {
29
+ if (!Array.isArray(candidate.hostModules) || candidate.hostModules.some((value) => !isNonEmptyString(value) || !String(value).startsWith('ns-host://'))) {
30
+ throw new Error('Invalid dev session hostModules');
31
+ }
32
+ }
33
+ if (candidate.runtimeConfigUrl != null && !isNonEmptyString(candidate.runtimeConfigUrl)) {
34
+ throw new Error('Invalid dev session runtimeConfigUrl');
35
+ }
36
+ if (candidate.features != null) {
37
+ if (typeof candidate.features !== 'object') {
38
+ throw new Error('Invalid dev session features');
39
+ }
40
+ }
41
+ }
42
+ /**
43
+ * Resolve the dev host API from the `ns:module` builtin module via the
44
+ * runtime's global CJS `require` (installed on the global object by
45
+ * ModuleInternal). Always read through this function rather than requiring
46
+ * the builtin directly so every consumer resolves the contract identically —
47
+ * and degrades to an empty surface off-device (tests, non-NativeScript
48
+ * environments, runtimes without the builtin).
49
+ */
50
+ export function readNsRuntimeDevHostApi(target = globalThis) {
51
+ const requireFn = target.require;
52
+ if (typeof requireFn !== 'function') {
53
+ return {};
54
+ }
55
+ try {
56
+ const api = requireFn('ns:module');
57
+ return api && typeof api === 'object' ? api : {};
58
+ }
59
+ catch {
60
+ // No such built-in module — a runtime predating ns:module or a
61
+ // host whose require doesn't know the scheme.
62
+ return {};
63
+ }
64
+ }
65
+ export {};
66
+ //# sourceMappingURL=browser-runtime-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-runtime-contract.js","sourceRoot":"","sources":["../../../../../../packages/vite/hmr/shared/runtime/browser-runtime-contract.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,yBAAyB,GAAG,mBAA4B,CAAC;AACtE,MAAM,CAAC,MAAM,+BAA+B,GAAG,yBAAkC,CAAC;AAClF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,yBAAyB,EAAE,+BAA+B,CAA8C,CAAC;AAEjJ,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AAS7H,MAAM,CAAC,MAAM,4BAA4B,GAAyE;IACjH,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;CACZ,CAAC;AA2EF,SAAS,gBAAgB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC7C,OAAO,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,UAAU,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAAgB;IAC5D,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,SAAS,GAAG,OAAkC,CAAC;IACrD,KAAK,MAAM,GAAG,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,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;QACrC,OAAO,EAAE,CAAC;IACX,CAAC;IACD,IAAI,CAAC;QACJ,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;QACnC,OAAO,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAE,GAA2B,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3E,CAAC;IAAC,MAAM,CAAC;QACR,+DAA+D;QAC/D,8CAA8C;QAC9C,OAAO,EAAE,CAAC;IACX,CAAC;AACF,CAAC;AAED,OAAO,EAAE,CAAC"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * iOS UIWindow overlay backend. The live/connection/update overlay is
3
+ * promoted to its own UIWindow (above `UIWindowLevelAlert`) so the dev
4
+ * surface never gets obscured by modals, bottom sheets, or any other window
5
+ * presented by the host app. Falls back to null (→ in-tree backend) on
6
+ * Android, web, tests, or when scene/window construction fails.
7
+ *
8
+ * The layout math (`computeIosOverlayLayout`, `computeIosOverlayWindowLevel`)
9
+ * is pure and deterministic so the rules stay unit-testable without booting a
10
+ * simulator — see `dev-overlay.spec.ts`.
11
+ */
12
+ import { type HmrOverlayPosition, type HmrOverlaySnapshot } from './dev-overlay-snapshots.js';
13
+ import { type HmrOverlayRuntimeState, type IosOverlayRefs } from './dev-overlay-shared.js';
14
+ /**
15
+ * Returns the UIWindow level we use for the live/connection overlay. We lift
16
+ * above `UIWindowLevelAlert` so system alerts (and any app-presented modal)
17
+ * stack underneath. When the platform does not expose `UIWindowLevelAlert`
18
+ * we fall back to the documented constant value (2000).
19
+ */
20
+ export declare function computeIosOverlayWindowLevel(baseAlert?: number | null): number;
21
+ export type IosSafeInsets = {
22
+ top: number;
23
+ bottom: number;
24
+ left: number;
25
+ right: number;
26
+ };
27
+ export type IosRect = {
28
+ x: number;
29
+ y: number;
30
+ width: number;
31
+ height: number;
32
+ };
33
+ export type IosOverlayLayout = {
34
+ backdrop: IosRect;
35
+ panel: IosRect;
36
+ title: IosRect;
37
+ status: IosRect;
38
+ };
39
+ /**
40
+ * Layout math for the live overlay when it runs inside its own UIWindow.
41
+ * Pure, deterministic and independent of UIKit so we can verify the rules
42
+ * (max panel width, position-aware placement, safe-area clamping, sane
43
+ * defaults) from tests.
44
+ *
45
+ * `position` controls where the panel sits vertically:
46
+ * - 'top': hugs `safeInsets.top + toastVerticalInset` so the chip
47
+ * sits just below the notch / Dynamic Island.
48
+ * - 'bottom': hugs `viewHeight - safeInsets.bottom - panelHeight -
49
+ * toastVerticalInset` so the chip sits just above the
50
+ * home indicator / nav bar.
51
+ * - 'center': original modal placement (vertically centered, clamped
52
+ * so it never crosses the top safe-area inset).
53
+ */
54
+ export declare function computeIosOverlayLayout(input: {
55
+ viewWidth: number;
56
+ viewHeight: number;
57
+ safeInsets?: IosSafeInsets | null;
58
+ titleHeight: number;
59
+ statusHeight: number;
60
+ maxPanelWidth?: number;
61
+ horizontalMargin?: number;
62
+ panelPadding?: number;
63
+ interLabelSpacing?: number;
64
+ minTopInset?: number;
65
+ position?: HmrOverlayPosition;
66
+ toastVerticalInset?: number;
67
+ }): IosOverlayLayout;
68
+ type IosOverlayHost = {
69
+ UIWindow: any;
70
+ UIViewController: any;
71
+ UIView: any;
72
+ UILabel: any;
73
+ UIColor: any;
74
+ UIFont: any;
75
+ UIApplication: any;
76
+ UIScreen: any;
77
+ UIWindowLevelAlert?: number;
78
+ };
79
+ /**
80
+ * Returns the iOS UIKit symbols we rely on if we're running on an iOS runtime
81
+ * with the metadata bridge available. Returns null on Android, web, or in
82
+ * tests so callers can gracefully fall back to the in-tree overlay.
83
+ */
84
+ export declare function getIosOverlayHost(): IosOverlayHost | null;
85
+ export declare function ensureIosOverlayRefs(state: HmrOverlayRuntimeState): IosOverlayRefs | null;
86
+ export declare function applySnapshotToIosRefs(refs: IosOverlayRefs | null, snapshot: HmrOverlaySnapshot): boolean;
87
+ export {};