@nativescript/vite 8.0.0-alpha.5 → 8.0.0-alpha.50

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 (424) hide show
  1. package/README.md +51 -11
  2. package/bin/cli.cjs +8 -14
  3. package/configuration/angular.d.ts +34 -1
  4. package/configuration/angular.js +376 -165
  5. package/configuration/angular.js.map +1 -1
  6. package/configuration/base.js +241 -51
  7. package/configuration/base.js.map +1 -1
  8. package/configuration/javascript.js +14 -93
  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 +51 -6
  13. package/configuration/solid.js.map +1 -1
  14. package/configuration/typescript.js +12 -93
  15. package/configuration/typescript.js.map +1 -1
  16. package/helpers/app-components.d.ts +2 -1
  17. package/helpers/app-components.js.map +1 -1
  18. package/helpers/app-css-state.d.ts +8 -0
  19. package/helpers/app-css-state.js +8 -0
  20. package/helpers/app-css-state.js.map +1 -0
  21. package/helpers/bundler-context.d.ts +11 -0
  22. package/helpers/bundler-context.js +71 -0
  23. package/helpers/bundler-context.js.map +1 -0
  24. package/helpers/cli-flags.d.ts +12 -0
  25. package/helpers/cli-flags.js +34 -0
  26. package/helpers/cli-flags.js.map +1 -1
  27. package/helpers/css-platform-plugin.d.ts +14 -0
  28. package/helpers/css-platform-plugin.js +43 -25
  29. package/helpers/css-platform-plugin.js.map +1 -1
  30. package/helpers/dev-host.d.ts +360 -0
  31. package/helpers/dev-host.js +694 -0
  32. package/helpers/dev-host.js.map +1 -0
  33. package/helpers/dynamic-import-plugin.js +1 -1
  34. package/helpers/dynamic-import-plugin.js.map +1 -1
  35. package/helpers/esbuild-platform-resolver.js +4 -1
  36. package/helpers/esbuild-platform-resolver.js.map +1 -1
  37. package/helpers/external-configs.d.ts +10 -12
  38. package/helpers/external-configs.js +58 -35
  39. package/helpers/external-configs.js.map +1 -1
  40. package/helpers/global-defines.d.ts +142 -0
  41. package/helpers/global-defines.js +213 -11
  42. package/helpers/global-defines.js.map +1 -1
  43. package/helpers/hmr-scope.d.ts +26 -0
  44. package/helpers/hmr-scope.js +67 -0
  45. package/helpers/hmr-scope.js.map +1 -0
  46. package/helpers/init.js +0 -18
  47. package/helpers/init.js.map +1 -1
  48. package/helpers/logging.d.ts +1 -0
  49. package/helpers/logging.js +65 -4
  50. package/helpers/logging.js.map +1 -1
  51. package/helpers/main-entry.d.ts +3 -1
  52. package/helpers/main-entry.js +301 -53
  53. package/helpers/main-entry.js.map +1 -1
  54. package/helpers/nativeclass-esbuild-plugin.d.ts +2 -1
  55. package/helpers/nativeclass-esbuild-plugin.js.map +1 -1
  56. package/helpers/nativeclass-transform.js +5 -6
  57. package/helpers/nativeclass-transform.js.map +1 -1
  58. package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
  59. package/helpers/nativeclass-transformer-plugin.js +157 -14
  60. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  61. package/helpers/nativescript-package-resolver.js +10 -62
  62. package/helpers/nativescript-package-resolver.js.map +1 -1
  63. package/helpers/normalize-id.d.ts +42 -0
  64. package/helpers/normalize-id.js +60 -0
  65. package/helpers/normalize-id.js.map +1 -0
  66. package/helpers/ns-core-url.d.ts +29 -7
  67. package/helpers/ns-core-url.js +69 -12
  68. package/helpers/ns-core-url.js.map +1 -1
  69. package/helpers/optimize-deps.d.ts +16 -0
  70. package/helpers/optimize-deps.js +17 -0
  71. package/helpers/optimize-deps.js.map +1 -0
  72. package/helpers/package-platform-aliases.js +34 -49
  73. package/helpers/package-platform-aliases.js.map +1 -1
  74. package/helpers/platform-types.d.ts +2 -0
  75. package/helpers/platform-types.js +2 -0
  76. package/helpers/platform-types.js.map +1 -0
  77. package/helpers/postcss-platform-config.d.ts +17 -1
  78. package/helpers/postcss-platform-config.js +20 -37
  79. package/helpers/postcss-platform-config.js.map +1 -1
  80. package/helpers/project.d.ts +35 -0
  81. package/helpers/project.js +120 -2
  82. package/helpers/project.js.map +1 -1
  83. package/helpers/resolve-main-field-platform.d.ts +20 -0
  84. package/helpers/resolve-main-field-platform.js +49 -0
  85. package/helpers/resolve-main-field-platform.js.map +1 -0
  86. package/helpers/resolver.js +17 -2
  87. package/helpers/resolver.js.map +1 -1
  88. package/helpers/theme-core-plugins.js +1 -1
  89. package/helpers/theme-core-plugins.js.map +1 -1
  90. package/helpers/ts-config-paths.d.ts +14 -0
  91. package/helpers/ts-config-paths.js +90 -9
  92. package/helpers/ts-config-paths.js.map +1 -1
  93. package/helpers/typescript-check.d.ts +2 -1
  94. package/helpers/typescript-check.js +2 -2
  95. package/helpers/typescript-check.js.map +1 -1
  96. package/helpers/ui-registration.d.ts +21 -0
  97. package/helpers/ui-registration.js +156 -0
  98. package/helpers/ui-registration.js.map +1 -0
  99. package/helpers/utils.d.ts +9 -0
  100. package/helpers/utils.js +22 -2
  101. package/helpers/utils.js.map +1 -1
  102. package/helpers/workers.d.ts +20 -19
  103. package/helpers/workers.js +624 -4
  104. package/helpers/workers.js.map +1 -1
  105. package/hmr/client/css-handler.d.ts +2 -1
  106. package/hmr/client/css-handler.js +50 -26
  107. package/hmr/client/css-handler.js.map +1 -1
  108. package/hmr/client/css-update-overlay.d.ts +18 -0
  109. package/hmr/client/css-update-overlay.js +27 -0
  110. package/hmr/client/css-update-overlay.js.map +1 -0
  111. package/hmr/client/framework-client-strategy.d.ts +79 -0
  112. package/hmr/client/framework-client-strategy.js +19 -0
  113. package/hmr/client/framework-client-strategy.js.map +1 -0
  114. package/hmr/client/hmr-pending-overlay.d.ts +13 -0
  115. package/hmr/client/hmr-pending-overlay.js +60 -0
  116. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  117. package/hmr/client/index.js +891 -220
  118. package/hmr/client/index.js.map +1 -1
  119. package/hmr/client/utils.d.ts +7 -1
  120. package/hmr/client/utils.js +207 -29
  121. package/hmr/client/utils.js.map +1 -1
  122. package/hmr/entry-runtime.d.ts +2 -1
  123. package/hmr/entry-runtime.js +256 -69
  124. package/hmr/entry-runtime.js.map +1 -1
  125. package/hmr/frameworks/angular/build/angular-linker.d.ts +12 -0
  126. package/hmr/frameworks/angular/build/angular-linker.js +109 -0
  127. package/hmr/frameworks/angular/build/angular-linker.js.map +1 -0
  128. package/hmr/frameworks/angular/build/inject-component-hmr-registration.d.ts +112 -0
  129. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js +291 -0
  130. package/hmr/frameworks/angular/build/inject-component-hmr-registration.js.map +1 -0
  131. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.d.ts +75 -0
  132. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js +221 -0
  133. package/hmr/frameworks/angular/build/inject-hmr-vite-ignore.js.map +1 -0
  134. package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.js +1 -170
  135. package/hmr/frameworks/angular/build/inline-decorator-component-templates.js.map +1 -0
  136. package/hmr/frameworks/angular/build/js-lexer.d.ts +4 -0
  137. package/{helpers/angular/synthesize-decorator-ctor-parameters.js → hmr/frameworks/angular/build/js-lexer.js} +22 -96
  138. package/hmr/frameworks/angular/build/js-lexer.js.map +1 -0
  139. package/hmr/frameworks/angular/build/shared-linker.d.ts +39 -0
  140. package/hmr/frameworks/angular/build/shared-linker.js +128 -0
  141. package/hmr/frameworks/angular/build/shared-linker.js.map +1 -0
  142. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js +88 -0
  143. package/hmr/frameworks/angular/build/synthesize-decorator-ctor-parameters.js.map +1 -0
  144. package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.js +1 -174
  145. package/hmr/frameworks/angular/build/synthesize-injectable-factories.js.map +1 -0
  146. package/{helpers/angular → hmr/frameworks/angular/build}/util.d.ts +1 -0
  147. package/hmr/frameworks/angular/build/util.js +155 -0
  148. package/hmr/frameworks/angular/build/util.js.map +1 -0
  149. package/hmr/frameworks/angular/client/index.d.ts +1 -0
  150. package/hmr/frameworks/angular/client/index.js +859 -21
  151. package/hmr/frameworks/angular/client/index.js.map +1 -1
  152. package/hmr/frameworks/angular/client/strategy.d.ts +9 -0
  153. package/hmr/frameworks/angular/client/strategy.js +19 -0
  154. package/hmr/frameworks/angular/client/strategy.js.map +1 -0
  155. package/hmr/frameworks/angular/server/angular-root-component.d.ts +79 -0
  156. package/hmr/frameworks/angular/server/angular-root-component.js +149 -0
  157. package/hmr/frameworks/angular/server/angular-root-component.js.map +1 -0
  158. package/hmr/frameworks/angular/server/linker.js +1 -4
  159. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  160. package/hmr/frameworks/angular/server/strategy.js +460 -12
  161. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  162. package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.js +2 -2
  163. package/hmr/frameworks/angular/server/websocket-angular-entry.js.map +1 -0
  164. package/hmr/{server → frameworks/angular/server}/websocket-angular-hot-update.d.ts +17 -11
  165. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +336 -0
  166. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -0
  167. package/hmr/frameworks/react/server/strategy.d.ts +2 -0
  168. package/hmr/frameworks/react/server/strategy.js +150 -0
  169. package/hmr/frameworks/react/server/strategy.js.map +1 -0
  170. package/hmr/frameworks/solid/build/solid-jsx-deps.d.ts +15 -0
  171. package/hmr/frameworks/solid/build/solid-jsx-deps.js +178 -0
  172. package/hmr/frameworks/solid/build/solid-jsx-deps.js.map +1 -0
  173. package/hmr/frameworks/solid/client/app-runtime.d.ts +54 -0
  174. package/hmr/frameworks/solid/client/app-runtime.js +184 -0
  175. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -0
  176. package/hmr/frameworks/solid/server/strategy.js +291 -16
  177. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  178. package/hmr/frameworks/typescript/server/strategy.js +38 -14
  179. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  180. package/hmr/frameworks/vue/client/dep-propagation.d.ts +36 -0
  181. package/hmr/frameworks/vue/client/dep-propagation.js +101 -0
  182. package/hmr/frameworks/vue/client/dep-propagation.js.map +1 -0
  183. package/hmr/frameworks/vue/client/index.d.ts +8 -0
  184. package/hmr/frameworks/vue/client/index.js +56 -243
  185. package/hmr/frameworks/vue/client/index.js.map +1 -1
  186. package/hmr/frameworks/vue/client/strategy.d.ts +33 -0
  187. package/hmr/frameworks/vue/client/strategy.js +157 -0
  188. package/hmr/frameworks/vue/client/strategy.js.map +1 -0
  189. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +49 -0
  190. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +142 -0
  191. package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -0
  192. package/hmr/frameworks/vue/server/sfc-route-assemble.d.ts +7 -0
  193. package/hmr/frameworks/vue/server/sfc-route-assemble.js +747 -0
  194. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -0
  195. package/hmr/frameworks/vue/server/sfc-route-meta.d.ts +7 -0
  196. package/hmr/frameworks/vue/server/sfc-route-meta.js +80 -0
  197. package/hmr/frameworks/vue/server/sfc-route-meta.js.map +1 -0
  198. package/hmr/frameworks/vue/server/sfc-route-serve.d.ts +8 -0
  199. package/hmr/frameworks/vue/server/sfc-route-serve.js +459 -0
  200. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -0
  201. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +38 -0
  202. package/hmr/frameworks/vue/server/sfc-route-shared.js +48 -0
  203. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -0
  204. package/hmr/frameworks/vue/server/strategy.d.ts +35 -0
  205. package/hmr/frameworks/vue/server/strategy.js +278 -1
  206. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  207. package/hmr/frameworks/vue/server/websocket-sfc.d.ts +15 -0
  208. package/hmr/frameworks/vue/server/websocket-sfc.js +20 -0
  209. package/hmr/frameworks/vue/server/websocket-sfc.js.map +1 -0
  210. package/hmr/helpers/ast-normalizer.d.ts +3 -1
  211. package/hmr/helpers/ast-normalizer.js +77 -10
  212. package/hmr/helpers/ast-normalizer.js.map +1 -1
  213. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  214. package/hmr/helpers/cjs-named-exports.js +152 -0
  215. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  216. package/hmr/helpers/package-exports.d.ts +16 -0
  217. package/hmr/helpers/package-exports.js +396 -0
  218. package/hmr/helpers/package-exports.js.map +1 -0
  219. package/hmr/server/constants.js +20 -5
  220. package/hmr/server/constants.js.map +1 -1
  221. package/hmr/server/core-sanitize.d.ts +86 -7
  222. package/hmr/server/core-sanitize.js +170 -45
  223. package/hmr/server/core-sanitize.js.map +1 -1
  224. package/hmr/server/device-transform-helpers.d.ts +24 -0
  225. package/hmr/server/device-transform-helpers.js +408 -0
  226. package/hmr/server/device-transform-helpers.js.map +1 -0
  227. package/hmr/server/framework-strategy.d.ts +108 -11
  228. package/hmr/server/hmr-module-graph.d.ts +37 -0
  229. package/hmr/server/hmr-module-graph.js +214 -0
  230. package/hmr/server/hmr-module-graph.js.map +1 -0
  231. package/hmr/server/import-map.d.ts +11 -2
  232. package/hmr/server/import-map.js +92 -45
  233. package/hmr/server/import-map.js.map +1 -1
  234. package/hmr/server/index.js +7 -16
  235. package/hmr/server/index.js.map +1 -1
  236. package/hmr/server/ns-core-cjs-shape.d.ts +2 -4
  237. package/hmr/server/ns-core-cjs-shape.js +4 -6
  238. package/hmr/server/ns-core-cjs-shape.js.map +1 -1
  239. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  240. package/hmr/server/ns-rt-bridge.js +131 -0
  241. package/hmr/server/ns-rt-bridge.js.map +1 -0
  242. package/hmr/server/ns-rt-route.d.ts +5 -0
  243. package/hmr/server/ns-rt-route.js +38 -0
  244. package/hmr/server/ns-rt-route.js.map +1 -0
  245. package/hmr/server/perf-instrumentation.d.ts +114 -0
  246. package/hmr/server/perf-instrumentation.js +197 -0
  247. package/hmr/server/perf-instrumentation.js.map +1 -0
  248. package/hmr/server/process-code-for-device.d.ts +14 -0
  249. package/hmr/server/process-code-for-device.js +699 -0
  250. package/hmr/server/process-code-for-device.js.map +1 -0
  251. package/hmr/server/require-guard.d.ts +1 -0
  252. package/hmr/server/require-guard.js +12 -0
  253. package/hmr/server/require-guard.js.map +1 -0
  254. package/hmr/server/rewrite-imports.d.ts +2 -0
  255. package/hmr/server/rewrite-imports.js +630 -0
  256. package/hmr/server/rewrite-imports.js.map +1 -0
  257. package/hmr/server/route-helpers.d.ts +7 -0
  258. package/hmr/server/route-helpers.js +13 -0
  259. package/hmr/server/route-helpers.js.map +1 -0
  260. package/hmr/server/server-origin.d.ts +2 -0
  261. package/hmr/server/server-origin.js +83 -0
  262. package/hmr/server/server-origin.js.map +1 -0
  263. package/hmr/server/shared-transform-request.js +13 -7
  264. package/hmr/server/shared-transform-request.js.map +1 -1
  265. package/hmr/server/transform-cache-invalidation.d.ts +37 -0
  266. package/hmr/server/transform-cache-invalidation.js +156 -0
  267. package/hmr/server/transform-cache-invalidation.js.map +1 -0
  268. package/hmr/server/vendor-bare-module-shims.d.ts +4 -0
  269. package/hmr/server/vendor-bare-module-shims.js +80 -0
  270. package/hmr/server/vendor-bare-module-shims.js.map +1 -0
  271. package/hmr/server/vite-plugin.js +78 -42
  272. package/hmr/server/vite-plugin.js.map +1 -1
  273. package/hmr/server/websocket-core-bridge.d.ts +45 -4
  274. package/hmr/server/websocket-core-bridge.js +50 -48
  275. package/hmr/server/websocket-core-bridge.js.map +1 -1
  276. package/hmr/server/websocket-css-hot-update.d.ts +33 -0
  277. package/hmr/server/websocket-css-hot-update.js +65 -0
  278. package/hmr/server/websocket-css-hot-update.js.map +1 -0
  279. package/hmr/server/websocket-device-transform.d.ts +3 -0
  280. package/hmr/server/websocket-device-transform.js +7 -0
  281. package/hmr/server/websocket-device-transform.js.map +1 -0
  282. package/hmr/server/websocket-graph-upsert.d.ts +15 -0
  283. package/hmr/server/websocket-graph-upsert.js +20 -0
  284. package/hmr/server/websocket-graph-upsert.js.map +1 -1
  285. package/hmr/server/websocket-hmr-pending.d.ts +37 -0
  286. package/hmr/server/websocket-hmr-pending.js +55 -0
  287. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  288. package/hmr/server/websocket-hot-update.d.ts +77 -0
  289. package/hmr/server/websocket-hot-update.js +360 -0
  290. package/hmr/server/websocket-hot-update.js.map +1 -0
  291. package/hmr/server/websocket-import-map-route.d.ts +15 -0
  292. package/hmr/server/websocket-import-map-route.js +50 -0
  293. package/hmr/server/websocket-import-map-route.js.map +1 -0
  294. package/hmr/server/websocket-module-bindings.js +3 -3
  295. package/hmr/server/websocket-module-bindings.js.map +1 -1
  296. package/hmr/server/websocket-module-specifiers.d.ts +66 -2
  297. package/hmr/server/websocket-module-specifiers.js +191 -20
  298. package/hmr/server/websocket-module-specifiers.js.map +1 -1
  299. package/hmr/server/websocket-ns-core.d.ts +21 -0
  300. package/hmr/server/websocket-ns-core.js +311 -0
  301. package/hmr/server/websocket-ns-core.js.map +1 -0
  302. package/hmr/server/websocket-ns-entry.d.ts +21 -0
  303. package/hmr/server/websocket-ns-entry.js +164 -0
  304. package/hmr/server/websocket-ns-entry.js.map +1 -0
  305. package/hmr/server/websocket-ns-m-paths.d.ts +1 -1
  306. package/hmr/server/websocket-ns-m-paths.js +58 -13
  307. package/hmr/server/websocket-ns-m-paths.js.map +1 -1
  308. package/hmr/server/websocket-ns-m-request.d.ts +11 -1
  309. package/hmr/server/websocket-ns-m-request.js +18 -25
  310. package/hmr/server/websocket-ns-m-request.js.map +1 -1
  311. package/hmr/server/websocket-ns-m.d.ts +33 -0
  312. package/hmr/server/websocket-ns-m.js +752 -0
  313. package/hmr/server/websocket-ns-m.js.map +1 -0
  314. package/hmr/server/websocket-served-module-helpers.d.ts +49 -3
  315. package/hmr/server/websocket-served-module-helpers.js +403 -87
  316. package/hmr/server/websocket-served-module-helpers.js.map +1 -1
  317. package/hmr/server/websocket-txn.js +2 -8
  318. package/hmr/server/websocket-txn.js.map +1 -1
  319. package/hmr/server/websocket-vendor-unifier.d.ts +0 -1
  320. package/hmr/server/websocket-vendor-unifier.js +4 -9
  321. package/hmr/server/websocket-vendor-unifier.js.map +1 -1
  322. package/hmr/server/websocket.d.ts +8 -39
  323. package/hmr/server/websocket.js +608 -6300
  324. package/hmr/server/websocket.js.map +1 -1
  325. package/hmr/shared/ns-globals.d.ts +118 -0
  326. package/hmr/shared/ns-globals.js +29 -0
  327. package/hmr/shared/ns-globals.js.map +1 -0
  328. package/hmr/shared/protocol.d.ts +145 -0
  329. package/hmr/shared/protocol.js +28 -0
  330. package/hmr/shared/protocol.js.map +1 -0
  331. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  332. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  333. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  334. package/hmr/shared/runtime/boot-progress.d.ts +44 -0
  335. package/hmr/shared/runtime/boot-progress.js +133 -0
  336. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  337. package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
  338. package/hmr/shared/runtime/boot-timeline.js +42 -0
  339. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  340. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
  341. package/hmr/shared/runtime/dev-overlay-snapshots.d.ts +31 -0
  342. package/hmr/shared/runtime/dev-overlay-snapshots.js +324 -0
  343. package/hmr/shared/runtime/dev-overlay-snapshots.js.map +1 -0
  344. package/hmr/shared/runtime/dev-overlay.d.ts +119 -26
  345. package/hmr/shared/runtime/dev-overlay.js +1196 -262
  346. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  347. package/hmr/shared/runtime/global-scope.d.ts +18 -0
  348. package/hmr/shared/runtime/global-scope.js +21 -0
  349. package/hmr/shared/runtime/global-scope.js.map +1 -0
  350. package/hmr/shared/runtime/hooks.js +2 -1
  351. package/hmr/shared/runtime/hooks.js.map +1 -1
  352. package/hmr/shared/runtime/http-only-boot.js +7 -6
  353. package/hmr/shared/runtime/http-only-boot.js.map +1 -1
  354. package/hmr/shared/runtime/module-provenance.js +4 -6
  355. package/hmr/shared/runtime/module-provenance.js.map +1 -1
  356. package/hmr/shared/runtime/root-placeholder-view.d.ts +19 -0
  357. package/hmr/shared/runtime/root-placeholder-view.js +311 -0
  358. package/hmr/shared/runtime/root-placeholder-view.js.map +1 -0
  359. package/hmr/shared/runtime/root-placeholder.js +393 -200
  360. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  361. package/hmr/shared/runtime/session-bootstrap.js +168 -4
  362. package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
  363. package/hmr/shared/runtime/vendor-bootstrap.js +3 -10
  364. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  365. package/hmr/shared/vendor/manifest-collect.d.ts +4 -0
  366. package/hmr/shared/vendor/manifest-collect.js +549 -0
  367. package/hmr/shared/vendor/manifest-collect.js.map +1 -0
  368. package/hmr/shared/vendor/manifest-loader.d.ts +2 -1
  369. package/hmr/shared/vendor/manifest-loader.js +5 -3
  370. package/hmr/shared/vendor/manifest-loader.js.map +1 -1
  371. package/hmr/shared/vendor/manifest.d.ts +1 -7
  372. package/hmr/shared/vendor/manifest.js +84 -819
  373. package/hmr/shared/vendor/manifest.js.map +1 -1
  374. package/hmr/shared/vendor/vendor-device-shim.d.ts +1 -0
  375. package/hmr/shared/vendor/vendor-device-shim.js +208 -0
  376. package/hmr/shared/vendor/vendor-device-shim.js.map +1 -0
  377. package/hmr/shared/vendor/vendor-esbuild-plugins.d.ts +38 -0
  378. package/hmr/shared/vendor/vendor-esbuild-plugins.js +296 -0
  379. package/hmr/shared/vendor/vendor-esbuild-plugins.js.map +1 -0
  380. package/hmr/vendor-bootstrap.d.ts +1 -3
  381. package/hmr/vendor-bootstrap.js +4 -6
  382. package/hmr/vendor-bootstrap.js.map +1 -1
  383. package/index.d.ts +1 -0
  384. package/index.js +5 -0
  385. package/index.js.map +1 -1
  386. package/package.json +61 -11
  387. package/runtime/core-aliases-early.js +25 -55
  388. package/runtime/core-aliases-early.js.map +1 -1
  389. package/shims/react-jsx-runtime.d.ts +4 -0
  390. package/shims/react-jsx-runtime.js +37 -0
  391. package/shims/react-jsx-runtime.js.map +1 -0
  392. package/helpers/angular/angular-linker.d.ts +0 -13
  393. package/helpers/angular/angular-linker.js +0 -194
  394. package/helpers/angular/angular-linker.js.map +0 -1
  395. package/helpers/angular/inline-decorator-component-templates.js.map +0 -1
  396. package/helpers/angular/shared-linker.d.ts +0 -11
  397. package/helpers/angular/shared-linker.js +0 -75
  398. package/helpers/angular/shared-linker.js.map +0 -1
  399. package/helpers/angular/synthesize-decorator-ctor-parameters.js.map +0 -1
  400. package/helpers/angular/synthesize-injectable-factories.js.map +0 -1
  401. package/helpers/angular/util.js +0 -67
  402. package/helpers/angular/util.js.map +0 -1
  403. package/helpers/prelink-angular.d.ts +0 -2
  404. package/helpers/prelink-angular.js +0 -117
  405. package/helpers/prelink-angular.js.map +0 -1
  406. package/hmr/server/websocket-angular-entry.js.map +0 -1
  407. package/hmr/server/websocket-angular-hot-update.js +0 -239
  408. package/hmr/server/websocket-angular-hot-update.js.map +0 -1
  409. package/hmr/server/websocket-ns-m-finalize.d.ts +0 -22
  410. package/hmr/server/websocket-ns-m-finalize.js +0 -88
  411. package/hmr/server/websocket-ns-m-finalize.js.map +0 -1
  412. package/hmr/server/websocket-runtime-compat.d.ts +0 -19
  413. package/hmr/server/websocket-runtime-compat.js +0 -286
  414. package/hmr/server/websocket-runtime-compat.js.map +0 -1
  415. package/hmr/server/websocket-vue-sfc.d.ts +0 -27
  416. package/hmr/server/websocket-vue-sfc.js +0 -1117
  417. package/hmr/server/websocket-vue-sfc.js.map +0 -1
  418. package/transformers/NativeClass/index.d.ts +0 -2
  419. package/transformers/NativeClass/index.js +0 -222
  420. package/transformers/NativeClass/index.js.map +0 -1
  421. /package/{helpers/angular → hmr/frameworks/angular/build}/inline-decorator-component-templates.d.ts +0 -0
  422. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-decorator-ctor-parameters.d.ts +0 -0
  423. /package/{helpers/angular → hmr/frameworks/angular/build}/synthesize-injectable-factories.d.ts +0 -0
  424. /package/hmr/{server → frameworks/angular/server}/websocket-angular-entry.d.ts +0 -0
