-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
effect-app uses a relatively thin layer around Effect RPC, adding the following changes:
- "Dynamic" middleware, based on configuration living on each Request. so instead of imperatively adding middleware to every RPC / Group, you configure it on a Request definition. e.g
allowAnonymous?: truewill require a user for all endpoints, except those configured withallowAnonymous: true, idem with basic role requirements, e.g the default is to require admin access, unless you specify only the user role is required. Each dynamic middleware can either optionally provide context, or add to the Failures of an RPC - Wrapping/Providing middleware on the global level; so not just per RPC or group, but for all.
- Providing middleware can provide Context; so more than 1 service at a time.
- a different API to define Controllers, and to use derived clients, with less ceremony to define rpcs and implement controllers (like there's the namespace auto derived from the folder structure)
- we do not support middleware that also affects the client, apart from Dynamic Middleware adding failure types to the RPCs.
- we support "bare" generator functions for controller handlers (instead of requiring
(x) => Effect.gen(function*()orEffect.fnUntraced(function* (x)wrapping
on the middleware level we are much more aligned now, except for the Dynamic Middleware.
TODO
- look into switching our Generic/Providing middleware for native RPC Wrap/Provide middleware, perhaps at first just using the Middleware tag constructors from RPC.
- consider replacing our resources/controllers/derived clients approach with native Effect RPC
- alternatively, consider supporting middleware passed to
Router()ormatch()so we can support middleware on the controller level too
- alternatively, consider supporting middleware passed to
- fluent apis
- add provides: Context.Context support. (actually provides: [X, Y, Z], which requires returning a Context)
- add support for
requires(the opposite ofprovides) RPC Middleware: play withrequires#293 - look into what can be ported to or requested to be added to Effect RPC
- port
provides: [X, Y, Z]Context feature. https://github.com/Effect-TS/effect/pull/5328/files - port
requires(seems harder due to the RpcGroup/toLayer api) - port multi middleware add once, including sideways elimination..
- port global/dynamic middleware; derive an
RpcGroupmakeandtoLayerfrom prepared middleware.- global
- dynamic (based on configuration on the Request)
- port
- align more to middleware as first class citizen
- remove http details from rpc api: 8cc79f2
Metadata
Metadata
Assignees
Labels
No labels