-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: decorate fastify instance with addittional properties #5093
base: main
Are you sure you want to change the base?
Conversation
It feels kind of wrong to change the FastifyInstance to a type. Doesnt this result in potential issues because you maybe cant extend from a type? Also i think AppInstance or app is a term of expressjs. A AppInstance or App in fastify is the FastifyInstance. |
@Uzlopak Actually you can extend a type the same way you do with an interface |
@Uzlopak If you are talking about declaration merging then you are correct, but this is the thing we are trying to avoid |
@DemonHa what can we do to help you ship this? |
Getting feedback as early as possible would be a great help. |
Was thinking how would it work with a plugin like autoload or even when defining routes on a separate function. We would probably need a generic to tell us which plugins have been registered. Wdyt @mcollina ? |
Proposal regarding to #5061
We are decorating the FastifyInstance to take into account decorators so it can work together with fastifyPlugin in order to have to end to end type safe apis.
This PR is a draft so any suggestion will be highly appreciated.
Checklist
npm run test
andnpm run benchmark
and the Code of conduct