Comments (2)
Cause and Effect
- wait_interruptible() in sync.rs returns a boolean value. Therefore any callers of this function cannot identify the difference between a failed compile and an interrupted compile as they both are represented by
false
. - Both failed and interrupted compiles are mapped to an Outcome::Stopped. See server.rs & front.rs.
- The run_loop interprets
Outcome::Stopped
as an interrupted compile not a failed compile. It therefore does not clear the change list and so future changes to the same files does not appear to be a change. And I think this is why the recompile does not happen.
Possible Solutions
-
Introduce a new enum for
wait_interruptible()
to return with variants Success, Fail, Stopped.
Change front.rs and server.rs to map Fail and Stopped to Outcome::Success(Product::None) and Outcome::Stopped respectively. -
Alternatively we could look to reuse the current Outcome enum and maybe add a Failed variant, and return an outcome from
wait_interruptible()
.
For successful compile we'd return Outcome::Success(Product::None)
For failed compile we'd return Outcome::Failed
For interrupted compile we'd return Outcome::Stopped.
This however would then require the caller ofwait_interruptible()
(e.g. server.rs) to then check if the binary has changed and then map Outcome::Success(Product::None) to Outcome::Success(Product::Server).
Happy to create a PR if someone could kindly indicate which solution is preferred.
from cargo-leptos.
Thanks @danylaporte for reporting this.
Thanks @phillipbaird for an excellent analysis. I took the liberty to implement your first proposed solution and really hope you don't mind.
from cargo-leptos.
Related Issues (20)
- Setting environment variables at a project level. HOT 3
- subscribe to shutdown
- Change `new` and add `init`? HOT 1
- leptos watch does not like pingora HOT 2
- Cross compile error (Debian -> Windows)
- `watch` does not load style assets if the initial build fails
- Doesn't watch if the path dependency is the workspace root HOT 2
- Hot reloading and local HTTPS HOT 5
- Bundle external modules to use them from JS snippets HOT 3
- Issue with VS Code and Hot Reloading HOT 2
- Bug: SSL error with shell script install HOT 7
- Feature: Option to only build front end / CSR or backend / SSR HOT 1
- use daisyui in leptos report Unexpected token Ident("tr") HOT 2
- workspace example is broken with LEPTOS_HASH_FILES=true HOT 1
- Doesn't play well with `candle` HOT 8
- MSRV
- `hash_files = true` doesn't work anymore HOT 9
- When compiling wasm it throws: thread 'tokio-runtime-worker' has overflowed its stack HOT 1
- Expand documtentation on new setup (README.md + inside --help command) HOT 1
- cargo leptos build fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-leptos.