|
85 | 85 | ### Implementation
|
86 | 86 |
|
87 | 87 | 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. |
91 | 92 |
|
92 | 93 | [notify]: https://crates.io/crates/notify
|
93 | 94 | [build-plan]: https://github.com/rust-lang/cargo/issues/5579
|
@@ -225,6 +226,20 @@ and add these `wasm-pack` features?
|
225 | 226 | features. But ideally we shouldn't need to do this given that `miniserve`
|
226 | 227 | seems to fulfill all of our requirements.
|
227 | 228 |
|
| 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 | + |
228 | 243 | [https]: https://crates.io/crates/https
|
229 | 244 | [miniserve]: https://crates.io/crates/miniserve
|
230 | 245 | [simple-http]: https://crates.io/crates/simple-http-server
|
0 commit comments