Skip to content

Support for anywidget frontend hot-reload #9719

@kolibril13

Description

@kolibril13

Description

Marimo's mo.watch.file() works well for reloading widgets when their JS code changes:

# Cell 1
js_file = mo.watch.file("monkey.js")
css_file = mo.watch.file("monkey.css")
# Cell 2
class Widget(anywidget.AnyWidget):
    _esm = js_file.read_text()
    _css = css_file.read_text()
Widget()

However, the whole cell is now re-running, not only the frontend.

Here's a comparison screen recording, left JupyterLab with real hot reloading, and right the current marimo workaround.

Screen.Recording.2026-05-29.at.09.37.27.mp4

Would be great if Marimo could support real hot reloading as well!

Are you willing to submit a PR? (You must receive approval from the team before submitting a PR.)

  • Yes

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions