@absolutejs/absolute 0.20.0-beta.74 → 0.20.0-beta.76

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.
@@ -22,7 +22,6 @@ import"./index-mywsk201.js";
22
22
  // src/cli/scripts/doctor.ts
23
23
  import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
24
24
  import { createRequire as createRequire2 } from "module";
25
- import { arch, platform } from "os";
26
25
  import { join as join2 } from "path";
27
26
 
28
27
  // src/cli/typeGraphCoherence.ts
@@ -274,11 +273,6 @@ var checkAbsolute = () => {
274
273
  const version = resolveVersion("@absolutejs/absolute");
275
274
  return version === null ? check("fail", "@absolutejs/absolute", "not resolvable here") : check("ok", "@absolutejs/absolute", `v${version}`);
276
275
  };
277
- var checkNative = () => {
278
- const target = `@absolutejs/native-${platform()}-${arch()}`;
279
- const version = resolveVersion(target);
280
- return version === null ? check("warn", "Native binary", `${target} not installed`) : check("ok", "Native binary", `v${version}`);
281
- };
282
276
  var loadConfigOrNull = async () => {
283
277
  try {
284
278
  return await loadRawConfig();
@@ -355,7 +349,6 @@ var gatherChecks = async () => {
355
349
  return [
356
350
  checkBun(),
357
351
  checkAbsolute(),
358
- checkNative(),
359
352
  typeGraphCheck(),
360
353
  configCheck,
361
354
  ...config === null ? [] : frameworkChecks(config),
package/dist/cli/index.js CHANGED
@@ -168,7 +168,7 @@ if (command === "dev") {
168
168
  await runLogs(args);
169
169
  } else if (command === "doctor") {
170
170
  sendTelemetryEvent("cli:command", { command: "doctor" });
171
- const { runDoctor } = await import("./doctor-a8afwvf9.js");
171
+ const { runDoctor } = await import("./doctor-mbh9bk05.js");
172
172
  await runDoctor(args);
173
173
  } else if (command === "routes") {
174
174
  sendTelemetryEvent("cli:command", { command: "routes" });
@@ -187,6 +187,15 @@ var dominatedByEdge = (edges, root, fromIndex, toIndex, reachable = reachableFro
187
187
  }
188
188
  return dominated;
189
189
  };
190
+ var dominatedByEdges = (edges, root, fromIndex, targets, reachable) => {
191
+ const without = reachableWithoutEdges(edges, root, fromIndex, targets);
192
+ const dominated = [];
193
+ for (let index = 0;index < edges.length; index += 1) {
194
+ if (reachable[index] === 1 && without[index] !== 1)
195
+ dominated.push(index);
196
+ }
197
+ return dominated;
198
+ };
190
199
  var reachableFrom = (edges, root, skipFrom = NOT_FOUND, skipTo = NOT_FOUND) => {
191
200
  const seen = new Uint8Array(edges.length);
192
201
  if (root < 0 || root >= edges.length)
@@ -201,6 +210,30 @@ var reachableFrom = (edges, root, skipFrom = NOT_FOUND, skipTo = NOT_FOUND) => {
201
210
  }
202
211
  return seen;
203
212
  };
213
+ var reachableWithoutEdges = (edges, root, skipFrom, skipTargets) => {
214
+ const seen = new Uint8Array(edges.length);
215
+ if (root < 0 || root >= edges.length)
216
+ return seen;
217
+ seen[root] = 1;
218
+ const stack = [root];
219
+ while (stack.length > 0) {
220
+ const current = stack.pop();
221
+ if (current === undefined)
222
+ break;
223
+ pushNeighboursExcept(edges[current] ?? [], seen, stack, current === skipFrom ? skipTargets : null);
224
+ }
225
+ return seen;
226
+ };
227
+ var pushNeighboursExcept = (targets, seen, stack, skip) => {
228
+ for (const target of targets) {
229
+ if (skip?.has(target) === true)
230
+ continue;
231
+ if (seen[target] === 1)
232
+ continue;
233
+ seen[target] = 1;
234
+ stack.push(target);
235
+ }
236
+ };
204
237
  var sumSelfMs = (selfMs, indexes) => indexes.reduce((total, index) => total + (selfMs[index] ?? 0), 0);
205
238
  var accumulate = (selfMs, reachable, attributed) => {
206
239
  const totals = {
@@ -251,10 +284,17 @@ var summarizeImportSavings = (input) => {
251
284
  });
252
285
  }
253
286
  const totals = accumulate(input.selfMs, reachable, attributed);
287
+ const inGroup = (candidate) => input.groupSpecifiers === undefined || input.groupSpecifiers.has(candidate.specifier);
288
+ const groupTargets = new Set(input.candidates.filter(inGroup).map((candidate) => candidate.target).filter((target) => target >= 0));
289
+ const groupDominated = dominatedByEdges(input.edges, input.root, input.entry, groupTargets, reachable);
254
290
  const result = {
255
291
  attributedCount: totals.attributedCount,
256
292
  attributedMs: totals.attributedMs,
257
293
  candidates: savings,
294
+ combined: {
295
+ count: groupDominated.length,
296
+ savingMs: sumSelfMs(input.selfMs, groupDominated)
297
+ },
258
298
  reachableCount: totals.reachableCount,
259
299
  sharedBaseCount: totals.reachableCount - totals.attributedCount,
260
300
  sharedBaseMs: totals.totalMs - totals.attributedMs,
@@ -322,6 +362,8 @@ AbsoluteJS import cost \u2014 ${report.entryLabel}`,
322
362
  "",
323
363
  ` shared base: ${formatMs(report.sharedBaseMs)} across ${report.sharedBaseCount} modules \u2014 reached through more than one`,
324
364
  " import (or loaded before the entry), so deferring any single import does not remove it.",
365
+ ` all together: deferring every deferrable import at once removes ${formatMs(report.combinedMs)}`,
366
+ ` across ${report.combinedCount} modules \u2014 each row above is measured alone, so they do not sum to this.`,
325
367
  ...caveats(report),
326
368
  ""
327
369
  ].join(`
@@ -674,6 +716,7 @@ var buildReport = (recorder) => {
674
716
  candidates,
675
717
  edges,
676
718
  entry,
719
+ groupSpecifiers: new Set(candidates.filter((_candidate, index) => (declared[index]?.verdict ?? "deferrable") === "deferrable").map((candidate) => candidate.specifier)),
677
720
  root,
678
721
  selfMs
679
722
  });
@@ -687,6 +730,8 @@ var buildReport = (recorder) => {
687
730
  verdict: declared[index]?.verdict ?? "deferrable"
688
731
  })).sort((left, right) => right.savingMs - left.savingMs);
689
732
  const report = {
733
+ combinedCount: savings.combined.count,
734
+ combinedMs: savings.combined.savingMs,
690
735
  entryBodyMs: entryMs,
691
736
  entryLabel: relative(process.cwd(), entryPath) || entryPath,
692
737
  incomplete: times.incomplete.filter((index) => index !== root).length,
package/dist/index.js CHANGED
@@ -10592,16 +10592,30 @@ var DEFAULT_BATCH_SIZE = 12, DEFAULT_POLL_MS = 25, DEFAULT_MAX_PAUSE_MS = 2000,
10592
10592
  waited += pollMs;
10593
10593
  }
10594
10594
  };
10595
+ const launchBatch = async (pending) => {
10596
+ const launched = [];
10597
+ while (pending.length > 0 && !cancelled) {
10598
+ if (launched.length > 0 && options.isBusy())
10599
+ break;
10600
+ const task = pending.shift();
10601
+ if (task === undefined)
10602
+ break;
10603
+ launched.push(Promise.resolve(task()));
10604
+ await sleep(0);
10605
+ }
10606
+ await Promise.all(launched);
10607
+ return launched.length;
10608
+ };
10595
10609
  const run = async () => {
10596
10610
  let completed = 0;
10597
10611
  const iterator = tasks[Symbol.iterator]();
10612
+ let pending = [];
10598
10613
  while (!cancelled) {
10599
10614
  await waitForIdle();
10600
- const batch = cancelled ? [] : takeBatch(iterator, batchSize);
10601
- if (batch.length === 0)
10615
+ pending = pending.length === 0 && !cancelled ? takeBatch(iterator, batchSize) : pending;
10616
+ if (pending.length === 0)
10602
10617
  break;
10603
- await Promise.all(batch.map((task) => task()));
10604
- completed += batch.length;
10618
+ completed += await launchBatch(pending);
10605
10619
  await sleep(0);
10606
10620
  }
10607
10621
  return completed;
@@ -43581,5 +43595,5 @@ export {
43581
43595
  wrapPageHandlerWithStreamingSlots
43582
43596
  };
43583
43597
 
43584
- //# debugId=64994B5103FBB83764756E2164756E21
43598
+ //# debugId=6F1D3AD5600A3EC864756E2164756E21
43585
43599
  //# sourceMappingURL=index.js.map