@absolutejs/absolute 0.19.0-beta.84 → 0.19.0-beta.86
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/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/dist/build.js +38 -11
- package/dist/build.js.map +3 -3
- package/dist/dev/client/handlers/rebuild.ts +11 -0
- package/dist/index.js +38 -11
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
|
@@ -102,6 +102,7 @@ export const handleModuleUpdate = (message: {
|
|
|
102
102
|
export const handleRebuildComplete = (message: {
|
|
103
103
|
data: {
|
|
104
104
|
affectedFrameworks?: string[];
|
|
105
|
+
fullReload?: boolean;
|
|
105
106
|
manifest?: Record<string, string>;
|
|
106
107
|
};
|
|
107
108
|
}) => {
|
|
@@ -112,6 +113,16 @@ export const handleRebuildComplete = (message: {
|
|
|
112
113
|
window.__HMR_MANIFEST__ = message.data.manifest;
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
// Subprocess builds need a full page reload to pick up fresh
|
|
117
|
+
// bundled JS (the in-process Bun.build cache was stale).
|
|
118
|
+
if (message.data.fullReload) {
|
|
119
|
+
setTimeout(() => {
|
|
120
|
+
window.location.reload();
|
|
121
|
+
}, REBUILD_RELOAD_DELAY_MS);
|
|
122
|
+
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
115
126
|
if (
|
|
116
127
|
message.data.affectedFrameworks &&
|
|
117
128
|
!message.data.affectedFrameworks.includes('angular') &&
|
package/dist/index.js
CHANGED
|
@@ -204212,8 +204212,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204212
204212
|
files.filter((f) => detectFramework(f, state.resolvedPaths) === "angular").forEach((f) => handled.add(f));
|
|
204213
204213
|
}
|
|
204214
204214
|
if (config.reactDirectory && affectedFrameworks.includes("react")) {
|
|
204215
|
-
|
|
204216
|
-
|
|
204215
|
+
const reactComponentFiles = files.filter((f) => detectFramework(f, state.resolvedPaths) === "react" && (f.endsWith(".tsx") || f.endsWith(".jsx")));
|
|
204216
|
+
if (reactComponentFiles.length > 0) {
|
|
204217
|
+
await handleReactFastPath(state, config, files, startTime, onRebuildComplete);
|
|
204218
|
+
}
|
|
204219
|
+
reactComponentFiles.forEach((f) => handled.add(f));
|
|
204217
204220
|
}
|
|
204218
204221
|
if (config.svelteDirectory && affectedFrameworks.includes("svelte")) {
|
|
204219
204222
|
await handleSvelteFastPath(state, config, files, startTime, onRebuildComplete);
|
|
@@ -204329,6 +204332,18 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204329
204332
|
return state.manifest;
|
|
204330
204333
|
}
|
|
204331
204334
|
const hasNonComponentFiles = (filesToRebuild ?? []).some((f) => f.endsWith(".ts") && !f.endsWith(".d.ts"));
|
|
204335
|
+
const subprocessConfig = hasNonComponentFiles ? {
|
|
204336
|
+
buildDirectory: config.buildDirectory,
|
|
204337
|
+
assetsDirectory: config.assetsDirectory,
|
|
204338
|
+
reactDirectory: config.reactDirectory,
|
|
204339
|
+
stylesConfig: config.stylesConfig,
|
|
204340
|
+
options: {
|
|
204341
|
+
...config.options,
|
|
204342
|
+
baseManifest: state.manifest,
|
|
204343
|
+
injectHMR: true,
|
|
204344
|
+
throwOnError: true
|
|
204345
|
+
}
|
|
204346
|
+
} : undefined;
|
|
204332
204347
|
const buildConfig = {
|
|
204333
204348
|
...config,
|
|
204334
204349
|
incrementalFiles: filesToRebuild && filesToRebuild.length > 0 ? filesToRebuild : undefined,
|
|
@@ -204340,12 +204355,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204340
204355
|
}
|
|
204341
204356
|
};
|
|
204342
204357
|
let manifest;
|
|
204343
|
-
if (hasNonComponentFiles) {
|
|
204344
|
-
const
|
|
204345
|
-
const
|
|
204358
|
+
if (hasNonComponentFiles && subprocessConfig) {
|
|
204359
|
+
const absDir = resolve21(process.cwd(), ".absolutejs");
|
|
204360
|
+
const tmpConfig = resolve21(absDir, "build-config.json");
|
|
204361
|
+
const tmpScript = resolve21(absDir, "fresh-build.ts");
|
|
204346
204362
|
const { mkdirSync: mkdirSync9, writeFileSync: writeFileSync5 } = await import("fs");
|
|
204347
|
-
mkdirSync9(
|
|
204348
|
-
writeFileSync5(tmpConfig, JSON.stringify(
|
|
204363
|
+
mkdirSync9(absDir, { recursive: true });
|
|
204364
|
+
writeFileSync5(tmpConfig, JSON.stringify(subprocessConfig));
|
|
204349
204365
|
const escapedConfig = tmpConfig.replace(/\\/g, "\\\\");
|
|
204350
204366
|
writeFileSync5(tmpScript, [
|
|
204351
204367
|
'import { build } from "@absolutejs/absolute/build";',
|
|
@@ -204363,13 +204379,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204363
204379
|
const stderr = await new Response(proc.stderr).text();
|
|
204364
204380
|
await proc.exited;
|
|
204365
204381
|
if (proc.exitCode !== 0) {
|
|
204366
|
-
logWarn(`Fresh build
|
|
204382
|
+
logWarn(`Fresh build failed: ${stderr.slice(0, 300)}`);
|
|
204367
204383
|
manifest = await build2(buildConfig);
|
|
204368
204384
|
} else {
|
|
204369
204385
|
const manifestLine = stdout.split(`
|
|
204370
204386
|
`).find((l) => l.startsWith("__MANIFEST__"));
|
|
204371
204387
|
if (manifestLine) {
|
|
204372
|
-
|
|
204388
|
+
const freshManifest = JSON.parse(manifestLine.slice("__MANIFEST__".length));
|
|
204389
|
+
manifest = { ...state.manifest, ...freshManifest };
|
|
204373
204390
|
} else {
|
|
204374
204391
|
manifest = await build2(buildConfig);
|
|
204375
204392
|
}
|
|
@@ -204381,6 +204398,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204381
204398
|
throw new Error("Build failed - no manifest generated");
|
|
204382
204399
|
}
|
|
204383
204400
|
const duration = Date.now() - startTime;
|
|
204401
|
+
const wasSubprocess = hasNonComponentFiles && subprocessConfig;
|
|
204402
|
+
if (wasSubprocess) {
|
|
204403
|
+
const dataFile = (filesToRebuild ?? []).find((f) => f.endsWith(".ts") && !f.endsWith(".d.ts"));
|
|
204404
|
+
if (dataFile) {
|
|
204405
|
+
state.lastHmrPath = relative9(process.cwd(), dataFile).replace(/\\/g, "/");
|
|
204406
|
+
state.lastHmrFramework = "react";
|
|
204407
|
+
logHmrUpdate(state.lastHmrPath, "react", duration);
|
|
204408
|
+
}
|
|
204409
|
+
}
|
|
204384
204410
|
sendTelemetryEvent("hmr:rebuild-complete", {
|
|
204385
204411
|
durationMs: duration,
|
|
204386
204412
|
fileCount: filesToRebuild?.length ?? 0,
|
|
@@ -204391,12 +204417,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
204391
204417
|
broadcastToClients(state, {
|
|
204392
204418
|
data: {
|
|
204393
204419
|
affectedFrameworks,
|
|
204420
|
+
fullReload: wasSubprocess,
|
|
204394
204421
|
manifest
|
|
204395
204422
|
},
|
|
204396
204423
|
message: "Rebuild completed successfully",
|
|
204397
204424
|
type: "rebuild-complete"
|
|
204398
204425
|
});
|
|
204399
|
-
if (filesToRebuild && filesToRebuild.length > 0) {
|
|
204426
|
+
if (filesToRebuild && filesToRebuild.length > 0 && !wasSubprocess) {
|
|
204400
204427
|
await handleFullBuildHMR(state, config, affectedFrameworks, filesToRebuild, manifest, duration);
|
|
204401
204428
|
}
|
|
204402
204429
|
broadcastFrameworkUpdates(state, affectedFrameworks, filesToRebuild, manifest, startTime);
|
|
@@ -205309,5 +205336,5 @@ export {
|
|
|
205309
205336
|
ANGULAR_INIT_TIMEOUT_MS
|
|
205310
205337
|
};
|
|
205311
205338
|
|
|
205312
|
-
//# debugId=
|
|
205339
|
+
//# debugId=CC2733F54B67DF6C64756E2164756E21
|
|
205313
205340
|
//# sourceMappingURL=index.js.map
|