Draft
Conversation
…dleware on runtime, making the route preperation faster
Member
|
All projects except for Pulse now use Gems\InitFunctions in their index.php. You can fix this their as part of the central code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Instead of adding custom middleware to every group, we pipe those middleware on runtime, making the route preperation faster.
Currently preparing the routes middleware takes a lot of calls, because every middleware gets prepared for all the routes (800+ routes * 10'ish middleware.. ). By creating a custom piping mechanism, we can check which routeGroup it belongs to on runtime, and then pipe it through the specific middleware, before continueing!
This way we do not have to prepare middleware for routes we currently aren't on.
The route group name as defined in the Routegroup in Route.php will get injected in the route options, so we know which route belongs to which route group on runtime.
This WILL require some project specific changes:
config/pipeline.php (after the config piuplines on r79:
Also the routeGroup trait has changed:
This would need to be refactored in all Route/apiRoute config files...