modiimedia / arri

Arri RPC is a code-first RPC framework for end-to-end type safety in any language
MIT License
41 stars 3 forks source link

Make TS server library agnostic #92

Open joshmossas opened 3 weeks ago

joshmossas commented 3 weeks ago

Describe the feature

Right now the Arri TS server assumes that developers are using H3. However ideally devs should be able to integrate Arri RPC into existing nodeJS servers whether it be Express, Fastify, or whatever.

Additional context

In order to accomplish this we will need to strip out the core Arri server code and allow that to be a standalone library. The existing TS server (with file-based routing and hot-reload for client code) will be converted to a "framework" built on top of the Arri core library.

The "arri-core" library will not be a server in and of itself. Instead it will require an "adapter" that can be used to map it to various different HTTP libraries. (We can possibly use trpc adapters as a point of reference for this). We can ship with some default adapters for vanilla nodejs, express, and fastify. Then we'll also want to document how people can make their own adapters.