stdweb icon indicating copy to clipboard operation
stdweb copied to clipboard

Unnecessary recompilation when switching between cargo check and cargo web deploy

Open Boscop opened this issue 5 years ago • 0 comments

Whenever I switch between doing cargo check in Sublime Text and cargo web deploy in cmd.exe, it causes unnecessary recompilation due to this line: https://github.com/koute/stdweb/blob/9b418d98df6fafaa4d4b87b04c304d0220292055/stdweb-internal-runtime/build.rs#L62 I usually have cargo watch -x "web deploy" running (in parallel with browser-sync for auto-reload), this is the output:

[Running 'cargo web deploy']
   Compiling stdweb-internal-runtime v0.1.5
   Compiling stdweb v0.4.20
   Compiling web_logger v0.2.0
   Compiling yew v0.12.0
   Compiling frontend v0.1.0 (D:\projects\myproject\frontend)
    Finished dev [unoptimized + debuginfo] target(s) in 36.72s
    Processing "frontend.wasm"...
    Finished processing of "frontend.wasm"!

It takes ~37 seconds just to recompile after just doing cargo check in the editor, with no source changes! This is very annoying for productivity because it takes away so much accumulated time from the development workflow/cycle! Can you please only recompile stdweb-internal-runtime when absolutely necessary, i.e. not when doing cargo check?

Boscop avatar Feb 23 '20 02:02 Boscop