@valbuild/server 0.154.0 → 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.
- package/CHANGELOG.md +49 -0
- package/browser/dist/valbuild-server-browser.cjs.dev.js +6 -3
- package/browser/dist/valbuild-server-browser.cjs.prod.js +6 -3
- package/browser/dist/valbuild-server-browser.esm.js +6 -3
- package/dist/{ValRouterCore-fe985e4c.esm.js → ValOpsMemory-611f33d2.esm.js} +44 -1988
- package/dist/{ValRouterCore-4be8eaf1.cjs.prod.js → ValOpsMemory-6ebbb3ba.cjs.prod.js} +53 -2009
- package/dist/{ValRouterCore-0c088c9e.cjs.dev.js → ValOpsMemory-d8bf9f5d.cjs.dev.js} +53 -2009
- package/dist/ValPatchStore-2f92eced.cjs.prod.js +1128 -0
- package/dist/ValPatchStore-df8cdbe7.cjs.dev.js +1128 -0
- package/dist/ValPatchStore-e23070df.esm.js +1119 -0
- package/dist/ValRouterCore-5b747abb.cjs.prod.js +612 -0
- package/dist/ValRouterCore-73eb843d.esm.js +608 -0
- package/dist/ValRouterCore-86757d56.cjs.dev.js +612 -0
- package/dist/createPrettierFormatter-05ad7480.cjs.prod.js +692 -0
- package/dist/createPrettierFormatter-1edca494.esm.js +673 -0
- package/dist/createPrettierFormatter-851fcf99.cjs.dev.js +692 -0
- package/dist/createValRuntime-2dc83070.cjs.prod.js +47 -0
- package/dist/createValRuntime-62836dbe.esm.js +45 -0
- package/dist/createValRuntime-fd9b673d.cjs.dev.js +47 -0
- package/dist/declarations/src/ValOpsMemory.d.ts +3 -73
- package/dist/declarations/src/ValPatchStore.d.ts +92 -0
- package/dist/declarations/src/ValRouter.d.ts +1 -11
- package/dist/declarations/src/createPrettierFormatter.d.ts +18 -3
- package/dist/declarations/src/createValRuntime.d.ts +12 -0
- package/dist/declarations/src/draftReads.d.ts +11 -3
- package/dist/declarations/src/index.d.ts +4 -2
- package/dist/declarations/src/internal/index.d.ts +28 -6
- package/dist/declarations/src/proposal.d.ts +13 -25
- package/dist/declarations/src/proposalJsonEntries.d.ts +30 -0
- package/dist/declarations/src/serverMode.d.ts +31 -0
- package/dist/{draftReads-0dcddf72.cjs.prod.js → draftReads-3f7dcda5.cjs.prod.js} +10 -2
- package/dist/{draftReads-df44e629.cjs.dev.js → draftReads-a300a02f.cjs.dev.js} +10 -2
- package/dist/{draftReads-1f29aedd.esm.js → draftReads-bca0d49c.esm.js} +10 -2
- package/dist/{inTabFetch-f6694ad2.cjs.prod.js → inTabFetch-0124da2e.cjs.prod.js} +5 -4
- package/dist/{inTabFetch-c8966e73.cjs.dev.js → inTabFetch-d0c9c58a.cjs.dev.js} +5 -4
- package/dist/{inTabFetch-877e7d11.esm.js → inTabFetch-e48a801e.esm.js} +2 -1
- package/dist/jsonValuesPatch-13acc674.esm.js +276 -0
- package/dist/jsonValuesPatch-88bc661d.cjs.dev.js +281 -0
- package/dist/jsonValuesPatch-92798812.cjs.prod.js +281 -0
- package/dist/proposalJsonEntries-0669f027.esm.js +480 -0
- package/dist/proposalJsonEntries-26f397bd.cjs.dev.js +500 -0
- package/dist/proposalJsonEntries-9e537244.cjs.prod.js +500 -0
- package/dist/{publishKit-cfe1273d.cjs.dev.js → publishKit-96522d5a.cjs.prod.js} +20 -22
- package/dist/{publishKit-e7f7db7c.cjs.prod.js → publishKit-b06031dc.cjs.dev.js} +20 -22
- package/dist/{publishKit-0709423c.esm.js → publishKit-b8929fe8.esm.js} +8 -9
- package/dist/{ValRouter-1f427c38.cjs.dev.js → valRuntime-ba8ff718.cjs.prod.js} +158 -6038
- package/dist/{ValRouter-cd6e854a.cjs.prod.js → valRuntime-c8c82b24.cjs.dev.js} +158 -6038
- package/dist/{ValRouter-558dc66d.esm.js → valRuntime-ccbbbfad.esm.js} +107 -5937
- package/dist/valbuild-server.cjs.dev.js +5146 -352
- package/dist/valbuild-server.cjs.prod.js +5146 -352
- package/dist/valbuild-server.esm.js +4902 -132
- package/internal/browser/dist/valbuild-server-internal-browser.cjs.dev.js +7 -4
- package/internal/browser/dist/valbuild-server-internal-browser.cjs.prod.js +7 -4
- package/internal/browser/dist/valbuild-server-internal-browser.esm.js +7 -4
- package/internal/dist/valbuild-server-internal.cjs.dev.js +47 -31
- package/internal/dist/valbuild-server-internal.cjs.prod.js +47 -31
- package/internal/dist/valbuild-server-internal.esm.js +38 -22
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
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
|
+
|
|
38
|
+
## 0.154.1
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- [#1072](https://github.com/valbuild/val/pull/1072) [`def1434`](https://github.com/valbuild/val/commit/def1434324a0b3e26202148cb11726e02bd5bffe) Thanks [@freekh](https://github.com/freekh)! - The assistant's code tools answer faster in a proposal.
|
|
43
|
+
|
|
44
|
+
- **Reading costs no request after the first.** The Studio keeps the proposal's project in the tab for the life of the chat, instead of fetching the site's source and the proposal's files again for every `read_file`, `search_code`, `list_files`, `edit_file`, `format_files` and `lint`. It is read again when someone changes the proposal, when the site is published, and after the assistant's own changes.
|
|
45
|
+
- **A change is one or two requests instead of four.** `edit_file`, `write_files`, `format_files` and `lint` with `fix` no longer ask whether code mode is on before each write: Val's server already refuses a write while it is off, and the assistant is still told who turned it off. Before a file is edited, the Studio asks what the proposal stages now, so a change someone else made to it is edited rather than overwritten.
|
|
46
|
+
- **A change does not wait for the schema to be re-read unless it can change it.** Only a write to a `.val.ts`, `val.modules.ts`, `val.config.ts` or a file they import waits for the Studio to evaluate the Val modules. A component, a stylesheet or a route is answered at once, and several edits in one reply are evaluated together rather than one after another.
|
|
47
|
+
|
|
48
|
+
- Updated dependencies [[`37e4f39`](https://github.com/valbuild/val/commit/37e4f390d1fd6a930488c9487de43f8c1a390122), [`245843e`](https://github.com/valbuild/val/commit/245843ec527212dc31c6e1da1f0bd5f9d99cf8d3), [`d4e514f`](https://github.com/valbuild/val/commit/d4e514f9eac2f014fc07aa768787d637898dc744), [`def1434`](https://github.com/valbuild/val/commit/def1434324a0b3e26202148cb11726e02bd5bffe), [`82c641c`](https://github.com/valbuild/val/commit/82c641ca00ddfe1ed5b07b9ccb5ee39b0c6f102e)]:
|
|
49
|
+
- @valbuild/ui@0.154.1
|
|
50
|
+
- @valbuild/shared@0.154.1
|
|
51
|
+
|
|
3
52
|
## 0.154.0
|
|
4
53
|
|
|
5
54
|
### Patch Changes
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var inTabFetch = require('../../dist/inTabFetch-
|
|
5
|
+
var inTabFetch = require('../../dist/inTabFetch-d0c9c58a.cjs.dev.js');
|
|
6
6
|
require('@valbuild/core');
|
|
7
|
-
require('../../dist/
|
|
7
|
+
require('../../dist/ValOpsMemory-d8bf9f5d.cjs.dev.js');
|
|
8
8
|
require('zod');
|
|
9
9
|
require('@valbuild/shared/internal');
|
|
10
|
-
require('
|
|
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-
|
|
5
|
+
var inTabFetch = require('../../dist/inTabFetch-0124da2e.cjs.prod.js');
|
|
6
6
|
require('@valbuild/core');
|
|
7
|
-
require('../../dist/
|
|
7
|
+
require('../../dist/ValOpsMemory-6ebbb3ba.cjs.prod.js');
|
|
8
8
|
require('zod');
|
|
9
9
|
require('@valbuild/shared/internal');
|
|
10
|
-
require('
|
|
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-
|
|
1
|
+
export { c as createInTabValFetch } from '../../dist/inTabFetch-e48a801e.esm.js';
|
|
2
2
|
import '@valbuild/core';
|
|
3
|
-
import '../../dist/
|
|
3
|
+
import '../../dist/ValOpsMemory-611f33d2.esm.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '@valbuild/shared/internal';
|
|
6
|
-
import '
|
|
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';
|