-
-
Notifications
You must be signed in to change notification settings - Fork 126
-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Use cases of Dream.path #238
Comments
aantron
added a commit
that referenced
this issue
May 11, 2023
Path getter and setter not removed. See #238. not_found just deprecated, so not removed, for users to have more of a chance to adapt.
Will the deprecation of this be reversed? For the above use cases I don't see a clear alternative. If this has already been un-deprecated and my dream version is out of date then my mistake :) |
We use
|
Thank you all. It looks like it's best to undeprecate it, but probably also consider routing in more detail. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The function
Dream.path
has been marked as deprecated. I understand that structured routing is preferable, but its removal blocks use cases for which routes can't be computed upfront. For example:Dream.static
depends on the internal equivalent topath
to map paths to the file system; it should be possible to implement such a handler with Dream's public API as well.path
to forward paths to CGI scripts.If
path
were removed, implementing such handlers would become an exercise in recursive application ofDream.router
to consume the entire path that wouldn't even provide any static information to parent scopes. Simple access to the path feels to me too foundational to remove, even if it competes with structured routes. (Would access to query parameters be removed as well if they were made routable?)If widespread access to
path
is problematic for routing, maybepath
could return a value only when the innermost route handler ends with a wildcard, and raise an exception otherwise. This would make handlers likestatic
or my CGI handler fail unless mounted directly under a wildcard, which I think is reasonable.The text was updated successfully, but these errors were encountered: