@absolutejs/absolute 0.19.0-beta.881 → 0.19.0-beta.883
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 +75 -19
- package/dist/build.js.map +4 -4
- package/dist/index.js +75 -19
- package/dist/index.js.map +4 -4
- package/dist/src/dev/angular/resolveOwningComponents.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17623,7 +17623,8 @@ var init_rewriteImports = __esm(() => {
|
|
|
17623
17623
|
// src/dev/angular/resolveOwningComponents.ts
|
|
17624
17624
|
var exports_resolveOwningComponents = {};
|
|
17625
17625
|
__export(exports_resolveOwningComponents, {
|
|
17626
|
-
resolveOwningComponents: () => resolveOwningComponents
|
|
17626
|
+
resolveOwningComponents: () => resolveOwningComponents,
|
|
17627
|
+
invalidateResourceIndex: () => invalidateResourceIndex
|
|
17627
17628
|
});
|
|
17628
17629
|
import { readdirSync as readdirSync2, readFileSync as readFileSync19, statSync as statSync3 } from "fs";
|
|
17629
17630
|
import { dirname as dirname18, extname as extname9, join as join29, resolve as resolve32 } from "path";
|
|
@@ -17754,27 +17755,42 @@ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") ||
|
|
|
17754
17755
|
}
|
|
17755
17756
|
if (!rootStat.isDirectory())
|
|
17756
17757
|
return out;
|
|
17758
|
+
const index = getOrBuildResourceIndex(userAngularRoot);
|
|
17759
|
+
const owners = index.get(changedAbs);
|
|
17760
|
+
if (owners) {
|
|
17761
|
+
out.push(...owners);
|
|
17762
|
+
}
|
|
17763
|
+
return out;
|
|
17764
|
+
}, resourceIndexByRoot, getOrBuildResourceIndex = (userAngularRoot) => {
|
|
17765
|
+
const cached = resourceIndexByRoot.get(userAngularRoot);
|
|
17766
|
+
if (cached)
|
|
17767
|
+
return cached;
|
|
17768
|
+
const index = new Map;
|
|
17757
17769
|
for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
|
|
17758
17770
|
const classes = parseDecoratedClasses(tsPath);
|
|
17759
17771
|
const componentDir = dirname18(tsPath);
|
|
17760
|
-
const matchesResource = (relativeUrl) => {
|
|
17761
|
-
const abs = safeNormalize(resolve32(componentDir, relativeUrl));
|
|
17762
|
-
return abs === changedAbs;
|
|
17763
|
-
};
|
|
17764
17772
|
for (const cls of classes) {
|
|
17765
17773
|
if (cls.kind !== "component")
|
|
17766
17774
|
continue;
|
|
17767
|
-
const
|
|
17768
|
-
if (!referencesChanged)
|
|
17769
|
-
continue;
|
|
17770
|
-
out.push({
|
|
17775
|
+
const owner = {
|
|
17771
17776
|
className: cls.className,
|
|
17772
17777
|
componentFilePath: tsPath,
|
|
17773
17778
|
kind: "component"
|
|
17774
|
-
}
|
|
17779
|
+
};
|
|
17780
|
+
for (const url of [...cls.templateUrls, ...cls.styleUrls]) {
|
|
17781
|
+
const abs = safeNormalize(resolve32(componentDir, url));
|
|
17782
|
+
const existing = index.get(abs);
|
|
17783
|
+
if (existing)
|
|
17784
|
+
existing.push(owner);
|
|
17785
|
+
else
|
|
17786
|
+
index.set(abs, [owner]);
|
|
17787
|
+
}
|
|
17775
17788
|
}
|
|
17776
17789
|
}
|
|
17777
|
-
|
|
17790
|
+
resourceIndexByRoot.set(userAngularRoot, index);
|
|
17791
|
+
return index;
|
|
17792
|
+
}, invalidateResourceIndex = () => {
|
|
17793
|
+
resourceIndexByRoot.clear();
|
|
17778
17794
|
};
|
|
17779
17795
|
var init_resolveOwningComponents = __esm(() => {
|
|
17780
17796
|
ENTITY_DECORATORS = {
|
|
@@ -17783,6 +17799,7 @@ var init_resolveOwningComponents = __esm(() => {
|
|
|
17783
17799
|
Pipe: "pipe",
|
|
17784
17800
|
Injectable: "service"
|
|
17785
17801
|
};
|
|
17802
|
+
resourceIndexByRoot = new Map;
|
|
17786
17803
|
});
|
|
17787
17804
|
|
|
17788
17805
|
// src/dev/angular/hmrImportGenerator.ts
|
|
@@ -20099,21 +20116,51 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20099
20116
|
const clientManifest = generateManifest2(clientResult.outputs, buildDir);
|
|
20100
20117
|
Object.assign(state.manifest, clientManifest);
|
|
20101
20118
|
await populateAssetStore(state.assetStore, clientManifest, buildDir);
|
|
20119
|
+
}, angularDispatcherModules = null, loadAngularDispatcherModules = async () => {
|
|
20120
|
+
if (angularDispatcherModules)
|
|
20121
|
+
return angularDispatcherModules;
|
|
20122
|
+
const [resolveMod, hmrMod, fastMod] = await Promise.all([
|
|
20123
|
+
Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents)),
|
|
20124
|
+
Promise.resolve().then(() => (init_hmrCompiler(), exports_hmrCompiler)),
|
|
20125
|
+
Promise.resolve().then(() => (init_fastHmrCompiler(), exports_fastHmrCompiler))
|
|
20126
|
+
]);
|
|
20127
|
+
angularDispatcherModules = {
|
|
20128
|
+
encodeHmrComponentId: hmrMod.encodeHmrComponentId,
|
|
20129
|
+
invalidateResourceIndex: resolveMod.invalidateResourceIndex,
|
|
20130
|
+
resolveOwningComponents: resolveMod.resolveOwningComponents,
|
|
20131
|
+
tryFastHmr: fastMod.tryFastHmr
|
|
20132
|
+
};
|
|
20133
|
+
return angularDispatcherModules;
|
|
20102
20134
|
}, decideAngularTier = async (state, angularDir) => {
|
|
20103
20135
|
const userEdited = state.lastUserEditedFiles ?? new Set;
|
|
20104
20136
|
if (userEdited.size === 0)
|
|
20105
20137
|
return { queue: [], tier: 0 };
|
|
20106
|
-
const
|
|
20107
|
-
const {
|
|
20108
|
-
|
|
20138
|
+
const importsStart = performance.now();
|
|
20139
|
+
const {
|
|
20140
|
+
resolveOwningComponents: resolveOwningComponents2,
|
|
20141
|
+
invalidateResourceIndex: invalidateResourceIndex2,
|
|
20142
|
+
encodeHmrComponentId: encodeHmrComponentId2,
|
|
20143
|
+
tryFastHmr: tryFastHmr2
|
|
20144
|
+
} = await loadAngularDispatcherModules();
|
|
20145
|
+
const importsMs = performance.now() - importsStart;
|
|
20146
|
+
for (const editedFile of userEdited) {
|
|
20147
|
+
if (editedFile.endsWith(".ts") || editedFile.endsWith(".tsx")) {
|
|
20148
|
+
invalidateResourceIndex2();
|
|
20149
|
+
break;
|
|
20150
|
+
}
|
|
20151
|
+
}
|
|
20109
20152
|
const queue = [];
|
|
20110
20153
|
const queueIds = new Set;
|
|
20111
20154
|
let anyFingerprintChanged = false;
|
|
20155
|
+
let totalResolveMs = 0;
|
|
20156
|
+
let totalCompileMs = 0;
|
|
20112
20157
|
for (const editedFile of userEdited) {
|
|
20158
|
+
const resolveStart = performance.now();
|
|
20113
20159
|
const owners = resolveOwningComponents2({
|
|
20114
20160
|
changedFilePath: editedFile,
|
|
20115
20161
|
userAngularRoot: angularDir
|
|
20116
20162
|
});
|
|
20163
|
+
totalResolveMs += performance.now() - resolveStart;
|
|
20117
20164
|
if (owners.length === 0 && (editedFile.endsWith(".component.ts") || editedFile.endsWith(".directive.ts") || editedFile.endsWith(".pipe.ts") || editedFile.endsWith(".service.ts"))) {
|
|
20118
20165
|
return {
|
|
20119
20166
|
kind: "rebootstrap",
|
|
@@ -20125,11 +20172,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20125
20172
|
const id = encodeHmrComponentId2(componentFilePath, className);
|
|
20126
20173
|
if (queueIds.has(id))
|
|
20127
20174
|
continue;
|
|
20175
|
+
const compileStart = performance.now();
|
|
20128
20176
|
const result = await tryFastHmr2({
|
|
20129
20177
|
className,
|
|
20130
20178
|
componentFilePath,
|
|
20131
20179
|
kind
|
|
20132
20180
|
});
|
|
20181
|
+
totalCompileMs += performance.now() - compileStart;
|
|
20133
20182
|
if (!result.ok) {
|
|
20134
20183
|
return {
|
|
20135
20184
|
kind: "rebootstrap",
|
|
@@ -20144,10 +20193,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20144
20193
|
queue.push({ className, id });
|
|
20145
20194
|
}
|
|
20146
20195
|
}
|
|
20196
|
+
const breakdown = {
|
|
20197
|
+
importsMs: Math.round(importsMs),
|
|
20198
|
+
resolveMs: Math.round(totalResolveMs),
|
|
20199
|
+
compileMs: Math.round(totalCompileMs)
|
|
20200
|
+
};
|
|
20147
20201
|
if (anyFingerprintChanged) {
|
|
20148
|
-
return { kind: "remount", queue, tier: 1 };
|
|
20202
|
+
return { breakdown, kind: "remount", queue, tier: 1 };
|
|
20149
20203
|
}
|
|
20150
|
-
return { queue, tier: 0 };
|
|
20204
|
+
return { breakdown, queue, tier: 0 };
|
|
20151
20205
|
}, broadcastSurgical = (state, queue) => {
|
|
20152
20206
|
const timestamp = Date.now();
|
|
20153
20207
|
for (const { id } of queue) {
|
|
@@ -20227,13 +20281,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
20227
20281
|
const queueDescription = (queue) => queue.map((e) => e.className).join(", ");
|
|
20228
20282
|
if (verdict.tier === 0) {
|
|
20229
20283
|
broadcastSurgical(state, verdict.queue);
|
|
20230
|
-
|
|
20284
|
+
const b2 = verdict.breakdown;
|
|
20285
|
+
logInfo(`[ng-hmr] tier-0 ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${b2.importsMs}/resolve ${b2.resolveMs}/compile ${b2.compileMs}; awaiting client apply)`);
|
|
20231
20286
|
runBundle().catch((err) => {
|
|
20232
20287
|
logWarn(`[ng-hmr async bundle] rebuild failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
20233
20288
|
});
|
|
20234
20289
|
} else if (verdict.tier === 1 && verdict.kind === "remount") {
|
|
20235
20290
|
broadcastRemount(state, verdict.queue);
|
|
20236
|
-
|
|
20291
|
+
const b2 = verdict.breakdown;
|
|
20292
|
+
logInfo(`[ng-hmr] tier-1a remount ${queueDescription(verdict.queue)} (server ${tierMs}ms: imports ${b2.importsMs}/resolve ${b2.resolveMs}/compile ${b2.compileMs}; awaiting client apply)`);
|
|
20237
20293
|
runBundle().catch((err) => {
|
|
20238
20294
|
logWarn(`[ng-hmr async bundle] rebuild failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
20239
20295
|
});
|
|
@@ -30541,5 +30597,5 @@ export {
|
|
|
30541
30597
|
ANGULAR_INIT_TIMEOUT_MS
|
|
30542
30598
|
};
|
|
30543
30599
|
|
|
30544
|
-
//# debugId=
|
|
30600
|
+
//# debugId=9196AF65F1A3263464756E2164756E21
|
|
30545
30601
|
//# sourceMappingURL=index.js.map
|