@valbuild/server 0.154.1 → 0.154.2

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 (58) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/browser/dist/valbuild-server-browser.cjs.dev.js +6 -3
  3. package/browser/dist/valbuild-server-browser.cjs.prod.js +6 -3
  4. package/browser/dist/valbuild-server-browser.esm.js +6 -3
  5. package/dist/{ValRouterCore-be314bc7.esm.js → ValOpsMemory-611f33d2.esm.js} +14 -1992
  6. package/dist/{ValRouterCore-cfb35067.cjs.prod.js → ValOpsMemory-6ebbb3ba.cjs.prod.js} +23 -2013
  7. package/dist/{ValRouterCore-361673dc.cjs.dev.js → ValOpsMemory-d8bf9f5d.cjs.dev.js} +23 -2013
  8. package/dist/ValPatchStore-2f92eced.cjs.prod.js +1128 -0
  9. package/dist/ValPatchStore-df8cdbe7.cjs.dev.js +1128 -0
  10. package/dist/ValPatchStore-e23070df.esm.js +1119 -0
  11. package/dist/ValRouterCore-5b747abb.cjs.prod.js +612 -0
  12. package/dist/ValRouterCore-73eb843d.esm.js +608 -0
  13. package/dist/ValRouterCore-86757d56.cjs.dev.js +612 -0
  14. package/dist/createPrettierFormatter-05ad7480.cjs.prod.js +692 -0
  15. package/dist/createPrettierFormatter-1edca494.esm.js +673 -0
  16. package/dist/createPrettierFormatter-851fcf99.cjs.dev.js +692 -0
  17. package/dist/createValRuntime-2dc83070.cjs.prod.js +47 -0
  18. package/dist/createValRuntime-62836dbe.esm.js +45 -0
  19. package/dist/createValRuntime-fd9b673d.cjs.dev.js +47 -0
  20. package/dist/declarations/src/ValOpsMemory.d.ts +3 -73
  21. package/dist/declarations/src/ValPatchStore.d.ts +92 -0
  22. package/dist/declarations/src/ValRouter.d.ts +1 -11
  23. package/dist/declarations/src/createPrettierFormatter.d.ts +18 -3
  24. package/dist/declarations/src/createValRuntime.d.ts +12 -0
  25. package/dist/declarations/src/draftReads.d.ts +11 -3
  26. package/dist/declarations/src/index.d.ts +4 -2
  27. package/dist/declarations/src/internal/index.d.ts +28 -6
  28. package/dist/declarations/src/proposal.d.ts +13 -25
  29. package/dist/declarations/src/proposalJsonEntries.d.ts +30 -0
  30. package/dist/declarations/src/serverMode.d.ts +31 -0
  31. package/dist/{draftReads-0dcddf72.cjs.prod.js → draftReads-3f7dcda5.cjs.prod.js} +10 -2
  32. package/dist/{draftReads-df44e629.cjs.dev.js → draftReads-a300a02f.cjs.dev.js} +10 -2
  33. package/dist/{draftReads-1f29aedd.esm.js → draftReads-bca0d49c.esm.js} +10 -2
  34. package/dist/{inTabFetch-56226d62.cjs.prod.js → inTabFetch-0124da2e.cjs.prod.js} +5 -4
  35. package/dist/{inTabFetch-5d0314a3.cjs.dev.js → inTabFetch-d0c9c58a.cjs.dev.js} +5 -4
  36. package/dist/{inTabFetch-7c8a5628.esm.js → inTabFetch-e48a801e.esm.js} +2 -1
  37. package/dist/jsonValuesPatch-13acc674.esm.js +276 -0
  38. package/dist/jsonValuesPatch-88bc661d.cjs.dev.js +281 -0
  39. package/dist/jsonValuesPatch-92798812.cjs.prod.js +281 -0
  40. package/dist/proposalJsonEntries-0669f027.esm.js +480 -0
  41. package/dist/proposalJsonEntries-26f397bd.cjs.dev.js +500 -0
  42. package/dist/proposalJsonEntries-9e537244.cjs.prod.js +500 -0
  43. package/dist/{publishKit-5a8c9a0d.cjs.dev.js → publishKit-96522d5a.cjs.prod.js} +20 -22
  44. package/dist/{publishKit-707230bc.cjs.prod.js → publishKit-b06031dc.cjs.dev.js} +20 -22
  45. package/dist/{publishKit-b850045b.esm.js → publishKit-b8929fe8.esm.js} +8 -9
  46. package/dist/{ValRouter-9505c550.cjs.dev.js → valRuntime-ba8ff718.cjs.prod.js} +158 -6038
  47. package/dist/{ValRouter-31f89baf.cjs.prod.js → valRuntime-c8c82b24.cjs.dev.js} +158 -6038
  48. package/dist/{ValRouter-b7dc784d.esm.js → valRuntime-ccbbbfad.esm.js} +107 -5937
  49. package/dist/valbuild-server.cjs.dev.js +5146 -352
  50. package/dist/valbuild-server.cjs.prod.js +5146 -352
  51. package/dist/valbuild-server.esm.js +4902 -132
  52. package/internal/browser/dist/valbuild-server-internal-browser.cjs.dev.js +7 -4
  53. package/internal/browser/dist/valbuild-server-internal-browser.cjs.prod.js +7 -4
  54. package/internal/browser/dist/valbuild-server-internal-browser.esm.js +7 -4
  55. package/internal/dist/valbuild-server-internal.cjs.dev.js +47 -31
  56. package/internal/dist/valbuild-server-internal.cjs.prod.js +47 -31
  57. package/internal/dist/valbuild-server-internal.esm.js +38 -22
  58. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @valbuild/server
