Skip to content
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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

DemonHa
Copy link
Contributor

@DemonHa DemonHa commented Oct 13, 2023

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

@Uzlopak
Copy link
Contributor

Uzlopak commented Oct 13, 2023

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.

@DemonHa
Copy link
Contributor Author

DemonHa commented Oct 13, 2023

@Uzlopak Actually you can extend a type the same way you do with an interface

@DemonHa
Copy link
Contributor Author

DemonHa commented Oct 13, 2023

@Uzlopak If you are talking about declaration merging then you are correct, but this is the thing we are trying to avoid

@DemonHa DemonHa marked this pull request as draft November 4, 2023 13:05
@mcollina mcollina self-requested a review May 1, 2024 14:58
@mcollina
Copy link
Member

mcollina commented May 2, 2024

@DemonHa what can we do to help you ship this?

@DemonHa
Copy link
Contributor Author

DemonHa commented May 2, 2024

@DemonHa what can we do to help you ship this?

Getting feedback as early as possible would be a great help.

@DemonHa
Copy link
Contributor Author

DemonHa commented May 4, 2024

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 ?

@Eomm Eomm added the typescript TypeScript related label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript TypeScript related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants