Skip to content

Commit b8eaf03

Browse files
committed
Add unresolved question about file watching heuristics
1 parent 8aae141 commit b8eaf03

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

text/010-wasm-pack-watch-and-serve.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ ARGS:
8585
### Implementation
8686

8787
We can use [the `notify` crate][notify] to watch the filesystem for
88-
changes. Initially, we will just watch the crate directory for
89-
changes. Eventually, we can use [`cargo build --build-plan`][build-plan] to get
90-
a list of files that we should be watching.
88+
changes. Initially, we will use some heuristics to determine which files an
89+
directories to watch (see unresolved questions). Eventually, we can use [`cargo
90+
build --build-plan`][build-plan] to get a list of files that we should be
91+
watching.
9192

9293
[notify]: https://crates.io/crates/notify
9394
[build-plan]: https://github.com/rust-lang/cargo/issues/5579
@@ -225,6 +226,20 @@ and add these `wasm-pack` features?
225226
features. But ideally we shouldn't need to do this given that `miniserve`
226227
seems to fulfill all of our requirements.
227228

229+
* Until we can use `cargo build --build-plan`, what heuristics should we employ
230+
to guess what files and directories to watch for changes? This decision seems
231+
like something that doesn't have to be written in stone in this RFC, and can
232+
be experimented with during implementation and via user feedback. That said,
233+
there have been suggestions for all of
234+
235+
* the crate's directory and its contained files and directories,
236+
* walking up to find the `.git` folder at the root of a git repository and
237+
watching the whole repository,
238+
* finding the root of the workspace (either via `cargo-metadata` or by peeking
239+
at the set of dependencies in the crate's `Cargo.toml`) and watching the
240+
whole workspace,
241+
* and some combination of these options.
242+
228243
[https]: https://crates.io/crates/https
229244
[miniserve]: https://crates.io/crates/miniserve
230245
[simple-http]: https://crates.io/crates/simple-http-server

0 commit comments

Comments
 (0)