Skip to content

Conversation

@gabrielgrant
Copy link
Contributor

@gabrielgrant gabrielgrant commented Jan 15, 2025

--watch seems very useful when using marimo within an editor so that edits within the editor (or automatic changes like symbol renames etc) are reflected in the notebook (vs today when those changes get silently overwritten by marimo)

Should not be merged before marimo support for --watch is released in marimo-team/marimo#3437

Based on #57

Note: in running tests locally, I'm seeing a bunch of failures in the export_as and convert tests (separate from these edits)

@gabrielgrant gabrielgrant changed the title feat: add support for --watch flag (default on) feat: add support for --watch flag Jan 15, 2025
tests don't use the default config, so shouldn't expect the --watch flag
unless explicitly set
- `marimo.browserType`: Browser to open marimo app (`system` or `embedded`, default: `embedded`)
- `marimo.port`: Default port for marimo server (default: `2818`)
- `marimo.sandbox`: Always start marimo in a sandbox, e.g. `marimo edit --sandbox` (default: `false`). Requires [`uv`](https://docs.astral.sh/uv/) to be installed.
- `marimo.watch`: Always start marimo with the `--watch` flag (default: `true`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! this is a great addition and good default

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for doing the main implementation!

@mscolnick
Copy link
Contributor

the tests might have gotten stale. i will look into them.

also will add CI checks and look at the outstanding issues

@mscolnick mscolnick merged commit 9c068f4 into marimo-team:main Jan 20, 2025
2 checks passed
@gabrielgrant gabrielgrant deleted the add-watch-flag branch January 21, 2025 23:45
@gabrielgrant gabrielgrant restored the add-watch-flag branch January 21, 2025 23:45
@majidaldo
Copy link

but cells don't execute if i change the notebook. marimo run --watch does.

@mscolnick
Copy link
Contributor

@majidaldo we may add the option to auto-run on save as well for --watch. if you'd like to make a FR (or even the contribution), you can file it on our main repo https://github.com/marimo-team/marimo

marimo run --watch does re-execute, but it refreshes the whole page and resets the state. for edit, we just send partial updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants