cli icon indicating copy to clipboard operation
cli copied to clipboard

Rust-Analyzer seems to break incremental compilation in Debug mode (e.g., when using `dioxus serve`)

Open d4h0 opened this issue 2 years ago • 2 comments

Hi,

Rust-Analyzer seems to break incremental compilation in Debug mode, when the target is Wasm (see https://github.com/rust-lang/rust-analyzer/issues/12551).

A workaround is, to create and use a separate build profile, e.g. by adding the following to the Cargo.toml of the project:

[profile.dev2]
inherits = "dev"

...and then execute dioxus serve --profile dev2.

Without that, I had to wait 30 to 60 seconds after basically every change (with a separate profile it takes ~800 ms).

I think, until the above issue is fixed, the workaround should be added to the hot-reload section of the guide.

d4h0 avatar Jan 11 '23 13:01 d4h0

There seems to be currently a bug, which result in the above not working properly (see https://github.com/DioxusLabs/cli/issues/91)

d4h0 avatar Jan 11 '23 15:01 d4h0

I have found a workaround for https://github.com/DioxusLabs/cli/issues/91:

Instead of switching Dioxus to a different profile, I switched Rust-Analyzer to another profile.

I've described how to do that in the following comment: https://github.com/rust-lang/rust-analyzer/issues/6007#issuecomment-1379342831

d4h0 avatar Jan 11 '23 19:01 d4h0