Upstream: crates/rune/README.md § An external app crate at
65f8eb43f710, MIT © Anomaly. Bundled by build-rune-apps; links point at this snapshot or at GitHub at that rev.
An external app crate
An app outside this repository needs one feature, and no code changes:
[features]
hot = ["rune/hot"]
scripts/rune-dev --manifest-path ../my-app/Cargo.toml --patch 'src/ui/**/*.rs' \
[--bin NAME] [--package NAME] [--features a,b] [-- APP ARGS]
--patch globs are relative to the app crate and can repeat; ** spans directories.
Function bodies in those files patch live. Every other file in the crate, its path
dependencies and Rune itself is a restart. The launcher mirrors the crate, each of its
path dependencies and their workspaces' manifests, lockfiles and Cargo configs to the
build Mac; a git-pinned Rune needs nothing extra. The mirrored workspace manifest lists
only the members it staged, so other members never need to build. If the app's workspace has no
[profile.rune-hot], the launcher passes one with cargo --config.
The launcher sets RUNE_HOT=1, which turns live editing on like --hot without any
argv plumbing. All entry points dispatch through the patch table: App::run/try_run,
run_windows, run_windows_with, run_windows_with_args and WindowSpec::from_app.
A process holds one devserver connection, and each patch reaches every window and overlay,
hidden ones included: a hidden launcher rebuilds before it shows again.
Rune's flags after --, such as --snap-on-patch and --window KEY, need an app that
passes its arguments to Rune; with --snap-on-patch, --window picks which window of a
run_windows app renders headless.