@rsc-kit/mcp 0.20.11 → 0.20.12

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.
@@ -58,7 +58,7 @@ generation](/guides/static-generation).
58
58
  With the Bun preset the whole application ends up in one file:
59
59
 
60
60
  ```bash
61
- npm run compile # builds, then bun build --compile
61
+ npm run compile # builds, then bun build --compile --keep-names
62
62
  ./dist/app
63
63
  ```
64
64
 
@@ -170,7 +170,7 @@ runs](/hosts/where-it-runs).
170
170
  "dev": "bun --bun vite",
171
171
  "build": "bun --bun vite build",
172
172
  "start": "bun .output/server/index.mjs",
173
- "compile": "bun --bun vite build && bun build --compile .output/server/compile.mjs --outfile dist/app"
173
+ "compile": "bun --bun vite build && bun build --compile --keep-names .output/server/compile.mjs --outfile dist/app"
174
174
  }
175
175
  }
176
176
  ```
package/guides/ppr.md CHANGED
@@ -51,6 +51,25 @@ the page's title and description into the head when it serves the shell for
51
51
  a url it does know; the client sets the title again after hydration. Static
52
52
  `metadata` on the page and the layouts is in the shell as always.
53
53
 
54
+ ## A shell and the server that finishes it are one build
55
+
56
+ A postponed state names the components React has to find when it replays, and
57
+ a name is whatever that build's minifier assigned. Resumed against a different
58
+ bundle, the same component answers to something else:
59
+
60
+ ```text
61
+ Expected the resume to render <J> in this slot but instead it rendered <J2>.
62
+ ```
63
+
64
+ Two names for one component is the fingerprint of two builds. Every shell is
65
+ stamped with the build that froze it, and a host that finds a shell from
66
+ another build serves it but renders the page whole instead of resuming it,
67
+ with a line in the log saying so.
68
+
69
+ How they drift apart in practice: a Docker layer, a CI cache or a volume that
70
+ keeps a previous prerender output while the server bundle is rebuilt. Build
71
+ both together, or clear the output directory between builds.
72
+
54
73
  ## A shell for a pattern is one shape
55
74
 
56
75
  A route with params that listed no urls is frozen **once**, for the pattern —
@@ -65,7 +65,7 @@ Bun only, and the whole application ends up inside one file — engine, route
65
65
  tree, frozen pages and assets, the precompressed variants included:
66
66
 
67
67
  ```bash
68
- npm run compile # builds, then bun build --compile .output/server/compile.mjs
68
+ npm run compile # builds, then bun build --compile --keep-names .output/server/compile.mjs
69
69
  ./dist/app
70
70
  ```
71
71
 
@@ -82,7 +82,22 @@ a binary one version behind the source with nothing to say so — and on a
82
82
  project that has never been built, an `ENOENT` naming a path the app did not
83
83
  write.
84
84
 
85
- `--compile` implies `--production`; `--target bun` is the default. `--bytecode`
85
+ **`--keep-names` is not optional.** `--compile` implies `--production`, which
86
+ minifies — and minifying renames every function. A partially prerendered page
87
+ is finished by replaying a tree the build recorded by component *name*, so a
88
+ binary that renamed them finds the wrong name in every slot:
89
+
90
+ ```text
91
+ Expected the resume to render <J> in this slot but instead it rendered <J2>.
92
+ ```
93
+
94
+ React then falls back to client rendering for every hole, and the page arrives
95
+ looking finished with nothing wired up. `--keep-names` preserves the names the
96
+ build recorded, and costs a few kilobytes. A build with no PPR route never
97
+ notices; one with them fails only on a cold load, in production, which is the
98
+ worst way to find out.
99
+
100
+ `--target bun` is the default. `--bytecode`
86
101
  compiles the JavaScript ahead of time for a faster cold start at the cost
87
102
  of a larger binary — a production port measured 275 ms → 72 ms to the first
88
103
  healthy response for 81 MB → 117 MB, and left it out, since on a pod the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsc-kit/mcp",
3
- "version": "0.20.11",
3
+ "version": "0.20.12",
4
4
  "description": "An MCP server over what an rsc-kit build decided: the routes, why each one is static or not, and what it costs the browser.",
5
5
  "type": "module",
6
6
  "license": "MIT",