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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (586) hide show
  1. package/README.md +89 -14
  2. package/bin/cli.cjs +8 -14
  3. package/configuration/angular.d.ts +35 -2
  4. package/configuration/angular.js +541 -216
  5. package/configuration/angular.js.map +1 -1
  6. package/configuration/base.js +228 -78
  7. package/configuration/base.js.map +1 -1
  8. package/configuration/javascript.js +17 -96
  9. package/configuration/javascript.js.map +1 -1
  10. package/configuration/react.js +41 -73
  11. package/configuration/react.js.map +1 -1
  12. package/configuration/solid.js +58 -6
  13. package/configuration/solid.js.map +1 -1
  14. package/configuration/typescript.js +15 -96
  15. package/configuration/typescript.js.map +1 -1
  16. package/framework.d.ts +22 -0
  17. package/framework.js +18 -0
  18. package/framework.js.map +1 -0
  19. package/helpers/app-components.d.ts +2 -1
  20. package/helpers/app-components.js.map +1 -1
  21. package/helpers/app-css-refresh.d.ts +31 -0
  22. package/helpers/app-css-refresh.js +43 -0
  23. package/helpers/app-css-refresh.js.map +1 -0
  24. package/helpers/app-css-state.d.ts +17 -0
  25. package/helpers/app-css-state.js +51 -0
  26. package/helpers/app-css-state.js.map +1 -0
  27. package/helpers/bundler-context.d.ts +11 -0
  28. package/helpers/bundler-context.js +71 -0
  29. package/helpers/bundler-context.js.map +1 -0
  30. package/helpers/cli-flags.d.ts +12 -0
  31. package/helpers/cli-flags.js +34 -0
  32. package/helpers/cli-flags.js.map +1 -1
  33. package/helpers/commonjs-plugins.d.ts +5 -2
  34. package/helpers/commonjs-plugins.js +126 -0
  35. package/helpers/commonjs-plugins.js.map +1 -1
  36. package/helpers/config-as-json.js +10 -0
  37. package/helpers/config-as-json.js.map +1 -1
  38. package/helpers/css-platform-plugin.d.ts +14 -0
  39. package/helpers/css-platform-plugin.js +43 -25
  40. package/helpers/css-platform-plugin.js.map +1 -1
  41. package/helpers/dev-host.d.ts +360 -0
  42. package/helpers/dev-host.js +694 -0
  43. package/helpers/dev-host.js.map +1 -0
  44. package/helpers/dynamic-import-plugin.d.ts +2 -1
  45. package/helpers/dynamic-import-plugin.js +59 -53
  46. package/helpers/dynamic-import-plugin.js.map +1 -1
  47. package/helpers/esbuild-platform-resolver.js +9 -6
  48. package/helpers/esbuild-platform-resolver.js.map +1 -1
  49. package/helpers/external-configs.d.ts +10 -4
  50. package/helpers/external-configs.js +63 -15
  51. package/helpers/external-configs.js.map +1 -1
  52. package/helpers/flavor.d.ts +31 -0
  53. package/helpers/flavor.js +53 -2
  54. package/helpers/flavor.js.map +1 -1
  55. package/helpers/global-defines.d.ts +118 -0
  56. package/helpers/global-defines.js +214 -11
  57. package/helpers/global-defines.js.map +1 -1
  58. package/helpers/hmr-scope.d.ts +26 -0
  59. package/helpers/hmr-scope.js +67 -0
  60. package/helpers/hmr-scope.js.map +1 -0
  61. package/helpers/import-meta-path.d.ts +4 -0
  62. package/helpers/import-meta-path.js +5 -0
  63. package/helpers/import-meta-path.js.map +1 -0
  64. package/helpers/import-specifier.d.ts +1 -0
  65. package/helpers/import-specifier.js +18 -0
  66. package/helpers/import-specifier.js.map +1 -0
  67. package/helpers/init.js +24 -26
  68. package/helpers/init.js.map +1 -1
  69. package/helpers/logging.d.ts +12 -1
  70. package/helpers/logging.js +81 -5
  71. package/helpers/logging.js.map +1 -1
  72. package/helpers/main-entry.d.ts +8 -2
  73. package/helpers/main-entry.js +622 -120
  74. package/helpers/main-entry.js.map +1 -1
  75. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  76. package/helpers/nativeclass-esbuild-plugin.js +6 -1
  77. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  78. package/helpers/nativeclass-transform.d.ts +13 -0
  79. package/helpers/nativeclass-transform.js +42 -131
  80. package/helpers/nativeclass-transform.js.map +1 -1
  81. package/helpers/nativeclass-transformer-plugin.d.ts +19 -1
  82. package/helpers/nativeclass-transformer-plugin.js +324 -37
  83. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  84. package/helpers/nativescript-package-resolver.js +10 -62
  85. package/helpers/nativescript-package-resolver.js.map +1 -1
  86. package/helpers/normalize-id.d.ts +42 -0
  87. package/helpers/normalize-id.js +60 -0
  88. package/helpers/normalize-id.js.map +1 -0
  89. package/helpers/ns-core-external-urls.d.ts +32 -0
  90. package/helpers/ns-core-external-urls.js +107 -0
  91. package/helpers/ns-core-external-urls.js.map +1 -0
  92. package/helpers/ns-core-url.d.ts +106 -0
  93. package/helpers/ns-core-url.js +225 -0
  94. package/helpers/ns-core-url.js.map +1 -0
  95. package/helpers/optimize-deps.d.ts +16 -0
  96. package/helpers/optimize-deps.js +17 -0
  97. package/helpers/optimize-deps.js.map +1 -0
  98. package/helpers/package-platform-aliases.js +34 -49
  99. package/helpers/package-platform-aliases.js.map +1 -1
  100. package/helpers/platform-types.d.ts +2 -0
  101. package/helpers/platform-types.js +2 -0
  102. package/helpers/platform-types.js.map +1 -0
  103. package/helpers/postcss-platform-config.d.ts +17 -1
  104. package/helpers/postcss-platform-config.js +20 -37
  105. package/helpers/postcss-platform-config.js.map +1 -1
  106. package/helpers/project.d.ts +35 -0
  107. package/helpers/project.js +120 -2
  108. package/helpers/project.js.map +1 -1
  109. package/helpers/resolve-main-field-platform.d.ts +20 -0
  110. package/helpers/resolve-main-field-platform.js +49 -0
  111. package/helpers/resolve-main-field-platform.js.map +1 -0
  112. package/helpers/resolver.js +17 -2
  113. package/helpers/resolver.js.map +1 -1
  114. package/helpers/theme-core-plugins.js +1 -1
  115. package/helpers/theme-core-plugins.js.map +1 -1
  116. package/helpers/ts-config-paths.d.ts +32 -0
  117. package/helpers/ts-config-paths.js +156 -27
  118. package/helpers/ts-config-paths.js.map +1 -1
  119. package/helpers/typescript-check.d.ts +3 -3
  120. package/helpers/typescript-check.js +4 -4
  121. package/helpers/typescript-check.js.map +1 -1
  122. package/helpers/ui-registration.d.ts +21 -0
  123. package/helpers/ui-registration.js +156 -0
  124. package/helpers/ui-registration.js.map +1 -0
  125. package/helpers/utils.d.ts +9 -0
  126. package/helpers/utils.js +22 -2
  127. package/helpers/utils.js.map +1 -1
  128. package/helpers/vite-package-version.d.ts +7 -0
  129. package/helpers/vite-package-version.js +44 -0
  130. package/helpers/vite-package-version.js.map +1 -0
  131. package/helpers/workers.d.ts +40 -19
  132. package/helpers/workers.js +312 -13
  133. package/helpers/workers.js.map +1 -1
  134. package/hmr/client/css-handler.d.ts +2 -1
  135. package/hmr/client/css-handler.js +95 -23
  136. package/hmr/client/css-handler.js.map +1 -1
  137. package/hmr/client/css-update-overlay.d.ts +18 -0
  138. package/hmr/client/css-update-overlay.js +27 -0
  139. package/hmr/client/css-update-overlay.js.map +1 -0
  140. package/hmr/client/framework-client-strategy.d.ts +117 -0
  141. package/hmr/client/framework-client-strategy.js +18 -0
  142. package/hmr/client/framework-client-strategy.js.map +1 -0
  143. package/hmr/client/framework.d.ts +31 -0
  144. package/hmr/client/framework.js +17 -0
  145. package/hmr/client/framework.js.map +1 -0
  146. package/hmr/client/hmr-pending-overlay.d.ts +13 -0
  147. package/hmr/client/hmr-pending-overlay.js +41 -0
  148. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  149. package/hmr/client/hot-context.d.ts +89 -0
  150. package/hmr/client/hot-context.js +404 -0
  151. package/hmr/client/hot-context.js.map +1 -0
  152. package/hmr/client/index.d.ts +9 -1
  153. package/hmr/client/index.js +91 -1418
  154. package/hmr/client/index.js.map +1 -1
  155. package/hmr/client/overlay-driver.d.ts +10 -0
  156. package/hmr/client/overlay-driver.js +33 -0
  157. package/hmr/client/overlay-driver.js.map +1 -0
  158. package/hmr/client/protocol-dispatch.d.ts +8 -0
  159. package/hmr/client/protocol-dispatch.js +308 -0
  160. package/hmr/client/protocol-dispatch.js.map +1 -0
  161. package/hmr/client/root-reset.d.ts +15 -0
  162. package/hmr/client/root-reset.js +358 -0
  163. package/hmr/client/root-reset.js.map +1 -0
  164. package/hmr/client/strategy-loader.d.ts +24 -0
  165. package/hmr/client/strategy-loader.js +136 -0
  166. package/hmr/client/strategy-loader.js.map +1 -0
  167. package/hmr/client/update-pipeline.d.ts +27 -0
  168. package/hmr/client/update-pipeline.js +489 -0
  169. package/hmr/client/update-pipeline.js.map +1 -0
  170. package/hmr/client/utils.d.ts +14 -1
  171. package/hmr/client/utils.js +265 -54
  172. package/hmr/client/utils.js.map +1 -1
  173. package/hmr/client/ws-transport.d.ts +21 -0
  174. package/hmr/client/ws-transport.js +323 -0
  175. package/hmr/client/ws-transport.js.map +1 -0
  176. package/hmr/entry-runtime.d.ts +11 -0
  177. package/hmr/entry-runtime.js +566 -43
  178. package/hmr/entry-runtime.js.map +1 -1
  179. package/hmr/framework-flavors.d.ts +59 -0
  180. package/hmr/framework-flavors.js +108 -0
  181. package/hmr/framework-flavors.js.map +1 -0
  182. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  183. package/hmr/frameworks/angular/build/angular-linker.js +113 -0
  184. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  185. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  186. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  187. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  188. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  189. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  190. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  191. package/hmr/frameworks/angular/build/inline-decorator-component-templates.d.ts +3 -0
  192. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js +231 -0
  193. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  194. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  195. package/hmr/frameworks/angular/build/js-lexer.js +182 -0
  196. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  197. package/hmr/frameworks/angular/build/linker-stats.d.ts +18 -0
  198. package/hmr/frameworks/angular/build/linker-stats.js +29 -0
  199. package/hmr/frameworks/angular/build/linker-stats.js.map +1 -0
  200. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  201. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  202. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  203. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.d.ts +1 -0
  204. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  205. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  206. package/hmr/frameworks/angular/build/synthesize-injectable-factories.d.ts +3 -0
  207. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js +241 -0
  208. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  209. package/hmr/frameworks/angular/build/ts-fallback-transform.d.ts +5 -0
  210. package/hmr/frameworks/angular/build/ts-fallback-transform.js +138 -0
  211. package/hmr/frameworks/angular/build/ts-fallback-transform.js.map +1 -0
  212. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  213. package/hmr/frameworks/angular/build/util.js +155 -0
  214. package/hmr/frameworks/angular/build/util.js.map +1 -0
  215. package/hmr/frameworks/angular/build/worker-url-preserve.d.ts +5 -0
  216. package/hmr/frameworks/angular/build/worker-url-preserve.js +140 -0
  217. package/hmr/frameworks/angular/build/worker-url-preserve.js.map +1 -0
  218. package/hmr/frameworks/angular/client/index.d.ts +2 -1
  219. package/hmr/frameworks/angular/client/index.js +637 -23
  220. package/hmr/frameworks/angular/client/index.js.map +1 -1
  221. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  222. package/hmr/frameworks/angular/client/strategy.js +19 -0
  223. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  224. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  225. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  226. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  227. package/hmr/frameworks/angular/server/linker.js +37 -6
  228. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  229. package/hmr/frameworks/angular/server/ng-component-route.d.ts +43 -0
  230. package/hmr/frameworks/angular/server/ng-component-route.js +113 -0
  231. package/hmr/frameworks/angular/server/ng-component-route.js.map +1 -0
  232. package/hmr/frameworks/angular/server/strategy.js +697 -18
  233. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  234. package/hmr/frameworks/angular/server/websocket-angular-entry.d.ts +2 -0
  235. package/hmr/frameworks/angular/server/websocket-angular-entry.js +68 -0
  236. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  237. package/hmr/frameworks/angular/server/websocket-angular-hot-update.d.ts +94 -0
  238. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +485 -0
  239. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  240. package/hmr/frameworks/react/client/strategy.d.ts +12 -0
  241. package/hmr/frameworks/react/client/strategy.js +27 -0
  242. package/hmr/frameworks/react/client/strategy.js.map +1 -0
  243. package/hmr/frameworks/react/server/strategy.d.ts +2 -0
  244. package/hmr/frameworks/react/server/strategy.js +230 -0
  245. package/hmr/frameworks/react/server/strategy.js.map +1 -0
  246. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  247. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  248. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  249. package/hmr/frameworks/solid/client/app-runtime.d.ts +68 -0
  250. package/hmr/frameworks/solid/client/app-runtime.js +252 -0
  251. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
  252. package/hmr/frameworks/solid/client/strategy.d.ts +7 -0
  253. package/hmr/frameworks/solid/client/strategy.js +391 -0
  254. package/hmr/frameworks/solid/client/strategy.js.map +1 -0
  255. package/hmr/frameworks/solid/server/strategy.js +293 -16
  256. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  257. package/hmr/frameworks/typescript/client/strategy.d.ts +7 -0
  258. package/hmr/frameworks/typescript/client/strategy.js +418 -0
  259. package/hmr/frameworks/typescript/client/strategy.js.map +1 -0
  260. package/hmr/frameworks/typescript/server/strategy.js +48 -16
  261. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  262. package/hmr/frameworks/vue/client/dep-propagation.d.ts +44 -0
  263. package/hmr/frameworks/vue/client/dep-propagation.js +148 -0
  264. package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
  265. package/hmr/frameworks/vue/client/index.d.ts +10 -1
  266. package/hmr/frameworks/vue/client/index.js +287 -562
  267. package/hmr/frameworks/vue/client/index.js.map +1 -1
  268. package/hmr/frameworks/vue/client/navigate-app.d.ts +3 -0
  269. package/hmr/frameworks/vue/client/navigate-app.js +178 -0
  270. package/hmr/frameworks/vue/client/navigate-app.js.map +1 -0
  271. package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
  272. package/hmr/frameworks/vue/client/strategy.js +152 -0
  273. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  274. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
  275. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +124 -0
  276. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  277. package/hmr/frameworks/vue/server/compiler.d.ts +3 -1
  278. package/hmr/frameworks/vue/server/compiler.js +3 -1
  279. package/hmr/frameworks/vue/server/compiler.js.map +1 -1
  280. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  281. package/hmr/frameworks/vue/server/sfc-route-assemble.js +823 -0
  282. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  283. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  284. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  285. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  286. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  287. package/hmr/frameworks/vue/server/sfc-route-serve.js +462 -0
  288. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  289. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +45 -0
  290. package/hmr/frameworks/vue/server/sfc-route-shared.js +105 -0
  291. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  292. package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
  293. package/hmr/frameworks/vue/server/strategy.js +291 -7
  294. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  295. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  296. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  297. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  298. package/hmr/helpers/ast-normalizer.d.ts +3 -1
  299. package/hmr/helpers/ast-normalizer.js +131 -24
  300. package/hmr/helpers/ast-normalizer.js.map +1 -1
  301. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  302. package/hmr/helpers/cjs-named-exports.js +152 -0
  303. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  304. package/hmr/helpers/package-exports.d.ts +16 -0
  305. package/hmr/helpers/package-exports.js +396 -0
  306. package/hmr/helpers/package-exports.js.map +1 -0
  307. package/hmr/helpers/vendor-rewrite.d.ts +1 -1
  308. package/hmr/helpers/vendor-rewrite.js +5 -3
  309. package/hmr/helpers/vendor-rewrite.js.map +1 -1
  310. package/hmr/server/boot-recording.d.ts +51 -0
  311. package/hmr/server/boot-recording.js +214 -0
  312. package/hmr/server/boot-recording.js.map +1 -0
  313. package/hmr/server/constants.d.ts +1 -0
  314. package/hmr/server/constants.js +21 -4
  315. package/hmr/server/constants.js.map +1 -1
  316. package/hmr/server/content-css-update.d.ts +54 -0
  317. package/hmr/server/content-css-update.js +78 -0
  318. package/hmr/server/content-css-update.js.map +1 -0
  319. package/hmr/server/core-bundle.d.ts +140 -0
  320. package/hmr/server/core-bundle.js +614 -0
  321. package/hmr/server/core-bundle.js.map +1 -0
  322. package/hmr/server/core-sanitize.d.ts +130 -4
  323. package/hmr/server/core-sanitize.js +393 -32
  324. package/hmr/server/core-sanitize.js.map +1 -1
  325. package/hmr/server/css-connect-sync.d.ts +28 -0
  326. package/hmr/server/css-connect-sync.js +59 -0
  327. package/hmr/server/css-connect-sync.js.map +1 -0
  328. package/hmr/server/css-device-module.d.ts +28 -0
  329. package/hmr/server/css-device-module.js +44 -0
  330. package/hmr/server/css-device-module.js.map +1 -0
  331. package/hmr/server/css-update-message.d.ts +23 -0
  332. package/hmr/server/css-update-message.js +41 -0
  333. package/hmr/server/css-update-message.js.map +1 -0
  334. package/hmr/server/deps-bundle.d.ts +233 -0
  335. package/hmr/server/deps-bundle.js +1022 -0
  336. package/hmr/server/deps-bundle.js.map +1 -0
  337. package/hmr/server/device-transform-helpers.d.ts +24 -0
  338. package/hmr/server/device-transform-helpers.js +408 -0
  339. package/hmr/server/device-transform-helpers.js.map +1 -0
  340. package/hmr/server/framework-strategy.d.ts +182 -11
  341. package/hmr/server/hmr-module-graph.d.ts +37 -0
  342. package/hmr/server/hmr-module-graph.js +215 -0
  343. package/hmr/server/hmr-module-graph.js.map +1 -0
  344. package/hmr/server/import-map.d.ts +99 -0
  345. package/hmr/server/import-map.js +294 -0
  346. package/hmr/server/import-map.js.map +1 -0
  347. package/hmr/server/index.d.ts +2 -1
  348. package/hmr/server/index.js +7 -16
  349. package/hmr/server/index.js.map +1 -1
  350. package/hmr/server/node-builtins-route.d.ts +12 -0
  351. package/hmr/server/node-builtins-route.js +86 -0
  352. package/hmr/server/node-builtins-route.js.map +1 -0
  353. package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
  354. package/hmr/server/ns-core-cjs-shape.js +271 -0
  355. package/hmr/server/ns-core-cjs-shape.js.map +1 -0
  356. package/hmr/server/ns-m-response-memo.d.ts +10 -0
  357. package/hmr/server/ns-m-response-memo.js +33 -0
  358. package/hmr/server/ns-m-response-memo.js.map +1 -0
  359. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  360. package/hmr/server/ns-rt-bridge.js +131 -0
  361. package/hmr/server/ns-rt-bridge.js.map +1 -0
  362. package/hmr/server/ns-rt-route.d.ts +5 -0
  363. package/hmr/server/ns-rt-route.js +39 -0
  364. package/hmr/server/ns-rt-route.js.map +1 -0
  365. package/hmr/server/perf-instrumentation.d.ts +114 -0
  366. package/hmr/server/perf-instrumentation.js +197 -0
  367. package/hmr/server/perf-instrumentation.js.map +1 -0
  368. package/hmr/server/process-code-for-device.d.ts +54 -0
  369. package/hmr/server/process-code-for-device.js +832 -0
  370. package/hmr/server/process-code-for-device.js.map +1 -0
  371. package/hmr/server/require-guard.d.ts +1 -0
  372. package/hmr/server/require-guard.js +12 -0
  373. package/hmr/server/require-guard.js.map +1 -0
  374. package/hmr/server/rewrite-imports.d.ts +2 -0
  375. package/hmr/server/rewrite-imports.js +631 -0
  376. package/hmr/server/rewrite-imports.js.map +1 -0
  377. package/hmr/server/route-helpers.d.ts +7 -0
  378. package/hmr/server/route-helpers.js +13 -0
  379. package/hmr/server/route-helpers.js.map +1 -0
  380. package/hmr/server/runtime-graph-filter.d.ts +5 -0
  381. package/hmr/server/runtime-graph-filter.js +28 -0
  382. package/hmr/server/runtime-graph-filter.js.map +1 -0
  383. package/hmr/server/server-origin.d.ts +2 -0
  384. package/hmr/server/server-origin.js +88 -0
  385. package/hmr/server/server-origin.js.map +1 -0
  386. package/hmr/server/shared-transform-request.d.ts +12 -0
  387. package/hmr/server/shared-transform-request.js +143 -0
  388. package/hmr/server/shared-transform-request.js.map +1 -0
  389. package/hmr/server/socket-utils.d.ts +10 -0
  390. package/hmr/server/socket-utils.js +14 -0
  391. package/hmr/server/socket-utils.js.map +1 -0
  392. package/hmr/server/transform-cache-invalidation.d.ts +37 -0
  393. package/hmr/server/transform-cache-invalidation.js +156 -0
  394. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  395. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  396. package/hmr/server/vendor-bare-module-shims.js +80 -0
  397. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  398. package/hmr/server/vite-plugin.d.ts +22 -1
  399. package/hmr/server/vite-plugin.js +655 -58
  400. package/hmr/server/vite-plugin.js.map +1 -1
  401. package/hmr/server/websocket-core-bridge.d.ts +68 -0
  402. package/hmr/server/websocket-core-bridge.js +370 -0
  403. package/hmr/server/websocket-core-bridge.js.map +1 -0
  404. package/hmr/server/websocket-device-transform.d.ts +3 -0
  405. package/hmr/server/websocket-device-transform.js +7 -0
  406. package/hmr/server/websocket-device-transform.js.map +1 -0
  407. package/hmr/server/websocket-graph-upsert.d.ts +21 -0
  408. package/hmr/server/websocket-graph-upsert.js +33 -0
  409. package/hmr/server/websocket-graph-upsert.js.map +1 -0
  410. package/hmr/server/websocket-hmr-pending.d.ts +29 -0
  411. package/hmr/server/websocket-hmr-pending.js +33 -0
  412. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  413. package/hmr/server/websocket-hot-update.d.ts +80 -0
  414. package/hmr/server/websocket-hot-update.js +299 -0
  415. package/hmr/server/websocket-hot-update.js.map +1 -0
  416. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  417. package/hmr/server/websocket-import-map-route.js +51 -0
  418. package/hmr/server/websocket-import-map-route.js.map +1 -0
  419. package/hmr/server/websocket-module-bindings.d.ts +21 -0
  420. package/hmr/server/websocket-module-bindings.js +504 -0
  421. package/hmr/server/websocket-module-bindings.js.map +1 -0
  422. package/hmr/server/websocket-module-specifiers.d.ts +98 -0
  423. package/hmr/server/websocket-module-specifiers.js +832 -0
  424. package/hmr/server/websocket-module-specifiers.js.map +1 -0
  425. package/hmr/server/websocket-ns-core.d.ts +34 -0
  426. package/hmr/server/websocket-ns-core.js +414 -0
  427. package/hmr/server/websocket-ns-core.js.map +1 -0
  428. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  429. package/hmr/server/websocket-ns-entry.js +163 -0
  430. package/hmr/server/websocket-ns-entry.js.map +1 -0
  431. package/hmr/server/websocket-ns-m-paths.d.ts +19 -0
  432. package/hmr/server/websocket-ns-m-paths.js +115 -0
  433. package/hmr/server/websocket-ns-m-paths.js.map +1 -0
  434. package/hmr/server/websocket-ns-m-request.d.ts +46 -0
  435. package/hmr/server/websocket-ns-m-request.js +197 -0
  436. package/hmr/server/websocket-ns-m-request.js.map +1 -0
  437. package/hmr/server/websocket-ns-m.d.ts +52 -0
  438. package/hmr/server/websocket-ns-m.js +592 -0
  439. package/hmr/server/websocket-ns-m.js.map +1 -0
  440. package/hmr/server/websocket-served-module-helpers.d.ts +98 -0
  441. package/hmr/server/websocket-served-module-helpers.js +948 -0
  442. package/hmr/server/websocket-served-module-helpers.js.map +1 -0
  443. package/hmr/server/websocket-txn.d.ts +6 -0
  444. package/hmr/server/websocket-txn.js +42 -0
  445. package/hmr/server/websocket-txn.js.map +1 -0
  446. package/hmr/server/websocket-vendor-unifier.d.ts +9 -0
  447. package/hmr/server/websocket-vendor-unifier.js +46 -0
  448. package/hmr/server/websocket-vendor-unifier.js.map +1 -0
  449. package/hmr/server/websocket.d.ts +6 -17
  450. package/hmr/server/websocket.js +723 -5376
  451. package/hmr/server/websocket.js.map +1 -1
  452. package/hmr/shared/ns-globals.d.ts +108 -0
  453. package/hmr/shared/ns-globals.js +29 -0
  454. package/hmr/shared/ns-globals.js.map +1 -0
  455. package/hmr/shared/package-classifier.d.ts +9 -0
  456. package/hmr/shared/package-classifier.js +58 -0
  457. package/hmr/shared/package-classifier.js.map +1 -0
  458. package/hmr/shared/protocol.d.ts +157 -0
  459. package/hmr/shared/protocol.js +28 -0
  460. package/hmr/shared/protocol.js.map +1 -0
  461. package/hmr/shared/runtime/boot-complete.d.ts +14 -0
  462. package/hmr/shared/runtime/boot-complete.js +32 -0
  463. package/hmr/shared/runtime/boot-complete.js.map +1 -0
  464. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  465. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  466. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  467. package/hmr/shared/runtime/boot-progress.d.ts +44 -0
  468. package/hmr/shared/runtime/boot-progress.js +134 -0
  469. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  470. package/hmr/shared/runtime/boot-timeline.d.ts +17 -0
  471. package/hmr/shared/runtime/boot-timeline.js +40 -0
  472. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  473. package/hmr/shared/runtime/browser-runtime-contract.d.ts +97 -0
  474. package/hmr/shared/runtime/browser-runtime-contract.js +66 -0
  475. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
  476. package/hmr/shared/runtime/dev-overlay-ios.d.ts +87 -0
  477. package/hmr/shared/runtime/dev-overlay-ios.js +521 -0
  478. package/hmr/shared/runtime/dev-overlay-ios.js.map +1 -0
  479. package/hmr/shared/runtime/dev-overlay-shared.d.ts +58 -0
  480. package/hmr/shared/runtime/dev-overlay-shared.js +116 -0
  481. package/hmr/shared/runtime/dev-overlay-shared.js.map +1 -0
  482. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  483. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  484. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  485. package/hmr/shared/runtime/dev-overlay-tree.d.ts +59 -0
  486. package/hmr/shared/runtime/dev-overlay-tree.js +712 -0
  487. package/hmr/shared/runtime/dev-overlay-tree.js.map +1 -0
  488. package/hmr/shared/runtime/dev-overlay.d.ts +39 -0
  489. package/hmr/shared/runtime/dev-overlay.js +292 -0
  490. package/hmr/shared/runtime/dev-overlay.js.map +1 -0
  491. package/hmr/shared/runtime/global-scope.d.ts +18 -0
  492. package/hmr/shared/runtime/global-scope.js +21 -0
  493. package/hmr/shared/runtime/global-scope.js.map +1 -0
  494. package/hmr/shared/runtime/hooks.js +2 -1
  495. package/hmr/shared/runtime/hooks.js.map +1 -1
  496. package/hmr/shared/runtime/launch-bridge.d.ts +9 -0
  497. package/hmr/shared/runtime/launch-bridge.js +98 -0
  498. package/hmr/shared/runtime/launch-bridge.js.map +1 -0
  499. package/hmr/shared/runtime/module-provenance.d.ts +1 -0
  500. package/hmr/shared/runtime/module-provenance.js +64 -0
  501. package/hmr/shared/runtime/module-provenance.js.map +1 -0
  502. package/hmr/shared/runtime/ns-runtime-test-double.d.ts +21 -0
  503. package/hmr/shared/runtime/ns-runtime-test-double.js +20 -0
  504. package/hmr/shared/runtime/ns-runtime-test-double.js.map +1 -0
  505. package/hmr/shared/runtime/overlay-flag.d.ts +9 -0
  506. package/hmr/shared/runtime/overlay-flag.js +34 -0
  507. package/hmr/shared/runtime/overlay-flag.js.map +1 -0
  508. package/hmr/shared/runtime/platform-polyfills.d.ts +26 -0
  509. package/hmr/shared/runtime/platform-polyfills.js +122 -0
  510. package/hmr/shared/runtime/platform-polyfills.js.map +1 -0
  511. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  512. package/hmr/shared/runtime/root-placeholder-view.js +311 -0
  513. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  514. package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
  515. package/hmr/shared/runtime/root-placeholder.js +778 -83
  516. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  517. package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
  518. package/hmr/shared/runtime/session-bootstrap.js +350 -0
  519. package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
  520. package/hmr/shared/runtime/vendor-bootstrap.js +54 -16
  521. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  522. package/hmr/shared/runtime/vendor-resolve.d.ts +22 -0
  523. package/hmr/shared/runtime/vendor-resolve.js +45 -0
  524. package/hmr/shared/runtime/vendor-resolve.js.map +1 -0
  525. package/hmr/shared/runtime/worker-tracking.d.ts +28 -0
  526. package/hmr/shared/runtime/worker-tracking.js +114 -0
  527. package/hmr/shared/runtime/worker-tracking.js.map +1 -0
  528. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  529. package/hmr/shared/vendor/manifest-collect.js +909 -0
  530. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  531. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  532. package/hmr/shared/vendor/manifest-loader.js +5 -3
  533. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  534. package/hmr/shared/vendor/manifest.d.ts +12 -0
  535. package/hmr/shared/vendor/manifest.js +341 -545
  536. package/hmr/shared/vendor/manifest.js.map +1 -1
  537. package/hmr/shared/vendor/registry.d.ts +2 -0
  538. package/hmr/shared/vendor/registry.js +118 -7
  539. package/hmr/shared/vendor/registry.js.map +1 -1
  540. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  541. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  542. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  543. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +107 -0
  544. package/hmr/shared/vendor/vendor-esbuild-plugins.js +540 -0
  545. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  546. package/index.d.ts +1 -0
  547. package/index.js +5 -0
  548. package/index.js.map +1 -1
  549. package/package.json +83 -14
  550. package/runtime/core-aliases-early.js +103 -81
  551. package/runtime/core-aliases-early.js.map +1 -1
  552. package/shims/react-jsx-runtime.d.ts +4 -0
  553. package/shims/react-jsx-runtime.js +61 -0
  554. package/shims/react-jsx-runtime.js.map +1 -0
  555. package/shims/solid-jsx-runtime.d.ts +7 -0
  556. package/shims/solid-jsx-runtime.js +17 -0
  557. package/shims/solid-jsx-runtime.js.map +1 -0
  558. package/helpers/angular/angular-linker.d.ts +0 -13
  559. package/helpers/angular/angular-linker.js +0 -189
  560. package/helpers/angular/angular-linker.js.map +0 -1
  561. package/helpers/angular/shared-linker.d.ts +0 -4
  562. package/helpers/angular/shared-linker.js +0 -39
  563. package/helpers/angular/shared-linker.js.map +0 -1
  564. package/helpers/angular/util.js +0 -67
  565. package/helpers/angular/util.js.map +0 -1
  566. package/helpers/module-runner-patch.d.ts +0 -3
  567. package/helpers/module-runner-patch.js +0 -63
  568. package/helpers/module-runner-patch.js.map +0 -1
  569. package/helpers/prelink-angular.d.ts +0 -2
  570. package/helpers/prelink-angular.js +0 -117
  571. package/helpers/prelink-angular.js.map +0 -1
  572. package/hmr/shared/runtime/http-only-boot.d.ts +0 -1
  573. package/hmr/shared/runtime/http-only-boot.js +0 -124
  574. package/hmr/shared/runtime/http-only-boot.js.map +0 -1
  575. package/hmr/vendor-bootstrap.d.ts +0 -3
  576. package/hmr/vendor-bootstrap.js +0 -32
  577. package/hmr/vendor-bootstrap.js.map +0 -1
  578. package/shims/react-reconciler-constants.d.ts +0 -14
  579. package/shims/react-reconciler-constants.js +0 -21
  580. package/shims/react-reconciler-constants.js.map +0 -1
  581. package/shims/react-reconciler.d.ts +0 -8
  582. package/shims/react-reconciler.js +0 -15
  583. package/shims/react-reconciler.js.map +0 -1
  584. package/transformers/NativeClass/index.d.ts +0 -2
  585. package/transformers/NativeClass/index.js +0 -222
  586. package/transformers/NativeClass/index.js.map +0 -1
