diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index f592c076..b16c1ea4 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -20,7 +20,7 @@ jobs: ref: ${{ github.base_ref }} - name: Run cargo bench on base - run: cargo bench + run: cd packages/tools/bench && cargo bench - name: Checkout repository head uses: actions/checkout@v2 @@ -30,7 +30,7 @@ jobs: clean: false # Do not remove benchmark results from base branch - name: Run cargo bench on head - run: cargo bench + run: cd packages/tools/bench && cargo bench - name: Upload benchmark report uses: actions/upload-artifact@v2 diff --git a/Cargo.toml b/Cargo.toml index afa44f39..8266d46c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ # Packages "packages/sycamore", @@ -35,5 +36,6 @@ members = [ "website", # Tools + "packages/tools/bench", "packages/tools/bench-diff", ] diff --git a/docs/Cargo.toml b/docs/Cargo.toml index 310ae134..ba1df1ee 100644 --- a/docs/Cargo.toml +++ b/docs/Cargo.toml @@ -5,7 +5,7 @@ version = "0.1.0" [dependencies] pulldown-cmark = "0.9.2" -serde = { version = "1.0.136", features = ["derive"] } -serde_json = "1.0.79" +serde = { version = "1.0.147", features = ["derive"] } +serde_json = "1.0.89" syntect = "5.0.0" walkdir = "2.3.2" diff --git a/examples/hello-builder/Cargo.toml b/examples/hello-builder/Cargo.toml index 1ce20457..84b027ee 100644 --- a/examples/hello-builder/Cargo.toml +++ b/examples/hello-builder/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" [dependencies] console_error_panic_hook = "0.1.7" console_log = "0.2.0" -log = "0.4.14" +log = "0.4.17" sycamore = { path = "../../packages/sycamore" } diff --git a/examples/http-request-builder/Cargo.toml b/examples/http-request-builder/Cargo.toml index 3afefb95..e85bcec1 100644 --- a/examples/http-request-builder/Cargo.toml +++ b/examples/http-request-builder/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] console_error_panic_hook = "0.1.7" console_log = "0.2.0" -log = "0.4.14" -reqwasm = "0.4.1" -serde = "1.0.136" +log = "0.4.17" +reqwasm = "0.5.0" +serde = "1.0.147" sycamore = { path = "../../packages/sycamore", features = ["suspense"] } diff --git a/examples/http-request/Cargo.toml b/examples/http-request/Cargo.toml index 6844fe0e..470f33a4 100644 --- a/examples/http-request/Cargo.toml +++ b/examples/http-request/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] console_error_panic_hook = "0.1.7" console_log = "0.2.0" -log = "0.4.14" -reqwasm = "0.4.1" -serde = "1.0.136" +log = "0.4.17" +reqwasm = "0.5.0" +serde = "1.0.147" sycamore = { path = "../../packages/sycamore", features = ["suspense"] } diff --git a/examples/hydrate/Cargo.toml b/examples/hydrate/Cargo.toml index 43db10bc..0a6ee27d 100644 --- a/examples/hydrate/Cargo.toml +++ b/examples/hydrate/Cargo.toml @@ -8,9 +8,9 @@ edition = "2021" [dependencies] console_error_panic_hook = "0.1.7" console_log = "0.2.0" -log = "0.4.14" +log = "0.4.17" sycamore = { path = "../../packages/sycamore", features = [ "hydrate", "ssr", ] } -wasm-bindgen = "0.2.79" +wasm-bindgen = "0.2.83" diff --git a/examples/js-framework-benchmark/Cargo.toml b/examples/js-framework-benchmark/Cargo.toml index 982390e1..89498894 100644 --- a/examples/js-framework-benchmark/Cargo.toml +++ b/examples/js-framework-benchmark/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -getrandom = { version = "0.2.5", features = ["js"] } +getrandom = { version = "0.2.8", features = ["js"] } rand = "0.8.5" sycamore = { path = "../../packages/sycamore" } -wasm-bindgen = "0.2.79" -web-sys = "0.3.56" +wasm-bindgen = "0.2.83" +web-sys = "0.3.60" diff --git a/examples/timer/Cargo.toml b/examples/timer/Cargo.toml index fef7b2ff..88f2416a 100644 --- a/examples/timer/Cargo.toml +++ b/examples/timer/Cargo.toml @@ -6,5 +6,5 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -gloo-timers = { version = "0.2.3", features = ["futures"] } +gloo-timers = { version = "0.2.4", features = ["futures"] } sycamore = { path = "../../packages/sycamore", features = ["suspense"] } diff --git a/examples/todomvc/Cargo.toml b/examples/todomvc/Cargo.toml index b520709c..1f4d7c28 100644 --- a/examples/todomvc/Cargo.toml +++ b/examples/todomvc/Cargo.toml @@ -8,13 +8,13 @@ edition = "2021" [dependencies] console_error_panic_hook = "0.1.7" console_log = "0.2.0" -log = "0.4.14" -serde = { version = "1.0.136", features = ["derive"] } -serde_json = "1.0.79" +log = "0.4.17" +serde = { version = "1.0.147", features = ["derive"] } +serde_json = "1.0.89" sycamore = { path = "../../packages/sycamore", features = ["serde"] } -uuid = { version = "0.8.2", features = ["serde", "v4", "wasm-bindgen"] } -wasm-bindgen = "0.2.79" +uuid = { version = "1.2.2", features = ["serde", "v4", "wasm-bindgen"] } +wasm-bindgen = "0.2.83" [dependencies.web-sys] features = ["InputEvent", "KeyboardEvent", "Location", "Storage"] -version = "0.3.56" +version = "0.3.60" diff --git a/examples/transitions/Cargo.toml b/examples/transitions/Cargo.toml index fe4eb66f..d1e237bb 100644 --- a/examples/transitions/Cargo.toml +++ b/examples/transitions/Cargo.toml @@ -8,8 +8,8 @@ edition = "2021" [dependencies] console_error_panic_hook = "0.1.7" console_log = "0.2.0" -getrandom = { version = "0.2.5", features = ["js"] } -gloo-timers = { version = "0.2.3", features = ["futures"] } -log = "0.4.14" +getrandom = { version = "0.2.8", features = ["js"] } +gloo-timers = { version = "0.2.4", features = ["futures"] } +log = "0.4.17" rand = "0.8.5" sycamore = { path = "../../packages/sycamore", features = ["suspense"] } diff --git a/packages/sycamore-core/Cargo.toml b/packages/sycamore-core/Cargo.toml index a429e78e..ff671b46 100644 --- a/packages/sycamore-core/Cargo.toml +++ b/packages/sycamore-core/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/sycamore-rs/sycamore" version = "0.8.2" [dependencies] -ahash = "0.7.6" +hashbrown = "0.13.1" sycamore-reactive = { path = "../sycamore-reactive", version = "0.8.0" } [dev-dependencies] diff --git a/packages/sycamore-core/src/render.rs b/packages/sycamore-core/src/render.rs index 47aa15bf..472d5940 100644 --- a/packages/sycamore-core/src/render.rs +++ b/packages/sycamore-core/src/render.rs @@ -2,7 +2,7 @@ use std::rc::Rc; -use ahash::AHashMap; +use hashbrown::HashMap; use sycamore_reactive::*; use crate::generic_node::GenericNode; @@ -265,7 +265,7 @@ pub fn reconcile_fragments(parent: &G, a: &mut [G], b: &[G]) { let mut b_end = b_len; let mut a_start = 0; let mut b_start = 0; - let mut map = None::>; + let mut map = None::>; // Last node in a. let after = a[a_end - 1].next_sibling(); diff --git a/packages/sycamore-futures/Cargo.toml b/packages/sycamore-futures/Cargo.toml index 99064a31..d08783a2 100644 --- a/packages/sycamore-futures/Cargo.toml +++ b/packages/sycamore-futures/Cargo.toml @@ -11,11 +11,11 @@ repository = "https://github.com/sycamore-rs/sycamore" version = "0.8.0" [dependencies] -futures = "0.3.21" +futures = "0.3.25" sycamore-reactive = { path = "../sycamore-reactive", version = "0.8.0" } [target.'cfg(target_arch = "wasm32")'.dependencies] -wasm-bindgen-futures = "0.4.29" +wasm-bindgen-futures = "0.4.33" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tokio = { version = "1.17.0", features = ["rt"] } +tokio = { version = "1.22.0", features = ["rt"] } diff --git a/packages/sycamore-macro/Cargo.toml b/packages/sycamore-macro/Cargo.toml index 2cbba39d..a2c4aa94 100644 --- a/packages/sycamore-macro/Cargo.toml +++ b/packages/sycamore-macro/Cargo.toml @@ -14,14 +14,14 @@ version = "0.8.2" proc-macro = true [dependencies] -once_cell = "1.10.0" -proc-macro2 = "1.0.36" -quote = "1.0.15" -syn = { version = "1.0.86", features = ["extra-traits", "full"] } +once_cell = "1.16.0" +proc-macro2 = "1.0.47" +quote = "1.0.21" +syn = { version = "1.0.103", features = ["extra-traits", "full"] } [dev-dependencies] sycamore = { path = "../sycamore", features = ["hydrate", "suspense"] } -trybuild = "1.0.56" +trybuild = "1.0.71" [features] default = [] diff --git a/packages/sycamore-reactive/Cargo.toml b/packages/sycamore-reactive/Cargo.toml index b0f42f7d..ab378799 100644 --- a/packages/sycamore-reactive/Cargo.toml +++ b/packages/sycamore-reactive/Cargo.toml @@ -11,12 +11,13 @@ repository = "https://github.com/sycamore-rs/sycamore" version = "0.8.1" [dependencies] -ahash = "0.7.6" -bumpalo = { version = "3.9.1", features = ["boxed"] } -indexmap = "1.8.0" -serde = { version = "1.0.136", optional = true } +bumpalo = { version = "3.11.1", features = ["boxed"] } +indexmap = "1.9.2" +getrandom = { version = "0.2.8", features = ["js"] } +hashbrown = "0.13.1" +serde = { version = "1.0.147", optional = true } slotmap = "1.0.6" -smallvec = { version = "1.8.0", features = ["const_generics"] } +smallvec = { version = "1.10.0", features = ["const_generics"] } [features] default = [] diff --git a/packages/sycamore-reactive/src/effect.rs b/packages/sycamore-reactive/src/effect.rs index b02817a2..f06d16bb 100644 --- a/packages/sycamore-reactive/src/effect.rs +++ b/packages/sycamore-reactive/src/effect.rs @@ -1,6 +1,6 @@ //! Side effects. -use ahash::AHashSet; +use hashbrown::HashSet; use crate::*; @@ -17,7 +17,7 @@ pub(crate) struct EffectState<'a> { /// The callback when the effect is re-executed. cb: Rc>, /// A list of dependencies that can trigger this effect. - dependencies: AHashSet, + dependencies: HashSet, } /// Implements reference equality for [`WeakSignalEmitter`]s. @@ -122,7 +122,7 @@ fn _create_effect<'a>(cx: Scope<'a>, mut f: Box<(dyn FnMut() + 'a)>) { // Initialize initial effect state. *effect.borrow_mut() = Some(EffectState { cb: cb.clone(), - dependencies: AHashSet::new(), + dependencies: HashSet::new(), }); // Initial callback call to get everything started. diff --git a/packages/sycamore-reactive/src/iter.rs b/packages/sycamore-reactive/src/iter.rs index 3e4ae147..67550e16 100644 --- a/packages/sycamore-reactive/src/iter.rs +++ b/packages/sycamore-reactive/src/iter.rs @@ -4,7 +4,7 @@ use std::hash::Hash; use std::mem; use std::rc::Rc; -use ahash::AHashMap; +use hashbrown::HashMap; use crate::*; @@ -107,7 +107,7 @@ where // 0) Prepare a map of indices in newItems. Scan backwards so we encounter them in // natural order. - let mut new_indices = AHashMap::with_capacity(new_end - start); + let mut new_indices = HashMap::with_capacity(new_end - start); // Indexes for new_indices_next are shifted by start because values at 0..start are // always None. diff --git a/packages/sycamore-reactive/src/lib.rs b/packages/sycamore-reactive/src/lib.rs index 9c55b294..08028538 100644 --- a/packages/sycamore-reactive/src/lib.rs +++ b/packages/sycamore-reactive/src/lib.rs @@ -16,10 +16,10 @@ use std::marker::PhantomData; use std::mem; use std::rc::{Rc, Weak}; -use ahash::AHashMap; use arena::*; pub use context::*; pub use effect::*; +use hashbrown::HashMap; use indexmap::IndexMap; pub use iter::*; pub use memo::*; @@ -47,7 +47,7 @@ struct ScopeInner<'a> { /// usually read and rarely created. Making this heap allocated when prevent blowing up the /// size of the [`ScopeInner`] struct when most of the times, this field is unneeded. #[allow(clippy::box_collection)] - contexts: Option>>, + contexts: Option>>, // Make sure that 'a is invariant. _phantom: InvariantLifetime<'a>, } diff --git a/packages/sycamore-router-macro/Cargo.toml b/packages/sycamore-router-macro/Cargo.toml index 7e49775a..ec724a2c 100644 --- a/packages/sycamore-router-macro/Cargo.toml +++ b/packages/sycamore-router-macro/Cargo.toml @@ -16,13 +16,13 @@ proc-macro = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -nom = "7.1.0" -proc-macro2 = "1.0.36" -quote = "1.0.15" -syn = "1.0.86" -unicode-xid = "0.2.2" +nom = "7.1.1" +proc-macro2 = "1.0.47" +quote = "1.0.21" +syn = "1.0.103" +unicode-xid = "0.2.4" [dev-dependencies] -expect-test = "1.2.2" +expect-test = "1.4.0" sycamore-router = { path = "../sycamore-router" } -trybuild = "1.0.56" +trybuild = "1.0.71" diff --git a/packages/sycamore-router/Cargo.toml b/packages/sycamore-router/Cargo.toml index e974b447..96b08c35 100644 --- a/packages/sycamore-router/Cargo.toml +++ b/packages/sycamore-router/Cargo.toml @@ -15,7 +15,7 @@ version = "0.8.0" [dependencies] sycamore = { path = "../sycamore", version = "0.8.0" } sycamore-router-macro = { path = "../sycamore-router-macro", version = "0.8.0" } -wasm-bindgen = "0.2.79" +wasm-bindgen = "0.2.83" [dependencies.web-sys] features = [ @@ -30,7 +30,7 @@ features = [ "Url", "Window", ] -version = "0.3.56" +version = "0.3.60" [dev-dependencies] sycamore = { path = "../sycamore", features = ["ssr"] } diff --git a/packages/sycamore-web/Cargo.toml b/packages/sycamore-web/Cargo.toml index 0d31fd03..7cab8fe6 100644 --- a/packages/sycamore-web/Cargo.toml +++ b/packages/sycamore-web/Cargo.toml @@ -11,14 +11,14 @@ repository = "https://github.com/sycamore-rs/sycamore" version = "0.8.2" [dependencies] -html-escape = "0.2.11" -indexmap = "1.8.1" -js-sys = "0.3.57" -once_cell = "1.10.0" +html-escape = "0.2.12" +indexmap = "1.9.2" +js-sys = "0.3.60" +once_cell = "1.16.0" sycamore-core = { path = "../sycamore-core", version = "0.8.0" } sycamore-reactive = { path = "../sycamore-reactive", version = "0.8.0" } -wasm-bindgen = "0.2.80" -web-sys = { version = "0.3.57", features = [ +wasm-bindgen = "0.2.83" +web-sys = { version = "0.3.60", features = [ "console", "Comment", "Document", diff --git a/packages/sycamore/Cargo.toml b/packages/sycamore/Cargo.toml index fe4c2c25..34cdb11c 100644 --- a/packages/sycamore/Cargo.toml +++ b/packages/sycamore/Cargo.toml @@ -11,20 +11,20 @@ repository = "https://github.com/sycamore-rs/sycamore" version = "0.8.2" [dependencies] -ahash = "0.7.6" -futures = { version = "0.3.21", optional = true } -html-escape = { version = "0.2.9", optional = true } -indexmap = { version = "1.8.0", features = ["std"] } -js-sys = { version = "0.3.56", optional = true } -once_cell = { version = "1.10.0", optional = true } -paste = "1.0.6" +futures = { version = "0.3.25", optional = true } +hashbrown = "0.13.1" +html-escape = { version = "0.2.12", optional = true } +indexmap = { version = "1.9.2", features = ["std"] } +js-sys = { version = "0.3.60", optional = true } +once_cell = { version = "1.16.0", optional = true } +paste = "1.0.9" sycamore-core = { path = "../sycamore-core", version = "0.8.0" } sycamore-futures = { path = "../sycamore-futures", version = "0.8.0", optional = true } sycamore-macro = { path = "../sycamore-macro", version = "0.8.0" } sycamore-reactive = { path = "../sycamore-reactive", version = "0.8.0" } sycamore-web = { path = "../sycamore-web", version = "0.8.0", optional = true } -wasm-bindgen = { version = "0.2.79", optional = true } -wasm-bindgen-futures = { version = "0.4.29", optional = true } +wasm-bindgen = { version = "0.2.83", optional = true } +wasm-bindgen-futures = { version = "0.4.33", optional = true } [dependencies.web-sys] features = [ @@ -43,14 +43,13 @@ features = [ "Text", "Window", ] -version = "0.3.56" +version = "0.3.60" optional = true [dev-dependencies] -criterion = "0.3.5" -expect-test = "1.2.2" -tokio = { version = "1.17.0", features = ["macros", "rt"] } -wasm-bindgen-test = "0.3.29" +expect-test = "1.4.0" +tokio = { version = "1.22.0", features = ["macros", "rt"] } +wasm-bindgen-test = "0.3.33" [features] default = ["web", "wasm-bindgen-interning"] @@ -73,15 +72,6 @@ serde = ["sycamore-reactive/serde"] wasm-bindgen-interning = ["web", "wasm-bindgen/enable-interning"] web = ["wasm-bindgen", "web-sys", "js-sys", "sycamore-web"] -[[bench]] -harness = false -name = "reactivity" - -[[bench]] -harness = false -name = "ssr" -required-features = ["ssr"] - [[test]] name = "ssr" required-features = ["ssr"] diff --git a/packages/tools/bench-diff/Cargo.toml b/packages/tools/bench-diff/Cargo.toml index 6b59a27a..0be4b956 100644 --- a/packages/tools/bench-diff/Cargo.toml +++ b/packages/tools/bench-diff/Cargo.toml @@ -2,9 +2,10 @@ name = "bench-diff" version = "0.1.0" edition = "2021" +publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde = { version = "1.0.136", features = ["derive"] } -serde_json = "1.0.79" +serde = { version = "1.0.147", features = ["derive"] } +serde_json = "1.0.89" diff --git a/packages/tools/bench/Cargo.toml b/packages/tools/bench/Cargo.toml new file mode 100644 index 00000000..0b85620f --- /dev/null +++ b/packages/tools/bench/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "bench" +version = "0.1.0" +edition = "2021" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +sycamore = { path = "../../sycamore" } + +[dev-dependencies] +criterion = "0.4.0" + +[[bench]] +harness = false +name = "reactivity" + +[[bench]] +harness = false +name = "ssr" +required-features = ["sycamore/ssr"] diff --git a/packages/sycamore/benches/reactivity.rs b/packages/tools/bench/benches/reactivity.rs similarity index 100% rename from packages/sycamore/benches/reactivity.rs rename to packages/tools/bench/benches/reactivity.rs diff --git a/packages/sycamore/benches/ssr.rs b/packages/tools/bench/benches/ssr.rs similarity index 100% rename from packages/sycamore/benches/ssr.rs rename to packages/tools/bench/benches/ssr.rs diff --git a/packages/tools/bench/src/main.rs b/packages/tools/bench/src/main.rs new file mode 100644 index 00000000..4d2e6b21 --- /dev/null +++ b/packages/tools/bench/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Run `cargo bench`."); +} diff --git a/website/Cargo.toml b/website/Cargo.toml index 4659e313..d9f90260 100644 --- a/website/Cargo.toml +++ b/website/Cargo.toml @@ -8,15 +8,15 @@ edition = "2021" [dependencies] console_error_panic_hook = "0.1.7" console_log = "0.2.0" -js-sys = "0.3.56" -log = "0.4.14" -reqwasm = "0.4.1" -serde-lite = { version = "0.2.0", features = ["derive"] } -serde_json = "1.0.79" +js-sys = "0.3.60" +log = "0.4.17" +reqwasm = "0.5.0" +serde-lite = { version = "0.3.2", features = ["derive"] } +serde_json = "1.0.89" sycamore = { path = "../packages/sycamore", features = ["suspense"] } sycamore-router = { path = "../packages/sycamore-router" } -wasm-bindgen = "0.2.79" +wasm-bindgen = "0.2.83" [dependencies.web-sys] features = ["MediaQueryList", "Storage", "Window"] -version = "0.3.56" +version = "0.3.60"