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

Update Migration-Guide-V4.md #4091

Merged
merged 5 commits into from Jun 28, 2022

Conversation

denes-fekeshazy
Copy link
Contributor

@denes-fekeshazy denes-fekeshazy commented Jun 27, 2022

Extending the V4 migration guide to highlight the changes to route definitions.

Resolves #4085

Checklist

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jun 27, 2022
better error reporting for route definition. As a result if you specify an `onRoute` hook
in a plugin you should either:
* wrap your routes in a plugin (recommended)
* use `await register(...)`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add the code example to let the user understand better the implications:
any onRoute hooks will not be executed when a plugin adds them if it is not awaited or the routes are wrapped in a plugin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the code example used in the linked issue before and after refactoring. Could you have a look please if that was what you had in mind?

denes-fekeshazy and others added 3 commits June 28, 2022 09:34
Co-authored-by: Matteo Collina <matteo.collina@gmail.com>
Add code examples to the Synchronous route definitions section
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 4eea272 into fastify:main Jun 28, 2022
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hook onRoute doesn't work correct inside registered plugin
3 participants