Open doseofted opened 8 months ago
Latest commit: e2879a94ecda0804a330ac048cc9f46885449672
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
prim-rpc | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Mar 4, 2024 3:40pm |
This plugin allows server-side functions to be replaced with RPC on the client and moved to a new module on the server. It integrates with an existing Prim+RPC server/client and will work with your existing server/client frameworks and the build tool of your choice.
This is the Prim+RPC take on "server actions" or "data loaders/actions" in frameworks like Next.js, Solid Start, Qwik, and others. An example of what this feature will look like:
A few key points:
"inline"
will be transformedwith { type: "rpc" }
to clarify for other developers that an imported function will be transformed into an RPC.Prim+RPC is still intended to be used without a compiler step in most cases: having a separate server and client generally results in better structured code, fewer chances to expose sensitive information, and easier review. The compiler step will be optional.
But sometimes inline RPC can be useful: prototyping, reducing the payload of a server result, other app-specific logic that doesn't need to be part of an API itself.