You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HTTP.Handlers and HTTP.Router functionality is extremely useful, but the way the handler code is written is extremely limiting. In particular, since routers must be defined using the @register macro, and these define a bunch of new methods, routers essentially need to be declared and set up in global scope. This is inappropriate for what is likely to be the majority of use cases for this, in which the router is likely associated with some other data structure and may need to be created with highly configurable routing. Furthermore, as far as I can tell there is no reason why the routing need involve any macros. Lambda functions should more than suffice. Fortunately, this doesn't exactly involve a ton of code, but it probably would involve a ton of testing and documentation.
I'm not at all sure I'd want to take this on myself, but if I did, would a rewrite be something everyone would be receptive to? Otherwise, probably worth keeping up this issue for discussion in case somebody wants to take it on at a later date.
The text was updated successfully, but these errors were encountered:
Having this exact same issue with Routers. It seems like Routers should be useful for breaking out endpoints into modules, but this is only really possible by playing incredibly fast and loose with globals variables.
The
HTTP.Handlers
andHTTP.Router
functionality is extremely useful, but the way the handler code is written is extremely limiting. In particular, since routers must be defined using the@register
macro, and these define a bunch of new methods, routers essentially need to be declared and set up in global scope. This is inappropriate for what is likely to be the majority of use cases for this, in which the router is likely associated with some other data structure and may need to be created with highly configurable routing. Furthermore, as far as I can tell there is no reason why the routing need involve any macros. Lambda functions should more than suffice. Fortunately, this doesn't exactly involve a ton of code, but it probably would involve a ton of testing and documentation.I'm not at all sure I'd want to take this on myself, but if I did, would a rewrite be something everyone would be receptive to? Otherwise, probably worth keeping up this issue for discussion in case somebody wants to take it on at a later date.
The text was updated successfully, but these errors were encountered: