DioxusLabs / cli

Dev server, hot reload, and packaging tool for Dioxus apps. Includes VSCode Extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

d4h0 opened this issue · comments

commented

Hi,

Rust-Analyzer seems to break incremental compilation in Debug mode, when the target is Wasm (see rust-lang/rust-analyzer#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.

commented

There seems to be currently a bug, which result in the above not working properly (see #91)

commented

I have found a workaround for #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: rust-lang/rust-analyzer#6007 (comment)