gemi 0.45.0 → 0.46.1

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 (53) hide show
  1. package/dist/app/index.js +1 -1
  2. package/dist/bin/gemi.js +185 -49
  3. package/dist/bin/gemi.js.map +10 -7
  4. package/dist/{chunk-tvp3xgfq.js → chunk-2ahct6kg.js} +2 -2
  5. package/dist/{chunk-tvp3xgfq.js.map → chunk-2ahct6kg.js.map} +1 -1
  6. package/dist/{chunk-v0qh5dqv.js → chunk-5hggqap1.js} +15 -15
  7. package/dist/{chunk-v0qh5dqv.js.map → chunk-5hggqap1.js.map} +3 -3
  8. package/dist/chunk-d9k245jt.js +79 -0
  9. package/dist/{chunk-jxpwexpz.js.map → chunk-d9k245jt.js.map} +8 -5
  10. package/dist/chunk-evkv0xa7.js +4 -0
  11. package/dist/{chunk-atv6nybp.js.map → chunk-evkv0xa7.js.map} +4 -4
  12. package/dist/{chunk-63gmzy5r.js → chunk-pr2xbq0m.js} +1 -1
  13. package/dist/{chunk-ppn0j67g.js → chunk-r64ba1pf.js} +1 -1
  14. package/dist/{chunk-396qq8ge.js → chunk-z29tg1ey.js} +1 -1
  15. package/dist/client/ClientRouter.d.ts.map +1 -1
  16. package/dist/client/Head.d.ts.map +1 -1
  17. package/dist/client/QueryManagerContext.d.ts +5 -2
  18. package/dist/client/QueryManagerContext.d.ts.map +1 -1
  19. package/dist/client/QueryResource.d.ts +23 -1
  20. package/dist/client/QueryResource.d.ts.map +1 -1
  21. package/dist/client/helpers/mergeCarriedSegments.d.ts +23 -0
  22. package/dist/client/helpers/mergeCarriedSegments.d.ts.map +1 -0
  23. package/dist/client/index.js +168 -27
  24. package/dist/client/index.js.map +1 -1
  25. package/dist/client/useQuery.d.ts +2 -0
  26. package/dist/client/useQuery.d.ts.map +1 -1
  27. package/dist/facades/index.js +1 -1
  28. package/dist/http/Metadata.d.ts +6 -0
  29. package/dist/http/Metadata.d.ts.map +1 -1
  30. package/dist/http/ViewRouter.d.ts +12 -0
  31. package/dist/http/ViewRouter.d.ts.map +1 -1
  32. package/dist/http/index.js +1 -1
  33. package/dist/i18n/index.js +1 -1
  34. package/dist/kernel/index.js +1 -1
  35. package/dist/server/index.js +1 -1
  36. package/dist/services/index.js +1 -1
  37. package/dist/services/router/ViewRouterServiceContainer.d.ts.map +1 -1
  38. package/dist/services/router/ViewRouterServiceProvider.d.ts +10 -0
  39. package/dist/services/router/ViewRouterServiceProvider.d.ts.map +1 -1
  40. package/dist/services/router/createFlatViewRoutes.d.ts +16 -0
  41. package/dist/services/router/createFlatViewRoutes.d.ts.map +1 -1
  42. package/dist/services/router/matchViewRoute.d.ts +12 -0
  43. package/dist/services/router/matchViewRoute.d.ts.map +1 -0
  44. package/dist/services/router/planPartialRender.d.ts +43 -0
  45. package/dist/services/router/planPartialRender.d.ts.map +1 -0
  46. package/dist/utils/partialRender.d.ts +28 -0
  47. package/dist/utils/partialRender.d.ts.map +1 -0
  48. package/package.json +1 -1
  49. package/dist/chunk-atv6nybp.js +0 -4
  50. package/dist/chunk-jxpwexpz.js +0 -79
  51. /package/dist/{chunk-63gmzy5r.js.map → chunk-pr2xbq0m.js.map} +0 -0
  52. /package/dist/{chunk-ppn0j67g.js.map → chunk-r64ba1pf.js.map} +0 -0
  53. /package/dist/{chunk-396qq8ge.js.map → chunk-z29tg1ey.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-ppn0j67g.js";import"../chunk-jxpwexpz.js";import"../chunk-atv6nybp.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-r64ba1pf.js";import"../chunk-d9k245jt.js";import"../chunk-evkv0xa7.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
@@ -9380,7 +9380,7 @@ var require_react_development = __commonJS((exports, module) => {
9380
9380
  type = type._init;
9381
9381
  try {
9382
9382
  return getComponentNameFromType(type(innerType));
9383
- } catch (x4) {}
9383
+ } catch (x5) {}
9384
9384
  }
9385
9385
  return null;
9386
9386
  }
