@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.
@@ -224,7 +224,11 @@
224
224
  "Bash(kill 895541)",
225
225
  "Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.63\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.64\"\"\"\"/' package.json)",
226
226
  "Bash(kill 897850)",
227
- "Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.64\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.65\"\"\"\"/' package.json)"
227
+ "Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.64\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.65\"\"\"\"/' package.json)",
228
+ "Bash(kill 899808)",
229
+ "Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.65\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.66\"\"\"\"/' package.json)",
230
+ "Bash(kill 906595)",
231
+ "Bash(sed -i 's/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.66\"\"\"\"/\"\"\"\"@absolutejs\\\\/absolute\"\"\"\": \"\"\"\"0.19.0-beta.67\"\"\"\"/' package.json)"
228
232
  ]
229
233
  }
230
234
  }
package/dist/build.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
- const queue = [filePath];
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.pop();
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
- for (const parent of parents) {
202350
- queue.push(parent);
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 file3 of reactFiles) {
203490
203511
  invalidateModule2(file3);
203491
203512
  }
203492
- const pageModuleUrl = await getReactModuleUrl(primaryFile);
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(resolve20(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, "/");
@@ -204871,5 +204900,5 @@ export {
204871
204900
  build
204872
204901
  };
204873
204902
 
204874
- //# debugId=B45A17BBFBB29B3764756E2164756E21
204903
+ //# debugId=FA7B9F8C946AF29164756E2164756E21
204875
204904
  //# sourceMappingURL=build.js.map