@absolutejs/absolute 0.20.0-beta.75 → 0.20.0-beta.77
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/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/build.js +19 -5
- package/dist/build.js.map +3 -3
- package/dist/dev/importCostReport.js +45 -0
- package/dist/index.js +19 -5
- package/dist/index.js.map +3 -3
- package/dist/src/dev/importCost/dominators.d.ts +15 -2
- package/dist/src/dev/importCost/format.d.ts +4 -0
- package/package.json +3 -3
|
@@ -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
|
-
|
|
10601
|
-
if (
|
|
10615
|
+
pending = pending.length === 0 && !cancelled ? takeBatch(iterator, batchSize) : pending;
|
|
10616
|
+
if (pending.length === 0)
|
|
10602
10617
|
break;
|
|
10603
|
-
|
|
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=
|
|
43598
|
+
//# debugId=6F1D3AD5600A3EC864756E2164756E21
|
|
43585
43599
|
//# sourceMappingURL=index.js.map
|