@decocms/tanstack 7.69.0 → 7.69.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/tanstack",
3
- "version": "7.69.0",
3
+ "version": "7.69.1",
4
4
  "type": "module",
5
5
  "description": "Deco framework binding for TanStack Start + Cloudflare Workers",
6
6
  "repository": {
@@ -27,9 +27,9 @@
27
27
  "lint:unused": "knip"
28
28
  },
29
29
  "dependencies": {
30
- "@decocms/blocks": "7.69.0",
31
- "@decocms/blocks-admin": "7.69.0",
32
- "@decocms/blocks-cli": "7.69.0",
30
+ "@decocms/blocks": "7.69.1",
31
+ "@decocms/blocks-admin": "7.69.1",
32
+ "@decocms/blocks-cli": "7.69.1",
33
33
  "@deco-cx/warp-node": "^0.3.16",
34
34
  "fast-json-patch": "^3.1.0",
35
35
  "ws": "^8.18.0"
@@ -219,7 +219,7 @@ export interface SegmentKey {
219
219
  * (not pulled into the client Vite build).
220
220
  */
221
221
  export interface AdminHandlers {
222
- handleMeta: (request: Request) => Response;
222
+ handleMeta: (request: Request) => Response | Promise<Response>;
223
223
  handleDecofileRead: () => Response;
224
224
  handleDecofileReload: (request: Request) => Response | Promise<Response>;
225
225
  handleRender: (request: Request) => Response | Promise<Response>;
@@ -282,6 +282,26 @@ export function decoVitePlugin({ fastDeploy = "auto" } = {}) {
282
282
  // backward-compatible sites that haven't regenerated).
283
283
  }
284
284
 
285
+ // meta.gen.json — the admin JSON Schema bundle, on the SERVER.
286
+ //
287
+ // Vite's JSON plugin would turn it into an object literal, which V8 must
288
+ // run through the full JS parser. Emitting `JSON.parse("...")` instead
289
+ // (same treatment blocks.gen gets, and the same reason) uses V8's fast
290
+ // JSON parser and — the part that matters for memory — keeps the schema
291
+ // as ONE string until something actually calls the parse. Since
292
+ // `createAdminSetup` now only invokes its loader on the first
293
+ // `/live/_meta`, an isolate that never serves the admin never
294
+ // materializes the object graph at all.
295
+ //
296
+ // The client is stubbed in `resolveId` above and never reaches here.
297
+ if (id.endsWith("meta.gen.json") && options?.ssr) {
298
+ if (existsSync(id)) {
299
+ const raw = readFileSync(id, "utf-8");
300
+ return `export default JSON.parse(${JSON.stringify(raw)});`;
301
+ }
302
+ // Absent (pre-generate-schema) — let Vite report it normally.
303
+ }
304
+
285
305
  // loaders.gen.ts — the site's invoke registry (`export const siteLoaders`).
286
306
  // It registers every site loader/action behind a dynamic `import()`, so if
287
307
  // it stays in the CLIENT module graph (it's reachable via