@@ -9392,7 +9392,7 @@ var require_react_development = __commonJS((exports, module) => {
9392
9392
  try {
9393
9393
  var name = getComponentNameFromType(type);
9394
9394
  return name ? "<" + name + ">" : "<...>";
9395
- } catch (x4) {
9395
+ } catch (x5) {
9396
9396
  return "<...>";
9397
9397
  }
9398
9398
  }
@@ -9643,14 +9643,14 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
9643
9643
  prevActScopeDepth !== actScopeDepth - 1 && console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
9644
9644
  actScopeDepth = prevActScopeDepth;
9645
9645
  }
9646
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
9646
+ function recursivelyFlushAsyncActWork(returnValue, resolve2, reject) {
9647
9647
  var queue = ReactSharedInternals.actQueue;
9648
9648
  if (queue !== null)
9649
9649
  if (queue.length !== 0)
9650
9650
  try {
9651
9651
  flushActQueue(queue);
9652
9652
  enqueueTask(function() {
9653
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
9653
+ return recursivelyFlushAsyncActWork(returnValue, resolve2, reject);
9654
9654
  });
9655
9655
  return;
9656
9656
  } catch (error) {
@@ -9658,7 +9658,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
9658
9658
  }
9659
9659
  else
9660
9660
  ReactSharedInternals.actQueue = null;
9661
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
9661
+ 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve2(returnValue);
9662
9662
  }
9663
9663
  function flushActQueue(queue) {
9664
9664
  if (!isFlushing) {
@@ -9834,14 +9834,14 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
9834
9834
  didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));
9835
9835
  });
9836
9836
  return {
9837
- then: function(resolve, reject) {
9837
+ then: function(resolve2, reject) {
9838
9838
  didAwaitActCall = true;
9839
9839
  thenable.then(function(returnValue) {
9840
9840
  popActScope(prevActQueue, prevActScopeDepth);
9841
9841
  if (prevActScopeDepth === 0) {
9842
9842
  try {
9843
9843
  flushActQueue(queue), enqueueTask(function() {
9844
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
9844
+ return recursivelyFlushAsyncActWork(returnValue, resolve2, reject);
9845
9845
  });
9846
9846
  } catch (error$0) {
9847
9847
  ReactSharedInternals.thrownErrors.push(error$0);
@@ -9852,7 +9852,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
9852
9852
  reject(_thrownError);
9853
9853
  }
9854
9854
  } else
9855
- resolve(returnValue);
9855
+ resolve2(returnValue);
9856
9856
  }, function(error) {
9857
9857
  popActScope(prevActQueue, prevActScopeDepth);
9858
9858
  0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
@@ -9868,11 +9868,11 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
9868
9868
  if (0 < ReactSharedInternals.thrownErrors.length)
9869
9869
  throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
9870
9870
  return {
9871
- then: function(resolve, reject) {
9871
+ then: function(resolve2, reject) {
9872
9872
  didAwaitActCall = true;
9873
9873
  prevActScopeDepth === 0 ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
9874
- return recursivelyFlushAsyncActWork(returnValue$jscomp$0, resolve, reject);
9875
- })) : resolve(returnValue$jscomp$0);
9874
+ return recursivelyFlushAsyncActWork(returnValue$jscomp$0, resolve2, reject);
9875
+ })) : resolve2(returnValue$jscomp$0);
9876
9876
  }
9877
9877
  };
9878
9878
  };
