@absolutejs/absolute 0.19.0-beta.66 → 0.19.0-beta.68
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/.claude/settings.local.json +5 -1
- package/dist/build.js +40 -11
- package/dist/build.js.map +4 -4
- package/dist/index.js +40 -11
- package/dist/index.js.map +4 -4
- package/dist/src/dev/transformCache.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -202323,6 +202323,15 @@ var init_pageHandler = __esm(() => {
|
|
|
202323
202323
|
});
|
|
202324
202324
|
|
|
202325
202325
|
// src/dev/transformCache.ts
|
|
202326
|
+
var exports_transformCache = {};
|
|
202327
|
+
__export(exports_transformCache, {
|
|
202328
|
+
setTransformed: () => setTransformed,
|
|
202329
|
+
invalidateAll: () => invalidateAll,
|
|
202330
|
+
invalidate: () => invalidate,
|
|
202331
|
+
getTransformed: () => getTransformed,
|
|
202332
|
+
getInvalidationVersion: () => getInvalidationVersion,
|
|
202333
|
+
findNearestComponent: () => findNearestComponent
|
|
202334
|
+
});
|
|
202326
202335
|
var globalStore, cache, importers, getTransformed = (filePath) => cache.get(filePath)?.content, setTransformed = (filePath, content, mtime, imports) => {
|
|
202327
202336
|
const resolvedImports = imports ?? [];
|
|
202328
202337
|
cache.set(filePath, { content, imports: resolvedImports, mtime });
|
|
@@ -202333,24 +202342,36 @@ var globalStore, cache, importers, getTransformed = (filePath) => cache.get(file
|
|
|
202333
202342
|
importers.get(imp).add(filePath);
|
|
202334
202343
|
}
|
|
202335
202344
|
}, invalidationVersions, getInvalidationVersion = (filePath) => invalidationVersions.get(filePath) ?? 0, invalidate = (filePath) => {
|
|
202336
|
-
|
|
202345
|
+
cache.delete(filePath);
|
|
202346
|
+
const parents = importers.get(filePath);
|
|
202347
|
+
if (parents) {
|
|
202348
|
+
for (const parent of parents) {
|
|
202349
|
+
cache.delete(parent);
|
|
202350
|
+
invalidationVersions.set(parent, (invalidationVersions.get(parent) ?? 0) + 1);
|
|
202351
|
+
}
|
|
202352
|
+
}
|
|
202353
|
+
}, invalidateAll = () => {
|
|
202354
|
+
cache.clear();
|
|
202355
|
+
importers.clear();
|
|
202356
|
+
}, findNearestComponent = (filePath) => {
|
|
202337
202357
|
const visited = new Set;
|
|
202358
|
+
const queue = [filePath];
|
|
202338
202359
|
while (queue.length > 0) {
|
|
202339
|
-
const current = queue.
|
|
202360
|
+
const current = queue.shift();
|
|
202340
202361
|
if (visited.has(current))
|
|
202341
202362
|
continue;
|
|
202342
202363
|
visited.add(current);
|
|
202343
|
-
cache.delete(current);
|
|
202344
|
-
if (current !== filePath) {
|
|
202345
|
-
invalidationVersions.set(current, (invalidationVersions.get(current) ?? 0) + 1);
|
|
202346
|
-
}
|
|
202347
202364
|
const parents = importers.get(current);
|
|
202348
|
-
if (parents)
|
|
202349
|
-
|
|
202350
|
-
|
|
202365
|
+
if (!parents)
|
|
202366
|
+
continue;
|
|
202367
|
+
for (const parent of parents) {
|
|
202368
|
+
if (parent.endsWith(".tsx") || parent.endsWith(".jsx")) {
|
|
202369
|
+
return parent;
|
|
202351
202370
|
}
|
|
202371
|
+
queue.push(parent);
|
|
202352
202372
|
}
|
|
202353
202373
|
}
|
|
202374
|
+
return;
|
|
202354
202375
|
};
|
|
202355
202376
|
var init_transformCache = __esm(() => {
|
|
202356
202377
|
globalStore = globalThis;
|
|
@@ -203489,7 +203510,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203489
203510
|
for (const file4 of reactFiles) {
|
|
203490
203511
|
invalidateModule2(file4);
|
|
203491
203512
|
}
|
|
203492
|
-
const
|
|
203513
|
+
const isComponentFile = primaryFile.endsWith(".tsx") || primaryFile.endsWith(".jsx");
|
|
203514
|
+
let broadcastTarget = primaryFile;
|
|
203515
|
+
if (!isComponentFile) {
|
|
203516
|
+
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
203517
|
+
const nearest = findNearestComponent2(resolve21(primaryFile));
|
|
203518
|
+
if (nearest)
|
|
203519
|
+
broadcastTarget = nearest;
|
|
203520
|
+
}
|
|
203521
|
+
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
203493
203522
|
if (pageModuleUrl) {
|
|
203494
203523
|
const serverDuration = Date.now() - startTime;
|
|
203495
203524
|
state.lastHmrPath = relative9(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
@@ -205259,5 +205288,5 @@ export {
|
|
|
205259
205288
|
ANGULAR_INIT_TIMEOUT_MS
|
|
205260
205289
|
};
|
|
205261
205290
|
|
|
205262
|
-
//# debugId=
|
|
205291
|
+
//# debugId=0EEED1DEBB36CC4064756E2164756E21
|
|
205263
205292
|
//# sourceMappingURL=index.js.map
|