A Vite plugin for creating server functions with automatic Remote Procedure Calls generation.
- File-level server code isolation without using directives like
'use server' - System wide configuration via vite style config file
- Automatic RPC generation for server functions
- Server-side caching with single-flight requests
- Flexible middleware system with hooks support and adapters for
express,fastifyandhono - Framework agnostic
- TypeScript support
| Example | Source Code | Try online |
|---|---|---|
| SPA - node:http | SPA | StackBlitz |
| Express | Express | StackBlitz |
| Fastify | Fastify | StackBlitz |
| Hono | Hono | StackBlitz |
npm install vite-uni-rpc@latestpnpm add vite-uni-rpc@latestPlease refer to the Wiki for guides on installation, configuration and usage.
- Add/update examples examples
- Add SPA support
- Add wiki
- Test bun
- Add
contentTypeoption tocreateServerFunction, currently supporting:application/json,text/plain; - Add koa adapter
- Add Github tooling/workflows
- Add tests
This project is inspired by vite-dev-rpc.
Released under MIT.