@rsc-kit/mcp 0.30.52 → 0.30.54

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/dist/recipes.js CHANGED
@@ -689,8 +689,8 @@ cache(fn, { tags }) answer it used go out as Cache-Tag: posts,post:1, for a
689
689
  CDN that purges by tag. changed(tag) calls the purge installed with
690
690
  installPurge(async ({ tags }) => ...) from @rsc-kit/core/purge, after the
691
691
  answer has gone - one hook, any CDN's API; a failure is logged, never fails
692
- the change. On Homeport (HOMEPORT_PURGE_URL set) it is homeportPurge() with
693
- nothing to install. Rsc::changed() and reg.Changed() post their own purge
692
+ the change. With RSC_PURGE_URL set it is homeportPurge() with nothing to install; on
693
+ Homeport, which sets HOMEPORT_PURGE_URL, that is read when RSC_PURGE_URL is not. Rsc::changed() and reg.Changed() post their own purge
694
694
  there, since a backend's change never passes through the engine. The host also keeps the page itself - ISR on every host: a
695
695
  repeat request is answered from the kept copy (X-RSC-Kit: cached, Age); past
696
696
  revalidate the stale copy goes out at once while one render replaces it;
@@ -1738,6 +1738,14 @@ BAP vs Inertia for a Laravel team: read_guide bap-vs-inertia.
1738
1738
  A backend in another language answers that ONE endpoint, POST /__rsc/host-call,
1739
1739
  and the renderer wires itself from two variables in .env: RSC_BACKEND (a
1740
1740
  Laravel app's APP_URL counts) and RSC_HOST_CALL_SECRET. Both or neither.
1741
+ A refused connection is tried again for up to 2s (nothing was sent, so nothing
1742
+ runs twice): a backend started beside the renderer may come up second. Nothing
1743
+ else is retried.
1744
+ RSC_BACKEND_HEADERS={"X-Preview-Token":"..."} (JSON object) puts fixed headers
1745
+ on every request to RSC_BACKEND, host calls and forwarded urls alike, never to
1746
+ another origin; read once at startup; malformed stops the server, naming the
1747
+ variable but not the value. For a platform that admits the renderer by a
1748
+ header (a private preview).
1741
1749
 
1742
1750
  A url the route tree does not own goes to the backend (/login, a webhook, an
1743
1751
  OAuth callback). One that it DOES match does not: a dynamic root route such as
@@ -1747,7 +1755,11 @@ app's 404 (and sign-in looped) - Laravel's /login and /auth/* as much as Go's
1747
1755
  when the renderer is in front. Name the backend's prefixes, and they are
1748
1756
  forwarded BEFORE any page is asked: rscKit({ backendPaths: ['/auth', '/github',
1749
1757
  '/gitlab'] }). A prefix at a segment boundary (/auth, not /authors), every
1750
- method; '/' and /_rsc are refused; a team called auth is then unreachable. Do NOT
1758
+ method; '/', /_rsc and the host-call endpoint (/__rsc/host-call) are refused; a
1759
+ team called auth is then unreachable. The build lists them as backendPaths in
1760
+ .output/rsc-kit.json ([] when none), so a proxy in front sends them straight to
1761
+ the backend instead of through the renderer. The renderer never forwards a
1762
+ browser's request for the host-call endpoint: it answers with its not-found page. Do NOT
1751
1763
  write catch-all route.ts files that forward by hand: that copies the forwarding.
1752
1764
  A named prefix is also a DOCUMENT LOAD in the browser, never a page: a Link,
1753
1765
  visit() or redirect('/gitlab/connect') to it loads the document and is
@@ -2188,7 +2200,10 @@ PRODUCTION - in the platform's environment settings, never in git:
2188
2200
  - read at runtime, so one build deploys anywhere (except the action key).
2189
2201
 
2190
2202
  ROTATING is a deploy:
2191
- - host-call: change renderer and backend together; between them every rpc() is refused.
2203
+ - host-call: the backend first. Give it the new value and the old one as
2204
+ RSC_HOST_CALL_SECRET_PREVIOUS (it answers either), then the renderer the new
2205
+ value, then remove RSC_HOST_CALL_SECRET_PREVIOUS. No call is refused. Before
2206
+ core 0.30.54 / go v0.17.0 / laravel 0.21, change both together.
2192
2207
  - signing: open pages stop refreshing until reloaded; nothing else breaks.
2193
2208
  - action key: actions from pages loaded before the change fail.
2194
2209