@nativescript/vite 8.0.0-alpha.2 → 8.0.0-alpha.21

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 (209) hide show
  1. package/configuration/angular.d.ts +34 -1
  2. package/configuration/angular.js +380 -34
  3. package/configuration/angular.js.map +1 -1
  4. package/configuration/base.js +171 -7
  5. package/configuration/base.js.map +1 -1
  6. package/configuration/solid.js +27 -1
  7. package/configuration/solid.js.map +1 -1
  8. package/configuration/typescript.js +1 -1
  9. package/configuration/typescript.js.map +1 -1
  10. package/helpers/angular/angular-linker.js +3 -12
  11. package/helpers/angular/angular-linker.js.map +1 -1
  12. package/helpers/angular/inject-component-hmr-registration.d.ts +112 -0
  13. package/helpers/angular/inject-component-hmr-registration.js +359 -0
  14. package/helpers/angular/inject-component-hmr-registration.js.map +1 -0
  15. package/helpers/angular/inject-hmr-vite-ignore.d.ts +75 -0
  16. package/helpers/angular/inject-hmr-vite-ignore.js +288 -0
  17. package/helpers/angular/inject-hmr-vite-ignore.js.map +1 -0
  18. package/helpers/angular/util.d.ts +1 -0
  19. package/helpers/angular/util.js +88 -0
  20. package/helpers/angular/util.js.map +1 -1
  21. package/helpers/commonjs-plugins.d.ts +5 -2
  22. package/helpers/commonjs-plugins.js +126 -0
  23. package/helpers/commonjs-plugins.js.map +1 -1
  24. package/helpers/config-as-json.js +10 -0
  25. package/helpers/config-as-json.js.map +1 -1
  26. package/helpers/dev-host.d.ts +274 -0
  27. package/helpers/dev-host.js +491 -0
  28. package/helpers/dev-host.js.map +1 -0
  29. package/helpers/global-defines.d.ts +51 -0
  30. package/helpers/global-defines.js +77 -0
  31. package/helpers/global-defines.js.map +1 -1
  32. package/helpers/logging.d.ts +1 -0
  33. package/helpers/logging.js +63 -3
  34. package/helpers/logging.js.map +1 -1
  35. package/helpers/main-entry.d.ts +3 -1
  36. package/helpers/main-entry.js +450 -125
  37. package/helpers/main-entry.js.map +1 -1
  38. package/helpers/nativeclass-transformer-plugin.d.ts +9 -2
  39. package/helpers/nativeclass-transformer-plugin.js +157 -14
  40. package/helpers/nativeclass-transformer-plugin.js.map +1 -1
  41. package/helpers/ns-core-url.d.ts +88 -0
  42. package/helpers/ns-core-url.js +191 -0
  43. package/helpers/ns-core-url.js.map +1 -0
  44. package/helpers/prelink-angular.js +1 -4
  45. package/helpers/prelink-angular.js.map +1 -1
  46. package/helpers/project.d.ts +35 -0
  47. package/helpers/project.js +120 -2
  48. package/helpers/project.js.map +1 -1
  49. package/helpers/resolver.js +9 -1
  50. package/helpers/resolver.js.map +1 -1
  51. package/helpers/solid-jsx-deps.d.ts +15 -0
  52. package/helpers/solid-jsx-deps.js +178 -0
  53. package/helpers/solid-jsx-deps.js.map +1 -0
  54. package/helpers/ts-config-paths.js +50 -2
  55. package/helpers/ts-config-paths.js.map +1 -1
  56. package/helpers/workers.d.ts +20 -19
  57. package/helpers/workers.js +620 -3
  58. package/helpers/workers.js.map +1 -1
  59. package/hmr/client/css-handler.d.ts +1 -0
  60. package/hmr/client/css-handler.js +34 -5
  61. package/hmr/client/css-handler.js.map +1 -1
  62. package/hmr/client/css-update-overlay.d.ts +18 -0
  63. package/hmr/client/css-update-overlay.js +27 -0
  64. package/hmr/client/css-update-overlay.js.map +1 -0
  65. package/hmr/client/hmr-pending-overlay.d.ts +27 -0
  66. package/hmr/client/hmr-pending-overlay.js +50 -0
  67. package/hmr/client/hmr-pending-overlay.js.map +1 -0
  68. package/hmr/client/index.js +491 -34
  69. package/hmr/client/index.js.map +1 -1
  70. package/hmr/client/utils.d.ts +5 -0
  71. package/hmr/client/utils.js +283 -12
  72. package/hmr/client/utils.js.map +1 -1
  73. package/hmr/client/vue-sfc-update-overlay.d.ts +82 -0
  74. package/hmr/client/vue-sfc-update-overlay.js +133 -0
  75. package/hmr/client/vue-sfc-update-overlay.js.map +1 -0
  76. package/hmr/entry-runtime.d.ts +2 -1
  77. package/hmr/entry-runtime.js +253 -66
  78. package/hmr/entry-runtime.js.map +1 -1
  79. package/hmr/frameworks/angular/client/index.d.ts +3 -1
  80. package/hmr/frameworks/angular/client/index.js +802 -10
  81. package/hmr/frameworks/angular/client/index.js.map +1 -1
  82. package/hmr/frameworks/angular/server/linker.js +1 -4
  83. package/hmr/frameworks/angular/server/linker.js.map +1 -1
  84. package/hmr/frameworks/angular/server/strategy.js +30 -6
  85. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  86. package/hmr/frameworks/typescript/server/strategy.js +8 -2
  87. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  88. package/hmr/frameworks/vue/client/index.js +30 -45
  89. package/hmr/frameworks/vue/client/index.js.map +1 -1
  90. package/hmr/helpers/ast-normalizer.js +52 -5
  91. package/hmr/helpers/ast-normalizer.js.map +1 -1
  92. package/hmr/helpers/cjs-named-exports.d.ts +23 -0
  93. package/hmr/helpers/cjs-named-exports.js +152 -0
  94. package/hmr/helpers/cjs-named-exports.js.map +1 -0
  95. package/hmr/helpers/package-exports.d.ts +16 -0
  96. package/hmr/helpers/package-exports.js +396 -0
  97. package/hmr/helpers/package-exports.js.map +1 -0
  98. package/hmr/server/constants.js +13 -4
  99. package/hmr/server/constants.js.map +1 -1
  100. package/hmr/server/core-sanitize.d.ts +93 -8
  101. package/hmr/server/core-sanitize.js +222 -49
  102. package/hmr/server/core-sanitize.js.map +1 -1
  103. package/hmr/server/import-map.js +80 -22
  104. package/hmr/server/import-map.js.map +1 -1
  105. package/hmr/server/index.d.ts +2 -1
  106. package/hmr/server/index.js.map +1 -1
  107. package/hmr/server/ns-core-cjs-shape.d.ts +204 -0
  108. package/hmr/server/ns-core-cjs-shape.js +271 -0
  109. package/hmr/server/ns-core-cjs-shape.js.map +1 -0
  110. package/hmr/server/ns-rt-bridge.d.ts +51 -0
  111. package/hmr/server/ns-rt-bridge.js +131 -0
  112. package/hmr/server/ns-rt-bridge.js.map +1 -0
  113. package/hmr/server/perf-instrumentation.d.ts +114 -0
  114. package/hmr/server/perf-instrumentation.js +195 -0
  115. package/hmr/server/perf-instrumentation.js.map +1 -0
  116. package/hmr/server/runtime-graph-filter.d.ts +5 -0
  117. package/hmr/server/runtime-graph-filter.js +21 -0
  118. package/hmr/server/runtime-graph-filter.js.map +1 -0
  119. package/hmr/server/shared-transform-request.d.ts +12 -0
  120. package/hmr/server/shared-transform-request.js +144 -0
  121. package/hmr/server/shared-transform-request.js.map +1 -0
  122. package/hmr/server/vite-plugin.d.ts +21 -1
  123. package/hmr/server/vite-plugin.js +497 -58
  124. package/hmr/server/vite-plugin.js.map +1 -1
  125. package/hmr/server/websocket-angular-entry.d.ts +2 -0
  126. package/hmr/server/websocket-angular-entry.js +68 -0
  127. package/hmr/server/websocket-angular-entry.js.map +1 -0
  128. package/hmr/server/websocket-angular-hot-update.d.ts +78 -0
  129. package/hmr/server/websocket-angular-hot-update.js +413 -0
  130. package/hmr/server/websocket-angular-hot-update.js.map +1 -0
  131. package/hmr/server/websocket-core-bridge.d.ts +58 -0
  132. package/hmr/server/websocket-core-bridge.js +368 -0
  133. package/hmr/server/websocket-core-bridge.js.map +1 -0
  134. package/hmr/server/websocket-css-hot-update.d.ts +33 -0
  135. package/hmr/server/websocket-css-hot-update.js +65 -0
  136. package/hmr/server/websocket-css-hot-update.js.map +1 -0
  137. package/hmr/server/websocket-graph-upsert.d.ts +21 -0
  138. package/hmr/server/websocket-graph-upsert.js +33 -0
  139. package/hmr/server/websocket-graph-upsert.js.map +1 -0
  140. package/hmr/server/websocket-hmr-pending.d.ts +43 -0
  141. package/hmr/server/websocket-hmr-pending.js +55 -0
  142. package/hmr/server/websocket-hmr-pending.js.map +1 -0
  143. package/hmr/server/websocket-module-bindings.d.ts +6 -0
  144. package/hmr/server/websocket-module-bindings.js +471 -0
  145. package/hmr/server/websocket-module-bindings.js.map +1 -0
  146. package/hmr/server/websocket-module-specifiers.d.ts +101 -0
  147. package/hmr/server/websocket-module-specifiers.js +820 -0
  148. package/hmr/server/websocket-module-specifiers.js.map +1 -0
  149. package/hmr/server/websocket-ns-m-finalize.d.ts +22 -0
  150. package/hmr/server/websocket-ns-m-finalize.js +88 -0
  151. package/hmr/server/websocket-ns-m-finalize.js.map +1 -0
  152. package/hmr/server/websocket-ns-m-paths.d.ts +3 -0
  153. package/hmr/server/websocket-ns-m-paths.js +92 -0
  154. package/hmr/server/websocket-ns-m-paths.js.map +1 -0
  155. package/hmr/server/websocket-ns-m-request.d.ts +45 -0
  156. package/hmr/server/websocket-ns-m-request.js +196 -0
  157. package/hmr/server/websocket-ns-m-request.js.map +1 -0
  158. package/hmr/server/websocket-served-module-helpers.d.ts +36 -0
  159. package/hmr/server/websocket-served-module-helpers.js +644 -0
  160. package/hmr/server/websocket-served-module-helpers.js.map +1 -0
  161. package/hmr/server/websocket-txn.d.ts +6 -0
  162. package/hmr/server/websocket-txn.js +45 -0
  163. package/hmr/server/websocket-txn.js.map +1 -0
  164. package/hmr/server/websocket-vendor-unifier.d.ts +10 -0
  165. package/hmr/server/websocket-vendor-unifier.js +51 -0
  166. package/hmr/server/websocket-vendor-unifier.js.map +1 -0
  167. package/hmr/server/websocket-vue-sfc.d.ts +26 -0
  168. package/hmr/server/websocket-vue-sfc.js +1053 -0
  169. package/hmr/server/websocket-vue-sfc.js.map +1 -0
  170. package/hmr/server/websocket.d.ts +58 -75
  171. package/hmr/server/websocket.js +2232 -1802
  172. package/hmr/server/websocket.js.map +1 -1
  173. package/hmr/shared/package-classifier.d.ts +9 -0
  174. package/hmr/shared/package-classifier.js +58 -0
  175. package/hmr/shared/package-classifier.js.map +1 -0
  176. package/hmr/shared/runtime/boot-placeholder-ui.d.ts +69 -0
  177. package/hmr/shared/runtime/boot-placeholder-ui.js +101 -0
  178. package/hmr/shared/runtime/boot-placeholder-ui.js.map +1 -0
  179. package/hmr/shared/runtime/boot-progress.d.ts +40 -0
  180. package/hmr/shared/runtime/boot-progress.js +128 -0
  181. package/hmr/shared/runtime/boot-progress.js.map +1 -0
  182. package/hmr/shared/runtime/boot-timeline.d.ts +18 -0
  183. package/hmr/shared/runtime/boot-timeline.js +52 -0
  184. package/hmr/shared/runtime/boot-timeline.js.map +1 -0
  185. package/hmr/shared/runtime/browser-runtime-contract.d.ts +64 -0
  186. package/hmr/shared/runtime/browser-runtime-contract.js +54 -0
  187. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -0
  188. package/hmr/shared/runtime/dev-overlay.d.ts +78 -3
  189. package/hmr/shared/runtime/dev-overlay.js +1094 -26
  190. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  191. package/hmr/shared/runtime/module-provenance.js +1 -4
  192. package/hmr/shared/runtime/module-provenance.js.map +1 -1
  193. package/hmr/shared/runtime/root-placeholder.d.ts +1 -0
  194. package/hmr/shared/runtime/root-placeholder.js +1019 -151
  195. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  196. package/hmr/shared/runtime/session-bootstrap.d.ts +1 -0
  197. package/hmr/shared/runtime/session-bootstrap.js +309 -0
  198. package/hmr/shared/runtime/session-bootstrap.js.map +1 -0
  199. package/hmr/shared/runtime/vendor-bootstrap.js +1 -9
  200. package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
  201. package/hmr/shared/vendor/manifest.d.ts +32 -0
  202. package/hmr/shared/vendor/manifest.js +411 -46
  203. package/hmr/shared/vendor/manifest.js.map +1 -1
  204. package/index.d.ts +1 -0
  205. package/index.js +5 -0
  206. package/index.js.map +1 -1
  207. package/package.json +9 -1
  208. package/runtime/core-aliases-early.js +94 -67
  209. package/runtime/core-aliases-early.js.map +1 -1
