Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hydration race condition #3240

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/interpreter/src/unified_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ mod js {
#[extends(BaseInterpreter)]
pub struct Interpreter;

fn mount_to_root() {
"{this.appendChildren(this.root, this.stack.length-1);}"
}
fn push_root(root: u32) {
"{this.pushRoot(this.nodes[$root$]);}"
}
Expand Down
4 changes: 0 additions & 4 deletions packages/web/src/dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ impl WebsysDom {
suspense_hydration_ids: Default::default(),
}
}

pub fn mount(&mut self) {
self.interpreter.mount_to_root();
}
}

fn walk_event_for_id(event: &web_sys::Event) -> Option<(ElementId, web_sys::Element)> {
Expand Down
3 changes: 0 additions & 3 deletions packages/web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ pub async fn run(mut virtual_dom: VirtualDom, web_config: Config) -> ! {
websys_dom.flush_edits();
}

// the mutations come back with nothing - we need to actually mount them
websys_dom.mount();

loop {
// if virtual dom has nothing, wait for it to have something before requesting idle time
// if there is work then this future resolves immediately.
Expand Down
Loading