-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
area: routingIssues related to routing.Issues related to routing.enhancementNew feature or requestNew feature or request
Description
Context
In the Router.use() method implementation, there's a TODO comment identifying a potential optimization:
While correct, it would be enough to map only the entry for the method that is actually looked up. However this is not easily achieved with the current implementation.
Currently, when applying a middleware transformation via use(), the implementation maps all HTTP method entries in the _RouterEntry, even though only one method is being looked up at a time. This works correctly but performs unnecessary transformations.
Proposed Optimization
Modify the implementation to apply the mapping function only to the specific method entry being looked up, rather than transforming all method entries upfront.
References
- PR: feat(router): Add support for setting up mappings of values on lookup
router.use(path, map)#186 - Comment: feat(router): Add support for setting up mappings of values on lookup
router.use(path, map)#186 (comment) - File:
lib/src/router/router.dart(lines 67-69)
Requested by: @nielsenko
Metadata
Metadata
Assignees
Labels
area: routingIssues related to routing.Issues related to routing.enhancementNew feature or requestNew feature or request
Type
Projects
Status
Backlog 🗂️