@absolutejs/absolute 0.19.0-beta.66 → 0.19.0-beta.67

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/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 });
@@ -202351,6 +202360,28 @@ var globalStore, cache, importers, getTransformed = (filePath) => cache.get(file
202351
202360
  }
202352
202361
  }
202353
202362
  }
202363
+ }, invalidateAll = () => {
202364
+ cache.clear();
202365
+ importers.clear();
202366
+ }, findNearestComponent = (filePath) => {
202367
+ const visited = new Set;
202368
+ const queue = [filePath];
202369
+ while (queue.length > 0) {
202370
+ const current = queue.shift();
202371
+ if (visited.has(current))
202372
+ continue;
202373
+ visited.add(current);
202374
+ const parents = importers.get(current);
202375
+ if (!parents)
202376
+ continue;
202377
+ for (const parent of parents) {
202378
+ if (parent.endsWith(".tsx") || parent.endsWith(".jsx")) {
202379
+ return parent;
202380
+ }
202381
+ queue.push(parent);
202382
+ }
202383
+ }
202384
+ return;
202354
202385
  };
202355
202386
  var init_transformCache = __esm(() => {
202356
202387
  globalStore = globalThis;
@@ -203489,7 +203520,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
203489
203520
  for (const file4 of reactFiles) {
203490
203521
  invalidateModule2(file4);
203491
203522
  }
203492
- const pageModuleUrl = await getReactModuleUrl(primaryFile);
203523
+ const isComponentFile = primaryFile.endsWith(".tsx") || primaryFile.endsWith(".jsx");
203524
+ let broadcastTarget = primaryFile;
203525
+ if (!isComponentFile) {
203526
+ const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
203527
+ const nearest = findNearestComponent2(resolve21(primaryFile));
203528
+ if (nearest)
203529
+ broadcastTarget = nearest;
203530
+ }
203531
+ const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
203493
203532
  if (pageModuleUrl) {
203494
203533
  const serverDuration = Date.now() - startTime;
203495
203534
  state.lastHmrPath = relative9(process.cwd(), primaryFile).replace(/\\/g, "/");
@@ -205259,5 +205298,5 @@ export {
205259
205298
  ANGULAR_INIT_TIMEOUT_MS
205260
205299
  };
205261
205300
 
205262
- //# debugId=364C554C5D92BFFF64756E2164756E21
205301
+ //# debugId=38B222B3DCDB342564756E2164756E21
205263
205302
  //# sourceMappingURL=index.js.map