@@ -1,4 +1,289 @@
1
- // Entry runtime executed on device via HTTP ESM.
1
+ import { getGlobalScope } from './shared/runtime/global-scope.js';
2
+ import { markDevBootComplete } from './shared/runtime/boot-complete.js';
3
+ import { readNsRuntimeDevHostApi } from './shared/runtime/browser-runtime-contract.js';
4
+ import { installWorkerConstructorTracking } from './shared/runtime/worker-tracking.js';
5
+ // Must match the tag used by the boot virtual `app.css` emitter in
6
+ // `helpers/main-entry.ts` so HMR's remove/add pair replaces the
7
+ // boot-time selectors instead of stacking on top of them.
8
+ export const APP_CSS_TAG = 'app.css';
9
+ function resolveTaggedCssApi(coreModule) {
10
+ const candidates = [coreModule, coreModule?.default, globalThis];
11
+ for (const candidate of candidates) {
12
+ if (!candidate)
13
+ continue;
14
+ const add = candidate.addTaggedAdditionalCSS;
15
+ const remove = candidate.removeTaggedAdditionalCSS;
16
+ if (typeof add === 'function' && typeof remove === 'function') {
17
+ return { add: add.bind(candidate), remove: remove.bind(candidate) };
18
+ }
19
+ }
20
+ return {};
21
+ }
22
+ function updateBootOverlay(stage, info) {
23
+ try {
24
+ const api = globalThis.__NS_HMR_DEV_OVERLAY__;
25
+ if (api && typeof api.setBootStage === 'function') {
26
+ api.setBootStage(stage, info);
27
+ }
28
+ }
29
+ catch { }
30
+ }
31
+ async function updateBootOverlayAndYield(stage, info) {
32
+ updateBootOverlay(stage, info);
33
+ await new Promise((resolve) => setTimeout(resolve, 0));
34
+ }
35
+ function prepareBootImportProgress(url, attempt, attempts) {
36
+ const g = globalThis;
37
+ g.__NS_HMR_BOOT_MAIN_URL__ = url;
38
+ g.__NS_HMR_BOOT_MAIN_ATTEMPT__ = attempt;
39
+ g.__NS_HMR_BOOT_MAIN_ATTEMPTS__ = attempts;
40
+ g.__NS_HMR_BOOT_MODULE_COUNT__ = 0;
41
+ g.__NS_HMR_BOOT_LAST_MODULE__ = '';
42
+ g.__NS_HMR_BOOT_LAST_PROGRESS__ = 0;
43
+ g.__NS_HMR_BOOT_LAST_PROGRESS_AT__ = 0;
44
+ g.__NS_HMR_BOOT_IMPORT_STARTED_AT__ = Date.now();
45
+ }
46
+ function clearBootImportProgress() {
47
+ const g = getGlobalScope();
48
+ delete g.__NS_HMR_BOOT_MAIN_URL__;
49
+ delete g.__NS_HMR_BOOT_MAIN_ATTEMPT__;
50
+ delete g.__NS_HMR_BOOT_MAIN_ATTEMPTS__;
51
+ delete g.__NS_HMR_BOOT_MODULE_COUNT__;
52
+ delete g.__NS_HMR_BOOT_LAST_MODULE__;
53
+ delete g.__NS_HMR_BOOT_LAST_PROGRESS__;
54
+ delete g.__NS_HMR_BOOT_LAST_PROGRESS_AT__;
55
+ delete g.__NS_HMR_BOOT_IMPORT_STARTED_AT__;
56
+ }
57
+ function buildBootImportDetail(url) {
58
+ const g = globalThis;
59
+ const count = Number(g.__NS_HMR_BOOT_MODULE_COUNT__ || 0);
60
+ const lastModule = typeof g.__NS_HMR_BOOT_LAST_MODULE__ === 'string' ? g.__NS_HMR_BOOT_LAST_MODULE__ : '';
61
+ const lines = [count > 0 ? `Evaluated ${count} modules` : 'Resolving the module graph'];
62
+ lines.push(lastModule || url);
63
+ return lines.join('\n');
64
+ }
65
+ // Inlined copy of `boot-progress.ts::computeBootImportProgress` +
66
+ // `applyMonotonicBootProgress`. This file is the device-side entry
67
+ // runtime for the http-bootloader fallback path; relative imports from
68
+ // `shared/runtime/` would cross the runtime boundary and slow
69
+ // first-byte. Keep the formula in sync with `boot-progress.ts` —
70
+ // `boot-progress.spec.ts` pins the canonical values.
71
+ function computeBootImportProgress() {
72
+ const g = globalThis;
73
+ const count = Number(g.__NS_HMR_BOOT_MODULE_COUNT__ || 0);
74
+ const startedAt = Number(g.__NS_HMR_BOOT_IMPORT_STARTED_AT__ || Date.now());
75
+ const elapsedMs = Math.max(0, Date.now() - startedAt);
76
+ const progressFromCount = Math.min(40, Math.floor(count / 2));
77
+ const progressFromTime = Math.min(62, Math.floor(elapsedMs / 250));
78
+ const candidate = Math.min(94, 30 + Math.min(62, progressFromCount + progressFromTime));
79
+ const previousRaw = g.__NS_HMR_BOOT_LAST_PROGRESS__;
80
+ const previous = typeof previousRaw === 'number' && Number.isFinite(previousRaw) ? previousRaw : 0;
81
+ const next = Math.max(previous, candidate);
82
+ try {
83
+ g.__NS_HMR_BOOT_LAST_PROGRESS__ = next;
84
+ }
85
+ catch { }
86
+ return next;
87
+ }
88
+ function startBootImportHeartbeat(url, attempt, attempts) {
89
+ // 250 ms cadence matches `session-bootstrap.ts::startBootImportHeartbeat`
90
+ // so both boot paths feel equally responsive.
91
+ const timer = setInterval(() => {
92
+ const g = globalThis;
93
+ if (g.__NS_HMR_BOOT_COMPLETE__) {
94
+ return;
95
+ }
96
+ updateBootOverlay('importing-main', {
97
+ detail: buildBootImportDetail(url),
98
+ attempt,
99
+ attempts,
100
+ progress: computeBootImportProgress(),
101
+ });
102
+ }, 250);
103
+ return () => clearInterval(timer);
104
+ }
105
+ export function installHttpCoreCssSupport(coreModule, verbose) {
106
+ try {
107
+ const g = getGlobalScope();
108
+ const core = coreModule?.default ?? coreModule;
109
+ const Application = (core && (typeof core.addCss === 'function' ? core : undefined)) || (core?.Application && typeof core.Application.addCss === 'function' ? core.Application : undefined) || (coreModule?.Application && typeof coreModule.Application.addCss === 'function' ? coreModule.Application : undefined) || g.Application;
110
+ if (!Application?.addCss) {
111
+ return null;
112
+ }
113
+ // Re-trigger styling on every reachable root view. The core bridge's
114
+ // Application realm is not always the realm whose Application.run()
115
+ // committed the root (monorepo per-module serving loads core through
116
+ // /ns/m/packages/... while the bridge re-exports @fs-spelled modules),
117
+ // so also consult the seeded global and the Application singletons the
118
+ // root-placeholder run-wrapper records in __NS_DEV_KNOWN_APPLICATIONS__.
119
+ const refreshRootViews = () => {
120
+ const candidates = [Application, g.Application];
121
+ try {
122
+ const known = g.__NS_DEV_KNOWN_APPLICATIONS__;
123
+ if (Array.isArray(known))
124
+ candidates.push(...known);
125
+ }
126
+ catch { }
127
+ const seenRoots = new Set();
128
+ for (const candidate of candidates) {
129
+ try {
130
+ const rootView = candidate?.getRootView?.();
131
+ if (!rootView || seenRoots.has(rootView))
132
+ continue;
133
+ seenRoots.add(rootView);
134
+ if (typeof rootView._onCssStateChange === 'function') {
135
+ rootView._onCssStateChange();
136
+ }
137
+ else {
138
+ const cls = rootView.className || '';
139
+ rootView.className = cls + ' ';
140
+ rootView.className = cls;
141
+ }
142
+ }
143
+ catch { }
144
+ }
145
+ };
146
+ // Replace selectors via remove + add tagged pair so deleted
147
+ // rules disappear (the additive `Application.addCss` cannot
148
+ // undo previously installed selectors).
149
+ const taggedCss = resolveTaggedCssApi(coreModule);
150
+ const applyCss = (cssText, refreshRoot = true) => {
151
+ if (typeof cssText !== 'string' || !cssText.length) {
152
+ return;
153
+ }
154
+ let appliedTagged = false;
155
+ if (taggedCss.add && taggedCss.remove) {
156
+ try {
157
+ taggedCss.remove(APP_CSS_TAG);
158
+ taggedCss.add(cssText, APP_CSS_TAG);
159
+ appliedTagged = true;
160
+ }
161
+ catch (taggedError) {
162
+ if (verbose)
163
+ console.warn('[ns-entry] tagged CSS replace failed, falling back to addCss:', taggedError?.message || taggedError);
164
+ }
165
+ }
166
+ if (!appliedTagged) {
167
+ Application.addCss(cssText);
168
+ }
169
+ if (!refreshRoot) {
170
+ return;
171
+ }
172
+ refreshRootViews();
173
+ };
174
+ g.__NS_HMR_APPLY_CSS__ = applyCss;
175
+ // Device CSS applier for the fallback HTTP-bootloader path (the native
176
+ // dev-session path installs the same one from `hmr/client`). Per-tag
177
+ // remove+add keeps each source independently replaceable on hot-update.
178
+ const registerCss = (tag, cssText) => {
179
+ if (typeof cssText !== 'string' || !cssText.length) {
180
+ return;
181
+ }
182
+ try {
183
+ if (taggedCss.add && taggedCss.remove) {
184
+ taggedCss.remove(tag);
185
+ taggedCss.add(cssText, tag);
186
+ }
187
+ else if (Application.addCss) {
188
+ Application.addCss(cssText);
189
+ }
190
+ }
191
+ catch (cssErr) {
192
+ if (verbose)
193
+ console.warn('[ns-entry] CSS register/apply failed for', tag, cssErr?.message || cssErr);
194
+ return;
195
+ }
196
+ // Live edit (boot complete): refresh the root so mounted views pick up
197
+ // the replaced selectors. Cold boot needs no refresh (views not built yet).
198
+ if (g.__NS_HMR_BOOT_COMPLETE__) {
199
+ refreshRootViews();
200
+ }
201
+ };
202
+ g.__NS_REGISTER_CSS__ = registerCss;
203
+ // Drain any CSS registered before this applier was installed.
204
+ try {
205
+ const pending = g.__NS_PENDING_CSS__;
206
+ if (pending && typeof pending === 'object') {
207
+ for (const pendingTag of Object.keys(pending)) {
208
+ registerCss(pendingTag, pending[pendingTag]);
209
+ }
210
+ g.__NS_PENDING_CSS__ = null;
211
+ }
212
+ }
213
+ catch { }
214
+ if (!g.__NS_HMR_HTTP_APP_CSS_APPLIED__) {
215
+ // Cold boot: prefer the pre-parsed rework AST stashed by
216
+ // `helpers/main-entry.ts` so the HTTP-core realm follows the
217
+ // SAME application path as the no-HMR rolldown bundle. If the
218
+ // AST isn't present (e.g. older bundle, future entry shape),
219
+ // fall back to the raw text path. Live HMR edits arriving via
220
+ // the dev-server WebSocket continue to use `applyCss(rawText)`
221
+ // — `addTaggedAdditionalCSS` accepts either via
222
+ // `CSSSource.fromDetect`.
223
+ const appCssAst = g.__NS_HMR_APP_CSS_AST__;
224
+ const appCssText = g.__NS_HMR_APP_CSS__;
225
+ let cssApplied = false;
226
+ if (appCssAst && typeof appCssAst === 'object' && taggedCss.add && taggedCss.remove) {
227
+ try {
228
+ taggedCss.remove(APP_CSS_TAG);
229
+ taggedCss.add(appCssAst, APP_CSS_TAG);
230
+ cssApplied = true;
231
+ if (verbose)
232
+ console.info('[ns-entry] app.css applied in HTTP core realm via AST');
233
+ }
234
+ catch (astError) {
235
+ if (verbose)
236
+ console.warn('[ns-entry] AST CSS apply failed, falling back to raw text:', astError?.message || astError);
237
+ }
238
+ }
239
+ if (!cssApplied && typeof appCssText === 'string' && appCssText.length) {
240
+ applyCss(appCssText);
241
+ cssApplied = true;
242
+ if (verbose)
243
+ console.info('[ns-entry] app.css applied in HTTP core realm via raw text');
244
+ }
245
+ if (cssApplied) {
246
+ g.__NS_HMR_HTTP_APP_CSS_APPLIED__ = true;
247
+ // On the http-bootloader path this install runs BEFORE the app
248
+ // mounts, so no refresh is needed. On the dev-session path the
249
+ // bootstrap installs this lazily AFTER boot completes — views
250
+ // are already mounted with stale (empty) styling, so re-style.
251
+ if (g.__NS_HMR_BOOT_COMPLETE__) {
252
+ refreshRootViews();
253
+ }
254
+ }
255
+ }
256
+ return applyCss;
257
+ }
258
+ catch (error) {
259
+ if (verbose)
260
+ console.warn('[ns-entry] failed to install HTTP core CSS support:', error?.message || error);
261
+ return null;
262
+ }
263
+ }
264
+ export async function preloadHttpCoreStyleScope(importHttp, origin, verbose) {
265
+ // Use the canonical, unversioned subpath form `/ns/core/ui/styling/style-scope`.
266
+ // Every consumer of `@nativescript/core/ui/styling/style-scope` (cold-boot
267
+ // preload here, app-side imports, vendor `require()` shims via the runtime
268
+ // import map) lands on the same URL string, so iOS's HTTP-ESM loader keys
269
+ // them to one module record and the style-scope module's class identity is
270
+ // shared across realms.
271
+ const url = String(origin || '') + '/ns/core/ui/styling/style-scope';
272
+ const t0 = Date.now();
273
+ try {
274
+ await importHttp(url);
275
+ if (verbose) {
276
+ console.info('[ns-entry] HTTP core style-scope preloaded');
277
+ }
278
+ return { ok: true, ms: Date.now() - t0, url };
279
+ }
280
+ catch (error) {
281
+ const result = { ok: false, ms: Date.now() - t0, url, err: String(error && (error.message || error)) };
282
+ if (verbose)
283
+ console.warn('[ns-entry] HTTP core style-scope preload failed:', error?.message || error);
284
+ return result;
285
+ }
286
+ }
2
287
  function parseStackUrlLineCol(err) {
3
288
  try {
4
289
  const stack = (err && (err.stack || err.message)) || '';
@@ -23,106 +308,324 @@ async function fetchCodeframe(u, line) {
23
308
  const num = String(i).padStart(4, ' ');
24
309
  context += `${mark}${num}: ${lines[i - 1]}\n`;
25
310
  }
26
- console.warn('[ns-entry][diag]', u === globalThis.__NS_ENTRY_LAST_TARGET__ ? 'sanitized' : 'raw', hash ? `(hash ${hash})` : '', '\n' + context);
311
+ if (globalThis.__NS_ENV_VERBOSE__)
312
+ console.warn('[ns-entry][diag]', u === globalThis.__NS_ENTRY_LAST_TARGET__ ? 'sanitized' : 'raw', hash ? `(hash ${hash})` : '', '\n' + context);
27
313
  }
28
314
  catch (fe) {
29
- try {
315
+ if (globalThis.__NS_ENV_VERBOSE__)
30
316
  console.warn('[ns-entry][diag] fetch failed', u, fe && (fe.message || fe));
31
- }
32
- catch { }
33
317
  }
34
318
  }