@@ -10352,11 +10352,11 @@ var require_tslib = __commonJS((exports, module) => {
10352
10352
  };
10353
10353
  __awaiter = function(thisArg, _arguments, P4, generator) {
10354
10354
  function adopt(value) {
10355
- return value instanceof P4 ? value : new P4(function(resolve) {
10356
- resolve(value);
10355
+ return value instanceof P4 ? value : new P4(function(resolve2) {
10356
+ resolve2(value);
10357
10357
  });
10358
10358
  }
10359
- return new (P4 || (P4 = Promise))(function(resolve, reject) {
10359
+ return new (P4 || (P4 = Promise))(function(resolve2, reject) {
10360
10360
  function fulfilled(value) {
10361
10361
  try {
10362
10362
  step(generator.next(value));
@@ -10372,7 +10372,7 @@ var require_tslib = __commonJS((exports, module) => {
10372
10372
  }
10373
10373
  }
10374
10374
  function step(result) {
10375
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
10375
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
10376
10376
  }
10377
10377
  step((generator = generator.apply(thisArg, _arguments || [])).next());
10378
10378
  });
@@ -10601,14 +10601,14 @@ var require_tslib = __commonJS((exports, module) => {
10601
10601
  }, i3);
10602
10602
  function verb(n2) {
10603
10603
  i3[n2] = o2[n2] && function(v4) {
10604
- return new Promise(function(resolve, reject) {
10605
- v4 = o2[n2](v4), settle(resolve, reject, v4.done, v4.value);
10604
+ return new Promise(function(resolve2, reject) {
10605
+ v4 = o2[n2](v4), settle(resolve2, reject, v4.done, v4.value);
10606
10606
  });
10607
10607
  };
10608
10608
  }
10609
- function settle(resolve, reject, d3, v4) {
10609
+ function settle(resolve2, reject, d3, v4) {
10610
10610
  Promise.resolve(v4).then(function(v5) {
10611
- resolve({ value: v5, done: d3 });
10611
+ resolve2({ value: v5, done: d3 });
10612
10612
  }, reject);
10613
10613
  }
10614
10614
  };
@@ -50068,6 +50068,7 @@ class Metadata {
50068
50068
  description: null,
50069
50069
  openGraph: null
50070
50070
  };
50071
+ touched = false;
50071
50072
  render() {
50072
50073
  return {
50073
50074
  title: this.content.title,
@@ -50076,9 +50077,11 @@ class Metadata {
50076
50077
  };
50077
50078
  }
50078
50079
  title(title) {
50080
+ this.touched = true;
50079
50081
  this.content.title = title;
50080
50082
  }
50081
50083
  description(description) {
50084
+ this.touched = true;
50082
50085
  this.content.description = description;
50083
50086
  }
50084
50087
  openGraph({
@@ -50095,6 +50098,7 @@ class Metadata {
50095
50098
  twitterImageWidth = imageWidth,
50096
50099
  twitterImageHeight = imageHeight
50097
50100
  }) {
50101
+ this.touched = true;
50098
50102
  let _image = image;
50099
50103
  let _twitterImage = twitterImage;
50100
50104
  if (image && !image.startsWith("http")) {
@@ -51084,6 +51088,7 @@ class LayoutRoute {
51084
51088
  viewPath;
51085
51089
  children;
51086
51090
  middlewares = [];
51091
+ alwaysRuns = false;
51087
51092
  handler = () => ({});
51088
51093
  constructor(viewPath, handlerOrRoutes, routes) {
51089
51094
  this.viewPath = viewPath;
@@ -51121,6 +51126,10 @@ class LayoutRoute {
51121
51126
  }
51122
51127
  };
51123
51128
  }
51129
+ alwaysRun() {
51130
+ this.alwaysRuns = true;
51131
+ return this;
51132
+ }
51124
51133
  middleware(middlewares) {
51125
51134
  this.middlewares = middlewares;
51126
51135
  return this;
@@ -67234,6 +67243,23 @@ function removeGroupPrefix(input) {
67234
67243
  const withoutDoubleSlashes = withoutParentheses.replace(/\/\//g, "/");
67235
67244
  return withoutDoubleSlashes;
67236
67245
  }
67246
+ function joinRoutePath(prefix, path) {
67247
+ if (prefix === "/")
67248
+ return path;
67249
+ if (path === "/")
67250
+ return prefix;
67251
+ return `${prefix}${path}`;
67252
+ }
67253
+ function segmentPath(path) {
67254
+ const withoutGroups = removeGroupPrefix(path);
67255
+ return withoutGroups.length > 1 ? withoutGroups.replace(/\/$/, "") : withoutGroups;
67256
+ }
67257
+ function prefixSegments(prefix, segments) {
67258
+ return segments.map((segment) => ({
67259
+ ...segment,
67260
+ path: segmentPath(joinRoutePath(prefix, segment.path))
67261
+ }));
67262
+ }
67237
67263
  function createFlatViewRoutes(routes) {
67238
67264
  const flatRoutes = {};
67239
67265
  for (const [routePath, viewConfigOrViewRouter] of Object.entries(routes)) {
@@ -67242,14 +67268,21 @@ function createFlatViewRoutes(routes) {
67242
67268
  if ("children" in route) {
67243
67269
  const children = new route.children;
67244
67270
  const result = createFlatViewRoutes(children.routes);
67245
- for (const [path, { exec: exec2, middleware }] of Object.entries(result)) {
67246
- const key = routePath === "/" ? path : `${routePath}${path}`;
67247
- const _key = path === "/" && routePath !== "/" ? routePath : key;
67271
+ for (const [path, { exec: exec2, middleware, segments }] of Object.entries(result)) {
67272
+ const _key = joinRoutePath(routePath, path);
67248
67273
  const handler = (req) => route.run.call(route, req, routePath);
67249
67274
  flatRoutes[removeGroupPrefix(_key)] = {
67250
67275
  exec: [handler, ...exec2],
67251
67276
  middleware: [...route.middlewares, ...middleware],
67252
- viewPath: route.viewPath
67277
+ viewPath: route.viewPath,
67278
+ segments: [
67279
+ {
67280
+ path: segmentPath(routePath),
67281
+ viewPath: route.viewPath,
67282
+ ...route.alwaysRuns ? { alwaysRun: true } : {}
67283
+ },
67284
+ ...prefixSegments(routePath, segments)
67285
+ ]
67253
67286
  };
67254
67287
  }
67255
67288
  } else {
@@ -67257,19 +67290,23 @@ function createFlatViewRoutes(routes) {
67257
67290
  flatRoutes[removeGroupPrefix(routePath)] = {
67258
67291
  exec: [handler],
67259
67292
  middleware: route.middlewares,
67260
- viewPath: route.viewPath
67293
+ viewPath: route.viewPath,
67294
+ segments: [{ path: segmentPath(routePath), viewPath: route.viewPath }]
67261
67295
  };
67262
67296
  }
67263
67297
  } else {
67264
67298
  const router = new viewConfigOrViewRouter;
67265
67299
  const result = createFlatViewRoutes(router.routes);
67266
- for (const [path, { exec: exec2, middleware, viewPath }] of Object.entries(result)) {
67267
- const key = routePath === "/" ? path : `${routePath}${path}`;
67268
- const _key = path === "/" && routePath !== "/" ? routePath : key;
67300
+ for (const [
67301
+ path,
67302
+ { exec: exec2, middleware, viewPath, segments }
67303
+ ] of Object.entries(result)) {
67304
+ const _key = joinRoutePath(routePath, path);
67269
67305
  flatRoutes[removeGroupPrefix(_key)] = {
67270
67306
  exec: exec2,
67271
67307
  middleware: [...router.middlewares, ...middleware],
67272
- viewPath
67308
+ viewPath,
67309
+ segments: prefixSegments(routePath, segments)
67273
67310
  };
67274
67311
  }
67275
67312
  }
@@ -67281,10 +67318,6 @@ function createFlatViewRoutes(routes) {
67281
67318
  }));
67282
67319
  }
67283
67320
 
67284
- // services/router/ViewRouterServiceContainer.ts
67285
- var import_react = __toESM(require_react(), 1);
67286
- import { renderToReadableStream } from "react-dom/server.browser";
67287
-
67288
67321
  // ../../node_modules/.bun/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.js
67289
67322
  var Pe3 = Object.defineProperty;
67290
67323
  var a2 = (e2, t2) => Pe3(e2, "name", { value: t2, configurable: true });
@@ -68115,6 +68148,93 @@ var Y2 = class {
68115
68148
  };
68116
68149
  a2(Y2, "URLPattern");
68117
68150
 
68151
+ // services/router/matchViewRoute.ts
68152
+ function matchViewRoute(flatViewRoutes, pathname) {
68153
+ for (const [routePath, route] of Object.entries(flatViewRoutes)) {
68154
+ const pattern2 = new Y2({ pathname: routePath });
68155
+ if (pattern2.test({ pathname })) {
68156
+ return {
68157
+ routePath,
68158
+ params: pattern2.exec({ pathname })?.pathname.groups ?? {},
68159
+ route
68160
+ };
68161
+ }
68162
+ }
68163
+ return null;
68164
+ }
68165
+
68166
+ // services/router/planPartialRender.ts
68167
+ var NOTHING_SKIPPED = { startIndex: 0, carriedViews: [] };
68168
+ function resolve(segment, params) {
68169
+ const resolved = applyParams(segment.path, params);
68170
+ return resolved.includes("*") ? null : resolved;
68171
+ }
68172
+ function planPartialRender(from, to3) {
68173
+ if (!from) {
68174
+ return NOTHING_SKIPPED;
68175
+ }
68176
+ if (from.search !== to3.search) {
68177
+ return NOTHING_SKIPPED;
68178
+ }
68179
+ const limit = Math.min(from.segments.length, to3.segments.length - 1);
68180
+ let startIndex = 0;
68181
+ while (startIndex < limit) {
68182
+ const fromSegment = from.segments[startIndex];
68183
+ const toSegment = to3.segments[startIndex];
68184
+ if (toSegment.alwaysRun)
68185
+ break;
68186
+ if (fromSegment.viewPath !== toSegment.viewPath)
68187
+ break;
68188
+ const fromPath = resolve(fromSegment, from.params);
68189
+ const toPath = resolve(toSegment, to3.params);
68190
+ if (fromPath === null || toPath === null || fromPath !== toPath)
68191
+ break;
68192
+ startIndex++;
68193
+ }
68194
+ if (startIndex === 0) {
68195
+ return NOTHING_SKIPPED;
68196
+ }
68197
+ return {
68198
+ startIndex,
68199
+ carriedViews: to3.segments.slice(0, startIndex).map(({ viewPath }) => viewPath)
68200
+ };
68201
+ }
68202
+ function stripLocaleSegment(pathname, supportedLocales) {
68203
+ const [, maybeLocale, ...rest] = pathname.split("/");
68204
+ if (!supportedLocales.includes(maybeLocale)) {
68205
+ return pathname;
68206
+ }
68207
+ const stripped = `/${rest.join("/")}`;
68208
+ return stripped === "/" ? "/" : stripped.replace(/\/$/, "");
68209
+ }
68210
+ function resolvePartialRender(options) {
68211
+ const { flatViewRoutes, supportedLocales, from, origin, to: to3 } = options;
68212
+ if (!from) {
68213
+ return NOTHING_SKIPPED;
68214
+ }
68215
+ let url;
68216
+ try {
68217
+ url = new URL(from, origin);
68218
+ } catch {
68219
+ return NOTHING_SKIPPED;
68220
+ }
68221
+ if (url.origin !== origin) {
68222
+ return NOTHING_SKIPPED;
68223
+ }
68224
+ const match = matchViewRoute(flatViewRoutes, stripLocaleSegment(url.pathname, supportedLocales));
68225
+ if (!match) {
68226
+ return NOTHING_SKIPPED;
68227
+ }
68228
+ return planPartialRender({ segments: match.route.segments, params: match.params, search: url.search }, to3);
68229
+ }
68230
+
68231
+ // utils/partialRender.ts
68232
+ var PARTIAL_RENDER_HEADER = "x-gemi-from";
68233
+
68234
+ // services/router/ViewRouterServiceContainer.ts
68235
+ var import_react = __toESM(require_react(), 1);
68236
+ import { renderToReadableStream } from "react-dom/server.browser";
68237
+
68118
68238
  // services/router/createRouteManifest.ts
68119
68239
  function removeGroupPrefix2(input) {
68120
68240
  const withoutParentheses = input.replace(/\([^)]*\)/g, "");
@@ -68434,15 +68554,27 @@ class ViewRouterServiceContainer extends ServiceContainer {
68434
68554
  let middlewares = [];
68435
68555
  let currentPathName = null;
68436
68556
  let params = {};
68557
+ let partial = null;
68437
68558
  try {
68438
- for (const [pathname, handler] of Object.entries(this.flatViewRoutes)) {
68439
- const pattern2 = new Y2({ pathname });
68440
- if (pattern2.test({ pathname: urlPathname })) {
68441
- currentPathName = pathname;
68442
- params = pattern2.exec({ pathname: urlPathname })?.pathname.groups;
68443
- handlers = handler.exec;
68444
- middlewares = handler.middleware;
68445
- break;
68559
+ const match = matchViewRoute(this.flatViewRoutes, urlPathname);
68560
+ if (match) {
68561
+ currentPathName = match.routePath;
68562
+ params = match.params;
68563
+ handlers = match.route.exec;
68564
+ middlewares = match.route.middleware;
68565
+ if (isViewDataRequest && this.service.partialRendering) {
68566
+ const from = req.headers.get(PARTIAL_RENDER_HEADER);
68567
+ const plan = resolvePartialRender({
68568
+ flatViewRoutes: this.flatViewRoutes,
68569
+ supportedLocales: i18nServiceContainer.service.supportedLocales,
68570
+ from,
68571
+ origin: url.origin,
68572
+ to: { segments: match.route.segments, params, search: url.search }
68573
+ });
68574
+ if (plan.startIndex > 0) {
68575
+ handlers = handlers.slice(plan.startIndex);
68576
+ partial = { from, carriedViews: plan.carriedViews };
68577
+ }
68446
68578
  }
68447
68579
  }
68448
68580
  } catch (err2) {
@@ -68483,9 +68615,11 @@ class ViewRouterServiceContainer extends ServiceContainer {
68483
68615
  defaultLocale: i18nServiceContainer2.service.defaultLocale
68484
68616
  };
68485
68617
  }
68486
- const data = await Promise.all([
68487
- ...handlers.map((fn2) => fn2(httpRequest2)),
68488
- ...Array.from(ctx.prefetchPromiseQueue).map((fn2) => fn2())
68618
+ const handlerPromises = handlers.map((fn2) => fn2(httpRequest2));
68619
+ const prefetchPromises = Array.from(ctx.prefetchPromiseQueue).map((fn2) => fn2());
68620
+ const [data] = await Promise.all([
68621
+ Promise.all(handlerPromises),
68622
+ Promise.all(prefetchPromises)
68489
68623
  ]);
68490
68624
  const cookies = ctx.cookies;
68491
68625
  const headers = ctx.headers;
@@ -68529,10 +68663,11 @@ class ViewRouterServiceContainer extends ServiceContainer {
68529
68663
  }
68530
68664
  if (isViewDataRequest) {
68531
68665
  headers.set("Content-Type", "application/json; charset=utf-8");
68666
+ headers.append("Vary", PARTIAL_RENDER_HEADER);
68532
68667
  cookies.forEach((cookie) => headers.append("Set-Cookie", cookie.toString()));
68533
68668
  await this.service.onRequestEnd(httpRequest2);
68534
68669
  return new Response(JSON.stringify({
68535
- meta: pageData.meta,
68670
+ meta: partial && !ctx.metadata.touched ? null : pageData.meta,
68536
68671
  data: {
68537
68672
  [urlPathname]: viewData
68538
68673
  },
@@ -68540,7 +68675,8 @@ class ViewRouterServiceContainer extends ServiceContainer {
68540
68675
  prefetchedData: pageData.prefetchedData,
68541
68676
  i18n,
68542
68677
  is404: !currentPathName2,
68543
- appId: pageData.appId
68678
+ appId: pageData.appId,
68679
+ partial
68544
68680
  }), {
68545
68681
  headers
68546
68682
  });
@@ -68822,13 +68958,13 @@ function createWorker() {
68822
68958
  async function runInWorker(jobName, args) {
68823
68959
  const worker = createWorker();
68824
68960
  worker.postMessage({ jobName, args });
68825
- return await new Promise((resolve, reject) => {
68961
+ return await new Promise((resolve2, reject) => {
68826
68962
  worker.onmessage = (e2) => {
68827
68963
  const data = e2.data;
68828
68964
  if ("error" in data) {
68829
68965
  reject(data.error);
68830
68966
  } else {
68831
- resolve(data.result);
68967
+ resolve2(data.result);
68832
68968
  }
68833
68969
  };
68834
68970
  });
@@ -68857,7 +68993,7 @@ class QueueServiceContainer extends ServiceContainer {
68857
68993
  this.isRunning = true;
68858
68994
  }
68859
68995
  if (this.activeRunningJobsCount >= this.service.concurrency) {
68860
- await new Promise((resolve) => setTimeout(resolve, 1000));
68996
+ await new Promise((resolve2) => setTimeout(resolve2, 1000));
68861
68997
  return this.next();
68862
68998
  }
68863
68999
  const jobDefinition = this.queue.values().next().value;
@@ -69613,5 +69749,5 @@ program.command("app:route-manifest").action(async () => {
69613
69749
  });
69614
69750
  program.parse();
69615
69751
 
69616
- //# debugId=4F1ACECB8A1785DF64756E2164756E21
69752
+ //# debugId=971DE98EAA769ECD64756E2164756E21
69617
69753
  //# sourceMappingURL=gemi.js.map