@absolutejs/absolute 0.19.0-beta.1102 → 0.19.0-beta.1103

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-grVnSR/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-B8wHMF/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-grVnSR/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-B8wHMF/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-grVnSR/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-B8wHMF/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
package/dist/build.js CHANGED
@@ -29178,6 +29178,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29178
29178
  const state = cached.hmrState;
29179
29179
  await waitForRebuild(state);
29180
29180
  state.isRebuilding = true;
29181
+ state.fileChangeQueue.clear();
29181
29182
  try {
29182
29183
  const buildResult = await build({
29183
29184
  ...state.config,
@@ -29200,7 +29201,10 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29200
29201
  } catch {} finally {
29201
29202
  state.rebuildCount++;
29202
29203
  state.isRebuilding = false;
29203
- state.fileChangeQueue.clear();
29204
+ drainPendingQueue(state, state.config, (newBuildResult) => {
29205
+ Object.assign(cached.manifest, newBuildResult.manifest);
29206
+ state.manifest = cached.manifest;
29207
+ });
29204
29208
  }
29205
29209
  }, handleCachedReload = async () => {
29206
29210
  const serverMtime = statSync7(resolve43(Bun.main)).mtimeMs;
@@ -29315,6 +29319,56 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29315
29319
  stepStartedAt = performance.now();
29316
29320
  await resolveAbsoluteVersion2();
29317
29321
  recordStep("resolve version", stepStartedAt);
29322
+ const manifest = {};
29323
+ stepStartedAt = performance.now();
29324
+ const onWatcherRebuildComplete = (newBuildResult) => {
29325
+ Object.assign(manifest, newBuildResult.manifest);
29326
+ state.manifest = manifest;
29327
+ };
29328
+ const settleRecoveryQueue = () => {
29329
+ if (state.initialBuildFailed) {
29330
+ state.fileChangeQueue.clear();
29331
+ return;
29332
+ }
29333
+ drainPendingQueue(state, config, onWatcherRebuildComplete);
29334
+ };
29335
+ const recoverFromColdStartFailure = async () => {
29336
+ await waitForRebuild(state);
29337
+ state.isRebuilding = true;
29338
+ state.fileChangeQueue.clear();
29339
+ try {
29340
+ const recoveryResult = await build({
29341
+ ...config,
29342
+ mode: "development",
29343
+ options: {
29344
+ ...config.options,
29345
+ injectHMR: true,
29346
+ throwOnError: true
29347
+ }
29348
+ });
29349
+ if (recoveryResult?.manifest) {
29350
+ Object.assign(manifest, recoveryResult.manifest);
29351
+ state.manifest = manifest;
29352
+ await populateAssetStore(state.assetStore, manifest, state.resolvedPaths.buildDir);
29353
+ state.initialBuildFailed = false;
29354
+ console.log("[hmr] cold-start recovery rebuild succeeded \u2014 manifest populated.");
29355
+ }
29356
+ } catch {} finally {
29357
+ state.rebuildCount++;
29358
+ state.isRebuilding = false;
29359
+ settleRecoveryQueue();
29360
+ }
29361
+ };
29362
+ state.isRebuilding = true;
29363
+ startFileWatching(state, config, (filePath) => {
29364
+ if (state.initialBuildFailed) {
29365
+ recoverFromColdStartFailure();
29366
+ return;
29367
+ }
29368
+ queueFileChange(state, filePath, config, onWatcherRebuildComplete);
29369
+ });
29370
+ console.log("[hmr] watching for file changes \u2014 edits saved during the boot build are queued.");
29371
+ recordStep("start file watching", stepStartedAt);
29318
29372
  const buildStart = performance.now();
29319
29373
  let buildResult = null;
29320
29374
  try {
@@ -29335,7 +29389,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29335
29389
  }
29336
29390
  state.initialBuildFailed = true;
29337
29391
  }
29338
- const manifest = buildResult?.manifest ?? {};
29392
+ Object.assign(manifest, buildResult?.manifest ?? {});
29339
29393
  const conventions = buildResult?.conventions ?? {};
29340
29394
  if (buildResult?.errors && buildResult.errors.length > 0) {
29341
29395
  state.lastBuildErrors = buildResult.errors;
@@ -29422,44 +29476,14 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
29422
29476
  recordStep("warm tailwind compiler", stepStartedAt);
29423
29477
  }
29424
29478
  state.manifest = manifest;
29425
- stepStartedAt = performance.now();
29426
- const recoverFromColdStartFailure = async () => {
29427
- await waitForRebuild(state);
29428
- state.isRebuilding = true;
29429
- try {
29430
- const recoveryResult = await build({
29431
- ...config,
29432
- mode: "development",
29433
- options: {
29434
- ...config.options,
29435
- injectHMR: true,
29436
- throwOnError: true
29437
- }
29438
- });
29439
- if (recoveryResult?.manifest) {
29440
- Object.assign(manifest, recoveryResult.manifest);
29441
- state.manifest = manifest;
29442
- await populateAssetStore(state.assetStore, manifest, state.resolvedPaths.buildDir);
29443
- state.initialBuildFailed = false;
29444
- console.log("[hmr] cold-start recovery rebuild succeeded \u2014 manifest populated.");
29445
- }
29446
- } catch {} finally {
29447
- state.rebuildCount++;
29448
- state.isRebuilding = false;
29449
- state.fileChangeQueue.clear();
29450
- }
29451
- };
29452
- startFileWatching(state, config, (filePath) => {
29453
- if (state.initialBuildFailed) {
29454
- recoverFromColdStartFailure();
29455
- return;
29456
- }
29457
- queueFileChange(state, filePath, config, (newBuildResult) => {
29458
- Object.assign(manifest, newBuildResult.manifest);
29459
- state.manifest = manifest;
29460
- });
29461
- });
29462
- recordStep("start file watching", stepStartedAt);
29479
+ state.isRebuilding = false;
29480
+ if (state.fileChangeQueue.size > 0 && state.initialBuildFailed) {
29481
+ state.fileChangeQueue.clear();
29482
+ recoverFromColdStartFailure();
29483
+ } else if (state.fileChangeQueue.size > 0) {
29484
+ console.log("[hmr] edits landed during the boot build \u2014 rebuilding to pick them up.");
29485
+ drainPendingQueue(state, config, onWatcherRebuildComplete);
29486
+ }
29463
29487
  globalThis.__hmrBuildDuration = performance.now() - buildStart;
29464
29488
  logStartupTimingBlock("AbsoluteJS devBuild timing", startupSteps);
29465
29489
  const result = {
@@ -29508,5 +29532,5 @@ export {
29508
29532
  build
29509
29533
  };
29510
29534
 
29511
- //# debugId=048B99A485D77DD464756E2164756E21
29535
+ //# debugId=D5BC49AA2D61155364756E2164756E21
29512
29536
  //# sourceMappingURL=build.js.map