Skip to content

🚧 Under Construction 🚧

This site is currently under construction. This page is generated by AI and has not undergone thorough review by a human. There may be hallucination!

In fact, for now only /, /reactive, and the llms.txt are carefully crafted by myself.

Quick Start

Let's create a simple example to see HMR in action.

1. Create a file

Create main.py:

# main.py
import time

i = 0
while True:
    i += 1
    print(f"Hello, World! {i}")
    time.sleep(1)

2. Run with HMR

hmr main.py

You should see:

Hello, World! 1
Hello, World! 2
Hello, World! 3
...

3. Edit and watch it reload

Without stopping the script, change the print statement:

# main.py
import time

i = 0
while True:
    i += 1
    print(f"HMR is amazing! {i}")  # Changed this line
    time.sleep(1)

Save the file. The output changes instantly:

...
Hello, World! 5
HMR is amazing! 6
HMR is amazing! 7
...

Notice that i continued from where it was. The process didn't restart—only the changed code was reloaded. This is the power of HMR: instant updates with preserved state.

Framework Examples

FastAPI/ASGI apps:

pip install uvicorn-hmr
uvicorn-hmr main:app

Flask apps:

hmr start.py  # where start.py creates and runs your Flask app

MCP servers:

pip install mcp-hmr
mcp-hmr server:app

Next Steps