ConduitPlatform / Conduit

Batteries-included backend that works with any stack.

Home Page:https://getconduit.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEAT] Migrate core from ExpressJS to Fastify

kkopanidis opened this issue · comments

Is your feature request related to a problem? Please describe.
While I do love express, Fastify provides multiple utilities for better performance, it's more "current" and will allow us for better promise handling as well as validation.

Describe the solution you'd like
We need to do 2 main things. 1. Migrate all existing expressjs functionality to Fastify, and remove REST validation code and migrate it to fastify's built in JSON validation. This will be more performant and far more stable than the current implementation.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

This remains blocked by Fastify not allowing route registrations after ready().
This is a big blocker as Conduit registers its routes dynamically due to:

  1. Initial route registration happening after modules have been registered for obvious reasons.
  2. Module configuration affecting exposed routes (eg for Authentication strategies etc).
  3. Dynamic routes (eg admin specified CustomEndpoints)

We could technically work around this by writing our own plugin for find-my-way (Fastify's router) to handle dynamic route registrations, but it would be overkill at this point.