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 +1 -1
- package/dist/bin/gemi.js +29 -4
- package/dist/bin/gemi.js.map +3 -3
- package/dist/{chunk-ff8gkrsr.js → chunk-370e8c8b.js} +1 -1
- package/dist/{chunk-r3hacxdr.js → chunk-tjqn206t.js} +24 -24
- package/dist/{chunk-r3hacxdr.js.map → chunk-tjqn206t.js.map} +4 -4
- package/dist/{chunk-thwfndp3.js → chunk-vc448e6t.js} +2 -2
- package/dist/{chunk-thwfndp3.js.map → chunk-vc448e6t.js.map} +1 -1
- package/dist/{chunk-qz5jz43n.js → chunk-vjwgfkwn.js} +1 -1
- package/dist/{chunk-wetdcmvf.js → chunk-x2zemc8f.js} +1 -1
- package/dist/facades/Prefetch.d.ts +8 -0
- package/dist/facades/Prefetch.d.ts.map +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/services/router/ServerQueryStore.d.ts +27 -0
- package/dist/services/router/ServerQueryStore.d.ts.map +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-ff8gkrsr.js.map → chunk-370e8c8b.js.map} +0 -0
- /package/dist/{chunk-qz5jz43n.js.map → chunk-vjwgfkwn.js.map} +0 -0
- /package/dist/{chunk-wetdcmvf.js.map → chunk-x2zemc8f.js.map} +0 -0
package/dist/app/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{o as a,p as b}from"../chunk-
|
|
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
|
-
|
|
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
|
-
|
|
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=
|
|
70009
|
+
//# debugId=44D95B041CD6BDAE64756E2164756E21
|
|
69985
70010
|
//# sourceMappingURL=gemi.js.map
|