@@ -24,6 +24,24 @@ import { getVendorManifest, listVendorModules } from '../shared/vendor/registry.
24
24
  import { readFileSync, readdirSync, existsSync } from 'fs';
25
25
  import { resolve, join } from 'path';
26
26
  import { getProjectRootPath } from '../../helpers/project.js';
27
+ import { buildCoreUrl } from '../../helpers/ns-core-url.js';
28
+ const OMIT_DEVICE_IMPORT_MAP_PACKAGES = new Set(['typescript', 'ts-node', 'esbuild', 'prettier', 'webpack', 'vite', '@nativescript/android', '@nativescript/ios', '@nativescript/visionos', '@nativescript/webpack', '@nativescript/types']);
29
+ const OMIT_DEVICE_IMPORT_MAP_PREFIXES = ['@types/', '@babel/', 'babel-', '@rollup/', '@vitejs/', 'vite-plugin-', '@angular-devkit/', '@angular/build', '@analogjs/'];
30
+ const PREFIX_ONLY_DEVICE_IMPORT_MAP_PACKAGES = new Set(['@nativescript/vite']);
31
+ function getDeviceImportMapExposure(name) {
32
+ if (PREFIX_ONLY_DEVICE_IMPORT_MAP_PACKAGES.has(name)) {
33
+ return 'prefix-only';
34
+ }
35
+ if (OMIT_DEVICE_IMPORT_MAP_PACKAGES.has(name)) {
36
+ return 'omit';
37
+ }
38
+ for (const prefix of OMIT_DEVICE_IMPORT_MAP_PREFIXES) {
39
+ if (name.startsWith(prefix)) {
40
+ return 'omit';
41
+ }
42
+ }
43
+ return 'full';
44
+ }
27
45
  /**
28
46
  * Generate an import map from the current vendor manifest.
29
47
  *
@@ -48,22 +66,56 @@ export function generateImportMap(options) {
48
66
  if (manifest) {
49
67
  // Map vendor modules to ns-vendor:// — EXACT entries only.
50
68
  // No trailing-slash prefixes: subpaths must resolve via HTTP, not vendor.
69
+ //
70
+ // IMPORTANT: `@nativescript/core` and any `@nativescript/core/<sub>` are
71
+ // deliberately routed through the HTTP bridge (`${origin}/ns/core/...`),
72
+ // NEVER through `ns-vendor://`. Two reasons:
73
+ // 1. Single realm. The core bridge is the canonical source for every
74
+ // `Application`, `View`, `Frame`, etc. instance — having a second
75
+ // copy in the vendor registry produces the classic
76
+ // `vendorApplicationSame: false` realm split (different
77
+ // `globalThis.Application` than the one the iOS/Android hooks
78
+ // patched) and HMR placeholder finalize stalls.
79
+ // 2. Chicken-and-egg. esbuild's vendor build externalizes
80
+ // `@nativescript/core(/...)` (see `nsCoreExternalPlugin` in
81
+ // `manifest.ts`), so the externalized `import` statements stay
82
+ // in `vendor.mjs` itself. If those externals resolve through
83
+ // `ns-vendor://`, the synthetic wrapper module's evaluation
84
+ // runs DURING `vendor.mjs` linking — but `vendor-bootstrap`
85
+ // hasn't populated `__nsVendorRegistry` yet (it runs LATER,
86
+ // from the clientUrl module body), so every wrapper throws
87
+ // `Vendor module not found in registry: @nativescript/core/...`.
88
+ // Routing core through the HTTP bridge sidesteps the registry
89
+ // lookup entirely; the dev server normalizes platform suffixes
90
+ // (see `normalizeCoreSub` in `ns-core-url.ts`) so
91
+ // `@nativescript/core/ui/frame/activity.android` → bridge URL
92
+ // `/ns/core/ui/frame/activity.android` → served from the
93
+ // platform-specific `.android.ts` source.
51
94
  const vendorModules = listVendorModules();
52
95
  for (const specifier of vendorModules) {
96
+ if (specifier === '@nativescript/core' || specifier.startsWith('@nativescript/core/')) {
97
+ continue;
98
+ }
53
99
  imports[specifier] = `ns-vendor://${specifier}`;
54
100
  }
55
101
  // Map aliases from the manifest (e.g., "solid-js/web" → ns-vendor://solid-js)
56
102
  if (manifest.aliases) {
57
103
  for (const [alias, canonical] of Object.entries(manifest.aliases)) {
104
+ // Same single-realm + chicken-and-egg reasons as above.
105
+ if (alias === '@nativescript/core' || alias.startsWith('@nativescript/core/')) {
106
+ continue;
107
+ }
58
108
  if (!imports[alias] && imports[canonical]) {
59
109
  imports[alias] = imports[canonical];
60
110
  }
61
111
  }
62
112
  }
63
113
  }
64
- // @nativescript/core → bridge endpoint
65
- imports['@nativescript/core'] = `${origin}/ns/core`;
66
- imports['@nativescript/core/'] = `${origin}/ns/core/`;
114
+ // @nativescript/core → bridge endpoint (canonical URL generator).
115
+ // The trailing-slash entry intentionally uses the same generator so
116
+ // subpath imports resolve via `${origin}/ns/core/<sub>`.
117
+ imports['@nativescript/core'] = buildCoreUrl(origin);
118
+ imports['@nativescript/core/'] = `${buildCoreUrl(origin)}/`;
67
119
  // Add framework-specific entries
68
120
  addFrameworkEntries(imports, origin, flavor);
69
121
  // Scan installed packages and add HTTP URL entries for ALL packages
@@ -111,7 +163,7 @@ export function buildRuntimeConfig(options) {
111
163
  volatilePatterns,
112
164
  };
113
165
  }
114
- function addFrameworkEntries(imports, _origin, flavor) {
166
+ function addFrameworkEntries(imports, origin, flavor) {
115
167
  switch (flavor) {
116
168
  case 'vue':
117
169
  // nativescript-vue should resolve from vendor if available
@@ -123,10 +175,27 @@ function addFrameworkEntries(imports, _origin, flavor) {
123
175
  }
124
176
  break;
125
177
  case 'solid':
126
- // Solid runtime root should resolve from vendor
127
- if (!imports['solid-js']) {
128
- imports['solid-js'] = `ns-vendor://solid-js`;
129
- }
178
+ // Solid runtime root MUST resolve to the same HTTP URL that
179
+ // Vite's solid-js alias produces for user code and the
180
+ // HTTP-served `@solid-refresh` middleware. The vendor bundle
181
+ // no longer ships `solid-js` for the Solid flavor — see
182
+ // `manifest.ts`'s `nsSolidJsExternalPlugin` + the matching
183
+ // `addCandidate` skip — so all three import sites (vendor's
184
+ // externalized `import 'solid-js'`, user code's
185
+ // alias-rewritten `/ns/m/node_modules/solid-js/...`, and
186
+ // `@solid-refresh`'s own rewritten import) converge on the
187
+ // dev.js URL below. V8's ESM loader dedupes by URL, so the
188
+ // app sees one `Owner` module-local, one `$DEVCOMP`/`$PROXY`
189
+ // symbol identity, and one reactive graph end-to-end. Without
190
+ // this unification, `solid-refresh`'s `setComp` ticks a
191
+ // signal whose subscribers live in a different solid-js
192
+ // realm than the page tree's render effect → HMR appears to
193
+ // fire (toast shows) but the screen never re-renders, and
194
+ // boot logs the `computations created outside a createRoot`
195
+ // warning because solid-refresh's HMRComp memo is created in
196
+ // the HTTP-side solid-js whose `Owner` was never set by the
197
+ // vendor-side `render()` createRoot.
198
+ imports['solid-js'] = `${origin}/ns/m/node_modules/solid-js/dist/dev.js`;
130
199
  // No trailing-slash prefix — subpaths like solid-js/store,
131
200
  // solid-js/jsx-runtime resolve via HTTP from discoverInstalledPackages()
132
201
  break;
@@ -153,23 +222,12 @@ function discoverInstalledPackages(imports, origin) {
153
222
  const nodeModulesDir = resolve(projectRoot, 'node_modules');
154
223
  if (!existsSync(nodeModulesDir))
155
224
  return;
156
- // Packages that should never be in the import map (build tools, types)
157
- const SKIP_PREFIXES = ['@types/', '@babel/', 'babel-', '@nativescript/types'];
158
- const SKIP_EXACT = new Set(['typescript', 'ts-node', 'esbuild', 'prettier', 'webpack', '@nativescript/android', '@nativescript/ios', '@nativescript/visionos', '@nativescript/webpack', '@nativescript/types']);
159
- const shouldSkip = (name) => {
160
- if (SKIP_EXACT.has(name))
161
- return true;
162
- for (const prefix of SKIP_PREFIXES) {
163
- if (name.startsWith(prefix))
164
- return true;
165
- }
166
- return false;
167
- };
168
225
  const addPackage = (name) => {
169
- if (shouldSkip(name))
226
+ const exposure = getDeviceImportMapExposure(name);
227
+ if (exposure === 'omit')
170
228
  return;
171
229
  // Add exact entry only if not already mapped (vendor packages already have ns-vendor:// exact entries)
172
- if (!imports[name]) {
230
+ if (exposure === 'full' && !imports[name]) {
173
231
  imports[name] = `${origin}/ns/m/node_modules/${name}`;
174
232
  }
175
233
  // ALWAYS add trailing-slash prefix for HTTP subpath resolution,
@@ -1 +1 @@
1
- {"version":3,"file":"import-map.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/import-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAe9D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAyB;IAC1D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IACjD,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;IACrC,MAAM,OAAO,GAA2B,EAAE,CAAC;IAE3C,IAAI,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AEnC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC1B,0CAA0C;gBAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;gBAC5C,IAAI,CAAC;oBACJ,MAAM,YAAY,GAAG,WAAW,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;oBACpE,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;wBACvC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE;4BAAE,SAAS;wBACxE,IAAI,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;4BAAE,SAAS;wBAC9C,UAAU,CAAC,GAAG,IAAI,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;oBAC1C,CAAC;gBACF,CAAC;gBAAC,MAAM,CAAC,CAAA,CAAC;YACX,CAAC;iBAAM,CAAC;gBACP,UAAU,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;QACF,CAAC;IACF,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACX,CAAC"}
@@ -1,5 +1,6 @@
1
+ import type { NsDevPlatform } from '../shared/runtime/browser-runtime-contract.js';
1
2
  export declare function getHMRPlugins(opts: {
2
- platform: string;
3
+ platform: NsDevPlatform;
3
4
  flavor: string;
4
5
  verbose: boolean;
5
6
  }): import("vite").Plugin<any>[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEjH,MAAM,UAAU,aAAa,CAAC,IAA4D;IACzF,MAAM,OAAO,GAAG,CA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3C,MAAM;QACP,KAAK,OAAO;YACX,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;YACtC,MAAM;IACR,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC"}
@@ -0,0 +1,204 @@
1
+ /**
2
+ * CJS/ESM interop shape.
3
+ *
4
+ * PROBLEM
5
+ * -------
6
+ * ESM Module Namespace Objects (ECMA §9.4.6) have [[Prototype]] = null.
7
+ * They do NOT inherit Object.prototype — no `hasOwnProperty`, no `toString`,
8
+ * no `isPrototypeOf`. CJS consumers (most notably zone.js's `patchMethod`)
9
+ * assume their require() result is a plain object that has those methods:
10
+ *
11
+ * let proto = target;
12
+ * while (proto && !proto.hasOwnProperty(name)) // ← crashes on null-proto
13
+ * proto = Object.getPrototypeOf(proto);
14
+ *
15
+ * `@nativescript/core/index.js` re-exports several sub-modules as namespaces:
16
+ *
17
+ * export * as Utils from './utils';
18
+ * export * as Http from './http';
19
+ * export * as Connectivity from './connectivity';
20
+ * export * as ApplicationSettings from './application-settings';
21
+ *
22
+ * When bundle.mjs does `import { Utils } from '@nativescript/core'`, `Utils`
23
+ * binds to that null-proto sub-namespace. zone.js then does
24
+ * `patchMethod(Utils, 'mainThreadify', …)` and crashes.
25
+ *
26
+ * WHY globalThis.require shims ALONE DON'T FIX THIS
27
+ * -------------------------------------------------
28
+ * ESM imports never pass through `globalThis.require`. They go through the
29
+ * host's ESM linker (V8 on iOS). Shimming `require` only intercepts the CJS
30
+ * path (vendor packages that use `require('@nativescript/core')`); direct
31
+ * ESM imports of `Utils` still see the raw null-proto namespace.
32
+ *
33
+ * THE FIX
34
+ * -------
35
+ * Rewrite `export * as X from 'Y'` at the /ns/core bridge response level:
36
+ *
37
+ * // before
38
+ * export * as Utils from './utils';
39
+ *
40
+ * // after
41
+ * import * as __ns_re_Utils__ from './utils';
42
+ * export const Utils = __NS_CJS_SHAPE__(__ns_re_Utils__);
43
+ *
44
+ * Now `Utils` is a plain Object (inherits Object.prototype). Zone.js's
45
+ * `patchMethod(Utils, ...)` succeeds. The shape function is recursive —
46
+ * nested namespaces get the same treatment — and identity-preserving
47
+ * (WeakMap-cached) so mutations stick across lookups.
48
+ *
49
+ * WHY THE SHAPE INSTALL MUST RUN IN MODULE BODY (NOT FOOTER)
50
+ * ---------------------------------------------------------
51
+ * `export const Utils = __NS_CJS_SHAPE__(__ns_re_Utils__)` is body code. It
52
+ * executes during module evaluation, BEFORE the registration footer. So the
53
+ * shape function must be installed as a body-level statement that runs
54
+ * before the rewritten body — we can't rely on the footer's install.
55
+ *
56
+ * Each served /ns/core module independently installs the shape function via
57
+ * an idempotent `|| (globalThis.__NS_CJS_SHAPE__ = ...)` assignment. The
58
+ * first module to evaluate wins; subsequent evaluations are no-ops. This
59
+ * also handles dependency-before-importer order (depth-first ESM eval):
60
+ * `/ns/core/utils` evaluates before `/ns/core` main, so the shape helper
61
+ * is in place whenever any body needs it.
62
+ */
63
+ /**
64
+ * Body-code statements that idempotently install `globalThis.__NS_CJS_SHAPE__`
65
+ * and `globalThis.__NS_CJS_SHAPE_CACHE__`. Must execute BEFORE any transformed
66
+ * `export const X = __NS_CJS_SHAPE__(...)` statement in the same module.
67
+ *
68
+ * Properties:
69
+ * - Recursive: traverses nested namespaces so `Utils.Something` is also
70
+ * a plain Object (if that sub-namespace is itself null-proto).
71
+ * - Identity-preserving: WeakMap keyed on the underlying ESM namespace.
72
+ * zone.js mutates its patch target; a fresh copy per call would lose
73
+ * mutations. Every lookup of the same namespace returns the same
74
+ * shaped object.
75
+ * - Cycle-safe: records the output in the cache BEFORE recursing into
76
+ * children. Handles `core ↔ platform` style cycles.
77
+ * - TDZ-safe: wraps each property read in try/catch. Some exports
78
+ * (Angular zone.js with early-access patterns) are still in their
79
+ * temporal dead zone when the namespace is first snapshotted. A thrown
80
+ * property read is skipped rather than failing the whole shape.
81
+ */
82
+ export declare function buildShapeInstallHeader(): string;
83
+ /**
84
+ * Rewrite namespace re-exports from CJS-incompatible ESM namespace form into
85
+ * shape-aware const exports. Handles the two forms Vite/esbuild may emit:
86
+ *
87
+ * (1) Original ES2020 syntax preserved unchanged:
88
+ * export * as X from 'Y';
89
+ *
90
+ * (2) Transpiled form esbuild emits when targeting older ES:
91
+ * import * as _foo from 'Y';
92
+ * export { _foo as X };
93
+ *
94
+ * Both become:
95
+ * import * as __ns_re_X__ from 'Y';
96
+ * export const X = __NS_CJS_SHAPE__(__ns_re_X__);
97
+ *
98
+ * Notes on the transform:
99
+ * - The internal binding uses a derived name (`__ns_re_<X>__`) so
100
+ * collisions with user bindings are extremely unlikely. Core doesn't
101
+ * declare identifiers matching that shape.
102
+ * - `__NS_CJS_SHAPE__` is read from globalThis with a defensive fallback
103
+ * (identity function) in case installation failed or runs in an
104
+ * environment where it hasn't been initialized yet. This makes the
105
+ * transform safe to apply to modules that don't always go through the
106
+ * /ns/core handler's headers.
107
+ * - We do NOT shape `export *` (star re-exports without alias). Those
108
+ * spread individual named exports — they don't create a nested
109
+ * namespace and aren't affected by the null-proto issue.
110
+ * - We do NOT shape `export { x } from 'y'` forms. Those copy individual
111
+ * named exports directly; the consumer never sees the namespace.
112
+ *
113
+ * The regex is intentionally precise. It matches only the `export * as X from
114
+ * 'Y'` syntactic form (and its transpiled equivalent) — no accidental matches
115
+ * in string literals or comments because those can't start a top-level
116
+ * statement with `export`.
117
+ */
118
+ export declare function rewriteNamespaceReExportsForShape(code: string): string;
119
+ /**
120
+ * Convenience: returns true if the given code appears to contain at least one
121
+ * namespace re-export that would benefit from the shape transform. Used to
122
+ * skip the regex replace for modules that don't need it (keeps the response
123
+ * identical for most submodules, which just have plain `export * from` or
124
+ * named exports).
125
+ */
126
+ export declare function hasNamespaceReExport(code: string): boolean;
127
+ /**
128
+ * Default-export bridge footer.
129
+ *
130
+ * BACKGROUND
131
+ * ----------
132
+ * Upstream consumer rewrites in the /ns/m handler convert
133
+ * `import { X } from '@nativescript/core'` into
134
+ * `import __ns_core_ns from '/ns/core'; const { X } = __ns_core_ns;`
135
+ * — a DEFAULT import followed by destructuring. The inline comment on that
136
+ * rewrite says explicitly: "This makes `import { Frame } from
137
+ * '@nativescript/core'` work even if the bridge provides only a default
138
+ * export."
139
+ *
140
+ * The original `@nativescript/core/index.js` has no `export default` — all
141
+ * named exports. Without this footer, consumers of the transformed import
142
+ * fail at ESM link time:
143
+ *
144
+ * SyntaxError: The requested module '/ns/core/<ver>' does not
145
+ * provide an export named 'default'
146
+ *
147
+ * THE FIX
148
+ * -------
149
+ * Emit `export default __ns_core_self_ns__;` at the end of the served
150
+ * module body. `__ns_core_self_ns__` is the namespace import the server
151
+ * already emits at the top of every /ns/core response for self-
152
+ * registration purposes. ESM spec guarantees a module re-entering itself
153
+ * during evaluation returns the in-progress namespace — so no extra
154
+ * evaluation occurs, and the default binding receives an object whose
155
+ * properties are every named export of the same module.
156
+ *
157
+ * CONSUMER MATRIX AFTER THIS FIX
158
+ * ------------------------------
159
+ * • `import X from '/ns/core'` (default) → X = self namespace
160
+ * • `import * as X from '/ns/core'` → X = self namespace + X.default = self
161
+ * • `import { X } from '/ns/core'` (named) → individual named binding (untouched)
162
+ * • `const { X } = <default-import>` → destructure from self namespace
163
+ * • `require('@nativescript/core')` (CJS) → shaped self via registry
164
+ *
165
+ * SKIP CONDITIONS
166
+ * ---------------
167
+ * Returns empty string when the source already declares a default export
168
+ * (some deep subpaths do — e.g. a file that does `export default MyClass`
169
+ * would SyntaxError on a duplicate). The consumer rewrite is also gated
170
+ * on `isDeepCoreSubpath`, so those paths don't normally hit the default-
171
+ * import pattern anyway.
172
+ *
173
+ * WHY THE DEFAULT ISN'T SHAPED
174
+ * ----------------------------
175
+ * The default is the raw null-proto MNO. This is intentional:
176
+ *
177
+ * 1. All current default-import consumers either destructure or do
178
+ * property access. Neither requires Object.prototype in the chain.
179
+ * 2. Shaping the default inside the module body would require calling
180
+ * __NS_CJS_SHAPE__ on a namespace whose own `default` slot is still
181
+ * being initialized — temporal dead zone hazard.
182
+ * 3. CJS consumers that need `.hasOwnProperty` go through the registry
183
+ * (shaped at registration), not through the default import.
184
+ *
185
+ * If a future consumer surfaces that calls `.hasOwnProperty` on the
186
+ * default, we can revisit. The current rule-of-least-surprise is:
187
+ * shape at the CJS boundary, not at the ESM boundary.
188
+ */
189
+ export declare function buildDefaultExportFooter(rewrittenCode: string): string;
190
+ /**
191
+ * Detects whether a module body already declares a default export in any of
192
+ * the syntactic forms the ESM spec allows. Mirrors the logic in
193
+ * `websocket-core-bridge.ts:hasModuleDefaultExport` — kept here so the
194
+ * default-export bridge helper is self-contained and unit-testable.
195
+ *
196
+ * Handles:
197
+ * - `export default <expr>;`
198
+ * - `export default function|class ...`
199
+ * - `export { x as default };`
200
+ * - `export { default };` (implicit `default as default`)
201
+ * - `export { default as default };`
202
+ * - `export { foo, default };`
203
+ */
204
+ export declare function hasExistingDefaultExport(code: string): boolean;