gemi 0.49.0-rc.2 → 0.49.0-rc.3

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/app/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{o as a,p as b}from"../chunk-qz5jz43n.js";import"../chunk-r3hacxdr.js";import"../chunk-x5f4e2fp.js";import"../chunk-p5r0t9jh.js";import"../chunk-xkrthw08.js";import"../chunk-4z53shav.js";import"../chunk-m0earq80.js";import"../chunk-f18weffa.js";export{b as prismaExtension,a as App};
2
+ import{o as a,p as b}from"../chunk-vjwgfkwn.js";import"../chunk-tjqn206t.js";import"../chunk-x5f4e2fp.js";import"../chunk-p5r0t9jh.js";import"../chunk-xkrthw08.js";import"../chunk-4z53shav.js";import"../chunk-m0earq80.js";import"../chunk-f18weffa.js";export{b as prismaExtension,a as App};
3
3
 
4
4
  //# debugId=15EBDBCE0B2D702364756E2164756E21
package/dist/bin/gemi.js CHANGED
@@ -51537,6 +51537,7 @@ class ServerQueryStore {
51537
51537
  shipped = new Set;
51538
51538
  requestStartedAt = performance.now();
51539
51539
  renderStartedAt = null;
51540
+ discoveryHintsMuted = false;
51540
51541
  constructor(fetcher) {
51541
51542
  this.fetcher = fetcher;
51542
51543
  }
@@ -51551,6 +51552,27 @@ class ServerQueryStore {
51551
51552
  this.renderStartedAt = performance.now();
51552
51553
  }
51553
51554
  }
51555
+ muteDiscoveryHints() {
51556
+ this.discoveryHintsMuted = true;
51557
+ }
51558
+ maybeLogLateDiscovery(entry) {
51559
+ if (!entry.lateBy || this.discoveryHintsMuted)
51560
+ return;
51561
+ if (entry.status !== "resolved")
51562
+ return;
51563
+ if (false)
51564
+ ;
51565
+ let size = "";
51566
+ try {
51567
+ const bytes = JSON.stringify(entry.data)?.length ?? 0;
51568
+ size = bytes >= 1024 ? `${(bytes / 1024).toFixed(1)} kB` : `${bytes} B`;
51569
+ } catch {
51570
+ size = "an unserializable payload";
51571
+ }
51572
+ const duration = (entry.settledAt ?? 0) - entry.startedAt;
51573
+ const searchHint = entry.variantKey ? `, { search: ${JSON.stringify(Object.fromEntries(new URLSearchParams(entry.variantKey)))} }` : "";
51574
+ console.warn(`[gemi] useQuery("${entry.patternPath}") was discovered ${entry.lateBy}ms into the ` + `server render \u2014 under a suspended segment, so its fetch (${duration}ms, resolved ` + `${size}) could not overlap the others. It still streamed. If the query belongs on ` + `this route, \`Query.prefetch("${entry.patternPath}"${searchHint})\` in the view ` + `handler starts it at request time \u2014 but note prefetched data is also awaited by and ` + `serialized into every client-side navigation payload for the route, so weigh that ` + `against the ${size}. If the data is only needed conditionally (a closed popover, a ` + `hidden tab), \`{ lazy: true }\` + \`trigger()\` avoids running it here at all. ` + `\`Query.noPrefetch()\` in the handler marks the omission intentional and silences ` + `this hint for the route.`);
51575
+ }
51554
51576
  read(path, variantKey) {
51555
51577
  return this.entries.get(this.keyFor(path, variantKey));
51556
51578
  }
@@ -51565,11 +51587,11 @@ class ServerQueryStore {
51565
51587
  const existing = this.entries.get(key);
51566
51588
  if (existing)
51567
51589
  return existing;
51568
- if (source === "render" && this.renderStartedAt !== null && true) {
51590
+ let lateBy;
51591
+ if (source === "render" && this.renderStartedAt !== null) {
51569
51592
  const delay = Math.round(performance.now() - this.renderStartedAt);
51570
51593
  if (delay > LATE_DISCOVERY_THRESHOLD_MS) {
51571
- const searchHint = variantKey ? `, { search: ${JSON.stringify(Object.fromEntries(searchParams))} }` : "";
51572
- console.warn(`[gemi] useQuery("${patternPath}") started ${delay}ms into the server render \u2014 ` + `it was discovered under a suspended segment, so its fetch could not overlap ` + `the others. It still streams, but \`Query.prefetch("${patternPath}"${searchHint})\` ` + `in the route's view handler would start it at request time.`);
51594
+ lateBy = delay;
51573
51595
  }
51574
51596
  }
51575
51597
  let settle;
@@ -51578,7 +51600,9 @@ class ServerQueryStore {
51578
51600
  });
51579
51601
  const entry = {
51580
51602
  path,
51603
+ patternPath,
51581
51604
  variantKey,
51605
+ lateBy,
51582
51606
  status: "pending",
51583
51607
  promise,
51584
51608
  source,
@@ -51593,6 +51617,7 @@ class ServerQueryStore {
51593
51617
  entry.error = error;
51594
51618
  }).then(() => {
51595
51619
  entry.settledAt = this.elapsed();
51620
+ this.maybeLogLateDiscovery(entry);
51596
51621
  if (this.settleListener) {
51597
51622
  this.settleListener(entry);
51598
51623
  } else {
@@ -69981,5 +70006,5 @@ program.command("app:route-manifest").action(async () => {
69981
70006
  });
69982
70007
  program.parse();
69983
70008
 
69984
- //# debugId=98CFC1ED06DD2FFA64756E2164756E21
70009
+ //# debugId=44D95B041CD6BDAE64756E2164756E21
69985
70010
  //# sourceMappingURL=gemi.js.map