@nativescript/vite 8.0.0-alpha.57 → 8.0.0-alpha.58

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 (102) hide show
  1. package/configuration/angular.js +3 -3
  2. package/configuration/angular.js.map +1 -1
  3. package/helpers/global-defines.d.ts +1 -1
  4. package/helpers/global-defines.js +1 -1
  5. package/helpers/workers.js +10 -10
  6. package/helpers/workers.js.map +1 -1
  7. package/hmr/client/hot-context.d.ts +67 -0
  8. package/hmr/client/hot-context.js +284 -0
  9. package/hmr/client/hot-context.js.map +1 -0
  10. package/hmr/client/index.js +49 -60
  11. package/hmr/client/index.js.map +1 -1
  12. package/hmr/client/utils.js +29 -57
  13. package/hmr/client/utils.js.map +1 -1
  14. package/hmr/entry-runtime.js +73 -39
  15. package/hmr/entry-runtime.js.map +1 -1
  16. package/hmr/frameworks/angular/client/index.js +103 -161
  17. package/hmr/frameworks/angular/client/index.js.map +1 -1
  18. package/hmr/frameworks/angular/server/strategy.js +4 -6
  19. package/hmr/frameworks/angular/server/strategy.js.map +1 -1
  20. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js +2 -2
  21. package/hmr/frameworks/angular/server/websocket-angular-hot-update.js.map +1 -1
  22. package/hmr/frameworks/solid/client/app-runtime.js +9 -7
  23. package/hmr/frameworks/solid/client/app-runtime.js.map +1 -1
  24. package/hmr/frameworks/solid/server/strategy.js +1 -1
  25. package/hmr/frameworks/solid/server/strategy.js.map +1 -1
  26. package/hmr/frameworks/typescript/server/strategy.js +1 -1
  27. package/hmr/frameworks/typescript/server/strategy.js.map +1 -1
  28. package/hmr/frameworks/vue/client/index.d.ts +1 -0
  29. package/hmr/frameworks/vue/client/index.js +54 -10
  30. package/hmr/frameworks/vue/client/index.js.map +1 -1
  31. package/hmr/frameworks/vue/server/sfc-route-assemble.js +32 -39
  32. package/hmr/frameworks/vue/server/sfc-route-assemble.js.map +1 -1
  33. package/hmr/frameworks/vue/server/sfc-route-serve.js +18 -30
  34. package/hmr/frameworks/vue/server/sfc-route-serve.js.map +1 -1
  35. package/hmr/frameworks/vue/server/sfc-route-shared.d.ts +13 -16
  36. package/hmr/frameworks/vue/server/sfc-route-shared.js +20 -24
  37. package/hmr/frameworks/vue/server/sfc-route-shared.js.map +1 -1
  38. package/hmr/frameworks/vue/server/strategy.js +14 -12
  39. package/hmr/frameworks/vue/server/strategy.js.map +1 -1
  40. package/hmr/helpers/vendor-rewrite.d.ts +1 -1
  41. package/hmr/helpers/vendor-rewrite.js +5 -3
  42. package/hmr/helpers/vendor-rewrite.js.map +1 -1
  43. package/hmr/server/boot-closure-route.d.ts +16 -0
  44. package/hmr/server/boot-closure-route.js +99 -0
  45. package/hmr/server/boot-closure-route.js.map +1 -0
  46. package/hmr/server/core-bundle.d.ts +116 -0
  47. package/hmr/server/core-bundle.js +460 -0
  48. package/hmr/server/core-bundle.js.map +1 -0
  49. package/hmr/server/framework-strategy.d.ts +10 -5
  50. package/hmr/server/hmr-module-graph.js +7 -6
  51. package/hmr/server/hmr-module-graph.js.map +1 -1
  52. package/hmr/server/import-map.d.ts +3 -3
  53. package/hmr/server/import-map.js +4 -4
  54. package/hmr/server/import-map.js.map +1 -1
  55. package/hmr/server/ns-rt-route.js +2 -1
  56. package/hmr/server/ns-rt-route.js.map +1 -1
  57. package/hmr/server/perf-instrumentation.js +1 -1
  58. package/hmr/server/perf-instrumentation.js.map +1 -1
  59. package/hmr/server/process-code-for-device.d.ts +16 -0
  60. package/hmr/server/process-code-for-device.js +94 -2
  61. package/hmr/server/process-code-for-device.js.map +1 -1
  62. package/hmr/server/vite-plugin.d.ts +1 -0
  63. package/hmr/server/vite-plugin.js +110 -20
  64. package/hmr/server/vite-plugin.js.map +1 -1
  65. package/hmr/server/websocket-import-map-route.d.ts +1 -1
  66. package/hmr/server/websocket-import-map-route.js +1 -1
  67. package/hmr/server/websocket-ns-core.d.ts +16 -3
  68. package/hmr/server/websocket-ns-core.js +100 -5
  69. package/hmr/server/websocket-ns-core.js.map +1 -1
  70. package/hmr/server/websocket-ns-m-paths.d.ts +1 -3
  71. package/hmr/server/websocket-ns-m-paths.js +24 -80
  72. package/hmr/server/websocket-ns-m-paths.js.map +1 -1
  73. package/hmr/server/websocket-ns-m.js +41 -77
  74. package/hmr/server/websocket-ns-m.js.map +1 -1
  75. package/hmr/server/websocket-served-module-helpers.d.ts +1 -1
  76. package/hmr/server/websocket-served-module-helpers.js +11 -5
  77. package/hmr/server/websocket-served-module-helpers.js.map +1 -1
  78. package/hmr/server/websocket-txn.js +4 -1
  79. package/hmr/server/websocket-txn.js.map +1 -1
  80. package/hmr/server/websocket.js +8 -1
  81. package/hmr/server/websocket.js.map +1 -1
  82. package/hmr/shared/ns-globals.d.ts +2 -15
  83. package/hmr/shared/ns-globals.js +2 -3
  84. package/hmr/shared/ns-globals.js.map +1 -1
  85. package/hmr/shared/runtime/boot-complete.d.ts +14 -0
  86. package/hmr/shared/runtime/boot-complete.js +32 -0
  87. package/hmr/shared/runtime/boot-complete.js.map +1 -0
  88. package/hmr/shared/runtime/boot-progress.js +6 -5
  89. package/hmr/shared/runtime/boot-progress.js.map +1 -1
  90. package/hmr/shared/runtime/boot-timeline.d.ts +1 -1
  91. package/hmr/shared/runtime/boot-timeline.js +6 -7
  92. package/hmr/shared/runtime/boot-timeline.js.map +1 -1
  93. package/hmr/shared/runtime/browser-runtime-contract.d.ts +34 -22
  94. package/hmr/shared/runtime/browser-runtime-contract.js +6 -9
  95. package/hmr/shared/runtime/browser-runtime-contract.js.map +1 -1
  96. package/hmr/shared/runtime/dev-overlay.js +1 -1
  97. package/hmr/shared/runtime/dev-overlay.js.map +1 -1
  98. package/hmr/shared/runtime/root-placeholder.js +5 -4
  99. package/hmr/shared/runtime/root-placeholder.js.map +1 -1
  100. package/hmr/shared/runtime/session-bootstrap.js +90 -48
  101. package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
  102. package/package.json +5 -1
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Single-eval @nativescript/core bundle for device serving (bundle mode).
3
+ *
4
+ * DEFAULT MODE (consumers)
5
+ * ------------------------
6
+ * Instead of serving @nativescript/core per-module through Vite's transform
7
+ * pipeline (~hundreds of serial HTTP fetches + per-file transforms during cold
8
+ * boot), the dev server pre-bundles the ENTIRE core package with esbuild into
9
+ * one ESM payload served at `GET /ns/core-bundle.mjs`. The canonical
10
+ * `/ns/core[/<sub>]` URL space is preserved — those routes serve THIN SHIMS
11
+ * that statically import the bundle and re-export the requested subpath's
12
+ * namespace from the `globalThis.__NS_CORE_MODULES__` registry the bundle
13
+ * populates. Because every shim's only dependency is the one bundle URL,
14
+ * V8/iOS evaluates core exactly once per app lifetime — the single-realm
15
+ * invariant is enforced by construction, with ONE big prefetchable payload
16
+ * instead of a deep serial fetch chain.
17
+ *
18
+ * OPT-IN PER-MODULE MODE (core maintainers)
19
+ * -----------------------------------------
20
+ * Set `NS_CORE_PER_MODULE=1` to keep the classic per-module `/ns/core` bridge
21
+ * (websocket-ns-core.ts). That is the right mode when editing
22
+ * `@nativescript/core` source live inside the NativeScript monorepo: each core
23
+ * module stays individually served/transformed so core edits participate in
24
+ * HMR. Consumers of the published package don't edit core mid-session, so the
25
+ * bundle is both safe and much faster for them.
26
+ *
27
+ * FAILURE FALLBACK
28
+ * ----------------
29
+ * If the esbuild bundle build fails for any reason, the service marks itself
30
+ * failed and `/ns/core[/<sub>]` transparently falls back to the per-module
31
+ * bridge for the whole session (logged loudly once). Boot still works; only
32
+ * the speed win is lost.
33
+ */
34
+ import type { ViteDevServer } from 'vite';
35
+ import type { Platform } from '../../helpers/platform-types.js';
36
+ /**
37
+ * Per-module /ns/core serving mode (vs the default single-eval bundle).
38
+ *
39
+ * `NS_CORE_PER_MODULE=1|true` forces it on, `0|false` forces bundle mode.
40
+ * When unset, it AUTO-ENABLES for monorepo core source (packages/core in the
41
+ * NativeScript repo). Two reasons:
42
+ * - core maintainers edit core live, and per-module serving keeps those
43
+ * edits in HMR;
44
+ * - realm safety: the build-time externalizer emits
45
+ * `/ns/m/packages/core/<file>` URLs for workspace-source core (see the
46
+ * `ns-core-external-urls` workspace branch in configuration/base.ts), so
47
+ * the served graph's core realm lives under /ns/m. A bundle-mode
48
+ * `/ns/core-bundle.mjs` would evaluate a complete SECOND copy of core for
49
+ * the entry's `/ns/core/globals|application|…` imports — duplicate native
50
+ * class registrations crash in MetadataBuilder at startup.
51
+ */
52
+ export declare function isCorePerModuleServingEnabled(env?: NodeJS.ProcessEnv, hasWorkspaceCoreSource?: () => boolean): boolean;
53
+ export interface CoreBundleState {
54
+ /** Full ESM payload served at /ns/core-bundle.mjs (shape header + esbuild output). */
55
+ code: string;
56
+ /** Canonical subpaths registered in the bundle's __NS_CORE_MODULES__ registry. */
57
+ subs: Set<string>;
58
+ hash: string;
59
+ builtAt: number;
60
+ buildMs: number;
61
+ }
62
+ export interface CoreBundleService {
63
+ /** Resolves the built bundle, or null when the build failed (per-module fallback). */
64
+ ensureBuilt(): Promise<CoreBundleState | null>;
65
+ /** Synchronous view — null until built (or when failed). */
66
+ getState(): CoreBundleState | null;
67
+ hasFailed(): boolean;
68
+ }
69
+ export interface GenerateCoreBundleOptions {
70
+ projectRoot: string;
71
+ platform: Platform | string;
72
+ mode: 'development' | 'production' | string;
73
+ flavor?: string;
74
+ verbose?: boolean;
75
+ }
76
+ /**
77
+ * Resolve the physical @nativescript/core root the same way configuration/
78
+ * base.ts does: prefer monorepo source (`<workspace>/packages/core`), else the
79
+ * node_modules install reachable from the project root.
80
+ */
81
+ export declare function resolveCoreRootForBundle(projectRoot: string): string;
82
+ /**
83
+ * Enumerate every importable core subpath (canonical form, per
84
+ * `normalizeCoreSub`) for the given platform. A subpath is included when it
85
+ * has a platform-neutral variant OR a variant for the current platform —
86
+ * other-platform-only modules (e.g. `ui/frame/activity.android` on iOS) are
87
+ * skipped since they can never resolve for this build.
88
+ */
89
+ export declare function enumerateCoreModuleSubpaths(coreRoot: string, platform: string): string[];
90
+ /**
91
+ * Synthetic esbuild entry: evaluate core once, expose every subpath's live
92
+ * namespace through `globalThis.__NS_CORE_MODULES__` (the SAME registry the
93
+ * per-module bridge footers populate, so the vendor CJS `require()` shim and
94
+ * `_nsReq` lookups keep working unchanged), and re-export the package main so
95
+ * `/ns/core-bundle.mjs` itself has core's full named-export surface.
96
+ */
97
+ export declare function buildCoreBundleEntryCode(subs: readonly string[]): string;
98
+ export declare function generateCoreBundle(options: GenerateCoreBundleOptions): Promise<CoreBundleState>;
99
+ export declare function createCoreBundleService(options: GenerateCoreBundleOptions): CoreBundleService;
100
+ /**
101
+ * Process-wide bundle service derived from the dev server's config + CLI
102
+ * flags. One dev server per process, so a module-level singleton matches the
103
+ * vendor manifest's lifecycle.
104
+ */
105
+ export declare function getSharedCoreBundleService(server: ViteDevServer): CoreBundleService;
106
+ /** Test seam: drop the shared service so specs can mount fresh. */
107
+ export declare function resetSharedCoreBundleServiceForTests(): void;
108
+ export declare const CORE_BUNDLE_PATH = "/ns/core-bundle.mjs";
109
+ /**
110
+ * Shim served at `/ns/core` in bundle mode. `export * from` gives real,
111
+ * live named bindings straight off the bundle module record; the explicit
112
+ * default keeps the "default import + destructure" consumer rewrite working
113
+ * (see buildDefaultExportFooter in ns-core-cjs-shape.ts for that contract).
114
+ */
115
+ export declare function buildCoreMainShimCode(): string;
116
+ export declare function buildCoreSubShimCode(sub: string, exportNames: readonly string[], hasOwnDefaultExport?: boolean): string;
@@ -0,0 +1,460 @@
1
+ /**
2
+ * Single-eval @nativescript/core bundle for device serving (bundle mode).
3
+ *
4
+ * DEFAULT MODE (consumers)
5
+ * ------------------------
6
+ * Instead of serving @nativescript/core per-module through Vite's transform
7
+ * pipeline (~hundreds of serial HTTP fetches + per-file transforms during cold
8
+ * boot), the dev server pre-bundles the ENTIRE core package with esbuild into
9
+ * one ESM payload served at `GET /ns/core-bundle.mjs`. The canonical
10
+ * `/ns/core[/<sub>]` URL space is preserved — those routes serve THIN SHIMS
11
+ * that statically import the bundle and re-export the requested subpath's
12
+ * namespace from the `globalThis.__NS_CORE_MODULES__` registry the bundle
13
+ * populates. Because every shim's only dependency is the one bundle URL,
14
+ * V8/iOS evaluates core exactly once per app lifetime — the single-realm
15
+ * invariant is enforced by construction, with ONE big prefetchable payload
16
+ * instead of a deep serial fetch chain.
17
+ *
18
+ * OPT-IN PER-MODULE MODE (core maintainers)
19
+ * -----------------------------------------
20
+ * Set `NS_CORE_PER_MODULE=1` to keep the classic per-module `/ns/core` bridge
21
+ * (websocket-ns-core.ts). That is the right mode when editing
22
+ * `@nativescript/core` source live inside the NativeScript monorepo: each core
23
+ * module stays individually served/transformed so core edits participate in
24
+ * HMR. Consumers of the published package don't edit core mid-session, so the
25
+ * bundle is both safe and much faster for them.
26
+ *
27
+ * FAILURE FALLBACK
28
+ * ----------------
29
+ * If the esbuild bundle build fails for any reason, the service marks itself
30
+ * failed and `/ns/core[/<sub>]` transparently falls back to the per-module
31
+ * bridge for the whole session (logged loudly once). Boot still works; only
32
+ * the speed win is lost.
33
+ */
34
+ import { createRequire } from 'node:module';
35
+ import { existsSync, readdirSync, statSync } from 'node:fs';
36
+ import * as path from 'node:path';
37
+ import { createHash } from 'node:crypto';
38
+ import * as esbuild from 'esbuild';
39
+ import { getCliFlags } from '../../helpers/cli-flags.js';
40
+ import { getGlobalDefines } from '../../helpers/global-defines.js';
41
+ import { getProjectFlavor } from '../../helpers/flavor.js';
42
+ import { createNativeClassEsbuildPlugin } from '../../helpers/nativeclass-esbuild-plugin.js';
43
+ import { createUnicodeRegexEsbuildPlugin } from '../shared/vendor/vendor-esbuild-plugins.js';
44
+ import { moduleRegistrationKeys, normalizeCoreSub } from '../../helpers/ns-core-url.js';
45
+ import { buildShapeInstallHeader } from './ns-core-cjs-shape.js';
46
+ import { resolveVerboseFlag } from '../../helpers/logging.js';
47
+ import { nsConfigToJson } from '../../helpers/utils.js';
48
+ import { aliasCssTree } from '../../helpers/css-tree.js';
49
+ import { getWorkspaceCoreSourceRoot } from './websocket-served-module-helpers.js';
50
+ /**
51
+ * Per-module /ns/core serving mode (vs the default single-eval bundle).
52
+ *
53
+ * `NS_CORE_PER_MODULE=1|true` forces it on, `0|false` forces bundle mode.
54
+ * When unset, it AUTO-ENABLES for monorepo core source (packages/core in the
55
+ * NativeScript repo). Two reasons:
56
+ * - core maintainers edit core live, and per-module serving keeps those
57
+ * edits in HMR;
58
+ * - realm safety: the build-time externalizer emits
59
+ * `/ns/m/packages/core/<file>` URLs for workspace-source core (see the
60
+ * `ns-core-external-urls` workspace branch in configuration/base.ts), so
61
+ * the served graph's core realm lives under /ns/m. A bundle-mode
62
+ * `/ns/core-bundle.mjs` would evaluate a complete SECOND copy of core for
63
+ * the entry's `/ns/core/globals|application|…` imports — duplicate native
64
+ * class registrations crash in MetadataBuilder at startup.
65
+ */
66
+ export function isCorePerModuleServingEnabled(env = process.env, hasWorkspaceCoreSource = () => getWorkspaceCoreSourceRoot() !== null) {
67
+ const v = env.NS_CORE_PER_MODULE;
68
+ if (v === '1' || v === 'true')
69
+ return true;
70
+ if (v === '0' || v === 'false')
71
+ return false;
72
+ try {
73
+ return hasWorkspaceCoreSource();
74
+ }
75
+ catch {
76
+ return false;
77
+ }
78
+ }
79
+ /**
80
+ * Resolve the physical @nativescript/core root the same way configuration/
81
+ * base.ts does: prefer monorepo source (`<workspace>/packages/core`), else the
82
+ * node_modules install reachable from the project root.
83
+ */
84
+ export function resolveCoreRootForBundle(projectRoot) {
85
+ const workspaceCorePkg = path.resolve(projectRoot, '../../packages/core/package.json');
86
+ if (existsSync(workspaceCorePkg)) {
87
+ return path.dirname(workspaceCorePkg);
88
+ }
89
+ const req = createRequire(path.join(projectRoot, 'package.json'));
90
+ const corePkg = req.resolve('@nativescript/core/package.json');
91
+ return path.dirname(corePkg);
92
+ }
93
+ // Directories that are not runtime module space. `debugger/` and
94
+ // `inspector_modules` only evaluate when a Web Inspector session loads them
95
+ // (via the app bundle, not HTTP) and carry heavyweight side effects (network
96
+ // interception) that must NOT run on every boot, so they stay out of the
97
+ // bundle. A request for an excluded subpath falls back to per-module serving —
98
+ // realm-safe, because the per-module response's own core imports are rewritten
99
+ // back to `/ns/core/<sub>` shim URLs that resolve into the bundle realm.
100
+ const EXCLUDED_DIRS = new Set(['node_modules', 'platforms', 'cli-hooks', 'debugger', '.git', '__tests__', 'fixtures']);
101
+ const EXCLUDED_TOP_LEVEL_MODULES = new Set(['inspector_modules', 'bundle-entry-points', 'references', 'global-types', 'vite.config', 'vitest.setup']);
102
+ const MODULE_FILE_RE = /\.(?:ts|tsx|js|mjs)$/;
103
+ const NON_MODULE_FILE_RE = /\.(?:d\.ts|spec\.(?:ts|js|tsx)|test\.(?:ts|js|tsx))$/;
104
+ function platformSuffixOf(baseName) {
105
+ const m = baseName.match(/\.(ios|android|visionos)$/);
106
+ return m?.[1] || null;
107
+ }
108
+ /**
109
+ * Enumerate every importable core subpath (canonical form, per
110
+ * `normalizeCoreSub`) for the given platform. A subpath is included when it
111
+ * has a platform-neutral variant OR a variant for the current platform —
112
+ * other-platform-only modules (e.g. `ui/frame/activity.android` on iOS) are
113
+ * skipped since they can never resolve for this build.
114
+ */
115
+ export function enumerateCoreModuleSubpaths(coreRoot, platform) {
116
+ const isApple = platform !== 'android';
117
+ // canonical sub → has a variant loadable on this platform
118
+ const loadable = new Map();
119
+ const visit = (dirAbs, relPrefix) => {
120
+ let entries;
121
+ try {
122
+ entries = readdirSync(dirAbs, { withFileTypes: true });
123
+ }
124
+ catch {
125
+ return;
126
+ }
127
+ for (const entry of entries) {
128
+ const name = entry.name;
129
+ if (name.startsWith('.'))
130
+ continue;
131
+ const rel = relPrefix ? `${relPrefix}/${name}` : name;
132
+ let isDir = entry.isDirectory();
133
+ if (entry.isSymbolicLink()) {
134
+ try {
135
+ isDir = statSync(path.join(dirAbs, name)).isDirectory();
136
+ }
137
+ catch {
138
+ continue;
139
+ }
140
+ }
141
+ if (isDir) {
142
+ if (EXCLUDED_DIRS.has(name))
143
+ continue;
144
+ visit(path.join(dirAbs, name), rel);
145
+ continue;
146
+ }
147
+ if (!MODULE_FILE_RE.test(name) || NON_MODULE_FILE_RE.test(name))
148
+ continue;
149
+ const relNoExt = rel.replace(MODULE_FILE_RE, '');
150
+ const suffix = platformSuffixOf(relNoExt);
151
+ const platformOk = suffix === null || (isApple ? suffix !== 'android' : suffix === 'android');
152
+ const canonical = normalizeCoreSub(relNoExt);
153
+ // '' is the package main — always included, not part of the sub list.
154
+ if (!canonical)
155
+ continue;
156
+ if (!relPrefix && EXCLUDED_TOP_LEVEL_MODULES.has(canonical))
157
+ continue;
158
+ if (canonical.split('/').some((seg) => EXCLUDED_TOP_LEVEL_MODULES.has(seg) || EXCLUDED_DIRS.has(seg)))
159
+ continue;
160
+ // Cross-platform helper modules without a platform suffix in their
161
+ // own filename (e.g. `ui/frame/frame-helper-for-android`) import
162
+ // siblings that only exist with the OTHER platform's suffix, so
163
+ // force-importing them on this platform can never resolve. They are
164
+ // only reachable from that platform's `index.<platform>` graph.
165
+ if (/-for-android$/.test(canonical) && isApple)
166
+ continue;
167
+ if (/-for-(?:ios|visionos)$/.test(canonical) && !isApple)
168
+ continue;
169
+ loadable.set(canonical, loadable.get(canonical) || false || platformOk);
170
+ }
171
+ };
172
+ visit(coreRoot, '');
173
+ return Array.from(loadable.entries())
174
+ .filter(([, ok]) => ok)
175
+ .map(([sub]) => sub)
176
+ .sort();
177
+ }
178
+ /**
179
+ * Synthetic esbuild entry: evaluate core once, expose every subpath's live
180
+ * namespace through `globalThis.__NS_CORE_MODULES__` (the SAME registry the
181
+ * per-module bridge footers populate, so the vendor CJS `require()` shim and
182
+ * `_nsReq` lookups keep working unchanged), and re-export the package main so
183
+ * `/ns/core-bundle.mjs` itself has core's full named-export surface.
184
+ */
185
+ export function buildCoreBundleEntryCode(subs) {
186
+ const lines = [];
187
+ // Package main first so its side-effect order (globals, bootstrap) matches
188
+ // the package's own intent; esbuild still evaluates shared deps once.
189
+ lines.push(`import * as __ns_core_main__ from ${JSON.stringify('@nativescript/core')};`);
190
+ subs.forEach((sub, i) => {
191
+ lines.push(`import * as __ns_core_m_${i}__ from ${JSON.stringify(`@nativescript/core/${sub}`)};`);
192
+ });
193
+ lines.push('');
194
+ lines.push('const __nsReg = (globalThis.__NS_CORE_MODULES__ || (globalThis.__NS_CORE_MODULES__ = Object.create(null)));');
195
+ lines.push(`const __nsShapeFn = typeof globalThis.__NS_CJS_SHAPE__ === 'function' ? globalThis.__NS_CJS_SHAPE__ : function (x) { return x; };`);
196
+ lines.push('const __nsRegSet = (keys, ns) => { const shaped = __nsShapeFn(ns); for (const k of keys) { __nsReg[k] = shaped; } };');
197
+ lines.push(`__nsRegSet(${JSON.stringify(moduleRegistrationKeys(''))}, __ns_core_main__);`);
198
+ subs.forEach((sub, i) => {
199
+ lines.push(`__nsRegSet(${JSON.stringify(moduleRegistrationKeys(sub))}, __ns_core_m_${i}__);`);
200
+ });
201
+ lines.push(`try { globalThis.__NS_CORE_EVAL_COUNT__ = (globalThis.__NS_CORE_EVAL_COUNT__ || 0) + 1; globalThis.__NS_CORE_BUNDLE_MODE__ = true; } catch (e) {}`);
202
+ lines.push(`export * from ${JSON.stringify('@nativescript/core')};`);
203
+ lines.push('');
204
+ return lines.join('\n');
205
+ }
206
+ // Platform-first extension order, mirroring Vite's `platformExtensions` in
207
+ // configuration/base.ts so the bundle resolves the same physical files the
208
+ // per-module bridge would (platform variant preferred over the bare one).
209
+ function coreResolveExtensions(platform) {
210
+ if (platform === 'android') {
211
+ return ['.android.tsx', '.tsx', '.android.jsx', '.jsx', '.android.ts', '.ts', '.android.js', '.js', '.mjs', '.cjs', '.json'];
212
+ }
213
+ return ['.ios.tsx', '.visionos.tsx', '.tsx', '.ios.jsx', '.visionos.jsx', '.jsx', '.ios.ts', '.visionos.ts', '.ts', '.ios.js', '.visionos.js', '.js', '.mjs', '.cjs', '.json'];
214
+ }
215
+ // Node built-ins the device runtime cannot resolve — externalized exactly like
216
+ // the vendor bundle build (see manifest.ts).
217
+ const NODE_BUILTINS = ['assert', 'async_hooks', 'buffer', 'child_process', 'cluster', 'console', 'constants', 'crypto', 'dgram', 'diagnostics_channel', 'dns', 'domain', 'events', 'fs', 'fs/promises', 'http', 'http2', 'https', 'inspector', 'module', 'net', 'os', 'path', 'path/posix', 'path/win32', 'perf_hooks', 'process', 'punycode', 'querystring', 'readline', 'repl', 'stream', 'stream/web', 'stream/promises', 'string_decoder', 'sys', 'timers', 'timers/promises', 'tls', 'trace_events', 'tty', 'url', 'util', 'v8', 'vm', 'wasi', 'worker_threads', 'zlib'];
218
+ const NODE_EXTERNALS = [...NODE_BUILTINS, ...NODE_BUILTINS.map((b) => `node:${b}`)];
219
+ export async function generateCoreBundle(options) {
220
+ const { projectRoot, platform, mode, flavor, verbose } = options;
221
+ const t0 = Date.now();
222
+ const coreRoot = resolveCoreRootForBundle(projectRoot);
223
+ const subs = enumerateCoreModuleSubpaths(coreRoot, String(platform));
224
+ const entryCode = buildCoreBundleEntryCode(subs);
225
+ // Resolve bare @nativescript/core[/sub] specifiers against the resolved
226
+ // core root directly. esbuild's default node-resolution can't be trusted
227
+ // here for two reasons: (1) monorepo apps consume core via a symlink whose
228
+ // realpath escapes the project's node_modules, and (2) the package's
229
+ // `main: "index"` is extensionless. Mapping to `<coreRoot>/<sub>` and
230
+ // letting resolveExtensions pick the platform file mirrors Vite's alias +
231
+ // extension behavior byte-for-byte.
232
+ const coreAliasPlugin = {
233
+ name: 'ns-core-bundle-alias',
234
+ setup(build) {
235
+ build.onResolve({ filter: /^@nativescript\/core(?:\/.*)?$/ }, (args) => {
236
+ const sub = args.path === '@nativescript/core' ? '' : args.path.slice('@nativescript/core/'.length);
237
+ const target = sub ? path.join(coreRoot, sub) : path.join(coreRoot, 'index');
238
+ return build.resolve(target, { kind: args.kind, resolveDir: coreRoot });
239
+ });
240
+ },
241
+ };
242
+ // Mirror the Vite pipeline's css-tree environment aliases: css-tree's ESM
243
+ // files do `import { createRequire } from 'module'` to lazily require JSON
244
+ // data — on device that bare 'module' import must resolve to our polyfill
245
+ // (same replacement `aliasCssTree` feeds Vite's resolver; see
246
+ // helpers/css-tree.ts and polyfills/module.ts). In the source tree the
247
+ // replacement's `.js` file may not exist yet (only `.ts`) — fall back.
248
+ const resolvePolyfillFile = (p) => {
249
+ if (existsSync(p))
250
+ return p;
251
+ const ts = p.replace(/\.js$/, '.ts');
252
+ return existsSync(ts) ? ts : p;
253
+ };
254
+ const polyfillAliases = new Map();
255
+ for (const { find, replacement } of aliasCssTree) {
256
+ polyfillAliases.set(String(find), resolvePolyfillFile(replacement));
257
+ }
258
+ const cssTreeEnvPlugin = {
259
+ name: 'ns-core-bundle-css-tree-env',
260
+ setup(build) {
261
+ build.onResolve({ filter: /^(?:node:)?module$|^mdn-data\/css\// }, (args) => {
262
+ const key = args.path.replace(/^node:/, '');
263
+ const target = polyfillAliases.get(key);
264
+ return target ? { path: target } : undefined;
265
+ });
266
+ },
267
+ };
268
+ // `~/package.json` — core's profiling/style-scope modules import the APP's
269
+ // nativescript.config as JSON through this alias (Vite serves it via the
270
+ // nsvite:nsconfig-json virtual module; see helpers/config-as-json.ts).
271
+ // Mirror that here with the same nsConfigToJson() payload.
272
+ const nsConfigJson = (() => {
273
+ try {
274
+ return JSON.stringify(nsConfigToJson());
275
+ }
276
+ catch {
277
+ // No nativescript.config.ts reachable (tests, bare fixtures) — the
278
+ // importers only read optional profiling/cssParser hints from it.
279
+ return '{}';
280
+ }
281
+ })();
282
+ const nsConfigPlugin = {
283
+ name: 'ns-core-bundle-nsconfig',
284
+ setup(build) {
285
+ build.onResolve({ filter: /^~\/package\.json$/ }, () => ({ path: 'ns-core-bundle:nsconfig-json', namespace: 'ns-core-bundle-virtual' }));
286
+ build.onLoad({ filter: /^ns-core-bundle:nsconfig-json$/, namespace: 'ns-core-bundle-virtual' }, () => ({
287
+ contents: `export default ${nsConfigJson};`,
288
+ loader: 'js',
289
+ }));
290
+ },
291
+ };
292
+ const defines = (() => {
293
+ const raw = getGlobalDefines({
294
+ platform: String(platform),
295
+ targetMode: mode === 'development' ? 'development' : 'production',
296
+ verbose: !!verbose,
297
+ flavor: flavor ?? '',
298
+ isCI: !!process.env.CI,
299
+ });
300
+ const out = {};
301
+ for (const [key, value] of Object.entries(raw)) {
302
+ out[key] = typeof value === 'string' ? value : JSON.stringify(value);
303
+ }
304
+ out['process.env.NODE_ENV'] = JSON.stringify(mode === 'development' ? 'development' : 'production');
305
+ return out;
306
+ })();
307
+ const buildResult = await esbuild.build({
308
+ stdin: {
309
+ contents: entryCode,
310
+ resolveDir: projectRoot,
311
+ sourcefile: 'ns-core-bundle-entry.ts',
312
+ loader: 'ts',
313
+ },
314
+ platform: 'neutral',
315
+ format: 'esm',
316
+ bundle: true,
317
+ target: 'es2019',
318
+ // Keep every module body — core relies on registration side effects
319
+ // (CssAnimationProperty.register, global.registerModule, …).
320
+ treeShaking: false,
321
+ sourcemap: false,
322
+ write: false,
323
+ logLevel: 'silent',
324
+ legalComments: 'eof',
325
+ conditions: ['module', 'react-native', 'import', 'browser', 'default'],
326
+ mainFields: ['module', 'browser', 'main'],
327
+ resolveExtensions: coreResolveExtensions(String(platform)),
328
+ loader: {
329
+ '.css': 'text',
330
+ '.json': 'json',
331
+ },
332
+ define: defines,
333
+ plugins: [coreAliasPlugin, cssTreeEnvPlugin, nsConfigPlugin, createNativeClassEsbuildPlugin(platform), createUnicodeRegexEsbuildPlugin(projectRoot)],
334
+ external: NODE_EXTERNALS,
335
+ });
336
+ if (!buildResult.outputFiles?.length) {
337
+ throw new Error('core bundle generation produced no output');
338
+ }
339
+ // The shape installer must run before the registry writes in the entry
340
+ // body so CJS consumers looking up __NS_CORE_MODULES__ always see
341
+ // plain-object-compatible namespaces (Invariant D).
342
+ const code = ['/* /ns/core-bundle.mjs — single-eval @nativescript/core (dev bundle mode) */', buildShapeInstallHeader(), buildResult.outputFiles[0].text].join('\n');
343
+ const hash = createHash('sha1').update(code).digest('hex');
344
+ const state = {
345
+ code,
346
+ subs: new Set(subs),
347
+ hash,
348
+ builtAt: Date.now(),
349
+ buildMs: Date.now() - t0,
350
+ };
351
+ if (verbose) {
352
+ console.log(`[ns-core-bundle] built ${subs.length} subpaths, ${(code.length / 1024).toFixed(0)}kb in ${state.buildMs}ms (hash ${hash.slice(0, 8)})`);
353
+ }
354
+ return state;
355
+ }
356
+ export function createCoreBundleService(options) {
357
+ let state = null;
358
+ let failed = false;
359
+ let building = null;
360
+ const ensureBuilt = async () => {
361
+ if (state)
362
+ return state;
363
+ if (failed)
364
+ return null;
365
+ if (!building) {
366
+ building = generateCoreBundle(options)
367
+ .then((built) => {
368
+ state = built;
369
+ return built;
370
+ })
371
+ .catch((error) => {
372
+ failed = true;
373
+ console.warn(`[ns-core-bundle] bundle build FAILED — falling back to per-module /ns/core serving for this session. Set NS_CORE_PER_MODULE=1 to silence. Error: ${error?.message || error}`);
374
+ return null;
375
+ });
376
+ }
377
+ return building;
378
+ };
379
+ return {
380
+ ensureBuilt,
381
+ getState: () => state,
382
+ hasFailed: () => failed,
383
+ };
384
+ }
385
+ let sharedService = null;
386
+ /**
387
+ * Process-wide bundle service derived from the dev server's config + CLI
388
+ * flags. One dev server per process, so a module-level singleton matches the
389
+ * vendor manifest's lifecycle.
390
+ */
391
+ export function getSharedCoreBundleService(server) {
392
+ if (sharedService)
393
+ return sharedService;
394
+ const cliFlags = (getCliFlags() || {});
395
+ const platform = cliFlags.android ? 'android' : cliFlags.visionos ? 'visionos' : 'ios';
396
+ let flavor = '';
397
+ try {
398
+ flavor = getProjectFlavor();
399
+ }
400
+ catch { }
401
+ sharedService = createCoreBundleService({
402
+ projectRoot: server.config?.root || process.cwd(),
403
+ platform,
404
+ mode: server.config?.mode === 'development' ? 'development' : 'production',
405
+ flavor,
406
+ verbose: resolveVerboseFlag(),
407
+ });
408
+ return sharedService;
409
+ }
410
+ /** Test seam: drop the shared service so specs can mount fresh. */
411
+ export function resetSharedCoreBundleServiceForTests() {
412
+ sharedService = null;
413
+ }
414
+ export const CORE_BUNDLE_PATH = '/ns/core-bundle.mjs';
415
+ /**
416
+ * Shim served at `/ns/core` in bundle mode. `export * from` gives real,
417
+ * live named bindings straight off the bundle module record; the explicit
418
+ * default keeps the "default import + destructure" consumer rewrite working
419
+ * (see buildDefaultExportFooter in ns-core-cjs-shape.ts for that contract).
420
+ */
421
+ export function buildCoreMainShimCode() {
422
+ return [`/* @nativescript/core bridge (bundle mode) — main */`, `import * as __ns_core_bundle_ns__ from ${JSON.stringify(CORE_BUNDLE_PATH)};`, `export * from ${JSON.stringify(CORE_BUNDLE_PATH)};`, `export default __ns_core_bundle_ns__;`, ``].join('\n');
423
+ }
424
+ /**
425
+ * Shim served at `/ns/core/<sub>` in bundle mode. The static bundle import
426
+ * guarantees the registry is populated before the body reads it (ESM deps
427
+ * evaluate first), so the named `export const` bindings snapshot the final
428
+ * class/function values. `exportNames` comes from the same disk-based export
429
+ * discovery the per-module bridge relies on (collectStaticExportNamesFromFile).
430
+ */
431
+ const RESERVED_EXPORT_NAMES = new Set(['default', 'break', 'case', 'catch', 'class', 'const', 'continue', 'debugger', 'delete', 'do', 'else', 'enum', 'export', 'extends', 'false', 'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'new', 'null', 'return', 'super', 'switch', 'this', 'throw', 'true', 'try', 'typeof', 'var', 'void', 'while', 'with', 'let', 'static', 'yield', 'await', 'eval', 'arguments', '__ns_core_sub_ns__']);
432
+ export function buildCoreSubShimCode(sub, exportNames, hasOwnDefaultExport = false) {
433
+ const canonical = normalizeCoreSub(sub);
434
+ const registryKey = `@nativescript/core/${canonical}`;
435
+ const names = Array.from(new Set(exportNames)).filter((n) => /^[A-Za-z_$][\w$]*$/.test(n) && !RESERVED_EXPORT_NAMES.has(n));
436
+ const lines = [];
437
+ lines.push(`/* @nativescript/core bridge (bundle mode) — sub: ${canonical} */`);
438
+ lines.push(`import ${JSON.stringify(CORE_BUNDLE_PATH)};`);
439
+ lines.push(`const __ns_core_sub_ns__ = (globalThis.__NS_CORE_MODULES__ || {})[${JSON.stringify(registryKey)}];`);
440
+ lines.push(`if (!__ns_core_sub_ns__) { throw new Error(${JSON.stringify(`[ns-core] core bundle registry missing '${registryKey}' — restart the dev server or set NS_CORE_PER_MODULE=1`)}); }`);
441
+ for (const name of names) {
442
+ lines.push(`export const ${name} = __ns_core_sub_ns__.${name};`);
443
+ }
444
+ // Deep-subpath contract (see isDeepCoreSubpath / per-module bridge): a sub
445
+ // that declares its own `export default` (e.g. utils/lazy.js's
446
+ // `export default function lazy`) must expose THAT value as the shim's
447
+ // default — consumers like the vendor bundle do
448
+ // `import lazy from '@nativescript/core/utils/lazy'` and call it directly.
449
+ // Subs without an own default keep the self-namespace default so the
450
+ // "default import + destructure" consumer rewrite still works.
451
+ if (hasOwnDefaultExport) {
452
+ lines.push(`export default __ns_core_sub_ns__.default;`);
453
+ }
454
+ else {
455
+ lines.push(`export default __ns_core_sub_ns__;`);
456
+ }
457
+ lines.push('');
458
+ return lines.join('\n');
459
+ }
460
+ //# sourceMappingURL=core-bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-bundle.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/server/core-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAe,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,8BAA8B,EAAE,MAA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EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5H,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,qDAAqD,SAAS,KAAK,CAAC,CAAC;IAChF,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC1D,KAAK,CAAC,IAAI,CAAC,qEAAqE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACjH,KAAK,CAAC,IAAI,CAAC,8CAA8C,IAAI,CAAC,SAAS,CAAC,2CAA2C,WAAW,wDAAwD,CAAC,MAAM,CAAC,CAAC;IAC/L,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,gBAAgB,IAAI,yBAAyB,IAAI,GAAG,CAAC,CAAC;IAClE,CAAC;IACD,2EAA2E;IAC3E,+DAA+D;IAC/D,uEAAuE;IACvE,gDAAgD;IAChD,2EAA2E;IAC3E,qEAAqE;IACrE,+DAA+D;IAC/D,IAAI,mBAAmB,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC1D,CAAC;SAAM,CAAC;QACP,KAAK,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;IAClD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
@@ -85,8 +85,13 @@ export interface FrameworkServerStrategy {
85
85
  rewriteFrameworkImports?(code: string): string;
86
86
  /** Framework-specific post-clean phase (strip HMR helpers, etc.). */
87
87
  postClean?(code: string): string;
88
- /** Ensure framework-specific HTTP endpoints/imports are versioned for cache-busting. */
89
- ensureVersionedImports?(code: string, origin: string, version: number): string;
88
+ /**
89
+ * Collapse framework-specific HTTP endpoint imports to their canonical
90
+ * (unversioned) URLs. Module identity is the URL; freshness is driven by
91
+ * explicit eviction, never URL variation. Versioned inbound shapes from
92
+ * stale cached device code (e.g. `/ns/sfc/<ver>/…`) are stripped here.
93
+ */
94
+ canonicalizeFrameworkImports?(code: string, origin: string): string;
90
95
  /** Optional vendor rewrite hook (e.g. map framework helper imports to vendor). */
91
96
  rewriteVendorSpec?(code: string, origin: string, version: number): string;
92
97
  /**
@@ -154,9 +159,9 @@ export interface FrameworkServerStrategy {
154
159
  */
155
160
  importMapEntries?(origin: string): Record<string, string>;
156
161
  /**
157
- * Extra volatile URL patterns the device runtime must always re-fetch (Vue →
158
- * `/@ns/sfc/`, `/@ns/asm/`; Angular `/@ns/asm/`). Defaults to none.
159
- * Replaces the framework arm of `getVolatilePatterns`.
162
+ * Extra volatile URL patterns the device runtime must always re-fetch.
163
+ * Defaults to none no built-in strategy needs any (freshness is
164
+ * eviction-driven), but the hook stays for custom strategies.
160
165
  */
161
166
  volatilePatterns?(): string[];
162
167
  processFile(ctx: FrameworkProcessFileContext): Promise<void>;