The route decorator in Starlette will be deprecated as of version 1.0.0 #482
kintisheff
started this conversation in
General
Replies: 1 comment
-
We don't use starlette route decorators - we define our own. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
fast_app
method returns a FastHtml instance, which in turn inherits from the Starlette app instance class, as well as the starlette app.route decorator, using the latter to decorate methods and turn them into request handlers.This behavior of using the route decorator to define request handlers is now strongly discouraged by starlette -
and is going to be deprecated in 1.0.0 in favor of the approach described in https://www.starlette.io/routing/.
While fasthtml allows for passing arguments on to starlette, which in theory should work for routes as well, in reality this appears to not work because of an apparent incompatibility of the expected method signatures for the request handlers in fasthml vs starlette.
Should something be done to future-proof fasthtml by ensuring the use of recommended (and in the near future, only possible) routing logic in Starlette?
Beta Was this translation helpful? Give feedback.
All reactions