gemi 0.49.0-rc.4 → 0.49.0

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.
Files changed (33) hide show
  1. package/dist/app/index.js +1 -1
  2. package/dist/bin/gemi.js +39 -8
  3. package/dist/bin/gemi.js.map +5 -4
  4. package/dist/{chunk-dbhj0tz1.js → chunk-jesnw3h2.js} +1 -1
  5. package/dist/{chunk-p2k3cckx.js → chunk-pd3ycrny.js} +1 -1
  6. package/dist/{chunk-shfyqrd6.js → chunk-swq81w29.js} +1 -1
  7. package/dist/{chunk-j0c51zzj.js → chunk-twg652g2.js} +18 -16
  8. package/dist/{chunk-j0c51zzj.js.map → chunk-twg652g2.js.map} +5 -4
  9. package/dist/chunk-x2ahg1k8.js +6 -0
  10. package/dist/{chunk-2rpa97bp.js.map → chunk-x2ahg1k8.js.map} +2 -2
  11. package/dist/client/ClientRouter.d.ts.map +1 -1
  12. package/dist/client/ClientRouterContext.d.ts.map +1 -1
  13. package/dist/client/QueryManagerContext.d.ts.map +1 -1
  14. package/dist/client/QueryResource.d.ts +8 -0
  15. package/dist/client/QueryResource.d.ts.map +1 -1
  16. package/dist/client/helpers/loadRoutePayload.d.ts +7 -0
  17. package/dist/client/helpers/loadRoutePayload.d.ts.map +1 -1
  18. package/dist/client/helpers/readRoutePayload.d.ts +28 -0
  19. package/dist/client/helpers/readRoutePayload.d.ts.map +1 -0
  20. package/dist/client/index.js +155 -28
  21. package/dist/client/index.js.map +1 -1
  22. package/dist/facades/index.js +1 -1
  23. package/dist/i18n/index.js +1 -1
  24. package/dist/kernel/index.js +1 -1
  25. package/dist/server/index.js +1 -1
  26. package/dist/services/router/ViewRouterServiceContainer.d.ts.map +1 -1
  27. package/dist/services/router/routePayloadStream.d.ts +22 -0
  28. package/dist/services/router/routePayloadStream.d.ts.map +1 -0
  29. package/package.json +1 -1
  30. package/dist/chunk-2rpa97bp.js +0 -6
  31. /package/dist/{chunk-dbhj0tz1.js.map → chunk-jesnw3h2.js.map} +0 -0
  32. /package/dist/{chunk-p2k3cckx.js.map → chunk-pd3ycrny.js.map} +0 -0
  33. /package/dist/{chunk-shfyqrd6.js.map → chunk-swq81w29.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-p2k3cckx.js";import"../chunk-j0c51zzj.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-pd3ycrny.js";import"../chunk-twg652g2.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
@@ -68556,6 +68556,36 @@ function isBotUserAgent(userAgent) {
68556
68556
  return BOT_UA.test(userAgent);
68557
68557
  }
68558
68558
 
68559
+ // services/router/routePayloadStream.ts
68560
+ var PAYLOAD_STREAM_DEADLINE_MS = 1e4;
68561
+ function createRoutePayloadStream(envelope, store, deadlineMs = PAYLOAD_STREAM_DEADLINE_MS) {
68562
+ const encoder = new TextEncoder;
68563
+ return new ReadableStream({
68564
+ start(controller) {
68565
+ let closed = false;
68566
+ const close = () => {
68567
+ if (closed)
68568
+ return;
68569
+ closed = true;
68570
+ clearTimeout(deadline);
68571
+ try {
68572
+ controller.close();
68573
+ } catch {}
68574
+ };
68575
+ controller.enqueue(encoder.encode(`${JSON.stringify(envelope)}
68576
+ `));
68577
+ store.onSettle((entry) => {
68578
+ if (closed || entry.status !== "resolved")
68579
+ return;
68580
+ controller.enqueue(encoder.encode(`${JSON.stringify([entry.path, entry.variantKey, entry.data])}
68581
+ `));
68582
+ });
68583
+ const deadline = setTimeout(close, deadlineMs);
68584
+ store.allSettled().then(close, close);
68585
+ }
68586
+ });
68587
+ }
68588
+
68559
68589
  // services/router/ViewRouterServiceContainer.ts
68560
68590
  var STREAM_DEADLINE_MS = 1e4;
68561
68591
  var themeScript = `
@@ -68878,9 +68908,6 @@ class ViewRouterServiceContainer extends ServiceContainer {
68878
68908
  };
68879
68909
  }
68880
68910
  const data = await Promise.all(handlers.map((fn2) => fn2(httpRequest2)));
68881
- if (isViewDataRequest) {
68882
- await ctx.serverQueries.allSettled();
68883
- }
68884
68911
  const cookies = ctx.cookies;
68885
68912
  const headers = ctx.headers;
68886
68913
  pageData = {
@@ -68921,26 +68948,30 @@ class ViewRouterServiceContainer extends ServiceContainer {
68921
68948
  return await createFileResponse(fileOutput, headers);
68922
68949
  }
68923
68950
  if (isViewDataRequest) {
68924
- headers.set("Content-Type", "application/json; charset=utf-8");
68951
+ headers.set("Content-Type", "application/x-ndjson; charset=utf-8");
68925
68952
  headers.append("Vary", PARTIAL_RENDER_HEADER);
68926
68953
  cookies.forEach((cookie) => headers.append("Set-Cookie", cookie.toString()));
68927
68954
  await this.service.onRequestEnd(httpRequest2);
68928
- return new Response(JSON.stringify({
68955
+ const envelope = {
68929
68956
  meta: partial && !ctx.metadata.touched ? null : pageData.meta,
68930
68957
  data: {
68931
68958
  [urlPathname]: viewData
68932
68959
  },
68933
68960
  breadcrumbs,
68934
- prefetchedData: pageData.prefetchedData,
68961
+ prefetchedData: ctx.serverQueries.snapshotResolved(),
68935
68962
  i18n,
68936
68963
  is404: !currentPathName2,
68937
68964
  appId: pageData.appId,
68938
68965
  partial
68939
- }), {
68966
+ };
68967
+ return new Response(createRoutePayloadStream(envelope, ctx.serverQueries), {
68940
68968
  headers
68941
68969
  });
68942
68970
  }
68943
68971
  headers.set("Content-Type", "text/html; charset=utf-8");
68972
+ if (!noStream) {
68973
+ headers.append("Vary", "User-Agent");
68974
+ }
68944
68975
  for (const cookie of cookies) {
68945
68976
  headers.append("Set-Cookie", cookie.toString());
68946
68977
  }
@@ -70010,5 +70041,5 @@ program.command("app:route-manifest").action(async () => {
70010
70041
  });
70011
70042
  program.parse();
70012
70043
 
70013
- //# debugId=4B7C38AF6FD3DF1064756E2164756E21
70044
+ //# debugId=DCB90EA813E43E3464756E2164756E21
70014
70045
  //# sourceMappingURL=gemi.js.map