Support RouteShorthandOptions to Receive Async Hooks #4943
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
run
npm run test
andnpm run benchmark
tests and/or benchmarks are included
documentation is changed or added
commit message and code follows the Developer's Certification of Origin
and the Code of conduct
This PR addresses Support
RouteShorthandOptions
to receive async hooks #4859 for which a solution caused problems as seen in typings for the route config based hooks no longer working since 4.16.0 #4705 leading to respective revert fix: revert changes made to route hook types #4708. Through this PR, I hope to provide a solution that will avoid similar problems with typing.Instead of using OR ( | ) to solve the problem, I added extra variables to represent the async hook versions. In the previous attempt, I know the async versions were never called or recognized.
I have changed the associated tests of RouteShorthandOptions to make use of the new async versions.
I am not sure if this is the best way to address the issue, so I will mark this PR as a draft.
Thanks for any feedback!