nativescript 9.1.0-alpha.12 → 9.1.0-alpha.13
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.
|
@@ -56,10 +56,15 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
56
56
|
// HMR updates from. No-op unless bundler is vite + hmr + watch.
|
|
57
57
|
// Fired in parallel with the build watcher; both child processes
|
|
58
58
|
// inherit the adb-reverse env the run-controller set before
|
|
59
|
-
// prepare, so neither one spawns adb on its own.
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
59
|
+
// prepare, so neither one spawns adb on its own. Not awaited HERE
|
|
60
|
+
// — but the first-build resolution below gates on it, because the
|
|
61
|
+
// app is (re)started as soon as `compileWithWatch` resolves and its
|
|
62
|
+
// very first HTTP module fetch dies on connection-refused if the
|
|
63
|
+
// server hasn't bound yet (a cold `vite serve` config load + vendor
|
|
64
|
+
// prebuild competes with this build watcher for CPU and can take
|
|
65
|
+
// 10-30s). Running both in parallel keeps the happy-path wall time
|
|
66
|
+
// at max(first build, server bind) instead of their sum.
|
|
67
|
+
const viteDevServerStartup = this.startViteDevServer(platformData, projectData, prepareData);
|
|
63
68
|
try {
|
|
64
69
|
const childProcess = await this.startBundleProcess(platformData, projectData, prepareData);
|
|
65
70
|
// Handle Vite differently from webpack
|
|
@@ -105,13 +110,18 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
105
110
|
}
|
|
106
111
|
this.copyViteBundleToNative(distOutput, destDir);
|
|
107
112
|
}
|
|
108
|
-
// Resolve the promise on first build completion
|
|
113
|
+
// Resolve the promise on first build completion — gated on
|
|
114
|
+
// the HMR dev server being reachable (no-op resolve for
|
|
115
|
+
// non-HMR runs). `startViteDevServer` never rejects and its
|
|
116
|
+
// readiness probe is bounded, so this cannot hang the run;
|
|
117
|
+
// on probe timeout we proceed and the device's own retry
|
|
118
|
+
// handles any residual gap.
|
|
109
119
|
if (isFirstBundlerWatchCompilation) {
|
|
110
120
|
isFirstBundlerWatchCompilation = false;
|
|
111
121
|
if (debugLog) {
|
|
112
122
|
console.log("Vite first build completed, resolving compileWithWatch");
|
|
113
123
|
}
|
|
114
|
-
resolve(childProcess);
|
|
124
|
+
viteDevServerStartup.then(() => resolve(childProcess));
|
|
115
125
|
return;
|
|
116
126
|
}
|
|
117
127
|
// Transform Vite message to match webpack format
|
|
@@ -454,7 +464,11 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
454
464
|
this.$logger.info(`Vite dev server ready on port ${port} (HMR for ${key}).`);
|
|
455
465
|
}
|
|
456
466
|
else {
|
|
457
|
-
|
|
467
|
+
// Warn (not trace): the first-build resolution in
|
|
468
|
+
// `compileWithWatch` gates on this method, so a probe timeout
|
|
469
|
+
// means the app will be deployed against a server that may not
|
|
470
|
+
// be up yet — the user should see why a boot might stall.
|
|
471
|
+
this.$logger.warn(`Vite dev server port ${port} not observed open within the readiness probe window; continuing (it may bind shortly).`);
|
|
458
472
|
}
|
|
459
473
|
}
|
|
460
474
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nativescript",
|
|
3
3
|
"main": "./lib/nativescript-cli-lib.js",
|
|
4
|
-
"version": "9.1.0-alpha.
|
|
4
|
+
"version": "9.1.0-alpha.13",
|
|
5
5
|
"author": "NativeScript <oss@nativescript.org>",
|
|
6
6
|
"description": "Command-line interface for building NativeScript projects",
|
|
7
7
|
"bin": {
|