Skip to content

Commit

Permalink
fix(core): Don't reverse unnecessary nodes in event measurer (#1096)
Browse files Browse the repository at this point in the history
* fix(CI): Tweak test threads

* use cargo test

* -- --test-threads 1

* split events tests

* remove threads cap

* split events tests

* fmt

* move

* clean up

* clean up

* clean up
  • Loading branch information
marc2332 authored Feb 6, 2025
1 parent f069832 commit 393e4fd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
uses: taiki-e/install-action@nextest
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
if: github.ref != 'refs/heads/main'
with:
prefix-key: "8"
- name: Install linux dependencies
Expand Down Expand Up @@ -63,4 +64,4 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Make sure the mocked Skia bindings are on sync
if: runner.os == 'Linux'
run: cargo build --package freya --features mocked-engine-development --no-default-features
run: cargo build --package freya --features mocked-engine-development --no-default-features
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ disable-zoom-shortcuts = ["freya/disable-zoom-shortcuts"]
docs = ["freya/docs"]

[patch.crates-io]
dioxus = { git = "https://github.com/ealmloff/dioxus", rev = "17b8b22d9b6c31a9ad5a8e291627776fa3c1ec49" }
dioxus-rsx = { git = "https://github.com/ealmloff/dioxus", rev = "17b8b22d9b6c31a9ad5a8e291627776fa3c1ec49" }
dioxus-core-macro = { git = "https://github.com/ealmloff/dioxus", rev = "17b8b22d9b6c31a9ad5a8e291627776fa3c1ec49" }
dioxus-hooks = { git = "https://github.com/ealmloff/dioxus", rev = "17b8b22d9b6c31a9ad5a8e291627776fa3c1ec49" }
dioxus-signals = { git = "https://github.com/ealmloff/dioxus", rev = "17b8b22d9b6c31a9ad5a8e291627776fa3c1ec49" }
dioxus-core = { git = "https://github.com/ealmloff/dioxus", rev = "17b8b22d9b6c31a9ad5a8e291627776fa3c1ec49" }
dioxus-router = { git = "https://github.com/ealmloff/dioxus", rev = "17b8b22d9b6c31a9ad5a8e291627776fa3c1ec49" }
generational-box = { git = "https://github.com/ealmloff/dioxus", rev = "17b8b22d9b6c31a9ad5a8e291627776fa3c1ec49" }
dioxus = { git = "https://github.com/ealmloff/dioxus", rev = "5c410876666710f0c497fd6d4033011ac37087bc" }
dioxus-rsx = { git = "https://github.com/ealmloff/dioxus", rev = "5c410876666710f0c497fd6d4033011ac37087bc" }
dioxus-core-macro = { git = "https://github.com/ealmloff/dioxus", rev = "5c410876666710f0c497fd6d4033011ac37087bc" }
dioxus-hooks = { git = "https://github.com/ealmloff/dioxus", rev = "5c410876666710f0c497fd6d4033011ac37087bc" }
dioxus-signals = { git = "https://github.com/ealmloff/dioxus", rev = "5c410876666710f0c497fd6d4033011ac37087bc" }
dioxus-core = { git = "https://github.com/ealmloff/dioxus", rev = "5c410876666710f0c497fd6d4033011ac37087bc" }
dioxus-router = { git = "https://github.com/ealmloff/dioxus", rev = "5c410876666710f0c497fd6d4033011ac37087bc" }
generational-box = { git = "https://github.com/ealmloff/dioxus", rev = "5c410876666710f0c497fd6d4033011ac37087bc" }

[workspace.dependencies]
freya = { path = "crates/freya", version = "0.3.0-rc.0" }
Expand Down
4 changes: 1 addition & 3 deletions crates/core/src/events/events_measurer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ pub fn measure_potential_event_listeners(

// Walk layer by layer from the bottom to the top
for (layer, layer_nodes) in sorted(layers.iter()) {
// Iterate over the nodes in reversed to their declaration because
// the next nodes could always render in top of their previous
for node_id in layer_nodes.iter().rev() {
for node_id in layer_nodes.iter() {
let Some(layout_node) = layout.get(*node_id) else {
continue;
};
Expand Down

0 comments on commit 393e4fd

Please sign in to comment.