@rsc-kit/mcp 0.30.47 → 0.30.49
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 +19 -4
- package/dist/recipes.js.map +1 -1
- package/guides/edge-caching.md +45 -0
- package/guides/go.md +58 -3
- package/guides/index.json +1 -1
- package/guides/installation.md +0 -1
- package/guides/isr.md +3 -1
- package/guides/laravel.md +87 -4
- package/guides/public-forms.md +77 -22
- package/guides/your-own-backend.md +9 -0
- package/package.json +2 -2
package/dist/recipes.js
CHANGED
|
@@ -696,7 +696,11 @@ 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;
|
|
697
697
|
changed(tag) makes the next request for a page that read that tag render, on
|
|
698
698
|
every instance, never stale. Kept in installCacheStore's store or 64 MB of
|
|
699
|
-
memory; off in dev, on Homeport, and with pageCache: false.
|
|
699
|
+
memory; off in dev, on Homeport, and with pageCache: false. Whether a CDN answered is its own
|
|
700
|
+
entry in Cache-Status (hit), never X-RSC-Kit, which is stored with the copy. Homeport's entry, named
|
|
701
|
+
homeport and last, comes with its next engine release: look for hit in that entry, not anywhere in
|
|
702
|
+
the header; stored is no proof, the next request's hit is. A static page, shell or asset hit has no
|
|
703
|
+
entry and says X-Homeport-Edge: page, shell or asset. A revalidate page calls its backend as nobody: no cookie, no
|
|
700
704
|
Authorization, and a cookie the backend sets is dropped - do NOT export it on
|
|
701
705
|
a page that shows who is signed in. Otherwise the page is sent private,
|
|
702
706
|
no-store with Cache-Status: rsc-kit; fwd=bypass; detail=<reason> (cookies,
|
|
@@ -2909,9 +2913,20 @@ passed. A refusal handle() decides goes under its field:
|
|
|
2909
2913
|
import { fieldErrors } from '@rsc-kit/core/action'
|
|
2910
2914
|
if (await subscribed(email)) fieldErrors({ email: 'Already on the list.' })
|
|
2911
2915
|
|
|
2912
|
-
A BACKEND
|
|
2913
|
-
|
|
2914
|
-
(
|
|
2916
|
+
A BACKEND, WITH NO SCHEMA: defineForm({ name, action: contactSend, theme }),
|
|
2917
|
+
with contactSend imported from the generated server-actions module - the
|
|
2918
|
+
action itself, never its name as a string (a string throws). No form, no
|
|
2919
|
+
handle, no zod. bunx rsc-kit make:form contactSend writes forms/contact.ts.
|
|
2920
|
+
The action is a Laravel class in app/Rsc/Actions (Contact::send is
|
|
2921
|
+
contactSend; a class in app/Rsc is rpc only and has no action) or Go's
|
|
2922
|
+
reg.HandleAction("contactSend", "Contact.send", fn). Fields and browser checks
|
|
2923
|
+
come from what it takes (rsc-host.json): a Laravel FormRequest's rules(), or a
|
|
2924
|
+
Go struct, whose validate tags are read as hints and never run, so the Go
|
|
2925
|
+
function must still check. It takes one object; a file needs form and handle.
|
|
2926
|
+
A 422 from Laravel (a FormRequest type-hinted on the method, whose authorize()
|
|
2927
|
+
returns true) or Go (rsckit.InvalidField) lands under the same fields,
|
|
2928
|
+
uncaught. To check in TypeScript first, keep a schema and
|
|
2929
|
+
handle: (values) => contactSend(values).
|
|
2915
2930
|
|
|
2916
2931
|
THE BOT TRAP: every form carries a hidden field named homepage. Filled in, the
|
|
2917
2932
|
submission is answered as a success and dropped - handle() never runs. So a
|