@@ -0,0 +1,178 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ /**
4
+ * Why this helper exists
5
+ * ----------------------
6
+ *
7
+ * Vite's depscanner happily pre-bundles every bare specifier the app
8
+ * imports. For a Solid library that publishes pre-compiled-but-still-JSX
9
+ * files (e.g. `solid-navigation`'s `dist/src/*.jsx`), the pre-bundle output
10
+ * lands at `node_modules/.vite/deps/<pkg>.js` with the JSX intact —
11
+ * rolldown's depscanner doesn't run Solid's JSX transform (that lives in
12
+ * `vite-plugin-solid`'s `transform` hook, which only matches files whose
13
+ * id ends in `.jsx`/`.tsx`).
14
+ *
15
+ * Vite then runs `vite:import-analysis` on the `.js` output, hits the
16
+ * first JSX expression, and aborts the dev server's pre-transform with:
17
+ *
18
+ * Failed to parse source for import analysis because the content
19
+ * contains invalid JS syntax. If you are using JSX, make sure to
20
+ * name the file with the .jsx or .tsx extension.
21
+ * File: /…/.vite/deps/<pkg>.js:51:32
22
+ *
23
+ * The fix: when a project depends on a Solid library that ships `.jsx`
24
+ * (or `.tsx`) source files in its package directory, mark that package
25
+ * as `optimizeDeps.exclude` so Vite serves it through the regular dev
26
+ * pipeline, where `vite-plugin-solid`'s `transform` hook matches the
27
+ * original `.jsx` id and applies the Solid babel preset.
28
+ *
29
+ * Detection rules — biased toward false negatives so we never wrongly
30
+ * exclude a package that Vite must pre-bundle (esp. CJS-only deps that
31
+ * need esm interop). A package is excluded only when ALL of the
32
+ * following hold:
33
+ *
34
+ * 1. It declares `solid-js` or `@nativescript-community/solid-js` in
35
+ * `dependencies` / `peerDependencies` / `devDependencies`. This is
36
+ * a strong signal that the package's published artifacts are
37
+ * meant to be processed by a Solid-aware JSX transformer.
38
+ * 2. Its package directory contains at least one `.jsx` / `.tsx`
39
+ * source file under `dist` / `lib` / `build` / `es` / `esm` /
40
+ * `out` (the common published-output dirs) or directly at the
41
+ * package root. We deliberately skip `node_modules`, `src` (raw
42
+ * sources, not what `main` points to), and test dirs.
43
+ *
44
+ * Both checks are scoped to packages installed in the app's
45
+ * `node_modules` (plus the monorepo's hoisted `node_modules`, if any)
46
+ * — we never recurse into transitive nested copies, since those are
47
+ * also reachable from the same top-level scan once Vite resolves them.
48
+ */
49
+ const PUBLISHED_OUTPUT_DIRS = new Set(['dist', 'lib', 'build', 'es', 'esm', 'out']);
50
+ // Always-skip subdirs regardless of depth: nested copies, test fixtures,
51
+ // docs, and example apps. Notably `src` is NOT in here because a published
52
+ // bundle may use `dist/src/<file>.jsx` as its layout (e.g. `solid-navigation`).
53
+ // `src/` at the *package root* is rejected separately by the
54
+ // "depth 0 must be a published-output dir" gate below.
55
+ const ALWAYS_SKIP_DIR_NAMES = new Set(['node_modules', 'test', 'tests', '__tests__', 'spec', 'specs', 'docs', 'examples', 'example', '.git', '.cache']);
56
+ const JSX_EXT_RE = /\.(jsx|tsx)$/;
57
+ const MAX_SCAN_DEPTH = 4;
58
+ function isSolidConsumer(pkgJson) {
59
+ const buckets = ['dependencies', 'peerDependencies', 'devDependencies', 'optionalDependencies'];
60
+ for (const key of buckets) {
61
+ const deps = pkgJson[key];
62
+ if (!deps || typeof deps !== 'object')
63
+ continue;
64
+ if (deps['solid-js'])
65
+ return true;
66
+ if (deps['@nativescript-community/solid-js'])
67
+ return true;
68
+ }
69
+ return false;
70
+ }
71
+ function hasJsxFile(dir, depth = 0) {
72
+ if (depth > MAX_SCAN_DEPTH)
73
+ return false;
74
+ let entries;
75
+ try {
76
+ entries = fs.readdirSync(dir, { withFileTypes: true });
77
+ }
78
+ catch {
79
+ return false;
80
+ }
81
+ for (const entry of entries) {
82
+ if (entry.isFile() && JSX_EXT_RE.test(entry.name)) {
83
+ return true;
84
+ }
85
+ if (entry.isDirectory()) {
86
+ if (entry.name.startsWith('.'))
87
+ continue;
88
+ if (ALWAYS_SKIP_DIR_NAMES.has(entry.name))
89
+ continue;
90
+ // At depth 0 (package root) only descend into known
91
+ // published-output dirs so a sibling `src/` (raw sources)
92
+ // can't flag the package on its own. Deeper levels are
93
+ // inside a publish dir already, so any subdir (incl. `src`)
94
+ // is fair game.
95
+ if (depth === 0 && !PUBLISHED_OUTPUT_DIRS.has(entry.name))
96
+ continue;
97
+ if (hasJsxFile(path.join(dir, entry.name), depth + 1))
98
+ return true;
99
+ }
100
+ }
101
+ return false;
102
+ }
103
+ function scanDirectoryForJsxPackages(nodeModulesDir, result, scope = '') {
104
+ let entries;
105
+ try {
106
+ entries = fs.readdirSync(nodeModulesDir, { withFileTypes: true });
107
+ }
108
+ catch {
109
+ return;
110
+ }
111
+ for (const entry of entries) {
112
+ if (!entry.isDirectory())
113
+ continue;
114
+ if (entry.name.startsWith('.'))
115
+ continue;
116
+ if (entry.name === 'node_modules')
117
+ continue;
118
+ const entryPath = path.join(nodeModulesDir, entry.name);
119
+ if (!scope && entry.name.startsWith('@')) {
120
+ scanDirectoryForJsxPackages(entryPath, result, entry.name);
121
+ continue;
122
+ }
123
+ const pkgName = scope ? `${scope}/${entry.name}` : entry.name;
124
+ if (result.has(pkgName))
125
+ continue;
126
+ const pkgJsonPath = path.join(entryPath, 'package.json');
127
+ if (!fs.existsSync(pkgJsonPath))
128
+ continue;
129
+ let pkgJson;
130
+ try {
131
+ pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
132
+ }
133
+ catch {
134
+ continue;
135
+ }
136
+ if (!isSolidConsumer(pkgJson))
137
+ continue;
138
+ if (!hasJsxFile(entryPath))
139
+ continue;
140
+ result.add(pkgName);
141
+ }
142
+ }
143
+ /**
144
+ * Find installed packages whose pre-bundle output would smuggle JSX into
145
+ * Vite's import-analysis stage. Returned names are safe to drop into
146
+ * `optimizeDeps.exclude` — the dev server will serve them through the
147
+ * normal module pipeline, where `vite-plugin-solid` can transform their
148
+ * original `.jsx`/`.tsx` files.
149
+ *
150
+ * The function is intentionally synchronous and best-effort: filesystem
151
+ * errors are swallowed, missing directories are skipped, and the scan
152
+ * caps at {@link MAX_SCAN_DEPTH} levels per package. Callers should
153
+ * treat the empty-array result as "no exclusions needed", not "scan
154
+ * failed". A nullable `monorepoRoot` is accepted so workspace hoisting
155
+ * is covered without forcing every caller to compute it.
156
+ */
157
+ export function findSolidPackagesShippingJsx(projectRoot, monorepoRoot) {
158
+ const found = new Set();
159
+ const seenDirs = new Set();
160
+ const scanDirs = [];
161
+ const projectNodeModules = path.resolve(projectRoot, 'node_modules');
162
+ scanDirs.push(projectNodeModules);
163
+ if (monorepoRoot && path.resolve(monorepoRoot) !== path.resolve(projectRoot)) {
164
+ const monorepoNodeModules = path.resolve(monorepoRoot, 'node_modules');
165
+ scanDirs.push(monorepoNodeModules);
166
+ }
167
+ for (const dir of scanDirs) {
168
+ const key = path.resolve(dir);
169
+ if (seenDirs.has(key))
170
+ continue;
171
+ seenDirs.add(key);
172
+ if (!fs.existsSync(dir))
173
+ continue;
174
+ scanDirectoryForJsxPackages(dir, found);
175
+ }
176
+ return Array.from(found).sort();
177
+ }
178
+ //# sourceMappingURL=solid-jsx-deps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solid-jsx-deps.js","sourceRoot":"","sources":["../../../../../../../packages/vite/hmr/frameworks/solid/build/solid-jsx-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AACpF,yEAAyE;AACzE,2EAA2E;AAC3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AAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC9E,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACvE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACpC,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAChC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAClC,2BAA2B,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Bootstrap + HMR remount for NativeScript Solid apps.
3
+ *
4
+ * Solid runs with `hot: false` (solid-refresh is off — it rewrites `export
5
+ * function` into a non-hoisted const and breaks TanStack file-route modules), so
6
+ * there is no fine-grained component HMR.
7
+ *
8
+ * Division of labour on each Solid HMR cycle (`__ns_solid_hmr_subscribe`):
9
+ * • ROUTE files — handled by @nativescript/tanstack-router's per-page remount
10
+ * (`subscribeSolidHmrRemount` → `page.__ns_remount`), which swaps the route
11
+ * component in place WITHOUT re-navigating, so the user stays on their route.
12
+ * This helper does nothing for route-only edits.
13
+ * • Everything else (app shell / shared components / app entry) — this helper
14
+ * re-imports the app entry and re-renders the whole Solid tree. The router is
15
+ * REUSED (its chain is never evicted), so the current route is preserved.
16
+ *
17
+ * Renderer bindings (`Application`, `render`, `document`) are passed in rather than
18
+ * imported here so the helper uses the app's exact solid-js / dominative instances.
19
+ * Importing our own copies could resolve to a different module realm and break
20
+ * Solid reactivity (NativeScript can load a package's deps in a separate realm).
21
+ */
22
+ export interface StartSolidAppOptions {
23
+ /** `@nativescript/core` `Application`. */
24
+ Application: {
25
+ run(entry: {
26
+ create: () => any;
27
+ }): void;
28
+ };
29
+ /** `@nativescript-community/solid-js` `render` — mounts a component, returns a disposer. */
30
+ render: (component: any, target: any) => () => void;
31
+ /** dominative `document` — returned as the root view; `document.body` is the mount target. */
32
+ document: any;
33
+ /** Initial root component (used for the first mount). */
34
+ root: any;
35
+ /**
36
+ * App-relative specifier of the module that exports the root component, as
37
+ * `App` or default (e.g. `/src/native/app`). Re-imported fresh on each cycle.
38
+ */
39
+ rootModule: string;
40
+ }
41
+ /**
42
+ * Boot a NativeScript Solid app and wire up HMR remounting. Call once from the
43
+ * app entry, e.g.:
44
+ *
45
+ * import './utils/dom';
46
+ * import { Application } from '@nativescript/core';
47
+ * import { render } from '@nativescript-community/solid-js';
48
+ * import { document } from 'dominative';
49
+ * import { startSolidApp } from '@nativescript/vite/solid-bootstrap';
50
+ * import { App } from './app';
51
+ *
52
+ * startSolidApp({ Application, render, document, root: App, rootModule: '/src/native/app' });
53
+ */
54
+ export declare function startSolidApp(options: StartSolidAppOptions): void;
@@ -0,0 +1,184 @@
1
+ const SCRIPT_EXT = /\.(?:tsx|jsx|ts|js|mjs|mts|cjs|cts)$/i;
2
+ const ROUTE_FILE_RE = /\/routes\/.+\.(?:tsx|jsx)$/i;
3
+ const isSource = (id) => SCRIPT_EXT.test(id) && !/\.d\.ts$/i.test(id);
4
+ // A "shell" change is any source file that is NOT a route file — route files are
5
+ // hot-swapped per-page by the router, shell files need an app re-render.
6
+ const isShell = (id) => isSource(id) && !ROUTE_FILE_RE.test(id);
7
+ /** Resolve the dev-server HTTP origin used to fetch app modules over the wire. */
8
+ function resolveOrigin() {
9
+ try {
10
+ const m = String(import.meta.url).match(/^https?:\/\/[^/]+/);
11
+ if (m)
12
+ return m[0];
13
+ }
14
+ catch { }
15
+ const g = globalThis;
16
+ if (typeof g.__NS_HTTP_ORIGIN__ === 'string' && /^https?:\/\//.test(g.__NS_HTTP_ORIGIN__)) {
17
+ return g.__NS_HTTP_ORIGIN__;
18
+ }
19
+ if (typeof g.__NS_HMR_WS_URL__ === 'string') {
20
+ const m = g.__NS_HMR_WS_URL__.match(/^wss?:\/\/([^/]+)/);
21
+ if (m)
22
+ return 'http://' + m[1];
23
+ }
24
+ return '';
25
+ }
26
+ /** Canonical `/ns/m/<path>` eviction URLs (with + without script extension). */
27
+ function evictionUrls(origin, specs) {
28
+ const urls = new Set();
29
+ for (const raw of specs) {
30
+ if (!raw)
31
+ continue;
32
+ let spec = raw.split('?')[0];
33
+ if (!spec.startsWith('/'))
34
+ spec = '/' + spec;
35
+ const canonical = spec.replace(SCRIPT_EXT, '');
36
+ urls.add(origin + '/ns/m' + canonical);
37
+ if (spec !== canonical)
38
+ urls.add(origin + '/ns/m' + spec);
39
+ for (const ext of ['.tsx', '.ts', '.jsx', '.js'])
40
+ urls.add(origin + '/ns/m' + canonical + ext);
41
+ }
42
+ return Array.from(urls);
43
+ }
44
+ /**
45
+ * Boot a NativeScript Solid app and wire up HMR remounting. Call once from the
46
+ * app entry, e.g.:
47
+ *
48
+ * import './utils/dom';
49
+ * import { Application } from '@nativescript/core';
50
+ * import { render } from '@nativescript-community/solid-js';
51
+ * import { document } from 'dominative';
52
+ * import { startSolidApp } from '@nativescript/vite/solid-bootstrap';
53
+ * import { App } from './app';
54
+ *
55
+ * startSolidApp({ Application, render, document, root: App, rootModule: '/src/native/app' });
56
+ */
57
+ export function startSolidApp(options) {
58
+ const { Application, render, document, root, rootModule } = options;
59
+ let dispose;
60
+ const mount = (Component) => {
61
+ if (dispose) {
62
+ try {
63
+ dispose();
64
+ }
65
+ catch (err) {
66
+ console.log('[ns-solid-hmr] dispose error', err);
67
+ }
68
+ dispose = undefined;
69
+ // Rapid remounts can leave a detached native view parented to body; drop
70
+ // any residue so each remount starts clean (else ghost/overlapping views).
71
+ try {
72
+ const body = document.body;
73
+ while (body && body.firstChild)
74
+ body.removeChild(body.firstChild);
75
+ }
76
+ catch (err) {
77
+ console.log('[ns-solid-hmr] body clear error', err);
78
+ }
79
+ }
80
+ dispose = render(Component, document.body);
81
+ };
82
+ Application.run({ create: () => (mount(root), document) });
83
+ installHmrRemount(rootModule, mount);
84
+ }
85
+ function installHmrRemount(rootModule, mount) {
86
+ const origin = resolveOrigin();
87
+ let nonce = 0;
88
+ let busy = false;
89
+ let rerun = false;
90
+ const remount = async (changed) => {
91
+ if (!origin) {
92
+ console.log('[ns-solid-hmr] no HTTP origin resolved; cannot re-import');
93
+ return;
94
+ }
95
+ if (busy) {
96
+ // A remount is in flight; run one more pass after it settles so the very
97
+ // latest edit is never dropped.
98
+ rerun = true;
99
+ return;
100
+ }
101
+ busy = true;
102
+ try {
103
+ // Evict the app entry + changed files so their re-imports resolve to fresh
104
+ // code. We deliberately do NOT evict the router / route-tree chain: keeping
105
+ // it cached preserves the live router (and the user's current route).
106
+ const invalidate = globalThis.__nsInvalidateModules;
107
+ if (typeof invalidate === 'function') {
108
+ try {
109
+ invalidate(evictionUrls(origin, [rootModule, ...changed]));
110
+ }
111
+ catch (err) {
112
+ console.log('[ns-solid-hmr] invalidate threw', err);
113
+ }
114
+ }
115
+ const t = `${Date.now()}_${++nonce}`;
116
+ // Entry-tagged URL first: the `__ns_hmr__/entry-<n>/` segment makes the dev
117
+ // server serve a freshly-transformed module instead of a cached (one-edit-
118
+ // behind) transform. Plain canonical URL is the fallback.
119
+ const candidates = [origin + '/ns/m/__ns_hmr__/entry-' + t + rootModule + '?t=' + t, origin + '/ns/m' + rootModule + '?t=' + t];
120
+ for (const url of candidates) {
121
+ try {
122
+ const mod = await import(/* @vite-ignore */ url);
123
+ const Next = mod && (mod.App || mod.default);
124
+ if (typeof Next === 'function') {
125
+ mount(Next);
126
+ return;
127
+ }
128
+ }
129
+ catch (err) {
130
+ console.log('[ns-solid-hmr] re-import failed', url, err?.message ?? err);
131
+ }
132
+ }
133
+ console.log('[ns-solid-hmr] all re-import candidates failed');
134
+ }
135
+ finally {
136
+ busy = false;
137
+ if (rerun) {
138
+ rerun = false;
139
+ void remount([]);
140
+ }
141
+ }
142
+ };
143
+ // Coalesce bursts (a single save can fan out several notifications) into one remount.
144
+ let timer;
145
+ let pending = new Set();
146
+ const schedule = (ids) => {
147
+ for (const id of ids)
148
+ pending.add(id);
149
+ if (timer)
150
+ clearTimeout(timer);
151
+ timer = setTimeout(() => {
152
+ timer = undefined;
153
+ const batch = Array.from(pending);
154
+ pending = new Set();
155
+ void remount(batch);
156
+ }, 30);
157
+ };
158
+ const g = globalThis;
159
+ let subscribed = false;
160
+ const trySubscribe = (attempt) => {
161
+ if (subscribed)
162
+ return;
163
+ if (typeof g.__ns_solid_hmr_subscribe === 'function') {
164
+ g.__ns_solid_hmr_subscribe((ev) => {
165
+ const changed = ev && Array.isArray(ev.changedFiles) ? ev.changedFiles : [];
166
+ const boundaries = ev && Array.isArray(ev.boundaries) ? ev.boundaries : [];
167
+ const ids = [...changed, ...boundaries].filter(isSource);
168
+ // Route-only edits are hot-swapped in place by the router's per-page
169
+ // remount — don't re-render the whole app (which would fight it). Only
170
+ // re-render for shell / shared-component / app-entry edits.
171
+ if (!ids.some(isShell))
172
+ return;
173
+ schedule(ids);
174
+ });
175
+ subscribed = true;
176
+ return;
177
+ }
178
+ // The HMR client loads asynchronously; retry until its global API is present.
179
+ if (attempt < 100)
180
+ setTimeout(() => trySubscribe(attempt + 1), 150);
181
+ };
182
+ trySubscribe(0);
183
+ }
184
+ //# sourceMappingURL=app-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-runtime.js","sourceRoot":"","sources":["../../../../../../../packages/vite/hmr/frameworks/solid/client/app-runtime.ts"],"names":[],"mappings":"AAqCA,MAAM,UAAU,GAAG,uCAAuC,CAAC;AAC3D,MAAM,aAAa,GAAG,6BAA6B,CA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