2
2
 
3
+ ## 0.154.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1087](https://github.com/valbuild/val/pull/1087) [`9e085bc`](https://github.com/valbuild/val/commit/9e085bc2b2104ce2644b4a14948288c799a2ce82) Thanks [@freekh](https://github.com/freekh)! - **A published page no longer loads the Studio, TypeScript, sucrase or prettier.** A site's first request in a fresh server process (on Val's hosting, every request a cold isolate answers) used to evaluate all of Val's server: the Studio's embedded assets (about 22 MB), TypeScript (9 MB), sucrase and the MCP tools. A page only needs that when someone edits it. These now load when they are first used, by the Val API, a draft read, a save or an MCP call, and a visitor's page never loads them.
8
+
9
+ We measured this in a fresh Node process, with the TanStack example app built the way a deployed app is built and running as a deployed site does (`http` mode). The first request for a public page used to load 38.8 MB of modules, take about 1.06 s and leave 170 MB of heap in use. It now loads 5.3 MB, takes about 0.23 s and leaves 38 MB of heap. An isolate counts more than Node does, so treat these heap figures as a lower bound.
10
+
11
+ What changed for an app:
12
+
13
+ - `initValContent` (and `initValRsc` in `@valbuild/next`) no longer start Val's server when they are created. They start it on the first draft read.
14
+ - With TanStack Start, `initValServer` loads the server on its first request in `http` mode, which is what a deployed site runs in. In local development (`fs` mode) and memory mode it still starts with the app. Those modes need the newest build in a process to exist before the previous build answers a request.
15
+ - `initValMcp` from `@valbuild/tanstack/server` loads the MCP tools on the first MCP request. Its `valMcpMetadata` comes from the new `@valbuild/mcp/metadata` entry, which is small.
16
+ - `createPrettierFormatter` now also accepts a loader. **Update your `val.server.ts`** so prettier is loaded by the first save rather than by every page:
17
+
18
+ ```ts
19
+ // before
20
+ import prettier from "prettier";
21
+ formatter: createPrettierFormatter(prettier, { projectRoot: process.cwd() }),
22
+
23
+ // after
24
+ formatter: createPrettierFormatter(() => import("prettier"), {
25
+ projectRoot: process.cwd(),
26
+ }),
27
+ ```
28
+
29
+ Passing `prettier` itself still works.
30
+
31
+ - If your app serves MCP from a TanStack Start route, import the MCP SDK inside the handler (`await import("@modelcontextprotocol/server")`), not at the top of the file. TanStack Start's route tree imports every server route's module on every cold start.
32
+
33
+ - Updated dependencies [[`d90b9e2`](https://github.com/valbuild/val/commit/d90b9e2f856d4023821698cd22b4fbbab046c2ff), [`a52c184`](https://github.com/valbuild/val/commit/a52c184687849ba9c2c2a4929871b60502a6ee55), [`6c26409`](https://github.com/valbuild/val/commit/6c2640966779e20931672dc78ff6e3c0d19e4183), [`d90b9e2`](https://github.com/valbuild/val/commit/d90b9e2f856d4023821698cd22b4fbbab046c2ff)]:
34
+ - @valbuild/core@0.154.2
35
+ - @valbuild/shared@0.154.2
36
+ - @valbuild/ui@0.154.2
37
+
3
38
  ## 0.154.1
4
39
 
5
40
  ### Patch Changes
@@ -2,15 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var inTabFetch = require('../../dist/inTabFetch-5d0314a3.cjs.dev.js');
5
+ var inTabFetch = require('../../dist/inTabFetch-d0c9c58a.cjs.dev.js');
6
6
  require('@valbuild/core');
7
- require('../../dist/ValRouterCore-361673dc.cjs.dev.js');
7
+ require('../../dist/ValOpsMemory-d8bf9f5d.cjs.dev.js');
8
8
  require('zod');
9
9
  require('@valbuild/shared/internal');
10
- require('zod-validation-error');
10
+ require('../../dist/jsonValuesPatch-88bc661d.cjs.dev.js');
11
11
  require('@valbuild/core/fp');
12
+ require('zod-validation-error');
13
+ require('../../dist/ValPatchStore-df8cdbe7.cjs.dev.js');
12
14
  require('@valbuild/core/patch');
13
15
  require('image-size');
16
+ require('../../dist/ValRouterCore-86757d56.cjs.dev.js');
14
17
 
15
18
 
16
19
 
@@ -2,15 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var inTabFetch = require('../../dist/inTabFetch-56226d62.cjs.prod.js');
5
+ var inTabFetch = require('../../dist/inTabFetch-0124da2e.cjs.prod.js');
6
6
  require('@valbuild/core');
7
- require('../../dist/ValRouterCore-cfb35067.cjs.prod.js');
7
+ require('../../dist/ValOpsMemory-6ebbb3ba.cjs.prod.js');
8
8
  require('zod');
9
9
  require('@valbuild/shared/internal');
10
- require('zod-validation-error');
10
+ require('../../dist/jsonValuesPatch-92798812.cjs.prod.js');
11
11
  require('@valbuild/core/fp');
12
+ require('zod-validation-error');
13
+ require('../../dist/ValPatchStore-2f92eced.cjs.prod.js');
12
14
  require('@valbuild/core/patch');
13
15
  require('image-size');
16
+ require('../../dist/ValRouterCore-5b747abb.cjs.prod.js');
14
17
 
15
18
 
16
19
 
@@ -1,9 +1,12 @@
1
- export { c as createInTabValFetch } from '../../dist/inTabFetch-7c8a5628.esm.js';
1
+ export { c as createInTabValFetch } from '../../dist/inTabFetch-e48a801e.esm.js';
2
2
  import '@valbuild/core';
3
- import '../../dist/ValRouterCore-be314bc7.esm.js';
3
+ import '../../dist/ValOpsMemory-611f33d2.esm.js';
4
4
  import 'zod';
5
5
  import '@valbuild/shared/internal';
6
- import 'zod-validation-error';
6
+ import '../../dist/jsonValuesPatch-13acc674.esm.js';
7
7
  import '@valbuild/core/fp';
8
+ import 'zod-validation-error';
9
+ import '../../dist/ValPatchStore-e23070df.esm.js';
8
10
  import '@valbuild/core/patch';
9
11
  import 'image-size';
12
+ import '../../dist/ValRouterCore-73eb843d.esm.js';