@nativescript/vite 8.0.0-alpha.35 → 8.0.0-alpha.37
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.
- package/helpers/logging.js +2 -1
- package/helpers/logging.js.map +1 -1
- package/hmr/client/css-handler.js +4 -3
- package/hmr/client/css-handler.js.map +1 -1
- package/hmr/client/hmr-pending-overlay.d.ts +0 -14
- package/hmr/client/hmr-pending-overlay.js +2 -1
- package/hmr/client/hmr-pending-overlay.js.map +1 -1
- package/hmr/client/index.js +26 -25
- package/hmr/client/index.js.map +1 -1
- package/hmr/client/utils.js +7 -3
- package/hmr/client/utils.js.map +1 -1
- package/hmr/entry-runtime.js +5 -5
- package/hmr/entry-runtime.js.map +1 -1
- package/hmr/frameworks/angular/client/index.js +4 -3
- package/hmr/frameworks/angular/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/index.js +11 -10
- package/hmr/frameworks/vue/client/index.js.map +1 -1
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.d.ts +0 -33
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js +2 -1
- package/hmr/frameworks/vue/client/vue-sfc-update-overlay.js.map +1 -1
- package/hmr/helpers/ast-normalizer.js +2 -1
- package/hmr/helpers/ast-normalizer.js.map +1 -1
- package/hmr/server/websocket-core-bridge.d.ts +4 -0
- package/hmr/server/websocket-core-bridge.js +9 -2
- package/hmr/server/websocket-core-bridge.js.map +1 -1
- package/hmr/server/websocket-ns-m.js +1 -1
- package/hmr/server/websocket-ns-m.js.map +1 -1
- package/hmr/server/websocket-served-module-helpers.d.ts +1 -1
- package/hmr/server/websocket-served-module-helpers.js +149 -26
- package/hmr/server/websocket-served-module-helpers.js.map +1 -1
- package/hmr/server/websocket.js +2 -1
- package/hmr/server/websocket.js.map +1 -1
- package/hmr/shared/runtime/boot-progress.js +3 -2
- package/hmr/shared/runtime/boot-progress.js.map +1 -1
- package/hmr/shared/runtime/boot-timeline.js +2 -12
- package/hmr/shared/runtime/boot-timeline.js.map +1 -1
- package/hmr/shared/runtime/dev-overlay.js +2 -1
- package/hmr/shared/runtime/dev-overlay.js.map +1 -1
- package/hmr/shared/runtime/global-scope.d.ts +18 -0
- package/hmr/shared/runtime/global-scope.js +21 -0
- package/hmr/shared/runtime/global-scope.js.map +1 -0
- package/hmr/shared/runtime/hooks.js +2 -1
- package/hmr/shared/runtime/hooks.js.map +1 -1
- package/hmr/shared/runtime/http-only-boot.js +7 -6
- package/hmr/shared/runtime/http-only-boot.js.map +1 -1
- package/hmr/shared/runtime/module-provenance.js +3 -2
- package/hmr/shared/runtime/module-provenance.js.map +1 -1
- package/hmr/shared/runtime/root-placeholder-view.js +2 -1
- package/hmr/shared/runtime/root-placeholder-view.js.map +1 -1
- package/hmr/shared/runtime/root-placeholder.js +5 -4
- package/hmr/shared/runtime/root-placeholder.js.map +1 -1
- package/hmr/shared/runtime/session-bootstrap.js +10 -9
- package/hmr/shared/runtime/session-bootstrap.js.map +1 -1
- package/hmr/shared/runtime/vendor-bootstrap.js +2 -1
- package/hmr/shared/runtime/vendor-bootstrap.js.map +1 -1
- package/hmr/shared/vendor/manifest-loader.js +2 -1
- package/hmr/shared/vendor/manifest-loader.js.map +1 -1
- package/hmr/vendor-bootstrap.d.ts +1 -3
- package/hmr/vendor-bootstrap.js +4 -6
- package/hmr/vendor-bootstrap.js.map +1 -1
- package/package.json +1 -1
- package/runtime/core-aliases-early.js +2 -3
- package/runtime/core-aliases-early.js.map +1 -1
package/helpers/logging.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createLogger } from 'vite';
|
|
2
|
+
import { getGlobalScope } from '../hmr/shared/runtime/global-scope.js';
|
|
2
3
|
const GLOBAL_VERBOSE_FLAG = '__NS_ENV_VERBOSE__';
|
|
3
4
|
const ENV_VERBOSE_KEYS = ['NS_VITE_VERBOSE', 'NS_ENV_VERBOSE', 'NS_VERBOSE', 'VERBOSE', 'VITE_DEBUG_LOGS', 'DEBUG'];
|
|
4
5
|
let cachedVerbose;
|
|
@@ -37,7 +38,7 @@ export function resolveVerboseFlag(options = {}) {
|
|
|
37
38
|
}
|
|
38
39
|
if (resolved === undefined && options.useGlobalFlag !== false) {
|
|
39
40
|
try {
|
|
40
|
-
const globalVerbose =
|
|
41
|
+
const globalVerbose = getGlobalScope()?.[GLOBAL_VERBOSE_FLAG];
|
|
41
42
|
const coerced = coerceBoolean(globalVerbose);
|
|
42
43
|
if (typeof coerced === 'boolean') {
|
|
43
44
|
resolved = coerced;
|
package/helpers/logging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../packages/vite/helpers/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,MAAM,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,MAAM,mBAAmB,GAAG,oBAAoB,CAAC;AACjD,MAAM,gBAAgB,GAAG,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAYpH,IAAI,aAAkC,CAAC;AAEvC,SAAS,aAAa,CAAC,KAAgB;IACtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,KAAK,CAAC,CAAC;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,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CAAC;AACd,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { getCore } from './utils.js';
|
|
2
|
-
|
|
2
|
+
import { getGlobalScope } from '../shared/runtime/global-scope.js';
|
|
3
|
+
const VERBOSE = !!getGlobalScope().__NS_ENV_VERBOSE__;
|
|
3
4
|
// Must match the tag used by the boot virtual `app.css` emitter in
|
|
4
5
|
// `helpers/main-entry.ts` and `entry-runtime.ts::APP_CSS_TAG` so HMR's
|
|
5
6
|
// remove/add pair replaces the boot-time selectors instead of stacking.
|
|
6
7
|
export const APP_CSS_TAG = 'app.css';
|
|
7
8
|
function getPreferredCssApplier() {
|
|
8
9
|
try {
|
|
9
|
-
const applier =
|
|
10
|
+
const applier = getGlobalScope().__NS_HMR_APPLY_CSS__;
|
|
10
11
|
if (typeof applier === 'function') {
|
|
11
12
|
return applier;
|
|
12
13
|
}
|
|
@@ -85,7 +86,7 @@ export function applyCssText(cssText, tag = APP_CSS_TAG) {
|
|
|
85
86
|
// Fetch helper
|
|
86
87
|
export async function fetchText(url) {
|
|
87
88
|
try {
|
|
88
|
-
const g =
|
|
89
|
+
const g = getGlobalScope();
|
|
89
90
|
if (typeof g.fetch === 'function') {
|
|
90
91
|
const res = await g.fetch(url);
|
|
91
92
|
return await res.text();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-handler.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/css-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"css-handler.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/css-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,OAAO,GAAG,CAAC,CAAC,cAAc,EAAE,CAAC,kBAAkB,CAAC;AAEtD,mEAAmE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@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Client-side helper for `ns:hmr-pending`.
|
|
3
|
-
*
|
|
4
|
-
* Server emits `ns:hmr-pending` immediately when `handleHotUpdate`
|
|
5
|
-
* fires, BEFORE doing any graph upserts / transforms / dependency
|
|
6
|
-
* analysis. The client uses that hint to drive the HMR-applying
|
|
7
|
-
* overlay's 'received' frame so the user sees an instant reaction
|
|
8
|
-
* to their save instead of waiting ~7–200ms for the framework
|
|
9
|
-
* payload (`ns:angular-update` / `ns:css-updates`) to arrive.
|
|
10
|
-
*
|
|
11
|
-
* This module is intentionally a tiny pure helper so the gating
|
|
12
|
-
* (`__NS_HMR_PROGRESS_OVERLAY_ENABLED__`) and detail-string formatting
|
|
13
|
-
* can be unit-tested without booting the full HMR client.
|
|
14
|
-
*/
|
|
15
1
|
export type HmrOverlayApiLike = {
|
|
16
2
|
setUpdateStage?: (stage: string, info?: {
|
|
17
3
|
detail?: string;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* (`__NS_HMR_PROGRESS_OVERLAY_ENABLED__`) and detail-string formatting
|
|
13
13
|
* can be unit-tested without booting the full HMR client.
|
|
14
14
|
*/
|
|
15
|
+
import { getGlobalScope } from '../shared/runtime/global-scope.js';
|
|
15
16
|
export function buildHmrPendingDetail(filePath) {
|
|
16
17
|
if (!filePath || filePath === '<unknown>')
|
|
17
18
|
return 'Preparing update';
|
|
@@ -30,7 +31,7 @@ export function applyHmrPendingFrame(filePath, deps) {
|
|
|
30
31
|
}
|
|
31
32
|
catch { }
|
|
32
33
|
try {
|
|
33
|
-
const seeded =
|
|
34
|
+
const seeded = getGlobalScope().__NS_HMR_PROGRESS_OVERLAY_ENABLED__;
|
|
34
35
|
if (typeof seeded === 'boolean')
|
|
35
36
|
return seeded;
|
|
36
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmr-pending-overlay.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/hmr-pending-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"hmr-pending-overlay.js","sourceRoot":"","sources":["../../../../../packages/vite/hmr/client/hmr-pending-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAkBnE,MAAM,UAAU,qBAAqB,CAAC,QAA4B;IACjE,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,WAAW;QAAE,OAAO,kBAAkB,CAAC;IACrE,OAAO,YAAY,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAA4B,EAAE,IAA2B;IAC7F,MAAM,OAAO,GACZ,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS;QACvC,CAAC,CAAC,IAAI,CAAC,cAAc;QACrB,CAAC,CAAC,CAAC,GAAG,EAAE;YACN,iEAAiE;YACjE,kEAAkE;YAClE,uCAAuC;YACvC,IAAI,CAAC;gBACJ,IAAI,OAAO,mCAAmC,KAAK,SAAS;oBAAE,OAAO,mCAAmC,CAAC;YAC1G,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;YACV,IAAI,CAAC;gBACJ,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC,mCAAmC,CAAC;gBACpE,IAAI,OAAO,MAAM,KAAK,SAAS;oBAAE,OAAO,MAAM,CAAC;YAChD,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;YACV,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,EAAE,CAAC;IACR,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,IAAI,GAAsB,CAAC;IAC3B,IAAI,CAAC;QACJ,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,CAAC,cAAc,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IACnE,IAAI,CAAC;QACJ,GAAG,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC"}
|
package/hmr/client/index.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { setHMRWsUrl, getHMRWsUrl, pendingModuleFetches, deriveHttpOrigin, setHttpOriginForVite, moduleFetchCache, requestModuleFromServer, getHttpOriginForVite, normalizeSpec, hmrMetrics, graph, setGraphVersion, getGraphVersion, getCurrentApp, getRootFrame, setCurrentApp, setRootFrame, getCore, hasExplicitEviction, invalidateModulesByUrls, buildEvictionUrls, emitHmrModeBannerOnce } from './utils.js';
|
|
9
9
|
import { handleCssUpdates } from './css-handler.js';
|
|
10
10
|
import { buildCssApplyingDetail, buildCssAppliedDetail } from './css-update-overlay.js';
|
|
11
|
+
import { getGlobalScope } from '../shared/runtime/global-scope.js';
|
|
11
12
|
const VERBOSE = typeof __NS_ENV_VERBOSE__ !== 'undefined' && __NS_ENV_VERBOSE__;
|
|
12
13
|
function resolveTargetFlavor() {
|
|
13
14
|
try {
|
|
@@ -17,7 +18,7 @@ function resolveTargetFlavor() {
|
|
|
17
18
|
}
|
|
18
19
|
catch { }
|
|
19
20
|
try {
|
|
20
|
-
const g =
|
|
21
|
+
const g = getGlobalScope();
|
|
21
22
|
if (typeof g.__NS_TARGET_FLAVOR__ === 'string' && g.__NS_TARGET_FLAVOR__) {
|
|
22
23
|
return g.__NS_TARGET_FLAVOR__;
|
|
23
24
|
}
|
|
@@ -45,7 +46,7 @@ catch { }
|
|
|
45
46
|
// so prefer the globalThis seed planted by the entry's defines-seed module —
|
|
46
47
|
// the '/src' literal is a last-resort default and is WRONG for 'app/'-rooted
|
|
47
48
|
// projects.
|
|
48
|
-
const APP_ROOT_VIRTUAL = (typeof __NS_APP_ROOT_VIRTUAL__ === 'string' && __NS_APP_ROOT_VIRTUAL__) || (typeof
|
|
49
|
+
const APP_ROOT_VIRTUAL = (typeof __NS_APP_ROOT_VIRTUAL__ === 'string' && __NS_APP_ROOT_VIRTUAL__) || (typeof getGlobalScope().__NS_APP_ROOT_VIRTUAL__ === 'string' && getGlobalScope().__NS_APP_ROOT_VIRTUAL__) || '/src';
|
|
49
50
|
const APP_VIRTUAL_WITH_SLASH = APP_ROOT_VIRTUAL.endsWith('/') ? APP_ROOT_VIRTUAL : `${APP_ROOT_VIRTUAL}/`;
|
|
50
51
|
const APP_MAIN_ENTRY_SPEC = `${APP_VIRTUAL_WITH_SLASH}app.ts`;
|
|
51
52
|
// Policy: by default, let the app's own main entry mount initially; HMR client handles updates/remounts only.
|
|
@@ -122,7 +123,7 @@ function setUpdateOverlayStage(stage, info) {
|
|
|
122
123
|
// A module-local Set would not be shared across instances; the global one
|
|
123
124
|
// is.
|
|
124
125
|
function getNsSolidHmrListenerSet() {
|
|
125
|
-
const g =
|
|
126
|
+
const g = getGlobalScope();
|
|
126
127
|
let set = g.__ns_solid_hmr_listener_set;
|
|
127
128
|
if (!set) {
|
|
128
129
|
set = new Set();
|
|
@@ -152,7 +153,7 @@ function nsSolidHmrEmit(ev) {
|
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
try {
|
|
155
|
-
const g =
|
|
156
|
+
const g = getGlobalScope();
|
|
156
157
|
g.__ns_solid_hmr_subscribe = nsSolidHmrSubscribe;
|
|
157
158
|
// Eagerly create the listener set so the global exists at module load time.
|
|
158
159
|
getNsSolidHmrListenerSet();
|
|
@@ -250,7 +251,7 @@ let processingPromise = null;
|
|
|
250
251
|
// Detect whether the early placeholder root is still active on screen
|
|
251
252
|
function isPlaceholderActive() {
|
|
252
253
|
try {
|
|
253
|
-
const g =
|
|
254
|
+
const g = getGlobalScope();
|
|
254
255
|
if (g.__NS_DEV_PLACEHOLDER_ROOT_VIEW__)
|
|
255
256
|
return true;
|
|
256
257
|
if (g.__NS_DEV_PLACEHOLDER_ROOT_EARLY__)
|
|
@@ -280,7 +281,7 @@ function applyFullGraph(payload) {
|
|
|
280
281
|
// causes a double-mount race (rescue fires at 450ms, then main.ts fires ~1s later,
|
|
281
282
|
// causing a visual flash and leaving the app in an inconsistent state).
|
|
282
283
|
try {
|
|
283
|
-
const g =
|
|
284
|
+
const g = getGlobalScope();
|
|
284
285
|
const bootDone = !!g.__NS_HMR_BOOT_COMPLETE__;
|
|
285
286
|
if (!bootDone && !initialMounted && !initialMounting && !g.__NS_HMR_RESCUE_SCHEDULED__ && TARGET_FLAVOR !== 'typescript') {
|
|
286
287
|
// simple snapshot helpers
|
|
@@ -466,7 +467,7 @@ function applyFullGraph(payload) {
|
|
|
466
467
|
console.log('[hmr][init] mounting initial root from', candidate, 'flavor=', TARGET_FLAVOR);
|
|
467
468
|
// Android-only: avoid racing entry-runtime reset and Activity bring-up
|
|
468
469
|
try {
|
|
469
|
-
const g =
|
|
470
|
+
const g = getGlobalScope();
|
|
470
471
|
const App = getCore('Application') || g.Application;
|
|
471
472
|
const isAndroid = !!(App && App.android !== undefined);
|
|
472
473
|
if (isAndroid) {
|
|
@@ -637,7 +638,7 @@ function applyDelta(payload) {
|
|
|
637
638
|
}
|
|
638
639
|
if (isAppMainEntryId(id)) {
|
|
639
640
|
try {
|
|
640
|
-
const exists =
|
|
641
|
+
const exists = getGlobalScope().require?.(id) || globalThis.__nsGetModuleExports?.(id);
|
|
641
642
|
if (!exists && VERBOSE)
|
|
642
643
|
console.log(`[hmr][delta] skipping unresolved ${APP_MAIN_ENTRY_SPEC} change`);
|
|
643
644
|
if (!exists)
|
|
@@ -655,7 +656,7 @@ function applyDelta(payload) {
|
|
|
655
656
|
}
|
|
656
657
|
// Deterministic navigation using the current Vue app instance rather than vendor-held rootApp.
|
|
657
658
|
function __nsNavigateUsingApp(comp, opts = {}) {
|
|
658
|
-
const g =
|
|
659
|
+
const g = getGlobalScope();
|
|
659
660
|
CLIENT_STRATEGY?.beforeNavigateBuild?.();
|
|
660
661
|
const AppFactory = g.createApp;
|
|
661
662
|
const RootCtor = g.NSVRoot;
|
|
@@ -813,7 +814,7 @@ function ensureModalTracking() {
|
|
|
813
814
|
if (modalTrackingInstalled)
|
|
814
815
|
return;
|
|
815
816
|
try {
|
|
816
|
-
const View = getCore('View') ||
|
|
817
|
+
const View = getCore('View') || getGlobalScope().View;
|
|
817
818
|
const proto = View?.prototype;
|
|
818
819
|
if (!proto || typeof proto.showModal !== 'function')
|
|
819
820
|
return;
|
|
@@ -1046,7 +1047,7 @@ async function processQueue() {
|
|
|
1046
1047
|
// XML re-renders pick up new markup but keep old behavior.
|
|
1047
1048
|
if (TARGET_FLAVOR === 'typescript' && mod && /\.(ts|js)$/i.test(id)) {
|
|
1048
1049
|
try {
|
|
1049
|
-
const g =
|
|
1050
|
+
const g = getGlobalScope();
|
|
1050
1051
|
const moduleName = toAppModuleName(id);
|
|
1051
1052
|
if (moduleName && typeof g.registerModule === 'function') {
|
|
1052
1053
|
g.registerModule(moduleName, () => mod);
|
|
@@ -1179,7 +1180,7 @@ async function processQueue() {
|
|
|
1179
1180
|
const findRouter = () => {
|
|
1180
1181
|
if (discoveredRouter)
|
|
1181
1182
|
return discoveredRouter;
|
|
1182
|
-
const g =
|
|
1183
|
+
const g = getGlobalScope();
|
|
1183
1184
|
if (g.__ns_router?.routesById)
|
|
1184
1185
|
return (discoveredRouter = g.__ns_router);
|
|
1185
1186
|
// Fallback: scan common global keys for router
|
|
@@ -1340,7 +1341,7 @@ async function processQueue() {
|
|
|
1340
1341
|
// This preserves the shell (Frame, ActionBar, etc.) that the app's
|
|
1341
1342
|
// own bootstrapping wires up via `Application.run`.
|
|
1342
1343
|
try {
|
|
1343
|
-
const g =
|
|
1344
|
+
const g = getGlobalScope();
|
|
1344
1345
|
const App = getCore('Application') || g.Application;
|
|
1345
1346
|
if (!App || typeof App.resetRootView !== 'function') {
|
|
1346
1347
|
if (VERBOSE)
|
|
@@ -1546,7 +1547,7 @@ function connectHmr() {
|
|
|
1546
1547
|
// Build ordered host candidates with preference to the active HTTP origin
|
|
1547
1548
|
const orderedHosts = [];
|
|
1548
1549
|
try {
|
|
1549
|
-
const g =
|
|
1550
|
+
const g = getGlobalScope();
|
|
1550
1551
|
const httpOrigin = g && typeof g.__NS_HTTP_ORIGIN__ === 'string' ? g.__NS_HTTP_ORIGIN__ : undefined;
|
|
1551
1552
|
if (httpOrigin) {
|
|
1552
1553
|
try {
|
|
@@ -1726,7 +1727,7 @@ async function handleHmrMessage(ev) {
|
|
|
1726
1727
|
if (msg.type === 'ns:hmr-full-graph') {
|
|
1727
1728
|
// Bump a monotonic nonce so HTTP ESM imports can always be cache-busted per update.
|
|
1728
1729
|
try {
|
|
1729
|
-
const g =
|
|
1730
|
+
const g = getGlobalScope();
|
|
1730
1731
|
g.__NS_HMR_IMPORT_NONCE__ = (typeof g.__NS_HMR_IMPORT_NONCE__ === 'number' ? g.__NS_HMR_IMPORT_NONCE__ : 0) + 1;
|
|
1731
1732
|
}
|
|
1732
1733
|
catch { }
|
|
@@ -1851,7 +1852,7 @@ async function handleHmrMessage(ev) {
|
|
|
1851
1852
|
if (msg.type === 'ns:hmr-delta') {
|
|
1852
1853
|
// Bump a monotonic nonce so HTTP ESM imports can always be cache-busted per update.
|
|
1853
1854
|
try {
|
|
1854
|
-
const g =
|
|
1855
|
+
const g = getGlobalScope();
|
|
1855
1856
|
g.__NS_HMR_IMPORT_NONCE__ = (typeof g.__NS_HMR_IMPORT_NONCE__ === 'number' ? g.__NS_HMR_IMPORT_NONCE__ : 0) + 1;
|
|
1856
1857
|
}
|
|
1857
1858
|
catch { }
|
|
@@ -2069,8 +2070,8 @@ function normalizeComponent(input, nameHint) {
|
|
|
2069
2070
|
// If provided a render function, wrap with defineComponent
|
|
2070
2071
|
if (typeof input === 'function') {
|
|
2071
2072
|
CLIENT_STRATEGY?.beforeNavigateBuild?.();
|
|
2072
|
-
const comp =
|
|
2073
|
-
?
|
|
2073
|
+
const comp = getGlobalScope().defineComponent
|
|
2074
|
+
? getGlobalScope().defineComponent({
|
|
2074
2075
|
name: nameHint || input.name || 'AnonymousSFC',
|
|
2075
2076
|
render: input,
|
|
2076
2077
|
})
|
|
@@ -2080,8 +2081,8 @@ function normalizeComponent(input, nameHint) {
|
|
|
2080
2081
|
// If object has a render function property
|
|
2081
2082
|
if (input?.render && typeof input.render === 'function') {
|
|
2082
2083
|
CLIENT_STRATEGY?.beforeNavigateBuild?.();
|
|
2083
|
-
const comp =
|
|
2084
|
-
?
|
|
2084
|
+
const comp = getGlobalScope().defineComponent
|
|
2085
|
+
? getGlobalScope().defineComponent({
|
|
2085
2086
|
name: nameHint || input.name || 'AnonymousSFC',
|
|
2086
2087
|
render: input.render,
|
|
2087
2088
|
})
|
|
@@ -2180,7 +2181,7 @@ async function performResetRoot(newComponent) {
|
|
|
2180
2181
|
return factory;
|
|
2181
2182
|
}
|
|
2182
2183
|
// Android readiness before any root changes
|
|
2183
|
-
const App = getCore('Application') ||
|
|
2184
|
+
const App = getCore('Application') || getGlobalScope().Application;
|
|
2184
2185
|
const isAndroid = !!(App && App.android !== undefined);
|
|
2185
2186
|
if (isAndroid) {
|
|
2186
2187
|
const isReady = () => {
|
|
@@ -2282,7 +2283,7 @@ async function performResetRoot(newComponent) {
|
|
|
2282
2283
|
}
|
|
2283
2284
|
catch { }
|
|
2284
2285
|
try {
|
|
2285
|
-
const AppAny = getCore('Application') ||
|
|
2286
|
+
const AppAny = getCore('Application') || getGlobalScope().Application;
|
|
2286
2287
|
isIOS = !!(AppAny && AppAny.ios !== undefined);
|
|
2287
2288
|
}
|
|
2288
2289
|
catch { }
|
|
@@ -2292,7 +2293,7 @@ async function performResetRoot(newComponent) {
|
|
|
2292
2293
|
// - Otherwise (subsequent HMR updates with an authoritative Frame already in place), re-use the
|
|
2293
2294
|
// current app Frame and navigate to the new Page. This avoids a brief flash that can occur
|
|
2294
2295
|
// when swapping the entire root view on Android. The placeholder is never involved here.
|
|
2295
|
-
const gAnyForPolicy =
|
|
2296
|
+
const gAnyForPolicy = getGlobalScope();
|
|
2296
2297
|
const placeholderFrame = (() => {
|
|
2297
2298
|
try {
|
|
2298
2299
|
return gAnyForPolicy.__NS_DEV_PLACEHOLDER_ROOT_VIEW__ || null;
|
|
@@ -2333,7 +2334,7 @@ async function performResetRoot(newComponent) {
|
|
|
2333
2334
|
console.log('[hmr-client] full root replacement via resetRootView (placeholder will be discarded)', { isFrameRoot, isIOS, hadPlaceholder });
|
|
2334
2335
|
// Fallback or preferred path: resetRootView with a creator that builds a fresh Frame and navigates to the new Page
|
|
2335
2336
|
try {
|
|
2336
|
-
const App2 = getCore('Application') ||
|
|
2337
|
+
const App2 = getCore('Application') || getGlobalScope().Application;
|
|
2337
2338
|
if (!App2 || typeof App2.resetRootView !== 'function') {
|
|
2338
2339
|
console.warn('[hmr-client] Application.resetRootView unavailable');
|
|
2339
2340
|
return false;
|
|
@@ -2352,7 +2353,7 @@ async function performResetRoot(newComponent) {
|
|
|
2352
2353
|
if (VERBOSE)
|
|
2353
2354
|
console.warn('[hmr-client] iOS Application.window is boolean false; attempting to clear cached window');
|
|
2354
2355
|
try {
|
|
2355
|
-
const g =
|
|
2356
|
+
const g = getGlobalScope();
|
|
2356
2357
|
const reg = g.__nsVendorRegistry;
|
|
2357
2358
|
const req = reg?.get ? g.__nsVendorRequire || g.__nsRequire || g.require : g.__nsRequire || g.require;
|
|
2358
2359
|
let helpers = null;
|