-
Notifications
You must be signed in to change notification settings - Fork 0
Decouple flask #7
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
base: bring-your-own-server
Are you sure you want to change the base?
Conversation
∙ removed flask specific import in _validate and use backends.backend.has_request_context now
∙ callback context uses request adapter context now ∙
removed flask.helpers.get_root_path usage
flask fully decoupled from dash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR decouples Dash from Flask dependencies by creating a unified backend abstraction layer that supports multiple web frameworks (Flask, Quart, and FastAPI). The main goal is to move Flask-specific functionality into backend-specific implementations while maintaining a consistent interface across all supported frameworks.
Key changes:
- Moved Flask-specific compression logic to individual backend implementations
- Added backend-agnostic context and request handling methods
- Created a new
get_root_path
utility to replace Flask's helper function
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
dash/dash.py | Removes Flask import and delegates compression handling to backend |
dash/backends/base_server.py | Adds abstract methods for request context and compression handling |
dash/backends/_flask.py | Implements Flask-specific compression and context methods |
dash/backends/_quart.py | Implements Quart-specific compression and context methods |
dash/backends/_fastapi.py | Implements FastAPI-specific compression and context methods |
dash/_utils.py | Adds get_root_path function to replace Flask's helper |
dash/_validate.py | Updates to use backend-agnostic request context checking |
dash/_callback_context.py | Updates timing information to use backend-agnostic context |
dash/_pages.py | Updates to use new get_root_path utility |
dash/_configs.py | Updates to use new get_root_path utility |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
context
andhas_request_context
to custom backend