35
319
  export default async function startEntry(opts) {
320
+ const D = '[entry-rt-diag]';
36
321
  const ORIGIN = String(opts.origin || '');
37
322
  const MAIN = String(opts.main || `${__NS_APP_ROOT_VIRTUAL__}/app.ts`);
38
323
  const VER = String(opts.ver || '0');
39
324
  const VERBOSE = !!opts.verbose;
325
+ if (VERBOSE)
326
+ console.log(D, 'startEntry called', { origin: ORIGIN, main: MAIN, ver: VER });
327
+ // Track every `Worker` construction before any app/vendor module can
328
+ // evaluate (idempotent — the session-bootstrap path installs the same
329
+ // patch). The HMR client sweeps the tracked set before framework
330
+ // reboots; worker teardown is fully userland.
331
+ installWorkerConstructorTracking(getGlobalScope(), { verbose: VERBOSE });
40
332
  // Announce chosen origin globally for any consumers (e.g., HMR client or helpers)
41
333
  try {
42
334
  globalThis.__NS_HTTP_ORIGIN__ = ORIGIN;
43
335
  }
44
336
  catch { }
45
337
  // Module-local trace snapshot
46
- const TRACE = { version: VER, origin: ORIGIN, mainPath: MAIN, t0: Date.now(), preload: { rt: {}, core: {} }, main: {} };
338
+ const TRACE = { version: VER, origin: ORIGIN, mainPath: MAIN, t0: Date.now(), preload: { rt: {}, core: {}, coreStyleScope: {} }, main: {}, importMap: {} };
47
339
  // Native HTTP ESM import only.
48
340
  // Ensure a single canonical module realm.
49
341
  const importHttp = async (u) => {
50
342
  return await import(/* @vite-ignore */ u);
51
343
  };
52
344
  try {
53
- // Preload runtime bridge and core bridge
345
+ // Configure runtime with import map before loading any modules.
346
+ // This enables the native runtime to resolve bare specifiers through the
347
+ // import map instead of relying on Vite-side import rewriting.
348
+ //
349
+ // session-bootstrap may have already fetched the import map
350
+ // and configured the runtime before we were invoked. In that case the
351
+ // shared flag on globalThis lets us skip a redundant fetch (~100-200ms).
352
+ //
353
+ // once the import map is in place, the /ns/rt and /ns/core
354
+ // imports (plus the style-scope preload) are independent HTTP GETs. We
355
+ // fire them in parallel so the boot path is bounded by the slowest
356
+ // payload rather than the sum.
357
+ let configureLoader = readNsRuntimeDevHostApi(globalThis).configureLoader;
358
+ const g = globalThis;
359
+ const importMapPromise = (async () => {
360
+ if (typeof configureLoader !== 'function') {
361
+ // Re-resolve `ns:module` fresh — an earlier snapshot may have
362
+ // been taken through a stale or stubbed scope.
363
+ configureLoader = readNsRuntimeDevHostApi(globalThis).configureLoader;
364
+ }
365
+ if (typeof configureLoader !== 'function') {
366
+ // NOT verbose-gated: without the import map every bare specifier
367
+ // in served modules is unresolvable and the session degrades into
368
+ // an undebuggable stall. Surface the contract violation loudly.
369
+ console.error('[ns-entry] ns:module configureLoader is unavailable — the import map cannot be installed and bare-specifier imports WILL fail. Update @nativescript/ios to a runtime that provides the ns:module builtin module.');
370
+ return;
371
+ }
372
+ if (g.__NS_IMPORT_MAP_CONFIGURED__ === true) {
373
+ TRACE.importMap = { ok: true, ms: 0, cached: true };
374
+ if (VERBOSE)
375
+ console.info('[ns-entry] import map already configured by earlier boot stage');
376
+ return;
377
+ }
378
+ await updateBootOverlayAndYield('configuring-import-map', {
379
+ detail: ORIGIN + '/ns/import-map.json',
380
+ });
381
+ const t_imap = Date.now();
382
+ try {
383
+ const imapRes = await fetch(ORIGIN + '/ns/import-map.json');
384
+ if (imapRes.ok) {
385
+ const config = await imapRes.json();
386
+ configureLoader({
387
+ importMap: config.importMap,
388
+ volatilePatterns: config.volatilePatterns,
389
+ // Server-owned URL vocabulary for the runtime's canonical-key
390
+ // function; runtimes that predate the field ignore it.
391
+ ...(config.canonicalization && typeof config.canonicalization === 'object' ? { canonicalization: config.canonicalization } : {}),
392
+ });
393
+ try {
394
+ g.__NS_IMPORT_MAP_CONFIGURED__ = true;
395
+ }
396
+ catch { }
397
+ TRACE.importMap = { ok: true, ms: Date.now() - t_imap, entries: Object.keys(config.importMap?.imports || {}).length };
398
+ if (VERBOSE)
399
+ console.info('[ns-entry] import map configured with', TRACE.importMap.entries, 'entries');
400
+ }
401
+ else {
402
+ TRACE.importMap = { ok: false, ms: Date.now() - t_imap, status: imapRes.status };
403
+ if (VERBOSE)
404
+ console.warn('[ns-entry] import map fetch failed:', imapRes.status);
405
+ }
406
+ }
407
+ catch (e_imap) {
408
+ TRACE.importMap = { ok: false, ms: Date.now() - t_imap, err: String(e_imap && (e_imap.message || e_imap)) };
409
+ if (VERBOSE)
410
+ console.warn('[ns-entry] import map error:', e_imap?.message);
411
+ }
412
+ })();
413
+ // Start the runtime bridge preload as soon as the import map is ready.
414
+ // Any bare-specifier resolution inside /ns/rt depends on the import map,
415
+ // so we chain it after importMapPromise — but otherwise let it race.
416
+ // Canonical (unversioned) URL: one module record per bridge, matching
417
+ // every served-module import of `/ns/rt`.
54
418
  const t_rt = Date.now();
55
- try {
56
- await importHttp(ORIGIN + '/ns/rt/' + VER);
57
- TRACE.preload.rt = { ok: true, ms: Date.now() - t_rt, url: ORIGIN + '/ns/rt/' + VER };
58
- }
59
- catch (e_rt) {
60
- TRACE.preload.rt = { ok: false, ms: Date.now() - t_rt, url: ORIGIN + '/ns/rt/' + VER, err: String(e_rt && (e_rt.message || e_rt)) };
61
- }
419
+ const RT_URL = ORIGIN + '/ns/rt';
420
+ const rtPromise = importMapPromise.then(async () => {
421
+ await updateBootOverlayAndYield('loading-runtime-bridge', {
422
+ detail: RT_URL,
423
+ });
424
+ try {
425
+ const mod = await importHttp(RT_URL);
426
+ TRACE.preload.rt = { ok: true, ms: Date.now() - t_rt, url: RT_URL };
427
+ return mod;
428
+ }
429
+ catch (e_rt) {
430
+ TRACE.preload.rt = { ok: false, ms: Date.now() - t_rt, url: RT_URL, err: String(e_rt && (e_rt.message || e_rt)) };
431
+ console.warn('[ns-entry] /ns/rt preload failed:', e_rt && (e_rt.message || e_rt));
432
+ return null;
433
+ }
434
+ });
435
+ // /ns/core and the style-scope preload are both core-realm side effects
436
+ // that run independently of /ns/rt. We fire them in parallel with rt so
437
+ // the aggregate cost is max(rt, core, styleScope) instead of the sum.
438
+ // Preload the canonical, unversioned `/ns/core` URL so this cold-boot
439
+ // fetch shares an iOS HTTP-ESM module record (and a single class-
440
+ // identity realm) with vendor `require('@nativescript/core')` lookups
441
+ // resolved through the runtime import map, the `/ns/rt` bridge's
442
+ // dynamic core import, and every served-module import. Threading a
443
+ // `/<version>` segment here would create two separate module records
444
+ // for byte-identical content, splitting `Frame`/`Page`/`View` class
445
+ // identity across the boundary and leaving the dev placeholder root
446
+ // visible after `Application.resetRootView(realFrame)` no-ops via a
447
+ // failed `instanceof Frame` check.
62
448
  const t_core = Date.now();
63
- try {
64
- await importHttp(ORIGIN + '/ns/core/' + VER);
65
- TRACE.preload.core = { ok: true, ms: Date.now() - t_core, url: ORIGIN + '/ns/core/' + VER };
66
- }
67
- catch (e_core) {
68
- TRACE.preload.core = { ok: false, ms: Date.now() - t_core, url: ORIGIN + '/ns/core/' + VER, err: String(e_core && (e_core.message || e_core)) };
449
+ const CORE_URL = ORIGIN + '/ns/core';
450
+ const corePromise = importMapPromise.then(async () => {
451
+ await updateBootOverlayAndYield('loading-core-bridge', {
452
+ detail: CORE_URL,
453
+ });
454
+ try {
455
+ const mod = await importHttp(CORE_URL);
456
+ TRACE.preload.core = { ok: true, ms: Date.now() - t_core, url: CORE_URL };
457
+ return mod;
458
+ }
459
+ catch (e_core) {
460
+ TRACE.preload.core = { ok: false, ms: Date.now() - t_core, url: CORE_URL, err: String(e_core && (e_core.message || e_core)) };
461
+ console.warn('[ns-entry] /ns/core preload failed:', e_core && (e_core.message || e_core));
462
+ return null;
463
+ }
464
+ });
465
+ const STYLE_SCOPE_URL = ORIGIN + '/ns/core/ui/styling/style-scope';
466
+ const styleScopePromise = importMapPromise.then(async () => {
467
+ await updateBootOverlayAndYield('preloading-style-scope', {
468
+ detail: STYLE_SCOPE_URL,
469
+ });
470
+ return preloadHttpCoreStyleScope(importHttp, ORIGIN, VERBOSE);
471
+ });
472
+ // Wait for all parallel preloads to resolve. Rejections are already
473
+ // absorbed inside each wrapper, so Promise.all never throws here.
474
+ const [, coreBridge, styleScopeResult] = await Promise.all([rtPromise, corePromise, styleScopePromise]);
475
+ TRACE.preload.coreStyleScope = styleScopeResult;
476
+ if (coreBridge) {
477
+ await updateBootOverlayAndYield('installing-css', {
478
+ detail: 'Applying app.css in the shared HTTP core realm.',
479
+ });
480
+ installHttpCoreCssSupport(coreBridge, VERBOSE);
69
481
  }
482
+ // Canonical entry URL — no `__ns_boot__` path decoration. The
483
+ // boot-progress snippet is injected self-gating by the /ns/m module
484
+ // server (it no-ops once `__NS_HMR_BOOT_COMPLETE__` flips), so the
485
+ // entry URL matches the steady-state HMR form and shares one module
486
+ // identity. `?v=` is a dev-endpoint query the runtime canonicalizer
487
+ // strips from the cache key.
70
488
  const MAIN_URL = ORIGIN + '/ns/m' + MAIN + '?v=' + VER;
489
+ const MAIN_IMPORT_URL = MAIN_URL;
71
490
  if (VERBOSE)
72
- console.info('[ns-entry] entry importing', MAIN_URL);
73
- globalThis.__NS_ENTRY_LAST_TARGET__ = MAIN_URL; // used by fetchCodeframe sanitized-vs-raw tag
491
+ console.log(D, 'importing main module:', MAIN_URL);
492
+ globalThis.__NS_ENTRY_LAST_TARGET__ = MAIN_IMPORT_URL; // used by fetchCodeframe sanitized-vs-raw tag
74
493
  const t_main = Date.now();
75
494
  let lastMainErr = null;
76
495
  for (let attempt = 0; attempt < 6; attempt++) {
496
+ prepareBootImportProgress(MAIN_URL, attempt + 1, 6);
497
+ const stopBootImportHeartbeat = startBootImportHeartbeat(MAIN_URL, attempt + 1, 6);
77
498
  try {
78
- const url = attempt === 0 ? MAIN_URL : MAIN_URL + '&r=' + String(Date.now());
499
+ await updateBootOverlayAndYield('importing-main', {
500
+ detail: buildBootImportDetail(MAIN_URL),
501
+ attempt: attempt + 1,
502
+ attempts: 6,
503
+ progress: computeBootImportProgress(),
504
+ });
505
+ const url = attempt === 0 ? MAIN_IMPORT_URL : MAIN_IMPORT_URL + '&r=' + String(Date.now());
506
+ if (VERBOSE)
507
+ console.log(D, 'import attempt', attempt, url);
79
508
  await importHttp(url);
509
+ if (VERBOSE)
510
+ console.log(D, 'import succeeded on attempt', attempt, 'took', Date.now() - t_main, 'ms');
80
511
  lastMainErr = null;
81
512
  break;
82
513
  }
83
514
  catch (e_main) {
84
515
  lastMainErr = e_main;
516
+ if (VERBOSE)
517
+ console.log(D, 'import attempt', attempt, 'FAILED:', e_main?.message || e_main);
85
518
  // brief backoff; allows dev server and device network to settle
86
519
  await new Promise((r) => setTimeout(r, 150 + attempt * 150));
87
520
  }
521
+ finally {
522
+ stopBootImportHeartbeat();
523
+ }
88
524
  }
525
+ clearBootImportProgress();
89
526
  if (lastMainErr)
90
527
  throw lastMainErr;
91
- TRACE.main = { ok: true, ms: Date.now() - t_main, url: MAIN_URL };
528
+ TRACE.main = { ok: true, ms: Date.now() - t_main, url: MAIN_IMPORT_URL };
529
+ await updateBootOverlayAndYield('waiting-for-app', {
530
+ detail: 'Waiting for the real application root to replace the boot placeholder.',
531
+ });
92
532
  globalThis.__NS_ENTRY_OK__ = true;
93
- // Detect whether the early placeholder was installed; defer restoration until after a safe reset
94
- let hadPlaceholder = false;
533
+ updateBootOverlay('ready', {
534
+ detail: 'HTTP HMR boot is ready. The app root should take over now.',
535
+ });
536
+ if (VERBOSE)
537
+ console.log(D, '__NS_HMR_BOOT_COMPLETE__ = true');
538
+ // Flips the JS global AND the native cold-boot gate
539
+ // (ns:module `setDevBootComplete`) so the runtime stops pumping the
540
+ // JS-thread runloop between synchronous fetches.
541
+ markDevBootComplete();
542
+ // Belt-and-suspenders: kick off the placeholder finalize poll now. The
543
+ // `Application.resetRootView` wrapper (installed by `installRootPlaceholder`
544
+ // or `installCoreAliasesEarly`) is the primary trigger, but on Android
545
+ // HTTP HMR boot the early hook can silently fail to install (it runs
546
+ // before `@nativescript/core/bundle-entry-points` loads, when
547
+ // `g.Application` is still `undefined`). Calling the restore hook here
548
+ // runs `tryFinalizeBootPlaceholder` immediately and, if the real root
549
+ // isn't committed yet (it usually isn't — Angular bootstrap is still
550
+ // async), schedules a ~100 ms poll that succeeds the moment the
551
+ // framework's `Application.run({ create })` or `resetRootView()` call
552
+ // commits a non-placeholder root. Without this safety net Android can
553
+ // hang at "Waiting for the app root view (94 %)" indefinitely.
95
554
  try {
96
- const g = globalThis;
97
- hadPlaceholder = !!(g && g.__NS_DEV_PLACEHOLDER_ROOT_EARLY__);
555
+ const g = getGlobalScope();
556
+ const restorePlaceholder = g.__NS_DEV_RESTORE_PLACEHOLDER__;
557
+ // Verbose-gated: if an app-root stall surfaces (e.g. Android
558
+ // hanging at "Waiting for the app root view"), flip
559
+ // `verbose: true` in the HMR config to see this plus the
560
+ // matching `[ns-placeholder][diag]` chain.
561
+ try {
562
+ if (VERBOSE) {
563
+ console.warn('[ns-entry][diag] main import done; kicking placeholder finalize', {
564
+ hasRestoreCallback: typeof restorePlaceholder === 'function',
565
+ hasPlaceholderRoot: !!g.__NS_DEV_PLACEHOLDER_ROOT_VIEW__,
566
+ hasApplication: !!(g.__NS_DEV_PLACEHOLDER_APPLICATION__ || g.Application),
567
+ });
568
+ }
569
+ }
570
+ catch { }
571
+ if (typeof restorePlaceholder === 'function') {
572
+ restorePlaceholder('main-import-done');
573
+ if (VERBOSE)
574
+ console.log(D, 'kicked __NS_DEV_RESTORE_PLACEHOLDER__ after main import');
575
+ }
98
576
  }
99
577
  catch { }
100
- // Placeholder detected: delegate root replacement to the HMR client.
101
- // Keep entry-runtime hands-off to avoid contention and duplicated logic.
102
- if (!hadPlaceholder) {
103
- if (VERBOSE)
104
- console.info('[ns-entry] no placeholder root detected; nothing to handoff');
105
- }
106
- else {
107
- if (VERBOSE)
108
- console.info('[ns-entry] placeholder present; delegating root reset to HMR client');
578
+ // The placeholder patches Application.run() → resetRootView(), so the
579
+ // app's Application.run() call in the main module transparently replaced
580
+ // the placeholder with the real app UI. Restore original run() now.
581
+ try {
582
+ const g = getGlobalScope();
583
+ if (typeof g.__NS_DEV_ORIGINAL_APP_RUN__ === 'function') {
584
+ // Restore original Application.run on ALL targets (mirrors placeholder patching)
585
+ const origRun = g.__NS_DEV_ORIGINAL_APP_RUN__;
586
+ const Application = g.Application || (g.__nsVendorRegistry?.get?.('@nativescript/core') || {}).Application;
587
+ if (Application) {
588
+ Application.run = origRun;
589
+ try {
590
+ const proto = Object.getPrototypeOf(Application);
591
+ if (proto && proto.run !== origRun)
592
+ proto.run = origRun;
593
+ }
594
+ catch { }
595
+ }
596
+ // Also restore on vendor-registry Application if different
597
+ try {
598
+ const reg = g.__nsVendorRegistry;
599
+ const vendorMod = reg?.get?.('@nativescript/core');
600
+ const vendorApp = vendorMod?.Application || vendorMod?.default?.Application;
601
+ if (vendorApp && vendorApp !== Application && vendorApp.run !== origRun) {
602
+ vendorApp.run = origRun;
603
+ }
604
+ }
605
+ catch { }
606
+ delete g.__NS_DEV_ORIGINAL_APP_RUN__;
607
+ if (VERBOSE)
608
+ console.log(D, 'restored original Application.run');
609
+ }
109
610
  }
611
+ catch { }
110
612
  }
111
613
  catch (e) {
614
+ clearBootImportProgress();
112
615
  const errInfo = { message: String(e && (e.message || e)), stack: e && e.stack ? String(e.stack) : '' };
113
616
  const loc = parseStackUrlLineCol(e);
114
617
  const TARGET = loc.url || globalThis.__NS_ENTRY_LAST_TARGET__;
115
618
  errInfo.url = loc.url;
116
619
  errInfo.line = loc.line;
117
620
  errInfo.column = loc.column;
621
+ updateBootOverlay('error', {
622
+ detail: errInfo.message,
623
+ });
118
624
  globalThis.__NS_ENTRY_ERROR__ = errInfo;
119
625
  TRACE.error = errInfo;
120
- try {
121
- console.error('[ns-entry] failed to import main via HTTP', errInfo.message);
122
- if (errInfo.stack && VERBOSE)
123
- console.error(errInfo.stack);
124
- }
125
- catch { }
626
+ console.error('[ns-entry] failed to import main via HTTP', errInfo.message);
627
+ if (errInfo.stack && VERBOSE)
628
+ console.error(errInfo.stack);
126
629
  // Always provide minimal diagnostics on error, even if verbose=false
127
630
  try {
128
631
  const urls = [TARGET];
@@ -143,6 +646,26 @@ export default async function startEntry(opts) {
143
646
  try {
144
647
  TRACE.t1 = Date.now();
145
648
  globalThis.__NS_ENTRY_TRACE__ = TRACE;
649
+ // Always print a concise, human-readable boot timeline so anyone
650
+ // investigating perf can see before/after numbers without flipping
651
+ // the verbose flag. Verbose mode still gets the full JSON dump.
652
+ try {
653
+ const parts = [];
654
+ const push = (label, ms) => {
655
+ if (typeof ms === 'number')
656
+ parts.push(`${label}=${ms}ms`);
657
+ };
658
+ push('importMap', TRACE.importMap?.ms);
659
+ push('rt', TRACE.preload?.rt?.ms);
660
+ push('core', TRACE.preload?.core?.ms);
661
+ push('styleScope', TRACE.preload?.coreStyleScope?.ms);
662
+ push('main', TRACE.main?.ms);
663
+ const total = typeof TRACE.t0 === 'number' && typeof TRACE.t1 === 'number' ? TRACE.t1 - TRACE.t0 : undefined;
664
+ push('total', total);
665
+ const status = TRACE.error ? 'FAILED' : 'ok';
666
+ console.info(`[ns-entry][boot] ${status} ${parts.join(' ')}`);
667
+ }
668
+ catch { }
146
669
  if (VERBOSE)
147
670
  console.info('[ns-entry][trace]', JSON.stringify(TRACE));
148
671
  }