-
Notifications
You must be signed in to change notification settings - Fork 7
Implement flask-hmr: Hot Module Replacement CLI wrapper for Flask applications #12
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: readme
Are you sure you want to change the base?
Conversation
Co-authored-by: CNSeniorious000 <74518716+CNSeniorious000@users.noreply.github.com>
Co-authored-by: CNSeniorious000 <74518716+CNSeniorious000@users.noreply.github.com>
…g mode Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
PR Change SummaryImplemented a new flask-hmr package for Flask applications, enabling hot module replacement and instant server reloading.
Added Files
How can I customize these reviews?Check out the Hyperlint AI Reviewer docs for more information on how to customize the review. If you just want to ignore it on this PR, you can add the Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add |
|
@copilot Workspace member |
Co-authored-by: CNSeniorious000 <74518716+CNSeniorious000@users.noreply.github.com>
Added the missing pyproject.toml file to the flask-hmr-demo example directory. The file follows the same pattern as other examples in the repository and includes proper dependencies for Flask and flask-hmr from the workspace. Commit: 1b90a24 |
5a6f396 to
6dc27a0
Compare
d2e0228 to
3145ac5
Compare
b044a10 to
59e0c95
Compare
This PR implements
flask-hmr, a new CLI tool that brings Hot Module Replacement (HMR) functionality to Flask applications, following the same pattern as the existinguvicorn-hmrpackage.Problem Statement
The repository already provides excellent HMR capabilities for Uvicorn/FastAPI applications through
uvicorn-hmr, but Flask developers had to manually set up HMR using the lower-levelreactivity.hmr.corefunctionality. This created an inconsistent developer experience and required boilerplate code for Flask projects.Solution
Created a new
flask-hmrpackage that wraps the existing HMR infrastructure with a Flask-specific CLI interface, maximizing code reuse while providing a seamless Flask developer experience.Key Features
🚀 Drop-in Replacement for
flask run⚡ Fast Hot Module Replacement
reactivity.hmr.corefor efficient module reloading🛠 Flask-Optimized Configuration
127.0.0.1:5000)--debugflag📋 Complete CLI Interface
Implementation Details
The implementation reuses ~90% of the existing
uvicorn-hmrcodebase while adapting key differences:make_server()instead of Uvicorn'sServerTesting
Package Structure
Backward Compatibility
This change is completely additive - no existing functionality is modified. The existing Flask examples continue to work exactly as before, while developers now have the option to use the more convenient
flask-hmrCLI.Demo
This provides Flask developers with the same excellent HMR experience that Uvicorn users already enjoy, while maintaining the repository's philosophy of reusing core functionality rather than duplicating it.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.