Comments (6)
thanks for reporting!
from seed.
It turns out that switching
from "websocket send-and-receive" as an asynchronous task
to timer-based asynchronous task
also reveals this bug.
As the timer-based example can be easier to analyze, I pushed timer-based version to repository on branch with-timers
from seed.
@wkordalski thanks for the example in the repo. I can reproduce the described behavior.
Since i was not much involved in the changes in the v0.9 release, it is hard for me to guess what the cause could be.
@MartinKavik or @fosskers do you have a guess?
from seed.
The example is too big for me to quickly orient in it by myself and imagine all possible cases, so only some general ideas:
ElRef
integration to Seed rendering system was a bit painful and error-prone if I remember correctly. I wouldn't be too much surprised if there is a bug / unhandled edge case.- I'm not sure if it's possible to accidentally call
some_elref.get()
during the rendering when the diff algorithm is just removing / reattaching new DOM elements - just an idea because async & websockets have been mentioned. - I had some similar
ElRef
-related problems in the past but there were my mistakes in all cases (forgottenskip()
, wrong assumption that DOM elements have been already rendered, etc.)
Sorry I can't help more, gl 🙂
from seed.
The example is too big for me to quickly orient in it by myself and imagine all possible cases
Sorry. I've reduced example size from around 5k LOC to 250 LOC (counting Rust only), and I feel it can be hard to reduce more.
ElRef
integration to Seed rendering system was a bit painful and error-prone if I remember correctly. I wouldn't be too much surprised if there is a bug / unhandled edge case.
I won't be surprised too.
- I'm not sure if it's possible to accidentally call
some_elref.get()
during the rendering when the diff algorithm is just removing / reattaching new DOM elements - just an idea because async & websockets have been mentioned.
As I know, whole Seed app and timers run on a single thread and the async tasks are scheduled using non-preemptive scheduler (run setInterval(handler, 1000); while (true) {}
and see that handler
is never called). Thus some_elref.get()
inside update
should not be executed during DOM update.
What is more, replacing assert_eq!(...)
with if ... { seed::log!(...) }
shows that ElRef
never gets attached and the node is being rendered. So this cannot be the case that "we asked ElRef
too early", but rather "we created the ElRef
wrongly".
- I had some similar
ElRef
-related problems in the past but there were my mistakes in all cases (forgottenskip()
, wrong assumption that DOM elements have been already rendered, etc.)
This might be. Especially that the documentation of ElRef
is concise and misses the conditions the programmer should hold to But why the problem does not appear in Seed 0.8?
Generally thank you very much for your hints and ideas!
(And for your work that resulted in Seed 0.8, which is usable in our use-case).
I don't even expect that you or someone else fix this problem as our usage of Seed is quite nonstandard.
I hope that this report will help somebody who meet a similar problem or while fixing another bug.
Currently we can stay with Seed 0.8 and maybe fix this bug in the future when money allow us to do so :)
from seed.
Ok... At least I did git bisect
and it turns out that that commit 5a4e91b introduces this bug.
5a4e91b36e4fa055d7f9e441171b12a3c889dfa5 is the first bad commit
commit 5a4e91b36e4fa055d7f9e441171b12a3c889dfa5
Author: glennsl <[email protected]>
Date: Sun Oct 3 23:32:34 2021 +0200
refactor(virtual_dom): simplify/deduplicate wiring related to DOM insertion
src/browser/dom/virtual_dom_bridge.rs | 77 +++++++++++++++++++++--------------
src/virtual_dom/patch.rs | 23 +----------
2 files changed, 48 insertions(+), 52 deletions(-)
from seed.
Related Issues (20)
- 1. Create a new issue in the Seed repo with the name and copy-paste this checklist into it (also add blockers and additional tasks, if exist).
- Maintenance & Future of Seed HOT 8
- v0.9.1: browser::json::Error is inaccessible
- Deserializing large numbers fail HOT 11
- Websocket example does not work HOT 2
- how to integrate with another wasm ?
- Websocket API changed from 0.8 to 0.9 HOT 5
- Does not build with wasm-bindgen 0.2.81 HOT 3
- Closures need types HOT 3
- Release v0.9.2 HOT 3
- Seed 0.8 accepting the newest wasm-bindgen HOT 3
- [0.8.x] WebSocket and too early dropped closure HOT 1
- support `beforeinput` events HOT 1
- Seed doesn't compile with `default-features = false` HOT 2
- checkbox not working HOT 2
- Release v0.10.0 HOT 3
- Cannot use subs (subs::UrlChanged) HOT 2
- Error: unresolved import in wasm_bindgen_initialize HOT 1
- Website defaced by indonesian (?) script-kiddie HOT 1
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 seed.