Synchronizing cargo (web, watch)

#1
  1. I have an app where frontend = Rust/wasm, backend = Rust/rocket

  2. The frontend makes a GET request to the backend during the initialization process.

  3. The frontend auto recompiles + auto reloads via “cargo web … --auto-reload”

  4. The backend auto recompiles + auto reloads via “cargo watch”

  5. A problem I often run into is that the frontend finishes recompiles (and auto reloads) before the backend finishes reloading rocket.

  6. Is there anyway to synchronize these two cargo reloads?

#2

Preferred order is:

  1. Backend finishes recompiling. Backend restarts rocket.

  2. Frontend recompiles. Frontend reloads.