-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
feature requestNew feature to be addedNew feature to be addedgood first issueGood for newcomersGood for newcomersnotable-changeA change that should be explicitly outlined in release notes and migration guidesA change that should be explicitly outlined in release notes and migration guidesv5.xIssue or pr related to Fastify v5Issue or pr related to Fastify v5
Milestone
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the issue has not already been raised
Issue
While looking at the onListen hook PR, I realized it is not that strict on how the application hooks refer to the instance.
onRoutehas the reference to theinstancein thethisparameteronRegisterhas the reference to theinstancein theinstanceparameteronClosehas the reference to theinstancein theinstanceparameteronReadyhas the reference to theinstancein thethisreferenceonListenhas the reference to theinstancein thethisparameterpreClosehas the reference to theinstancein thethisreference
I dont see any pattern.
### Tasks
- [ ] https://github.com/fastify/fastify/pull/4972
- [ ] Document the this context more clearly for every hook
How to implement it:
We choose to convert the parameters into an object and bind the this context too:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestNew feature to be addedNew feature to be addedgood first issueGood for newcomersGood for newcomersnotable-changeA change that should be explicitly outlined in release notes and migration guidesA change that should be explicitly outlined in release notes and migration guidesv5.xIssue or pr related to Fastify v5Issue or pr related to Fastify v5
Type
Projects
Status
Todo