Skip to content

bogeeee/RPCFrameworksComparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

RPC frameworks comparison

Not included (TODO: ts-rest | gRPC | Deepkit RPC | Blitz RPC | Remult Backend methods | Phero)

Common

Restfuncs Telefunc tRPC wildcard
Comment Uses server side transformers. Aimed for a quick jump in / less config. Specially tailored for certain frameworks. Uses server side and client side transformers. Widely used, many 3rd party integrations. Also has additional higher level execution plans (links / queries / mutations) to reduce the number of calls but that goes beyond this comparison. Precedent of telefunc. Not maintained anymore.
Your service is defined as a class module t.router({ ...}) declaration by adding functions to the server object
End-to-end-type safety (compile time) ❌*
Function declarations are in native language style (see examples)
Automatic arguments validation at runtime (implies that you don't have to declare or handle a type twice) ✅* ✅* ✅*
Server-Side rendering ❌* ❌*
Request batching
Subscriptions / WebSockets
File uploads / WebSockets
Superjson support: proper handling of Date/Map/Set/BigInt ✅*
REST API
Auto. generate OpenAPI/Swagger docs ❌* ❌*
React helpers
Typesafe session / context objects

Compile / run

Assuming full features (like automatic arguments validation)

restfuncs telefunc tRPC wildcard
tsc / ttsc
ts-node ✅*
tsx / esbuild ❌*
When server code is build within...
... Vite/SVELTE KIT
... Next
... Prisma

Server frameworks

restfuncs telefunc tRPC wildcard
Standalone
Express
Koa
hapi
Electron
µWebSockets.js
Other see here

Clients / packagers

restfuncs telefunc tRPC wildcard
Client
Vite
Webpack
Babel
All other packagers and non-browser js clients (that can load NPM packages)
Special frontend framework utils / other see here

A server function looks like

restfuncs

@remote()
greet(name: string) {
    return `Hello ${name} from the server`
}

telefunc

export async function greet(name: string) {
    return `Hello ${name} from the server`
}

tRPC

  greet: t.procedure    
    .input(z.object({ name: z.string() })) // arguments validation
    .query(async ({ name }) => {
        return `Hello ${name} from the server`
    })

wildcard

server.greet = async function(name: string) {    
    
    // ... arguments validation code
    
    return `Hello ${name} from the server`
}




And on the client, this looks like (in case you're new to RPC ;):

console.log(await client.greet("Bob"))

Except on tRPC it's await client.greet.query("Bob")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published