From 3ddf395772aa24d04cf4e35bbb3a0027c8f1c7dd Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 14 Dec 2021 22:59:34 -0500 Subject: [PATCH 01/21] wip: docs --- Cargo.toml | 24 ++++++++++++------------ README.md | 15 +++++++++------ packages/hooks/Cargo.toml | 2 +- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3ed970f1b..21f2f915f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,34 +40,34 @@ mobile = ["dioxus-mobile"] [dev-dependencies] -futures-util = "0.3.16" +futures-util = "0.3.17" log = "0.4.14" num-format = "0.4.0" separator = "0.4.1" -serde = { version = "1.0.130", features = ["derive"] } +serde = { version = "1.0.131", features = ["derive"] } im-rc = "15.0.0" fxhash = "0.2.1" -anyhow = "1.0.42" +anyhow = "1.0.51" # reqwest = "0.11.4" -serde_json = "1.0.68" -simple_logger = "1.13.0" +serde_json = "1.0.73" +simple_logger = "1.16.0" [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] -argh = "0.1.5" +argh = "0.1.7" env_logger = "0.9.0" -tokio = { version = "1.12.0", features = ["full"] } +tokio = { version = "1.14.0", features = ["full"] } rand = { version = "0.8.4", features = ["small_rng"] } -gloo-timers = "0.2.1" +gloo-timers = "0.2.2" [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -gloo-timers = "0.2.1" +gloo-timers = "0.2.2" wasm-logger = "0.2.0" -console_error_panic_hook = "0.1.6" +console_error_panic_hook = "0.1.7" rand = { version = "0.8.4", features = ["small_rng"] } -wasm-bindgen = { version = "0.2.71", features = ["enable-interning"] } +wasm-bindgen = { version = "0.2.78", features = ["enable-interning"] } [dev-dependencies.getrandom] -version = "0.2" +version = "0.2.3" features = ["js"] diff --git a/README.md b/README.md index 69df6e883..9c9161038 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ Dioxus is a portable, performant, and ergonomic framework for building cross-platform user experiences in Rust. ```rust -fn App(cx: Scope, props: &()) -> Element { - let mut count = use_state(cx, || 0); +fn App(cx: Scope<()>) -> Element { + let mut count = use_state(&cx, || 0); cx.render(rsx!( h1 { "High-Five counter: {count}" } @@ -87,9 +87,11 @@ If you know React, then you already know Dioxus. ## Examples: -| File Navigator (Desktop) | Bluetooth scanner (Desktop) | TodoMVC (All platforms) | Widget Gallery | -| --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | -| [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | ![asd](https://sixtyfps.io/resources/printerdemo_screenshot.png) | [![asd](https://github.com/DioxusLabs/todomvc/blob/master/example.png)](https://github.com/dioxusLabs/todomvc/) | ![asd](https://sixtyfps.io/resources/printerdemo_screenshot.png) | +| File Navigator (Desktop) | Bluetooth scanner (Desktop) | TodoMVC (All platforms) | Widget Gallery | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/todomvc/raw/master/example.png)](https://github.com/dioxusLabs/todomvc/) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | + + See the awesome-dioxus page for a curated list of content in the Dioxus Ecosystem. @@ -159,6 +161,7 @@ Dioxus is heavily inspired by React, but we want your transition to feel like an | Re-hydration | ✅ | ✅ | Pre-render to HTML to speed up first contentful paint | | Jank-Free Rendering | ✅ | ✅ | Large diffs are segmented across frames for silky-smooth transitions | | Effects | ✅ | ✅ | Run effects after a component has been committed to render | +| Portals | 🛠 | ✅ | Render nodes outside of the traditional tree structure | | Cooperative Scheduling | 🛠 | ✅ | Prioritize important events over non-important events | | Server Components | 🛠 | ✅ | Hybrid components for SPA and Server | | Bundle Splitting | 👀 | ✅ | Efficiently and asynchronously load the app | @@ -185,5 +188,5 @@ This project is licensed under the [MIT license]. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Pipette by you, shall be licensed as MIT, without any additional +for inclusion in Dioxus by you, shall be licensed as MIT, without any additional terms or conditions. diff --git a/packages/hooks/Cargo.toml b/packages/hooks/Cargo.toml index 08feb8535..2327308b4 100644 --- a/packages/hooks/Cargo.toml +++ b/packages/hooks/Cargo.toml @@ -8,4 +8,4 @@ edition = "2018" [dependencies] dioxus-core = { path = "../../packages/core", version = "0.1.3" } -futures = "0.3.18" +futures = "0.3" From e495b09bf1c99950b5ea8647b371f296dc64afbe Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 14 Dec 2021 23:01:40 -0500 Subject: [PATCH 02/21] docs: fix table --- README.md | 6 +++--- packages/core/Cargo.toml | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9c9161038..a5f0e8448 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,9 @@ If you know React, then you already know Dioxus. ## Examples: -| File Navigator (Desktop) | Bluetooth scanner (Desktop) | TodoMVC (All platforms) | Widget Gallery | -| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/todomvc/raw/master/example.png)](https://github.com/dioxusLabs/todomvc/) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | +| File Navigator (Desktop) | Bluetooth scanner (Desktop) | TodoMVC (All platforms) | Widget Gallery | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/todomvc/raw/master/example.png)](https://github.com/dioxusLabs/todomvc/) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index f895ec814..deca59cde 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -11,10 +11,10 @@ description = "Core functionality for Dioxus - a concurrent renderer-agnostic Vi [dependencies] # Bumpalo is used as a micro heap backing each component -bumpalo = { version = "3.6.0", features = ["collections", "boxed"] } +bumpalo = { version = "3.6", features = ["collections", "boxed"] } # faster hashmaps -fxhash = "0.2.1" +fxhash = "0.2" # Used in diffing longest-increasing-subsequence = "0.1.0" @@ -24,22 +24,22 @@ log = { version = "0.4", features = ["release_max_level_off"] } futures-util = { version = "0.3.15", default-features = false } -smallvec = "1.6.1" +smallvec = "1.6" -slab = "0.4.3" +slab = "0.4" -futures-channel = "0.3.18" +futures-channel = "0.3" # used for noderefs -once_cell = "1.8.0" +once_cell = "1.8" -indexmap = "1.7.0" +indexmap = "1.7" # Serialize the Edits for use in Webview/Liveview instances serde = { version = "1", features = ["derive"], optional = true } # todo: I want to get rid of this -backtrace = "0.3.63" +backtrace = "0.3" [dev-dependencies] anyhow = "1.0.42" From 4de16c4779648e591b3869b5df31271ae603c812 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 15:56:53 -0500 Subject: [PATCH 03/21] docs: update local examples and docs to support new syntaxes --- .vscode/settings.json | 6 +- README.md | 19 +- docs/guide/src/README.md | 4 +- docs/guide/src/concepts/00-index.md | 2 +- docs/guide/src/concepts/11-arena-memo.md | 6 +- docs/guide/src/concepts/12-signals.md | 10 +- docs/guide/src/concepts/components.md | 4 +- .../src/concepts/conditional_rendering.md | 2 +- .../src/concepts/exporting_components.md | 6 +- docs/guide/src/concepts/interactivity.md | 6 +- docs/guide/src/hello_world.md | 6 +- examples/README.md | 10 +- examples/async.rs | 8 +- examples/borrowed.rs | 12 +- examples/calculator.rs | 18 +- examples/core/alternative.rs | 2 +- examples/core/async.rs | 2 +- examples/core/contextapi.rs | 2 +- examples/core/jsframework.rs | 4 +- examples/core/syntax.rs | 10 +- examples/core/syntax2.rs | 2 +- examples/core/vdom_usage.rs | 2 +- examples/core_reference/antipatterns.rs | 24 +- examples/core_reference/basics.rs | 6 +- examples/core_reference/children.rs | 4 +- .../core_reference/conditional_rendering.rs | 14 +- examples/core_reference/controlled_inputs.rs | 10 +- examples/core_reference/custom_elements.rs | 2 +- examples/core_reference/empty.rs | 2 +- examples/core_reference/errorhandling.rs | 12 +- examples/core_reference/fragments.rs | 8 +- examples/core_reference/global_css.rs | 2 +- examples/core_reference/inline_styles.rs | 4 +- examples/core_reference/iterators.rs | 4 +- examples/core_reference/listener.rs | 10 +- examples/core_reference/memo.rs | 14 +- examples/core_reference/noderefs.rs | 2 +- examples/core_reference/signals.rs | 2 +- examples/core_reference/spreadpattern.rs | 4 +- examples/core_reference/statemanagement.rs | 2 +- examples/core_reference/suspense.rs | 2 +- examples/core_reference/task.rs | 6 +- examples/core_reference/testing.rs | 2 +- examples/core_reference/tostring.rs | 8 +- examples/coroutine.rs | 8 +- examples/crm.rs | 14 +- examples/desktop/crm.rs | 14 +- examples/desktop/demo.rs | 4 +- examples/desktop/todomvc.rs | 12 +- examples/file_explorer.rs | 22 +- examples/framework_benchmark.rs | 20 +- examples/hello_world.rs | 2 +- examples/hydration.rs | 4 +- examples/pattern_model.rs | 12 +- examples/pattern_reducer.rs | 6 +- examples/readme.rs | 6 +- examples/router.rs | 2 +- examples/rsx_usage.rs | 4 +- examples/ssr.rs | 8 +- examples/ssr/basic.rs | 2 +- examples/ssr/tide.rs | 6 +- examples/ssr/tofile.rs | 12 +- examples/tailwind.rs | 12 +- examples/tasks.rs | 6 +- examples/todomvc.rs | 16 +- examples/weather_app.rs | 6 +- examples/web/async_web.rs | 6 +- examples/web/basic.rs | 12 +- examples/web/blah.rs | 6 +- examples/web/btns.rs | 10 +- examples/web/crm2.rs | 14 +- examples/web/demo.rs | 14 +- examples/web_tick.rs | 6 +- examples/webview_web.rs | 6 +- notes/Parity.md | 2 +- notes/SOLVEDPROBLEMS.md | 10 +- packages/core-macro/src/lib.rs | 2 +- packages/core-macro/src/rsx/ambiguous.rs | 6 +- packages/core-macro/src/rsx/component.rs | 9 +- packages/core/Cargo.toml | 4 +- packages/core/README.md | 57 +-- packages/core/architecture.md | 2 + packages/core/benches/jsframework.rs | 8 +- packages/core/examples/borrowed.rs | 18 - packages/core/examples/hooks.rs | 8 +- packages/core/flamegraph.svg | 412 ------------------ packages/core/src/component.rs | 2 +- packages/core/src/diff.rs | 13 +- packages/core/src/nodes.rs | 4 +- packages/core/src/scope.rs | 10 +- packages/core/src/scopearena.rs | 53 +-- packages/core/src/virtual_dom.rs | 8 +- packages/core/tests/lifecycle.rs | 1 - packages/desktop/README.md | 18 +- packages/desktop/examples/async.rs | 6 +- packages/desktop/src/desktop_context.rs | 2 +- packages/desktop/src/lib.rs | 8 +- packages/hooks/Cargo.toml | 5 +- packages/hooks/README.md | 4 +- packages/hooks/src/lib.rs | 3 - packages/hooks/src/usecollection.rs | 4 +- packages/hooks/src/usecoroutine.rs | 2 +- packages/hooks/src/usemodel.rs | 2 +- packages/hooks/src/usestate.rs | 2 +- packages/hooks/src/usestate2.rs | 227 ---------- packages/hooks/src/usetask.rs | 0 packages/liveview/README.md | 2 +- packages/mobile/src/lib.rs | 2 +- packages/router/README.md | 4 +- packages/router/examples/simple.rs | 6 +- packages/ssr/README.md | 8 +- packages/ssr/src/lib.rs | 17 +- packages/web/examples/async.rs | 6 +- packages/web/examples/js_bench.rs | 19 +- packages/web/examples/simple.rs | 8 +- packages/web/examples/suspense.rs | 4 +- packages/web/src/lib.rs | 12 +- src/lib.rs | 115 +++-- 118 files changed, 520 insertions(+), 1154 deletions(-) delete mode 100644 packages/core/flamegraph.svg delete mode 100644 packages/hooks/src/usestate2.rs delete mode 100644 packages/hooks/src/usetask.rs diff --git a/.vscode/settings.json b/.vscode/settings.json index b3bde867c..ac2195ccd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,7 @@ { - "rust-analyzer.cargo.allFeatures": true + "rust-analyzer.cargo.allFeatures": true, + "rust-analyzer.cargo.features": [ + "desktop", + "router" + ], } diff --git a/README.md b/README.md index a5f0e8448..fddea2882 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Dioxus is a portable, performant, and ergonomic framework for building cross-platform user experiences in Rust. ```rust -fn App(cx: Scope<()>) -> Element { +fn app(cx: Scope<()>) -> Element { let mut count = use_state(&cx, || 0); cx.render(rsx!( @@ -76,23 +76,21 @@ If you know React, then you already know Dioxus. - - - - - - + + + + + +
WebDesktopMobileStateDocsToolsWebDesktopMobileStateDocsTools
## Examples: -| File Navigator (Desktop) | Bluetooth scanner (Desktop) | TodoMVC (All platforms) | Widget Gallery | +| File Navigator (Desktop) | Bluetooth scanner (Desktop) | TodoMVC (All platforms) | Tailwind (Liveview) | | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | [![asd](https://github.com/DioxusLabs/todomvc/raw/master/example.png)](https://github.com/dioxusLabs/todomvc/) | [![asd](https://github.com/DioxusLabs/file-explorer-example/raw/master/image.png)](https://github.com/DioxusLabs/file-explorer-example) | - - See the awesome-dioxus page for a curated list of content in the Dioxus Ecosystem. @@ -169,6 +167,7 @@ Dioxus is heavily inspired by React, but we want your transition to feel like an | 1st class global state | ✅ | ✅ | redux/recoil/mobx on top of context | | Runs natively | ✅ | ❓ | runs as a portable binary w/o a runtime (Node) | | Subtree Memoization | ✅ | ❓ | skip diffing static element subtrees | +| High-efficiency templates | 🛠 | ❓ | rsx! calls are translated to templates on the DOM's side | | Compile-time correct | ✅ | ❓ | Throw errors on invalid template layouts | | Heuristic Engine | ✅ | ❓ | track component memory usage to minimize future allocations | | Fine-grained reactivity | 👀 | ❓ | Skip diffing for fine-grain updates | diff --git a/docs/guide/src/README.md b/docs/guide/src/README.md index faf58e309..419828620 100644 --- a/docs/guide/src/README.md +++ b/docs/guide/src/README.md @@ -6,7 +6,7 @@ ```rust fn App(cx: Context, props: &()) -> Element { - let mut count = use_state(cx, || 0); + let mut count = use_state(&cx, || 0); cx.render(rsx!( h1 { "High-Five counter: {count}" } @@ -53,7 +53,7 @@ Dioxus supports server-side rendering! For rendering statically to an `.html` file or from a WebServer, then you'll want to make sure the `ssr` feature is enabled in the `dioxus` crate and use the `dioxus::ssr` API. We don't expect the SSR API to change drastically in the future. ```rust -let contents = dioxus::ssr::render_vdom(&dom, |c| c); +let contents = dioxus::ssr::render_vdom(&dom); ``` [Jump to the getting started guide for SSR.]() diff --git a/docs/guide/src/concepts/00-index.md b/docs/guide/src/concepts/00-index.md index 715c3d69b..cc432cf9a 100644 --- a/docs/guide/src/concepts/00-index.md +++ b/docs/guide/src/concepts/00-index.md @@ -45,7 +45,7 @@ As the UI grows in scale, our logic to keep each element in the proper state wou Instead, with Dioxus, we *declare* what we want our UI to look like: ```rust -let mut state = use_state(cx, || "red"); +let mut state = use_state(&cx, || "red"); cx.render(rsx!( Container { diff --git a/docs/guide/src/concepts/11-arena-memo.md b/docs/guide/src/concepts/11-arena-memo.md index 28eccda24..12f99a1d6 100644 --- a/docs/guide/src/concepts/11-arena-memo.md +++ b/docs/guide/src/concepts/11-arena-memo.md @@ -21,9 +21,9 @@ fn test() -> DomTree { } } -static TestComponent: FC<()> = |cx, props|html!{
"Hello world"
}; +static TestComponent: Component<()> = |cx, props|html!{
"Hello world"
}; -static TestComponent: FC<()> = |cx, props|{ +static TestComponent: Component<()> = |cx, props|{ let g = "BLAH"; html! {
"Hello world"
@@ -31,7 +31,7 @@ static TestComponent: FC<()> = |cx, props|{ }; #[functional_component] -static TestComponent: FC<{ name: String }> = |cx, props|html! {
"Hello {name}"
}; +static TestComponent: Component<{ name: String }> = |cx, props|html! {
"Hello {name}"
}; ``` ## Why this behavior? diff --git a/docs/guide/src/concepts/12-signals.md b/docs/guide/src/concepts/12-signals.md index 5000faebc..3737a4885 100644 --- a/docs/guide/src/concepts/12-signals.md +++ b/docs/guide/src/concepts/12-signals.md @@ -12,7 +12,7 @@ Your component today might look something like this: ```rust fn Comp(cx: Context<()>) -> DomTree { - let (title, set_title) = use_state(cx, || "Title".to_string()); + let (title, set_title) = use_state(&cx, || "Title".to_string()); cx.render(rsx!{ input { value: title, @@ -26,7 +26,7 @@ This component is fairly straightforward - the input updates its own value on ev ```rust fn Comp(cx: Context<()>) -> DomTree { - let (title, set_title) = use_state(cx, || "Title".to_string()); + let (title, set_title) = use_state(&cx, || "Title".to_string()); cx.render(rsx!{ div { input { @@ -96,7 +96,7 @@ Sometimes you want a signal to propagate across your app, either through far-awa ```rust const TITLE: Atom = || "".to_string(); -const Provider: FC<()> = |cx, props|{ +const Provider: Component<()> = |cx, props|{ let title = use_signal(&cx, &TITLE); rsx!(cx, input { value: title }) }; @@ -105,7 +105,7 @@ const Provider: FC<()> = |cx, props|{ If we use the `TITLE` atom in another component, we can cause updates to flow between components without calling render or diffing either component trees: ```rust -const Receiver: FC<()> = |cx, props|{ +const Receiver: Component<()> = |cx, props|{ let title = use_signal(&cx, &TITLE); log::info!("This will only be called once!"); rsx!(cx, @@ -132,7 +132,7 @@ Dioxus automatically understands how to use your signals when mixed with iterato ```rust const DICT: AtomFamily = |_| {}; -const List: FC<()> = |cx, props|{ +const List: Component<()> = |cx, props|{ let dict = use_signal(&cx, &DICT); cx.render(rsx!( ul { diff --git a/docs/guide/src/concepts/components.md b/docs/guide/src/concepts/components.md index ef750f87a..9eb67ab39 100644 --- a/docs/guide/src/concepts/components.md +++ b/docs/guide/src/concepts/components.md @@ -124,7 +124,7 @@ fn VoteButton(cx: Context, props: &VoteButtonProps) -> Element { cx.render(rsx!{ div { class: "votebutton" div { class: "arrow up" } - div { class: "score", "{props.score}"} + div { class: "score", "{cx.props.score}"} div { class: "arrow down" } } }) @@ -147,7 +147,7 @@ struct TitleCardProps<'a> { fn TitleCard(cx: Context, props: &TitleCardProps) -> Element { cx.render(rsx!{ - h1 { "{props.title}" } + h1 { "{cx.props.title}" } }) } ``` diff --git a/docs/guide/src/concepts/conditional_rendering.md b/docs/guide/src/concepts/conditional_rendering.md index e35fce36d..ef62b8701 100644 --- a/docs/guide/src/concepts/conditional_rendering.md +++ b/docs/guide/src/concepts/conditional_rendering.md @@ -83,7 +83,7 @@ fn App(cx: Context, props: &())-> Element { This syntax even enables us to write a one-line component: ```rust -static App: FC<()> = |cx, props| rsx!(cx, "hello world!"); +static App: Component<()> = |cx, props| rsx!(cx, "hello world!"); ``` Alternatively, for match statements, we can just return the builder itself and pass it into a final, single call to `cx.render`: diff --git a/docs/guide/src/concepts/exporting_components.md b/docs/guide/src/concepts/exporting_components.md index 9b5a65ca1..6139a97e6 100644 --- a/docs/guide/src/concepts/exporting_components.md +++ b/docs/guide/src/concepts/exporting_components.md @@ -22,7 +22,7 @@ Let's say our app looks something like this: use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } fn App((cx, props): Component<()>) -> Element {} @@ -87,7 +87,7 @@ In our `main.rs`, we'll want to declare the `post` module so we can access our ` use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } mod post; @@ -186,7 +186,7 @@ Ultimately, including and exporting components is governed by Rust's module syst use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } mod post; diff --git a/docs/guide/src/concepts/interactivity.md b/docs/guide/src/concepts/interactivity.md index bd8ff14aa..63cf6741c 100644 --- a/docs/guide/src/concepts/interactivity.md +++ b/docs/guide/src/concepts/interactivity.md @@ -64,7 +64,7 @@ The most common hook you'll use for storing state is `use_state`. `use_state` pr ```rust fn App(cx: Context, props: &())-> Element { - let post = use_state(cx, || { + let post = use_state(&cx, || { PostData { id: Uuid::new_v4(), score: 10, @@ -112,7 +112,7 @@ For example, let's say we provide a button to generate a new post. Whenever the ```rust fn App(cx: Context, props: &())-> Element { - let post = use_state(cx, || PostData::new()); + let post = use_state(&cx, || PostData::new()); cx.render(rsx!{ button { @@ -135,7 +135,7 @@ We can use tasks in our components to build a tiny stopwatch that ticks every se ```rust fn App(cx: Context, props: &())-> Element { - let mut sec_elapsed = use_state(cx, || 0); + let mut sec_elapsed = use_state(&cx, || 0); cx.spawn_task(async move { TimeoutFuture::from_ms(1000).await; diff --git a/docs/guide/src/hello_world.md b/docs/guide/src/hello_world.md index 2520c286a..2b0cebf87 100644 --- a/docs/guide/src/hello_world.md +++ b/docs/guide/src/hello_world.md @@ -92,7 +92,7 @@ use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } fn App(cx: Context, props: &()) -> Element { @@ -118,7 +118,7 @@ This initialization code launches a Tokio runtime on a helper thread where your ```rust fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } ``` @@ -135,7 +135,7 @@ fn App(cx: Context, props: &()) -> Element { Writing `fn App(cx: Context, props: &()) -> Element {` might become tedious. Rust will also let you write functions as static closures, but these types of Components cannot have props that borrow data. ```rust -static App: FC<()> = |cx, props| cx.render(rsx!(div { "Hello, world!" })); +static App: Component<()> = |cx, props| cx.render(rsx!(div { "Hello, world!" })); ``` ### What is this `Context` object? diff --git a/examples/README.md b/examples/README.md index 06a73db07..2c05466a2 100644 --- a/examples/README.md +++ b/examples/README.md @@ -72,7 +72,7 @@ fn App(cx: Context, props: &()) -> Element { struct ToggleProps { children: Element } fn Toggle(cx: Context, props: &ToggleProps) -> Element { - let mut toggled = use_state(cx, || false); + let mut toggled = use_state(&cx, || false); cx.render(rsx!{ div { {&props.children} @@ -87,7 +87,7 @@ fn Toggle(cx: Context, props: &ToggleProps) -> Element { Controlled inputs: ```rust fn App(cx: Context, props: &()) -> Element { - let value = use_state(cx, String::new); + let value = use_state(&cx, String::new); cx.render(rsx!( input { "type": "text", @@ -123,13 +123,13 @@ fn App(cx: Context, props: &()) -> Element { Tiny components: ```rust -static App: FC<()> = |cx, _| rsx!(cx, div {"hello world!"}); +static App: Component<()> = |cx, _| rsx!(cx, div {"hello world!"}); ``` Borrowed prop contents: ```rust fn App(cx: Context, props: &()) -> Element { - let name = use_state(cx, || String::from("example")); + let name = use_state(&cx, || String::from("example")); rsx!(cx, Child { title: name.as_str() }) } @@ -137,7 +137,7 @@ fn App(cx: Context, props: &()) -> Element { struct ChildProps<'a> { title: &'a str } fn Child(cx: Context, props: &ChildProps) -> Element { - rsx!(cx, "Hello {props.title}") + rsx!(cx, "Hello {cx.props.title}") } ``` diff --git a/examples/async.rs b/examples/async.rs index 7143a9af6..16f28809e 100644 --- a/examples/async.rs +++ b/examples/async.rs @@ -8,12 +8,12 @@ use gloo_timers::future::TimeoutFuture; #[tokio::main] async fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } -pub static App: Component<()> = |cx, _| { - let count = use_state(cx, || 0); - let mut direction = use_state(cx, || 1); +pub static App: Component<()> = |cx| { + let count = use_state(&cx, || 0); + let mut direction = use_state(&cx, || 1); let (async_count, dir) = (count.for_async(), *direction); diff --git a/examples/borrowed.rs b/examples/borrowed.rs index 35ec2cfba..cf497bbc4 100644 --- a/examples/borrowed.rs +++ b/examples/borrowed.rs @@ -17,10 +17,10 @@ and is proven to be safe with MIRI. use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } -fn App(cx: Scope, props: &()) -> Element { +fn App(cx: Scope<()>) -> Element { let text: &mut Vec = cx.use_hook(|_| vec![String::from("abc=def")], |f| f); let first = text.get_mut(0).unwrap(); @@ -39,7 +39,7 @@ struct C1Props<'a> { text: &'a mut String, } -fn Child1(cx: Scope, props: &C1Props) -> Element { +fn Child1<'a>(cx: Scope<'a, C1Props<'a>>) -> Element { let (left, right) = props.text.split_once("=").unwrap(); cx.render(rsx! { @@ -55,7 +55,7 @@ struct C2Props<'a> { text: &'a str, } -fn Child2(cx: Scope, props: &C2Props) -> Element { +fn Child2<'a>(cx: Scope<'a, C2Props<'a>>) -> Element { cx.render(rsx! { Child3 { text: props.text @@ -68,8 +68,8 @@ struct C3Props<'a> { text: &'a str, } -fn Child3(cx: Scope, props: &C3Props) -> Element { +fn Child3<'a>(cx: Scope<'a, C3Props<'a>>) -> Element { cx.render(rsx! { - div { "{props.text}"} + div { "{cx.props.text}"} }) } diff --git a/examples/calculator.rs b/examples/calculator.rs index 442ddb7f8..6a83bfa63 100644 --- a/examples/calculator.rs +++ b/examples/calculator.rs @@ -10,13 +10,13 @@ use dioxus::prelude::*; use separator::Separatable; fn main() { - dioxus::desktop::launch(APP, |cfg| cfg); + dioxus::desktop::launch(APP); } -const APP: Component<()> = |cx, _| { - let cur_val = use_state(cx, || 0.0_f64); - let operator = use_state(cx, || None as Option<&'static str>); - let display_value = use_state(cx, || String::from("")); +static APP: Component<()> = |cx| { + let cur_val = use_state(&cx, || 0.0_f64); + let operator = use_state(&cx, || None as Option<&'static str>); + let display_value = use_state(&cx, || String::from("")); let toggle_percent = move |_| todo!(); let input_digit = move |num: u8| display_value.modify().push_str(num.to_string().as_str()); @@ -117,13 +117,13 @@ const APP: Component<()> = |cx, _| { struct CalculatorKeyProps<'a> { name: &'static str, onclick: &'a dyn Fn(Arc), - children: Element, + children: Element<'a>, } -fn CalculatorKey<'a>(cx: Scope, props: &CalculatorKeyProps) -> Element { +fn CalculatorKey<'a>(cx: Scope<'a, CalculatorKeyProps<'a>>) -> Element { rsx!(cx, button { - class: "calculator-key {props.name}" - onclick: {props.onclick} + class: "calculator-key {cx.props.name}" + onclick: {cx.props.onclick} {&props.children} }) } diff --git a/examples/core/alternative.rs b/examples/core/alternative.rs index 6c20e2adf..a009a88cb 100644 --- a/examples/core/alternative.rs +++ b/examples/core/alternative.rs @@ -9,7 +9,7 @@ fn main() { println!("{}", dom); } -pub static EXAMPLE: FC<()> = |cx, _| { +pub static EXAMPLE: Component<()> = |cx| { let list = (0..10).map(|_f| { rsx! { "{_f}" diff --git a/examples/core/async.rs b/examples/core/async.rs index a21f82652..2919651d2 100644 --- a/examples/core/async.rs +++ b/examples/core/async.rs @@ -5,7 +5,7 @@ fn main() { dom.rebuild(); } -const App: FC<()> = |cx, props| { +const App: Component<()> = |cx| { let id = cx.scope_id(); // cx.submit_task(Box::pin(async move { id })); diff --git a/examples/core/contextapi.rs b/examples/core/contextapi.rs index 6c90a60c7..d538d49ae 100644 --- a/examples/core/contextapi.rs +++ b/examples/core/contextapi.rs @@ -6,7 +6,7 @@ struct SomeContext { } #[allow(unused)] -static Example: FC<()> = |cx, props| { +static Example: Component<()> = |cx| { todo!() // let value = cx.use_context(|c: &SomeContext| c.items.last().unwrap()); diff --git a/examples/core/jsframework.rs b/examples/core/jsframework.rs index 207f6e84e..15c25ec8d 100644 --- a/examples/core/jsframework.rs +++ b/examples/core/jsframework.rs @@ -47,9 +47,9 @@ fn Row<'a>((cx, props): Scope<'a, RowProps>) -> Element<'a> { }; cx.render(rsx! { tr { - // td { class:"col-md-1", "{props.row_id}" } + // td { class:"col-md-1", "{cx.props.row_id}" } // td { class:"col-md-1", onclick: move |_| { /* run onselect */ } - // a { class: "lbl", "{props.label}" } + // a { class: "lbl", "{cx.props.label}" } // } // td { class: "col-md-1" // a { class: "remove", onclick: {handler} diff --git a/examples/core/syntax.rs b/examples/core/syntax.rs index 9a21bc7e6..2339af8ad 100644 --- a/examples/core/syntax.rs +++ b/examples/core/syntax.rs @@ -31,9 +31,9 @@ fn html_usage() { // let p = rsx!(div { {f} }); } -static App2: FC<()> = |cx, _| cx.render(rsx!("hello world!")); +static App2: Component<()> = |cx, _| cx.render(rsx!("hello world!")); -static App: FC<()> = |cx, props| { +static App: Component<()> = |cx| { let name = cx.use_state(|| 0); cx.render(rsx!(div { @@ -71,7 +71,7 @@ struct ChildProps { fn Child<'a>((cx, props): Scope<'a, ChildProps>) -> Element<'a> { cx.render(rsx!(div { - // {props.children} + // {cx.props.children} })) } @@ -99,7 +99,7 @@ impl<'a> Children<'a> { } } -static Bapp: FC<()> = |cx, props| { +static Bapp: Component<()> = |cx| { let name = cx.use_state(|| 0); cx.render(rsx!( @@ -114,7 +114,7 @@ static Bapp: FC<()> = |cx, props| { )) }; -static Match: FC<()> = |cx, props| { +static Match: Component<()> = |cx| { // let b: Box VNode> = Box::new(|f| todo!()); diff --git a/examples/core/syntax2.rs b/examples/core/syntax2.rs index 54c0bedaa..0b3a9e049 100644 --- a/examples/core/syntax2.rs +++ b/examples/core/syntax2.rs @@ -40,7 +40,7 @@ fn t() { // let a = rsx! { // div { // "asd" -// "{props.foo}" +// "{cx.props.foo}" // } // }; diff --git a/examples/core/vdom_usage.rs b/examples/core/vdom_usage.rs index cbe3c324f..844174062 100644 --- a/examples/core/vdom_usage.rs +++ b/examples/core/vdom_usage.rs @@ -4,7 +4,7 @@ use dioxus_core::{lazynodes::LazyNodes, prelude::*}; // #[async_std::main] fn main() { - static App: FC<()> = + static App: Component<()> = |cx, props| cx.render(Some(LazyNodes::new(move |f| f.text(format_args!("hello"))))); let mut dom = VirtualDom::new(App); diff --git a/examples/core_reference/antipatterns.rs b/examples/core_reference/antipatterns.rs index 735a57104..50fecc4f5 100644 --- a/examples/core_reference/antipatterns.rs +++ b/examples/core_reference/antipatterns.rs @@ -32,14 +32,14 @@ use dioxus::prelude::*; struct NoKeysProps { data: std::collections::HashMap, } -static AntipatternNoKeys: FC = |cx, props| { +static AntipatternNoKeys: Component = |cx| { // WRONG: Make sure to add keys! rsx!(cx, ul { - {props.data.iter().map(|(k, v)| rsx!(li { "List item: {v}" }))} + {cx.props.data.iter().map(|(k, v)| rsx!(li { "List item: {v}" }))} }); // RIGHT: Like this: rsx!(cx, ul { - {props.data.iter().map(|(k, v)| rsx!(li { key: "{k}", "List item: {v}" }))} + {cx.props.data.iter().map(|(k, v)| rsx!(li { key: "{k}", "List item: {v}" }))} }) }; @@ -54,7 +54,7 @@ static AntipatternNoKeys: FC = |cx, props| { /// /// Only Component and Fragment nodes are susceptible to this issue. Dioxus mitigates this with components by providing /// an API for registering shared state without the ContextProvider pattern. -static AntipatternNestedFragments: FC<()> = |cx, props| { +static AntipatternNestedFragments: Component<()> = |cx| { // Try to avoid heavily nesting fragments rsx!(cx, Fragment { @@ -82,8 +82,8 @@ static AntipatternNestedFragments: FC<()> = |cx, props| { /// However, calling set_state will *not* update the current version of state in the component. This should be easy to /// recognize from the function signature, but Dioxus will not update the "live" version of state. Calling `set_state` /// merely places a new value in the queue and schedules the component for a future update. -static AntipatternRelyingOnSetState: FC<()> = |cx, props| { - let (state, set_state) = use_state(cx, || "Hello world").classic(); +static AntipatternRelyingOnSetState: Component<()> = |cx| { + let (state, set_state) = use_state(&cx, || "Hello world").classic(); set_state("New state"); // This will return false! `state` will *still* be "Hello world" assert!(state == &"New state"); @@ -99,7 +99,7 @@ static AntipatternRelyingOnSetState: FC<()> = |cx, props| { /// - All components must start with an uppercase character /// /// i.e.: the following component will be rejected when attempted to be used in the rsx! macro -static antipattern_component: FC<()> = |cx, props| todo!(); +static antipattern_component: Component<()> = |cx, props| todo!(); /// Antipattern: Misusing hooks /// --------------------------- @@ -120,11 +120,11 @@ static antipattern_component: FC<()> = |cx, props| todo!(); struct MisuedHooksProps { should_render_state: bool, } -static AntipatternMisusedHooks: FC = |cx, props| { +static AntipatternMisusedHooks: Component = |cx| { if props.should_render_state { // do not place a hook in the conditional! // prefer to move it out of the conditional - let (state, set_state) = use_state(cx, || "hello world").classic(); + let (state, set_state) = use_state(&cx, || "hello world").classic(); rsx!(cx, div { "{state}" }) } else { rsx!(cx, div { "Not rendering state" }) @@ -153,7 +153,7 @@ static AntipatternMisusedHooks: FC = |cx, props| { /// } /// } /// }) -static _example: FC<()> = |cx, props| todo!(); +static _example: Component<()> = |cx, props| todo!(); /// Antipattern: publishing components and hooks with all features enabled /// ---------------------------------------------------------------------- @@ -171,9 +171,9 @@ static _example: FC<()> = |cx, props| todo!(); /// /// This will only include the `core` dioxus crate which is relatively slim and fast to compile and avoids target-specific /// libraries. -static __example: FC<()> = |cx, props| todo!(); +static __example: Component<()> = |cx, props| todo!(); -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { AntipatternNoKeys { data: std::collections::HashMap::new() } AntipatternNestedFragments {} diff --git a/examples/core_reference/basics.rs b/examples/core_reference/basics.rs index 6a3807bb2..11c3a59c3 100644 --- a/examples/core_reference/basics.rs +++ b/examples/core_reference/basics.rs @@ -9,7 +9,7 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { div { Greeting { @@ -25,10 +25,10 @@ struct GreetingProps { name: &'static str, } -static Greeting: FC = |cx, props| { +static Greeting: Component = |cx| { cx.render(rsx! { div { - h1 { "Hello, {props.name}!" } + h1 { "Hello, {cx.props.name}!" } p { "Welcome to the Dioxus framework" } br {} {cx.children()} diff --git a/examples/core_reference/children.rs b/examples/core_reference/children.rs index bdd3108d0..48c940b60 100644 --- a/examples/core_reference/children.rs +++ b/examples/core_reference/children.rs @@ -18,7 +18,7 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { div { Banner { @@ -31,7 +31,7 @@ pub static Example: FC<()> = |cx, props| { }) }; -pub static Banner: FC<()> = |cx, props| { +pub static Banner: Component<()> = |cx| { cx.render(rsx! { div { h1 { "This is a great banner!" } diff --git a/examples/core_reference/conditional_rendering.rs b/examples/core_reference/conditional_rendering.rs index 6a5fe9a64..d73f562e0 100644 --- a/examples/core_reference/conditional_rendering.rs +++ b/examples/core_reference/conditional_rendering.rs @@ -16,10 +16,10 @@ use dioxus::prelude::*; pub struct MyProps { should_show: bool, } -pub static Example0: FC = |cx, props| { +pub static Example0: Component = |cx| { cx.render(rsx! { div { - {props.should_show.then(|| rsx!{ + {cx.props.should_show.then(|| rsx!{ h1 { "showing the title!" } })} } @@ -39,7 +39,7 @@ pub static Example0: FC = |cx, props| { pub struct MyProps1 { should_show: bool, } -pub static Example1: FC = |cx, props| { +pub static Example1: Component = |cx| { cx.render(rsx! { div { // With matching @@ -77,7 +77,7 @@ pub enum Color { pub struct MyProps2 { color: Color, } -pub static Example2: FC = |cx, props| { +pub static Example2: Component = |cx| { cx.render(rsx! { div { {match props.color { @@ -89,9 +89,9 @@ pub static Example2: FC = |cx, props| { }) }; -pub static Example: FC<()> = |cx, props| { - let should_show = use_state(cx, || false); - let mut color_index = use_state(cx, || 0); +pub static Example: Component<()> = |cx| { + let should_show = use_state(&cx, || false); + let mut color_index = use_state(&cx, || 0); let color = match *color_index % 2 { 2 => Color::Green, 1 => Color::Yellow, diff --git a/examples/core_reference/controlled_inputs.rs b/examples/core_reference/controlled_inputs.rs index bdabe83d2..2c97ec1ff 100644 --- a/examples/core_reference/controlled_inputs.rs +++ b/examples/core_reference/controlled_inputs.rs @@ -1,7 +1,7 @@ use dioxus::prelude::*; fn main() {} -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { div { @@ -10,8 +10,8 @@ pub static Example: FC<()> = |cx, props| { }; // A controlled component: -static ControlledSelect: FC<()> = |cx, props| { - let value = use_state(cx, || String::from("Grapefruit")); +static ControlledSelect: Component<()> = |cx| { + let value = use_state(&cx, || String::from("Grapefruit")); cx.render(rsx! { select { value: "{value}", onchange: move |evt| value.set(evt.value()), option { value: "Grapefruit", "Grapefruit"} @@ -23,8 +23,8 @@ static ControlledSelect: FC<()> = |cx, props| { }; // TODO - how do uncontrolled things work? -static UncontrolledSelect: FC<()> = |cx, props| { - let value = use_state(cx, || String::new()); +static UncontrolledSelect: Component<()> = |cx| { + let value = use_state(&cx, || String::new()); cx.render(rsx! { select { diff --git a/examples/core_reference/custom_elements.rs b/examples/core_reference/custom_elements.rs index 053b3aea5..63024213a 100644 --- a/examples/core_reference/custom_elements.rs +++ b/examples/core_reference/custom_elements.rs @@ -11,7 +11,7 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { div { custom_element { diff --git a/examples/core_reference/empty.rs b/examples/core_reference/empty.rs index 28914bd6b..aebf7e71f 100644 --- a/examples/core_reference/empty.rs +++ b/examples/core_reference/empty.rs @@ -5,4 +5,4 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| cx.render(rsx! { Fragment {} }); +pub static Example: Component<()> = |cx, props| cx.render(rsx! { Fragment {} }); diff --git a/examples/core_reference/errorhandling.rs b/examples/core_reference/errorhandling.rs index e598726e5..cc21a62f9 100644 --- a/examples/core_reference/errorhandling.rs +++ b/examples/core_reference/errorhandling.rs @@ -23,14 +23,14 @@ fn main() {} /// This is one way to go about error handling (just toss things away with unwrap). /// However, if you get it wrong, the whole app will crash. /// This is pretty flimsy. -static App: FC<()> = |cx, props| { +static App: Component<()> = |cx| { let data = get_data().unwrap(); cx.render(rsx!( div { "{data}" } )) }; /// This is a pretty verbose way of error handling /// However, it's still pretty good since we don't panic, just fail to render anything -static App1: FC<()> = |cx, props| { +static App1: Component<()> = |cx| { let data = match get_data() { Some(data) => data, None => return None, @@ -46,7 +46,7 @@ static App1: FC<()> = |cx, props| { /// a user is logged in. /// /// Dioxus will throw an error in the console if the None-path is ever taken. -static App2: FC<()> = |cx, props| { +static App2: Component<()> = |cx| { let data = get_data()?; cx.render(rsx!( div { "{data}" } )) }; @@ -54,14 +54,14 @@ static App2: FC<()> = |cx, props| { /// This is top-tier error handling since it displays a failure state. /// /// However, the error is lacking in context. -static App3: FC<()> = |cx, props| match get_data() { +static App3: Component<()> = |cx, props| match get_data() { Some(data) => cx.render(rsx!( div { "{data}" } )), None => cx.render(rsx!( div { "Failed to load data :(" } )), }; /// For errors that return results, it's possible to short-circuit the match-based error handling with `.ok()` which converts /// a Result into an Option and lets you abort rendering by early-returning `None` -static App4: FC<()> = |cx, props| { +static App4: Component<()> = |cx| { let data = get_data_err().ok()?; cx.render(rsx!( div { "{data}" } )) }; @@ -69,7 +69,7 @@ static App4: FC<()> = |cx, props| { /// This is great error handling since it displays a failure state... with context! /// /// Hopefully you'll never need to display a screen like this. It's rather bad taste -static App5: FC<()> = |cx, props| match get_data_err() { +static App5: Component<()> = |cx, props| match get_data_err() { Ok(data) => cx.render(rsx!( div { "{data}" } )), Err(c) => cx.render(rsx!( div { "Failed to load data: {c}" } )), }; diff --git a/examples/core_reference/fragments.rs b/examples/core_reference/fragments.rs index 88c9dcaea..0532abd27 100644 --- a/examples/core_reference/fragments.rs +++ b/examples/core_reference/fragments.rs @@ -11,7 +11,7 @@ use dioxus::prelude::*; // Returning multiple elements with rsx! or html! -static App1: FC<()> = |cx, props| { +static App1: Component<()> = |cx| { cx.render(rsx! { h1 { } h2 { } @@ -20,7 +20,7 @@ static App1: FC<()> = |cx, props| { }; // Using the Fragment component -static App2: FC<()> = |cx, props| { +static App2: Component<()> = |cx| { cx.render(rsx! { Fragment { div {} @@ -31,7 +31,7 @@ static App2: FC<()> = |cx, props| { }; // Using the `fragment` method on the NodeFactory -static App3: FC<()> = |cx, props| { +static App3: Component<()> = |cx| { cx.render(LazyNodes::new(move |fac| { fac.fragment_from_iter([ fac.text(format_args!("A")), @@ -42,7 +42,7 @@ static App3: FC<()> = |cx, props| { })) }; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { App1 {} App2 {} diff --git a/examples/core_reference/global_css.rs b/examples/core_reference/global_css.rs index 5e7c75a8c..6b7de70f0 100644 --- a/examples/core_reference/global_css.rs +++ b/examples/core_reference/global_css.rs @@ -19,7 +19,7 @@ h1 {color: blue;} p {color: red;} "#; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { head { style { "{STYLE}" } } body { diff --git a/examples/core_reference/inline_styles.rs b/examples/core_reference/inline_styles.rs index e3a45154c..c60364b75 100644 --- a/examples/core_reference/inline_styles.rs +++ b/examples/core_reference/inline_styles.rs @@ -10,7 +10,7 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { head { style: { background_color: "powderblue" } @@ -29,7 +29,7 @@ pub static Example: FC<()> = |cx, props| { // .... technically the rsx! macro is slightly broken at the moment and allows styles not wrapped in style {} // I haven't noticed any name collisions yet, and am tentatively leaving this behavior in.. // Don't rely on it. -static Example2: FC<()> = |cx, props| { +static Example2: Component<()> = |cx| { cx.render(rsx! { div { color: "red" "hello world!" diff --git a/examples/core_reference/iterators.rs b/examples/core_reference/iterators.rs index f8feae8a8..55d725a21 100644 --- a/examples/core_reference/iterators.rs +++ b/examples/core_reference/iterators.rs @@ -12,8 +12,8 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| { - let example_data = use_state(cx, || 0); +pub static Example: Component<()> = |cx| { + let example_data = use_state(&cx, || 0); let v = (0..10).map(|f| { rsx! { diff --git a/examples/core_reference/listener.rs b/examples/core_reference/listener.rs index 63813e423..891ee3743 100644 --- a/examples/core_reference/listener.rs +++ b/examples/core_reference/listener.rs @@ -7,7 +7,7 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { ButtonList {} NonUpdatingEvents {} @@ -16,8 +16,8 @@ pub static Example: FC<()> = |cx, props| { }; /// We can use `set_name` in multiple closures; the closures automatically *copy* the reference to set_name. -static ButtonList: FC<()> = |cx, props| { - let name = use_state(cx, || "...?"); +static ButtonList: Component<()> = |cx| { + let name = use_state(&cx, || "...?"); let names = ["jack", "jill", "john", "jane"] .iter() @@ -33,7 +33,7 @@ static ButtonList: FC<()> = |cx, props| { /// This shows how listeners may be without a visible change in the display. /// Check the console. -static NonUpdatingEvents: FC<()> = |cx, props| { +static NonUpdatingEvents: Component<()> = |cx| { rsx!(cx, div { button { onclick: move |_| log::info!("Did not cause any updates!") @@ -42,7 +42,7 @@ static NonUpdatingEvents: FC<()> = |cx, props| { }) }; -static DisablePropagation: FC<()> = |cx, props| { +static DisablePropagation: Component<()> = |cx| { rsx!(cx, div { onclick: move |_| log::info!("event propagated to the div!") diff --git a/examples/core_reference/memo.rs b/examples/core_reference/memo.rs index 40aa54191..86831842b 100644 --- a/examples/core_reference/memo.rs +++ b/examples/core_reference/memo.rs @@ -21,7 +21,7 @@ use dioxus::prelude::*; // By default, components with no props are always memoized. // A props of () is considered empty. -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { div { "100% memoized!" } }) @@ -35,9 +35,9 @@ pub struct MyProps1 { name: String, } -pub static Example1: FC = |cx, props| { +pub static Example1: Component = |cx| { cx.render(rsx! { - div { "100% memoized! {props.name}" } + div { "100% memoized! {cx.props.name}" } }) }; @@ -49,9 +49,9 @@ pub struct MyProps2 { name: std::rc::Rc, } -pub static Example2: FC = |cx, props| { +pub static Example2: Component = |cx| { cx.render(rsx! { - div { "100% memoized! {props.name}" } + div { "100% memoized! {cx.props.name}" } }) }; @@ -61,11 +61,11 @@ pub struct MyProps3<'a> { name: &'a str, } // We need to manually specify a lifetime that ensures props and scope (the component's state) share the same lifetime. -// Using the `pub static Example: FC<()>` pattern _will_ specify a lifetime, but that lifetime will be static which might +// Using the `pub static Example: Component<()>` pattern _will_ specify a lifetime, but that lifetime will be static which might // not exactly be what you want fn Example3<'a>(cx: Context<'a>, props: &'a MyProps3) -> DomTree<'a> { cx.render(rsx! { - div { "Not memoized! {props.name}" } + div { "Not memoized! {cx.props.name}" } }) } diff --git a/examples/core_reference/noderefs.rs b/examples/core_reference/noderefs.rs index 8d22ee5b4..c520abdca 100644 --- a/examples/core_reference/noderefs.rs +++ b/examples/core_reference/noderefs.rs @@ -1,7 +1,7 @@ use dioxus::prelude::*; fn main() {} -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { let p = 10; cx.render(rsx! { diff --git a/examples/core_reference/signals.rs b/examples/core_reference/signals.rs index 2e69d8e66..06fb6ab1b 100644 --- a/examples/core_reference/signals.rs +++ b/examples/core_reference/signals.rs @@ -1,7 +1,7 @@ use dioxus::prelude::*; fn main() {} -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { div { diff --git a/examples/core_reference/spreadpattern.rs b/examples/core_reference/spreadpattern.rs index 58a813cb5..c197f87e6 100644 --- a/examples/core_reference/spreadpattern.rs +++ b/examples/core_reference/spreadpattern.rs @@ -9,7 +9,7 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { let props = MyProps { count: 0, live: true, @@ -27,7 +27,7 @@ pub struct MyProps { name: &'static str, } -pub static Example1: FC = |cx, MyProps { count, live, name }| { +pub static Example1: Component = |cx, MyProps { count, live, name }| { cx.render(rsx! { div { h1 { "Hello, {name}"} diff --git a/examples/core_reference/statemanagement.rs b/examples/core_reference/statemanagement.rs index 2e69d8e66..06fb6ab1b 100644 --- a/examples/core_reference/statemanagement.rs +++ b/examples/core_reference/statemanagement.rs @@ -1,7 +1,7 @@ use dioxus::prelude::*; fn main() {} -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { div { diff --git a/examples/core_reference/suspense.rs b/examples/core_reference/suspense.rs index e3bbd2574..bbe536d3e 100644 --- a/examples/core_reference/suspense.rs +++ b/examples/core_reference/suspense.rs @@ -14,7 +14,7 @@ struct DogApi { } const ENDPOINT: &str = "https://dog.ceo/api/breeds/image/random"; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { let doggo = use_suspense( cx, || surf::get(ENDPOINT).recv_json::(), diff --git a/examples/core_reference/task.rs b/examples/core_reference/task.rs index a5e877bc6..7fad94381 100644 --- a/examples/core_reference/task.rs +++ b/examples/core_reference/task.rs @@ -24,9 +24,9 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| { - let count = use_state(cx, || 0); - let mut direction = use_state(cx, || 1); +pub static Example: Component<()> = |cx| { + let count = use_state(&cx, || 0); + let mut direction = use_state(&cx, || 1); // Tasks are 'static, so we need to copy relevant items in let (async_count, dir) = (count.for_async(), *direction); diff --git a/examples/core_reference/testing.rs b/examples/core_reference/testing.rs index 587ce19cc..ec10acaa3 100644 --- a/examples/core_reference/testing.rs +++ b/examples/core_reference/testing.rs @@ -1,6 +1,6 @@ use dioxus::prelude::*; -pub static Example: FC<()> = |cx, props| { +pub static Example: Component<()> = |cx| { cx.render(rsx! { div { diff --git a/examples/core_reference/tostring.rs b/examples/core_reference/tostring.rs index a04a165da..09f8d95d1 100644 --- a/examples/core_reference/tostring.rs +++ b/examples/core_reference/tostring.rs @@ -1,13 +1,13 @@ use dioxus::prelude::*; use dioxus::ssr; -pub static Example: FC<()> = |cx, props| { - let as_string = use_state(cx, || { +pub static Example: Component<()> = |cx| { + let as_string = use_state(&cx, || { // Currently, SSR is only supported for whole VirtualDOMs // This is an easy/low hanging fruit to improve upon let mut dom = VirtualDom::new(SomeApp); dom.rebuild(); - ssr::render_vdom(&dom, |c| c) + ssr::render_vdom(&dom) }); cx.render(rsx! { @@ -15,7 +15,7 @@ pub static Example: FC<()> = |cx, props| { }) }; -static SomeApp: FC<()> = |cx, props| { +static SomeApp: Component<()> = |cx| { cx.render(rsx! { div { style: {background_color: "blue"} h1 {"Some amazing app or component"} diff --git a/examples/coroutine.rs b/examples/coroutine.rs index 61bed91c3..e112c2995 100644 --- a/examples/coroutine.rs +++ b/examples/coroutine.rs @@ -22,14 +22,14 @@ //! the coroutine was initiated. `use_state` always returns the same setter, so you don't need to worry about fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } use dioxus::prelude::*; -static App: Component<()> = |cx, props| { - let p1 = use_state(cx, || 0); - let p2 = use_state(cx, || 0); +static App: Component<()> = |cx| { + let p1 = use_state(&cx, || 0); + let p2 = use_state(&cx, || 0); let (mut p1_async, mut p2_async) = (p1.for_async(), p2.for_async()); let (p1_handle, _) = use_coroutine(cx, || async move { diff --git a/examples/crm.rs b/examples/crm.rs index f146e0856..2ae7d3ee0 100644 --- a/examples/crm.rs +++ b/examples/crm.rs @@ -4,7 +4,7 @@ Tiny CRM: A port of the Yew CRM example to Dioxus. use dioxus::prelude::*; fn main() { - dioxus::web::launch(App, |c| c); + dioxus::web::launch(App); } enum Scene { ClientsList, @@ -19,13 +19,13 @@ pub struct Client { pub description: String, } -static App: Component<()> = |cx, _| { - let mut clients = use_ref(cx, || vec![] as Vec); - let mut scene = use_state(cx, || Scene::ClientsList); +static App: Component<()> = |cx| { + let mut clients = use_ref(&cx, || vec![] as Vec); + let mut scene = use_state(&cx, || Scene::ClientsList); - let mut firstname = use_state(cx, || String::new()); - let mut lastname = use_state(cx, || String::new()); - let mut description = use_state(cx, || String::new()); + let mut firstname = use_state(&cx, || String::new()); + let mut lastname = use_state(&cx, || String::new()); + let mut description = use_state(&cx, || String::new()); let scene = match *scene { Scene::ClientsList => { diff --git a/examples/desktop/crm.rs b/examples/desktop/crm.rs index 8cc5b2988..f216f884f 100644 --- a/examples/desktop/crm.rs +++ b/examples/desktop/crm.rs @@ -5,7 +5,7 @@ use dioxus_hooks::*; use dioxus_html as dioxus_elements; fn main() { - dioxus_desktop::launch(App, |c| c) + dioxus_desktop::launch(App) } enum Scene { @@ -21,13 +21,13 @@ pub struct Client { pub description: String, } -static App: FC<()> = |cx, _| { - let mut scene = use_state(cx, || Scene::ClientsList); - let clients = use_ref(cx, || vec![] as Vec); +static App: Component<()> = |cx| { + let mut scene = use_state(&cx, || Scene::ClientsList); + let clients = use_ref(&cx, || vec![] as Vec); - let mut firstname = use_state(cx, String::new); - let mut lastname = use_state(cx, String::new); - let mut description = use_state(cx, String::new); + let mut firstname = use_state(&cx, String::new); + let mut lastname = use_state(&cx, String::new); + let mut description = use_state(&cx, String::new); let scene = match scene.get() { Scene::ClientsList => { diff --git a/examples/desktop/demo.rs b/examples/desktop/demo.rs index 77a927e99..d327b7f32 100644 --- a/examples/desktop/demo.rs +++ b/examples/desktop/demo.rs @@ -5,10 +5,10 @@ use dioxus_core_macro::*; use dioxus_html as dioxus_elements; fn main() { - dioxus_desktop::launch(App, |c| c); + dioxus_desktop::launch(App); } -static App: FC<()> = |cx, props| { +static App: Component<()> = |cx| { cx.render(rsx!( div { "hello world!" diff --git a/examples/desktop/todomvc.rs b/examples/desktop/todomvc.rs index d8edf40e4..2674d9dee 100644 --- a/examples/desktop/todomvc.rs +++ b/examples/desktop/todomvc.rs @@ -14,7 +14,7 @@ fn main() { SimpleLogger::new().init().unwrap(); } - dioxus_desktop::launch(App, |c| c) + dioxus_desktop::launch(App) } #[derive(PartialEq)] @@ -32,14 +32,14 @@ pub struct TodoItem { } pub type Todos = HashMap; -pub static App: FC<()> = |cx, _| { +pub static App: Component<()> = |cx| { // Share our TodoList to the todos themselves use_provide_state(cx, Todos::new); // Save state for the draft, filter - let draft = use_state(cx, || "".to_string()); - let filter = use_state(cx, || FilterState::All); - let mut todo_id = use_state(cx, || 0); + let draft = use_state(&cx, || "".to_string()); + let filter = use_state(&cx, || FilterState::All); + let mut todo_id = use_state(&cx, || 0); // Consume the todos let todos = use_shared_state::(cx)?; @@ -142,7 +142,7 @@ pub fn TodoEntry((cx, props): Scope) -> Element { let _todos = todos.read(); let todo = _todos.get(&props.id)?; - let is_editing = use_state(cx, || false); + let is_editing = use_state(&cx, || false); let completed = if todo.checked { "completed" } else { "" }; cx.render(rsx!{ diff --git a/examples/file_explorer.rs b/examples/file_explorer.rs index 74ea6a7d9..98b729896 100644 --- a/examples/file_explorer.rs +++ b/examples/file_explorer.rs @@ -9,7 +9,7 @@ use dioxus::prelude::*; fn main() { simple_logger::init_with_level(log::Level::Debug); - dioxus::desktop::launch(App, |c| { + dioxus::desktop::launch_cfg(App, |c| { c.with_window(|w| { w.with_resizable(true).with_inner_size( dioxus::desktop::wry::application::dpi::LogicalSize::new(400.0, 800.0), @@ -18,8 +18,8 @@ fn main() { }); } -static App: Component<()> = |cx, props| { - let file_manager = use_ref(cx, || Files::new()); +static App: Component<()> = |cx| { + let file_manager = use_ref(&cx, Files::new); let files = file_manager.read(); let file_list = files.path_names.iter().enumerate().map(|(dir_id, path)| { @@ -39,13 +39,15 @@ static App: Component<()> = |cx, props| { let current_dir = files.current(); - rsx!(cx, div { - h1 {"Files: "} - h3 {"Cur dir: {current_dir}"} - button { "go up", onclick: move |_| file_manager.write().go_up() } - ol { {file_list} } - {err_disp} - }) + cx.render(rsx!( + div { + h1 {"Files: "} + h3 {"Cur dir: {current_dir}"} + button { "go up", onclick: move |_| file_manager.write().go_up() } + ol { {file_list} } + {err_disp} + } + )) }; struct Files { diff --git a/examples/framework_benchmark.rs b/examples/framework_benchmark.rs index 44fe202e1..fada80ad4 100644 --- a/examples/framework_benchmark.rs +++ b/examples/framework_benchmark.rs @@ -2,8 +2,8 @@ use dioxus::prelude::*; use rand::prelude::*; fn main() { - dioxus::web::launch(App, |c| c); - // dioxus::desktop::launch(App, |c| c); + dioxus::web::launch(App); + // dioxus::desktop::launch(App); } #[derive(Clone, PartialEq)] @@ -30,9 +30,9 @@ impl Label { } } -static App: Component<()> = |cx, _props| { - let mut items = use_ref(cx, || vec![]); - let mut selected = use_state(cx, || None); +static App: Component<()> = |cx| { + let mut items = use_ref(&cx, || vec![]); + let mut selected = use_state(&cx, || None); cx.render(rsx! { div { class: "container" @@ -95,10 +95,10 @@ struct ActionButtonProps<'a> { onclick: &'a dyn Fn(), } -fn ActionButton(cx: Scope, props: &ActionButtonProps) -> Element { +fn ActionButton<'a>(cx: Scope<'a, ActionButtonProps<'a>>) -> Element { rsx!(cx, div { class: "col-sm-6 smallpad" - button { class:"btn btn-primary btn-block", r#type: "button", id: "{props.id}", onclick: move |_| (props.onclick)(), - "{props.name}" + button { class:"btn btn-primary btn-block", r#type: "button", id: "{cx.props.id}", onclick: move |_| (props.onclick)(), + "{cx.props.name}" } }) } @@ -149,9 +149,9 @@ static NOUNS: &[&str] = &[ // fn Row(cx: Context, props: &RowProps) -> Element { // rsx!(cx, tr { -// td { class:"col-md-1", "{props.row_id}" } +// td { class:"col-md-1", "{cx.props.row_id}" } // td { class:"col-md-1", onclick: move |_| { /* run onselect */ } -// a { class: "lbl", {props.label.labels} } +// a { class: "lbl", {cx.props.label.labels} } // } // td { class: "col-md-1" // a { class: "remove", onclick: move |_| {/* remove */} diff --git a/examples/hello_world.rs b/examples/hello_world.rs index e6c874ba5..f788f9791 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -1,7 +1,7 @@ use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } fn App((cx, props): ScopeState<()>) -> Element { diff --git a/examples/hydration.rs b/examples/hydration.rs index 22a81ffe7..8189f7cdd 100644 --- a/examples/hydration.rs +++ b/examples/hydration.rs @@ -19,8 +19,8 @@ fn main() { dioxus::desktop::launch(App, |c| c.with_prerendered(content)); } -static App: Component<()> = |cx, props| { - let mut val = use_state(cx, || 0); +static App: Component<()> = |cx| { + let mut val = use_state(&cx, || 0); cx.render(rsx! { div { diff --git a/examples/pattern_model.rs b/examples/pattern_model.rs index d0a9e7290..f59a548cb 100644 --- a/examples/pattern_model.rs +++ b/examples/pattern_model.rs @@ -16,13 +16,13 @@ //! RefMuts at the same time. use dioxus::desktop::wry::application::dpi::LogicalSize; -use dioxus::events::{on::*, KeyCode}; +use dioxus::events::*; use dioxus::prelude::*; const STYLE: &str = include_str!("./assets/calculator.css"); fn main() { env_logger::init(); - dioxus::desktop::launch(App, |cfg| { + dioxus::desktop::launch_cfg(App, |cfg| { cfg.with_window(|w| { w.with_title("Calculator Demo") .with_resizable(false) @@ -31,8 +31,8 @@ fn main() { }); } -static App: Component<()> = |cx, props| { - let state = use_ref(cx, || Calculator::new()); +static App: Component<()> = |cx| { + let state = use_ref(&cx, || Calculator::new()); let clear_display = state.read().display_value.eq("0"); let clear_text = if clear_display { "C" } else { "AC" }; @@ -80,8 +80,8 @@ struct CalculatorKeyProps<'a> { fn CalculatorKey<'a>((cx, props): ScopeState<'a, CalculatorKeyProps<'a>>) -> Element<'a> { cx.render(rsx! { button { - class: "calculator-key {props.name}" - onclick: {props.onclick} + class: "calculator-key {cx.props.name}" + onclick: {cx.props.onclick} {&props.children} } }) diff --git a/examples/pattern_reducer.rs b/examples/pattern_reducer.rs index 42c1976f9..7441516a3 100644 --- a/examples/pattern_reducer.rs +++ b/examples/pattern_reducer.rs @@ -8,11 +8,11 @@ use dioxus::prelude::*; fn main() { env_logger::init(); - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } -pub static App: Component<()> = |cx, _| { - let state = use_state(cx, PlayerState::new); +pub static App: Component<()> = |cx| { + let state = use_state(&cx, PlayerState::new); let is_playing = state.is_playing(); diff --git a/examples/readme.rs b/examples/readme.rs index afff68f87..aa4cd9a8a 100644 --- a/examples/readme.rs +++ b/examples/readme.rs @@ -4,11 +4,11 @@ use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } -static App: Component<()> = |cx, props| { - let mut count = use_state(cx, || 0); +static App: Component<()> = |cx| { + let mut count = use_state(&cx, || 0); cx.render(rsx! { div { diff --git a/examples/router.rs b/examples/router.rs index 66b86f56d..be055fe9e 100644 --- a/examples/router.rs +++ b/examples/router.rs @@ -23,7 +23,7 @@ pub enum Route { NotFound, } -static App: Component<()> = |cx, props| { +static App: Component<()> = |cx| { let route = use_router(cx, Route::parse)?; cx.render(rsx! { diff --git a/examples/rsx_usage.rs b/examples/rsx_usage.rs index e27d4c828..9b6283d92 100644 --- a/examples/rsx_usage.rs +++ b/examples/rsx_usage.rs @@ -39,7 +39,7 @@ //! - Allow top-level fragments //! fn main() { - dioxus::desktop::launch(Example, |c| c); + dioxus::desktop::launch(Example); } /// When trying to return "nothing" to Dioxus, you'll need to specify the type parameter or Rust will be sad. @@ -49,7 +49,7 @@ const NONE_ELEMENT: Option<()> = None; use baller::Baller; use dioxus::prelude::*; -pub static Example: Component<()> = |cx, props| { +pub static Example: Component<()> = |cx| { let formatting = "formatting!"; let formatting_tuple = ("a", "b"); let lazy_fmt = format_args!("lazily formatted text"); diff --git a/examples/ssr.rs b/examples/ssr.rs index e23251ada..542417c00 100644 --- a/examples/ssr.rs +++ b/examples/ssr.rs @@ -5,11 +5,11 @@ use dioxus::ssr; fn main() { let mut vdom = VirtualDom::new(App); - // vdom.rebuild_in_place().expect("Rebuilding failed"); - println!("{}", ssr::render_vdom(&vdom, |c| c)); + vdom.rebuild_in_place().expect("Rebuilding failed"); + println!("{}", ssr::render_vdom(&vdom)); } -static App: Component<()> = |cx, props| { +static App: Component<()> = |cx| { cx.render(rsx!( div { h1 { "Title" } @@ -21,6 +21,6 @@ static App: Component<()> = |cx, props| { struct MyProps<'a> { text: &'a str, } -fn App2(cx: Scope, props: &MyProps) -> Element { +fn App2<'a>(cx: Scope<'a, MyProps<'a>>) -> Element { None } diff --git a/examples/ssr/basic.rs b/examples/ssr/basic.rs index c89c425e3..89b976d42 100644 --- a/examples/ssr/basic.rs +++ b/examples/ssr/basic.rs @@ -12,7 +12,7 @@ fn main() { ) } -pub static App: FC<()> = |cx, props| { +pub static App: Component<()> = |cx| { cx.render(rsx!( div { class: "overflow-hidden" diff --git a/examples/ssr/tide.rs b/examples/ssr/tide.rs index d86fbdf55..d7255b91d 100644 --- a/examples/ssr/tide.rs +++ b/examples/ssr/tide.rs @@ -26,7 +26,7 @@ fn main() {} // dom.rebuild(); // Ok(Response::builder(200) -// .body(format!("{}", dioxus_ssr::render_vdom(&dom, |c| c))) +// .body(format!("{}", dioxus_ssr::render_vdom(&dom))) // .content_type(tide::http::mime::HTML) // .build()) // }); @@ -42,8 +42,8 @@ fn main() {} // initial_name: String, // } -// static Example: FC = |cx, props| { -// let dispaly_name = use_state(cx, move || props.initial_name.clone()); +// static Example: Component = |cx| { +// let dispaly_name = use_state(&cx, move || props.initial_name.clone()); // cx.render(rsx! { // div { class: "py-12 px-4 text-center w-full max-w-2xl mx-auto", diff --git a/examples/ssr/tofile.rs b/examples/ssr/tofile.rs index e3091580a..8440074e8 100644 --- a/examples/ssr/tofile.rs +++ b/examples/ssr/tofile.rs @@ -24,7 +24,7 @@ fn main() { .unwrap(); } -pub static App: FC<()> = |cx, props| { +pub static App: Component<()> = |cx| { cx.render(rsx!( div { class: "overflow-hidden" link { href:"https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel:"stylesheet" } @@ -39,7 +39,7 @@ pub static App: FC<()> = |cx, props| { )) }; -pub static Header: FC<()> = |cx, props| { +pub static Header: Component<()> = |cx| { cx.render(rsx! { div { header { class: "text-gray-400 bg-gray-900 body-font" @@ -65,7 +65,7 @@ pub static Header: FC<()> = |cx, props| { }) }; -pub static Hero: FC<()> = |cx, props| { +pub static Hero: Component<()> = |cx| { // cx.render(rsx! { section{ class: "text-gray-400 bg-gray-900 body-font" @@ -103,7 +103,7 @@ pub static Hero: FC<()> = |cx, props| { } }) }; -pub static Entry: FC<()> = |cx, props| { +pub static Entry: Component<()> = |cx| { // cx.render(rsx! { section{ class: "text-gray-400 bg-gray-900 body-font" @@ -116,7 +116,7 @@ pub static Entry: FC<()> = |cx, props| { }) }; -pub static StacksIcon: FC<()> = |cx, props| { +pub static StacksIcon: Component<()> = |cx| { cx.render(rsx!( svg { xmlns: "http://www.w3.org/2000/svg" @@ -131,7 +131,7 @@ pub static StacksIcon: FC<()> = |cx, props| { } )) }; -pub static RightArrowIcon: FC<()> = |cx, props| { +pub static RightArrowIcon: Component<()> = |cx| { cx.render(rsx!( svg { fill: "none" diff --git a/examples/tailwind.rs b/examples/tailwind.rs index 555d13d5d..70a0448fd 100644 --- a/examples/tailwind.rs +++ b/examples/tailwind.rs @@ -14,7 +14,7 @@ fn main() { const STYLE: &str = "body {overflow:hidden;}"; -pub static App: Component<()> = |cx, props| { +pub static App: Component<()> = |cx| { cx.render(rsx!( div { class: "overflow-hidden" style { "{STYLE}" } @@ -30,7 +30,7 @@ pub static App: Component<()> = |cx, props| { )) }; -pub static Header: Component<()> = |cx, props| { +pub static Header: Component<()> = |cx| { cx.render(rsx! { div { header { class: "text-gray-400 bg-gray-900 body-font" @@ -56,7 +56,7 @@ pub static Header: Component<()> = |cx, props| { }) }; -pub static Hero: Component<()> = |cx, props| { +pub static Hero: Component<()> = |cx| { // cx.render(rsx! { section{ class: "text-gray-400 bg-gray-900 body-font" @@ -94,7 +94,7 @@ pub static Hero: Component<()> = |cx, props| { } }) }; -pub static Entry: Component<()> = |cx, props| { +pub static Entry: Component<()> = |cx| { // cx.render(rsx! { section{ class: "text-gray-400 bg-gray-900 body-font" @@ -107,7 +107,7 @@ pub static Entry: Component<()> = |cx, props| { }) }; -pub static StacksIcon: Component<()> = |cx, props| { +pub static StacksIcon: Component<()> = |cx| { cx.render(rsx!( svg { // xmlns: "http://www.w3.org/2000/svg" @@ -122,7 +122,7 @@ pub static StacksIcon: Component<()> = |cx, props| { } )) }; -pub static RightArrowIcon: Component<()> = |cx, props| { +pub static RightArrowIcon: Component<()> = |cx| { cx.render(rsx!( svg { fill: "none" diff --git a/examples/tasks.rs b/examples/tasks.rs index 699ae1274..3b14faff1 100644 --- a/examples/tasks.rs +++ b/examples/tasks.rs @@ -6,11 +6,11 @@ use std::time::Duration; use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } -static App: Component<()> = |cx, props| { - let mut count = use_state(cx, || 0); +static App: Component<()> = |cx| { + let mut count = use_state(&cx, || 0); cx.push_task(async move { tokio::time::sleep(Duration::from_millis(100)).await; diff --git a/examples/todomvc.rs b/examples/todomvc.rs index 395b86696..b73d4ef49 100644 --- a/examples/todomvc.rs +++ b/examples/todomvc.rs @@ -4,7 +4,7 @@ use im_rc::HashMap; use std::rc::Rc; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } #[derive(PartialEq)] @@ -22,10 +22,10 @@ pub struct TodoItem { } const STYLE: &str = include_str!("./assets/todomvc.css"); -const App: Component<()> = |cx, props| { - let mut draft = use_state(cx, || "".to_string()); - let mut todos = use_state(cx, || HashMap::>::new()); - let mut filter = use_state(cx, || FilterState::All); +const App: Component<()> = |cx| { + let mut draft = use_state(&cx, || "".to_string()); + let mut todos = use_state(&cx, || HashMap::>::new()); + let mut filter = use_state(&cx, || FilterState::All); let todolist = todos .iter() @@ -85,9 +85,9 @@ pub struct TodoEntryProps { todo: Rc, } -pub fn TodoEntry(cx: Scope, props: &TodoEntryProps) -> Element { - let mut is_editing = use_state(cx, || false); - let mut contents = use_state(cx, || String::from("")); +pub fn TodoEntry(cx: Scope) -> Element { + let mut is_editing = use_state(&cx, || false); + let mut contents = use_state(&cx, || String::from("")); let todo = &props.todo; rsx!(cx, li { diff --git a/examples/weather_app.rs b/examples/weather_app.rs index 20fde8a28..0ba2ffa0f 100644 --- a/examples/weather_app.rs +++ b/examples/weather_app.rs @@ -7,12 +7,12 @@ use dioxus::prelude::*; fn main() { - dioxus::desktop::launch(App, |c| c); + dioxus::desktop::launch(App); } const ENDPOINT: &str = "https://api.openweathermap.org/data/2.5/weather"; -static App: Component<()> = |cx, props| { +static App: Component<()> = |cx| { // let body = use_suspense( cx, @@ -40,7 +40,7 @@ static App: Component<()> = |cx, props| { #[derive(PartialEq, Props)] struct WeatherProps {} -static WeatherDisplay: Component = |cx, props| { +static WeatherDisplay: Component = |cx| { // cx.render(rsx!( div { class: "flex items-center justify-center flex-col" diff --git a/examples/web/async_web.rs b/examples/web/async_web.rs index a64ea0598..a1a0f8bb1 100644 --- a/examples/web/async_web.rs +++ b/examples/web/async_web.rs @@ -8,7 +8,7 @@ use dioxus_html as dioxus_elements; fn main() { console_error_panic_hook::set_once(); wasm_logger::init(wasm_logger::Config::new(log::Level::Debug)); - dioxus_web::launch(APP, |c| c) + dioxus_web::launch(APP) } #[derive(serde::Deserialize)] @@ -16,8 +16,8 @@ struct DogApi { message: String, } -static APP: FC<()> = |(cx, _props)| { - let state = use_state(cx, || 0); +static APP: Component<()> = |(cx, _props)| { + let state = use_state(&cx, || 0); const ENDPOINT: &str = "https://dog.ceo/api/breeds/image/random/"; let doggo = use_suspense( diff --git a/examples/web/basic.rs b/examples/web/basic.rs index 4c4d52ce5..ff70f8a1b 100644 --- a/examples/web/basic.rs +++ b/examples/web/basic.rs @@ -11,13 +11,13 @@ fn main() { console_error_panic_hook::set_once(); // Run the app - dioxus_web::launch(APP, |c| c) + dioxus_web::launch(APP) } -static APP: FC<()> = |cx, _| { - let mut count = use_state(cx, || 3); - let content = use_state(cx, || String::from("h1")); - let text_content = use_state(cx, || String::from("Hello, world!")); +static APP: Component<()> = |cx| { + let mut count = use_state(&cx, || 3); + let content = use_state(&cx, || String::from("h1")); + let text_content = use_state(&cx, || String::from("Hello, world!")); cx.render(rsx! { div { @@ -86,4 +86,4 @@ fn render_list(cx: Context, count: usize) -> Element { rsx!(cx, ul { {items} }) } -static CHILD: FC<()> = |cx, _| rsx!(cx, div {"hello child"}); +static CHILD: Component<()> = |cx, _| rsx!(cx, div {"hello child"}); diff --git a/examples/web/blah.rs b/examples/web/blah.rs index d21cd5fd0..5553ceede 100644 --- a/examples/web/blah.rs +++ b/examples/web/blah.rs @@ -21,11 +21,11 @@ fn main() { console_error_panic_hook::set_once(); // Run the app - dioxus_web::launch(App, |c| c) + dioxus_web::launch(App) } -static App: FC<()> = |cx, props| { - let mut state = use_state(cx, || 0); +static App: Component<()> = |cx| { + let mut state = use_state(&cx, || 0); cx.render(rsx! { div { style: { diff --git a/examples/web/btns.rs b/examples/web/btns.rs index 179074ee7..a3c96ad7a 100644 --- a/examples/web/btns.rs +++ b/examples/web/btns.rs @@ -18,12 +18,12 @@ use dioxus_html as dioxus_elements; // #[cfg] fn main() { wasm_logger::init(wasm_logger::Config::new(log::Level::Debug)); - dioxus_web::launch(App, |c| c); + dioxus_web::launch(App); // env_logger::init(); - // dioxus::web::launch(App, |c| c); + // dioxus::web::launch(App); } -static App: FC<()> = |cx, props| { +static App: Component<()> = |cx| { dbg!("rednering parent"); cx.render(rsx! { div { @@ -40,8 +40,8 @@ static App: FC<()> = |cx, props| { }) }; -static But: FC<()> = |cx, props| { - let mut count = use_state(cx, || 0); +static But: Component<()> = |cx| { + let mut count = use_state(&cx, || 0); // let d = Dropper { name: "asd" }; // let handler = move |_| { diff --git a/examples/web/crm2.rs b/examples/web/crm2.rs index 4dfe9db34..4f0eff48f 100644 --- a/examples/web/crm2.rs +++ b/examples/web/crm2.rs @@ -12,7 +12,7 @@ fn main() { wasm_logger::init(wasm_logger::Config::new(log::Level::Debug)); console_error_panic_hook::set_once(); - dioxus_web::launch(App, |c| c) + dioxus_web::launch(App) } enum Scene { @@ -28,13 +28,13 @@ pub struct Client { pub description: String, } -static App: FC<()> = |cx, _| { - let scene = use_state(cx, || Scene::ClientsList); - let clients = use_ref(cx, || vec![] as Vec); +static App: Component<()> = |cx| { + let scene = use_state(&cx, || Scene::ClientsList); + let clients = use_ref(&cx, || vec![] as Vec); - let firstname = use_state(cx, || String::new()); - let lastname = use_state(cx, || String::new()); - let description = use_state(cx, || String::new()); + let firstname = use_state(&cx, || String::new()); + let lastname = use_state(&cx, || String::new()); + let description = use_state(&cx, || String::new()); let scene = match *scene { Scene::ClientsList => { diff --git a/examples/web/demo.rs b/examples/web/demo.rs index 603b84de5..6c21aa48d 100644 --- a/examples/web/demo.rs +++ b/examples/web/demo.rs @@ -21,10 +21,10 @@ fn main() { console_error_panic_hook::set_once(); // Run the app - dioxus_web::launch(App, |c| c) + dioxus_web::launch(App) } -pub static App: FC<()> = |cx, props| { +pub static App: Component<()> = |cx| { cx.render(rsx!( div { class: "overflow-hidden" link { href:"https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel:"stylesheet" } @@ -39,7 +39,7 @@ pub static App: FC<()> = |cx, props| { )) }; -pub static Header: FC<()> = |cx, props| { +pub static Header: Component<()> = |cx| { cx.render(rsx! { div { header { class: "text-gray-400 bg-gray-900 body-font" @@ -65,7 +65,7 @@ pub static Header: FC<()> = |cx, props| { }) }; -pub static Hero: FC<()> = |cx, props| { +pub static Hero: Component<()> = |cx| { // cx.render(rsx! { section{ class: "text-gray-400 bg-gray-900 body-font" @@ -103,7 +103,7 @@ pub static Hero: FC<()> = |cx, props| { } }) }; -pub static Entry: FC<()> = |cx, props| { +pub static Entry: Component<()> = |cx| { // cx.render(rsx! { section{ class: "text-gray-400 bg-gray-900 body-font" @@ -116,7 +116,7 @@ pub static Entry: FC<()> = |cx, props| { }) }; -pub static StacksIcon: FC<()> = |cx, props| { +pub static StacksIcon: Component<()> = |cx| { cx.render(rsx!( svg { // xmlns: "http://www.w3.org/2000/svg" @@ -131,7 +131,7 @@ pub static StacksIcon: FC<()> = |cx, props| { } )) }; -pub static RightArrowIcon: FC<()> = |cx, props| { +pub static RightArrowIcon: Component<()> = |cx| { cx.render(rsx!( svg { fill: "none" diff --git a/examples/web_tick.rs b/examples/web_tick.rs index 3a24ce523..098bfc1f3 100644 --- a/examples/web_tick.rs +++ b/examples/web_tick.rs @@ -16,10 +16,10 @@ fn main() { #[cfg(target_arch = "wasm32")] intern_strings(); - dioxus::web::launch(App, |c| c); + dioxus::web::launch(App); } -static App: Component<()> = |cx, props| { +static App: Component<()> = |cx| { let mut rng = SmallRng::from_entropy(); let rows = (0..1_000).map(|f| { let label = Label::new(&mut rng); @@ -49,7 +49,7 @@ fn Row((cx, props): ScopeState) -> Element { let [adj, col, noun] = props.label.0; cx.render(rsx! { tr { - td { class:"col-md-1", "{props.row_id}" } + td { class:"col-md-1", "{cx.props.row_id}" } td { class:"col-md-1", onclick: move |_| { /* run onselect */ } a { class: "lbl", "{adj}" "{col}" "{noun}" } } diff --git a/examples/webview_web.rs b/examples/webview_web.rs index 55f9f4309..a31096be7 100644 --- a/examples/webview_web.rs +++ b/examples/webview_web.rs @@ -13,11 +13,11 @@ use dioxus::prelude::*; fn main() { - dioxus::web::launch(App, |c| c); + dioxus::web::launch(App); } -static App: Component<()> = |cx, props| { - let mut count = use_state(cx, || 0); +static App: Component<()> = |cx| { + let mut count = use_state(&cx, || 0); cx.render(rsx! { div { diff --git a/notes/Parity.md b/notes/Parity.md index 5cc0851c9..fa51fff58 100644 --- a/notes/Parity.md +++ b/notes/Parity.md @@ -12,7 +12,7 @@ https://github.com/rustwasm/gloo For example, resize observer would function like this: ```rust -pub static Example: FC<()> = |cx, props|{ +pub static Example: Component<()> = |cx, props|{ let observer = use_resize_observer(); cx.render(rsx!( diff --git a/notes/SOLVEDPROBLEMS.md b/notes/SOLVEDPROBLEMS.md index 3c42094ee..baf88701b 100644 --- a/notes/SOLVEDPROBLEMS.md +++ b/notes/SOLVEDPROBLEMS.md @@ -153,13 +153,13 @@ Notice that LiveComponent receivers (the client-side interpretation of a LiveCom The `VNodeTree` type is a very special type that allows VNodes to be created using a pluggable allocator. The html! macro creates something that looks like: ```rust -pub static Example: FC<()> = |cx, props|{ +pub static Example: Component<()> = |cx, props|{ html! {
"blah"
} }; // expands to... -pub static Example: FC<()> = |cx, props|{ +pub static Example: Component<()> = |cx, props|{ // This function converts a Fn(allocator) -> DomTree closure to a VNode struct that will later be evaluated. html_macro_to_vnodetree(move |allocator| { let mut node0 = allocator.alloc(VElement::div); @@ -313,7 +313,7 @@ Here's how react does it: Any "dirty" node causes an entire subtree render. Calling "setState" at the very top will cascade all the way down. This is particularly bad for this component design: ```rust -static APP: FC<()> = |cx, props|{ +static APP: Component<()> = |cx, props|{ let title = use_context(Title); cx.render(html!{
@@ -334,7 +334,7 @@ static APP: FC<()> = |cx, props|{
}) }; -static HEAVY_LIST: FC<()> = |cx, props|{ +static HEAVY_LIST: Component<()> = |cx, props|{ cx.render({ {0.100.map(i => )} }) @@ -378,7 +378,7 @@ struct Props { } -static Component: FC = |cx, props|{ +static Component: Component = |cx, props|{ } ``` diff --git a/packages/core-macro/src/lib.rs b/packages/core-macro/src/lib.rs index 6e754a163..6d36280cb 100644 --- a/packages/core-macro/src/lib.rs +++ b/packages/core-macro/src/lib.rs @@ -30,7 +30,7 @@ pub fn derive_typed_builder(input: proc_macro::TokenStream) -> proc_macro::Token /// /// ## Complete Reference Guide: /// ``` -/// const Example: FC<()> = |cx, props|{ +/// const Example: Component<()> = |cx, props|{ /// let formatting = "formatting!"; /// let formatting_tuple = ("a", "b"); /// let lazy_fmt = format_args!("lazily formatted text"); diff --git a/packages/core-macro/src/rsx/ambiguous.rs b/packages/core-macro/src/rsx/ambiguous.rs index 71b3a2c4c..16cb2c4e5 100644 --- a/packages/core-macro/src/rsx/ambiguous.rs +++ b/packages/core-macro/src/rsx/ambiguous.rs @@ -43,7 +43,11 @@ impl Parse for AmbiguousElement { if first_char.is_ascii_uppercase() { input.parse::().map(AmbiguousElement::Component) } else { - input.parse::().map(AmbiguousElement::Element) + if input.peek2(syn::token::Paren) { + input.parse::().map(AmbiguousElement::Component) + } else { + input.parse::().map(AmbiguousElement::Element) + } } } else { Err(Error::new(input.span(), "Not a valid Html tag")) diff --git a/packages/core-macro/src/rsx/component.rs b/packages/core-macro/src/rsx/component.rs index 23ff3b537..9c51cb748 100644 --- a/packages/core-macro/src/rsx/component.rs +++ b/packages/core-macro/src/rsx/component.rs @@ -39,7 +39,14 @@ impl Parse for Component { // parse the guts let content: ParseBuffer; - syn::braced!(content in stream); + + // if we see a `{` then we have a block + // else parse as a function-like call + if stream.peek(token::Brace) { + syn::braced!(content in stream); + } else { + syn::parenthesized!(content in stream); + } let cfg: BodyConfig = BodyConfig { allow_children: true, diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index deca59cde..1788427d7 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -22,7 +22,7 @@ longest-increasing-subsequence = "0.1.0" # internall used log = { version = "0.4", features = ["release_max_level_off"] } -futures-util = { version = "0.3.15", default-features = false } +futures-util = { version = "0.3", default-features = false } smallvec = "1.6" @@ -48,7 +48,7 @@ fern = { version = "0.6.0", features = ["colored"] } rand = { version = "0.8.4", features = ["small_rng"] } simple_logger = "1.13.0" dioxus-core-macro = { path = "../core-macro", version = "0.1.2" } -dioxus-hooks = { path = "../hooks" } +# dioxus-hooks = { path = "../hooks" } criterion = "0.3.5" [features] diff --git a/packages/core/README.md b/packages/core/README.md index ce2602003..71ee252cb 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -2,7 +2,7 @@ This is the core crate for the Dioxus Virtual DOM. This README will focus on the technical design and layout of this Virtual DOM implementation. If you want to read more about using Dioxus, then check out the Dioxus crate, documentation, and website. -To build new apps with Dioxus or to extend the ecosystem with new hooks or components, use the `Dioxus` crate with the appropriate feature flags. +To build new apps with Dioxus or to extend the ecosystem with new hooks or components, use the higher-level `dioxus` crate with the appropriate feature flags. ## Internals @@ -10,69 +10,44 @@ Dioxus-core builds off the many frameworks that came before it. Notably, Dioxus - React: hooks, concurrency, suspense - Dodrio: bump allocation, double buffering, and some diffing architecture -- Percy: html! macro architecture, platform-agnostic edits -- InfernoJS: approach to keyed diffing -- Preact: approach for normalization and ref -- Yew: passion and inspiration ❤️ Dioxus-core leverages some really cool techniques and hits a very high level of parity with mature frameworks. However, Dioxus also brings some new unique features: - managed lifetimes for borrowed data -- suspended nodes (task/fiber endpoints) for asynchronous vnodes +- placeholder approach for suspended vnodes +- fiber/interruptible diffing algorithm - custom memory allocator for vnodes and all text content - support for fragments w/ lazy normalization - slab allocator for scopes - mirrored-slab approach for remote vdoms +- dedicated subtrees for rendering into separate contexts from the same app -There's certainly more to the story, but these optimizations make Dioxus memory use and allocation count extremely minimal. For an average application, it is possible that zero allocations will need to be performed once the app has been mounted. Only when new components are added to the dom will allocations occur - and only en mass. The space of old VNodes is dynamically recycled as new nodes are added. Additionally, Dioxus tracks the average memory footprint of previous components to estimate how much memory allocate for future components. +There's certainly more to the story, but these optimizations make Dioxus memory use and allocation count extremely minimal. For an average application, it is possible that zero allocations will need to be performed once the app has been loaded. Only when new components are added to the dom will allocations occur. For a given component, the space of old VNodes is dynamically recycled as new nodes are added. Additionally, Dioxus tracks the average memory footprint of previous components to estimate how much memory allocate for future components. -All in all, Dioxus treats memory as an incredibly valuable resource. Combined with the memory-efficient footprint of Wasm compilation, Dioxus apps can scale to thousands of components and still stay snappy and respect your RAM usage. +All in all, Dioxus treats memory as a valuable resource. Combined with the memory-efficient footprint of Wasm compilation, Dioxus apps can scale to thousands of components and still stay snappy. ## Goals -We have big goals for Dioxus. The final implementation must: +The final implementation of Dioxus must: - Be **fast**. Allocators are typically slow in Wasm/Rust, so we should have a smart way of allocating. -- Be extremely memory efficient. Servers should handle tens of thousands of simultaneous VDoms with no problem. -- Be concurrent. Components should be able to pause rendering using a threading mechanism. -- Be "remote". Edit lists should be separate from the Renderer implementation. -- Support SSR. VNodes should render to a string that can be served via a web server. +- Be memory efficient. Servers should handle tens of thousands of simultaneous VDoms with no problem. +- Be concurrent. Components should be able to pause rendering to let the screen paint the next frame. +- Be disconnected from a specific renderer (no WebSys dependency in the core crate). +- Support server-side-rendering (SSR). VNodes should render to a string that can be served via a web server. - Be "live". Components should be able to be both server rendered and client rendered without needing frontend APIs. - Be modular. Components and hooks should be work anywhere without worrying about target platform. - ## Safety +Dioxus uses unsafe. The design of Dioxus *requires* unsafe (self-referential trees). + +All of our test suite passes MIRI without errors. + Dioxus deals with arenas, lifetimes, asynchronous tasks, custom allocators, pinning, and a lot more foundational low-level work that is very difficult to implement with 0 unsafe. If you don't want to use a crate that uses unsafe, then this crate is not for you. -however, we are always interested in decreasing the scope of the core VirtualDom to make it easier to review. +However, we are always interested in decreasing the scope of the core VirtualDom to make it easier to review. We'd be happy to welcome PRs that can eliminate unsafe code while still upholding the numerous variants required to execute certain features. -We'd also be happy to welcome PRs that can eliminate unsafe code while still upholding the numerous variants required to execute certain features. - -There's a few invariants that are very important: - -- References to `ScopeInner` and `Props` passed into components are *always* valid for as long as the component exists. Even if the scope backing is resized to fit more scopes, the scope has to stay the same place in memory. - - - -## Suspense - -Suspense is done through combinators on values. - -```rust -let name = get_name(cx).suspend(); - -rsx!( - div { - {name} - div { - div { - - } - } - } -) -``` diff --git a/packages/core/architecture.md b/packages/core/architecture.md index a3f468c25..f852fda3c 100644 --- a/packages/core/architecture.md +++ b/packages/core/architecture.md @@ -1,5 +1,7 @@ # Dioxus Core Architecture: +This document is mostly a brain-dump on how things work. A lot of this information might be outdated. Certain features (priority queues, swim lanes) might not be implemented yet. + Main topics covered here: - Fiber, Concurrency, and Cooperative Scheduling - Suspense diff --git a/packages/core/benches/jsframework.rs b/packages/core/benches/jsframework.rs index 4f5f762d1..34884983a 100644 --- a/packages/core/benches/jsframework.rs +++ b/packages/core/benches/jsframework.rs @@ -23,7 +23,7 @@ criterion_group!(mbenches, create_rows); criterion_main!(mbenches); fn create_rows(c: &mut Criterion) { - static App: Component<()> = |cx, _| { + static App: Component<()> = |cx| { let mut rng = SmallRng::from_entropy(); let rows = (0..10_000_usize).map(|f| { let label = Label::new(&mut rng); @@ -53,11 +53,11 @@ struct RowProps { row_id: usize, label: Label, } -fn Row(cx: Scope, props: &RowProps) -> Element { - let [adj, col, noun] = props.label.0; +fn Row(cx: Scope) -> Element { + let [adj, col, noun] = cx.props.label.0; cx.render(rsx! { tr { - td { class:"col-md-1", "{props.row_id}" } + td { class:"col-md-1", "{cx.props.row_id}" } td { class:"col-md-1", onclick: move |_| { /* run onselect */ } a { class: "lbl", "{adj}" "{col}" "{noun}" } } diff --git a/packages/core/examples/borrowed.rs b/packages/core/examples/borrowed.rs index 71a4f2fb9..784f48740 100644 --- a/packages/core/examples/borrowed.rs +++ b/packages/core/examples/borrowed.rs @@ -31,21 +31,3 @@ fn bleat() { let blah = String::from("asd"); eat(&blah); } - -// struct Lower {} - -// #[derive(Clone, Copy)] -// struct Upper {} -// impl std::ops::Deref for Upper { -// type Target = Lower; - -// fn deref(&self) -> &Self::Target { -// todo!() -// } -// } - -// fn mark(f: &Lower) {} -// fn bark() { -// let up = Upper {}; -// mark(&up); -// } diff --git a/packages/core/examples/hooks.rs b/packages/core/examples/hooks.rs index d4d217fde..969d9f3f2 100644 --- a/packages/core/examples/hooks.rs +++ b/packages/core/examples/hooks.rs @@ -1,16 +1,10 @@ use dioxus::prelude::*; use dioxus_core as dioxus; use dioxus_core_macro::*; -use dioxus_hooks::use_state; use dioxus_html as dioxus_elements; fn main() {} fn App(cx: Scope<()>) -> Element { - let color = use_state(&cx, || "white"); - - cx.render(rsx!( - div { onclick: move |_| color.set("red"), "red" } - div { onclick: move |_| color.set("blue"), "blue" } - )) + todo!() } diff --git a/packages/core/flamegraph.svg b/packages/core/flamegraph.svg deleted file mode 100644 index 0699a198c..000000000 --- a/packages/core/flamegraph.svg +++ /dev/null @@ -1,412 +0,0 @@ -Flame Graph Reset ZoomSearch jsframework-a8f4acf5955e8e7f`core::ptr::drop_in_place<dioxus_core::virtual_dom::VirtualDom> (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`core::ptr::drop_in_place<alloc::boxed::Box<dioxus_core::scopearena::ScopeArena>> (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`<bumpalo::Bump as core::ops::drop::Drop>::drop (1 samples, 1.82%)j..libsystem_malloc.dylib`free_medium (1 samples, 1.82%)l..libsystem_kernel.dylib`madvise (1 samples, 1.82%)l..libsystem_malloc.dylib`_malloc_zone_malloc (2 samples, 3.64%)libs..libsystem_malloc.dylib`szone_malloc_should_clear (2 samples, 3.64%)libs..libsystem_malloc.dylib`tiny_malloc_should_clear (2 samples, 3.64%)libs..libsystem_malloc.dylib`tiny_malloc_from_free_list (1 samples, 1.82%)l..libsystem_malloc.dylib`tiny_free_list_add_ptr (1 samples, 1.82%)l..jsframework-a8f4acf5955e8e7f`dioxus_core::diff::DiffState::create_element_node (7 samples, 12.73%)jsframework-a8f4acf..jsframework-a8f4acf5955e8e7f`alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle (3 samples, 5.45%)jsframe..jsframework-a8f4acf5955e8e7f`alloc::raw_vec::finish_grow (3 samples, 5.45%)jsframe..libsystem_malloc.dylib`realloc (1 samples, 1.82%)l..libsystem_malloc.dylib`malloc_zone_realloc (1 samples, 1.82%)l..libsystem_malloc.dylib`szone_realloc (1 samples, 1.82%)l..libsystem_platform.dylib`_platform_memmove$VARIANT$Haswell (1 samples, 1.82%)l..jsframework-a8f4acf5955e8e7f`dioxus_core::scopearena::ScopeArena::fin_head (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`<bumpalo::Bump as core::default::Default>::default (4 samples, 7.27%)jsframewor..jsframework-a8f4acf5955e8e7f`<bumpalo::Bump as core::ops::drop::Drop>::drop (1 samples, 1.82%)j..libsystem_malloc.dylib`free_tiny (1 samples, 1.82%)l..libsystem_malloc.dylib`tiny_free_no_lock (1 samples, 1.82%)l..libsystem_malloc.dylib`tiny_free_list_add_ptr (1 samples, 1.82%)l..libsystem_malloc.dylib`malloc_zone_realloc (1 samples, 1.82%)l..libsystem_platform.dylib`DYLD-STUB$$_platform_memmove (1 samples, 1.82%)l..jsframework-a8f4acf5955e8e7f`alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle (2 samples, 3.64%)jsfr..jsframework-a8f4acf5955e8e7f`alloc::raw_vec::finish_grow (2 samples, 3.64%)jsfr..libsystem_malloc.dylib`realloc (2 samples, 3.64%)libs..libsystem_malloc.dylib`szone_size (1 samples, 1.82%)l..jsframework-a8f4acf5955e8e7f`bumpalo::Bump::with_capacity (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`bumpalo::Bump::with_capacity (2 samples, 3.64%)jsfr..jsframework-a8f4acf5955e8e7f`dioxus_core::scope::BumpFrame::new (3 samples, 5.45%)jsframe..libsystem_malloc.dylib`_malloc_zone_malloc (1 samples, 1.82%)l..libsystem_malloc.dylib`szone_malloc_should_clear (1 samples, 1.82%)l..libsystem_malloc.dylib`tiny_malloc_should_clear (1 samples, 1.82%)l..libsystem_malloc.dylib`tiny_malloc_from_free_list (1 samples, 1.82%)l..jsframework-a8f4acf5955e8e7f`dioxus_core::scopearena::ScopeArena::new_with_key (14 samples, 25.45%)jsframework-a8f4acf5955e8e7f`dioxus_core:..jsframework-a8f4acf5955e8e7f`hashbrown::raw::RawTable<T,A>::insert (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`dioxus_core::nodes::NodeFactory::element (6 samples, 10.91%)jsframework-a8f4..jsframework-a8f4acf5955e8e7f`bumpalo::Bump::alloc_layout_slow (6 samples, 10.91%)jsframework-a8f4..libsystem_malloc.dylib`_malloc_zone_malloc (2 samples, 3.64%)libs..libsystem_malloc.dylib`szone_malloc_should_clear (2 samples, 3.64%)libs..libsystem_malloc.dylib`tiny_malloc_should_clear (2 samples, 3.64%)libs..libsystem_malloc.dylib`set_tiny_meta_header_in_use (1 samples, 1.82%)l..jsframework-a8f4acf5955e8e7f`dioxus_core::nodes::NodeFactory::raw_element (12 samples, 21.82%)jsframework-a8f4acf5955e8e7f`dioxu..jsframework-a8f4acf5955e8e7f`bumpalo::Bump::alloc_layout_slow (12 samples, 21.82%)jsframework-a8f4acf5955e8e7f`bumpa..libsystem_malloc.dylib`_malloc_zone_malloc (1 samples, 1.82%)l..libsystem_malloc.dylib`szone_malloc_should_clear (1 samples, 1.82%)l..libsystem_malloc.dylib`small_malloc_should_clear (1 samples, 1.82%)l..jsframework-a8f4acf5955e8e7f`<&T as core::fmt::Display>::fmt (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`bumpalo::collections::string::String::into_bump_str (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`dioxus_core::nodes::NodeFactory::text (3 samples, 5.45%)jsframe..jsframework-a8f4acf5955e8e7f`core::fmt::write (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`<&mut W as core::fmt::Write>::write_str (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`dioxus_core::lazynodes::LazyNodes::call (22 samples, 40.00%)jsframework-a8f4acf5955e8e7f`dioxus_core::lazynodes::LazyNodes::c..jsframework-a8f4acf5955e8e7f`dioxus_core::lazynodes::LazyNodes::new::_{{closure}} (22 samples, 40.00%)jsframework-a8f4acf5955e8e7f`dioxus_core::lazynodes::LazyNodes::n..jsframework-a8f4acf5955e8e7f`dioxus_core::nodes::empty_cell (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`dioxus_core::scope::Scope::render (23 samples, 41.82%)jsframework-a8f4acf5955e8e7f`dioxus_core::scope::Scope::renderlibsystem_platform.dylib`_platform_memmove$VARIANT$Haswell (1 samples, 1.82%)l..jsframework-a8f4acf5955e8e7f`dioxus_core::diff::DiffState::create_node (40 samples, 72.73%)jsframework-a8f4acf5955e8e7f`dioxus_core::diff::DiffState::create_nodejsframework-a8f4acf5955e8e7f`dioxus_core::scopearena::ScopeArena::run_scope (24 samples, 43.64%)jsframework-a8f4acf5955e8e7f`dioxus_core::scopearena::ScopeArena::run_s..jsframework-a8f4acf5955e8e7f`dioxus_core::nodes::NodeFactory::component::_{{closure}} (24 samples, 43.64%)jsframework-a8f4acf5955e8e7f`dioxus_core::nodes::NodeFactory::component..jsframework-a8f4acf5955e8e7f`jsframework::Row (24 samples, 43.64%)jsframework-a8f4acf5955e8e7f`jsframework::Rowlibsystem_platform.dylib`_platform_memmove$VARIANT$Haswell (1 samples, 1.82%)l..jsframework-a8f4acf5955e8e7f`dioxus_core::diff::DiffState::work (48 samples, 87.27%)jsframework-a8f4acf5955e8e7f`dioxus_core::diff::DiffState::workjsframework-a8f4acf5955e8e7f`dioxus_core::diff::DiffState::mount (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`<core::option::Option<dioxus_core::lazynodes::LazyNodes> as dioxus_core::nodes::IntoVNode>::into_vnode (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`dioxus_core::lazynodes::LazyNodes::call (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`dioxus_core::lazynodes::LazyNodes::new::_{{closure}} (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`dioxus_core::nodes::NodeFactory::component (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`main (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`mainjsframework-a8f4acf5955e8e7f`std::rt::lang_start_internal (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`std::rt::lang_start_internaljsframework-a8f4acf5955e8e7f`std::rt::lang_start::_{{closure}} (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`std::rt::lang_start::_{{closure}}jsframework-a8f4acf5955e8e7f`std::sys_common::backtrace::__rust_begin_short_backtrace (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`std::sys_common::backtrace::__rust_begin_short_backtracejsframework-a8f4acf5955e8e7f`jsframework::main (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`jsframework::mainjsframework-a8f4acf5955e8e7f`criterion::Criterion<M>::bench_function (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`criterion::Criterion<M>::bench_functionjsframework-a8f4acf5955e8e7f`criterion::benchmark_group::BenchmarkGroup<M>::bench_function (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`criterion::benchmark_group::BenchmarkGroup<M>::bench_functionjsframework-a8f4acf5955e8e7f`criterion::routine::Routine::test (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`criterion::routine::Routine::testjsframework-a8f4acf5955e8e7f`<alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`<alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iterjsframework-a8f4acf5955e8e7f`criterion::bencher::Bencher<M>::iter (51 samples, 92.73%)jsframework-a8f4acf5955e8e7f`criterion::bencher::Bencher<M>::iterjsframework-a8f4acf5955e8e7f`dioxus_core::virtual_dom::VirtualDom::rebuild (50 samples, 90.91%)jsframework-a8f4acf5955e8e7f`dioxus_core::virtual_dom::VirtualDom::rebuildjsframework-a8f4acf5955e8e7f`dioxus_core::scopearena::ScopeArena::run_scope (2 samples, 3.64%)jsfr..jsframework-a8f4acf5955e8e7f`dioxus_core::virtual_dom::VirtualDom::new_with_props_and_scheduler::_{{closure}} (2 samples, 3.64%)jsfr..jsframework-a8f4acf5955e8e7f`core::ops::function::FnOnce::call_once (2 samples, 3.64%)jsfr..jsframework-a8f4acf5955e8e7f`dioxus_core::scope::Scope::render (2 samples, 3.64%)jsfr..jsframework-a8f4acf5955e8e7f`dioxus_core::lazynodes::LazyNodes::call (2 samples, 3.64%)jsfr..jsframework-a8f4acf5955e8e7f`dioxus_core::lazynodes::LazyNodes::new::_{{closure}} (2 samples, 3.64%)jsfr..jsframework-a8f4acf5955e8e7f`dioxus_core::nodes::NodeFactory::fragment_from_iter (2 samples, 3.64%)jsfr..jsframework-a8f4acf5955e8e7f`core::ops::function::impls::_<impl core::ops::function::FnOnce<A> for &mut F>::call_once (1 samples, 1.82%)j..jsframework-a8f4acf5955e8e7f`rand::rng::Rng::gen_range (1 samples, 1.82%)j..all (55 samples, 100%)0x1 (55 samples, 100.00%)0x1libdyld.dylib`start (55 samples, 100.00%)libdyld.dylib`startlibsystem_kernel.dylib`__exit (4 samples, 7.27%)libsystem_.. \ No newline at end of file diff --git a/packages/core/src/component.rs b/packages/core/src/component.rs index f8d3c9727..75a3d4e17 100644 --- a/packages/core/src/component.rs +++ b/packages/core/src/component.rs @@ -58,7 +58,7 @@ impl<'a, const A: bool> FragmentBuilder<'a, A> { /// cx.render(rsx!{ /// div { /// h1 {"Title card"} -/// {props.children} +/// {cx.props.children} /// } /// }) /// } diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs index 35f7470ba..5783a696e 100644 --- a/packages/core/src/diff.rs +++ b/packages/core/src/diff.rs @@ -440,7 +440,7 @@ impl<'bump> DiffState<'bump> { let height = parent_scope.height + 1; let subtree = parent_scope.subtree.get(); - let parent_scope = unsafe { self.scopes.get_scope_raw(parent_idx) }; + let parent_scope = self.scopes.get_scope_raw(parent_idx); let caller = unsafe { std::mem::transmute(vcomponent.caller as *const _) }; let fc_ptr = vcomponent.user_fc; @@ -716,13 +716,12 @@ impl<'bump> DiffState<'bump> { new.associated_scope.set(Some(scope_addr)); // make sure the component's caller function is up to date - let scope = unsafe { - self.scopes - .get_scope_mut(scope_addr) - .unwrap_or_else(|| panic!("could not find {:?}", scope_addr)) - }; + let scope = self + .scopes + .get_scope(scope_addr) + .unwrap_or_else(|| panic!("could not find {:?}", scope_addr)); - scope.caller = unsafe { std::mem::transmute(new.caller) }; + scope.caller.set(unsafe { std::mem::transmute(new.caller) }); // React doesn't automatically memoize, but we do. let props_are_the_same = old.comparator.unwrap(); diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index 9514f83f9..1f8b8b1c7 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -520,8 +520,8 @@ impl<'a> NodeFactory<'a> { move |other: &VComponent| { if user_fc == other.user_fc { // Safety - // - We guarantee that FC

is the same by function pointer - // - Because FC

is the same, then P must be the same (even with generics) + // - We guarantee that Component

is the same by function pointer + // - Because Component

is the same, then P must be the same (even with generics) // - Non-static P are autoderived to memoize as false // - This comparator is only called on a corresponding set of bumpframes // diff --git a/packages/core/src/scope.rs b/packages/core/src/scope.rs index 5d07b3920..6289811e0 100644 --- a/packages/core/src/scope.rs +++ b/packages/core/src/scope.rs @@ -28,7 +28,7 @@ use bumpalo::{boxed::Box as BumpBox, Bump}; /// } /// /// fn Example(cx: Context, props: &ExampleProps) -> Element { -/// cx.render(rsx!{ div {"Hello, {props.name}"} }) +/// cx.render(rsx!{ div {"Hello, {cx.props.name}"} }) /// } /// ``` pub struct Scope<'a, P> { @@ -88,7 +88,7 @@ pub struct ScopeState { pub(crate) frames: [BumpFrame; 2], - pub(crate) caller: *const dyn Fn(&ScopeState) -> Element, + pub(crate) caller: Cell<*const dyn Fn(&ScopeState) -> Element>, pub(crate) items: RefCell>, @@ -269,12 +269,12 @@ impl ScopeState { /// ```rust, ignore /// struct SharedState(&'static str); /// - /// static App: FC<()> = |cx, props|{ + /// static App: Component<()> = |cx, props|{ /// cx.use_hook(|_| cx.provide_state(SharedState("world")), |_| {}, |_| {}); /// rsx!(cx, Child {}) /// } /// - /// static Child: FC<()> = |cx, props| { + /// static Child: Component<()> = |cx| { /// let state = cx.consume_state::(); /// rsx!(cx, div { "hello {state.0}" }) /// } @@ -344,7 +344,7 @@ impl ScopeState { /// ## Example /// /// ```ignore - /// fn Component(cx: Scope, props: &Props) -> Element { + /// fn Component(cx: Scope) -> Element { /// // Lazy assemble the VNode tree /// let lazy_nodes = rsx!("hello world"); /// diff --git a/packages/core/src/scopearena.rs b/packages/core/src/scopearena.rs index 9716a3ae1..9afb80866 100644 --- a/packages/core/src/scopearena.rs +++ b/packages/core/src/scopearena.rs @@ -72,14 +72,10 @@ impl ScopeArena { unsafe { self.scopes.borrow().get(&id).map(|f| &**f) } } - pub(crate) unsafe fn get_scope_raw(&self, id: ScopeId) -> Option<*mut ScopeState> { + pub(crate) fn get_scope_raw(&self, id: ScopeId) -> Option<*mut ScopeState> { self.scopes.borrow().get(&id).copied() } - pub(crate) unsafe fn get_scope_mut(&self, id: ScopeId) -> Option<&mut ScopeState> { - self.scopes.borrow().get(&id).map(|s| &mut **s) - } - pub(crate) fn new_with_key( &self, fc_ptr: *const (), @@ -95,35 +91,13 @@ impl ScopeArena { if let Some(old_scope) = self.free_scopes.borrow_mut().pop() { let scope = unsafe { &mut *old_scope }; - scope.caller = caller; + scope.caller.set(caller); scope.parent_scope = parent_scope; scope.height = height; scope.subtree = Cell::new(subtree); scope.our_arena_idx = new_scope_id; scope.container = container; - // scope.frames[0].nodes.get_mut().push({ - // let vnode = scope.frames[0] - // .bump - // .alloc(VNode::Text(scope.frames[0].bump.alloc(VText { - // dom_id: Default::default(), - // is_static: false, - // text: "", - // }))); - // unsafe { std::mem::transmute(vnode as *mut VNode) } - // }); - - // scope.frames[1].nodes.get_mut().push({ - // let vnode = scope.frames[1] - // .bump - // .alloc(VNode::Text(scope.frames[1].bump.alloc(VText { - // dom_id: Default::default(), - // is_static: false, - // text: "", - // }))); - // unsafe { std::mem::transmute(vnode as *mut VNode) } - // }); - let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); debug_assert!(any_item.is_none()); } else { @@ -148,7 +122,7 @@ impl ScopeArena { subtree: Cell::new(subtree), is_subtree_root: Cell::new(false), - caller, + caller: Cell::new(caller), generation: 0.into(), shared_contexts: Default::default(), @@ -277,18 +251,20 @@ impl ScopeArena { // Remove all the outdated listeners self.ensure_drop_safety(id); - let scope = unsafe { &mut *self.get_scope_mut(id).expect("could not find scope") }; + // todo: we *know* that this is aliased by the contents of the scope itself + let scope = unsafe { &mut *self.get_scope_raw(id).expect("could not find scope") }; // Safety: // - We dropped the listeners, so no more &mut T can be used while these are held // - All children nodes that rely on &mut T are replaced with a new reference scope.hook_idx.set(0); - // Safety: - // - We've dropped all references to the wip bump frame with "ensure_drop_safety" - unsafe { scope.reset_wip_frame() }; - + // book keeping to ensure safety around the borrowed data { + // Safety: + // - We've dropped all references to the wip bump frame with "ensure_drop_safety" + unsafe { scope.reset_wip_frame() }; + let mut items = scope.items.borrow_mut(); // just forget about our suspended nodes while we're at it @@ -298,12 +274,9 @@ impl ScopeArena { debug_assert!(items.listeners.is_empty()); debug_assert!(items.borrowed_props.is_empty()); debug_assert!(items.tasks.is_empty()); - - // Todo: see if we can add stronger guarantees around internal bookkeeping and failed component renders. - // scope.wip_frame().nodes } - let render: &dyn Fn(&ScopeState) -> Element = unsafe { &*scope.caller }; + let render: &dyn Fn(&ScopeState) -> Element = unsafe { &*scope.caller.get() }; if let Some(node) = render(scope) { if !scope.items.borrow().tasks.is_empty() { @@ -319,6 +292,10 @@ impl ScopeArena { scope.cycle_frame(); true } else { + // the component bailed out early + // this leaves the wip frame and all descendents in a state where + // their WIP frames are invalid + // todo: descendents should not cause the app to crash false } } diff --git a/packages/core/src/virtual_dom.rs b/packages/core/src/virtual_dom.rs index 63d64efc7..23d7570cc 100644 --- a/packages/core/src/virtual_dom.rs +++ b/packages/core/src/virtual_dom.rs @@ -25,7 +25,7 @@ use std::{any::Any, collections::VecDeque, pin::Pin, sync::Arc, task::Poll}; /// /// fn App(cx: Context, props: &AppProps) -> Element { /// cx.render(rsx!( -/// div {"hello, {props.title}"} +/// div {"hello, {cx.props.title}"} /// )) /// } /// ``` @@ -36,7 +36,7 @@ use std::{any::Any, collections::VecDeque, pin::Pin, sync::Arc, task::Poll}; /// fn App(cx: Context, props: &AppProps) -> Element { /// cx.render(rsx!( /// NavBar { routes: ROUTES } -/// Title { "{props.title}" } +/// Title { "{cx.props.title}" } /// Footer {} /// )) /// } @@ -459,7 +459,7 @@ impl VirtualDom { /// /// # Example /// ```rust, ignore - /// static App: FC<()> = |cx, props| cx.render(rsx!{ "hello world" }); + /// static App: Component<()> = |cx, props| cx.render(rsx!{ "hello world" }); /// let mut dom = VirtualDom::new(); /// let edits = dom.rebuild(); /// @@ -497,7 +497,7 @@ impl VirtualDom { /// value: Shared<&'static str>, /// } /// - /// static App: FC = |cx, props|{ + /// static App: Component = |cx, props|{ /// let val = cx.value.borrow(); /// cx.render(rsx! { div { "{val}" } }) /// }; diff --git a/packages/core/tests/lifecycle.rs b/packages/core/tests/lifecycle.rs index d3976fdea..2da5b5bd6 100644 --- a/packages/core/tests/lifecycle.rs +++ b/packages/core/tests/lifecycle.rs @@ -7,7 +7,6 @@ use dioxus_core::DomEdit::*; use dioxus_core::ScopeId; use dioxus_core_macro::*; -use dioxus_hooks::*; use dioxus_html as dioxus_elements; use std::sync::{Arc, Mutex}; diff --git a/packages/desktop/README.md b/packages/desktop/README.md index 0c1663488..18225ade7 100644 --- a/packages/desktop/README.md +++ b/packages/desktop/README.md @@ -4,11 +4,11 @@ This crate provides an ergonomic API for Dioxus to build desktop apps. ```rust fn main() { - dioxus::desktop::launch(App, |c| c) + dioxus::desktop::launch(App) } -static App: FC<()> = |cx, props| { - let (count, set_count) = use_state(cx, || 0); +static App: Component<()> = |cx| { + let (count, set_count) = use_state(&cx, || 0); cx.render(rsx!( WebviewWindow { @@ -34,7 +34,7 @@ Window management, system trays, notifications, and other desktop-related functi Managing windows is done by simply rendering content into a `WebviewWindow` component. ```rust -static App: FC<()> = |cx, props| { +static App: Component<()> = |cx| { rsx!(cx, WebviewWindow { "hello world" } ) } ``` @@ -46,7 +46,7 @@ Notifications also use a declarative approach. Sending a notification has never The api has been somewhat modeled after https://github.com/mikaelbr/node-notifier ```rust -static Notifications: FC<()> = |cx, props| { +static Notifications: Component<()> = |cx| { cx.render(rsx!( Notification { title: "title" @@ -78,7 +78,7 @@ static Notifications: FC<()> = |cx, props| { Dioxus Desktop supports app trays, which can be built with native menu groups or with a custom window. ```rust -static Tray: FC<()> = |cx, props| { +static Tray: Component<()> = |cx| { cx.render(rsx!( GlobalTray { MenuGroup { @@ -90,7 +90,7 @@ static Tray: FC<()> = |cx, props| { }; // using a builder -static Tray: FC<()> = |cx, props| { +static Tray: Component<()> = |cx| { let menu = MenuGroup::builder(cx) .with_items([ MenuGroupItem::builder() @@ -107,7 +107,7 @@ static Tray: FC<()> = |cx, props| { } // or with a custom window -static Tray: FC<()> = |cx, props| { +static Tray: Component<()> = |cx| { rsx!(cx, GlobalTray { div { "custom buttons here" } }) }; ``` @@ -116,7 +116,7 @@ static Tray: FC<()> = |cx, props| { Declaring menus is convenient and cross-platform. ```rust -static Menu: FC<()> = |cx, props| { +static Menu: Component<()> = |cx| { cx.render(rsx!( MenuBarMajorItem { title: "File" MenuGroup { diff --git a/packages/desktop/examples/async.rs b/packages/desktop/examples/async.rs index b86b66df4..2626355e4 100644 --- a/packages/desktop/examples/async.rs +++ b/packages/desktop/examples/async.rs @@ -12,11 +12,11 @@ use dioxus_html as dioxus_elements; fn main() { simple_logger::init().unwrap(); - dioxus_desktop::launch(App, |c| c); + dioxus_desktop::launch(app); } -static App: Component<()> = |cx, props| { - let mut count = use_state(cx, || 0); +fn app(cx: Scope<()>) -> Element { + let mut count = use_state(&cx, || 0); log::debug!("count is {:?}", count); cx.push_task(|| async move { diff --git a/packages/desktop/src/desktop_context.rs b/packages/desktop/src/desktop_context.rs index b6e8ac4c7..9a0607218 100644 --- a/packages/desktop/src/desktop_context.rs +++ b/packages/desktop/src/desktop_context.rs @@ -90,7 +90,7 @@ fn syntax_works() { use dioxus_hooks::*; use dioxus_html as dioxus_elements; - static App: FC<()> = |cx, props| { + static App: Component<()> = |cx| { cx.render(rsx! { // left window WebviewWindow { diff --git a/packages/desktop/src/lib.rs b/packages/desktop/src/lib.rs index df97b49a8..59654aeb9 100644 --- a/packages/desktop/src/lib.rs +++ b/packages/desktop/src/lib.rs @@ -6,6 +6,9 @@ mod cfg; mod escape; mod events; +pub use wry; +pub use wry::application as tao; + // mod desktop_context; use cfg::DesktopConfig; @@ -28,7 +31,10 @@ use wry::{ webview::{WebView, WebViewBuilder}, }; -pub fn launch( +pub fn launch(root: Component<()>) { + launch_with_props(root, (), |c| c) +} +pub fn launch_cfg( root: Component<()>, config_builder: impl for<'a, 'b> FnOnce(&'b mut DesktopConfig<'a>) -> &'b mut DesktopConfig<'a>, ) { diff --git a/packages/hooks/Cargo.toml b/packages/hooks/Cargo.toml index 2327308b4..93133865e 100644 --- a/packages/hooks/Cargo.toml +++ b/packages/hooks/Cargo.toml @@ -1,11 +1,10 @@ [package] name = "dioxus-hooks" -version = "0.0.0" +version = "0.1.3" authors = ["Jonathan Kelley "] edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../../packages/core", version = "0.1.3" } -futures = "0.3" +dioxus-core = { path = "../../packages/core" } diff --git a/packages/hooks/README.md b/packages/hooks/README.md index 39ab816b5..11e008c44 100644 --- a/packages/hooks/README.md +++ b/packages/hooks/README.md @@ -16,10 +16,10 @@ You can always use it "normally" with the `split` method: ```rust // Normal usage: -let value = use_state(cx, || 10); +let value = use_state(&cx, || 10); // "Classic" usage: -let (value, set_value) = use_state(cx, || 0).split(); +let (value, set_value) = use_state(&cx, || 0).split(); ``` ## use_ref diff --git a/packages/hooks/src/lib.rs b/packages/hooks/src/lib.rs index f6a5227bc..ef5b699b6 100644 --- a/packages/hooks/src/lib.rs +++ b/packages/hooks/src/lib.rs @@ -1,9 +1,6 @@ mod usestate; pub use usestate::{use_state, AsyncUseState, UseState}; -mod usestate2; -// pub use usestate2::use_state2; - mod useref; pub use useref::*; diff --git a/packages/hooks/src/usecollection.rs b/packages/hooks/src/usecollection.rs index d0b3b71e7..47005e57b 100644 --- a/packages/hooks/src/usecollection.rs +++ b/packages/hooks/src/usecollection.rs @@ -16,7 +16,7 @@ This is moderately efficient because the fields of the map are moved, but the da However, if you used similar approach with Dioxus: ```rust -let (map, set_map) = use_state(cx, || HashMap::new()); +let (map, set_map) = use_state(&cx, || HashMap::new()); set_map({ let mut newmap = map.clone(); newmap.set(key, value); @@ -36,7 +36,7 @@ uses the same memoization on top of the use_context API. Here's a fully-functional todo app using the use_map API: ```rust -static TodoList: FC<()> = |cx, props|{ +static TodoList: Component<()> = |cx, props|{ let todos = use_map(cx, || HashMap::new()); let input = use_ref(|| None); diff --git a/packages/hooks/src/usecoroutine.rs b/packages/hooks/src/usecoroutine.rs index f04fb4f12..f593c2b77 100644 --- a/packages/hooks/src/usecoroutine.rs +++ b/packages/hooks/src/usecoroutine.rs @@ -1,5 +1,5 @@ use dioxus_core::ScopeState; -use futures::Future; +use std::future::Future; use std::{ cell::{Cell, RefCell}, pin::Pin, diff --git a/packages/hooks/src/usemodel.rs b/packages/hooks/src/usemodel.rs index 47981af0f..642081cf8 100644 --- a/packages/hooks/src/usemodel.rs +++ b/packages/hooks/src/usemodel.rs @@ -5,9 +5,9 @@ //! In these cases, we provide `use_model` - a convenient way of abstracting over some state and async functions. use dioxus_core::prelude::ScopeState; -use futures::Future; use std::{ cell::{Cell, Ref, RefCell, RefMut}, + future::Future, marker::PhantomData, pin::Pin, rc::Rc, diff --git a/packages/hooks/src/usestate.rs b/packages/hooks/src/usestate.rs index 0c5bb708a..1c4fe2d04 100644 --- a/packages/hooks/src/usestate.rs +++ b/packages/hooks/src/usestate.rs @@ -39,7 +39,7 @@ impl<'a, P, T> UseStateA<'a, T> for Scope<'a, P> { /// On top of the methods to set/get state, `use_state` also supports fancy combinators to extend its functionality: /// - `.classic()` and `.split()` convert the hook into the classic React-style hook /// ```rust -/// let (state, set_state) = use_state(cx, || 10).split() +/// let (state, set_state) = use_state(&cx, || 10).split() /// ``` /// /// diff --git a/packages/hooks/src/usestate2.rs b/packages/hooks/src/usestate2.rs deleted file mode 100644 index 6cffc8e95..000000000 --- a/packages/hooks/src/usestate2.rs +++ /dev/null @@ -1,227 +0,0 @@ -// use dioxus_core::prelude::Context; -// use std::{ -// borrow::{Borrow, BorrowMut}, -// cell::{Cell, Ref, RefCell, RefMut}, -// fmt::{Debug, Display}, -// ops::Not, -// rc::Rc, -// }; - -// /// Store state between component renders! -// /// -// /// ## Dioxus equivalent of UseStateInner2, designed for Rust -// /// -// /// The Dioxus version of `UseStateInner2` is the "king daddy" of state management. It allows you to ergonomically store and -// /// modify state between component renders. When the state is updated, the component will re-render. -// /// -// /// Dioxus' use_state basically wraps a RefCell with helper methods and integrates it with the VirtualDOM update system. -// /// -// /// [`use_state`] exposes a few helper methods to modify the underlying state: -// /// - `.set(new)` allows you to override the "work in progress" value with a new value -// /// - `.get_mut()` allows you to modify the WIP value -// /// - `.get_wip()` allows you to access the WIP value -// /// - `.deref()` provides the previous value (often done implicitly, though a manual dereference with `*` might be required) -// /// -// /// Additionally, a ton of std::ops traits are implemented for the `UseStateInner2` wrapper, meaning any mutative type operations -// /// will automatically be called on the WIP value. -// /// -// /// ## Combinators -// /// -// /// On top of the methods to set/get state, `use_state` also supports fancy combinators to extend its functionality: -// /// - `.classic()` and `.split()` convert the hook into the classic React-style hook -// /// ```rust -// /// let (state, set_state) = use_state(cx, || 10).split() -// /// ``` -// /// -// /// -// /// Usage: -// /// ```ignore -// /// const Example: FC<()> = |cx, props|{ -// /// let counter = use_state(cx, || 0); -// /// let increment = |_| counter += 1; -// /// let decrement = |_| counter += 1; -// /// -// /// html! { -// ///

-// ///

"Counter: {counter}"

-// /// -// /// -// ///
-// /// } -// /// } -// /// ``` -// pub fn use_state2<'a, T: 'static>( -// cx: Context<'a>, -// initial_state_fn: impl FnOnce() -> T, -// ) -> &'a UseState2 { -// cx.use_hook( -// move |_| { -// UseState2(Rc::new(UseStateInner2 { -// current_val: initial_state_fn(), -// update_callback: cx.schedule_update(), -// wip: None, -// update_scheuled: Cell::new(false), -// })) -// }, -// move |hook: &mut UseState2| { -// { -// let r = hook.0.as_ref(); -// let mut state = r.borrow_mut(); -// state.update_scheuled.set(false); -// if state.wip.is_some() { -// state.current_val = state.wip.take().unwrap(); -// } -// } -// &*hook -// }, -// ) -// } - -// pub struct UseState2(Rc>); - -// impl ToOwned for UseState2 { -// type Owned = UseState2; -// fn to_owned(&self) -> Self::Owned { -// UseState2(self.0.clone()) -// } -// } - -// pub struct UseStateInner2 { -// current_val: T, -// update_scheuled: Cell, -// update_callback: Rc, -// wip: Option, -// } - -// impl Debug for UseStateInner2 { -// fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { -// write!(f, "{:?}", self.current_val) -// } -// } - -// impl UseState2 { -// /// Tell the Dioxus Scheduler that we need to be processed -// pub fn needs_update(&self) { -// if !self.update_scheuled.get() { -// self.update_scheuled.set(true); -// (self.update_callback)(); -// } -// } - -// pub fn set(&mut self, new_val: T) -> Option { -// self.needs_update(); -// ip.wip.replace(new_val) -// } - -// pub fn get(&self) -> &T { -// &self.current_val -// } -// } - -// // impl> UseState2 { -// // /// Gain mutable access to the new value. This method is only available when the value is a `ToOwned` type. -// // /// -// // /// Mutable access is derived by calling "ToOwned" (IE cloning) on the current value. -// // /// -// // /// To get a reference to the current value, use `.get()` -// // pub fn modify(&self) -> RefMut { -// // // make sure we get processed -// // self.0.needs_update(); - -// // // Bring out the new value, cloning if it we need to -// // // "get_mut" is locked behind "ToOwned" to make it explicit that cloning occurs to use this -// // RefMut::map(self.wip.borrow_mut(), |slot| { -// // if slot.is_none() { -// // *slot = Some(self.current_val.to_owned()); -// // } -// // slot.as_mut().unwrap() -// // }) -// // } - -// // pub fn inner(self) -> T { -// // self.current_val.to_owned() -// // } -// // } - -// impl std::ops::Deref for UseStateInner2 { -// type Target = T; - -// fn deref(&self) -> &Self::Target { -// self.get() -// } -// } - -// use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign}; - -// use crate::UseState; - -// impl> Add for UseStateInner2 { -// type Output = T; - -// fn add(self, rhs: T) -> Self::Output { -// self.current_val.add(rhs) -// } -// } -// impl> AddAssign for UseStateInner2 { -// fn add_assign(&mut self, rhs: T) { -// self.set(self.current_val.add(rhs)); -// } -// } -// impl> Sub for UseStateInner2 { -// type Output = T; - -// fn sub(self, rhs: T) -> Self::Output { -// self.current_val.sub(rhs) -// } -// } -// impl> SubAssign for UseStateInner2 { -// fn sub_assign(&mut self, rhs: T) { -// self.set(self.current_val.sub(rhs)); -// } -// } - -// /// MUL -// impl> Mul for UseStateInner2 { -// type Output = T; - -// fn mul(self, rhs: T) -> Self::Output { -// self.current_val.mul(rhs) -// } -// } -// impl> MulAssign for UseStateInner2 { -// fn mul_assign(&mut self, rhs: T) { -// self.set(self.current_val.mul(rhs)); -// } -// } -// /// DIV -// impl> Div for UseStateInner2 { -// type Output = T; - -// fn div(self, rhs: T) -> Self::Output { -// self.current_val.div(rhs) -// } -// } -// impl> DivAssign for UseStateInner2 { -// fn div_assign(&mut self, rhs: T) { -// self.set(self.current_val.div(rhs)); -// } -// } -// impl> PartialEq for UseStateInner2 { -// fn eq(&self, other: &V) -> bool { -// self.get() == other -// } -// } -// impl + Copy> Not for UseStateInner2 { -// type Output = O; - -// fn not(self) -> Self::Output { -// !*self.get() -// } -// } - -// // enable displaty for the handle -// impl std::fmt::Display for UseStateInner2 { -// fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { -// write!(f, "{}", self.current_val) -// } -// } diff --git a/packages/hooks/src/usetask.rs b/packages/hooks/src/usetask.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/liveview/README.md b/packages/liveview/README.md index 1e29ac75a..4a05d9f10 100644 --- a/packages/liveview/README.md +++ b/packages/liveview/README.md @@ -40,7 +40,7 @@ async fn order_shoes(mut req: WebsocketRequest) -> Response { } fn App(cx: Context, props: &()) -> Element { - let mut count = use_state(cx, || 0); + let mut count = use_state(&cx, || 0); cx.render(rsx!( button { onclick: move |_| count += 1, "Incr" } button { onclick: move |_| count -= 1, "Decr" } diff --git a/packages/mobile/src/lib.rs b/packages/mobile/src/lib.rs index 6d7f27114..e11765dda 100644 --- a/packages/mobile/src/lib.rs +++ b/packages/mobile/src/lib.rs @@ -69,7 +69,7 @@ impl WebviewRenderer { redits: Option>>, ) -> anyhow::Result<()> { // pub fn run_with_edits( - // root: FC, + // root: Component, // props: T, // user_builder: fn(WindowBuilder) -> WindowBuilder, // redits: Option>>, diff --git a/packages/router/README.md b/packages/router/README.md index 598c4f6a9..05181ec9b 100644 --- a/packages/router/README.md +++ b/packages/router/README.md @@ -16,7 +16,7 @@ enum AppRoute { NotFound } -static App: FC<()> = |cx, props| { +static App: Component<()> = |cx| { let route = use_router(cx, AppRoute::parse); match route { @@ -30,7 +30,7 @@ static App: FC<()> = |cx, props| { Adding links into your app: ```rust -static Leaf: FC<()> = |cx, props| { +static Leaf: Component<()> = |cx| { rsx!(cx, div { Link { to: AppRoute::Home } }) diff --git a/packages/router/examples/simple.rs b/packages/router/examples/simple.rs index 6c604b88a..5f8105223 100644 --- a/packages/router/examples/simple.rs +++ b/packages/router/examples/simple.rs @@ -6,10 +6,10 @@ use dioxus_router::*; fn main() { console_error_panic_hook::set_once(); wasm_logger::init(wasm_logger::Config::new(log::Level::Debug)); - dioxus_web::launch(App, |c| c); + dioxus_web::launch(APP); } -static App: Component<()> = |cx, props| { +static APP: Component<()> = |cx| { #[derive(Clone, Debug, PartialEq)] enum Route { Home, @@ -17,7 +17,7 @@ static App: Component<()> = |cx, props| { NotFound, } - let route = use_router(cx, |s| match s { + let route = use_router(&cx, |s| match s { "/" => Route::Home, "/about" => Route::About, _ => Route::NotFound, diff --git a/packages/ssr/README.md b/packages/ssr/README.md index 4d47b426d..02f6e09d8 100644 --- a/packages/ssr/README.md +++ b/packages/ssr/README.md @@ -5,7 +5,7 @@ Render a Dioxus VirtualDOM to a string. ```rust // Our app: -const App: FC<()> = |cx, props| rsx!(cx, div {"hello world!"}); +const App: Component<()> = |cx, props| rsx!(cx, div {"hello world!"}); // Build the virtualdom from our app let mut vdom = VirtualDOM::new(App); @@ -14,7 +14,7 @@ let mut vdom = VirtualDOM::new(App); let _ = vdom.rebuild(); // Render the entire virtualdom from the root -let text = dioxus::ssr::render_vdom(&vdom, |c| c); +let text = dioxus::ssr::render_vdom(&vdom); assert_eq!(text, "
hello world!
") ``` @@ -30,7 +30,7 @@ With pre-rendering enabled, this crate will generate element nodes with Element To enable pre-rendering, simply configure the `SsrConfig` with pre-rendering enabled. ```rust -let dom = VirtualDom::new(App, |c| c); +let dom = VirtualDom::new(App); let text = dioxus::ssr::render_vdom(App, |cfg| cfg.pre_render(true)); ``` @@ -40,7 +40,7 @@ let text = dioxus::ssr::render_vdom(App, |cfg| cfg.pre_render(true)); Dioxus SSR can also be to render on the server. Obviously, you can just render the VirtualDOM to a string and send that down. ```rust -let text = dioxus::ssr::render_vdom(&vdom, |c| c); +let text = dioxus::ssr::render_vdom(&vdom); assert_eq!(text, "
hello world!
") ``` diff --git a/packages/ssr/src/lib.rs b/packages/ssr/src/lib.rs index 80de92680..a29a7db1c 100644 --- a/packages/ssr/src/lib.rs +++ b/packages/ssr/src/lib.rs @@ -82,7 +82,10 @@ pub fn render_lazy<'a>(f: Option>) -> String { ) } -pub fn render_vdom(dom: &VirtualDom, cfg: impl FnOnce(SsrConfig) -> SsrConfig) -> String { +pub fn render_vdom(dom: &VirtualDom) -> String { + format!("{:}", TextRenderer::from_vdom(dom, SsrConfig::default())) +} +pub fn render_vdom_cfg(dom: &VirtualDom, cfg: impl FnOnce(SsrConfig) -> SsrConfig) -> String { format!( "{:}", TextRenderer::from_vdom(dom, cfg(SsrConfig::default())) @@ -110,7 +113,7 @@ pub fn render_vdom_scope(vdom: &VirtualDom, scope: ScopeId) -> Option { /// /// ## Example /// ```ignore -/// static App: FC<()> = |cx, props|cx.render(rsx!(div { "hello world" })); +/// static App: Component<()> = |cx, props|cx.render(rsx!(div { "hello world" })); /// let mut vdom = VirtualDom::new(App); /// vdom.rebuild(); /// @@ -343,28 +346,28 @@ mod tests { fn to_string_works() { let mut dom = VirtualDom::new(SIMPLE_APP); dom.rebuild(); - dbg!(render_vdom(&dom, |c| c)); + dbg!(render_vdom(&dom)); } #[test] fn hydration() { let mut dom = VirtualDom::new(NESTED_APP); dom.rebuild(); - dbg!(render_vdom(&dom, |c| c.pre_render(true))); + dbg!(render_vdom_cfg(&dom, |c| c.pre_render(true))); } #[test] fn nested() { let mut dom = VirtualDom::new(NESTED_APP); dom.rebuild(); - dbg!(render_vdom(&dom, |c| c)); + dbg!(render_vdom(&dom)); } #[test] fn fragment_app() { let mut dom = VirtualDom::new(FRAGMENT_APP); dom.rebuild(); - dbg!(render_vdom(&dom, |c| c)); + dbg!(render_vdom(&dom)); } #[test] @@ -394,7 +397,7 @@ mod tests { let mut dom = VirtualDom::new(STLYE_APP); dom.rebuild(); - dbg!(render_vdom(&dom, |c| c)); + dbg!(render_vdom(&dom)); } #[test] diff --git a/packages/web/examples/async.rs b/packages/web/examples/async.rs index c6cedf9be..ae8af39bd 100644 --- a/packages/web/examples/async.rs +++ b/packages/web/examples/async.rs @@ -11,11 +11,11 @@ use dioxus_web; use gloo_timers::future::TimeoutFuture; fn main() { - dioxus_web::launch(App, |c| c); + dioxus_web::launch(App); } -static App: Component<()> = |cx, props| { - let mut count = use_state(cx, || 0); +static App: Component<()> = |cx| { + let mut count = use_state(&cx, || 0); cx.push_task(|| async move { TimeoutFuture::new(100).await; diff --git a/packages/web/examples/js_bench.rs b/packages/web/examples/js_bench.rs index e81b1f04b..cc7304b40 100644 --- a/packages/web/examples/js_bench.rs +++ b/packages/web/examples/js_bench.rs @@ -6,7 +6,6 @@ use dioxus_core_macro::*; use dioxus_hooks::{use_ref, use_state}; use dioxus_html as dioxus_elements; use dioxus_web; -use gloo_timers::future::TimeoutFuture; use rand::prelude::*; fn main() { @@ -73,7 +72,7 @@ fn main() { wasm_bindgen::intern(&x.to_string()); } - dioxus_web::launch(App, |c| c.rootname("main")); + dioxus_web::launch(App); } #[derive(Clone, PartialEq, Copy)] @@ -107,9 +106,9 @@ impl Label { } } -static App: Component<()> = |cx, _props| { - let mut items = use_ref(cx, || vec![]); - let mut selected = use_state(cx, || None); +static App: Component<()> = |cx| { + let mut items = use_ref(&cx, || vec![]); + let mut selected = use_state(&cx, || None); cx.render(rsx! { div { class: "container" @@ -175,10 +174,10 @@ struct ActionButtonProps<'a> { onclick: &'a dyn Fn(), } -fn ActionButton(cx: Scope, props: &ActionButtonProps) -> Element { +fn ActionButton<'a>(cx: Scope<'a, ActionButtonProps<'a>>) -> Element { rsx!(cx, div { class: "col-sm-6 smallpad" - button { class:"btn btn-primary btn-block", r#type: "button", id: "{props.id}", onclick: move |_| (props.onclick)(), - "{props.name}" + button { class:"btn btn-primary btn-block", r#type: "button", id: "{cx.props.id}", onclick: move |_| (cx.props.onclick)(), + "{cx.props.name}" } }) } @@ -229,9 +228,9 @@ static NOUNS: &[&str] = &[ // fn Row(cx: Context, props: &RowProps) -> Element { // rsx!(cx, tr { -// td { class:"col-md-1", "{props.row_id}" } +// td { class:"col-md-1", "{cx.props.row_id}" } // td { class:"col-md-1", onclick: move |_| { /* run onselect */ } -// a { class: "lbl", {props.label.labels} } +// a { class: "lbl", {cx.props.label.labels} } // } // td { class: "col-md-1" // a { class: "remove", onclick: move |_| {/* remove */} diff --git a/packages/web/examples/simple.rs b/packages/web/examples/simple.rs index d93591952..ffb572314 100644 --- a/packages/web/examples/simple.rs +++ b/packages/web/examples/simple.rs @@ -7,16 +7,14 @@ use dioxus_core as dioxus; use dioxus_core_macro::*; use dioxus_hooks::use_state; use dioxus_html as dioxus_elements; -use dioxus_web; -use gloo_timers::future::TimeoutFuture; fn main() { wasm_logger::init(wasm_logger::Config::new(log::Level::Debug)); - dioxus_web::launch(App, |c| c); + dioxus_web::launch(App); } -static App: Component<()> = |cx, props| { - let show = use_state(cx, || true); +static App: Component<()> = |cx| { + let show = use_state(&cx, || true); let inner = match *show { true => { diff --git a/packages/web/examples/suspense.rs b/packages/web/examples/suspense.rs index 615351a81..4dd1b4c33 100644 --- a/packages/web/examples/suspense.rs +++ b/packages/web/examples/suspense.rs @@ -11,10 +11,10 @@ use dioxus_html as dioxus_elements; use dioxus_web; fn main() { - dioxus_web::launch(App, |c| c); + dioxus_web::launch(App); } -static App: Component<()> = |cx, _| { +static App: Component<()> = |cx| { let doggo = cx.suspend(|| async move { #[derive(serde::Deserialize)] struct Doggo { diff --git a/packages/web/src/lib.rs b/packages/web/src/lib.rs index d792c3725..8796ba35e 100644 --- a/packages/web/src/lib.rs +++ b/packages/web/src/lib.rs @@ -84,12 +84,12 @@ mod ric_raf; /// dioxus_web::launch(App); /// } /// -/// static App: Component<()> = |cx, props| { +/// static App: Component<()> = |cx| { /// rsx!(cx, div {"hello world"}) /// } /// ``` pub fn launch(root_component: Component<()>) { - launch_with_props(root_component, (), |c| c); + launch_with_props(root_component, ()); } /// Launches the VirtualDOM from the specified component function and props. @@ -100,7 +100,7 @@ pub fn launch(root_component: Component<()>) { /// /// ```rust /// fn main() { -/// dioxus_web::launch_with_props(App, RootProps { name: String::from("joe") }, |c| c); +/// dioxus_web::launch_with_props(App, RootProps { name: String::from("joe") }); /// } /// /// #[derive(ParitalEq, Props)] @@ -108,8 +108,8 @@ pub fn launch(root_component: Component<()>) { /// name: String /// } /// -/// static App: Component = |cx, props| { -/// rsx!(cx, div {"hello {props.name}"}) +/// static App: Component = |cx| { +/// rsx!(cx, div {"hello {cx.props.name}"}) /// } /// ``` pub fn launch_with_props( @@ -132,7 +132,7 @@ pub fn launch_with_props( /// /// ```ignore /// fn main() { -/// let app_fut = dioxus_web::run_with_props(App, RootProps { name: String::from("joe") }, |c| c); +/// let app_fut = dioxus_web::run_with_props(App, RootProps { name: String::from("joe") }); /// wasm_bindgen_futures::spawn_local(app_fut); /// } /// ``` diff --git a/src/lib.rs b/src/lib.rs index 10a22e685..773aed0cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,8 +10,8 @@ //! This overview is provides a brief introduction to Dioxus. For a more in-depth guide, make sure to check out: //! - [Getting Started](https://dioxuslabs.com/getting-started) //! - [Book](https://dioxuslabs.com/book) -//! - [Reference](https://dioxuslabs.com/refernce-guide) - +//! - [Reference](https://dioxuslabs.com/reference) +//! - [Community Examples](https://github.com/DioxusLabs/community-examples) //! //! # Overview and Goals //! @@ -22,34 +22,32 @@ //! //! - Hooks for state //! - VirtualDom & diffing -//! - Concurrency & asynchronous rendering +//! - Concurrency, fibers, and asynchronous rendering //! - JSX-like templating syntax //! //! If you know React, then you know Dioxus. //! -//! Dioxus is *substantially* faster than many of the other Rust UI libraries (Yew/Percy) and is *significantly* faster -//! than React, competitve with InfernoJS and frameworks like Svelte/SolidJS. +//! Dioxus is *substantially* more performant than many of the other Rust UI libraries (Yew/Percy) and is *significantly* more performant +//! than React - roughly competitve with InfernoJS. +//! +//! Remember: Dioxus is a library for declaring interactive user interfaces - it is not a dedicated renderer. Most 1st party renderers for Dioxus currently only support web technologies. //! //! ## Brief Overview //! -//! All Dioxus apps are built by composing functions that take in a `Scope` and `Properties` and return an `Element`. A `Scope` holds -//! relevant state data for the the currently-rendered component. +//! All Dioxus apps are built by composing functions that take in a `Scope` which is generic over some `Properties` and return an `Element`. +//! A `Scope` holds relevant state data for the the currently-rendered component. +//! +//! To launch an app, we use the `launch` method for the specific renderer we want to use. In the launch function, was pass the app's `Component`. //! //! ```rust //! use dioxus::prelude::*; //! //! fn main() { -//! dioxus::desktop::launch(App); +//! dioxus::desktop::launch(app); //! } //! -//! fn App(cx: Scope, props: &()) -> Element { -//! let mut count = use_state(cx, || 0); -//! -//! cx.render(rsx!( -//! div { "Count: {count}" } -//! button { onclick: move |_| count += 1, "Increment" } -//! button { onclick: move |_| count -= 1, "Decrement" } -//! )) +//! fn app(cx: Scope<()>) -> Element { +//! cx.render(rsx!("hello world!")) //! } //! ``` //! @@ -59,7 +57,7 @@ //! For components with no explicit properties, we can use the `()` type. In Dioxus, all properties are memoized by default! //! //! ```rust -//! fn App(cx: Scope, props &()) -> Element { +//! fn App(cx: Scope<()>) -> Element { //! cx.render(rsx!( //! Header { //! title: "My App", @@ -78,11 +76,11 @@ //! color: String, //! } //! -//! fn Header(cx: Scope, props: &HeaderProps) -> Element { +//! fn Header(cx: Scope) -> Element { //! cx.render(rsx!( //! div { -//! background_color: "{props.color}" -//! h1 { "{props.title}" } +//! background_color: "{cx.props.color}" +//! h1 { "{cx.props.title}" } //! } //! )) //! } @@ -90,21 +88,65 @@ //! //! ## Hooks //! -//! While components are reusable forms of UI elements, hooks are reusable forms of logic. The details of hooks are -//! somewhat complicated. In essence, hooks let us save state between renders of our components and reuse the accompanying -//! logic across different apps. -//! -//! Hooks are simply composition of other hooks. To create our first hook we can create a simple function that takes in -//! an Scope. We can then call `use_hook` on the `Scope` to get a mutable reference to the stored value. +//! While components are reusable forms of UI elements, hooks are reusable forms of logic. All hooks start with `use_`. We can use hooks to declare state. //! //! ```rust -//! fn use_say_hello(cx: Scope) -> &mut String { +//! fn app(cx: Scope<()>) -> Element { +//! let name = use_state(&cx, || "world"); +//! +//! rsx!(cx, "hello {name}!") +//! } +//! ``` +//! +//! Hooks are sensitive to how they are used. To use hooks, you must abide by the ["rules of hooks" (borrowed from react)](https://reactjs.org/docs/hooks-rules.html): +//! - Hooks should not be called in callbacks +//! - Hooks should not be called in out of order +//! - Hooks should not be called in loops or conditionals +//! +//! In a sense, hooks let us add a field of state to our component without declaring +//! an explicit struct. However, this means we need to "load" the struct in the right +//! order. If that order is wrong, then the hook will pick the wrong state and panic. +//! +//! Most hooks you'll write are simply composition of other hooks: +//! +//! ```rust +//! fn use_username(cx: &ScopeState, id: Uuid) -> bool { +//! let users = use_context::(cx); +//! users.get(&id).is_some().map(|user| user.logged_in).ok_or(false) +//! } +//! ``` +//! +//! To create entirely new foundational hooks, we can use the `use_hook` method on ScopeState. +//! +//! ```rust +//! fn use_mut_string(cx: &ScopeState) -> &mut String { //! cx.use_hook(|_| "Hello".to_string(), |hook| hook) //! } //! ``` //! -//! If you want to extend Dioxus with some new functionality, you'll probably want to implement a new hook. +//! If you want to extend Dioxus with some new functionality, you'll probably want to implement a new hook from scratch. //! +//! ## Putting it all together +//! +//! Using components, templates, and hooks, we can build a simple app. +//! +//! ```rust +//! use dioxus::prelude::*; +//! +//! fn main() { +//! dioxus::desktop::launch(App); +//! } +//! +//! fn App(cx: Scope<()>) -> Element { +//! let mut count = use_state(&cx, || 0); +//! +//! cx.render(rsx!( +//! div { "Count: {count}" } +//! button { onclick: move |_| count += 1, "Increment" } +//! button { onclick: move |_| count -= 1, "Decrement" } +//! )) +//! } +//! ``` //! //! ## Features //! @@ -122,6 +164,23 @@ //! - Custom elements //! - Basic fine-grained reactivity (IE SolidJS/Svelte) //! - and more! +//! +//! Good luck! +//! +//! ## Inspiration, Resources, Alternatives and Credits +//! +//! Dioxus is inspired by: +//! - React: for its hooks, concurrency, suspense +//! - Dodrio: for its research in bump allocation, double buffering, and diffing architecture +//! +//! Alternatives to Dioxus include: +//! - Yew: supports function components and web, but no SSR, borrowed data, or bump allocation. Rather slow at times. +//! - Percy: supports function components, web, ssr, but lacks in state management +//! - Sycamore: supports function components, web, ssr, but closer to SolidJS than React +//! - MoonZoom/Seed: opionated in the Elm model (message, update) - no hooks +//! +//! We've put a lot of work into making Dioxus ergonomic and *familiar*. +//! Our target audience is TypeSrcipt developers looking to switch to Rust for the web - so we need to be comparabale to React. // Just a heads-up, the core functionality of dioxus rests in Dioxus-Core. This crate just wraps a bunch of utilities // together and exports their namespaces to something predicatble. From 0846d93d41c27464ca271757c6f24a2cef8fb997 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 15:58:20 -0500 Subject: [PATCH 04/21] wip: bump versions --- packages/html/Cargo.toml | 2 +- packages/router/Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index 4903276e9..b66714e04 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-html" -version = "0.0.0" +version = "0.1.0" authors = ["Jonathan Kelley"] edition = "2018" description = "HTML Element pack for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences" diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 6eea36766..df3fc15c1 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-router" -version = "0.0.0" +version = "0.1.0" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -28,7 +28,7 @@ serde_urlencoded = "0.7" wasm-bindgen = "0.2" js-sys = "0.3" -gloo = "0.4" +gloo = "0.5" route-recognizer = "0.3.1" url = "2.2.2" url_serde = "0.2.0" From 58106a55291e90661e8901dd8900434c20a75576 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 15:59:02 -0500 Subject: [PATCH 05/21] fix: router version --- packages/router/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index df3fc15c1..4189c300b 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "0.1.3", default-features = false } +dioxus-core = { path = "../core", version = "0.1", default-features = false } +dioxus-html = { path = "../html", version = "0.1", default-features = false } dioxus-core-macro = { path = "../core-macro", version = "0.1" } -dioxus-html = { path = "../html", version = "0.0.0", default-features = false } web-sys = { version = "0.3", features = [ "Attr", From 270dfc9590b2354d083ea8da5cc0e1a1497d30e0 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 15:59:11 -0500 Subject: [PATCH 06/21] Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 --- Cargo.toml | 2 +- packages/core/Cargo.toml | 2 +- packages/desktop/Cargo.toml | 2 +- packages/html/Cargo.toml | 2 +- packages/mobile/Cargo.toml | 2 +- packages/router/Cargo.toml | 6 +++--- packages/ssr/Cargo.toml | 2 +- packages/web/Cargo.toml | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 21f2f915f..678081fb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ description = "Core functionality for Dioxus - a concurrent renderer-agnostic Vi # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "./packages/core", version = "0.1.3" } +dioxus-core = { path = "./packages/core", version ="^0.1.3"} dioxus-router = { path = "./packages/router", optional = true } dioxus-core-macro = { path = "./packages/core-macro", optional = true } dioxus-html = { path = "./packages/html", optional = true } diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 1788427d7..e363b4f8f 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -47,7 +47,7 @@ dioxus-html = { path = "../html" } fern = { version = "0.6.0", features = ["colored"] } rand = { version = "0.8.4", features = ["small_rng"] } simple_logger = "1.13.0" -dioxus-core-macro = { path = "../core-macro", version = "0.1.2" } +dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} # dioxus-hooks = { path = "../hooks" } criterion = "0.3.5" diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index 40ac7b6ed..c4829df93 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "0.1.2", features = ["serialize"] } +dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index b66714e04..bf351d4c5 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -9,7 +9,7 @@ description = "HTML Element pack for Dioxus - a concurrent renderer-agnostic Vir # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} # Serialize the Edits for use in Webview/Liveview instances serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1.7", optional = true } diff --git a/packages/mobile/Cargo.toml b/packages/mobile/Cargo.toml index df174023d..9566c3330 100644 --- a/packages/mobile/Cargo.toml +++ b/packages/mobile/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] anyhow = "1.0" # cacao = { git = "https://github.com/ryanmcgrath/cacao" } -dioxus-core = { path = "../core", version = "0.1.2" } +dioxus-core = { path = "../core", version ="^0.1.3"} log = "0.4.14" serde = "1.0.126" serde_json = "1.0.64" diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 4189c300b..808d15673 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "0.1", default-features = false } -dioxus-html = { path = "../html", version = "0.1", default-features = false } -dioxus-core-macro = { path = "../core-macro", version = "0.1" } +dioxus-core = { path = "../core", version ="^0.1.3", default-features = false } +dioxus-html = { path = "../html", version ="^0.1.0", default-features = false } +dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} web-sys = { version = "0.3", features = [ "Attr", diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 681b235a1..291164e27 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } [dev-dependencies] diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index a45bd7e31..264e14542 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "0.1.2" } +dioxus-core = { path = "../core", version ="^0.1.3"} dioxus-html = { path = "../html" } js-sys = "0.3" # wasm-bindgen-shared = { path = "../../../Tinkering/wasm-bindgen/crates/shared" } From e4c06ce8e893779d2aad0883a1bb27d193bc5985 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 16:04:27 -0500 Subject: [PATCH 07/21] docs: update cargo tomls --- CHANGELOG.md | 81 +++++ Cargo.toml | 6 +- packages/core-macro/CHANGELOG.md | 175 ++++++++++ packages/core-macro/Cargo.toml | 20 +- packages/core/CHANGELOG.md | 528 +++++++++++++++++++++++++++++++ packages/core/Cargo.toml | 21 +- packages/coroutines/Cargo.toml | 18 +- packages/desktop/CHANGELOG.md | 106 +++++++ packages/desktop/Cargo.toml | 20 +- packages/hooks/CHANGELOG.md | 113 +++++++ packages/hooks/Cargo.toml | 18 +- packages/html/CHANGELOG.md | 83 +++++ packages/html/Cargo.toml | 20 +- packages/liveview/CHANGELOG.md | 40 +++ packages/liveview/Cargo.toml | 16 +- packages/mobile/CHANGELOG.md | 48 +++ packages/mobile/Cargo.toml | 20 +- packages/router/CHANGELOG.md | 56 ++++ packages/router/Cargo.toml | 24 +- packages/ssr/CHANGELOG.md | 108 +++++++ packages/ssr/Cargo.toml | 19 +- packages/web/CHANGELOG.md | 260 +++++++++++++++ packages/web/Cargo.toml | 19 +- 23 files changed, 1788 insertions(+), 31 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 packages/core-macro/CHANGELOG.md create mode 100644 packages/core/CHANGELOG.md create mode 100644 packages/desktop/CHANGELOG.md create mode 100644 packages/hooks/CHANGELOG.md create mode 100644 packages/html/CHANGELOG.md create mode 100644 packages/liveview/CHANGELOG.md create mode 100644 packages/mobile/CHANGELOG.md create mode 100644 packages/router/CHANGELOG.md create mode 100644 packages/ssr/CHANGELOG.md create mode 100644 packages/web/CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..f27966f0b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,81 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + - improve docs + - big updates to the reference + - lib.rs docs + - move around examples + +### New Features + + - it compiles once more + - massage lifetimes + - amazingly awesome error handling + - svgs working in webview + - mvoe away from compound context + - more suspended nodes! + - add aria + - enable arbitrary body in rsx! macro + +### Commit Statistics + + + + - 36 commits contributed to the release over the course of 174 calendar days. + - 34 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - docs ([`8814977`](https://github.comgit//DioxusLabs/dioxus/commit/8814977eeebe06748a3b9677a8070e42a037ebd7)) + - it compiles once more ([`8acdd2e`](https://github.comgit//DioxusLabs/dioxus/commit/8acdd2ea830b995b608d8bac2ef527db8d40e662)) + - some docs and suspense ([`93d4b8c`](https://github.comgit//DioxusLabs/dioxus/commit/93d4b8ca7c1b133e5dba2a8dc9a310dbe1357001)) + - docs and router ([`a5f05d7`](https://github.comgit//DioxusLabs/dioxus/commit/a5f05d73acc0e47b05cff64a373482519414bc7c)) + - Merge branch 'master' into jk/remove_node_safety ([`db00047`](https://github.comgit//DioxusLabs/dioxus/commit/db0004758c77331cc3b93ea8cf227c060028e12e)) + - improve docs ([`7800744`](https://github.comgit//DioxusLabs/dioxus/commit/78007445f944f259170307d840e0f16242b7b4b6)) + - Various typos/grammar/rewording ([`5747e00`](https://github.comgit//DioxusLabs/dioxus/commit/5747e00b27b1b69c4f9c2820e7e78030feaff71e)) + - bubbling in progress ([`a21020e`](https://github.comgit//DioxusLabs/dioxus/commit/a21020ea575e467ba0d608737269fe1b0792dba7)) + - massage lifetimes ([`9726a06`](https://github.comgit//DioxusLabs/dioxus/commit/9726a065b0d4fb1ede5b53a2ddd58c855e51539f)) + - major cleanups to scheduler ([`2933e4b`](https://github.comgit//DioxusLabs/dioxus/commit/2933e4bc11b3074c2bde8d76ec55364fca841988)) + - threadsafe ([`82953f2`](https://github.comgit//DioxusLabs/dioxus/commit/82953f2ac37913f83a822333acd0c47e20777d31)) + - move macro crate out of core ([`7bdad1e`](https://github.comgit//DioxusLabs/dioxus/commit/7bdad1e2e6f67e74c9f67dde2150140cf8a090e8)) + - amazingly awesome error handling ([`4a72b31`](https://github.comgit//DioxusLabs/dioxus/commit/4a72b3140bd244da602deada1eeecded65ff5848)) + - some ideas ([`05c909f`](https://github.comgit//DioxusLabs/dioxus/commit/05c909f320765aec1bf4c1c55ca59ffd5525a2c7)) + - big updates to the reference ([`583fdfa`](https://github.comgit//DioxusLabs/dioxus/commit/583fdfa5618e11d660985b97e570d4503be2ff49)) + - docs, html! macro, more ([`caf772c`](https://github.comgit//DioxusLabs/dioxus/commit/caf772cf249d2f56c8d0b0fa2737ad48e32c6e82)) + - cleanup workspace ([`8f0bb5d`](https://github.comgit//DioxusLabs/dioxus/commit/8f0bb5dc5bfa3e775af567c4b569622cdd932af1)) + - svgs working in webview ([`3bedcb9`](https://github.comgit//DioxusLabs/dioxus/commit/3bedcb93cacec5bdf134adc38ff02eadbf96c1c6)) + - mvoe away from compound context ([`a2c7d17`](https://github.comgit//DioxusLabs/dioxus/commit/a2c7d17b0595769f60bc1c2bbf7cbe32cec37486)) + - more suspended nodes! ([`de9f61b`](https://github.comgit//DioxusLabs/dioxus/commit/de9f61bcf48c0d6e35e46c337b72a713c9f9f7d2)) + - add aria ([`4091846`](https://github.comgit//DioxusLabs/dioxus/commit/4091846934b4b3b2bc03d3ca8aaf7712aebd4e36)) + - more examples ([`56e7eb8`](https://github.comgit//DioxusLabs/dioxus/commit/56e7eb83a97ebd6d5bcd23464cfb9d718e5ac26d)) + - more refactor for async ([`975fa56`](https://github.comgit//DioxusLabs/dioxus/commit/975fa566f9809f8fa2bb0bdb07fbfc7f855dcaeb)) + - enable arbitrary body in rsx! macro ([`7aec40d`](https://github.comgit//DioxusLabs/dioxus/commit/7aec40d57e78ec13ff3a90ca8149521cbf1d9ff2)) + - move CLI into its own "studio" app ([`fd79335`](https://github.comgit//DioxusLabs/dioxus/commit/fd7933561fe81922e4d5d77f6ac3b6f19efb5a90)) + - move some examples around ([`98a0933`](https://github.comgit//DioxusLabs/dioxus/commit/98a09339fd3190799ea4dd316908f0a53fdf2413)) + - fix issues with lifetimes ([`a38a81e`](https://github.comgit//DioxusLabs/dioxus/commit/a38a81e1290375cae685f7c49d3745e4298fab26)) + - more examples ([`11f89e5`](https://github.comgit//DioxusLabs/dioxus/commit/11f89e5d338d14a7aeece0a6275c24ae65913ce7)) + - lib.rs docs ([`bf21c82`](https://github.comgit//DioxusLabs/dioxus/commit/bf21c82de04e25daee60a06232b9a16b640508f2)) + - rename ctx to cx ([`81382e7`](https://github.comgit//DioxusLabs/dioxus/commit/81382e7044fb3dba61d4abb1e6086b7b29143116)) + - move around examples ([`70cd46d`](https://github.comgit//DioxusLabs/dioxus/commit/70cd46dbb2a689ae2d512e142b8aee9c80798430)) + - start moving events to rc ([`b9ff95f`](https://github.comgit//DioxusLabs/dioxus/commit/b9ff95fa12c46365fe73b64a4926a506d5da2342)) + - rename recoil to atoms ([`36ea39a`](https://github.comgit//DioxusLabs/dioxus/commit/36ea39ae30aa3f1fb2d718c0fdf08850c6bfd3ac)) + - more examples and docs ([`7fbaf69`](https://github.comgit//DioxusLabs/dioxus/commit/7fbaf69cabbdde712bb3fd9e4b2a5dc18b9390e9)) + - docs ([`f5683a2`](https://github.comgit//DioxusLabs/dioxus/commit/f5683a23464992ecace463a61414795b5a2c58c8)) +
+ diff --git a/Cargo.toml b/Cargo.toml index 678081fb5..b8470ecb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "dioxus" version = "0.1.0" -authors = ["Jonathan Kelley "] +authors = ["Jonathan Kelley"] edition = "2018" description = "Core functionality for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences" -"license" = "MIT/Apache-2.0" +license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "./packages/core", version ="^0.1.3"} +dioxus-core = { path = "./packages/core", version = "^0.1.3" } dioxus-router = { path = "./packages/router", optional = true } dioxus-core-macro = { path = "./packages/core-macro", optional = true } dioxus-html = { path = "./packages/html", optional = true } diff --git a/packages/core-macro/CHANGELOG.md b/packages/core-macro/CHANGELOG.md new file mode 100644 index 000000000..e4cfeebed --- /dev/null +++ b/packages/core-macro/CHANGELOG.md @@ -0,0 +1,175 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.2 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + - big updates to the reference + - examples + - more work on docs + +### New Features + + - upgrade syntax + - pull children out of component definition + - cleanuup + - full html support + - massage lifetimes + - mutations + - amazingly awesome error handling + - mvoe away from compound context + - wire up event delegator for webview + - add aria + - beaf up the use_state hook + - enable arbitrary body in rsx! macro + - namespaced attributes + this commit adds namespaced attributes. This lets us support attribute groups, and thus, inline styles. + + This namespaced attribute stuff is only available for styles at the moment, though it theoretically could be enabled for any other attributes. + - add edits back! and more webview support! + This commit adds a new type - the DomEdit - for serializing the changes made by the diffing machine. The architecture of how DomEdits fit into the cooperative scheduling is still TBD but it will allow us to build change lists without applying them immediately. This is more performant and allows us to only render parts of the page at a time. + + This commit also adds more infrastructure around webview. Dioxus can now run on the web, generate static pages, run in the desktop, and run on mobile, with a large part of thanks to webview. + - two calculator examples + - props memoization is more powerful + This commit solves the memoization , properly memoizing properties that don't have any generic parameters. This is a rough heuristic to prevent non-static lifetimes from creeping into props and breaking our minual lifetime management. + + Props that have a generic parameter are opted-out of the `partialeq` requirement and props *without* lifetimes must implement partialeq. We're going to leave manual disabling of memoization for future work. + - todomvc + +### Bug Fixes + + - really big bug around hooks + - use annotation method from rust/58052 to fix closure lifetimes + - messed up how lifetimes worked, need to render once per component + +### Commit Statistics + + + + - 107 commits contributed to the release over the course of 329 calendar days. + - 103 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - docs ([`8814977`](https://github.comgit//DioxusLabs/dioxus/commit/8814977eeebe06748a3b9677a8070e42a037ebd7)) + - polish ([`8bf57dc`](https://github.comgit//DioxusLabs/dioxus/commit/8bf57dc21dfbcbae5b95650203b68d3f41227652)) + - really big bug around hooks ([`52c7154`](https://github.comgit//DioxusLabs/dioxus/commit/52c7154897111b570918127ffe3285bb1d5951a0)) + - rename ([`36d89be`](https://github.comgit//DioxusLabs/dioxus/commit/36d89beb34821694cb0afb546d3b0cb4e01aaae1)) + - updates to router ([`bab21a0`](https://github.comgit//DioxusLabs/dioxus/commit/bab21a0aa1cbf8e6bd95f823e49f53c082e8d6cc)) + - add router ([`d298b62`](https://github.comgit//DioxusLabs/dioxus/commit/d298b626d3ae21a39a8ec4426373369ac94edf9f)) + - docs and router ([`a5f05d7`](https://github.comgit//DioxusLabs/dioxus/commit/a5f05d73acc0e47b05cff64a373482519414bc7c)) + - upgrade syntax ([`fd93ee8`](https://github.comgit//DioxusLabs/dioxus/commit/fd93ee89c19b085a04307ef30217170518defa8e)) + - Merge branch 'master' into jk/remove_node_safety ([`db00047`](https://github.comgit//DioxusLabs/dioxus/commit/db0004758c77331cc3b93ea8cf227c060028e12e)) + - pull children out of component definition ([`2cf90b6`](https://github.comgit//DioxusLabs/dioxus/commit/2cf90b6903411e42f01a801f89037686194ee068)) + - bubbling in progress ([`a21020e`](https://github.comgit//DioxusLabs/dioxus/commit/a21020ea575e467ba0d608737269fe1b0792dba7)) + - cleanuup ([`84fd0c6`](https://github.comgit//DioxusLabs/dioxus/commit/84fd0c616252bf29cd665782258530032b54d13a)) + - clippy happy on macro ([`e1c858d`](https://github.comgit//DioxusLabs/dioxus/commit/e1c858dda5c937a56f402bfb3e8b90baf34b84f1)) + - remove bump ([`fcc6738`](https://github.comgit//DioxusLabs/dioxus/commit/fcc6738f1703006d7678f31a39bbf6d59464a7e1)) + - fix some bugs around the rsx macro ([`339e450`](https://github.comgit//DioxusLabs/dioxus/commit/339e450027b4a5d2e1317e13863cd1b2e7ab5853)) + - full html support ([`79503f1`](https://github.comgit//DioxusLabs/dioxus/commit/79503f15c5db04fa04575c8735941a2e3a75030b)) + - remove HTML macro and add custom fields ([`9f7eb0f`](https://github.comgit//DioxusLabs/dioxus/commit/9f7eb0f6002156d3e6e14ea2cb24829133b531c5)) + - use annotation method from rust/58052 to fix closure lifetimes ([`27d8919`](https://github.comgit//DioxusLabs/dioxus/commit/27d891934a70424b45e6278b7e2baaa2d1b78b35)) + - worked backwards a bit and got it slightly figured out ([`9ee2bfb`](https://github.comgit//DioxusLabs/dioxus/commit/9ee2bfb010ce90ec97e93e173c31aab281db32c4)) + - massage lifetimes ([`9726a06`](https://github.comgit//DioxusLabs/dioxus/commit/9726a065b0d4fb1ede5b53a2ddd58c855e51539f)) + - book documentation ([`16dbf4a`](https://github.comgit//DioxusLabs/dioxus/commit/16dbf4a6f84103857385fb4b142a718b0ce72118)) + - messed up how lifetimes worked, need to render once per component ([`ba9e1db`](https://github.comgit//DioxusLabs/dioxus/commit/ba9e1dbb8fa24048a6c9ccef8a8722688226a845)) + - major cleanups to scheduler ([`2933e4b`](https://github.comgit//DioxusLabs/dioxus/commit/2933e4bc11b3074c2bde8d76ec55364fca841988)) + - move everything over to a stack dst ([`0e9d5fc`](https://github.comgit//DioxusLabs/dioxus/commit/0e9d5fc5306ab508d5af6999a4064f9b8b48460f)) + - remove warnings on core macero ([`6587224`](https://github.comgit//DioxusLabs/dioxus/commit/6587224debffa8e8d5282dc3f120abbaa96f552b)) + - mutations ([`fac4233`](https://github.comgit//DioxusLabs/dioxus/commit/fac42339c272b0e430ebf4f31b6061a0635d3e19)) + - bottom up dropping ([`f2334c1`](https://github.comgit//DioxusLabs/dioxus/commit/f2334c17be2612d926361686d7d40a57e3ffe9b9)) + - fill out the snippets ([`6051b0e`](https://github.comgit//DioxusLabs/dioxus/commit/6051b0ec86927704451f4ce6cdf8f988e59702ae)) + - amazingly awesome error handling ([`4a72b31`](https://github.comgit//DioxusLabs/dioxus/commit/4a72b3140bd244da602deada1eeecded65ff5848)) + - big updates to the reference ([`583fdfa`](https://github.comgit//DioxusLabs/dioxus/commit/583fdfa5618e11d660985b97e570d4503be2ff49)) + - docs, html! macro, more ([`caf772c`](https://github.comgit//DioxusLabs/dioxus/commit/caf772cf249d2f56c8d0b0fa2737ad48e32c6e82)) + - get keyed diffing compiling ([`0a0be95`](https://github.comgit//DioxusLabs/dioxus/commit/0a0be95c3e58dc065409f02f703b82700c1003f8)) + - changes to scheduler ([`098d382`](https://github.comgit//DioxusLabs/dioxus/commit/098d3821ed89ad38d99077a6556b48a7e91fc3fc)) + - clean up warnings ([`b32e261`](https://github.comgit//DioxusLabs/dioxus/commit/b32e2611e37b17c2371ffb10cf1ac647f017d917)) + - mvoe away from compound context ([`a2c7d17`](https://github.comgit//DioxusLabs/dioxus/commit/a2c7d17b0595769f60bc1c2bbf7cbe32cec37486)) + - wire up event delegator for webview ([`7dfe89c`](https://github.comgit//DioxusLabs/dioxus/commit/7dfe89c9581f45a445f17f9fe4bb94e61f67e971)) + - basic support for scheduled rendering ([`c52af22`](https://github.comgit//DioxusLabs/dioxus/commit/c52af221f755601a9e826ffc2c355def138999d0)) + - solve some issues regarding listeners ([`dfaf5ad`](https://github.comgit//DioxusLabs/dioxus/commit/dfaf5adee164f44a679ab21d730caaab3610e01f)) + - change in cx to cx ([`9971ff2`](https://github.comgit//DioxusLabs/dioxus/commit/9971ff215db6f771b7ec1cae2517c85d47d38622)) + - move things into a "shared" object ([`f644d7c`](https://github.comgit//DioxusLabs/dioxus/commit/f644d7c44159eef091552dcc90acbb151ea76b21)) + - apply formatting ([`a85b8c4`](https://github.comgit//DioxusLabs/dioxus/commit/a85b8c4b6be83f7aba06714b6a1ff0aa5f2ee729)) + - more upgades to html parser ([`22f894e`](https://github.comgit//DioxusLabs/dioxus/commit/22f894e6b98073bffa39f08b890071ffc00b8d49)) + - serious refactor with const generics ([`160d86a`](https://github.comgit//DioxusLabs/dioxus/commit/160d86abbe1b325e3123202aef29025dcd96f4eb)) + - ....sigh..... so the diffing algorithm is robust ([`68ed1c0`](https://github.comgit//DioxusLabs/dioxus/commit/68ed1c04e7e773f9e6c0a5148f0ea89b97b6784e)) + - add aria ([`4091846`](https://github.comgit//DioxusLabs/dioxus/commit/4091846934b4b3b2bc03d3ca8aaf7712aebd4e36)) + - move examples around ([`304259d`](https://github.comgit//DioxusLabs/dioxus/commit/304259d8186d1d34224a74c95f4fd7d14126b499)) + - beaf up the use_state hook ([`e4cdb64`](https://github.comgit//DioxusLabs/dioxus/commit/e4cdb645aad800484b19ec35ba1f8bb9ccf71d12)) + - enable arbitrary body in rsx! macro ([`7aec40d`](https://github.comgit//DioxusLabs/dioxus/commit/7aec40d57e78ec13ff3a90ca8149521cbf1d9ff2)) + - move some examples around ([`98a0933`](https://github.comgit//DioxusLabs/dioxus/commit/98a09339fd3190799ea4dd316908f0a53fdf2413)) + - fix issues with lifetimes ([`a38a81e`](https://github.comgit//DioxusLabs/dioxus/commit/a38a81e1290375cae685f7c49d3745e4298fab26)) + - namespaced attributes ([`22e659c`](https://github.comgit//DioxusLabs/dioxus/commit/22e659c2bd7797ca5a822180aca0cb5d950c5287)) + - groundwork for noderefs ([`c1afeba`](https://github.comgit//DioxusLabs/dioxus/commit/c1afeba1efb1a063705466a14648beee08cacb86)) + - add edits back! and more webview support! ([`904b26f`](https://github.comgit//DioxusLabs/dioxus/commit/904b26f7111c3fc66400744ff6192e4b20bf6d74)) + - enable more diffing ([`e8f29a8`](https://github.comgit//DioxusLabs/dioxus/commit/e8f29a8f8ac56020bee0048021efa52547307a77)) + - two calculator examples ([`b5e5ef1`](https://github.comgit//DioxusLabs/dioxus/commit/b5e5ef171aa9f8986fb4ab04d793eb63f557c4ae)) + - examples ([`d9e6d09`](https://github.comgit//DioxusLabs/dioxus/commit/d9e6d0925b30690212d1d690dfba288f1a694a27)) + - wip ([`952a91d`](https://github.comgit//DioxusLabs/dioxus/commit/952a91d5408aaf789b496f11d01c3b3f7fcf9059)) + - rename ctx to cx ([`81382e7`](https://github.comgit//DioxusLabs/dioxus/commit/81382e7044fb3dba61d4abb1e6086b7b29143116)) + - rethinking stack machine ([`62ae5d3`](https://github.comgit//DioxusLabs/dioxus/commit/62ae5d3bb94cb9ead030ae0b39d9d9bc2b8b4532)) + - more work on docs ([`daa9bd8`](https://github.comgit//DioxusLabs/dioxus/commit/daa9bd82c365763fe240528c7df222d230bce613)) + - some cleanup and documentation ([`517d7f1`](https://github.comgit//DioxusLabs/dioxus/commit/517d7f14957c4dae9fc894bfbdcd00a955d09f20)) + - docs ([`f5683a2`](https://github.comgit//DioxusLabs/dioxus/commit/f5683a23464992ecace463a61414795b5a2c58c8)) + - pre vnodes instead of vnode ([`fe6938c`](https://github.comgit//DioxusLabs/dioxus/commit/fe6938ceb3dba0796ae8bab52ae41248dc0d3650)) + - props memoization is more powerful ([`73047fe`](https://github.comgit//DioxusLabs/dioxus/commit/73047fe95678d50fcfd62a4ace7c6b406c5304e1)) + - merge in some code from the other branch ([`7790750`](https://github.comgit//DioxusLabs/dioxus/commit/7790750349b40055673a0ec16074a0426b84d3b3)) + - move the rsx macro around ([`50c8b93`](https://github.comgit//DioxusLabs/dioxus/commit/50c8b93aade1bfa83a091fb51ee48638507f89b0)) + - massive changes to definition of components ([`508c560`](https://github.comgit//DioxusLabs/dioxus/commit/508c560320d78730fa058156421523ffa5695d9d)) + - move to static props ([`c1fd848`](https://github.comgit//DioxusLabs/dioxus/commit/c1fd848f89b0146581d8e485fa0d4a847387b963)) + - more progress on parity docs. ([`c5089ba`](https://github.comgit//DioxusLabs/dioxus/commit/c5089ba3c5a8daad4de4d6257604011cc87f6ac7)) + - buff the readme and docs ([`3cfa1fe`](https://github.comgit//DioxusLabs/dioxus/commit/3cfa1fe125886787f35905ed9b05340a739bc654)) + - Todomvc in progress ([`b843dbd`](https://github.comgit//DioxusLabs/dioxus/commit/b843dbd3679abf86a34347d87fd4ce5fe9e2aca5)) + - remove old code ([`3de54d0`](https://github.comgit//DioxusLabs/dioxus/commit/3de54d0b5202aca678d485a68ef8de006a63e21b)) + - some code health ([`c28697e`](https://github.comgit//DioxusLabs/dioxus/commit/c28697e1fe3136d1835f2b663715f34aab9f4b17)) + - major overhaul to diffing ([`9810fee`](https://github.comgit//DioxusLabs/dioxus/commit/9810feebf57f93114e3d7faf6de053ac192593a9)) + - todos ([`8c541f6`](https://github.comgit//DioxusLabs/dioxus/commit/8c541f66d5f7ef2286f2cdf9b0496a9c404471f9)) + - todomvc ([`cfa0927`](https://github.comgit//DioxusLabs/dioxus/commit/cfa0927cdd40bc3dba22996018605dbad91d0391)) + - todomvc ([`ce33031`](https://github.comgit//DioxusLabs/dioxus/commit/ce33031519fbbbd207f1dffb75acf62bf59e3c9e)) + - more ergonomics, more examples ([`0bcff1f`](https://github.comgit//DioxusLabs/dioxus/commit/0bcff1f88e4b1a633b7a9b7c6c2e39b8bd3666c4)) + - use rsx! inline! ([`44aad27`](https://github.comgit//DioxusLabs/dioxus/commit/44aad2746c117ba9742c86a53327f4f9e96509e7)) + - building large apps, revamp macro ([`9f7f43b`](https://github.comgit//DioxusLabs/dioxus/commit/9f7f43b6614aaef2d7dded7058e81934f28f5dec)) + - begint to accept iterator types ([`742f150`](https://github.comgit//DioxusLabs/dioxus/commit/742f150eb3eba89913f5a0fabb229e72e2a0a5ee)) + - props now autoderives its own trait ([`b3c96a5`](https://github.comgit//DioxusLabs/dioxus/commit/b3c96a5996f434332813c737bb83ad564d91af5f)) + - staticify? ([`5ad8188`](https://github.comgit//DioxusLabs/dioxus/commit/5ad81885e499bf02ac79e0098f7956d02ee5f2e5)) + - cargo fix to clean up things ([`78d093a`](https://github.comgit//DioxusLabs/dioxus/commit/78d093a9454386397a991bd01e603e4ad554521f)) + - wire up props macro ([`37f5a7a`](https://github.comgit//DioxusLabs/dioxus/commit/37f5a7ad33e272a9e210bf480304d54ff0df0d67)) + - revert FC changes (like the old style). ([`7158bc3`](https://github.comgit//DioxusLabs/dioxus/commit/7158bc3575e180dbe8641549b040e74ae3baf80b)) + - yeet, synthetic somewhat wired up ([`d959806`](https://github.comgit//DioxusLabs/dioxus/commit/d9598066c2679d9d0b9ca0ce1d3f26110a238cd2)) + - remove FC ([`92d9521`](https://github.comgit//DioxusLabs/dioxus/commit/92d9521a73aefb620b354ae5954617109dd06e7e)) + - more cleanup ([`5a9155b`](https://github.comgit//DioxusLabs/dioxus/commit/5a9155b059acc1fb3c8b8accbeca3701ce4f0ab6)) + - add context to builder ([`cf16090`](https://github.comgit//DioxusLabs/dioxus/commit/cf16090838d127354e333dcbc0b06474835b87d6)) + - listeners now have scope information ([`fcd68e6`](https://github.comgit//DioxusLabs/dioxus/commit/fcd68e61d2400628469ba193b009e7bf1fd3acdf)) + - broken, but solved ([`cb74d70`](https://github.comgit//DioxusLabs/dioxus/commit/cb74d70f831b5510f1ee191d91eaff621ffa6256)) + - accept closures directly in handler ([`f225030`](https://github.comgit//DioxusLabs/dioxus/commit/f225030506967415a21f4af0372477cb5224ee7c)) + - wowza got it all working ([`4b8e9f4`](https://github.comgit//DioxusLabs/dioxus/commit/4b8e9f4a125b9d55439d919786f33d9d5df234e8)) + - parse custom rsx syntax ([`da00df6`](https://github.comgit//DioxusLabs/dioxus/commit/da00df66889f4fa2e39651491e08794e1fe78549)) + - update readme and examples ([`ffaf687`](https://github.comgit//DioxusLabs/dioxus/commit/ffaf6878963981860089c2362947bf77a84c9058)) + - add core macro crate ([`6a7bf3f`](https://github.comgit//DioxusLabs/dioxus/commit/6a7bf3f964150bcb8f7ba35ad285dd7deff7955c)) + - add in style crate, and abort any styligng ([`c09b71f`](https://github.comgit//DioxusLabs/dioxus/commit/c09b71f473ceeac7d37cd2b4117786350b6b11b6)) + - remove html crate ([`9dcee01`](https://github.comgit//DioxusLabs/dioxus/commit/9dcee01b335901cf2c80b453b97180e0d2551dc2)) + - add core macro crate ([`9f49ecb`](https://github.comgit//DioxusLabs/dioxus/commit/9f49ecbd95b60deb74c646f3798dfde3542c44be)) + - custom format_args for inlining variables into html templates ([`e4b1f6e`](https://github.comgit//DioxusLabs/dioxus/commit/e4b1f6ea0d0db707cf757dabf8635e9fc91a3e0f)) + - comment out examples and move lifetime in FC type ([`62d4ad5`](https://github.comgit//DioxusLabs/dioxus/commit/62d4ad58787185032100a2d25e79b70f6ec97a3c)) + - include the helper ([`07341d2`](https://github.comgit//DioxusLabs/dioxus/commit/07341d2c65dc61b90587e2e5daadf72ec82623a8)) + - Dioxus-webview ([`9c01736`](https://github.comgit//DioxusLabs/dioxus/commit/9c0173689539210d14847613f9a1694e6cb34506)) + - update fc_macro ([`28ac37a`](https://github.comgit//DioxusLabs/dioxus/commit/28ac37a8b23874c77011a46a11e6b9cbdf79ecdd)) + - dioxus frontend crate ([`4d7ac5b`](https://github.comgit//DioxusLabs/dioxus/commit/4d7ac5bb5d3aa1897c0f6c1f322aca08c0c791f0)) +
+ diff --git a/packages/core-macro/Cargo.toml b/packages/core-macro/Cargo.toml index 69f7117f4..c2a37fbdf 100644 --- a/packages/core-macro/Cargo.toml +++ b/packages/core-macro/Cargo.toml @@ -1,11 +1,25 @@ [package] name = "dioxus-core-macro" version = "0.1.2" -authors = ["Jonathan Kelley "] +authors = ["Jonathan Kelley"] edition = "2018" description = "Core macro for Dioxus Virtual DOM" -"license" = "MIT/Apache-2.0" - +license = "MIT/Apache-2.0" +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md new file mode 100644 index 000000000..36922f13a --- /dev/null +++ b/packages/core/CHANGELOG.md @@ -0,0 +1,528 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.3 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + - fix table + - more docs + - strong improvmenets, first major section done + - start on components + - lnks to projects + - big updates to the reference + - examples + - more docs + - move around examples + - move into a fromjs tutorial + - add some more sources in the core implementation + +### New Features + + - move back to combined cx/props + - bubbling + - it compiles once more + - should be functional across the boar + - wire tasks up + - wire up linked nodes + - it properly bubbles + - upgrade syntax + - fake bubbling + - events bubble now + - pull children out of component definition + - cleanuup + - full html support + - improve FC handling to allow lifetimes of parent + - improve safety + - massage lifetimes + - support desktop more completely + - add update functionality to useref + - desktop functioning well + - shared state mechanisms + - mutations + - re-enable suspense + - amazingly awesome error handling + - proper handling of events + - keyed diffing!! + - update root props + - some docs, cleaning + - more and more sophisticated diff + - a new vnode type for anchors + - code quality improvements for core + - mvoe away from compound context + - wire up resource pool + - make hooks free-functions + - transition to cx, props + - omg what a dumb mistake + - suspense! + - bless up, no more segfaults + - more suspended nodes! + - wire up event delegator for webview + - fix some lifetime issues + - move over to push based mechanism + - architecture document and edit list + - task system works + but I broke the other things :( + - rebuild doesn't return errors + - add aria + - buff up html allowed attributes + - enable components in ssr + - keyed diffing + - static node infrastructure and ssr changes + - tests and benchmarks + - dedicated mutations module + - refactor out the hooks implementation + - fix compiling + - move webview to wry + - beaf up the use_state hook + - namespaced attributes + this commit adds namespaced attributes. This lets us support attribute groups, and thus, inline styles. + + This namespaced attribute stuff is only available for styles at the moment, though it theoretically could be enabled for any other attributes. + - add edits back! and more webview support! + This commit adds a new type - the DomEdit - for serializing the changes made by the diffing machine. The architecture of how DomEdits fit into the cooperative scheduling is still TBD but it will allow us to build change lists without applying them immediately. This is more performant and allows us to only render parts of the page at a time. + + This commit also adds more infrastructure around webview. Dioxus can now run on the web, generate static pages, run in the desktop, and run on mobile, with a large part of thanks to webview. + - two calculator examples + - move to slotmap + - integrate serialization and string borrowing + This commit adds lifetimes to the diff and realdom methods so consumers may borrow the contents of the DOM for serialization or asynchronous modifications. + - events work again! + - props memoization is more powerful + This commit solves the memoization , properly memoizing properties that don't have any generic parameters. This is a rough heuristic to prevent non-static lifetimes from creeping into props and breaking our minual lifetime management. + + Props that have a generic parameter are opted-out of the `partialeq` requirement and props *without* lifetimes must implement partialeq. We're going to leave manual disabling of memoization for future work. + - todomvc + - somewhat working with rc and weak + - dyn scope + - update builder + +### Bug Fixes + + - really big bug around hooks + - desktop and mobile + - it compiles again + - use annotation method from rust/58052 to fix closure lifetimes + - messed up how lifetimes worked, need to render once per component + - all the bugs! + +### Performance + + - remove global allocation for props + - refcell to cell for hookidx + +### Commit Statistics + + + + - 393 commits contributed to the release over the course of 335 calendar days. + - 380 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - fix table ([`e495b09`](https://github.comgit//DioxusLabs/dioxus/commit/e495b09bf1c99950b5ea8647b371f296dc64afbe)) + - fix ssr ([`ded9696`](https://github.comgit//DioxusLabs/dioxus/commit/ded9696930ec825e0aba990494790e8be43a73e5)) + - remove portals completely ([`2fd56e7`](https://github.comgit//DioxusLabs/dioxus/commit/2fd56e76192bc70d5503bfcd6b4127d383dd082c)) + - some basic cleaning ([`f746793`](https://github.comgit//DioxusLabs/dioxus/commit/f746793890d091d3bca4b7c5261b8b2e2d080512)) + - go back to noisy lifetime solution ([`8daf7a6`](https://github.comgit//DioxusLabs/dioxus/commit/8daf7a6ed86df72522b089aa2647eea7bee0f3b6)) + - clean up the core crate ([`e6c6bbd`](https://github.comgit//DioxusLabs/dioxus/commit/e6c6bbdc1ec6a8c251b78c05ca104f006b6fad26)) + - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) + - docs ([`8814977`](https://github.comgit//DioxusLabs/dioxus/commit/8814977eeebe06748a3b9677a8070e42a037ebd7)) + - polish ([`8bf57dc`](https://github.comgit//DioxusLabs/dioxus/commit/8bf57dc21dfbcbae5b95650203b68d3f41227652)) + - update hooks ([`597a045`](https://github.comgit//DioxusLabs/dioxus/commit/597a0456f59872bd5dc60d382acdec76a98b1db2)) + - really big bug around hooks ([`52c7154`](https://github.comgit//DioxusLabs/dioxus/commit/52c7154897111b570918127ffe3285bb1d5951a0)) + - better desktop support ([`25a8411`](https://github.comgit//DioxusLabs/dioxus/commit/25a8411485e85bb7e3c8f20701d484529efe9a80)) + - move back to combined cx/props ([`96b3d56`](https://github.comgit//DioxusLabs/dioxus/commit/96b3d56e09a38843f7dc6c1047fe2a3923bd8473)) + - rename ([`36d89be`](https://github.comgit//DioxusLabs/dioxus/commit/36d89beb34821694cb0afb546d3b0cb4e01aaae1)) + - bubbling ([`19df1bd`](https://github.comgit//DioxusLabs/dioxus/commit/19df1bda109aba03c40ff631263bcb7035004ca0)) + - it compiles once more ([`8acdd2e`](https://github.comgit//DioxusLabs/dioxus/commit/8acdd2ea830b995b608d8bac2ef527db8d40e662)) + - some docs and suspense ([`93d4b8c`](https://github.comgit//DioxusLabs/dioxus/commit/93d4b8ca7c1b133e5dba2a8dc9a310dbe1357001)) + - update readme ([`9bd56ee`](https://github.comgit//DioxusLabs/dioxus/commit/9bd56ee499dd8d3ce2b382655487d150e5a6cacf)) + - should be functional across the boar ([`74c6211`](https://github.comgit//DioxusLabs/dioxus/commit/74c6211408ea0db5916a4e0973a3f9a7208faa44)) + - move examples around ([`1e6e5e6`](https://github.comgit//DioxusLabs/dioxus/commit/1e6e5e611b61571f272289adefc9cdd7d59c4399)) + - updates to router ([`bab21a0`](https://github.comgit//DioxusLabs/dioxus/commit/bab21a0aa1cbf8e6bd95f823e49f53c082e8d6cc)) + - wire tasks up ([`55e6dd9`](https://github.comgit//DioxusLabs/dioxus/commit/55e6dd9701d3710ff17a25581b99b8f159e609b9)) + - wire up linked nodes ([`c10c1f4`](https://github.comgit//DioxusLabs/dioxus/commit/c10c1f418bf21e0e54b53e2babeb37c672c06901)) + - add router ([`d298b62`](https://github.comgit//DioxusLabs/dioxus/commit/d298b626d3ae21a39a8ec4426373369ac94edf9f)) + - docs and router ([`a5f05d7`](https://github.comgit//DioxusLabs/dioxus/commit/a5f05d73acc0e47b05cff64a373482519414bc7c)) + - it properly bubbles ([`9d8c5ca`](https://github.comgit//DioxusLabs/dioxus/commit/9d8c5ca5ab5784b3f17d7ee20a451ee68fd703d6)) + - upgrade syntax ([`fd93ee8`](https://github.comgit//DioxusLabs/dioxus/commit/fd93ee89c19b085a04307ef30217170518defa8e)) + - more docs ([`9874f34`](https://github.comgit//DioxusLabs/dioxus/commit/9874f342e2bc1116410142c691545d75b0e0d6fe)) + - strong improvmenets, first major section done ([`54d050c`](https://github.comgit//DioxusLabs/dioxus/commit/54d050cf897131ddc4f53651f1aeedaf03f23f57)) + - fake bubbling ([`11757dd`](https://github.comgit//DioxusLabs/dioxus/commit/11757ddf61e1decb1bd1c2bb30455d0bd01a3e95)) + - remove scopechildren in favor of elements directly ([`574d7fd`](https://github.comgit//DioxusLabs/dioxus/commit/574d7fdb9e72a5254130589f13f9efd31e3d2870)) + - remove send requirement on root props ([`5a21493`](https://github.comgit//DioxusLabs/dioxus/commit/5a21493fb7162287989bd7c0cd1c496cc3143605)) + - events bubble now ([`f223406`](https://github.comgit//DioxusLabs/dioxus/commit/f2234068ba7cd915a00a81e41660d7d6ee1177cc)) + - move hooklist into scope ([`b9fc5fc`](https://github.comgit//DioxusLabs/dioxus/commit/b9fc5fc251b874fe4a9b5bc46718093029c07bad)) + - Merge branch 'master' into jk/remove_node_safety ([`db00047`](https://github.comgit//DioxusLabs/dioxus/commit/db0004758c77331cc3b93ea8cf227c060028e12e)) + - bubbling reserves nodes ([`b6262ed`](https://github.comgit//DioxusLabs/dioxus/commit/b6262edd53767bf0d87ed1af3bb0c32612380a23)) + - move testdom methods into virtualdom ([`d2f0547`](https://github.comgit//DioxusLabs/dioxus/commit/d2f0547692cb8b4594fbec1d9fa0934e169d1706)) + - pull children out of component definition ([`2cf90b6`](https://github.comgit//DioxusLabs/dioxus/commit/2cf90b6903411e42f01a801f89037686194ee068)) + - Merge branch 'master' of https://github.com/jkelleyrtp/dioxus ([`60d6eb2`](https://github.comgit//DioxusLabs/dioxus/commit/60d6eb204a10633e5e52f91e855bd12c5cda40f2)) + - Various typos/grammar/rewording ([`5747e00`](https://github.comgit//DioxusLabs/dioxus/commit/5747e00b27b1b69c4f9c2820e7e78030feaff71e)) + - bubbling in progress ([`a21020e`](https://github.comgit//DioxusLabs/dioxus/commit/a21020ea575e467ba0d608737269fe1b0792dba7)) + - cleanup src ([`f2e343c`](https://github.comgit//DioxusLabs/dioxus/commit/f2e343c1548588ad01ddac6e39e5014132cff91c)) + - move children onto scope ([`f438bbc`](https://github.comgit//DioxusLabs/dioxus/commit/f438bbcfd20be889aac9a9ca8486e5896af1ce14)) + - desktop and mobile ([`601078f`](https://github.comgit//DioxusLabs/dioxus/commit/601078f9cf78a58d7502a377676ac94f3cf037bf)) + - start on components ([`9b5f82a`](https://github.comgit//DioxusLabs/dioxus/commit/9b5f82af7dce18b75a781b86b188bc713860bb99)) + - cleanuup ([`84fd0c6`](https://github.comgit//DioxusLabs/dioxus/commit/84fd0c616252bf29cd665782258530032b54d13a)) + - it compiles again ([`77686ba`](https://github.comgit//DioxusLabs/dioxus/commit/77686ba329cba0679d0339589a00df77d3c4c1a1)) + - move debugging virtualdom into its own feature ([`d1b294f`](https://github.comgit//DioxusLabs/dioxus/commit/d1b294fff0c8618e50969ca59f198baf0565777d)) + - clean up using new children syntax ([`9c13436`](https://github.comgit//DioxusLabs/dioxus/commit/9c1343610b3907bd8c6acadc086bfc9a8c7b3f3e)) + - fix some bugs around the rsx macro ([`339e450`](https://github.comgit//DioxusLabs/dioxus/commit/339e450027b4a5d2e1317e13863cd1b2e7ab5853)) + - full html support ([`79503f1`](https://github.comgit//DioxusLabs/dioxus/commit/79503f15c5db04fa04575c8735941a2e3a75030b)) + - slim deps and upgrade docs ([`83dd49d`](https://github.comgit//DioxusLabs/dioxus/commit/83dd49d89044b618fa371e09f9f34ea28b9fd529)) + - work on scheduler, async, coroutines, and merge scope into context ([`b56ea6c`](https://github.comgit//DioxusLabs/dioxus/commit/b56ea6c9a99cd747f376aca4a3c439c13f082714)) + - implement dst magic ([`d4192d0`](https://github.comgit//DioxusLabs/dioxus/commit/d4192d0de2fb352d31f33f2fadfc21de0b1b950c)) + - working on re-enabling components ([`fffc7ea`](https://github.comgit//DioxusLabs/dioxus/commit/fffc7ea061922120cd2288982a310a87691948cd)) + - a few things left, slme cleanup ([`289d2f2`](https://github.comgit//DioxusLabs/dioxus/commit/289d2f2518cef937a6fc823495a8bd32f287b84e)) + - implement lazy nodes properly ([`3e07214`](https://github.comgit//DioxusLabs/dioxus/commit/3e07214272f20a47b168d6431fcb39880cd41a9d)) + - fix rebuild ([`15c31d5`](https://github.comgit//DioxusLabs/dioxus/commit/15c31d545a84f05fe17254009dc275aac93e7574)) + - dst drops properly ([`f33510b`](https://github.comgit//DioxusLabs/dioxus/commit/f33510b13fa515e496e6a934650c5a7c61838a39)) + - remove cx.children. start to move towards a "children" field ([`7b97e00`](https://github.comgit//DioxusLabs/dioxus/commit/7b97e009ec74cd2f134bbb8e576404e7a964db74)) + - clean up, use old approach to components ([`2559740`](https://github.comgit//DioxusLabs/dioxus/commit/2559740463d298d27a058607c5d80196dc736c11)) + - dst nodes leak but work ([`62ed920`](https://github.comgit//DioxusLabs/dioxus/commit/62ed9208a44c7aa038613f73ff0573bd2010f4d0)) + - improve FC handling to allow lifetimes of parent ([`6b2645f`](https://github.comgit//DioxusLabs/dioxus/commit/6b2645fd80ab20153e7bb51887443e994fbab5cb)) + - improve safety ([`fda2ebc`](https://github.comgit//DioxusLabs/dioxus/commit/fda2ebc2a22965845e015384f39f34ce7cb3e428)) + - move more stuff out ([`464b457`](https://github.comgit//DioxusLabs/dioxus/commit/464b457b80a40c0ff24386342a0e81ecfeac4723)) + - try to get lifetimes passed in properly ([`f70b5b4`](https://github.comgit//DioxusLabs/dioxus/commit/f70b5b4e4acf589372f769153968922d2fcfedf1)) + - listen to clippy ([`f492443`](https://github.comgit//DioxusLabs/dioxus/commit/f49244344c06a6d05edfe041fd3afa59ef89ca21)) + - remove bumpframe ([`e4cda7c`](https://github.comgit//DioxusLabs/dioxus/commit/e4cda7c2cbba536b045fa7bed1263b78ed33c096)) + - use annotation method from rust/58052 to fix closure lifetimes ([`27d8919`](https://github.comgit//DioxusLabs/dioxus/commit/27d891934a70424b45e6278b7e2baaa2d1b78b35)) + - it compiles cleanly ([`fd0c384`](https://github.comgit//DioxusLabs/dioxus/commit/fd0c384daccf89cec408e3ad674ea04c00797eae)) + - worked backwards a bit and got it slightly figured out ([`9ee2bfb`](https://github.comgit//DioxusLabs/dioxus/commit/9ee2bfb010ce90ec97e93e173c31aab281db32c4)) + - massage lifetimes ([`9726a06`](https://github.comgit//DioxusLabs/dioxus/commit/9726a065b0d4fb1ede5b53a2ddd58c855e51539f)) + - book documentation ([`16dbf4a`](https://github.comgit//DioxusLabs/dioxus/commit/16dbf4a6f84103857385fb4b142a718b0ce72118)) + - more changes to scheduler ([`059294a`](https://github.comgit//DioxusLabs/dioxus/commit/059294ab55e9e945c9aede1fd4b4faf39a7b9ea9)) + - messed up how lifetimes worked, need to render once per component ([`ba9e1db`](https://github.comgit//DioxusLabs/dioxus/commit/ba9e1dbb8fa24048a6c9ccef8a8722688226a845)) + - major cleanups to scheduler ([`2933e4b`](https://github.comgit//DioxusLabs/dioxus/commit/2933e4bc11b3074c2bde8d76ec55364fca841988)) + - move everything over to a stack dst ([`0e9d5fc`](https://github.comgit//DioxusLabs/dioxus/commit/0e9d5fc5306ab508d5af6999a4064f9b8b48460f)) + - event system ([`1f22a06`](https://github.comgit//DioxusLabs/dioxus/commit/1f22a06a36f72073188b8c9009dd4950b3f4ff9a)) + - no more lifetimes ([`d96276a`](https://github.comgit//DioxusLabs/dioxus/commit/d96276a715a9f62943909cfc429c9fe47fd28146)) + - support desktop more completely ([`efd0e9b`](https://github.comgit//DioxusLabs/dioxus/commit/efd0e9b5648c809057f339083ba9d454f810d483)) + - compiling again with runtime safety ([`857c92f`](https://github.comgit//DioxusLabs/dioxus/commit/857c92f7f096108317b1854715b4dcbeaae6f759)) + - add update functionality to useref ([`a2b0c50`](https://github.comgit//DioxusLabs/dioxus/commit/a2b0c50a343005c63c7032bcefb8323b78350bb9)) + - more raw ptrs ([`95bd17e`](https://github.comgit//DioxusLabs/dioxus/commit/95bd17e38fc936dcc9383d0ba8beac5ed64b41eb)) + - lnks to projects ([`460783a`](https://github.comgit//DioxusLabs/dioxus/commit/460783ad549818a85db634ed9c39ffce210b98ec)) + - desktop functioning well ([`5502429`](https://github.comgit//DioxusLabs/dioxus/commit/5502429626023d0788cca352e94ac6ea67c2cb11)) + - remove resource pool in favor of raw ptrs ([`b8d9869`](https://github.comgit//DioxusLabs/dioxus/commit/b8d98698c6056a330fe62f52833504fb1c728bbb)) + - overhaul event system ([`7a03c1d`](https://github.comgit//DioxusLabs/dioxus/commit/7a03c1d2b48590276b182465679387655fe08f3a)) + - consolidation, simplification ([`70b983d`](https://github.comgit//DioxusLabs/dioxus/commit/70b983d0909a332d357da9bb07adc263059bce19)) + - threadsafe ([`82953f2`](https://github.comgit//DioxusLabs/dioxus/commit/82953f2ac37913f83a822333acd0c47e20777d31)) + - all the bugs! ([`478255f`](https://github.comgit//DioxusLabs/dioxus/commit/478255f40d4de1d2e3f3cc9b6d758b30ff394b39)) + - ssr ([`71f0df6`](https://github.comgit//DioxusLabs/dioxus/commit/71f0df63745fe5c17468693144c552ea3a0a7101)) + - shared state mechanisms ([`4a4c7af`](https://github.comgit//DioxusLabs/dioxus/commit/4a4c7afca7e1beadd4b213214074fdb420eb0923)) + - fix typo ([`4a5041c`](https://github.comgit//DioxusLabs/dioxus/commit/4a5041c5902e1dab99f25ce00d754ac8a5ee30c1)) + - fix web list issue ([`da4423c`](https://github.comgit//DioxusLabs/dioxus/commit/da4423c141f1f376df5f3f2580e5284831744a7e)) + - move macro crate out of core ([`7bdad1e`](https://github.comgit//DioxusLabs/dioxus/commit/7bdad1e2e6f67e74c9f67dde2150140cf8a090e8)) + - portals ([`4a0bb8c`](https://github.comgit//DioxusLabs/dioxus/commit/4a0bb8cf84da7960d7090de3d5f95248318540a3)) + - polish ([`a5f82be`](https://github.comgit//DioxusLabs/dioxus/commit/a5f82be433309790e0cac07a77e59c996a53796d)) + - exampels ([`04d16b4`](https://github.comgit//DioxusLabs/dioxus/commit/04d16b41dc9bc06ca0320a9fec27744318e48355)) + - fix some event stuff for web and core ([`725b4a1`](https://github.comgit//DioxusLabs/dioxus/commit/725b4a1d7f5d629b1b0a163b65bfd93b2f8a151b)) + - garbage collection ([`dfe9f86`](https://github.comgit//DioxusLabs/dioxus/commit/dfe9f86bfff48ae3166fd41d673245ed142c26f0)) + - on collaborative scheduling ([`1a32383`](https://github.comgit//DioxusLabs/dioxus/commit/1a323835c8c4f667e5744bbf5447776f1dc51fca)) + - examples ([`1a2f91e`](https://github.comgit//DioxusLabs/dioxus/commit/1a2f91ed91c13dae553ecde585462ab261b1b95d)) + - working down warnings ([`958c02a`](https://github.comgit//DioxusLabs/dioxus/commit/958c02a26e86b07431d3e5f51f00afe116656981)) + - mutations ([`fac4233`](https://github.comgit//DioxusLabs/dioxus/commit/fac42339c272b0e430ebf4f31b6061a0635d3e19)) + - performance looks good, needs more testing ([`4b6ca05`](https://github.comgit//DioxusLabs/dioxus/commit/4b6ca05f2c3ad647842c858967da9c87f1915825)) + - add test_dom ([`a652090`](https://github.comgit//DioxusLabs/dioxus/commit/a652090dc5708db334fa7430fededb1bac207880)) + - bottom up dropping ([`f2334c1`](https://github.comgit//DioxusLabs/dioxus/commit/f2334c17be2612d926361686d7d40a57e3ffe9b9)) + - cleanup ([`1745a44`](https://github.comgit//DioxusLabs/dioxus/commit/1745a44d949b994b64ea1fb715cbe36963ae7027)) + - more scheduler work ([`44b4384`](https://github.comgit//DioxusLabs/dioxus/commit/44b43849613a52cee8dc98ea3068095416b201c2)) + - re-enable suspense ([`687cda1`](https://github.comgit//DioxusLabs/dioxus/commit/687cda1b6d9595357d1dc8720ebe921f61098d8f)) + - fill out the snippets ([`6051b0e`](https://github.comgit//DioxusLabs/dioxus/commit/6051b0ec86927704451f4ce6cdf8f988e59702ae)) + - amazingly awesome error handling ([`4a72b31`](https://github.comgit//DioxusLabs/dioxus/commit/4a72b3140bd244da602deada1eeecded65ff5848)) + - some ideas ([`05c909f`](https://github.comgit//DioxusLabs/dioxus/commit/05c909f320765aec1bf4c1c55ca59ffd5525a2c7)) + - proper handling of events ([`d7940aa`](https://github.comgit//DioxusLabs/dioxus/commit/d7940aa2ac2017316d62e0f2eac0701dc6ad1f09)) + - more work on scheduler ([`1cd5e69`](https://github.comgit//DioxusLabs/dioxus/commit/1cd5e697128877e911ece2c9b34ec38d74eeec80)) + - websys dom working properly ([`cfa0247`](https://github.comgit//DioxusLabs/dioxus/commit/cfa0247cbb1233e1df275374a73f431650a9250f)) + - big updates to the reference ([`583fdfa`](https://github.comgit//DioxusLabs/dioxus/commit/583fdfa5618e11d660985b97e570d4503be2ff49)) + - fix invalid is_empty bug ([`c7d2d9d`](https://github.comgit//DioxusLabs/dioxus/commit/c7d2d9d050548f06244caeeedc2c0e0e52eb329f)) + - more work on rebuild ([`5c3dc0a`](https://github.comgit//DioxusLabs/dioxus/commit/5c3dc0a8741df251dd3cb7f954fae2243df155f7)) + - keyed diffing!! ([`d717c22`](https://github.comgit//DioxusLabs/dioxus/commit/d717c22d9c5da7b6f343fede11faaf953a3a29e0)) + - docs, html! macro, more ([`caf772c`](https://github.comgit//DioxusLabs/dioxus/commit/caf772cf249d2f56c8d0b0fa2737ad48e32c6e82)) + - update root props ([`fac2e56`](https://github.comgit//DioxusLabs/dioxus/commit/fac2e56ed63fc708a89e14df15f1fc32f58391a9)) + - get keyed diffing compiling ([`0a0be95`](https://github.comgit//DioxusLabs/dioxus/commit/0a0be95c3e58dc065409f02f703b82700c1003f8)) + - changes to scheduler ([`098d382`](https://github.comgit//DioxusLabs/dioxus/commit/098d3821ed89ad38d99077a6556b48a7e91fc3fc)) + - some docs, cleaning ([`c321532`](https://github.comgit//DioxusLabs/dioxus/commit/c321532a6cef40b2d2e4adc8c7a55931b6755b08)) + - more and more sophisticated diff ([`1749eba`](https://github.comgit//DioxusLabs/dioxus/commit/1749eba8eb6c8ffa38ab3ad52160b637fe021e86)) + - clean up warnings ([`b32e261`](https://github.comgit//DioxusLabs/dioxus/commit/b32e2611e37b17c2371ffb10cf1ac647f017d917)) + - a new vnode type for anchors ([`d618092`](https://github.comgit//DioxusLabs/dioxus/commit/d618092e9d150589e61516f7bbb169f2db49d3f2)) + - more cleanup ([`5cbdc57`](https://github.comgit//DioxusLabs/dioxus/commit/5cbdc571e3abe54391aec8f296d7389410b373b6)) + - more work on bumpframe ([`63a85e4`](https://github.comgit//DioxusLabs/dioxus/commit/63a85e4865929dbd32a1b72ebeac271561e9ed92)) + - heuristics engine ([`6aaad1c`](https://github.comgit//DioxusLabs/dioxus/commit/6aaad1c9ef97fa407b660aec60999d263c172ecc)) + - more cleanup in scheduler ([`9f99f46`](https://github.comgit//DioxusLabs/dioxus/commit/9f99f46cfd6355ce46afdf84d60dd049047c6b57)) + - making progress on diffing and hydration ([`49856cc`](https://github.comgit//DioxusLabs/dioxus/commit/49856ccd6865f88d63765f26d27f7e945b554da0)) + - code quality improvements for core ([`00231ad`](https://github.comgit//DioxusLabs/dioxus/commit/00231adfa2e1d67a9d7ae2fa61c33e3a22d51978)) + - mvoe away from compound context ([`a2c7d17`](https://github.comgit//DioxusLabs/dioxus/commit/a2c7d17b0595769f60bc1c2bbf7cbe32cec37486)) + - examples ([`f1cff84`](https://github.comgit//DioxusLabs/dioxus/commit/f1cff845ce11231cb4b2dd4857f9ca9f0265b925)) + - wire up resource pool ([`31702db`](https://github.comgit//DioxusLabs/dioxus/commit/31702dbf878dd0207d101f7869ebefd2bb9f6860)) + - make hooks free-functions ([`e5c88fe`](https://github.comgit//DioxusLabs/dioxus/commit/e5c88fe3a49649ecb308decd14c2557963978619)) + - more work on suspense and documentation ([`37ed4be`](https://github.comgit//DioxusLabs/dioxus/commit/37ed4bed8cf28eb65465d41e15e8d758cb3d9679)) + - transition to cx, props ([`bfdcb20`](https://github.comgit//DioxusLabs/dioxus/commit/bfdcb20437c385116fd640e46b6361d09d8d5ff8)) + - more doc ([`adf202e`](https://github.comgit//DioxusLabs/dioxus/commit/adf202eab9201c69ec455e621c755500329815fe)) + - cleanup public apis ([`927b05f`](https://github.comgit//DioxusLabs/dioxus/commit/927b05f358221aa4b9c440608704e86c2400ab64)) + - omg what a dumb mistake ([`f782e14`](https://github.comgit//DioxusLabs/dioxus/commit/f782e142118fb7acf1b88a0f3fbb03e4a5e3e91e)) + - suspense! ([`4837d8e`](https://github.comgit//DioxusLabs/dioxus/commit/4837d8e741343d26f31b55e4478a374dc761e538)) + - refactor ([`8b0eb87`](https://github.comgit//DioxusLabs/dioxus/commit/8b0eb87c72ea9d444dee99a8b05643f19fea2634)) + - bless up, no more segfaults ([`4a0068f`](https://github.comgit//DioxusLabs/dioxus/commit/4a0068f09918adbc299150edcf777f342ced0dd3)) + - more suspended nodes! ([`de9f61b`](https://github.comgit//DioxusLabs/dioxus/commit/de9f61bcf48c0d6e35e46c337b72a713c9f9f7d2)) + - more docs ([`34c3107`](https://github.comgit//DioxusLabs/dioxus/commit/34c3107418df89620cb9dfbd9300f89a1fe6e68f)) + - algo for scheduler finished ([`9ad5e49`](https://github.comgit//DioxusLabs/dioxus/commit/9ad5e4965409464c6ca63b3434bbe182dde26943)) + - wire up event delegator for webview ([`7dfe89c`](https://github.comgit//DioxusLabs/dioxus/commit/7dfe89c9581f45a445f17f9fe4bb94e61f67e971)) + - basic support for scheduled rendering ([`c52af22`](https://github.comgit//DioxusLabs/dioxus/commit/c52af221f755601a9e826ffc2c355def138999d0)) + - feeling goodish about scheduler ([`5f63eda`](https://github.comgit//DioxusLabs/dioxus/commit/5f63eda29473b82ce708ec66e4dd862c3717e958)) + - fix some lifetime issues ([`0a907b3`](https://github.comgit//DioxusLabs/dioxus/commit/0a907b35c647b67172080023462770b761364d51)) + - move over to push based mechanism ([`80e6c25`](https://github.comgit//DioxusLabs/dioxus/commit/80e6c256980eb3e8c32e30f3dbb43c8b3b9a9cf4)) + - bubbling ([`7978a17`](https://github.comgit//DioxusLabs/dioxus/commit/7978a17419be0c1e6a7ddd2c21cfa96b9660038b)) + - some structure ([`bcaa76a`](https://github.comgit//DioxusLabs/dioxus/commit/bcaa76a37fb7ff48ab3345c594a20fbdcda6074a)) + - solve some issues regarding listeners ([`dfaf5ad`](https://github.comgit//DioxusLabs/dioxus/commit/dfaf5adee164f44a679ab21d730caaab3610e01f)) + - architecture document and edit list ([`e723876`](https://github.comgit//DioxusLabs/dioxus/commit/e7238762ae518c5688f9339d11832d17f99ad553)) + - before scheduler simplify ([`c16b92e`](https://github.comgit//DioxusLabs/dioxus/commit/c16b92ee7ee3a02153d651db1a84c7dc781c26da)) + - considering making vdom passed verywehre ([`ac3a7b1`](https://github.comgit//DioxusLabs/dioxus/commit/ac3a7b1fbc1665482354ddf4f0de3d6ceb5b400a)) + - move to slab ([`6084fbc`](https://github.comgit//DioxusLabs/dioxus/commit/6084fbcd11d1669db135098d920488e2c01a7014)) + - change in cx to cx ([`9971ff2`](https://github.comgit//DioxusLabs/dioxus/commit/9971ff215db6f771b7ec1cae2517c85d47d38622)) + - more work on scheduler ([`d4d7114`](https://github.comgit//DioxusLabs/dioxus/commit/d4d7114bebe09a5e265a29105a9bdf3b369ecd67)) + - move things into a "shared" object ([`f644d7c`](https://github.comgit//DioxusLabs/dioxus/commit/f644d7c44159eef091552dcc90acbb151ea76b21)) + - reduce warnings ([`0ded32e`](https://github.comgit//DioxusLabs/dioxus/commit/0ded32e184a4b48b848b078585fbe1ca61d09b1d)) + - it compiles again ([`07efb6a`](https://github.comgit//DioxusLabs/dioxus/commit/07efb6a1b656b24eb1ff25c62f84bb529df936b2)) + - task system works ([`3a57b94`](https://github.comgit//DioxusLabs/dioxus/commit/3a57b942624afb8aa6650aeee05466c3c9ce967e)) + - more polish on display ([`12afd2b`](https://github.comgit//DioxusLabs/dioxus/commit/12afd2b0f24c6968c1498fcedebb03a06e9bc135)) + - more overhaul on virtualevents ([`41cc429`](https://github.comgit//DioxusLabs/dioxus/commit/41cc42919d42453f8f2560aa852211364af4ad3d)) + - cargo fix ([`84c3e9f`](https://github.comgit//DioxusLabs/dioxus/commit/84c3e9fcb11bab921818fbb090632a54dc16423f)) + - more polish on scopes ([`2386772`](https://github.comgit//DioxusLabs/dioxus/commit/238677208ea93d39e26b17af0c17c4f0b512d007)) + - more work on priority ([`cef116a`](https://github.comgit//DioxusLabs/dioxus/commit/cef116aa3a435857c9a3a818bcd81de8ef03a771)) + - cargo fix ([`beceda5`](https://github.comgit//DioxusLabs/dioxus/commit/beceda511c514d743bce17ed19df9dba8675fcda)) + - polish up some safety stuff and add suspense support in ([`ff1398b`](https://github.comgit//DioxusLabs/dioxus/commit/ff1398b943de14f7573ad13577e83500ed9c146e)) + - refactor to fix some ownership quirks ([`05e960b`](https://github.comgit//DioxusLabs/dioxus/commit/05e960b6b037d237ddcaf4fef4d33179883b6644)) + - cargo fix ([`fd03b9d`](https://github.comgit//DioxusLabs/dioxus/commit/fd03b9d252c9e57a281557fbe91786fba2f28e3b)) + - remove unnecessary import ([`fb0c6d2`](https://github.comgit//DioxusLabs/dioxus/commit/fb0c6d2ea4d1edbf1cec4c78179395114071a520)) + - fix props update ([`79e8df2`](https://github.comgit//DioxusLabs/dioxus/commit/79e8df26f5a84f5d765921ae307b33db83c14d4e)) + - more work on web ([`3bf19d8`](https://github.comgit//DioxusLabs/dioxus/commit/3bf19d8106e0cca7749b7346e9b0adfce654d782)) + - cargo fix ([`c7ca7c2`](https://github.comgit//DioxusLabs/dioxus/commit/c7ca7c227325dee85fec0f1bc7d8ab00cbf68f66)) + - more clean up ([`5a09ec1`](https://github.comgit//DioxusLabs/dioxus/commit/5a09ec161031abaa01582435839a8077fd80b228)) + - ricraf polyfill ([`59219b9`](https://github.comgit//DioxusLabs/dioxus/commit/59219b9ef22caa5896046ccaabc8a225cc4b5a53)) + - cut down on errors ([`775e9e2`](https://github.comgit//DioxusLabs/dioxus/commit/775e9e29b8cde45a13bdae22a6f54b25518e7192)) + - ....sigh..... so the diffing algorithm is robust ([`68ed1c0`](https://github.comgit//DioxusLabs/dioxus/commit/68ed1c04e7e773f9e6c0a5148f0ea89b97b6784e)) + - remove global allocation for props ([`8b3ac0b`](https://github.comgit//DioxusLabs/dioxus/commit/8b3ac0b57ca073c1451e8d5df93882c9360ca52a)) + - ric_raf wired up ([`8b0d04c`](https://github.comgit//DioxusLabs/dioxus/commit/8b0d04ce585596f561f15e92fc087e2c7063eb07)) + - wip ([`996247a`](https://github.comgit//DioxusLabs/dioxus/commit/996247a1644d91ebb00e2b2188d21cacdc48257b)) + - lots of changes to diffing ([`ff0a3d1`](https://github.comgit//DioxusLabs/dioxus/commit/ff0a3d1c83a4349a228a742fccc761822f1711d3)) + - change around how deadline works ([`369b36b`](https://github.comgit//DioxusLabs/dioxus/commit/369b36b2c64a4bc3d4895f1e04b412c4edbf3c99)) + - rebuild doesn't return errors ([`f457b71`](https://github.comgit//DioxusLabs/dioxus/commit/f457b7113129479cad577237ef21cb735fffe483)) + - add aria ([`4091846`](https://github.comgit//DioxusLabs/dioxus/commit/4091846934b4b3b2bc03d3ca8aaf7712aebd4e36)) + - more examples ([`56e7eb8`](https://github.comgit//DioxusLabs/dioxus/commit/56e7eb83a97ebd6d5bcd23464cfb9d718e5ac26d)) + - tests and documentation ([`da81591`](https://github.comgit//DioxusLabs/dioxus/commit/da8159190b84d13caa9dfe7dea385a809cf84199)) + - buff up html allowed attributes ([`c79d9ae`](https://github.comgit//DioxusLabs/dioxus/commit/c79d9ae674e235c8e9c2c069d24902122b9c7464)) + - move examples around ([`304259d`](https://github.comgit//DioxusLabs/dioxus/commit/304259d8186d1d34224a74c95f4fd7d14126b499)) + - it works but the page is backwards ([`cdcd861`](https://github.comgit//DioxusLabs/dioxus/commit/cdcd8611e87ffb5e24de7b9fe6c656af3053276e)) + - use the new structure ([`a05047d`](https://github.comgit//DioxusLabs/dioxus/commit/a05047d01e606425fb0d6595e9d27d3e15f32050)) + - ssr + tide ([`269e81b`](https://github.comgit//DioxusLabs/dioxus/commit/269e81b0fdb32ae0706160cd278cf3a1b731387b)) + - more test ([`a0a977a`](https://github.comgit//DioxusLabs/dioxus/commit/a0a977a12d4008155fe332ee226f04e5f59acf95)) + - enable components in ssr ([`bbcb5a0`](https://github.comgit//DioxusLabs/dioxus/commit/bbcb5a0234dbce48ffeb64903c3ec04562a87ad6)) + - documentation and badges ([`3f68be7`](https://github.comgit//DioxusLabs/dioxus/commit/3f68be79ae326f6d169ee771bf86490aed4d7885)) + - keyed diffing ([`0479252`](https://github.comgit//DioxusLabs/dioxus/commit/0479252a5fba96e554dcf2422a8566e248fc6593)) + - static node infrastructure and ssr changes ([`9abb047`](https://github.comgit//DioxusLabs/dioxus/commit/9abb0470b7869019d539a2fc21da3872348ae38b)) + - naming ([`1a6b238`](https://github.comgit//DioxusLabs/dioxus/commit/1a6b2388299bf005006e23b75c65a09449049f8d)) + - it works? ([`778baff`](https://github.comgit//DioxusLabs/dioxus/commit/778baffb10c2b14ac350b38229d1b3acfa49ec39)) + - more refactor for async ([`975fa56`](https://github.comgit//DioxusLabs/dioxus/commit/975fa566f9809f8fa2bb0bdb07fbfc7f855dcaeb)) + - refactor non_keyed diff ([`082765f`](https://github.comgit//DioxusLabs/dioxus/commit/082765f6873d9ba72d67e3383dfab6c901eb772a)) + - some project refactor ([`8cfc437`](https://github.comgit//DioxusLabs/dioxus/commit/8cfc437bfe4110d7f984428f01df90bdf8f8d9ec)) + - tests and benchmarks ([`e6f5656`](https://github.comgit//DioxusLabs/dioxus/commit/e6f56563bc84516e017b3db06f11fab2549b9a50)) + - some work ([`feab50f`](https://github.comgit//DioxusLabs/dioxus/commit/feab50f24a8ab82a2cf1d02af1c54d13dd539b01)) + - structure coming together and tests ([`2d541ec`](https://github.comgit//DioxusLabs/dioxus/commit/2d541eca640d15bb56bccb4191b1dc0fe02dfc22)) + - more refactor ([`58ab51a`](https://github.comgit//DioxusLabs/dioxus/commit/58ab51a4e4e8a2a7b9b03a4c9a136648112d39dc)) + - compiles again ([`16bfc6d`](https://github.comgit//DioxusLabs/dioxus/commit/16bfc6d2488f7ec0266ff5b174142232fb04849f)) + - more refactor ([`c811a89`](https://github.comgit//DioxusLabs/dioxus/commit/c811a8982c08a778f1484ed8aa1dd6b991790086)) + - dedicated mutations module ([`db6d018`](https://github.comgit//DioxusLabs/dioxus/commit/db6d0184aa5aa612bd7229a06f72b4c2ec5f6409)) + - refactor ([`9276fd7`](https://github.comgit//DioxusLabs/dioxus/commit/9276fd7db78e48c530b8f5dbc317be2d8d51ad7f)) + - basic creates working properly ([`1622f48`](https://github.comgit//DioxusLabs/dioxus/commit/1622f484b34412110723645cffc4c8c286b6ca80)) + - refactor out the hooks implementation ([`1cc1679`](https://github.comgit//DioxusLabs/dioxus/commit/1cc1679a6ba33ff68d45ad1e964b73230224bc23)) + - tests added for new iterative ([`24572b6`](https://github.comgit//DioxusLabs/dioxus/commit/24572b63deec590f810df0b95a12cbd5b0bd61f5)) + - webview and async ([`eb82051`](https://github.comgit//DioxusLabs/dioxus/commit/eb82051000fe8772b97f879195fc412092228023)) + - fix compiling ([`2ce0752`](https://github.comgit//DioxusLabs/dioxus/commit/2ce0752a9cd253fee1c8b205400aa191b09c9dcb)) + - move webview to wry ([`99d94b6`](https://github.comgit//DioxusLabs/dioxus/commit/99d94b69aba192be7e41ebe891aca4bb4f6cae88)) + - moving over instructions ([`0987760`](https://github.comgit//DioxusLabs/dioxus/commit/098776095844013469f68c0b585f75587c0edd75)) + - more examples ([`2547da3`](https://github.comgit//DioxusLabs/dioxus/commit/2547da36a089f09d219e7d701efd35f74f66784c)) + - remove old create ([`7b06820`](https://github.comgit//DioxusLabs/dioxus/commit/7b068202cea3e513cf885826f303df7e4f707afd)) + - beaf up the use_state hook ([`e4cdb64`](https://github.comgit//DioxusLabs/dioxus/commit/e4cdb645aad800484b19ec35ba1f8bb9ccf71d12)) + - back to vnode enum ([`64f289a`](https://github.comgit//DioxusLabs/dioxus/commit/64f289a61c18b6b4c1adf785a864171e51615780)) + - move from recursive to iterative ([`9652ccd`](https://github.comgit//DioxusLabs/dioxus/commit/9652ccdcf19189e2aac9262bcfa30e2b04c36d37)) + - move CLI into its own "studio" app ([`fd79335`](https://github.comgit//DioxusLabs/dioxus/commit/fd7933561fe81922e4d5d77f6ac3b6f19efb5a90)) + - working on async diff ([`f41cff5`](https://github.comgit//DioxusLabs/dioxus/commit/f41cff571fd11bb00820c0bf9d147e81ed5a6a53)) + - more work on scheduler ([`882d695`](https://github.comgit//DioxusLabs/dioxus/commit/882d69571dcc807a5fa3734f14980e5233f895f5)) + - move some examples around ([`98a0933`](https://github.comgit//DioxusLabs/dioxus/commit/98a09339fd3190799ea4dd316908f0a53fdf2413)) + - scheduler skeleton ([`9d14faf`](https://github.comgit//DioxusLabs/dioxus/commit/9d14faf62c654e6958b5e5dc444374146977f52c)) + - remove the scoped trait ([`cca7c5f`](https://github.comgit//DioxusLabs/dioxus/commit/cca7c5fc3a9e341996e2d5a23b981b658e54ea62)) + - more work on deadline, support immediates ([`5965bee`](https://github.comgit//DioxusLabs/dioxus/commit/5965bee1d143ee50ed24d4bde5176e057bce4363)) + - move the functions around a bit ([`36542b4`](https://github.comgit//DioxusLabs/dioxus/commit/36542b482f33e5abd58d3d2c40250f6ffac1a99d)) + - got the structure figured out! ([`97745c6`](https://github.comgit//DioxusLabs/dioxus/commit/97745c6a7f2094deca32c7a1c30890853067848e)) + - fix issues with lifetimes ([`a38a81e`](https://github.comgit//DioxusLabs/dioxus/commit/a38a81e1290375cae685f7c49d3745e4298fab26)) + - close on putting it all together ([`85e2dc2`](https://github.comgit//DioxusLabs/dioxus/commit/85e2dc259aba38ec1654ab7581418aaa9c1c543c)) + - namespaced attributes ([`22e659c`](https://github.comgit//DioxusLabs/dioxus/commit/22e659c2bd7797ca5a822180aca0cb5d950c5287)) + - groundwork for noderefs ([`c1afeba`](https://github.comgit//DioxusLabs/dioxus/commit/c1afeba1efb1a063705466a14648beee08cacb86)) + - more work on jank free ([`a44e9fc`](https://github.comgit//DioxusLabs/dioxus/commit/a44e9fcffa4da6dd01966a62575ff4f4832e5fcc)) + - more examples ([`11f89e5`](https://github.comgit//DioxusLabs/dioxus/commit/11f89e5d338d14a7aeece0a6275c24ae65913ce7)) + - add edits back! and more webview support! ([`904b26f`](https://github.comgit//DioxusLabs/dioxus/commit/904b26f7111c3fc66400744ff6192e4b20bf6d74)) + - enable more diffing ([`e8f29a8`](https://github.comgit//DioxusLabs/dioxus/commit/e8f29a8f8ac56020bee0048021efa52547307a77)) + - two calculator examples ([`b5e5ef1`](https://github.comgit//DioxusLabs/dioxus/commit/b5e5ef171aa9f8986fb4ab04d793eb63f557c4ae)) + - examples ([`d9e6d09`](https://github.comgit//DioxusLabs/dioxus/commit/d9e6d0925b30690212d1d690dfba288f1a694a27)) + - wip ([`952a91d`](https://github.comgit//DioxusLabs/dioxus/commit/952a91d5408aaf789b496f11d01c3b3f7fcf9059)) + - integrate signals ([`93900aa`](https://github.comgit//DioxusLabs/dioxus/commit/93900aac4443db2e63631ed928294af74201a9ff)) + - move to slotmap ([`7665f2c`](https://github.comgit//DioxusLabs/dioxus/commit/7665f2c6cf05cea64bb9131381d4ac11cbdeb932)) + - more work on diffing ([`21685fb`](https://github.comgit//DioxusLabs/dioxus/commit/21685fbb164cf58120e9d37e994a25fa7d902b21)) + - integrate serialization and string borrowing ([`f4fb5bb`](https://github.comgit//DioxusLabs/dioxus/commit/f4fb5bb454536d9f108c7e276ce98a8924ab45e1)) + - more work on diffing machine ([`9813f23`](https://github.comgit//DioxusLabs/dioxus/commit/9813f23cdf7b32bc058771c91db3f182d6224905)) + - more work on diffing. ([`ca3b80f`](https://github.comgit//DioxusLabs/dioxus/commit/ca3b80f06929f30a32c4d50387977cc8724daa8d)) + - stack-based "real child iterator" ([`895cc01`](https://github.comgit//DioxusLabs/dioxus/commit/895cc0142b8c0a380ecc71aa6acb5c9d7820862d)) + - more docs ([`0826fdf`](https://github.comgit//DioxusLabs/dioxus/commit/0826fdfee13d26b08cb8a2fa45cbd59cc4f20c25)) + - refcell to cell for hookidx ([`ea91fc9`](https://github.comgit//DioxusLabs/dioxus/commit/ea91fc984dc648150acbafd0abb79d9f42aca500)) + - rename ctx to cx ([`81382e7`](https://github.comgit//DioxusLabs/dioxus/commit/81382e7044fb3dba61d4abb1e6086b7b29143116)) + - rethinking stack machine ([`62ae5d3`](https://github.comgit//DioxusLabs/dioxus/commit/62ae5d3bb94cb9ead030ae0b39d9d9bc2b8b4532)) + - move around examples ([`70cd46d`](https://github.comgit//DioxusLabs/dioxus/commit/70cd46dbb2a689ae2d512e142b8aee9c80798430)) + - start moving events to rc ([`b9ff95f`](https://github.comgit//DioxusLabs/dioxus/commit/b9ff95fa12c46365fe73b64a4926a506d5da2342)) + - rename recoil to atoms ([`36ea39a`](https://github.comgit//DioxusLabs/dioxus/commit/36ea39ae30aa3f1fb2d718c0fdf08850c6bfd3ac)) + - more examples and docs ([`7fbaf69`](https://github.comgit//DioxusLabs/dioxus/commit/7fbaf69cabbdde712bb3fd9e4b2a5dc18b9390e9)) + - more work on updating syntad ([`47e8960`](https://github.comgit//DioxusLabs/dioxus/commit/47e896038ef3655566f3eda83d1d2adfefbc8862)) + - some cleanup and documentation ([`517d7f1`](https://github.comgit//DioxusLabs/dioxus/commit/517d7f14957c4dae9fc894bfbdcd00a955d09f20)) + - pre-diffmachine merge fork ([`424a181`](https://github.comgit//DioxusLabs/dioxus/commit/424a18137f1fa9528408ce96a57e8120251b9ed5)) + - docs ([`f5683a2`](https://github.comgit//DioxusLabs/dioxus/commit/f5683a23464992ecace463a61414795b5a2c58c8)) + - pre vnodes instead of vnode ([`fe6938c`](https://github.comgit//DioxusLabs/dioxus/commit/fe6938ceb3dba0796ae8bab52ae41248dc0d3650)) + - move into a fromjs tutorial ([`69f5cc3`](https://github.comgit//DioxusLabs/dioxus/commit/69f5cc3802af136729bc73e5c3d209270d41b184)) + - events work again! ([`9d7ee79`](https://github.comgit//DioxusLabs/dioxus/commit/9d7ee79826a3b3fb952a70abcbb16dcd3363d2fb)) + - successfully building ([`e3d9db0`](https://github.comgit//DioxusLabs/dioxus/commit/e3d9db0847ecc4ff5156929adb6d22e324f93df3)) + - props memoization is more powerful ([`73047fe`](https://github.comgit//DioxusLabs/dioxus/commit/73047fe95678d50fcfd62a4ace7c6b406c5304e1)) + - merge in some code from the other branch ([`7790750`](https://github.comgit//DioxusLabs/dioxus/commit/7790750349b40055673a0ec16074a0426b84d3b3)) + - move the rsx macro around ([`50c8b93`](https://github.comgit//DioxusLabs/dioxus/commit/50c8b93aade1bfa83a091fb51ee48638507f89b0)) + - add some more sources in the core implementation ([`7102fe5`](https://github.comgit//DioxusLabs/dioxus/commit/7102fe5f984fe8692cf977ea3a43e2973eed4f45)) + - new approach at direct access to vdom ([`795a54a`](https://github.comgit//DioxusLabs/dioxus/commit/795a54a2e427bc7f2b37e636d50aa300977a42a1)) + - some docs ([`1919f88`](https://github.comgit//DioxusLabs/dioxus/commit/1919f88f035fadadfc2b9bce6157f2effcd2a4b0)) + - get diff compiling ([`cff0547`](https://github.comgit//DioxusLabs/dioxus/commit/cff0547f1a3e2e28ba1946f347c161078818ac66)) + - massive changes to definition of components ([`508c560`](https://github.comgit//DioxusLabs/dioxus/commit/508c560320d78730fa058156421523ffa5695d9d)) + - moving to IDs ([`79127ea`](https://github.comgit//DioxusLabs/dioxus/commit/79127ea6cdabf62bf91e777aaacb563e3aa5e619)) + - move to static props ([`c1fd848`](https://github.comgit//DioxusLabs/dioxus/commit/c1fd848f89b0146581d8e485fa0d4a847387b963)) + - moving to imperative method of dom ([`45ee803`](https://github.comgit//DioxusLabs/dioxus/commit/45ee803609bf94404f22d89ab2a20ce0698271ff)) + - more progress on parity docs. ([`c5089ba`](https://github.comgit//DioxusLabs/dioxus/commit/c5089ba3c5a8daad4de4d6257604011cc87f6ac7)) + - dirty hack to enable send + sync on virtual dom ([`4d5c528`](https://github.comgit//DioxusLabs/dioxus/commit/4d5c528b07e61d6cb0ac8fc0c27ce2e0fdf7e7d2)) + - doesnt share on thread ([`fe67ff9`](https://github.comgit//DioxusLabs/dioxus/commit/fe67ff9fa4c9d5009670c922e192dccedb7cd09a)) + - recoil ([`ee67654`](https://github.comgit//DioxusLabs/dioxus/commit/ee67654f58aecca91c640fc49451d0b99bc05981)) + - Todomvc in progress ([`b843dbd`](https://github.comgit//DioxusLabs/dioxus/commit/b843dbd3679abf86a34347d87fd4ce5fe9e2aca5)) + - introduce children for walking down the tree ([`0d44f00`](https://github.comgit//DioxusLabs/dioxus/commit/0d44f009b0176cb9cf8203374cf534f5af7de63c)) + - context api wired up ([`24805a0`](https://github.comgit//DioxusLabs/dioxus/commit/24805a02f6a46539ff76ddcd569ecfc336ca2171)) + - about to consolidate context and scope ([`4c8130c`](https://github.comgit//DioxusLabs/dioxus/commit/4c8130c4e48a4f0eaef53c696154958d6e0ec6f2)) + - remove old code ([`3de54d0`](https://github.comgit//DioxusLabs/dioxus/commit/3de54d0b5202aca678d485a68ef8de006a63e21b)) + - abstraction lifetimes work out nicely ([`2284b35`](https://github.comgit//DioxusLabs/dioxus/commit/2284b357823336aafd8c622b466cd4695b78c690)) + - Clean up repo a bit ([`a99147c`](https://github.comgit//DioxusLabs/dioxus/commit/a99147c85b53b4ee336a94deee463d793cebf572)) + - some code health ([`c28697e`](https://github.comgit//DioxusLabs/dioxus/commit/c28697e1fe3136d1835f2b663715f34aab9f4b17)) + - major overhaul to diffing ([`9810fee`](https://github.comgit//DioxusLabs/dioxus/commit/9810feebf57f93114e3d7faf6de053ac192593a9)) + - Wip ([`c809095`](https://github.comgit//DioxusLabs/dioxus/commit/c809095124d06175e7f49853c34e48d7335573c5)) + - refactor a bit ([`2eeb8f2`](https://github.comgit//DioxusLabs/dioxus/commit/2eeb8f2386409b53836fab687097d89af7b883c3)) + - todos ([`8c541f6`](https://github.comgit//DioxusLabs/dioxus/commit/8c541f66d5f7ef2286f2cdf9b0496a9c404471f9)) + - todomvc ([`cfa0927`](https://github.comgit//DioxusLabs/dioxus/commit/cfa0927cdd40bc3dba22996018605dbad91d0391)) + - todomvc ([`ce33031`](https://github.comgit//DioxusLabs/dioxus/commit/ce33031519fbbbd207f1dffb75acf62bf59e3c9e)) + - more ergonomics, more examples ([`0bcff1f`](https://github.comgit//DioxusLabs/dioxus/commit/0bcff1f88e4b1a633b7a9b7c6c2e39b8bd3666c4)) + - use rsx! inline! ([`44aad27`](https://github.comgit//DioxusLabs/dioxus/commit/44aad2746c117ba9742c86a53327f4f9e96509e7)) + - building large apps, revamp macro ([`9f7f43b`](https://github.comgit//DioxusLabs/dioxus/commit/9f7f43b6614aaef2d7dded7058e81934f28f5dec)) + - begint to accept iterator types ([`742f150`](https://github.comgit//DioxusLabs/dioxus/commit/742f150eb3eba89913f5a0fabb229e72e2a0a5ee)) + - livehost bones ([`7856f2b`](https://github.comgit//DioxusLabs/dioxus/commit/7856f2b1537b52478a6fa1ca55d0a8c5793a91e5)) + - some stuff related to event listeners. POC for lifecyel ([`5b7887d`](https://github.comgit//DioxusLabs/dioxus/commit/5b7887d76c714d11e0cea5207197ffaac856a0a7)) + - diffing approach slightly broken ([`4e48e05`](https://github.comgit//DioxusLabs/dioxus/commit/4e48e0514e1caed9f60bcac4048114008ac76439)) + - remove old macro ([`9d0727e`](https://github.comgit//DioxusLabs/dioxus/commit/9d0727edabbf759dac8a3cffabd7103d08b728c1)) + - update examples ([`39bd185`](https://github.comgit//DioxusLabs/dioxus/commit/39bd1856f4d7c2364d6ca2c7812ab5d6e71252b9)) + - ensure mutabality is okay when not double-using the components ([`305ff91`](https://github.comgit//DioxusLabs/dioxus/commit/305ff919effa919ff7ea5db2a71cf21eca106588)) + - props now autoderives its own trait ([`b3c96a5`](https://github.comgit//DioxusLabs/dioxus/commit/b3c96a5996f434332813c737bb83ad564d91af5f)) + - somewhat working with rc and weak ([`d4f1cea`](https://github.comgit//DioxusLabs/dioxus/commit/d4f1ceaffbc0551ea3b179a101885275690cebec)) + - foregin eq from comparapable comp type. ([`ec801ea`](https://github.comgit//DioxusLabs/dioxus/commit/ec801eab167f9be5325ab877e74e2b65d501e129)) + - staticify? ([`5ad8188`](https://github.comgit//DioxusLabs/dioxus/commit/5ad81885e499bf02ac79e0098f7956d02ee5f2e5)) + - cargo fix to clean up things ([`78d093a`](https://github.comgit//DioxusLabs/dioxus/commit/78d093a9454386397a991bd01e603e4ad554521f)) + - implement vcomp fully ([`29751a4`](https://github.comgit//DioxusLabs/dioxus/commit/29751a4babfb46da25446ecf4077bfe9aa695655)) + - add some docs ([`5abda91`](https://github.comgit//DioxusLabs/dioxus/commit/5abda91892f32fd82a88d902aaefaccaabf07c7d)) + - update component so build passes ([`8fcd001`](https://github.comgit//DioxusLabs/dioxus/commit/8fcd001677146d83dc8e89402495c4e2a0ccc2f8)) + - wire up props macro ([`37f5a7a`](https://github.comgit//DioxusLabs/dioxus/commit/37f5a7ad33e272a9e210bf480304d54ff0df0d67)) + - still a bit stumped on DFS vs BFS ([`3740f81`](https://github.comgit//DioxusLabs/dioxus/commit/3740f81383b45e3300edda9c04f414852a828d12)) + - Feat: it's awersome ([`8dc2619`](https://github.comgit//DioxusLabs/dioxus/commit/8dc26195e274874a7de6c806372f9f77a5c82c5d)) + - revert FC changes (like the old style). ([`7158bc3`](https://github.comgit//DioxusLabs/dioxus/commit/7158bc3575e180dbe8641549b040e74ae3baf80b)) + - dyn scope ([`89f2290`](https://github.comgit//DioxusLabs/dioxus/commit/89f22906926ccb5aa4cbe3fe1b6d834b06dd91e7)) + - yeet, synthetic somewhat wired up ([`d959806`](https://github.comgit//DioxusLabs/dioxus/commit/d9598066c2679d9d0b9ca0ce1d3f26110a238cd2)) + - synthetic events wired up (ish) ([`3087813`](https://github.comgit//DioxusLabs/dioxus/commit/30878135707ea86702a2f1f8c6f269c14576879f)) + - remove FC ([`92d9521`](https://github.comgit//DioxusLabs/dioxus/commit/92d9521a73aefb620b354ae5954617109dd06e7e)) + - notes on safety, and inline listeners ([`bdd6be3`](https://github.comgit//DioxusLabs/dioxus/commit/bdd6be309e8fa4c05a03c5cfc164f7564e7c3051)) + - cleanup edit module ([`c70652a`](https://github.comgit//DioxusLabs/dioxus/commit/c70652a3c91411e816012f79291926a716615d5c)) + - more cleanup ([`5a9155b`](https://github.comgit//DioxusLabs/dioxus/commit/5a9155b059acc1fb3c8b8accbeca3701ce4f0ab6)) + - add context to builder ([`cf16090`](https://github.comgit//DioxusLabs/dioxus/commit/cf16090838d127354e333dcbc0b06474835b87d6)) + - listeners now have scope information ([`fcd68e6`](https://github.comgit//DioxusLabs/dioxus/commit/fcd68e61d2400628469ba193b009e7bf1fd3acdf)) + - broken, but solved ([`cb74d70`](https://github.comgit//DioxusLabs/dioxus/commit/cb74d70f831b5510f1ee191d91eaff621ffa6256)) + - use_reducer ([`879e107`](https://github.comgit//DioxusLabs/dioxus/commit/879e107634f596d555f62f8853afcf5b3796b180)) + - wowza got it all working ([`4b8e9f4`](https://github.comgit//DioxusLabs/dioxus/commit/4b8e9f4a125b9d55439d919786f33d9d5df234e8)) + - parse custom rsx syntax ([`da00df6`](https://github.comgit//DioxusLabs/dioxus/commit/da00df66889f4fa2e39651491e08794e1fe78549)) + - update readme and examples ([`ffaf687`](https://github.comgit//DioxusLabs/dioxus/commit/ffaf6878963981860089c2362947bf77a84c9058)) + - view -> render ([`c8bb392`](https://github.comgit//DioxusLabs/dioxus/commit/c8bb392cadb22ddb41e53a776ab0677945579a9c)) + - bump core version ([`4997976`](https://github.comgit//DioxusLabs/dioxus/commit/499797626144738ec088ced0ca272c2e7a920c19)) + - remove html crate ([`9dcee01`](https://github.comgit//DioxusLabs/dioxus/commit/9dcee01b335901cf2c80b453b97180e0d2551dc2)) + - add core macro crate ([`c32a6ef`](https://github.comgit//DioxusLabs/dioxus/commit/c32a6ef7fe50d8901a0585c7e426ff0b16b1de6e)) + - bump version for web release ([`422d5ac`](https://github.comgit//DioxusLabs/dioxus/commit/422d5ac5af4c3d05627edd36a623663db158c3dd)) + - a few bugs, but the event system works! ([`3b30fa6`](https://github.comgit//DioxusLabs/dioxus/commit/3b30fa61b8f1927f22ffec373a3405ddfdefde39)) + - patch to diff to allow scopes ([`2041c88`](https://github.comgit//DioxusLabs/dioxus/commit/2041c88d07e8d68494bc77a10eaeb4707da078d9)) + - moving to CbIdx as serializable event system ([`e840f47`](https://github.comgit//DioxusLabs/dioxus/commit/e840f472faf25d8e1d65abeb610daed6a522771d)) + - custom format_args for inlining variables into html templates ([`e4b1f6e`](https://github.comgit//DioxusLabs/dioxus/commit/e4b1f6ea0d0db707cf757dabf8635e9fc91a3e0f)) + - begin WIP on html macro ([`a8b1225`](https://github.comgit//DioxusLabs/dioxus/commit/a8b1225c4853a61c7862e1a33eba64b8ed4e06d5)) + - move webview logic into library ([`32b45e5`](https://github.comgit//DioxusLabs/dioxus/commit/32b45e5ba168390e338a343eef6baba5cca9468b)) + - comments ([`18a7a1f`](https://github.comgit//DioxusLabs/dioxus/commit/18a7a1f9c40eb3b1ac263cbd21b1daa6da9c7093)) + - wire up rebuild ([`06ae4fc`](https://github.comgit//DioxusLabs/dioxus/commit/06ae4fc17833ff9695b0645f940b5ea32eeb4ef0)) + - clean up code ([`8345137`](https://github.comgit//DioxusLabs/dioxus/commit/83451372aa28ba4e137b553f07838a2db06c92da)) + - fix internal lifecycle ([`5204862`](https://github.comgit//DioxusLabs/dioxus/commit/5204862bc220e55afe8d2f8f4422cb530a6ea1cf)) + - add css example ([`edf09c1`](https://github.comgit//DioxusLabs/dioxus/commit/edf09c1892f2521f41bf84372629e84bed86e921)) + - borrowing ([`7a4594e`](https://github.comgit//DioxusLabs/dioxus/commit/7a4594e237acc9864ca9426f6d7002a8ab223d83)) + - finally solve the component lifetime problem <3 ([`bdc25b5`](https://github.comgit//DioxusLabs/dioxus/commit/bdc25b581b12ee536933032803785d3531b13693)) + - WIP ctx ([`7a6aabe`](https://github.comgit//DioxusLabs/dioxus/commit/7a6aabe4f39aa38bec7b548d030c11b2d9f481cb)) + - desktop app wired up ([`b3e6886`](https://github.comgit//DioxusLabs/dioxus/commit/b3e68863514a33291556ce278b7255fdf53e8b50)) + - remove our use of ouroborous. ([`bcbb93b`](https://github.comgit//DioxusLabs/dioxus/commit/bcbb93b69764dbff0d6130dc0f32bcf58ad7807f)) + - re-enable stack machine approach ([`e3ede7f`](https://github.comgit//DioxusLabs/dioxus/commit/e3ede7fcbf7acb5d8762bcddb5f1499104bb0ce7)) + - WIP on deserialize ([`f22ff83`](https://github.comgit//DioxusLabs/dioxus/commit/f22ff8319078d283e675ff8dc735da5bf8efe0df)) + - wire up a very basic dom updater ([`c4e8d8b`](https://github.comgit//DioxusLabs/dioxus/commit/c4e8d8bb31d54d70c8da2f4a5e3e3926ff7df92b)) + - major overhaul to diffing, using a "diffing machine" now ([`4dfdf91`](https://github.comgit//DioxusLabs/dioxus/commit/4dfdf9123608c69b86a56acbd6d8810b0cf1918c)) + - remove generic paramter on VDOM ([`4c291a0`](https://github.comgit//DioxusLabs/dioxus/commit/4c291a0efdbaadf5c2212248367c0a78046e2f83)) + - wire up some of the changelist for diff ([`d063a19`](https://github.comgit//DioxusLabs/dioxus/commit/d063a199391383288e807ac03d333091bac6ba60)) + - event loop ([`ea2aa4b`](https://github.comgit//DioxusLabs/dioxus/commit/ea2aa4b0c97b3292178284e05756d1415902a9e2)) + - major overhaul, wire up event system ([`8295ac4`](https://github.comgit//DioxusLabs/dioxus/commit/8295ac4b3dd2954e2aa23ef3a1f2e7c740a29961)) + - overall API updates ([`f47651b`](https://github.comgit//DioxusLabs/dioxus/commit/f47651b32afb385297ddae00616f4308083a36e6)) + - push new component API and context API ([`125f542`](https://github.comgit//DioxusLabs/dioxus/commit/125f5426a4719bdbad42c6c166e3a6002a2ce3f0)) + - update builder ([`8329268`](https://github.comgit//DioxusLabs/dioxus/commit/8329268d39238f030dd703ab4614253e58339e0b)) + - update solved problems with context API ([`c97a964`](https://github.comgit//DioxusLabs/dioxus/commit/c97a9647e3ccc477f5068d567a17d540c0bd199c)) + - Feat: - integrate subscription service into context. - Update documentation ([`204f0d9`](https://github.comgit//DioxusLabs/dioxus/commit/204f0d9f16c97fb847b7265296b43db36411b393)) + - fix docs names ([`ee23ea6`](https://github.comgit//DioxusLabs/dioxus/commit/ee23ea6c3a43cb6a3f5f36d8eab3a0df0daeb760)) + - implememt nodes better ([`edbb33b`](https://github.comgit//DioxusLabs/dioxus/commit/edbb33b2ee3692cac155b9e206cd7c2d6382eb9d)) + - move out scope into its own file ([`c9d95dd`](https://github.comgit//DioxusLabs/dioxus/commit/c9d95dd1dc35bde6f395dd95a951a0260ecfbb8a)) + - capture pointer type ([`e939373`](https://github.comgit//DioxusLabs/dioxus/commit/e939373616680ae74948fa2c36388332c52d0d1f)) + - more updates to hooks ([`2c2882c`](https://github.comgit//DioxusLabs/dioxus/commit/2c2882c9a24ed22aa6d17800ad3b1c308eb6579f)) + - found a fast solution to hook state ([`4d01436`](https://github.comgit//DioxusLabs/dioxus/commit/4d01436c3f45ef32ea17fa06c363f4c76dc8c227)) + - comment out examples and move lifetime in FC type ([`62d4ad5`](https://github.comgit//DioxusLabs/dioxus/commit/62d4ad58787185032100a2d25e79b70f6ec97a3c)) + - include the helper ([`07341d2`](https://github.comgit//DioxusLabs/dioxus/commit/07341d2c65dc61b90587e2e5daadf72ec82623a8)) + - updates to docs, extension ([`a2406b3`](https://github.comgit//DioxusLabs/dioxus/commit/a2406b33d6c11174f95bd003a59650b86f14159f)) + - webview example ([`7730fd4`](https://github.comgit//DioxusLabs/dioxus/commit/7730fd4a8c0183699684704777fb581129eddd8e)) + - Dioxus-webview ([`9c01736`](https://github.comgit//DioxusLabs/dioxus/commit/9c0173689539210d14847613f9a1694e6cb34506)) + - add router ([`6aeea9b`](https://github.comgit//DioxusLabs/dioxus/commit/6aeea9b79081a2a711d8eee7e6edd299caf379ef)) + - dioxus frontend crate ([`4d7ac5b`](https://github.comgit//DioxusLabs/dioxus/commit/4d7ac5bb5d3aa1897c0f6c1f322aca08c0c791f0)) + - Add versioning for package ([`33a805d`](https://github.comgit//DioxusLabs/dioxus/commit/33a805da4024a02f7fd2c68d97ce270c31154461)) + - clean up naming ([`2afbfea`](https://github.comgit//DioxusLabs/dioxus/commit/2afbfea324317003c601a331bd759414cce6b742)) + - prep for cargo ([`be8d267`](https://github.comgit//DioxusLabs/dioxus/commit/be8d2678b58ceb15c30ce75de630d0398c8951c3)) + - include diffing and patching in Dioxus ([`f3c650b`](https://github.comgit//DioxusLabs/dioxus/commit/f3c650b073b57073d30b65fb4f7fe15a6c5b2be6)) + - more docs, dissolve vnode crate into dioxus-core ([`9c616ea`](https://github.comgit//DioxusLabs/dioxus/commit/9c616ea5c092a756a437ccf175c8b04ada50b1b6)) + - more docs, example, mroe nodes ([`d13e04c`](https://github.comgit//DioxusLabs/dioxus/commit/d13e04c9ff4c2a98e295d762d631d47e0c762049)) + - some updates, pull in the vnode enums ([`152bced`](https://github.comgit//DioxusLabs/dioxus/commit/152bced9f38576f359c9270efd868179298528bc)) + - WIP ([`ce34d0d`](https://github.comgit//DioxusLabs/dioxus/commit/ce34d0dfcda82d847a6032f8f42749b39e0fba18)) + - docs, code frm percy ([`2b9c8d0`](https://github.comgit//DioxusLabs/dioxus/commit/2b9c8d09d926ff6b5ad8a7e7b7b0b6f93bb8eb36)) +
+ diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index e363b4f8f..5da0536a6 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -1,10 +1,25 @@ [package] name = "dioxus-core" version = "0.1.3" -authors = ["Jonathan Kelley "] +authors = ["Jonathan Kelley"] edition = "2018" description = "Core functionality for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences" -"license" = "MIT/Apache-2.0" +license = "MIT/Apache-2.0" +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -47,7 +62,7 @@ dioxus-html = { path = "../html" } fern = { version = "0.6.0", features = ["colored"] } rand = { version = "0.8.4", features = ["small_rng"] } simple_logger = "1.13.0" -dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} +dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } # dioxus-hooks = { path = "../hooks" } criterion = "0.3.5" diff --git a/packages/coroutines/Cargo.toml b/packages/coroutines/Cargo.toml index 1b2632366..b0068a94e 100644 --- a/packages/coroutines/Cargo.toml +++ b/packages/coroutines/Cargo.toml @@ -2,7 +2,21 @@ name = "dioxus-coroutines" version = "0.0.0" edition = "2018" - +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[dependencies] \ No newline at end of file +[dependencies] diff --git a/packages/desktop/CHANGELOG.md b/packages/desktop/CHANGELOG.md new file mode 100644 index 000000000..03b66488e --- /dev/null +++ b/packages/desktop/CHANGELOG.md @@ -0,0 +1,106 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.0.0 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + - lnks to projects + +### New Features + + - bubbling + - it properly bubbles + - upgrade syntax + - fake bubbling + - improve safety + - massage lifetimes + - support desktop more completely + - add update functionality to useref + - desktop functioning well + - shared state mechanisms + - mutations + - mvoe away from compound context + - omg what a dumb mistake + - bless up, no more segfaults + - wire up event delegator for webview + +### Bug Fixes + + - really big bug around hooks + - desktop and mobile + - messed up how lifetimes worked, need to render once per component + +### Commit Statistics + + + + - 51 commits contributed to the release over the course of 128 calendar days. + - 49 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) + - polish ([`8bf57dc`](https://github.comgit//DioxusLabs/dioxus/commit/8bf57dc21dfbcbae5b95650203b68d3f41227652)) + - really big bug around hooks ([`52c7154`](https://github.comgit//DioxusLabs/dioxus/commit/52c7154897111b570918127ffe3285bb1d5951a0)) + - better desktop support ([`25a8411`](https://github.comgit//DioxusLabs/dioxus/commit/25a8411485e85bb7e3c8f20701d484529efe9a80)) + - bubbling ([`19df1bd`](https://github.comgit//DioxusLabs/dioxus/commit/19df1bda109aba03c40ff631263bcb7035004ca0)) + - move examples around ([`1e6e5e6`](https://github.comgit//DioxusLabs/dioxus/commit/1e6e5e611b61571f272289adefc9cdd7d59c4399)) + - updates to router ([`bab21a0`](https://github.comgit//DioxusLabs/dioxus/commit/bab21a0aa1cbf8e6bd95f823e49f53c082e8d6cc)) + - docs and router ([`a5f05d7`](https://github.comgit//DioxusLabs/dioxus/commit/a5f05d73acc0e47b05cff64a373482519414bc7c)) + - it properly bubbles ([`9d8c5ca`](https://github.comgit//DioxusLabs/dioxus/commit/9d8c5ca5ab5784b3f17d7ee20a451ee68fd703d6)) + - upgrade syntax ([`fd93ee8`](https://github.comgit//DioxusLabs/dioxus/commit/fd93ee89c19b085a04307ef30217170518defa8e)) + - fake bubbling ([`11757dd`](https://github.comgit//DioxusLabs/dioxus/commit/11757ddf61e1decb1bd1c2bb30455d0bd01a3e95)) + - Merge branch 'master' into jk/remove_node_safety ([`db00047`](https://github.comgit//DioxusLabs/dioxus/commit/db0004758c77331cc3b93ea8cf227c060028e12e)) + - Merge branch 'master' of https://github.com/jkelleyrtp/dioxus ([`60d6eb2`](https://github.comgit//DioxusLabs/dioxus/commit/60d6eb204a10633e5e52f91e855bd12c5cda40f2)) + - desktop and mobile ([`601078f`](https://github.comgit//DioxusLabs/dioxus/commit/601078f9cf78a58d7502a377676ac94f3cf037bf)) + - slim down tokio ([`e86c1d8`](https://github.comgit//DioxusLabs/dioxus/commit/e86c1d8972dfa8717cd450513e90ff05b9af4776)) + - docs ([`a42711a`](https://github.comgit//DioxusLabs/dioxus/commit/a42711a324215b87f607093a57b204be4154f30e)) + - improve safety ([`fda2ebc`](https://github.comgit//DioxusLabs/dioxus/commit/fda2ebc2a22965845e015384f39f34ce7cb3e428)) + - massage lifetimes ([`9726a06`](https://github.comgit//DioxusLabs/dioxus/commit/9726a065b0d4fb1ede5b53a2ddd58c855e51539f)) + - book documentation ([`16dbf4a`](https://github.comgit//DioxusLabs/dioxus/commit/16dbf4a6f84103857385fb4b142a718b0ce72118)) + - more changes to scheduler ([`059294a`](https://github.comgit//DioxusLabs/dioxus/commit/059294ab55e9e945c9aede1fd4b4faf39a7b9ea9)) + - messed up how lifetimes worked, need to render once per component ([`ba9e1db`](https://github.comgit//DioxusLabs/dioxus/commit/ba9e1dbb8fa24048a6c9ccef8a8722688226a845)) + - major cleanups to scheduler ([`2933e4b`](https://github.comgit//DioxusLabs/dioxus/commit/2933e4bc11b3074c2bde8d76ec55364fca841988)) + - move everything over to a stack dst ([`0e9d5fc`](https://github.comgit//DioxusLabs/dioxus/commit/0e9d5fc5306ab508d5af6999a4064f9b8b48460f)) + - support desktop more completely ([`efd0e9b`](https://github.comgit//DioxusLabs/dioxus/commit/efd0e9b5648c809057f339083ba9d454f810d483)) + - add update functionality to useref ([`a2b0c50`](https://github.comgit//DioxusLabs/dioxus/commit/a2b0c50a343005c63c7032bcefb8323b78350bb9)) + - lnks to projects ([`460783a`](https://github.comgit//DioxusLabs/dioxus/commit/460783ad549818a85db634ed9c39ffce210b98ec)) + - desktop functioning well ([`5502429`](https://github.comgit//DioxusLabs/dioxus/commit/5502429626023d0788cca352e94ac6ea67c2cb11)) + - more example images ([`2403990`](https://github.comgit//DioxusLabs/dioxus/commit/2403990ea362f1e066da5a877b123cbdfe3dada2)) + - overhaul event system ([`7a03c1d`](https://github.comgit//DioxusLabs/dioxus/commit/7a03c1d2b48590276b182465679387655fe08f3a)) + - threadsafe ([`82953f2`](https://github.comgit//DioxusLabs/dioxus/commit/82953f2ac37913f83a822333acd0c47e20777d31)) + - shared state mechanisms ([`4a4c7af`](https://github.comgit//DioxusLabs/dioxus/commit/4a4c7afca7e1beadd4b213214074fdb420eb0923)) + - clean up the web module ([`823adc0`](https://github.comgit//DioxusLabs/dioxus/commit/823adc0834b581327aee745c72ce8993f0bba5aa)) + - fix some event stuff for web and core ([`725b4a1`](https://github.comgit//DioxusLabs/dioxus/commit/725b4a1d7f5d629b1b0a163b65bfd93b2f8a151b)) + - mutations ([`fac4233`](https://github.comgit//DioxusLabs/dioxus/commit/fac42339c272b0e430ebf4f31b6061a0635d3e19)) + - add test_dom ([`a652090`](https://github.comgit//DioxusLabs/dioxus/commit/a652090dc5708db334fa7430fededb1bac207880)) + - bottom up dropping ([`f2334c1`](https://github.comgit//DioxusLabs/dioxus/commit/f2334c17be2612d926361686d7d40a57e3ffe9b9)) + - cleanup ([`1745a44`](https://github.comgit//DioxusLabs/dioxus/commit/1745a44d949b994b64ea1fb715cbe36963ae7027)) + - docs, html! macro, more ([`caf772c`](https://github.comgit//DioxusLabs/dioxus/commit/caf772cf249d2f56c8d0b0fa2737ad48e32c6e82)) + - cleanup workspace ([`8f0bb5d`](https://github.comgit//DioxusLabs/dioxus/commit/8f0bb5dc5bfa3e775af567c4b569622cdd932af1)) + - clean up warnings ([`b32e261`](https://github.comgit//DioxusLabs/dioxus/commit/b32e2611e37b17c2371ffb10cf1ac647f017d917)) + - web stuff ([`acad9ca`](https://github.comgit//DioxusLabs/dioxus/commit/acad9ca622748f96599dd02ad22aaeaae3621b76)) + - making progress on diffing and hydration ([`49856cc`](https://github.comgit//DioxusLabs/dioxus/commit/49856ccd6865f88d63765f26d27f7e945b554da0)) + - mvoe away from compound context ([`a2c7d17`](https://github.comgit//DioxusLabs/dioxus/commit/a2c7d17b0595769f60bc1c2bbf7cbe32cec37486)) + - omg what a dumb mistake ([`f782e14`](https://github.comgit//DioxusLabs/dioxus/commit/f782e142118fb7acf1b88a0f3fbb03e4a5e3e91e)) + - refactor ([`8b0eb87`](https://github.comgit//DioxusLabs/dioxus/commit/8b0eb87c72ea9d444dee99a8b05643f19fea2634)) + - bless up, no more segfaults ([`4a0068f`](https://github.comgit//DioxusLabs/dioxus/commit/4a0068f09918adbc299150edcf777f342ced0dd3)) + - wire up event delegator for webview ([`7dfe89c`](https://github.comgit//DioxusLabs/dioxus/commit/7dfe89c9581f45a445f17f9fe4bb94e61f67e971)) + - solve some issues regarding listeners ([`dfaf5ad`](https://github.comgit//DioxusLabs/dioxus/commit/dfaf5adee164f44a679ab21d730caaab3610e01f)) + - more overhaul on virtualevents ([`41cc429`](https://github.comgit//DioxusLabs/dioxus/commit/41cc42919d42453f8f2560aa852211364af4ad3d)) + - groundwork for noderefs ([`c1afeba`](https://github.comgit//DioxusLabs/dioxus/commit/c1afeba1efb1a063705466a14648beee08cacb86)) +
+ diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index c4829df93..53407d549 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -1,15 +1,29 @@ [package] name = "dioxus-desktop" version = "0.0.0" -authors = ["Jonathan Kelley "] +authors = ["Jonathan Kelley"] edition = "2018" description = "Dioxus VirtualDOM renderer for a remote webview instance" license = "MIT/Apache-2.0" - +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md new file mode 100644 index 000000000..e9c3cec5c --- /dev/null +++ b/packages/hooks/CHANGELOG.md @@ -0,0 +1,113 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.3 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + - big updates to the reference + - move around examples + - move into a fromjs tutorial + +### New Features + + - it compiles once more + - improve safety + - massage lifetimes + - add update functionality to useref + - shared state mechanisms + - mvoe away from compound context + - omg what a dumb mistake + - more suspended nodes! + - wire up event delegator for webview + - task system works + but I broke the other things :( + - static node infrastructure and ssr changes + +### Bug Fixes + + - really big bug around hooks + - desktop and mobile + - all the bugs! + +### Commit Statistics + + + + - 59 commits contributed to the release over the course of 335 calendar days. + - 57 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - docs ([`3ddf395`](https://github.comgit//DioxusLabs/dioxus/commit/3ddf395772aa24d04cf4e35bbb3a0027c8f1c7dd)) + - remove portals completely ([`2fd56e7`](https://github.comgit//DioxusLabs/dioxus/commit/2fd56e76192bc70d5503bfcd6b4127d383dd082c)) + - go back to noisy lifetime solution ([`8daf7a6`](https://github.comgit//DioxusLabs/dioxus/commit/8daf7a6ed86df72522b089aa2647eea7bee0f3b6)) + - clean up the core crate ([`e6c6bbd`](https://github.comgit//DioxusLabs/dioxus/commit/e6c6bbdc1ec6a8c251b78c05ca104f006b6fad26)) + - make warnings go away ([`0545d27`](https://github.comgit//DioxusLabs/dioxus/commit/0545d271828418f3ab0df2e9abf66ccafb30707d)) + - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) + - docs ([`8814977`](https://github.comgit//DioxusLabs/dioxus/commit/8814977eeebe06748a3b9677a8070e42a037ebd7)) + - update hooks ([`597a045`](https://github.comgit//DioxusLabs/dioxus/commit/597a0456f59872bd5dc60d382acdec76a98b1db2)) + - really big bug around hooks ([`52c7154`](https://github.comgit//DioxusLabs/dioxus/commit/52c7154897111b570918127ffe3285bb1d5951a0)) + - better desktop support ([`25a8411`](https://github.comgit//DioxusLabs/dioxus/commit/25a8411485e85bb7e3c8f20701d484529efe9a80)) + - it compiles once more ([`8acdd2e`](https://github.comgit//DioxusLabs/dioxus/commit/8acdd2ea830b995b608d8bac2ef527db8d40e662)) + - move examples around ([`1e6e5e6`](https://github.comgit//DioxusLabs/dioxus/commit/1e6e5e611b61571f272289adefc9cdd7d59c4399)) + - docs and router ([`a5f05d7`](https://github.comgit//DioxusLabs/dioxus/commit/a5f05d73acc0e47b05cff64a373482519414bc7c)) + - Merge branch 'master' into jk/remove_node_safety ([`db00047`](https://github.comgit//DioxusLabs/dioxus/commit/db0004758c77331cc3b93ea8cf227c060028e12e)) + - Merge branch 'master' of https://github.com/jkelleyrtp/dioxus ([`60d6eb2`](https://github.comgit//DioxusLabs/dioxus/commit/60d6eb204a10633e5e52f91e855bd12c5cda40f2)) + - bubbling in progress ([`a21020e`](https://github.comgit//DioxusLabs/dioxus/commit/a21020ea575e467ba0d608737269fe1b0792dba7)) + - desktop and mobile ([`601078f`](https://github.comgit//DioxusLabs/dioxus/commit/601078f9cf78a58d7502a377676ac94f3cf037bf)) + - improve safety ([`fda2ebc`](https://github.comgit//DioxusLabs/dioxus/commit/fda2ebc2a22965845e015384f39f34ce7cb3e428)) + - massage lifetimes ([`9726a06`](https://github.comgit//DioxusLabs/dioxus/commit/9726a065b0d4fb1ede5b53a2ddd58c855e51539f)) + - major cleanups to scheduler ([`2933e4b`](https://github.comgit//DioxusLabs/dioxus/commit/2933e4bc11b3074c2bde8d76ec55364fca841988)) + - add update functionality to useref ([`a2b0c50`](https://github.comgit//DioxusLabs/dioxus/commit/a2b0c50a343005c63c7032bcefb8323b78350bb9)) + - all the bugs! ([`478255f`](https://github.comgit//DioxusLabs/dioxus/commit/478255f40d4de1d2e3f3cc9b6d758b30ff394b39)) + - shared state mechanisms ([`4a4c7af`](https://github.comgit//DioxusLabs/dioxus/commit/4a4c7afca7e1beadd4b213214074fdb420eb0923)) + - fix web list issue ([`da4423c`](https://github.comgit//DioxusLabs/dioxus/commit/da4423c141f1f376df5f3f2580e5284831744a7e)) + - remove wildcard ([`ba8ced5`](https://github.comgit//DioxusLabs/dioxus/commit/ba8ced573caea6f55d47804c327d6a279d4733a6)) + - clean up the web module ([`823adc0`](https://github.comgit//DioxusLabs/dioxus/commit/823adc0834b581327aee745c72ce8993f0bba5aa)) + - examples ([`1a2f91e`](https://github.comgit//DioxusLabs/dioxus/commit/1a2f91ed91c13dae553ecde585462ab261b1b95d)) + - performance looks good, needs more testing ([`4b6ca05`](https://github.comgit//DioxusLabs/dioxus/commit/4b6ca05f2c3ad647842c858967da9c87f1915825)) + - cleanup ([`1745a44`](https://github.comgit//DioxusLabs/dioxus/commit/1745a44d949b994b64ea1fb715cbe36963ae7027)) + - fill out the snippets ([`6051b0e`](https://github.comgit//DioxusLabs/dioxus/commit/6051b0ec86927704451f4ce6cdf8f988e59702ae)) + - big updates to the reference ([`583fdfa`](https://github.comgit//DioxusLabs/dioxus/commit/583fdfa5618e11d660985b97e570d4503be2ff49)) + - docs, html! macro, more ([`caf772c`](https://github.comgit//DioxusLabs/dioxus/commit/caf772cf249d2f56c8d0b0fa2737ad48e32c6e82)) + - mvoe away from compound context ([`a2c7d17`](https://github.comgit//DioxusLabs/dioxus/commit/a2c7d17b0595769f60bc1c2bbf7cbe32cec37486)) + - examples ([`f1cff84`](https://github.comgit//DioxusLabs/dioxus/commit/f1cff845ce11231cb4b2dd4857f9ca9f0265b925)) + - omg what a dumb mistake ([`f782e14`](https://github.comgit//DioxusLabs/dioxus/commit/f782e142118fb7acf1b88a0f3fbb03e4a5e3e91e)) + - more suspended nodes! ([`de9f61b`](https://github.comgit//DioxusLabs/dioxus/commit/de9f61bcf48c0d6e35e46c337b72a713c9f9f7d2)) + - wire up event delegator for webview ([`7dfe89c`](https://github.comgit//DioxusLabs/dioxus/commit/7dfe89c9581f45a445f17f9fe4bb94e61f67e971)) + - task system works ([`3a57b94`](https://github.comgit//DioxusLabs/dioxus/commit/3a57b942624afb8aa6650aeee05466c3c9ce967e)) + - move examples around ([`304259d`](https://github.comgit//DioxusLabs/dioxus/commit/304259d8186d1d34224a74c95f4fd7d14126b499)) + - ssr + tide ([`269e81b`](https://github.comgit//DioxusLabs/dioxus/commit/269e81b0fdb32ae0706160cd278cf3a1b731387b)) + - static node infrastructure and ssr changes ([`9abb047`](https://github.comgit//DioxusLabs/dioxus/commit/9abb0470b7869019d539a2fc21da3872348ae38b)) + - more refactor for async ([`975fa56`](https://github.comgit//DioxusLabs/dioxus/commit/975fa566f9809f8fa2bb0bdb07fbfc7f855dcaeb)) + - some project refactor ([`8cfc437`](https://github.comgit//DioxusLabs/dioxus/commit/8cfc437bfe4110d7f984428f01df90bdf8f8d9ec)) + - move some examples around ([`98a0933`](https://github.comgit//DioxusLabs/dioxus/commit/98a09339fd3190799ea4dd316908f0a53fdf2413)) + - rename ctx to cx ([`81382e7`](https://github.comgit//DioxusLabs/dioxus/commit/81382e7044fb3dba61d4abb1e6086b7b29143116)) + - move around examples ([`70cd46d`](https://github.comgit//DioxusLabs/dioxus/commit/70cd46dbb2a689ae2d512e142b8aee9c80798430)) + - pre vnodes instead of vnode ([`fe6938c`](https://github.comgit//DioxusLabs/dioxus/commit/fe6938ceb3dba0796ae8bab52ae41248dc0d3650)) + - move into a fromjs tutorial ([`69f5cc3`](https://github.comgit//DioxusLabs/dioxus/commit/69f5cc3802af136729bc73e5c3d209270d41b184)) + - massive changes to definition of components ([`508c560`](https://github.comgit//DioxusLabs/dioxus/commit/508c560320d78730fa058156421523ffa5695d9d)) + - major overhaul to diffing ([`9810fee`](https://github.comgit//DioxusLabs/dioxus/commit/9810feebf57f93114e3d7faf6de053ac192593a9)) + - cargo fix to clean up things ([`78d093a`](https://github.comgit//DioxusLabs/dioxus/commit/78d093a9454386397a991bd01e603e4ad554521f)) + - overall API updates ([`f47651b`](https://github.comgit//DioxusLabs/dioxus/commit/f47651b32afb385297ddae00616f4308083a36e6)) + - implememt nodes better ([`edbb33b`](https://github.comgit//DioxusLabs/dioxus/commit/edbb33b2ee3692cac155b9e206cd7c2d6382eb9d)) + - comment out examples and move lifetime in FC type ([`62d4ad5`](https://github.comgit//DioxusLabs/dioxus/commit/62d4ad58787185032100a2d25e79b70f6ec97a3c)) + - updates to docs, extension ([`a2406b3`](https://github.comgit//DioxusLabs/dioxus/commit/a2406b33d6c11174f95bd003a59650b86f14159f)) + - add webview example ([`65d0d61`](https://github.comgit//DioxusLabs/dioxus/commit/65d0d611ea9a47d305151d65769b52ec22559959)) + - add hooks ([`c1b990b`](https://github.comgit//DioxusLabs/dioxus/commit/c1b990b27c34e5d6b95ec78e07394b3806b75dc1)) + - docs, code frm percy ([`2b9c8d0`](https://github.comgit//DioxusLabs/dioxus/commit/2b9c8d09d926ff6b5ad8a7e7b7b0b6f93bb8eb36)) +
+ diff --git a/packages/hooks/Cargo.toml b/packages/hooks/Cargo.toml index 93133865e..450903a30 100644 --- a/packages/hooks/Cargo.toml +++ b/packages/hooks/Cargo.toml @@ -1,9 +1,23 @@ [package] name = "dioxus-hooks" version = "0.1.3" -authors = ["Jonathan Kelley "] +authors = ["Jonathan Kelley"] edition = "2018" - +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/packages/html/CHANGELOG.md b/packages/html/CHANGELOG.md new file mode 100644 index 000000000..06215f01e --- /dev/null +++ b/packages/html/CHANGELOG.md @@ -0,0 +1,83 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0 (2021-12-15) + +### Documentation + + - update readme + - big updates to the reference + +### New Features + + - fake bubbling + - events bubble now + - support innerhtml + - shared state mechanisms + - a cute crm + - svgs working in webview + - more suspended nodes! + - add aria + - buff up html allowed attributes + - beaf up the use_state hook + - enable arbitrary body in rsx! macro + +### Bug Fixes + + - desktop and mobile + +### Commit Statistics + + + + - 34 commits contributed to the release over the course of 160 calendar days. + - 32 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - bump versions ([`0846d93`](https://github.comgit//DioxusLabs/dioxus/commit/0846d93d41c27464ca271757c6f24a2cef8fb997)) + - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) + - polish ([`8bf57dc`](https://github.comgit//DioxusLabs/dioxus/commit/8bf57dc21dfbcbae5b95650203b68d3f41227652)) + - docs and router ([`a5f05d7`](https://github.comgit//DioxusLabs/dioxus/commit/a5f05d73acc0e47b05cff64a373482519414bc7c)) + - fake bubbling ([`11757dd`](https://github.comgit//DioxusLabs/dioxus/commit/11757ddf61e1decb1bd1c2bb30455d0bd01a3e95)) + - events bubble now ([`f223406`](https://github.comgit//DioxusLabs/dioxus/commit/f2234068ba7cd915a00a81e41660d7d6ee1177cc)) + - Merge branch 'master' of https://github.com/jkelleyrtp/dioxus ([`60d6eb2`](https://github.comgit//DioxusLabs/dioxus/commit/60d6eb204a10633e5e52f91e855bd12c5cda40f2)) + - desktop and mobile ([`601078f`](https://github.comgit//DioxusLabs/dioxus/commit/601078f9cf78a58d7502a377676ac94f3cf037bf)) + - support innerhtml ([`cfc24f5`](https://github.comgit//DioxusLabs/dioxus/commit/cfc24f5451cd2d1e9dcd5f1589ee50f705404110)) + - major cleanups to scheduler ([`2933e4b`](https://github.comgit//DioxusLabs/dioxus/commit/2933e4bc11b3074c2bde8d76ec55364fca841988)) + - more raw ptrs ([`95bd17e`](https://github.comgit//DioxusLabs/dioxus/commit/95bd17e38fc936dcc9383d0ba8beac5ed64b41eb)) + - update readme ([`285b33d`](https://github.comgit//DioxusLabs/dioxus/commit/285b33dd38c88e2be797eb7f19c34a0906f16b13)) + - shared state mechanisms ([`4a4c7af`](https://github.comgit//DioxusLabs/dioxus/commit/4a4c7afca7e1beadd4b213214074fdb420eb0923)) + - fix web list issue ([`da4423c`](https://github.comgit//DioxusLabs/dioxus/commit/da4423c141f1f376df5f3f2580e5284831744a7e)) + - html package ([`740cbd1`](https://github.comgit//DioxusLabs/dioxus/commit/740cbd1f9d3e7055822af0be5cc07cc8140eb435)) + - and publish ([`51e2005`](https://github.comgit//DioxusLabs/dioxus/commit/51e20052d9f711a06232675eddc6aace492ad287)) + - clean up the web module ([`823adc0`](https://github.comgit//DioxusLabs/dioxus/commit/823adc0834b581327aee745c72ce8993f0bba5aa)) + - a cute crm ([`718fa14`](https://github.comgit//DioxusLabs/dioxus/commit/718fa14b45df38b40b0c0dff7bdc923cba57026b)) + - examples ([`1a2f91e`](https://github.comgit//DioxusLabs/dioxus/commit/1a2f91ed91c13dae553ecde585462ab261b1b95d)) + - some ideas ([`05c909f`](https://github.comgit//DioxusLabs/dioxus/commit/05c909f320765aec1bf4c1c55ca59ffd5525a2c7)) + - big updates to the reference ([`583fdfa`](https://github.comgit//DioxusLabs/dioxus/commit/583fdfa5618e11d660985b97e570d4503be2ff49)) + - cleanup workspace ([`8f0bb5d`](https://github.comgit//DioxusLabs/dioxus/commit/8f0bb5dc5bfa3e775af567c4b569622cdd932af1)) + - svgs working in webview ([`3bedcb9`](https://github.comgit//DioxusLabs/dioxus/commit/3bedcb93cacec5bdf134adc38ff02eadbf96c1c6)) + - more doc ([`adf202e`](https://github.comgit//DioxusLabs/dioxus/commit/adf202eab9201c69ec455e621c755500329815fe)) + - more suspended nodes! ([`de9f61b`](https://github.comgit//DioxusLabs/dioxus/commit/de9f61bcf48c0d6e35e46c337b72a713c9f9f7d2)) + - solve some issues regarding listeners ([`dfaf5ad`](https://github.comgit//DioxusLabs/dioxus/commit/dfaf5adee164f44a679ab21d730caaab3610e01f)) + - wip ([`996247a`](https://github.comgit//DioxusLabs/dioxus/commit/996247a1644d91ebb00e2b2188d21cacdc48257b)) + - add aria ([`4091846`](https://github.comgit//DioxusLabs/dioxus/commit/4091846934b4b3b2bc03d3ca8aaf7712aebd4e36)) + - more examples ([`56e7eb8`](https://github.comgit//DioxusLabs/dioxus/commit/56e7eb83a97ebd6d5bcd23464cfb9d718e5ac26d)) + - buff up html allowed attributes ([`c79d9ae`](https://github.comgit//DioxusLabs/dioxus/commit/c79d9ae674e235c8e9c2c069d24902122b9c7464)) + - it works but the page is backwards ([`cdcd861`](https://github.comgit//DioxusLabs/dioxus/commit/cdcd8611e87ffb5e24de7b9fe6c656af3053276e)) + - use the new structure ([`a05047d`](https://github.comgit//DioxusLabs/dioxus/commit/a05047d01e606425fb0d6595e9d27d3e15f32050)) + - beaf up the use_state hook ([`e4cdb64`](https://github.comgit//DioxusLabs/dioxus/commit/e4cdb645aad800484b19ec35ba1f8bb9ccf71d12)) + - enable arbitrary body in rsx! macro ([`7aec40d`](https://github.comgit//DioxusLabs/dioxus/commit/7aec40d57e78ec13ff3a90ca8149521cbf1d9ff2)) +
+ diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index bf351d4c5..b341f3ee6 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -4,12 +4,26 @@ version = "0.1.0" authors = ["Jonathan Kelley"] edition = "2018" description = "HTML Element pack for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences" -"license" = "MIT/Apache-2.0" - +license = "MIT/Apache-2.0" +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3"} +dioxus-core = { path = "../core", version = "^0.1.3" } # Serialize the Edits for use in Webview/Liveview instances serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1.7", optional = true } diff --git a/packages/liveview/CHANGELOG.md b/packages/liveview/CHANGELOG.md new file mode 100644 index 000000000..2c67b4244 --- /dev/null +++ b/packages/liveview/CHANGELOG.md @@ -0,0 +1,40 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + +### Commit Statistics + + + + - 10 commits contributed to the release over the course of 274 calendar days. + - 10 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - clean up the core crate ([`e6c6bbd`](https://github.comgit//DioxusLabs/dioxus/commit/e6c6bbdc1ec6a8c251b78c05ca104f006b6fad26)) + - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) + - move some examples around ([`98a0933`](https://github.comgit//DioxusLabs/dioxus/commit/98a09339fd3190799ea4dd316908f0a53fdf2413)) + - rename ctx to cx ([`81382e7`](https://github.comgit//DioxusLabs/dioxus/commit/81382e7044fb3dba61d4abb1e6086b7b29143116)) + - massive changes to definition of components ([`508c560`](https://github.comgit//DioxusLabs/dioxus/commit/508c560320d78730fa058156421523ffa5695d9d)) + - move to static props ([`c1fd848`](https://github.comgit//DioxusLabs/dioxus/commit/c1fd848f89b0146581d8e485fa0d4a847387b963)) + - begint to accept iterator types ([`742f150`](https://github.comgit//DioxusLabs/dioxus/commit/742f150eb3eba89913f5a0fabb229e72e2a0a5ee)) + - need iterator for bracketed children ([`f24d291`](https://github.comgit//DioxusLabs/dioxus/commit/f24d29130a9d69d55b47770064cce4547533eb52)) + - more liveview and webview custom client ([`9b560df`](https://github.comgit//DioxusLabs/dioxus/commit/9b560dfedb988b258f5c564986759cb83730a96c)) +
+ diff --git a/packages/liveview/Cargo.toml b/packages/liveview/Cargo.toml index 1fb2905fc..b036f0203 100644 --- a/packages/liveview/Cargo.toml +++ b/packages/liveview/Cargo.toml @@ -2,7 +2,21 @@ name = "dioxus-liveview" version = "0.1.0" edition = "2021" - +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/packages/mobile/CHANGELOG.md b/packages/mobile/CHANGELOG.md new file mode 100644 index 000000000..2be2fb9dc --- /dev/null +++ b/packages/mobile/CHANGELOG.md @@ -0,0 +1,48 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.0.0 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + - big updates to the reference + +### New Features + + - add update functionality to useref + - omg what a dumb mistake + +### Commit Statistics + + + + - 12 commits contributed to the release over the course of 128 calendar days. + - 12 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) + - book documentation ([`16dbf4a`](https://github.comgit//DioxusLabs/dioxus/commit/16dbf4a6f84103857385fb4b142a718b0ce72118)) + - add update functionality to useref ([`a2b0c50`](https://github.comgit//DioxusLabs/dioxus/commit/a2b0c50a343005c63c7032bcefb8323b78350bb9)) + - overhaul event system ([`7a03c1d`](https://github.comgit//DioxusLabs/dioxus/commit/7a03c1d2b48590276b182465679387655fe08f3a)) + - bottom up dropping ([`f2334c1`](https://github.comgit//DioxusLabs/dioxus/commit/f2334c17be2612d926361686d7d40a57e3ffe9b9)) + - big updates to the reference ([`583fdfa`](https://github.comgit//DioxusLabs/dioxus/commit/583fdfa5618e11d660985b97e570d4503be2ff49)) + - cleanup workspace ([`8f0bb5d`](https://github.comgit//DioxusLabs/dioxus/commit/8f0bb5dc5bfa3e775af567c4b569622cdd932af1)) + - omg what a dumb mistake ([`f782e14`](https://github.comgit//DioxusLabs/dioxus/commit/f782e142118fb7acf1b88a0f3fbb03e4a5e3e91e)) + - solve some issues regarding listeners ([`dfaf5ad`](https://github.comgit//DioxusLabs/dioxus/commit/dfaf5adee164f44a679ab21d730caaab3610e01f)) + - move CLI into its own "studio" app ([`fd79335`](https://github.comgit//DioxusLabs/dioxus/commit/fd7933561fe81922e4d5d77f6ac3b6f19efb5a90)) + - groundwork for noderefs ([`c1afeba`](https://github.comgit//DioxusLabs/dioxus/commit/c1afeba1efb1a063705466a14648beee08cacb86)) +
+ diff --git a/packages/mobile/Cargo.toml b/packages/mobile/Cargo.toml index 9566c3330..02d4cf9cf 100644 --- a/packages/mobile/Cargo.toml +++ b/packages/mobile/Cargo.toml @@ -1,15 +1,29 @@ [package] name = "dioxus-mobile" version = "0.0.0" -authors = ["Jonathan Kelley "] +authors = ["Jonathan Kelley"] edition = "2018" - +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1.0" # cacao = { git = "https://github.com/ryanmcgrath/cacao" } -dioxus-core = { path = "../core", version ="^0.1.3"} +dioxus-core = { path = "../core", version = "^0.1.3" } log = "0.4.14" serde = "1.0.126" serde_json = "1.0.64" diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md new file mode 100644 index 000000000..a252a2a8c --- /dev/null +++ b/packages/router/CHANGELOG.md @@ -0,0 +1,56 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + +### New Features + + - it compiles once more + +### Bug Fixes + + - router version + - really big bug around hooks + +### Commit Statistics + + + + - 17 commits contributed to the release over the course of 328 calendar days. + - 17 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - router version ([`58106a5`](https://github.comgit//DioxusLabs/dioxus/commit/58106a55291e90661e8901dd8900434c20a75576)) + - bump versions ([`0846d93`](https://github.comgit//DioxusLabs/dioxus/commit/0846d93d41c27464ca271757c6f24a2cef8fb997)) + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - remove portals completely ([`2fd56e7`](https://github.comgit//DioxusLabs/dioxus/commit/2fd56e76192bc70d5503bfcd6b4127d383dd082c)) + - go back to noisy lifetime solution ([`8daf7a6`](https://github.comgit//DioxusLabs/dioxus/commit/8daf7a6ed86df72522b089aa2647eea7bee0f3b6)) + - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) + - docs ([`8814977`](https://github.comgit//DioxusLabs/dioxus/commit/8814977eeebe06748a3b9677a8070e42a037ebd7)) + - really big bug around hooks ([`52c7154`](https://github.comgit//DioxusLabs/dioxus/commit/52c7154897111b570918127ffe3285bb1d5951a0)) + - it compiles once more ([`8acdd2e`](https://github.comgit//DioxusLabs/dioxus/commit/8acdd2ea830b995b608d8bac2ef527db8d40e662)) + - move examples around ([`1e6e5e6`](https://github.comgit//DioxusLabs/dioxus/commit/1e6e5e611b61571f272289adefc9cdd7d59c4399)) + - updates to router ([`bab21a0`](https://github.comgit//DioxusLabs/dioxus/commit/bab21a0aa1cbf8e6bd95f823e49f53c082e8d6cc)) + - add router ([`d298b62`](https://github.comgit//DioxusLabs/dioxus/commit/d298b626d3ae21a39a8ec4426373369ac94edf9f)) + - docs and router ([`a5f05d7`](https://github.comgit//DioxusLabs/dioxus/commit/a5f05d73acc0e47b05cff64a373482519414bc7c)) + - rename ctx to cx ([`81382e7`](https://github.comgit//DioxusLabs/dioxus/commit/81382e7044fb3dba61d4abb1e6086b7b29143116)) + - more work on updating syntad ([`47e8960`](https://github.comgit//DioxusLabs/dioxus/commit/47e896038ef3655566f3eda83d1d2adfefbc8862)) + - massive changes to definition of components ([`508c560`](https://github.comgit//DioxusLabs/dioxus/commit/508c560320d78730fa058156421523ffa5695d9d)) + - add router ([`6aeea9b`](https://github.comgit//DioxusLabs/dioxus/commit/6aeea9b79081a2a711d8eee7e6edd299caf379ef)) +
+ diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 808d15673..3d49cadd4 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -2,13 +2,29 @@ name = "dioxus-router" version = "0.1.0" edition = "2018" - +description = "Dioxus VirtualDOM renderer for the web browser using websys" +license = "MIT/Apache-2.0" +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", default-features = false } -dioxus-html = { path = "../html", version ="^0.1.0", default-features = false } -dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} +dioxus-core = { path = "../core", version = "^0.1.3", default-features = false } +dioxus-html = { path = "../html", version = "^0.1.0", default-features = false } +dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } web-sys = { version = "0.3", features = [ "Attr", diff --git a/packages/ssr/CHANGELOG.md b/packages/ssr/CHANGELOG.md new file mode 100644 index 000000000..6b06fd248 --- /dev/null +++ b/packages/ssr/CHANGELOG.md @@ -0,0 +1,108 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.1.0 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + - big updates to the reference + +### New Features + + - upgrade syntax + - support innerhtml + - add more to ssr renderer + - massage lifetimes + - some docs, cleaning + - a new vnode type for anchors + - code quality improvements for core + - mvoe away from compound context + - wire up resource pool + - omg what a dumb mistake + - rebuild doesn't return errors + - add aria + - buff up html allowed attributes + - enable components in ssr + - static node infrastructure and ssr changes + - todomvc + +### Commit Statistics + + + + - 58 commits contributed to the release over the course of 333 calendar days. + - 58 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - fix ssr ([`ded9696`](https://github.comgit//DioxusLabs/dioxus/commit/ded9696930ec825e0aba990494790e8be43a73e5)) + - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) + - rename ([`36d89be`](https://github.comgit//DioxusLabs/dioxus/commit/36d89beb34821694cb0afb546d3b0cb4e01aaae1)) + - some docs and suspense ([`93d4b8c`](https://github.comgit//DioxusLabs/dioxus/commit/93d4b8ca7c1b133e5dba2a8dc9a310dbe1357001)) + - move examples around ([`1e6e5e6`](https://github.comgit//DioxusLabs/dioxus/commit/1e6e5e611b61571f272289adefc9cdd7d59c4399)) + - docs and router ([`a5f05d7`](https://github.comgit//DioxusLabs/dioxus/commit/a5f05d73acc0e47b05cff64a373482519414bc7c)) + - upgrade syntax ([`fd93ee8`](https://github.comgit//DioxusLabs/dioxus/commit/fd93ee89c19b085a04307ef30217170518defa8e)) + - support innerhtml ([`cfc24f5`](https://github.comgit//DioxusLabs/dioxus/commit/cfc24f5451cd2d1e9dcd5f1589ee50f705404110)) + - clean up and add lazy renderer ([`d4dcb17`](https://github.comgit//DioxusLabs/dioxus/commit/d4dcb175670f4cf8e51a25af8ddc584356c3d067)) + - add more to ssr renderer ([`63568c5`](https://github.comgit//DioxusLabs/dioxus/commit/63568c546c76375aa8acb0b8d2555727ef48edc4)) + - massage lifetimes ([`9726a06`](https://github.comgit//DioxusLabs/dioxus/commit/9726a065b0d4fb1ede5b53a2ddd58c855e51539f)) + - threadsafe ([`82953f2`](https://github.comgit//DioxusLabs/dioxus/commit/82953f2ac37913f83a822333acd0c47e20777d31)) + - ssr ([`71f0df6`](https://github.comgit//DioxusLabs/dioxus/commit/71f0df63745fe5c17468693144c552ea3a0a7101)) + - move macro crate out of core ([`7bdad1e`](https://github.comgit//DioxusLabs/dioxus/commit/7bdad1e2e6f67e74c9f67dde2150140cf8a090e8)) + - remove wildcards ([`10d335a`](https://github.comgit//DioxusLabs/dioxus/commit/10d335ae3112b6999b5b988fb5236032af30e1d0)) + - remove wildcard ([`ba8ced5`](https://github.comgit//DioxusLabs/dioxus/commit/ba8ced573caea6f55d47804c327d6a279d4733a6)) + - cleanup ([`1745a44`](https://github.comgit//DioxusLabs/dioxus/commit/1745a44d949b994b64ea1fb715cbe36963ae7027)) + - some ideas ([`05c909f`](https://github.comgit//DioxusLabs/dioxus/commit/05c909f320765aec1bf4c1c55ca59ffd5525a2c7)) + - websys dom working properly ([`cfa0247`](https://github.comgit//DioxusLabs/dioxus/commit/cfa0247cbb1233e1df275374a73f431650a9250f)) + - big updates to the reference ([`583fdfa`](https://github.comgit//DioxusLabs/dioxus/commit/583fdfa5618e11d660985b97e570d4503be2ff49)) + - docs, html! macro, more ([`caf772c`](https://github.comgit//DioxusLabs/dioxus/commit/caf772cf249d2f56c8d0b0fa2737ad48e32c6e82)) + - cleanup workspace ([`8f0bb5d`](https://github.comgit//DioxusLabs/dioxus/commit/8f0bb5dc5bfa3e775af567c4b569622cdd932af1)) + - some docs, cleaning ([`c321532`](https://github.comgit//DioxusLabs/dioxus/commit/c321532a6cef40b2d2e4adc8c7a55931b6755b08)) + - a new vnode type for anchors ([`d618092`](https://github.comgit//DioxusLabs/dioxus/commit/d618092e9d150589e61516f7bbb169f2db49d3f2)) + - fix styling for ssr ([`f14d4ef`](https://github.comgit//DioxusLabs/dioxus/commit/f14d4ef7c21fe9f60712deaded8e3db9a18353c0)) + - making progress on diffing and hydration ([`49856cc`](https://github.comgit//DioxusLabs/dioxus/commit/49856ccd6865f88d63765f26d27f7e945b554da0)) + - code quality improvements for core ([`00231ad`](https://github.comgit//DioxusLabs/dioxus/commit/00231adfa2e1d67a9d7ae2fa61c33e3a22d51978)) + - mvoe away from compound context ([`a2c7d17`](https://github.comgit//DioxusLabs/dioxus/commit/a2c7d17b0595769f60bc1c2bbf7cbe32cec37486)) + - wire up resource pool ([`31702db`](https://github.comgit//DioxusLabs/dioxus/commit/31702dbf878dd0207d101f7869ebefd2bb9f6860)) + - more work on suspense and documentation ([`37ed4be`](https://github.comgit//DioxusLabs/dioxus/commit/37ed4bed8cf28eb65465d41e15e8d758cb3d9679)) + - omg what a dumb mistake ([`f782e14`](https://github.comgit//DioxusLabs/dioxus/commit/f782e142118fb7acf1b88a0f3fbb03e4a5e3e91e)) + - solve some issues regarding listeners ([`dfaf5ad`](https://github.comgit//DioxusLabs/dioxus/commit/dfaf5adee164f44a679ab21d730caaab3610e01f)) + - move things into a "shared" object ([`f644d7c`](https://github.comgit//DioxusLabs/dioxus/commit/f644d7c44159eef091552dcc90acbb151ea76b21)) + - polish up some safety stuff and add suspense support in ([`ff1398b`](https://github.comgit//DioxusLabs/dioxus/commit/ff1398b943de14f7573ad13577e83500ed9c146e)) + - rebuild doesn't return errors ([`f457b71`](https://github.comgit//DioxusLabs/dioxus/commit/f457b7113129479cad577237ef21cb735fffe483)) + - add aria ([`4091846`](https://github.comgit//DioxusLabs/dioxus/commit/4091846934b4b3b2bc03d3ca8aaf7712aebd4e36)) + - more examples ([`56e7eb8`](https://github.comgit//DioxusLabs/dioxus/commit/56e7eb83a97ebd6d5bcd23464cfb9d718e5ac26d)) + - buff up html allowed attributes ([`c79d9ae`](https://github.comgit//DioxusLabs/dioxus/commit/c79d9ae674e235c8e9c2c069d24902122b9c7464)) + - it works but the page is backwards ([`cdcd861`](https://github.comgit//DioxusLabs/dioxus/commit/cdcd8611e87ffb5e24de7b9fe6c656af3053276e)) + - ssr + tide ([`269e81b`](https://github.comgit//DioxusLabs/dioxus/commit/269e81b0fdb32ae0706160cd278cf3a1b731387b)) + - enable components in ssr ([`bbcb5a0`](https://github.comgit//DioxusLabs/dioxus/commit/bbcb5a0234dbce48ffeb64903c3ec04562a87ad6)) + - static node infrastructure and ssr changes ([`9abb047`](https://github.comgit//DioxusLabs/dioxus/commit/9abb0470b7869019d539a2fc21da3872348ae38b)) + - back to vnode enum ([`64f289a`](https://github.comgit//DioxusLabs/dioxus/commit/64f289a61c18b6b4c1adf785a864171e51615780)) + - rename ctx to cx ([`81382e7`](https://github.comgit//DioxusLabs/dioxus/commit/81382e7044fb3dba61d4abb1e6086b7b29143116)) + - more work on updating syntad ([`47e8960`](https://github.comgit//DioxusLabs/dioxus/commit/47e896038ef3655566f3eda83d1d2adfefbc8862)) + - massive changes to definition of components ([`508c560`](https://github.comgit//DioxusLabs/dioxus/commit/508c560320d78730fa058156421523ffa5695d9d)) + - more progress on parity docs. ([`c5089ba`](https://github.comgit//DioxusLabs/dioxus/commit/c5089ba3c5a8daad4de4d6257604011cc87f6ac7)) + - dirty hack to enable send + sync on virtual dom ([`4d5c528`](https://github.comgit//DioxusLabs/dioxus/commit/4d5c528b07e61d6cb0ac8fc0c27ce2e0fdf7e7d2)) + - doesnt share on thread ([`fe67ff9`](https://github.comgit//DioxusLabs/dioxus/commit/fe67ff9fa4c9d5009670c922e192dccedb7cd09a)) + - remove old code ([`3de54d0`](https://github.comgit//DioxusLabs/dioxus/commit/3de54d0b5202aca678d485a68ef8de006a63e21b)) + - Clean up repo a bit ([`a99147c`](https://github.comgit//DioxusLabs/dioxus/commit/a99147c85b53b4ee336a94deee463d793cebf572)) + - todomvc ([`cfa0927`](https://github.comgit//DioxusLabs/dioxus/commit/cfa0927cdd40bc3dba22996018605dbad91d0391)) + - todomvc ([`ce33031`](https://github.comgit//DioxusLabs/dioxus/commit/ce33031519fbbbd207f1dffb75acf62bf59e3c9e)) + - building large apps, revamp macro ([`9f7f43b`](https://github.comgit//DioxusLabs/dioxus/commit/9f7f43b6614aaef2d7dded7058e81934f28f5dec)) + - include the helper ([`07341d2`](https://github.comgit//DioxusLabs/dioxus/commit/07341d2c65dc61b90587e2e5daadf72ec82623a8)) + - update fc_macro ([`28ac37a`](https://github.comgit//DioxusLabs/dioxus/commit/28ac37a8b23874c77011a46a11e6b9cbdf79ecdd)) + - more docs, example, mroe nodes ([`d13e04c`](https://github.comgit//DioxusLabs/dioxus/commit/d13e04c9ff4c2a98e295d762d631d47e0c762049)) +
+ diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 291164e27..09bb5df51 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -1,15 +1,30 @@ [package] name = "dioxus-ssr" version = "0.1.0" -authors = ["Jonathan Kelley "] +authors = ["Jonathan Kelley"] edition = "2018" description = "Dioxus render-to-string" license = "MIT/Apache-2.0" +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } [dev-dependencies] diff --git a/packages/web/CHANGELOG.md b/packages/web/CHANGELOG.md new file mode 100644 index 000000000..ff730ebd9 --- /dev/null +++ b/packages/web/CHANGELOG.md @@ -0,0 +1,260 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## v0.0.0 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + - lnks to projects + - big updates to the reference + - move around examples + +### New Features + + - bubbling + - upgrade syntax + - events bubble now + - support innerhtml + - massage lifetimes + - support desktop more completely + - add update functionality to useref + - shared state mechanisms + - a cute crm + - mutations + - select figured out + - re-enable suspense + - amazingly awesome error handling + - proper handling of events + - mvoe away from compound context + - make hooks free-functions + - omg what a dumb mistake + - suspense! + - bless up, no more segfaults + - more suspended nodes! + - move over to push based mechanism + - architecture document and edit list + - it loads the doggos + - task system works + but I broke the other things :( + - rebuild doesn't return errors + - static node infrastructure and ssr changes + - enable arbitrary body in rsx! macro + - add edits back! and more webview support! + This commit adds a new type - the DomEdit - for serializing the changes made by the diffing machine. The architecture of how DomEdits fit into the cooperative scheduling is still TBD but it will allow us to build change lists without applying them immediately. This is more performant and allows us to only render parts of the page at a time. + + This commit also adds more infrastructure around webview. Dioxus can now run on the web, generate static pages, run in the desktop, and run on mobile, with a large part of thanks to webview. + - move to slotmap + - integrate serialization and string borrowing + This commit adds lifetimes to the diff and realdom methods so consumers may borrow the contents of the DOM for serialization or asynchronous modifications. + - events work again! + - props memoization is more powerful + This commit solves the memoization , properly memoizing properties that don't have any generic parameters. This is a rough heuristic to prevent non-static lifetimes from creeping into props and breaking our minual lifetime management. + + Props that have a generic parameter are opted-out of the `partialeq` requirement and props *without* lifetimes must implement partialeq. We're going to leave manual disabling of memoization for future work. + - todomvc + - somewhat working with rc and weak + +### Bug Fixes + + - all the bugs! + - append isnt backwards + +### Performance + + - remove global allocation for props + +### Commit Statistics + + + + - 173 commits contributed to the release over the course of 334 calendar days. + - 169 commits where understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' where seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) + - go back to noisy lifetime solution ([`8daf7a6`](https://github.comgit//DioxusLabs/dioxus/commit/8daf7a6ed86df72522b089aa2647eea7bee0f3b6)) + - clean up the core crate ([`e6c6bbd`](https://github.comgit//DioxusLabs/dioxus/commit/e6c6bbdc1ec6a8c251b78c05ca104f006b6fad26)) + - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) + - bubbling ([`19df1bd`](https://github.comgit//DioxusLabs/dioxus/commit/19df1bda109aba03c40ff631263bcb7035004ca0)) + - some docs and suspense ([`93d4b8c`](https://github.comgit//DioxusLabs/dioxus/commit/93d4b8ca7c1b133e5dba2a8dc9a310dbe1357001)) + - move examples around ([`1e6e5e6`](https://github.comgit//DioxusLabs/dioxus/commit/1e6e5e611b61571f272289adefc9cdd7d59c4399)) + - docs and router ([`a5f05d7`](https://github.comgit//DioxusLabs/dioxus/commit/a5f05d73acc0e47b05cff64a373482519414bc7c)) + - upgrade syntax ([`fd93ee8`](https://github.comgit//DioxusLabs/dioxus/commit/fd93ee89c19b085a04307ef30217170518defa8e)) + - events bubble now ([`f223406`](https://github.comgit//DioxusLabs/dioxus/commit/f2234068ba7cd915a00a81e41660d7d6ee1177cc)) + - support innerhtml ([`cfc24f5`](https://github.comgit//DioxusLabs/dioxus/commit/cfc24f5451cd2d1e9dcd5f1589ee50f705404110)) + - massage lifetimes ([`9726a06`](https://github.comgit//DioxusLabs/dioxus/commit/9726a065b0d4fb1ede5b53a2ddd58c855e51539f)) + - move everything over to a stack dst ([`0e9d5fc`](https://github.comgit//DioxusLabs/dioxus/commit/0e9d5fc5306ab508d5af6999a4064f9b8b48460f)) + - event system ([`1f22a06`](https://github.comgit//DioxusLabs/dioxus/commit/1f22a06a36f72073188b8c9009dd4950b3f4ff9a)) + - support desktop more completely ([`efd0e9b`](https://github.comgit//DioxusLabs/dioxus/commit/efd0e9b5648c809057f339083ba9d454f810d483)) + - add update functionality to useref ([`a2b0c50`](https://github.comgit//DioxusLabs/dioxus/commit/a2b0c50a343005c63c7032bcefb8323b78350bb9)) + - lnks to projects ([`460783a`](https://github.comgit//DioxusLabs/dioxus/commit/460783ad549818a85db634ed9c39ffce210b98ec)) + - overhaul event system ([`7a03c1d`](https://github.comgit//DioxusLabs/dioxus/commit/7a03c1d2b48590276b182465679387655fe08f3a)) + - threadsafe ([`82953f2`](https://github.comgit//DioxusLabs/dioxus/commit/82953f2ac37913f83a822333acd0c47e20777d31)) + - all the bugs! ([`478255f`](https://github.comgit//DioxusLabs/dioxus/commit/478255f40d4de1d2e3f3cc9b6d758b30ff394b39)) + - ssr ([`71f0df6`](https://github.comgit//DioxusLabs/dioxus/commit/71f0df63745fe5c17468693144c552ea3a0a7101)) + - shared state mechanisms ([`4a4c7af`](https://github.comgit//DioxusLabs/dioxus/commit/4a4c7afca7e1beadd4b213214074fdb420eb0923)) + - fix web list issue ([`da4423c`](https://github.comgit//DioxusLabs/dioxus/commit/da4423c141f1f376df5f3f2580e5284831744a7e)) + - move macro crate out of core ([`7bdad1e`](https://github.comgit//DioxusLabs/dioxus/commit/7bdad1e2e6f67e74c9f67dde2150140cf8a090e8)) + - clean up to web ([`b43a964`](https://github.comgit//DioxusLabs/dioxus/commit/b43a964f982eb871195278a093cc214c3a8ad66d)) + - clean up the web module ([`823adc0`](https://github.comgit//DioxusLabs/dioxus/commit/823adc0834b581327aee745c72ce8993f0bba5aa)) + - slightly simplify crm ([`f07e345`](https://github.comgit//DioxusLabs/dioxus/commit/f07e345eb2a2e4197270396dffebc85c65272fe0)) + - fix some event stuff for web and core ([`725b4a1`](https://github.comgit//DioxusLabs/dioxus/commit/725b4a1d7f5d629b1b0a163b65bfd93b2f8a151b)) + - a cute crm ([`718fa14`](https://github.comgit//DioxusLabs/dioxus/commit/718fa14b45df38b40b0c0dff7bdc923cba57026b)) + - on collaborative scheduling ([`1a32383`](https://github.comgit//DioxusLabs/dioxus/commit/1a323835c8c4f667e5744bbf5447776f1dc51fca)) + - examples ([`1a2f91e`](https://github.comgit//DioxusLabs/dioxus/commit/1a2f91ed91c13dae553ecde585462ab261b1b95d)) + - mutations ([`fac4233`](https://github.comgit//DioxusLabs/dioxus/commit/fac42339c272b0e430ebf4f31b6061a0635d3e19)) + - performance looks good, needs more testing ([`4b6ca05`](https://github.comgit//DioxusLabs/dioxus/commit/4b6ca05f2c3ad647842c858967da9c87f1915825)) + - add test_dom ([`a652090`](https://github.comgit//DioxusLabs/dioxus/commit/a652090dc5708db334fa7430fededb1bac207880)) + - bottom up dropping ([`f2334c1`](https://github.comgit//DioxusLabs/dioxus/commit/f2334c17be2612d926361686d7d40a57e3ffe9b9)) + - cleanup ([`1745a44`](https://github.comgit//DioxusLabs/dioxus/commit/1745a44d949b994b64ea1fb715cbe36963ae7027)) + - select figured out ([`84b5ddd`](https://github.comgit//DioxusLabs/dioxus/commit/84b5ddded57238a64e966ec07334e6f9bd86ecf8)) + - re-enable suspense ([`687cda1`](https://github.comgit//DioxusLabs/dioxus/commit/687cda1b6d9595357d1dc8720ebe921f61098d8f)) + - fill out the snippets ([`6051b0e`](https://github.comgit//DioxusLabs/dioxus/commit/6051b0ec86927704451f4ce6cdf8f988e59702ae)) + - amazingly awesome error handling ([`4a72b31`](https://github.comgit//DioxusLabs/dioxus/commit/4a72b3140bd244da602deada1eeecded65ff5848)) + - some ideas ([`05c909f`](https://github.comgit//DioxusLabs/dioxus/commit/05c909f320765aec1bf4c1c55ca59ffd5525a2c7)) + - proper handling of events ([`d7940aa`](https://github.comgit//DioxusLabs/dioxus/commit/d7940aa2ac2017316d62e0f2eac0701dc6ad1f09)) + - websys dom working properly ([`cfa0247`](https://github.comgit//DioxusLabs/dioxus/commit/cfa0247cbb1233e1df275374a73f431650a9250f)) + - big updates to the reference ([`583fdfa`](https://github.comgit//DioxusLabs/dioxus/commit/583fdfa5618e11d660985b97e570d4503be2ff49)) + - broken diff ([`f15e1fa`](https://github.comgit//DioxusLabs/dioxus/commit/f15e1fa892070f9cf1fc627eb9c36fbaa0dc309b)) + - cleanup workspace ([`8f0bb5d`](https://github.comgit//DioxusLabs/dioxus/commit/8f0bb5dc5bfa3e775af567c4b569622cdd932af1)) + - changes to scheduler ([`098d382`](https://github.comgit//DioxusLabs/dioxus/commit/098d3821ed89ad38d99077a6556b48a7e91fc3fc)) + - web stuff ([`acad9ca`](https://github.comgit//DioxusLabs/dioxus/commit/acad9ca622748f96599dd02ad22aaeaae3621b76)) + - making progress on diffing and hydration ([`49856cc`](https://github.comgit//DioxusLabs/dioxus/commit/49856ccd6865f88d63765f26d27f7e945b554da0)) + - mvoe away from compound context ([`a2c7d17`](https://github.comgit//DioxusLabs/dioxus/commit/a2c7d17b0595769f60bc1c2bbf7cbe32cec37486)) + - make hooks free-functions ([`e5c88fe`](https://github.comgit//DioxusLabs/dioxus/commit/e5c88fe3a49649ecb308decd14c2557963978619)) + - more work on suspense and documentation ([`37ed4be`](https://github.comgit//DioxusLabs/dioxus/commit/37ed4bed8cf28eb65465d41e15e8d758cb3d9679)) + - omg what a dumb mistake ([`f782e14`](https://github.comgit//DioxusLabs/dioxus/commit/f782e142118fb7acf1b88a0f3fbb03e4a5e3e91e)) + - suspense! ([`4837d8e`](https://github.comgit//DioxusLabs/dioxus/commit/4837d8e741343d26f31b55e4478a374dc761e538)) + - refactor ([`8b0eb87`](https://github.comgit//DioxusLabs/dioxus/commit/8b0eb87c72ea9d444dee99a8b05643f19fea2634)) + - bless up, no more segfaults ([`4a0068f`](https://github.comgit//DioxusLabs/dioxus/commit/4a0068f09918adbc299150edcf777f342ced0dd3)) + - more suspended nodes! ([`de9f61b`](https://github.comgit//DioxusLabs/dioxus/commit/de9f61bcf48c0d6e35e46c337b72a713c9f9f7d2)) + - more docs ([`34c3107`](https://github.comgit//DioxusLabs/dioxus/commit/34c3107418df89620cb9dfbd9300f89a1fe6e68f)) + - basic support for scheduled rendering ([`c52af22`](https://github.comgit//DioxusLabs/dioxus/commit/c52af221f755601a9e826ffc2c355def138999d0)) + - move over to push based mechanism ([`80e6c25`](https://github.comgit//DioxusLabs/dioxus/commit/80e6c256980eb3e8c32e30f3dbb43c8b3b9a9cf4)) + - solve some issues regarding listeners ([`dfaf5ad`](https://github.comgit//DioxusLabs/dioxus/commit/dfaf5adee164f44a679ab21d730caaab3610e01f)) + - architecture document and edit list ([`e723876`](https://github.comgit//DioxusLabs/dioxus/commit/e7238762ae518c5688f9339d11832d17f99ad553)) + - move to slab ([`6084fbc`](https://github.comgit//DioxusLabs/dioxus/commit/6084fbcd11d1669db135098d920488e2c01a7014)) + - change in cx to cx ([`9971ff2`](https://github.comgit//DioxusLabs/dioxus/commit/9971ff215db6f771b7ec1cae2517c85d47d38622)) + - move things into a "shared" object ([`f644d7c`](https://github.comgit//DioxusLabs/dioxus/commit/f644d7c44159eef091552dcc90acbb151ea76b21)) + - it loads the doggos ([`abf4759`](https://github.comgit//DioxusLabs/dioxus/commit/abf47596bc2c092bd2f646a77807728416159ad4)) + - task system works ([`3a57b94`](https://github.comgit//DioxusLabs/dioxus/commit/3a57b942624afb8aa6650aeee05466c3c9ce967e)) + - more overhaul on virtualevents ([`41cc429`](https://github.comgit//DioxusLabs/dioxus/commit/41cc42919d42453f8f2560aa852211364af4ad3d)) + - more work on web ([`3bf19d8`](https://github.comgit//DioxusLabs/dioxus/commit/3bf19d8106e0cca7749b7346e9b0adfce654d782)) + - ricraf polyfill ([`59219b9`](https://github.comgit//DioxusLabs/dioxus/commit/59219b9ef22caa5896046ccaabc8a225cc4b5a53)) + - ....sigh..... so the diffing algorithm is robust ([`68ed1c0`](https://github.comgit//DioxusLabs/dioxus/commit/68ed1c04e7e773f9e6c0a5148f0ea89b97b6784e)) + - remove global allocation for props ([`8b3ac0b`](https://github.comgit//DioxusLabs/dioxus/commit/8b3ac0b57ca073c1451e8d5df93882c9360ca52a)) + - ric_raf wired up ([`8b0d04c`](https://github.comgit//DioxusLabs/dioxus/commit/8b0d04ce585596f561f15e92fc087e2c7063eb07)) + - rebuild doesn't return errors ([`f457b71`](https://github.comgit//DioxusLabs/dioxus/commit/f457b7113129479cad577237ef21cb735fffe483)) + - more examples ([`56e7eb8`](https://github.comgit//DioxusLabs/dioxus/commit/56e7eb83a97ebd6d5bcd23464cfb9d718e5ac26d)) + - tests and documentation ([`da81591`](https://github.comgit//DioxusLabs/dioxus/commit/da8159190b84d13caa9dfe7dea385a809cf84199)) + - append isnt backwards ([`df8aa77`](https://github.comgit//DioxusLabs/dioxus/commit/df8aa77198712559f72bef093d064e03b2a5245a)) + - it works but the page is backwards ([`cdcd861`](https://github.comgit//DioxusLabs/dioxus/commit/cdcd8611e87ffb5e24de7b9fe6c656af3053276e)) + - static node infrastructure and ssr changes ([`9abb047`](https://github.comgit//DioxusLabs/dioxus/commit/9abb0470b7869019d539a2fc21da3872348ae38b)) + - more refactor for async ([`975fa56`](https://github.comgit//DioxusLabs/dioxus/commit/975fa566f9809f8fa2bb0bdb07fbfc7f855dcaeb)) + - enable arbitrary body in rsx! macro ([`7aec40d`](https://github.comgit//DioxusLabs/dioxus/commit/7aec40d57e78ec13ff3a90ca8149521cbf1d9ff2)) + - working on async diff ([`f41cff5`](https://github.comgit//DioxusLabs/dioxus/commit/f41cff571fd11bb00820c0bf9d147e81ed5a6a53)) + - move some examples around ([`98a0933`](https://github.comgit//DioxusLabs/dioxus/commit/98a09339fd3190799ea4dd316908f0a53fdf2413)) + - fix issues with lifetimes ([`a38a81e`](https://github.comgit//DioxusLabs/dioxus/commit/a38a81e1290375cae685f7c49d3745e4298fab26)) + - groundwork for noderefs ([`c1afeba`](https://github.comgit//DioxusLabs/dioxus/commit/c1afeba1efb1a063705466a14648beee08cacb86)) + - more examples ([`11f89e5`](https://github.comgit//DioxusLabs/dioxus/commit/11f89e5d338d14a7aeece0a6275c24ae65913ce7)) + - add edits back! and more webview support! ([`904b26f`](https://github.comgit//DioxusLabs/dioxus/commit/904b26f7111c3fc66400744ff6192e4b20bf6d74)) + - enable more diffing ([`e8f29a8`](https://github.comgit//DioxusLabs/dioxus/commit/e8f29a8f8ac56020bee0048021efa52547307a77)) + - example ([`eb39b00`](https://github.comgit//DioxusLabs/dioxus/commit/eb39b000d7f0ef16d0b83ec44d3926f4690fd08f)) + - wip ([`952a91d`](https://github.comgit//DioxusLabs/dioxus/commit/952a91d5408aaf789b496f11d01c3b3f7fcf9059)) + - integrate signals ([`93900aa`](https://github.comgit//DioxusLabs/dioxus/commit/93900aac4443db2e63631ed928294af74201a9ff)) + - move to slotmap ([`7665f2c`](https://github.comgit//DioxusLabs/dioxus/commit/7665f2c6cf05cea64bb9131381d4ac11cbdeb932)) + - integrate serialization and string borrowing ([`f4fb5bb`](https://github.comgit//DioxusLabs/dioxus/commit/f4fb5bb454536d9f108c7e276ce98a8924ab45e1)) + - more work on diffing machine ([`9813f23`](https://github.comgit//DioxusLabs/dioxus/commit/9813f23cdf7b32bc058771c91db3f182d6224905)) + - rename ctx to cx ([`81382e7`](https://github.comgit//DioxusLabs/dioxus/commit/81382e7044fb3dba61d4abb1e6086b7b29143116)) + - move around examples ([`70cd46d`](https://github.comgit//DioxusLabs/dioxus/commit/70cd46dbb2a689ae2d512e142b8aee9c80798430)) + - start moving events to rc ([`b9ff95f`](https://github.comgit//DioxusLabs/dioxus/commit/b9ff95fa12c46365fe73b64a4926a506d5da2342)) + - rename recoil to atoms ([`36ea39a`](https://github.comgit//DioxusLabs/dioxus/commit/36ea39ae30aa3f1fb2d718c0fdf08850c6bfd3ac)) + - more examples and docs ([`7fbaf69`](https://github.comgit//DioxusLabs/dioxus/commit/7fbaf69cabbdde712bb3fd9e4b2a5dc18b9390e9)) + - more work on updating syntad ([`47e8960`](https://github.comgit//DioxusLabs/dioxus/commit/47e896038ef3655566f3eda83d1d2adfefbc8862)) + - some cleanup and documentation ([`517d7f1`](https://github.comgit//DioxusLabs/dioxus/commit/517d7f14957c4dae9fc894bfbdcd00a955d09f20)) + - docs ([`f5683a2`](https://github.comgit//DioxusLabs/dioxus/commit/f5683a23464992ecace463a61414795b5a2c58c8)) + - pre vnodes instead of vnode ([`fe6938c`](https://github.comgit//DioxusLabs/dioxus/commit/fe6938ceb3dba0796ae8bab52ae41248dc0d3650)) + - events work again! ([`9d7ee79`](https://github.comgit//DioxusLabs/dioxus/commit/9d7ee79826a3b3fb952a70abcbb16dcd3363d2fb)) + - props memoization is more powerful ([`73047fe`](https://github.comgit//DioxusLabs/dioxus/commit/73047fe95678d50fcfd62a4ace7c6b406c5304e1)) + - massive changes to definition of components ([`508c560`](https://github.comgit//DioxusLabs/dioxus/commit/508c560320d78730fa058156421523ffa5695d9d)) + - moving to IDs ([`79127ea`](https://github.comgit//DioxusLabs/dioxus/commit/79127ea6cdabf62bf91e777aaacb563e3aa5e619)) + - move to static props ([`c1fd848`](https://github.comgit//DioxusLabs/dioxus/commit/c1fd848f89b0146581d8e485fa0d4a847387b963)) + - doesnt share on thread ([`fe67ff9`](https://github.comgit//DioxusLabs/dioxus/commit/fe67ff9fa4c9d5009670c922e192dccedb7cd09a)) + - parity document ([`ba97541`](https://github.comgit//DioxusLabs/dioxus/commit/ba975410f9fe2a5b3a0e407f6a2478bf86577f29)) + - recoil ([`ee67654`](https://github.comgit//DioxusLabs/dioxus/commit/ee67654f58aecca91c640fc49451d0b99bc05981)) + - buff the readme and docs ([`3cfa1fe`](https://github.comgit//DioxusLabs/dioxus/commit/3cfa1fe125886787f35905ed9b05340a739bc654)) + - Todomvc in progress ([`b843dbd`](https://github.comgit//DioxusLabs/dioxus/commit/b843dbd3679abf86a34347d87fd4ce5fe9e2aca5)) + - introduce children for walking down the tree ([`0d44f00`](https://github.comgit//DioxusLabs/dioxus/commit/0d44f009b0176cb9cf8203374cf534f5af7de63c)) + - Clean up repo a bit ([`a99147c`](https://github.comgit//DioxusLabs/dioxus/commit/a99147c85b53b4ee336a94deee463d793cebf572)) + - some code health ([`c28697e`](https://github.comgit//DioxusLabs/dioxus/commit/c28697e1fe3136d1835f2b663715f34aab9f4b17)) + - major overhaul to diffing ([`9810fee`](https://github.comgit//DioxusLabs/dioxus/commit/9810feebf57f93114e3d7faf6de053ac192593a9)) + - Wip ([`c809095`](https://github.comgit//DioxusLabs/dioxus/commit/c809095124d06175e7f49853c34e48d7335573c5)) + - refactor a bit ([`2eeb8f2`](https://github.comgit//DioxusLabs/dioxus/commit/2eeb8f2386409b53836fab687097d89af7b883c3)) + - todos ([`8c541f6`](https://github.comgit//DioxusLabs/dioxus/commit/8c541f66d5f7ef2286f2cdf9b0496a9c404471f9)) + - todomvc ([`cfa0927`](https://github.comgit//DioxusLabs/dioxus/commit/cfa0927cdd40bc3dba22996018605dbad91d0391)) + - todomvc ([`ce33031`](https://github.comgit//DioxusLabs/dioxus/commit/ce33031519fbbbd207f1dffb75acf62bf59e3c9e)) + - more ergonomics, more examples ([`0bcff1f`](https://github.comgit//DioxusLabs/dioxus/commit/0bcff1f88e4b1a633b7a9b7c6c2e39b8bd3666c4)) + - building large apps, revamp macro ([`9f7f43b`](https://github.comgit//DioxusLabs/dioxus/commit/9f7f43b6614aaef2d7dded7058e81934f28f5dec)) + - more liveview and webview custom client ([`9b560df`](https://github.comgit//DioxusLabs/dioxus/commit/9b560dfedb988b258f5c564986759cb83730a96c)) + - livehost bones ([`7856f2b`](https://github.comgit//DioxusLabs/dioxus/commit/7856f2b1537b52478a6fa1ca55d0a8c5793a91e5)) + - some stuff related to event listeners. POC for lifecyel ([`5b7887d`](https://github.comgit//DioxusLabs/dioxus/commit/5b7887d76c714d11e0cea5207197ffaac856a0a7)) + - diffing approach slightly broken ([`4e48e05`](https://github.comgit//DioxusLabs/dioxus/commit/4e48e0514e1caed9f60bcac4048114008ac76439)) + - remove old macro ([`9d0727e`](https://github.comgit//DioxusLabs/dioxus/commit/9d0727edabbf759dac8a3cffabd7103d08b728c1)) + - add deeply neste example ([`e66827e`](https://github.comgit//DioxusLabs/dioxus/commit/e66827ec92e23bf0602f92d5223894a7831dfd0f)) + - update examples ([`39bd185`](https://github.comgit//DioxusLabs/dioxus/commit/39bd1856f4d7c2364d6ca2c7812ab5d6e71252b9)) + - ensure mutabality is okay when not double-using the components ([`305ff91`](https://github.comgit//DioxusLabs/dioxus/commit/305ff919effa919ff7ea5db2a71cf21eca106588)) + - somewhat working with rc and weak ([`d4f1cea`](https://github.comgit//DioxusLabs/dioxus/commit/d4f1ceaffbc0551ea3b179a101885275690cebec)) + - foregin eq from comparapable comp type. ([`ec801ea`](https://github.comgit//DioxusLabs/dioxus/commit/ec801eab167f9be5325ab877e74e2b65d501e129)) + - staticify? ([`5ad8188`](https://github.comgit//DioxusLabs/dioxus/commit/5ad81885e499bf02ac79e0098f7956d02ee5f2e5)) + - Feat: it's awersome ([`8dc2619`](https://github.comgit//DioxusLabs/dioxus/commit/8dc26195e274874a7de6c806372f9f77a5c82c5d)) + - yeet, synthetic somewhat wired up ([`d959806`](https://github.comgit//DioxusLabs/dioxus/commit/d9598066c2679d9d0b9ca0ce1d3f26110a238cd2)) + - remove FC ([`92d9521`](https://github.comgit//DioxusLabs/dioxus/commit/92d9521a73aefb620b354ae5954617109dd06e7e)) + - more cleanup ([`5a9155b`](https://github.comgit//DioxusLabs/dioxus/commit/5a9155b059acc1fb3c8b8accbeca3701ce4f0ab6)) + - add context to builder ([`cf16090`](https://github.comgit//DioxusLabs/dioxus/commit/cf16090838d127354e333dcbc0b06474835b87d6)) + - listeners now have scope information ([`fcd68e6`](https://github.comgit//DioxusLabs/dioxus/commit/fcd68e61d2400628469ba193b009e7bf1fd3acdf)) + - broken, but solved ([`cb74d70`](https://github.comgit//DioxusLabs/dioxus/commit/cb74d70f831b5510f1ee191d91eaff621ffa6256)) + - accept closures directly in handler ([`f225030`](https://github.comgit//DioxusLabs/dioxus/commit/f225030506967415a21f4af0372477cb5224ee7c)) + - bug that phantom triggered events ([`07f671c`](https://github.comgit//DioxusLabs/dioxus/commit/07f671c8e19a2a2e90afc3db94c4edebcfffe982)) + - wowza got it all working ([`4b8e9f4`](https://github.comgit//DioxusLabs/dioxus/commit/4b8e9f4a125b9d55439d919786f33d9d5df234e8)) + - update readme and examples ([`ffaf687`](https://github.comgit//DioxusLabs/dioxus/commit/ffaf6878963981860089c2362947bf77a84c9058)) + - view -> render ([`c8bb392`](https://github.comgit//DioxusLabs/dioxus/commit/c8bb392cadb22ddb41e53a776ab0677945579a9c)) + - bump core version ([`6fabd8c`](https://github.comgit//DioxusLabs/dioxus/commit/6fabd8ccc87c0b30a95693e85b98bdb4e2b1a936)) + - update and prep for dioxusweb ([`ab655ea`](https://github.comgit//DioxusLabs/dioxus/commit/ab655eac97fcd9ea3542edbdea4c6cf9a06956fd)) + - a few bugs, but the event system works! ([`3b30fa6`](https://github.comgit//DioxusLabs/dioxus/commit/3b30fa61b8f1927f22ffec373a3405ddfdefde39)) + - moving to CbIdx as serializable event system ([`e840f47`](https://github.comgit//DioxusLabs/dioxus/commit/e840f472faf25d8e1d65abeb610daed6a522771d)) + - custom format_args for inlining variables into html templates ([`e4b1f6e`](https://github.comgit//DioxusLabs/dioxus/commit/e4b1f6ea0d0db707cf757dabf8635e9fc91a3e0f)) + - begin WIP on html macro ([`a8b1225`](https://github.comgit//DioxusLabs/dioxus/commit/a8b1225c4853a61c7862e1a33eba64b8ed4e06d5)) + - move webview logic into library ([`32b45e5`](https://github.comgit//DioxusLabs/dioxus/commit/32b45e5ba168390e338a343eef6baba5cca9468b)) + - comments ([`18a7a1f`](https://github.comgit//DioxusLabs/dioxus/commit/18a7a1f9c40eb3b1ac263cbd21b1daa6da9c7093)) + - buff up examples and docs ([`8d3e2ad`](https://github.comgit//DioxusLabs/dioxus/commit/8d3e2ade7aef491921bb51f0d35b7253bbc800f8)) + - wire up rebuild ([`06ae4fc`](https://github.comgit//DioxusLabs/dioxus/commit/06ae4fc17833ff9695b0645f940b5ea32eeb4ef0)) + - update websys with lifecycle ([`4d01455`](https://github.comgit//DioxusLabs/dioxus/commit/4d01455729dac55cf049c50f47a511190d13550e)) + - fix internal lifecycle ([`5204862`](https://github.comgit//DioxusLabs/dioxus/commit/5204862bc220e55afe8d2f8f4422cb530a6ea1cf)) + - add css example ([`edf09c1`](https://github.comgit//DioxusLabs/dioxus/commit/edf09c1892f2521f41bf84372629e84bed86e921)) + - WIP ctx ([`7a6aabe`](https://github.comgit//DioxusLabs/dioxus/commit/7a6aabe4f39aa38bec7b548d030c11b2d9f481cb)) + - desktop app wired up ([`b3e6886`](https://github.comgit//DioxusLabs/dioxus/commit/b3e68863514a33291556ce278b7255fdf53e8b50)) + - re-enable stack machine approach ([`e3ede7f`](https://github.comgit//DioxusLabs/dioxus/commit/e3ede7fcbf7acb5d8762bcddb5f1499104bb0ce7)) + - WIP on deserialize ([`f22ff83`](https://github.comgit//DioxusLabs/dioxus/commit/f22ff8319078d283e675ff8dc735da5bf8efe0df)) + - web example + cli writes to browser screen! ([`8439994`](https://github.comgit//DioxusLabs/dioxus/commit/84399948596c573883bd29786edee48f5d4ef438)) + - wire up a very basic dom updater ([`c4e8d8b`](https://github.comgit//DioxusLabs/dioxus/commit/c4e8d8bb31d54d70c8da2f4a5e3e3926ff7df92b)) + - major overhaul to diffing, using a "diffing machine" now ([`4dfdf91`](https://github.comgit//DioxusLabs/dioxus/commit/4dfdf9123608c69b86a56acbd6d8810b0cf1918c)) + - remove generic paramter on VDOM ([`4c291a0`](https://github.comgit//DioxusLabs/dioxus/commit/4c291a0efdbaadf5c2212248367c0a78046e2f83)) + - wire up some of the changelist for diff ([`d063a19`](https://github.comgit//DioxusLabs/dioxus/commit/d063a199391383288e807ac03d333091bac6ba60)) + - event loop ([`ea2aa4b`](https://github.comgit//DioxusLabs/dioxus/commit/ea2aa4b0c97b3292178284e05756d1415902a9e2)) + - Dioxus-webview ([`9c01736`](https://github.comgit//DioxusLabs/dioxus/commit/9c0173689539210d14847613f9a1694e6cb34506)) + - more docs, dissolve vnode crate into dioxus-core ([`9c616ea`](https://github.comgit//DioxusLabs/dioxus/commit/9c616ea5c092a756a437ccf175c8b04ada50b1b6)) + - WIP ([`ce34d0d`](https://github.comgit//DioxusLabs/dioxus/commit/ce34d0dfcda82d847a6032f8f42749b39e0fba18)) +
+ diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index 264e14542..88aba781a 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -1,14 +1,29 @@ [package] name = "dioxus-web" version = "0.0.0" -authors = ["Jonathan Kelley "] +authors = ["Jonathan Kelley"] edition = "2018" description = "Dioxus VirtualDOM renderer for the web browser using websys" license = "MIT/Apache-2.0" +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = [ + "dom", + "ui", + "user interface", + "gui", + "react", + "state", + "management", + "wasm", + "web", + "ssr", +] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3"} +dioxus-core = { path = "../core", version = "^0.1.3" } dioxus-html = { path = "../html" } js-sys = "0.3" # wasm-bindgen-shared = { path = "../../../Tinkering/wasm-bindgen/crates/shared" } From 3a706ac4168db137723bea90d7a0058190adfc3c Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 16:04:30 -0500 Subject: [PATCH 08/21] Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 --- Cargo.toml | 2 +- packages/core-macro/CHANGELOG.md | 6 ++++-- packages/core/CHANGELOG.md | 7 +++++-- packages/core/Cargo.toml | 2 +- packages/desktop/CHANGELOG.md | 7 +++++-- packages/desktop/Cargo.toml | 2 +- packages/hooks/CHANGELOG.md | 6 ++++-- packages/html/CHANGELOG.md | 7 +++++-- packages/html/Cargo.toml | 2 +- packages/liveview/CHANGELOG.md | 6 ++++-- packages/mobile/CHANGELOG.md | 7 +++++-- packages/mobile/Cargo.toml | 2 +- packages/router/CHANGELOG.md | 7 +++++-- packages/router/Cargo.toml | 6 +++--- packages/ssr/CHANGELOG.md | 7 +++++-- packages/ssr/Cargo.toml | 2 +- packages/web/CHANGELOG.md | 7 +++++-- packages/web/Cargo.toml | 2 +- 18 files changed, 57 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b8470ecb6..473e98884 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "./packages/core", version = "^0.1.3" } +dioxus-core = { path = "./packages/core", version ="^0.1.3"} dioxus-router = { path = "./packages/router", optional = true } dioxus-core-macro = { path = "./packages/core-macro", optional = true } dioxus-html = { path = "./packages/html", optional = true } diff --git a/packages/core-macro/CHANGELOG.md b/packages/core-macro/CHANGELOG.md index e4cfeebed..3a14ae345 100644 --- a/packages/core-macro/CHANGELOG.md +++ b/packages/core-macro/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - big updates to the reference - examples - more work on docs + - update cargo tomls ### New Features @@ -53,8 +54,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 107 commits contributed to the release over the course of 329 calendar days. - - 103 commits where understood as [conventional](https://www.conventionalcommits.org). + - 108 commits contributed to the release over the course of 329 calendar days. + - 104 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -64,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - docs ([`8814977`](https://github.comgit//DioxusLabs/dioxus/commit/8814977eeebe06748a3b9677a8070e42a037ebd7)) - polish ([`8bf57dc`](https://github.comgit//DioxusLabs/dioxus/commit/8bf57dc21dfbcbae5b95650203b68d3f41227652)) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 36922f13a..629c85532 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - move around examples - move into a fromjs tutorial - add some more sources in the core implementation + - update cargo tomls ### New Features @@ -120,8 +121,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 393 commits contributed to the release over the course of 335 calendar days. - - 380 commits where understood as [conventional](https://www.conventionalcommits.org). + - 395 commits contributed to the release over the course of 335 calendar days. + - 381 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -131,6 +132,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - fix table ([`e495b09`](https://github.comgit//DioxusLabs/dioxus/commit/e495b09bf1c99950b5ea8647b371f296dc64afbe)) - fix ssr ([`ded9696`](https://github.comgit//DioxusLabs/dioxus/commit/ded9696930ec825e0aba990494790e8be43a73e5)) diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 5da0536a6..5c6b55563 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -62,7 +62,7 @@ dioxus-html = { path = "../html" } fern = { version = "0.6.0", features = ["colored"] } rand = { version = "0.8.4", features = ["small_rng"] } simple_logger = "1.13.0" -dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } +dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} # dioxus-hooks = { path = "../hooks" } criterion = "0.3.5" diff --git a/packages/desktop/CHANGELOG.md b/packages/desktop/CHANGELOG.md index 03b66488e..524a325a0 100644 --- a/packages/desktop/CHANGELOG.md +++ b/packages/desktop/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - update local examples and docs to support new syntaxes - lnks to projects + - update cargo tomls ### New Features @@ -40,8 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 51 commits contributed to the release over the course of 128 calendar days. - - 49 commits where understood as [conventional](https://www.conventionalcommits.org). + - 53 commits contributed to the release over the course of 128 calendar days. + - 50 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -51,6 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) - polish ([`8bf57dc`](https://github.comgit//DioxusLabs/dioxus/commit/8bf57dc21dfbcbae5b95650203b68d3f41227652)) diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index 53407d549..ddef426c5 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -23,7 +23,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md index e9c3cec5c..4a16fa5d7 100644 --- a/packages/hooks/CHANGELOG.md +++ b/packages/hooks/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - big updates to the reference - move around examples - move into a fromjs tutorial + - update cargo tomls ### New Features @@ -39,8 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 59 commits contributed to the release over the course of 335 calendar days. - - 57 commits where understood as [conventional](https://www.conventionalcommits.org). + - 60 commits contributed to the release over the course of 335 calendar days. + - 58 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -50,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - docs ([`3ddf395`](https://github.comgit//DioxusLabs/dioxus/commit/3ddf395772aa24d04cf4e35bbb3a0027c8f1c7dd)) - remove portals completely ([`2fd56e7`](https://github.comgit//DioxusLabs/dioxus/commit/2fd56e76192bc70d5503bfcd6b4127d383dd082c)) diff --git a/packages/html/CHANGELOG.md b/packages/html/CHANGELOG.md index 06215f01e..a9d4df17b 100644 --- a/packages/html/CHANGELOG.md +++ b/packages/html/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - update readme - big updates to the reference + - update cargo tomls ### New Features @@ -34,8 +35,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 34 commits contributed to the release over the course of 160 calendar days. - - 32 commits where understood as [conventional](https://www.conventionalcommits.org). + - 36 commits contributed to the release over the course of 160 calendar days. + - 33 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -45,6 +46,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - bump versions ([`0846d93`](https://github.comgit//DioxusLabs/dioxus/commit/0846d93d41c27464ca271757c6f24a2cef8fb997)) - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) - polish ([`8bf57dc`](https://github.comgit//DioxusLabs/dioxus/commit/8bf57dc21dfbcbae5b95650203b68d3f41227652)) diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index b341f3ee6..99cf83e21 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -23,7 +23,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} # Serialize the Edits for use in Webview/Liveview instances serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1.7", optional = true } diff --git a/packages/liveview/CHANGELOG.md b/packages/liveview/CHANGELOG.md index 2c67b4244..de9898c8e 100644 --- a/packages/liveview/CHANGELOG.md +++ b/packages/liveview/CHANGELOG.md @@ -10,13 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Documentation - update local examples and docs to support new syntaxes + - update cargo tomls ### Commit Statistics - - 10 commits contributed to the release over the course of 274 calendar days. - - 10 commits where understood as [conventional](https://www.conventionalcommits.org). + - 11 commits contributed to the release over the course of 274 calendar days. + - 11 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -26,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - clean up the core crate ([`e6c6bbd`](https://github.comgit//DioxusLabs/dioxus/commit/e6c6bbdc1ec6a8c251b78c05ca104f006b6fad26)) - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) diff --git a/packages/mobile/CHANGELOG.md b/packages/mobile/CHANGELOG.md index 2be2fb9dc..39d4a3e5e 100644 --- a/packages/mobile/CHANGELOG.md +++ b/packages/mobile/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - update local examples and docs to support new syntaxes - big updates to the reference + - update cargo tomls ### New Features @@ -21,8 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 12 commits contributed to the release over the course of 128 calendar days. - - 12 commits where understood as [conventional](https://www.conventionalcommits.org). + - 14 commits contributed to the release over the course of 128 calendar days. + - 13 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -32,6 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) - book documentation ([`16dbf4a`](https://github.comgit//DioxusLabs/dioxus/commit/16dbf4a6f84103857385fb4b142a718b0ce72118)) diff --git a/packages/mobile/Cargo.toml b/packages/mobile/Cargo.toml index 02d4cf9cf..3aea3f190 100644 --- a/packages/mobile/Cargo.toml +++ b/packages/mobile/Cargo.toml @@ -23,7 +23,7 @@ keywords = [ [dependencies] anyhow = "1.0" # cacao = { git = "https://github.com/ryanmcgrath/cacao" } -dioxus-core = { path = "../core", version = "^0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} log = "0.4.14" serde = "1.0.126" serde_json = "1.0.64" diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index a252a2a8c..e7f5bec2a 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Documentation - update local examples and docs to support new syntaxes + - update cargo tomls ### New Features @@ -24,8 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 17 commits contributed to the release over the course of 328 calendar days. - - 17 commits where understood as [conventional](https://www.conventionalcommits.org). + - 19 commits contributed to the release over the course of 328 calendar days. + - 18 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -35,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - router version ([`58106a5`](https://github.comgit//DioxusLabs/dioxus/commit/58106a55291e90661e8901dd8900434c20a75576)) - bump versions ([`0846d93`](https://github.comgit//DioxusLabs/dioxus/commit/0846d93d41c27464ca271757c6f24a2cef8fb997)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 3d49cadd4..496ecff50 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -22,9 +22,9 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", default-features = false } -dioxus-html = { path = "../html", version = "^0.1.0", default-features = false } -dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } +dioxus-core = { path = "../core", version ="^0.1.3", default-features = false } +dioxus-html = { path = "../html", version ="^0.1.0", default-features = false } +dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} web-sys = { version = "0.3", features = [ "Attr", diff --git a/packages/ssr/CHANGELOG.md b/packages/ssr/CHANGELOG.md index 6b06fd248..bcf3c5aaf 100644 --- a/packages/ssr/CHANGELOG.md +++ b/packages/ssr/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - update local examples and docs to support new syntaxes - big updates to the reference + - update cargo tomls ### New Features @@ -35,8 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 58 commits contributed to the release over the course of 333 calendar days. - - 58 commits where understood as [conventional](https://www.conventionalcommits.org). + - 60 commits contributed to the release over the course of 333 calendar days. + - 59 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -46,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - fix ssr ([`ded9696`](https://github.comgit//DioxusLabs/dioxus/commit/ded9696930ec825e0aba990494790e8be43a73e5)) - rename fc to component ([`1e4a599`](https://github.comgit//DioxusLabs/dioxus/commit/1e4a599d14af85a2d1c29a442dd489f8dc8df321)) diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 09bb5df51..87c0117ee 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -24,7 +24,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } [dev-dependencies] diff --git a/packages/web/CHANGELOG.md b/packages/web/CHANGELOG.md index ff730ebd9..84b3acbdd 100644 --- a/packages/web/CHANGELOG.md +++ b/packages/web/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - lnks to projects - big updates to the reference - move around examples + - update cargo tomls ### New Features @@ -72,8 +73,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 173 commits contributed to the release over the course of 334 calendar days. - - 169 commits where understood as [conventional](https://www.conventionalcommits.org). + - 175 commits contributed to the release over the course of 334 calendar days. + - 170 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -83,6 +84,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - go back to noisy lifetime solution ([`8daf7a6`](https://github.comgit//DioxusLabs/dioxus/commit/8daf7a6ed86df72522b089aa2647eea7bee0f3b6)) - clean up the core crate ([`e6c6bbd`](https://github.comgit//DioxusLabs/dioxus/commit/e6c6bbdc1ec6a8c251b78c05ca104f006b6fad26)) diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index 88aba781a..c8ef6c629 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -23,7 +23,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} dioxus-html = { path = "../html" } js-sys = "0.3" # wasm-bindgen-shared = { path = "../../../Tinkering/wasm-bindgen/crates/shared" } From a33f7701fcf5f917fea8719253650b5ad92554fd Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 16:05:18 -0500 Subject: [PATCH 09/21] fix: tags --- packages/core-macro/Cargo.toml | 2 +- packages/core/Cargo.toml | 4 ++-- packages/coroutines/Cargo.toml | 2 +- packages/desktop/Cargo.toml | 4 ++-- packages/hooks/Cargo.toml | 2 +- packages/html/Cargo.toml | 4 ++-- packages/liveview/Cargo.toml | 2 +- packages/mobile/Cargo.toml | 4 ++-- packages/router/Cargo.toml | 8 ++++---- packages/ssr/Cargo.toml | 4 ++-- packages/web/Cargo.toml | 4 ++-- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/core-macro/Cargo.toml b/packages/core-macro/Cargo.toml index c2a37fbdf..5c3eba20f 100644 --- a/packages/core-macro/Cargo.toml +++ b/packages/core-macro/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 5c6b55563..7be9fcdac 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", @@ -62,7 +62,7 @@ dioxus-html = { path = "../html" } fern = { version = "0.6.0", features = ["colored"] } rand = { version = "0.8.4", features = ["small_rng"] } simple_logger = "1.13.0" -dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} +dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } # dioxus-hooks = { path = "../hooks" } criterion = "0.3.5" diff --git a/packages/coroutines/Cargo.toml b/packages/coroutines/Cargo.toml index b0068a94e..02cd009fe 100644 --- a/packages/coroutines/Cargo.toml +++ b/packages/coroutines/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index ddef426c5..364497e0d 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", @@ -23,7 +23,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" diff --git a/packages/hooks/Cargo.toml b/packages/hooks/Cargo.toml index 450903a30..6e9253cb4 100644 --- a/packages/hooks/Cargo.toml +++ b/packages/hooks/Cargo.toml @@ -9,7 +9,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index 99cf83e21..acab7fdb1 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", @@ -23,7 +23,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3"} +dioxus-core = { path = "../core", version = "^0.1.3" } # Serialize the Edits for use in Webview/Liveview instances serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1.7", optional = true } diff --git a/packages/liveview/Cargo.toml b/packages/liveview/Cargo.toml index b036f0203..8be5acac1 100644 --- a/packages/liveview/Cargo.toml +++ b/packages/liveview/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", diff --git a/packages/mobile/Cargo.toml b/packages/mobile/Cargo.toml index 3aea3f190..866d1af4c 100644 --- a/packages/mobile/Cargo.toml +++ b/packages/mobile/Cargo.toml @@ -9,7 +9,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", @@ -23,7 +23,7 @@ keywords = [ [dependencies] anyhow = "1.0" # cacao = { git = "https://github.com/ryanmcgrath/cacao" } -dioxus-core = { path = "../core", version ="^0.1.3"} +dioxus-core = { path = "../core", version = "^0.1.3" } log = "0.4.14" serde = "1.0.126" serde_json = "1.0.64" diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 496ecff50..76c020f86 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -10,7 +10,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", @@ -22,9 +22,9 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", default-features = false } -dioxus-html = { path = "../html", version ="^0.1.0", default-features = false } -dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} +dioxus-core = { path = "../core", version = "^0.1.3", default-features = false } +dioxus-html = { path = "../html", version = "^0.1.0", default-features = false } +dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } web-sys = { version = "0.3", features = [ "Attr", diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 87c0117ee..0a2fd55a4 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", @@ -24,7 +24,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } [dev-dependencies] diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index c8ef6c629..f0500b88e 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -11,7 +11,7 @@ documentation = "https://dioxuslabs.com" keywords = [ "dom", "ui", - "user interface", + "userinterface", "gui", "react", "state", @@ -23,7 +23,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3"} +dioxus-core = { path = "../core", version = "^0.1.3" } dioxus-html = { path = "../html" } js-sys = "0.3" # wasm-bindgen-shared = { path = "../../../Tinkering/wasm-bindgen/crates/shared" } From b32665d7212a5b9a3e21cb7af7abba63ae399fac Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 16:05:20 -0500 Subject: [PATCH 10/21] Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 --- packages/core-macro/CHANGELOG.md | 7 +++++-- packages/core/CHANGELOG.md | 7 +++++-- packages/core/Cargo.toml | 2 +- packages/desktop/CHANGELOG.md | 7 +++++-- packages/desktop/Cargo.toml | 2 +- packages/hooks/CHANGELOG.md | 7 +++++-- packages/html/CHANGELOG.md | 7 +++++-- packages/html/Cargo.toml | 2 +- packages/liveview/CHANGELOG.md | 10 ++++++++-- packages/mobile/CHANGELOG.md | 10 ++++++++-- packages/mobile/Cargo.toml | 2 +- packages/router/CHANGELOG.md | 7 +++++-- packages/router/Cargo.toml | 6 +++--- packages/ssr/CHANGELOG.md | 10 ++++++++-- packages/ssr/Cargo.toml | 2 +- packages/web/CHANGELOG.md | 7 +++++-- packages/web/Cargo.toml | 2 +- 17 files changed, 68 insertions(+), 29 deletions(-) diff --git a/packages/core-macro/CHANGELOG.md b/packages/core-macro/CHANGELOG.md index 3a14ae345..65e988637 100644 --- a/packages/core-macro/CHANGELOG.md +++ b/packages/core-macro/CHANGELOG.md @@ -49,13 +49,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - really big bug around hooks - use annotation method from rust/58052 to fix closure lifetimes - messed up how lifetimes worked, need to render once per component + - tags ### Commit Statistics - - 108 commits contributed to the release over the course of 329 calendar days. - - 104 commits where understood as [conventional](https://www.conventionalcommits.org). + - 110 commits contributed to the release over the course of 329 calendar days. + - 105 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -65,6 +66,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - docs ([`8814977`](https://github.comgit//DioxusLabs/dioxus/commit/8814977eeebe06748a3b9677a8070e42a037ebd7)) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 629c85532..c9733e4b5 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -111,6 +111,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - use annotation method from rust/58052 to fix closure lifetimes - messed up how lifetimes worked, need to render once per component - all the bugs! + - tags ### Performance @@ -121,8 +122,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 395 commits contributed to the release over the course of 335 calendar days. - - 381 commits where understood as [conventional](https://www.conventionalcommits.org). + - 397 commits contributed to the release over the course of 335 calendar days. + - 382 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -132,6 +133,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 7be9fcdac..055b69ab8 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -62,7 +62,7 @@ dioxus-html = { path = "../html" } fern = { version = "0.6.0", features = ["colored"] } rand = { version = "0.8.4", features = ["small_rng"] } simple_logger = "1.13.0" -dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } +dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} # dioxus-hooks = { path = "../hooks" } criterion = "0.3.5" diff --git a/packages/desktop/CHANGELOG.md b/packages/desktop/CHANGELOG.md index 524a325a0..e8f352c73 100644 --- a/packages/desktop/CHANGELOG.md +++ b/packages/desktop/CHANGELOG.md @@ -36,13 +36,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - really big bug around hooks - desktop and mobile - messed up how lifetimes worked, need to render once per component + - tags ### Commit Statistics - - 53 commits contributed to the release over the course of 128 calendar days. - - 50 commits where understood as [conventional](https://www.conventionalcommits.org). + - 55 commits contributed to the release over the course of 128 calendar days. + - 51 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -52,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index 364497e0d..7f0b59033 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -23,7 +23,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md index 4a16fa5d7..ee294e268 100644 --- a/packages/hooks/CHANGELOG.md +++ b/packages/hooks/CHANGELOG.md @@ -35,13 +35,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - really big bug around hooks - desktop and mobile - all the bugs! + - tags ### Commit Statistics - - 60 commits contributed to the release over the course of 335 calendar days. - - 58 commits where understood as [conventional](https://www.conventionalcommits.org). + - 62 commits contributed to the release over the course of 335 calendar days. + - 59 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -51,6 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - docs ([`3ddf395`](https://github.comgit//DioxusLabs/dioxus/commit/3ddf395772aa24d04cf4e35bbb3a0027c8f1c7dd)) diff --git a/packages/html/CHANGELOG.md b/packages/html/CHANGELOG.md index a9d4df17b..9f09479b6 100644 --- a/packages/html/CHANGELOG.md +++ b/packages/html/CHANGELOG.md @@ -30,13 +30,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug Fixes - desktop and mobile + - tags ### Commit Statistics - - 36 commits contributed to the release over the course of 160 calendar days. - - 33 commits where understood as [conventional](https://www.conventionalcommits.org). + - 38 commits contributed to the release over the course of 160 calendar days. + - 34 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -46,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - bump versions ([`0846d93`](https://github.comgit//DioxusLabs/dioxus/commit/0846d93d41c27464ca271757c6f24a2cef8fb997)) diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index acab7fdb1..bc79b30a7 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -23,7 +23,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} # Serialize the Edits for use in Webview/Liveview instances serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1.7", optional = true } diff --git a/packages/liveview/CHANGELOG.md b/packages/liveview/CHANGELOG.md index de9898c8e..4d7f72054 100644 --- a/packages/liveview/CHANGELOG.md +++ b/packages/liveview/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## v0.1.0 (2021-12-15) +### Bug Fixes + + - tags + ### Documentation - update local examples and docs to support new syntaxes @@ -16,8 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 11 commits contributed to the release over the course of 274 calendar days. - - 11 commits where understood as [conventional](https://www.conventionalcommits.org). + - 13 commits contributed to the release over the course of 274 calendar days. + - 12 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -27,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) - clean up the core crate ([`e6c6bbd`](https://github.comgit//DioxusLabs/dioxus/commit/e6c6bbdc1ec6a8c251b78c05ca104f006b6fad26)) diff --git a/packages/mobile/CHANGELOG.md b/packages/mobile/CHANGELOG.md index 39d4a3e5e..6096a242f 100644 --- a/packages/mobile/CHANGELOG.md +++ b/packages/mobile/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## v0.0.0 (2021-12-15) +### Bug Fixes + + - tags + ### Documentation - update local examples and docs to support new syntaxes @@ -22,8 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 14 commits contributed to the release over the course of 128 calendar days. - - 13 commits where understood as [conventional](https://www.conventionalcommits.org). + - 16 commits contributed to the release over the course of 128 calendar days. + - 14 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -33,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) diff --git a/packages/mobile/Cargo.toml b/packages/mobile/Cargo.toml index 866d1af4c..eed852376 100644 --- a/packages/mobile/Cargo.toml +++ b/packages/mobile/Cargo.toml @@ -23,7 +23,7 @@ keywords = [ [dependencies] anyhow = "1.0" # cacao = { git = "https://github.com/ryanmcgrath/cacao" } -dioxus-core = { path = "../core", version = "^0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} log = "0.4.14" serde = "1.0.126" serde_json = "1.0.64" diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index e7f5bec2a..e750ea532 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -20,13 +20,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - router version - really big bug around hooks + - tags ### Commit Statistics - - 19 commits contributed to the release over the course of 328 calendar days. - - 18 commits where understood as [conventional](https://www.conventionalcommits.org). + - 21 commits contributed to the release over the course of 328 calendar days. + - 19 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -36,6 +37,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - router version ([`58106a5`](https://github.comgit//DioxusLabs/dioxus/commit/58106a55291e90661e8901dd8900434c20a75576)) diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 76c020f86..c72de51e2 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -22,9 +22,9 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", default-features = false } -dioxus-html = { path = "../html", version = "^0.1.0", default-features = false } -dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } +dioxus-core = { path = "../core", version ="^0.1.3", default-features = false } +dioxus-html = { path = "../html", version ="^0.1.0", default-features = false } +dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} web-sys = { version = "0.3", features = [ "Attr", diff --git a/packages/ssr/CHANGELOG.md b/packages/ssr/CHANGELOG.md index bcf3c5aaf..7899746cb 100644 --- a/packages/ssr/CHANGELOG.md +++ b/packages/ssr/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## v0.1.0 (2021-12-15) +### Bug Fixes + + - tags + ### Documentation - update local examples and docs to support new syntaxes @@ -36,8 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 60 commits contributed to the release over the course of 333 calendar days. - - 59 commits where understood as [conventional](https://www.conventionalcommits.org). + - 62 commits contributed to the release over the course of 333 calendar days. + - 60 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -47,6 +51,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 0a2fd55a4..50035c29b 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -24,7 +24,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } [dev-dependencies] diff --git a/packages/web/CHANGELOG.md b/packages/web/CHANGELOG.md index 84b3acbdd..730101320 100644 --- a/packages/web/CHANGELOG.md +++ b/packages/web/CHANGELOG.md @@ -64,6 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - all the bugs! - append isnt backwards + - tags ### Performance @@ -73,8 +74,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 175 commits contributed to the release over the course of 334 calendar days. - - 170 commits where understood as [conventional](https://www.conventionalcommits.org). + - 177 commits contributed to the release over the course of 334 calendar days. + - 171 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -84,6 +85,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`270dfc9`](https://github.comgit//DioxusLabs/dioxus/commit/270dfc9590b2354d083ea8da5cc0e1a1497d30e0)) - update local examples and docs to support new syntaxes ([`4de16c4`](https://github.comgit//DioxusLabs/dioxus/commit/4de16c4779648e591b3869b5df31271ae603c812)) diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index f0500b88e..a31ee07c8 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -23,7 +23,7 @@ keywords = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} dioxus-html = { path = "../html" } js-sys = "0.3" # wasm-bindgen-shared = { path = "../../../Tinkering/wasm-bindgen/crates/shared" } From 868f6739d2b2c5f2ace0c5240cff8008901e818c Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 16:06:13 -0500 Subject: [PATCH 11/21] fix: keyword length --- packages/core-macro/Cargo.toml | 13 +------------ packages/core/Cargo.toml | 15 ++------------- packages/coroutines/Cargo.toml | 13 +------------ packages/desktop/Cargo.toml | 15 ++------------- packages/hooks/Cargo.toml | 13 +------------ packages/html/Cargo.toml | 15 ++------------- packages/liveview/Cargo.toml | 13 +------------ packages/mobile/Cargo.toml | 15 ++------------- packages/router/Cargo.toml | 19 ++++--------------- packages/ssr/Cargo.toml | 15 ++------------- packages/web/Cargo.toml | 15 ++------------- 11 files changed, 20 insertions(+), 141 deletions(-) diff --git a/packages/core-macro/Cargo.toml b/packages/core-macro/Cargo.toml index 5c3eba20f..dd18287b0 100644 --- a/packages/core-macro/Cargo.toml +++ b/packages/core-macro/Cargo.toml @@ -8,18 +8,7 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 055b69ab8..60dabd75f 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -8,18 +8,7 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -62,7 +51,7 @@ dioxus-html = { path = "../html" } fern = { version = "0.6.0", features = ["colored"] } rand = { version = "0.8.4", features = ["small_rng"] } simple_logger = "1.13.0" -dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} +dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } # dioxus-hooks = { path = "../hooks" } criterion = "0.3.5" diff --git a/packages/coroutines/Cargo.toml b/packages/coroutines/Cargo.toml index 02cd009fe..3b6e47851 100644 --- a/packages/coroutines/Cargo.toml +++ b/packages/coroutines/Cargo.toml @@ -5,18 +5,7 @@ edition = "2018" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index 7f0b59033..845973f25 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -8,22 +8,11 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" diff --git a/packages/hooks/Cargo.toml b/packages/hooks/Cargo.toml index 6e9253cb4..ee7cc40a1 100644 --- a/packages/hooks/Cargo.toml +++ b/packages/hooks/Cargo.toml @@ -6,18 +6,7 @@ edition = "2018" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index bc79b30a7..1c5b14129 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -8,22 +8,11 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3"} +dioxus-core = { path = "../core", version = "^0.1.3" } # Serialize the Edits for use in Webview/Liveview instances serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1.7", optional = true } diff --git a/packages/liveview/Cargo.toml b/packages/liveview/Cargo.toml index 8be5acac1..fb9b17a56 100644 --- a/packages/liveview/Cargo.toml +++ b/packages/liveview/Cargo.toml @@ -5,18 +5,7 @@ edition = "2021" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/packages/mobile/Cargo.toml b/packages/mobile/Cargo.toml index eed852376..256f5622b 100644 --- a/packages/mobile/Cargo.toml +++ b/packages/mobile/Cargo.toml @@ -6,24 +6,13 @@ edition = "2018" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1.0" # cacao = { git = "https://github.com/ryanmcgrath/cacao" } -dioxus-core = { path = "../core", version ="^0.1.3"} +dioxus-core = { path = "../core", version = "^0.1.3" } log = "0.4.14" serde = "1.0.126" serde_json = "1.0.64" diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index c72de51e2..cbb3e6585 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -7,24 +7,13 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", default-features = false } -dioxus-html = { path = "../html", version ="^0.1.0", default-features = false } -dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} +dioxus-core = { path = "../core", version = "^0.1.3", default-features = false } +dioxus-html = { path = "../html", version = "^0.1.0", default-features = false } +dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } web-sys = { version = "0.3", features = [ "Attr", diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 50035c29b..6f5ec27d3 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -8,23 +8,12 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } [dev-dependencies] diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index a31ee07c8..517a55355 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -8,22 +8,11 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = [ - "dom", - "ui", - "userinterface", - "gui", - "react", - "state", - "management", - "wasm", - "web", - "ssr", -] +keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3"} +dioxus-core = { path = "../core", version = "^0.1.3" } dioxus-html = { path = "../html" } js-sys = "0.3" # wasm-bindgen-shared = { path = "../../../Tinkering/wasm-bindgen/crates/shared" } From 0d480a4c437d424f0eaff486e510a8fd3f3e6584 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 16:06:15 -0500 Subject: [PATCH 12/21] Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 --- packages/core-macro/CHANGELOG.md | 7 +++++-- packages/core/CHANGELOG.md | 7 +++++-- packages/core/Cargo.toml | 2 +- packages/desktop/CHANGELOG.md | 7 +++++-- packages/desktop/Cargo.toml | 2 +- packages/hooks/CHANGELOG.md | 7 +++++-- packages/html/CHANGELOG.md | 7 +++++-- packages/html/Cargo.toml | 2 +- packages/liveview/CHANGELOG.md | 7 +++++-- packages/mobile/CHANGELOG.md | 7 +++++-- packages/mobile/Cargo.toml | 2 +- packages/router/CHANGELOG.md | 7 +++++-- packages/router/Cargo.toml | 6 +++--- packages/ssr/CHANGELOG.md | 7 +++++-- packages/ssr/Cargo.toml | 2 +- packages/web/CHANGELOG.md | 7 +++++-- packages/web/Cargo.toml | 2 +- 17 files changed, 59 insertions(+), 29 deletions(-) diff --git a/packages/core-macro/CHANGELOG.md b/packages/core-macro/CHANGELOG.md index 65e988637..9b054262a 100644 --- a/packages/core-macro/CHANGELOG.md +++ b/packages/core-macro/CHANGELOG.md @@ -50,13 +50,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - use annotation method from rust/58052 to fix closure lifetimes - messed up how lifetimes worked, need to render once per component - tags + - keyword length ### Commit Statistics - - 110 commits contributed to the release over the course of 329 calendar days. - - 105 commits where understood as [conventional](https://www.conventionalcommits.org). + - 112 commits contributed to the release over the course of 329 calendar days. + - 106 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -66,6 +67,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index c9733e4b5..d9fc7a308 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -112,6 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - messed up how lifetimes worked, need to render once per component - all the bugs! - tags + - keyword length ### Performance @@ -122,8 +123,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 397 commits contributed to the release over the course of 335 calendar days. - - 382 commits where understood as [conventional](https://www.conventionalcommits.org). + - 399 commits contributed to the release over the course of 335 calendar days. + - 383 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -133,6 +134,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 60dabd75f..0d1d1e958 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -51,7 +51,7 @@ dioxus-html = { path = "../html" } fern = { version = "0.6.0", features = ["colored"] } rand = { version = "0.8.4", features = ["small_rng"] } simple_logger = "1.13.0" -dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } +dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} # dioxus-hooks = { path = "../hooks" } criterion = "0.3.5" diff --git a/packages/desktop/CHANGELOG.md b/packages/desktop/CHANGELOG.md index e8f352c73..78505dff2 100644 --- a/packages/desktop/CHANGELOG.md +++ b/packages/desktop/CHANGELOG.md @@ -37,13 +37,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - desktop and mobile - messed up how lifetimes worked, need to render once per component - tags + - keyword length ### Commit Statistics - - 55 commits contributed to the release over the course of 128 calendar days. - - 51 commits where understood as [conventional](https://www.conventionalcommits.org). + - 57 commits contributed to the release over the course of 128 calendar days. + - 52 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -53,6 +54,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index 845973f25..0edced3b2 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md index ee294e268..f09efeaa0 100644 --- a/packages/hooks/CHANGELOG.md +++ b/packages/hooks/CHANGELOG.md @@ -36,13 +36,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - desktop and mobile - all the bugs! - tags + - keyword length ### Commit Statistics - - 62 commits contributed to the release over the course of 335 calendar days. - - 59 commits where understood as [conventional](https://www.conventionalcommits.org). + - 64 commits contributed to the release over the course of 335 calendar days. + - 60 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -52,6 +53,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/html/CHANGELOG.md b/packages/html/CHANGELOG.md index 9f09479b6..97aeda4ad 100644 --- a/packages/html/CHANGELOG.md +++ b/packages/html/CHANGELOG.md @@ -31,13 +31,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - desktop and mobile - tags + - keyword length ### Commit Statistics - - 38 commits contributed to the release over the course of 160 calendar days. - - 34 commits where understood as [conventional](https://www.conventionalcommits.org). + - 40 commits contributed to the release over the course of 160 calendar days. + - 35 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -47,6 +48,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index 1c5b14129..08e767ea1 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} # Serialize the Edits for use in Webview/Liveview instances serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1.7", optional = true } diff --git a/packages/liveview/CHANGELOG.md b/packages/liveview/CHANGELOG.md index 4d7f72054..6ea3a93cf 100644 --- a/packages/liveview/CHANGELOG.md +++ b/packages/liveview/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug Fixes - tags + - keyword length ### Documentation @@ -20,8 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 13 commits contributed to the release over the course of 274 calendar days. - - 12 commits where understood as [conventional](https://www.conventionalcommits.org). + - 15 commits contributed to the release over the course of 274 calendar days. + - 13 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -31,6 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/mobile/CHANGELOG.md b/packages/mobile/CHANGELOG.md index 6096a242f..59cf4eb19 100644 --- a/packages/mobile/CHANGELOG.md +++ b/packages/mobile/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug Fixes - tags + - keyword length ### Documentation @@ -26,8 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 16 commits contributed to the release over the course of 128 calendar days. - - 14 commits where understood as [conventional](https://www.conventionalcommits.org). + - 18 commits contributed to the release over the course of 128 calendar days. + - 15 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -37,6 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/mobile/Cargo.toml b/packages/mobile/Cargo.toml index 256f5622b..ef05f2eee 100644 --- a/packages/mobile/Cargo.toml +++ b/packages/mobile/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] [dependencies] anyhow = "1.0" # cacao = { git = "https://github.com/ryanmcgrath/cacao" } -dioxus-core = { path = "../core", version = "^0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} log = "0.4.14" serde = "1.0.126" serde_json = "1.0.64" diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index e750ea532..ff770cbee 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -21,13 +21,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - router version - really big bug around hooks - tags + - keyword length ### Commit Statistics - - 21 commits contributed to the release over the course of 328 calendar days. - - 19 commits where understood as [conventional](https://www.conventionalcommits.org). + - 23 commits contributed to the release over the course of 328 calendar days. + - 20 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -37,6 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index cbb3e6585..2c1d89d4e 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -11,9 +11,9 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", default-features = false } -dioxus-html = { path = "../html", version = "^0.1.0", default-features = false } -dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } +dioxus-core = { path = "../core", version ="^0.1.3", default-features = false } +dioxus-html = { path = "../html", version ="^0.1.0", default-features = false } +dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} web-sys = { version = "0.3", features = [ "Attr", diff --git a/packages/ssr/CHANGELOG.md b/packages/ssr/CHANGELOG.md index 7899746cb..5ff1264fa 100644 --- a/packages/ssr/CHANGELOG.md +++ b/packages/ssr/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug Fixes - tags + - keyword length ### Documentation @@ -40,8 +41,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 62 commits contributed to the release over the course of 333 calendar days. - - 60 commits where understood as [conventional](https://www.conventionalcommits.org). + - 64 commits contributed to the release over the course of 333 calendar days. + - 61 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -51,6 +52,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 6f5ec27d3..425fd0285 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } [dev-dependencies] diff --git a/packages/web/CHANGELOG.md b/packages/web/CHANGELOG.md index 730101320..add20b861 100644 --- a/packages/web/CHANGELOG.md +++ b/packages/web/CHANGELOG.md @@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - all the bugs! - append isnt backwards - tags + - keyword length ### Performance @@ -74,8 +75,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 177 commits contributed to the release over the course of 334 calendar days. - - 171 commits where understood as [conventional](https://www.conventionalcommits.org). + - 179 commits contributed to the release over the course of 334 calendar days. + - 172 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages ### Commit Details @@ -85,6 +86,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`3a706ac`](https://github.comgit//DioxusLabs/dioxus/commit/3a706ac4168db137723bea90d7a0058190adfc3c)) - update cargo tomls ([`e4c06ce`](https://github.comgit//DioxusLabs/dioxus/commit/e4c06ce8e893779d2aad0883a1bb27d193bc5985)) diff --git a/packages/web/Cargo.toml b/packages/web/Cargo.toml index 517a55355..cb540dae5 100644 --- a/packages/web/Cargo.toml +++ b/packages/web/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version = "^0.1.3" } +dioxus-core = { path = "../core", version ="^0.1.3"} dioxus-html = { path = "../html" } js-sys = "0.3" # wasm-bindgen-shared = { path = "../../../Tinkering/wasm-bindgen/crates/shared" } From 6a3c61fae88b5fdc7fb0e5fbca6370a193b61129 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 16:07:07 -0500 Subject: [PATCH 13/21] fix: version number --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 473e98884..0f3a2fead 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus" -version = "0.1.0" +version = "0.1.1" authors = ["Jonathan Kelley"] edition = "2018" description = "Core functionality for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences" @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "./packages/core", version ="^0.1.3"} +dioxus-core = { path = "./packages/core", version = "^0.1.3" } dioxus-router = { path = "./packages/router", optional = true } dioxus-core-macro = { path = "./packages/core-macro", optional = true } dioxus-html = { path = "./packages/html", optional = true } From 2b928372fb1b74a4d4e220ff3d798bb7e52f79d2 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 15 Dec 2021 16:07:09 -0500 Subject: [PATCH 14/21] Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.1 --- CHANGELOG.md | 23 ++++++++++++++++++++++- Cargo.toml | 2 +- packages/core-macro/CHANGELOG.md | 3 ++- packages/core/CHANGELOG.md | 3 ++- packages/desktop/CHANGELOG.md | 3 ++- packages/hooks/CHANGELOG.md | 3 ++- packages/html/CHANGELOG.md | 3 ++- packages/liveview/CHANGELOG.md | 3 ++- packages/mobile/CHANGELOG.md | 3 ++- packages/router/CHANGELOG.md | 3 ++- packages/ssr/CHANGELOG.md | 3 ++- packages/web/CHANGELOG.md | 3 ++- 12 files changed, 43 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f27966f0b..b049f8dd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## v0.1.0 (2021-12-15) +## v0.1.1 (2021-12-15) ### Documentation @@ -79,3 +79,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - docs ([`f5683a2`](https://github.comgit//DioxusLabs/dioxus/commit/f5683a23464992ecace463a61414795b5a2c58c8))
+## v0.1.0 (2021-12-15) + +### Documentation + + - update local examples and docs to support new syntaxes + - improve docs + - big updates to the reference + - lib.rs docs + - move around examples + +### New Features + + - it compiles once more + - massage lifetimes + - amazingly awesome error handling + - svgs working in webview + - mvoe away from compound context + - more suspended nodes! + - add aria + - enable arbitrary body in rsx! macro + diff --git a/Cargo.toml b/Cargo.toml index 0f3a2fead..a90f4e50a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "./packages/core", version = "^0.1.3" } +dioxus-core = { path = "./packages/core", version ="^0.1.3"} dioxus-router = { path = "./packages/router", optional = true } dioxus-core-macro = { path = "./packages/core-macro", optional = true } dioxus-html = { path = "./packages/html", optional = true } diff --git a/packages/core-macro/CHANGELOG.md b/packages/core-macro/CHANGELOG.md index 9b054262a..ead050b12 100644 --- a/packages/core-macro/CHANGELOG.md +++ b/packages/core-macro/CHANGELOG.md @@ -56,7 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 112 commits contributed to the release over the course of 329 calendar days. + - 113 commits contributed to the release over the course of 329 calendar days. - 106 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -67,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index d9fc7a308..db65dab4a 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -123,7 +123,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 399 commits contributed to the release over the course of 335 calendar days. + - 400 commits contributed to the release over the course of 335 calendar days. - 383 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -134,6 +134,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) diff --git a/packages/desktop/CHANGELOG.md b/packages/desktop/CHANGELOG.md index 78505dff2..b0844b6cc 100644 --- a/packages/desktop/CHANGELOG.md +++ b/packages/desktop/CHANGELOG.md @@ -43,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 57 commits contributed to the release over the course of 128 calendar days. + - 58 commits contributed to the release over the course of 128 calendar days. - 52 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -54,6 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) diff --git a/packages/hooks/CHANGELOG.md b/packages/hooks/CHANGELOG.md index f09efeaa0..f2ec5ea71 100644 --- a/packages/hooks/CHANGELOG.md +++ b/packages/hooks/CHANGELOG.md @@ -42,7 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 64 commits contributed to the release over the course of 335 calendar days. + - 65 commits contributed to the release over the course of 335 calendar days. - 60 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) diff --git a/packages/html/CHANGELOG.md b/packages/html/CHANGELOG.md index 97aeda4ad..02ab24dbb 100644 --- a/packages/html/CHANGELOG.md +++ b/packages/html/CHANGELOG.md @@ -37,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 40 commits contributed to the release over the course of 160 calendar days. + - 41 commits contributed to the release over the course of 160 calendar days. - 35 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) diff --git a/packages/liveview/CHANGELOG.md b/packages/liveview/CHANGELOG.md index 6ea3a93cf..6ff6ab4d8 100644 --- a/packages/liveview/CHANGELOG.md +++ b/packages/liveview/CHANGELOG.md @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 15 commits contributed to the release over the course of 274 calendar days. + - 16 commits contributed to the release over the course of 274 calendar days. - 13 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) diff --git a/packages/mobile/CHANGELOG.md b/packages/mobile/CHANGELOG.md index 59cf4eb19..45cc86228 100644 --- a/packages/mobile/CHANGELOG.md +++ b/packages/mobile/CHANGELOG.md @@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 18 commits contributed to the release over the course of 128 calendar days. + - 19 commits contributed to the release over the course of 128 calendar days. - 15 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) diff --git a/packages/router/CHANGELOG.md b/packages/router/CHANGELOG.md index ff770cbee..12e2185c8 100644 --- a/packages/router/CHANGELOG.md +++ b/packages/router/CHANGELOG.md @@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 23 commits contributed to the release over the course of 328 calendar days. + - 24 commits contributed to the release over the course of 328 calendar days. - 20 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) diff --git a/packages/ssr/CHANGELOG.md b/packages/ssr/CHANGELOG.md index 5ff1264fa..3347e50af 100644 --- a/packages/ssr/CHANGELOG.md +++ b/packages/ssr/CHANGELOG.md @@ -41,7 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 64 commits contributed to the release over the course of 333 calendar days. + - 65 commits contributed to the release over the course of 333 calendar days. - 61 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) diff --git a/packages/web/CHANGELOG.md b/packages/web/CHANGELOG.md index add20b861..9f913f55f 100644 --- a/packages/web/CHANGELOG.md +++ b/packages/web/CHANGELOG.md @@ -75,7 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 179 commits contributed to the release over the course of 334 calendar days. + - 180 commits contributed to the release over the course of 334 calendar days. - 172 commits where understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' where seen in commit messages @@ -86,6 +86,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`0d480a4`](https://github.comgit//DioxusLabs/dioxus/commit/0d480a4c437d424f0eaff486e510a8fd3f3e6584)) - keyword length ([`868f673`](https://github.comgit//DioxusLabs/dioxus/commit/868f6739d2b2c5f2ace0c5240cff8008901e818c)) - Release dioxus-core v0.1.3, dioxus-core-macro v0.1.2, dioxus-html v0.1.0, dioxus-desktop v0.0.0, dioxus-hooks v0.1.3, dioxus-liveview v0.1.0, dioxus-mobile v0.0.0, dioxus-router v0.1.0, dioxus-ssr v0.1.0, dioxus-web v0.0.0, dioxus v0.1.0 ([`b32665d`](https://github.comgit//DioxusLabs/dioxus/commit/b32665d7212a5b9a3e21cb7af7abba63ae399fac)) - tags ([`a33f770`](https://github.comgit//DioxusLabs/dioxus/commit/a33f7701fcf5f917fea8719253650b5ad92554fd)) From 2c3a0464264fa11e8100df025d863931f9606cdb Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sat, 18 Dec 2021 15:17:32 -0500 Subject: [PATCH 15/21] wip: prepare to change our fragment pattern. Add some more docs --- Cargo.toml | 70 +++++++++++----------------- README.md | 12 +++++ packages/core/Cargo.toml | 3 +- packages/core/examples/handlerror.rs | 10 ++++ packages/core/src/lib.rs | 40 ++++++++++++++++ packages/desktop/Cargo.toml | 6 +-- packages/desktop/src/lib.rs | 24 ++++------ packages/html/Cargo.toml | 3 +- packages/router/Cargo.toml | 8 ++-- src/lib.rs | 3 -- 10 files changed, 108 insertions(+), 71 deletions(-) create mode 100644 packages/core/examples/handlerror.rs diff --git a/Cargo.toml b/Cargo.toml index a90f4e50a..349a17495 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,44 +1,55 @@ [package] name = "dioxus" -version = "0.1.1" +version = "0.1.2" authors = ["Jonathan Kelley"] edition = "2018" description = "Core functionality for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences" license = "MIT/Apache-2.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +repository = "https://github.com/DioxusLabs/dioxus/" +homepage = "https://dioxuslabs.com" +documentation = "https://dioxuslabs.com" +keywords = ["dom", "ui", "gui", "react", "wasm"] [dependencies] -dioxus-core = { path = "./packages/core", version ="^0.1.3"} -dioxus-router = { path = "./packages/router", optional = true } -dioxus-core-macro = { path = "./packages/core-macro", optional = true } +dioxus-core = { path = "./packages/core", version = "^0.1.3" } dioxus-html = { path = "./packages/html", optional = true } +dioxus-core-macro = { path = "./packages/core-macro", optional = true } +dioxus-hooks = { path = "./packages/hooks", optional = true } + +dioxus-ssr = { path = "./packages/ssr", optional = true } dioxus-web = { path = "./packages/web", optional = true } dioxus-desktop = { path = "./packages/desktop", optional = true } -dioxus-hooks = { path = "./packages/hooks", optional = true } -dioxus-ssr = { path = "./packages/ssr", optional = true } +dioxus-router = { path = "./packages/router", optional = true } + dioxus-mobile = { path = "./packages/mobile", optional = true } dioxus-liveview = { path = "./packages/liveview", optional = true } [features] -# core -default = ["core"] -core = ["macro", "hooks", "html"] +default = ["macro", "hooks", "html"] + macro = ["dioxus-core-macro"] hooks = ["dioxus-hooks"] html = ["dioxus-html"] router = ["dioxus-router"] liveview = ["dioxus-liveview"] - -# utilities -atoms = [] - -# targets ssr = ["dioxus-ssr"] web = ["dioxus-web"] desktop = ["dioxus-desktop"] mobile = ["dioxus-mobile"] +[workspace] +members = [ + "packages/core", + "packages/core-macro", + "packages/html", + "packages/hooks", + "packages/web", + "packages/ssr", + "packages/desktop", + "packages/mobile", +] + [dev-dependencies] futures-util = "0.3.17" log = "0.4.14" @@ -48,7 +59,6 @@ serde = { version = "1.0.131", features = ["derive"] } im-rc = "15.0.0" fxhash = "0.2.1" anyhow = "1.0.51" -# reqwest = "0.11.4" serde_json = "1.0.73" simple_logger = "1.16.0" @@ -69,31 +79,3 @@ wasm-bindgen = { version = "0.2.78", features = ["enable-interning"] } [dev-dependencies.getrandom] version = "0.2.3" features = ["js"] - - -[workspace] -members = [ - "packages/core", - "packages/core-macro", - "packages/html", - "packages/hooks", - "packages/web", - "packages/ssr", - "packages/desktop", - "packages/mobile", -] - - -[[example]] -required-features = ["desktop"] -name = "webview" -path = "./examples/webview.rs" - -[[example]] -required-features = ["desktop"] -name = "tailwind" -path = "./examples/tailwind.rs" - - -# [patch.crates-io] -# wasm-bindgen = { path = "../Tinkering/wasm-bindgen" } diff --git a/README.md b/README.md index fddea2882..3f5b5d55c 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,18 @@ If you know React, then you already know Dioxus. +Available cargo features: +- default: core (macro, hooks, html) +- macro: support for `Props` and `rsx` macros +- hooks: foundational hooks like `use_state`, `use_ref`, etc. +- html: the entire namespace of `html` elements, their listeners, and attributes +- router: a cross-platform (web and desktop) solution for global app routing +- liveview: a threadpool to spawn new VirtualDoms and their handles in +- ssr: render the virtualdom to a string +- web: render the your app on the web +- desktop: render your app locally rendered with webview +- mobile: render your app on your device rendered with webview + ## Examples: | File Navigator (Desktop) | Bluetooth scanner (Desktop) | TodoMVC (All platforms) | Tailwind (Liveview) | diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 0d1d1e958..edb841a54 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -51,9 +51,10 @@ dioxus-html = { path = "../html" } fern = { version = "0.6.0", features = ["colored"] } rand = { version = "0.8.4", features = ["small_rng"] } simple_logger = "1.13.0" -dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} +dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } # dioxus-hooks = { path = "../hooks" } criterion = "0.3.5" +thiserror = "1.0.30" [features] default = [] diff --git a/packages/core/examples/handlerror.rs b/packages/core/examples/handlerror.rs new file mode 100644 index 000000000..c3283c32b --- /dev/null +++ b/packages/core/examples/handlerror.rs @@ -0,0 +1,10 @@ +//! Handling errors and early aborts +//! +//! +//! +//! + +use dioxus_core::prelude::*; +use thiserror::Error; + +fn main() {} diff --git a/packages/core/src/lib.rs b/packages/core/src/lib.rs index 14d7bd123..9055d8729 100644 --- a/packages/core/src/lib.rs +++ b/packages/core/src/lib.rs @@ -20,7 +20,47 @@ pub(crate) mod innerlude { pub(crate) use crate::scopearena::*; pub use crate::virtual_dom::*; + /// An [`Element`] is a possibly-none [`VNode`] created by calling `render` on [`Scope`] or [`ScopeState`]. + /// + /// Any [`None`] [`Element`] will automatically be coerced into a placeholder [`VNode`] with the [`VNode::Placeholder`] variant. pub type Element<'a> = Option>; + + /// A [`Component`] is a function that takes a [`Scope`] and returns an [`Element`]. + /// + /// Components can be used in other components with two syntax options: + /// - lowercase as a function call with named arguments (rust style) + /// - uppercase as an element (react style) + /// + /// ## Rust-Style + /// + /// ```rust + /// fn example(cx: Scope) -> Element { + /// // ... + /// } + /// + /// rsx!( + /// example() + /// ) + /// ``` + /// ## React-Style + /// ```rust + /// fn Example(cx: Scope) -> Element { + /// // ... + /// } + /// + /// rsx!( + /// Example {} + /// ) + /// ``` + /// + /// ## As a closure + /// This particular type alias lets you even use static closures for pure/static components: + /// + /// ```rust + /// static Example: Component = |cx| { + /// // ... + /// }; + /// ``` pub type Component

= for<'a> fn(Scope<'a, P>) -> Element<'a>; } diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index 0edced3b2..a132bc513 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dioxus-desktop" -version = "0.0.0" +version = "0.1.0" authors = ["Jonathan Kelley"] edition = "2018" description = "Dioxus VirtualDOM renderer for a remote webview instance" @@ -12,7 +12,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", features = ["serialize"] } +dioxus-core = { path = "../core", version = "^0.1.3", features = ["serialize"] } argh = "0.1.4" serde = "1.0.120" serde_json = "1.0.61" @@ -20,7 +20,7 @@ thiserror = "1.0.23" log = "0.4.13" html-escape = "0.2.9" wry = "0.12.2" -futures-channel = "0.3.18" +futures-channel = "0.3" tokio = { version = "1.12.0", features = [ "sync", "rt-multi-thread", diff --git a/packages/desktop/src/lib.rs b/packages/desktop/src/lib.rs index 59654aeb9..7de3bdd8c 100644 --- a/packages/desktop/src/lib.rs +++ b/packages/desktop/src/lib.rs @@ -1,16 +1,10 @@ //! Dioxus Desktop Renderer //! //! Render the Dioxus VirtualDom using the platform's native WebView implementation. -//! mod cfg; mod escape; mod events; -pub use wry; -pub use wry::application as tao; - -// mod desktop_context; - use cfg::DesktopConfig; use dioxus_core::*; use std::{ @@ -18,15 +12,17 @@ use std::{ sync::atomic::AtomicBool, sync::{Arc, RwLock}, }; +use tao::{ + accelerator::{Accelerator, SysMods}, + event::{Event, StartCause, WindowEvent}, + event_loop::{ControlFlow, EventLoop, EventLoopWindowTarget}, + keyboard::{KeyCode, ModifiersState}, + menu::{MenuBar, MenuItem}, + window::{Window, WindowId}, +}; +pub use wry; +pub use wry::application as tao; use wry::{ - application::{ - accelerator::{Accelerator, SysMods}, - event::{Event, StartCause, WindowEvent}, - event_loop::{ControlFlow, EventLoop, EventLoopWindowTarget}, - keyboard::{KeyCode, ModifiersState}, - menu::{MenuBar, MenuItem}, - window::{Window, WindowId}, - }, webview::RpcRequest, webview::{WebView, WebViewBuilder}, }; diff --git a/packages/html/Cargo.toml b/packages/html/Cargo.toml index 08e767ea1..6083203df 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -12,8 +12,7 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3"} -# Serialize the Edits for use in Webview/Liveview instances +dioxus-core = { path = "../core", version = "^0.1.3" } serde = { version = "1", features = ["derive"], optional = true } serde_repr = { version = "0.1.7", optional = true } diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index 2c1d89d4e..e12468436 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -11,9 +11,9 @@ keywords = ["dom", "ui", "gui", "react", "wasm"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -dioxus-core = { path = "../core", version ="^0.1.3", default-features = false } -dioxus-html = { path = "../html", version ="^0.1.0", default-features = false } -dioxus-core-macro = { path = "../core-macro", version ="^0.1.2"} +dioxus-core = { path = "../core", version = "^0.1.3", default-features = false } +dioxus-html = { path = "../html", version = "^0.1.0", default-features = false } +dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } web-sys = { version = "0.3", features = [ "Attr", @@ -33,7 +33,7 @@ serde_urlencoded = "0.7" wasm-bindgen = "0.2" js-sys = "0.3" -gloo = "0.5" +gloo = "0.4" route-recognizer = "0.3.1" url = "2.2.2" url_serde = "0.2.0" diff --git a/src/lib.rs b/src/lib.rs index 773aed0cb..98d99449a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -182,9 +182,6 @@ //! We've put a lot of work into making Dioxus ergonomic and *familiar*. //! Our target audience is TypeSrcipt developers looking to switch to Rust for the web - so we need to be comparabale to React. -// Just a heads-up, the core functionality of dioxus rests in Dioxus-Core. This crate just wraps a bunch of utilities -// together and exports their namespaces to something predicatble. -#[cfg(feature = "core")] pub use dioxus_core as core; #[cfg(feature = "hooks")] From 1c516aba6a5dbe11c7a7162f3d65625e62461f03 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sat, 18 Dec 2021 15:49:30 -0500 Subject: [PATCH 16/21] chore: adjust semantics of placeholders and fragments --- packages/core/src/diff.rs | 55 +++++++++++++-------- packages/core/src/nodes.rs | 89 ++++++++++++++++++---------------- packages/core/tests/diffing.rs | 14 +++--- 3 files changed, 89 insertions(+), 69 deletions(-) diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs index 5783a696e..b1d4818a2 100644 --- a/packages/core/src/diff.rs +++ b/packages/core/src/diff.rs @@ -501,9 +501,16 @@ impl<'bump> DiffState<'bump> { self.diff_component_nodes(old_node, new_node, *old, *new) } (Fragment(old), Fragment(new)) => self.diff_fragment_nodes(old, new), - (Placeholder(old), Placeholder(new)) => new.dom_id.set(old.dom_id.get()), + (Placeholder(old), Placeholder(new)) => self.diff_placeholder_nodes(old, new), (Element(old), Element(new)) => self.diff_element_nodes(old, new, old_node, new_node), + // The normal pathway still works, but generates slightly weird instructions + // This pathway just ensures we get create and replace + (Placeholder(_), Fragment(new)) => { + self.stack + .create_children(new.children, MountType::Replace { old: old_node }); + } + // Anything else is just a basic replace and create ( Component(_) | Fragment(_) | Text(_) | Element(_) | Placeholder(_), @@ -634,7 +641,9 @@ impl<'bump> DiffState<'bump> { } // todo: this is for the "settext" optimization - // it works, but i'm not sure if it's the direction we want to take + // it works, but i'm not sure if it's the direction we want to take right away + // I haven't benchmarked the performance imporvemenet yet. Perhaps + // we can make it a config? // match (old.children.len(), new.children.len()) { // (0, 0) => {} @@ -754,6 +763,11 @@ impl<'bump> DiffState<'bump> { self.diff_children(old.children, new.children); } + // probably will get inlined + fn diff_placeholder_nodes(&mut self, old: &'bump VPlaceholder, new: &'bump VPlaceholder) { + new.dom_id.set(old.dom_id.get()) + } + // ============================================= // Utilities for creating new diff instructions // ============================================= @@ -784,23 +798,26 @@ impl<'bump> DiffState<'bump> { (_, []) => { self.remove_nodes(old, true); } - ([VNode::Placeholder(old_anchor)], [VNode::Placeholder(new_anchor)]) => { - old_anchor.dom_id.set(new_anchor.dom_id.get()); - } - ([VNode::Placeholder(_)], _) => { - self.stack - .create_children(new, MountType::Replace { old: &old[0] }); - } - (_, [VNode::Placeholder(_)]) => { - let new: &'bump VNode<'bump> = &new[0]; - if let Some(first_old) = old.get(0) { - self.remove_nodes(&old[1..], true); - self.stack - .create_node(new, MountType::Replace { old: first_old }); - } else { - self.stack.create_node(new, MountType::Append {}); - } - } + + // todo: placeholders explicitly replace fragments + // + // ([VNode::Placeholder(old_anchor)], [VNode::Placeholder(new_anchor)]) => { + // old_anchor.dom_id.set(new_anchor.dom_id.get()); + // } + // ([VNode::Placeholder(_)], _) => { + // self.stack + // .create_children(new, MountType::Replace { old: &old[0] }); + // } + // (_, [VNode::Placeholder(_)]) => { + // let new: &'bump VNode<'bump> = &new[0]; + // if let Some(first_old) = old.get(0) { + // self.remove_nodes(&old[1..], true); + // self.stack + // .create_node(new, MountType::Replace { old: first_old }); + // } else { + // self.stack.create_node(new, MountType::Append {}); + // } + // } _ => { let new_is_keyed = new[0].key().is_some(); let old_is_keyed = old[0].key().is_some(); diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index 1f8b8b1c7..fd0fd3e3c 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -177,9 +177,11 @@ impl Debug for VNode<'_> { .debug_struct("VNode::VElement") .field("name", &el.tag_name) .field("key", &el.key) + .field("attrs", &el.attributes) + .field("children", &el.children) .finish(), VNode::Text(t) => write!(s, "VNode::VText {{ text: {} }}", t.text), - VNode::Placeholder(_) => write!(s, "VNode::VAnchor"), + VNode::Placeholder(_) => write!(s, "VNode::VPlaceholder"), VNode::Fragment(frag) => { write!(s, "VNode::VFragment {{ children: {:?} }}", frag.children) } @@ -225,6 +227,10 @@ pub struct VText<'src> { /// A list of VNodes with no single root. pub struct VFragment<'src> { pub key: Option<&'src str>, + + /// Fragments can never have zero children. Enforced by NodeFactory. + /// + /// You *can* make a fragment with no children, but it's not a valid fragment and your VDom will panic. pub children: &'src [VNode<'src>], } @@ -602,15 +608,15 @@ impl<'a> NodeFactory<'a> { } if nodes.is_empty() { - nodes.push(VNode::Placeholder(self.bump.alloc(VPlaceholder { + VNode::Placeholder(self.bump.alloc(VPlaceholder { dom_id: empty_cell(), - }))); + })) + } else { + VNode::Fragment(VFragment { + children: nodes.into_bump_slice(), + key: None, + }) } - - VNode::Fragment(VFragment { - children: nodes.into_bump_slice(), - key: None, - }) } pub fn fragment_from_iter<'b, 'c>( @@ -624,32 +630,34 @@ impl<'a> NodeFactory<'a> { } if nodes.is_empty() { - nodes.push(VNode::Placeholder(self.bump.alloc(VPlaceholder { + VNode::Placeholder(self.bump.alloc(VPlaceholder { dom_id: empty_cell(), - }))); - } + })) + } else { + let children = nodes.into_bump_slice(); - let children = nodes.into_bump_slice(); - - if cfg!(debug_assertions) && children.len() > 1 && children.last().unwrap().key().is_none() - { - // todo: make the backtrace prettier or remove it altogether - log::error!( - r#" + if cfg!(debug_assertions) + && children.len() > 1 + && children.last().unwrap().key().is_none() + { + // todo: make the backtrace prettier or remove it altogether + log::error!( + r#" Warning: Each child in an array or iterator should have a unique "key" prop. Not providing a key will lead to poor performance with lists. See docs.rs/dioxus for more information. ------------- {:?} "#, - backtrace::Backtrace::new() - ); - } + backtrace::Backtrace::new() + ); + } - VNode::Fragment(VFragment { - children, - key: None, - }) + VNode::Fragment(VFragment { + children, + key: None, + }) + } } // this isn't quite feasible yet @@ -658,28 +666,24 @@ impl<'a> NodeFactory<'a> { self, node_iter: impl IntoIterator>, ) -> Element<'a> { - let bump = self.bump; - let mut nodes = bumpalo::collections::Vec::new_in(bump); + let mut nodes = bumpalo::collections::Vec::new_in(self.bump); for node in node_iter { nodes.push(node.into_vnode(self)); } if nodes.is_empty() { - nodes.push(VNode::Placeholder(bump.alloc(VPlaceholder { + Some(VNode::Placeholder(self.bump.alloc(VPlaceholder { dom_id: empty_cell(), - }))); + }))) + } else { + let children = nodes.into_bump_slice(); + + Some(VNode::Fragment(VFragment { + children, + key: None, + })) } - - let children = nodes.into_bump_slice(); - - // TODO - // We need a dedicated path in the rsx! macro that will trigger the "you need keys" warning - - Some(VNode::Fragment(VFragment { - children, - key: None, - })) } } @@ -749,10 +753,9 @@ impl<'a> IntoVNode<'a> for Option> { fn into_vnode(self, cx: NodeFactory<'a>) -> VNode<'a> { match self { Some(lazy) => lazy.call(cx), - None => VNode::Fragment(VFragment { - children: &[], - key: None, - }), + None => VNode::Placeholder(cx.bump.alloc(VPlaceholder { + dom_id: empty_cell(), + })), } } } diff --git a/packages/core/tests/diffing.rs b/packages/core/tests/diffing.rs index a1afb8aa2..b8c86e615 100644 --- a/packages/core/tests/diffing.rs +++ b/packages/core/tests/diffing.rs @@ -184,12 +184,13 @@ fn empty_fragments_create_anchors_with_many_children() { create.edits, [CreatePlaceholder { root: 1 }, AppendChildren { many: 1 }] ); + assert_eq!( change.edits, [ CreateElement { + tag: "div", root: 2, - tag: "div" }, CreateTextNode { text: "hello: 0", @@ -197,8 +198,8 @@ fn empty_fragments_create_anchors_with_many_children() { }, AppendChildren { many: 1 }, CreateElement { + tag: "div", root: 4, - tag: "div" }, CreateTextNode { text: "hello: 1", @@ -206,15 +207,15 @@ fn empty_fragments_create_anchors_with_many_children() { }, AppendChildren { many: 1 }, CreateElement { + tag: "div", root: 6, - tag: "div" }, CreateTextNode { text: "hello: 2", root: 7 }, AppendChildren { many: 1 }, - ReplaceWith { m: 3, root: 1 } + ReplaceWith { root: 1, m: 3 } ] ); } @@ -257,13 +258,12 @@ fn many_items_become_fragment() { ] ); - // note: the ID gets reused assert_eq!( change.edits, [ - Remove { root: 3 }, - CreatePlaceholder { root: 4 }, + CreatePlaceholder { root: 5 }, ReplaceWith { root: 1, m: 1 }, + Remove { root: 3 }, ] ); } From 934de21dd673b1b79904a3249998427f11428426 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Sat, 18 Dec 2021 23:03:59 -0500 Subject: [PATCH 17/21] wip: miri stress tets --- Cargo.toml | 4 +- packages/core/examples/handlerror.rs | 9 +- packages/core/src/component.rs | 4 +- packages/core/src/diff.rs | 21 +-- packages/core/src/lazynodes.rs | 19 ++- packages/core/src/nodes.rs | 2 +- packages/core/src/scope.rs | 81 ++++++++++-- packages/core/src/scopearena.rs | 183 ++++++++++++++------------- packages/core/src/virtual_dom.rs | 151 +++++++++++----------- packages/core/tests/earlyabort.rs | 80 ++++++++++++ packages/core/tests/miri_stress.rs | 126 ++++++++++++++++++ packages/desktop/src/lib.rs | 2 + packages/router/Cargo.toml | 21 ++- packages/router/src/lib.rs | 143 ++------------------- packages/router/src/platform/web.rs | 126 ++++++++++++++++++ packages/router/src/utils.rs | 4 +- 16 files changed, 641 insertions(+), 335 deletions(-) create mode 100644 packages/core/tests/earlyabort.rs create mode 100644 packages/core/tests/miri_stress.rs diff --git a/Cargo.toml b/Cargo.toml index 349a17495..44750d463 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,8 +33,8 @@ html = ["dioxus-html"] router = ["dioxus-router"] liveview = ["dioxus-liveview"] ssr = ["dioxus-ssr"] -web = ["dioxus-web"] -desktop = ["dioxus-desktop"] +web = ["dioxus-web", "dioxus-router/web"] +desktop = ["dioxus-desktop", "dioxus-router/desktop"] mobile = ["dioxus-mobile"] diff --git a/packages/core/examples/handlerror.rs b/packages/core/examples/handlerror.rs index c3283c32b..0de55333e 100644 --- a/packages/core/examples/handlerror.rs +++ b/packages/core/examples/handlerror.rs @@ -7,4 +7,11 @@ use dioxus_core::prelude::*; use thiserror::Error; -fn main() {} +fn main() { + + /* + If a component returns None, do we leave it the same way it was before? + We spent all this time wiping the component + + */ +} diff --git a/packages/core/src/component.rs b/packages/core/src/component.rs index 75a3d4e17..71de3cf99 100644 --- a/packages/core/src/component.rs +++ b/packages/core/src/component.rs @@ -40,7 +40,7 @@ impl<'a, const A: bool> FragmentBuilder<'a, A> { /// ## Example /// /// ```rust, ignore -/// fn App(cx: Context, props: &()) -> Element { +/// fn App(cx: Scope<()>) -> Element { /// cx.render(rsx!{ /// CustomCard { /// h1 {}2 @@ -54,7 +54,7 @@ impl<'a, const A: bool> FragmentBuilder<'a, A> { /// children: Element /// } /// -/// fn CustomCard(cx: Context, props: &CardProps) -> Element { +/// fn CustomCard(cx: Scope) -> Element { /// cx.render(rsx!{ /// div { /// h1 {"Title card"} diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs index b1d4818a2..7a5e00810 100644 --- a/packages/core/src/diff.rs +++ b/packages/core/src/diff.rs @@ -471,16 +471,16 @@ impl<'bump> DiffState<'bump> { ); // Run the scope for one iteration to initialize it - if self.scopes.run_scope(new_idx) { - // Take the node that was just generated from running the component - let nextnode = self.scopes.fin_head(new_idx); - self.stack.create_component(new_idx, nextnode); + self.scopes.run_scope(new_idx); - // todo: subtrees - // if new_component.is_subtree_root.get() { - // self.stack.push_subtree(); - // } - } + // Take the node that was just generated from running the component + let nextnode = self.scopes.fin_head(new_idx); + self.stack.create_component(new_idx, nextnode); + + // todo: subtrees + // if new_component.is_subtree_root.get() { + // self.stack.push_subtree(); + // } // Finally, insert this scope as a seen node. self.mutations.dirty_scopes.insert(new_idx); @@ -735,7 +735,8 @@ impl<'bump> DiffState<'bump> { // React doesn't automatically memoize, but we do. let props_are_the_same = old.comparator.unwrap(); - if (self.force_diff || !props_are_the_same(new)) && self.scopes.run_scope(scope_addr) { + if self.force_diff || !props_are_the_same(new) { + self.scopes.run_scope(scope_addr); self.diff_node( self.scopes.wip_head(scope_addr), self.scopes.fin_head(scope_addr), diff --git a/packages/core/src/lazynodes.rs b/packages/core/src/lazynodes.rs index fb474dc69..2d10622e3 100644 --- a/packages/core/src/lazynodes.rs +++ b/packages/core/src/lazynodes.rs @@ -35,7 +35,6 @@ enum StackNodeStorage<'a, 'b> { } impl<'a, 'b> LazyNodes<'a, 'b> { - pub fn new_some(_val: F) -> Option where F: FnOnce(NodeFactory<'a>) -> VNode<'a> + 'b, @@ -43,6 +42,24 @@ impl<'a, 'b> LazyNodes<'a, 'b> { Some(Self::new(_val)) } + /// force this call onto the stack + pub fn new_boxed(_val: F) -> Option + where + F: FnOnce(NodeFactory<'a>) -> VNode<'a> + 'b, + { + // there's no way to call FnOnce without a box, so we need to store it in a slot and use static dispatch + let mut slot = Some(_val); + + let val = move |fac: Option>| { + let inner = slot.take().unwrap(); + fac.map(inner) + }; + + Some(Self { + inner: StackNodeStorage::Heap(Box::new(val)), + }) + } + pub fn new(_val: F) -> Self where F: FnOnce(NodeFactory<'a>) -> VNode<'a> + 'b, diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index fd0fd3e3c..a6f288a52 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -83,7 +83,7 @@ pub enum VNode<'src> { /// # Example /// /// ```rust, ignore - /// fn Example(cx: Context, props: &()) -> Element { + /// fn Example(cx: Scope<()>) -> Element { /// todo!() /// } /// diff --git a/packages/core/src/scope.rs b/packages/core/src/scope.rs index 6289811e0..40bcd8aca 100644 --- a/packages/core/src/scope.rs +++ b/packages/core/src/scope.rs @@ -1,7 +1,6 @@ use crate::innerlude::*; use futures_channel::mpsc::UnboundedSender; -use smallvec::SmallVec; use std::{ any::{Any, TypeId}, cell::{Cell, RefCell}, @@ -27,7 +26,7 @@ use bumpalo::{boxed::Box as BumpBox, Bump}; /// name: String /// } /// -/// fn Example(cx: Context, props: &ExampleProps) -> Element { +/// fn Example(cx: Scope) -> Element { /// cx.render(rsx!{ div {"Hello, {cx.props.name}"} }) /// } /// ``` @@ -62,7 +61,7 @@ impl<'a, P> std::ops::Deref for Scope<'a, P> { #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub struct ScopeId(pub usize); -/// Every component in Dioxus is represented by a `Scope`. +/// Every component in Dioxus is represented by a `ScopeState`. /// /// Scopes contain the state for hooks, the component's props, and other lifecycle information. /// @@ -93,7 +92,9 @@ pub struct ScopeState { pub(crate) items: RefCell>, pub(crate) hook_arena: Bump, - pub(crate) hook_vals: RefCell>, + + pub(crate) hook_vals: RefCell>, + pub(crate) hook_idx: Cell, pub(crate) shared_contexts: RefCell>>, @@ -141,7 +142,7 @@ impl ScopeState { /// # Example /// /// ```rust, ignore - /// fn App(cx: Context, props: &()) -> Element { + /// fn App(cx: Scope<()>) -> Element { /// todo!(); /// rsx!(cx, div { "Subtree {id}"}) /// }; @@ -250,9 +251,8 @@ impl ScopeState { /// Get the Root Node of this scope pub fn root_node(&self) -> &VNode { - todo!("Portals have changed how we address nodes. Still fixing this, sorry."); - // let node = *self.wip_frame().nodes.borrow().get(0).unwrap(); - // unsafe { std::mem::transmute(&*node) } + let node = unsafe { &*self.wip_frame().node.get() }; + unsafe { std::mem::transmute(node) } } /// This method enables the ability to expose state to children further down the VirtualDOM Tree. @@ -329,6 +329,8 @@ impl ScopeState { let pinned_fut: Pin> = boxed_fut.into(); // erase the 'src lifetime for self-referential storage + // todo: provide a miri test around this + // concerned about segfaulting let self_ref_fut = unsafe { std::mem::transmute(pinned_fut) }; // Push the future into the tasks @@ -358,9 +360,8 @@ impl ScopeState { }; match rsx { Some(s) => Some(s.call(fac)), - None => todo!(), + None => todo!("oh no no nodes"), } - // rsx.map(|f| f.call(fac)) } /// Store a value between renders @@ -463,24 +464,78 @@ impl ScopeState { pub(crate) fn bump(&self) -> &Bump { &self.wip_frame().bump } + + pub(crate) fn drop_hooks(&mut self) { + self.hook_vals.get_mut().drain(..).for_each(|state| { + let as_mut = unsafe { &mut *state }; + let boxed = unsafe { bumpalo::boxed::Box::from_raw(as_mut) }; + drop(boxed); + }); + } + + pub(crate) fn reset(&mut self) { + // we're just reusing scopes so we need to clear it out + self.drop_hooks(); + + self.hook_idx.set(0); + + self.hook_arena.reset(); + self.shared_contexts.get_mut().clear(); + self.parent_scope = None; + self.generation.set(0); + self.is_subtree_root.set(false); + self.subtree.set(0); + + self.frames[0].reset(); + self.frames[1].reset(); + + let SelfReferentialItems { + borrowed_props, + listeners, + tasks, + } = self.items.get_mut(); + + borrowed_props.clear(); + listeners.clear(); + tasks.clear(); + } +} + +impl Drop for ScopeState { + fn drop(&mut self) { + self.drop_hooks(); + } } pub(crate) struct BumpFrame { pub bump: Bump, - pub nodes: Cell<*const VNode<'static>>, + pub node: Cell<*const VNode<'static>>, } impl BumpFrame { pub(crate) fn new(capacity: usize) -> Self { let bump = Bump::with_capacity(capacity); let node = &*bump.alloc(VText { - text: "asd", + text: "placeholdertext", dom_id: Default::default(), is_static: false, }); let node = bump.alloc(VNode::Text(unsafe { std::mem::transmute(node) })); let nodes = Cell::new(node as *const _); - Self { bump, nodes } + Self { bump, node: nodes } + } + + pub(crate) fn reset(&mut self) { + self.bump.reset(); + let node = self.bump.alloc(VText { + text: "placeholdertext", + dom_id: Default::default(), + is_static: false, + }); + let node = self + .bump + .alloc(VNode::Text(unsafe { std::mem::transmute(node) })); + self.node.set(node as *const _); } } diff --git a/packages/core/src/scopearena.rs b/packages/core/src/scopearena.rs index 9afb80866..a08455895 100644 --- a/packages/core/src/scopearena.rs +++ b/packages/core/src/scopearena.rs @@ -21,14 +21,15 @@ pub(crate) struct Heuristic { // // has an internal heuristics engine to pre-allocate arenas to the right size pub(crate) struct ScopeArena { - bump: Bump, pub pending_futures: RefCell>, scope_counter: Cell, + pub(crate) sender: UnboundedSender, + bump: Bump, + pub scopes: RefCell>, pub heuristics: RefCell>, free_scopes: RefCell>, nodes: RefCell>>, - pub(crate) sender: UnboundedSender, } impl ScopeArena { @@ -51,6 +52,7 @@ impl ScopeArena { let node = bump.alloc(VNode::Element(el)); let mut nodes = Slab::new(); let root_id = nodes.insert(unsafe { std::mem::transmute(node as *const _) }); + debug_assert_eq!(root_id, 0); Self { @@ -88,63 +90,73 @@ impl ScopeArena { let new_scope_id = ScopeId(self.scope_counter.get()); self.scope_counter.set(self.scope_counter.get() + 1); - if let Some(old_scope) = self.free_scopes.borrow_mut().pop() { - let scope = unsafe { &mut *old_scope }; + /* + This scopearena aggressively reuse old scopes when possible. + We try to minimize the new allocations for props/arenas. - scope.caller.set(caller); - scope.parent_scope = parent_scope; - scope.height = height; - scope.subtree = Cell::new(subtree); - scope.our_arena_idx = new_scope_id; - scope.container = container; + However, this will probably lead to some sort of fragmentation. + I'm not exactly sure how to improve this today. + */ + match self.free_scopes.borrow_mut().pop() { + // No free scope, make a new scope + None => { + let (node_capacity, hook_capacity) = self + .heuristics + .borrow() + .get(&fc_ptr) + .map(|h| (h.node_arena_size, h.hook_arena_size)) + .unwrap_or_default(); - let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); - debug_assert!(any_item.is_none()); - } else { - let (node_capacity, hook_capacity) = { - let heuristics = self.heuristics.borrow(); - if let Some(heuristic) = heuristics.get(&fc_ptr) { - (heuristic.node_arena_size, heuristic.hook_arena_size) - } else { - (0, 0) - } - }; + let frames = [BumpFrame::new(node_capacity), BumpFrame::new(node_capacity)]; - let frames = [BumpFrame::new(node_capacity), BumpFrame::new(node_capacity)]; + let scope = self.bump.alloc(ScopeState { + sender: self.sender.clone(), + container, + our_arena_idx: new_scope_id, + parent_scope, + height, + frames, + subtree: Cell::new(subtree), + is_subtree_root: Cell::new(false), - let scope = self.bump.alloc(ScopeState { - sender: self.sender.clone(), - container, - our_arena_idx: new_scope_id, - parent_scope, - height, - frames, - subtree: Cell::new(subtree), - is_subtree_root: Cell::new(false), + caller: Cell::new(caller), + generation: 0.into(), - caller: Cell::new(caller), - generation: 0.into(), + shared_contexts: Default::default(), - shared_contexts: Default::default(), + items: RefCell::new(SelfReferentialItems { + listeners: Default::default(), + borrowed_props: Default::default(), + tasks: Default::default(), + }), - items: RefCell::new(SelfReferentialItems { - listeners: Default::default(), - borrowed_props: Default::default(), - tasks: Default::default(), - }), + hook_arena: Bump::new(), + hook_vals: RefCell::new(Vec::with_capacity(hook_capacity)), + hook_idx: Default::default(), + }); - hook_arena: Bump::new(), - hook_vals: RefCell::new(smallvec::SmallVec::with_capacity(hook_capacity)), - hook_idx: Default::default(), - }); + let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); + debug_assert!(any_item.is_none()); + } - let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); - debug_assert!(any_item.is_none()); + // Reuse a free scope + Some(old_scope) => { + let scope = unsafe { &mut *old_scope }; + scope.caller.set(caller); + scope.parent_scope = parent_scope; + scope.height = height; + scope.subtree = Cell::new(subtree); + scope.our_arena_idx = new_scope_id; + scope.container = container; + let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); + debug_assert!(any_item.is_none()); + } } new_scope_id } + // Removes a scope and its descendents from the arena pub fn try_remove(&self, id: ScopeId) -> Option<()> { self.ensure_drop_safety(id); @@ -152,34 +164,7 @@ impl ScopeArena { // - ensure_drop_safety ensures that no references to this scope are in use // - this raw pointer is removed from the map let scope = unsafe { &mut *self.scopes.borrow_mut().remove(&id).unwrap() }; - - // we're just reusing scopes so we need to clear it out - scope.hook_vals.get_mut().drain(..).for_each(|state| { - let as_mut = unsafe { &mut *state }; - let boxed = unsafe { bumpalo::boxed::Box::from_raw(as_mut) }; - drop(boxed); - }); - scope.hook_idx.set(0); - scope.hook_arena.reset(); - - scope.shared_contexts.get_mut().clear(); - scope.parent_scope = None; - scope.generation.set(0); - scope.is_subtree_root.set(false); - scope.subtree.set(0); - - scope.frames[0].bump.reset(); - scope.frames[1].bump.reset(); - - let SelfReferentialItems { - borrowed_props, - listeners, - tasks, - } = scope.items.get_mut(); - - borrowed_props.clear(); - listeners.clear(); - tasks.clear(); + scope.reset(); self.free_scopes.borrow_mut().push(scope); @@ -245,7 +230,9 @@ impl ScopeArena { } } - pub(crate) fn run_scope(&self, id: ScopeId) -> bool { + // pub(crate) fn run_scope(&self, id: ScopeId) -> bool { + + pub(crate) fn run_scope(&self, id: ScopeId) { // Cycle to the next frame and then reset it // This breaks any latent references, invalidating every pointer referencing into it. // Remove all the outdated listeners @@ -278,6 +265,11 @@ impl ScopeArena { let render: &dyn Fn(&ScopeState) -> Element = unsafe { &*scope.caller.get() }; + /* + If the component returns None, then we fill in a placeholder node. This will wipe what was there. + + An alternate approach is to leave the Real Dom the same, but that can lead to safety issues and a lot more checks. + */ if let Some(node) = render(scope) { if !scope.items.borrow().tasks.is_empty() { self.pending_futures.borrow_mut().insert(id); @@ -285,19 +277,20 @@ impl ScopeArena { let frame = scope.wip_frame(); let node = frame.bump.alloc(node); - frame.nodes.set(unsafe { std::mem::transmute(node) }); - - // make the "wip frame" contents the "finished frame" - // any future dipping into completed nodes after "render" will go through "fin head" - scope.cycle_frame(); - true + frame.node.set(unsafe { std::mem::transmute(node) }); } else { - // the component bailed out early - // this leaves the wip frame and all descendents in a state where - // their WIP frames are invalid - // todo: descendents should not cause the app to crash - false + let frame = scope.wip_frame(); + let node = frame + .bump + .alloc(VNode::Placeholder(frame.bump.alloc(VPlaceholder { + dom_id: Default::default(), + }))); + frame.node.set(unsafe { std::mem::transmute(node) }); } + + // make the "wip frame" contents the "finished frame" + // any future dipping into completed nodes after "render" will go through "fin head" + scope.cycle_frame(); } pub fn call_listener_with_bubbling(&self, event: UserEvent, element: ElementId) { @@ -328,7 +321,7 @@ impl ScopeArena { pub fn wip_head(&self, id: ScopeId) -> &VNode { let scope = self.get_scope(id).unwrap(); let frame = scope.wip_frame(); - let node = unsafe { &*frame.nodes.get() }; + let node = unsafe { &*frame.node.get() }; unsafe { std::mem::transmute::<&VNode, &VNode>(node) } } @@ -336,7 +329,7 @@ impl ScopeArena { pub fn fin_head(&self, id: ScopeId) -> &VNode { let scope = self.get_scope(id).unwrap(); let frame = scope.fin_frame(); - let node = unsafe { &*frame.nodes.get() }; + let node = unsafe { &*frame.node.get() }; unsafe { std::mem::transmute::<&VNode, &VNode>(node) } } @@ -344,3 +337,19 @@ impl ScopeArena { self.fin_head(id) } } + +// when dropping the virtualdom, we need to make sure and drop everything important +impl Drop for ScopeArena { + fn drop(&mut self) { + for (_, scopeptr) in self.scopes.get_mut().drain() { + let scope = unsafe { bumpalo::boxed::Box::from_raw(scopeptr) }; + drop(scope); + } + + // these are probably complete invalid unfortunately ? + for scopeptr in self.free_scopes.get_mut().drain(..) { + let scope = unsafe { bumpalo::boxed::Box::from_raw(scopeptr) }; + drop(scope); + } + } +} diff --git a/packages/core/src/virtual_dom.rs b/packages/core/src/virtual_dom.rs index 23d7570cc..13551d337 100644 --- a/packages/core/src/virtual_dom.rs +++ b/packages/core/src/virtual_dom.rs @@ -1,4 +1,4 @@ -//! # VirtualDOM Implementation for Rust +//! # VirtualDom Implementation for Rust //! //! This module provides the primary mechanics to create a hook-based, concurrent VDOM for Rust. @@ -23,7 +23,7 @@ use std::{any::Any, collections::VecDeque, pin::Pin, sync::Arc, task::Poll}; /// title: String /// } /// -/// fn App(cx: Context, props: &AppProps) -> Element { +/// fn App(cx: Scope) -> Element { /// cx.render(rsx!( /// div {"hello, {cx.props.title}"} /// )) @@ -33,7 +33,7 @@ use std::{any::Any, collections::VecDeque, pin::Pin, sync::Arc, task::Poll}; /// Components may be composed to make complex apps. /// /// ```rust, ignore -/// fn App(cx: Context, props: &AppProps) -> Element { +/// fn App(cx: Scope) -> Element { /// cx.render(rsx!( /// NavBar { routes: ROUTES } /// Title { "{cx.props.title}" } @@ -81,7 +81,7 @@ use std::{any::Any, collections::VecDeque, pin::Pin, sync::Arc, task::Poll}; /// Putting everything together, you can build an event loop around Dioxus by using the methods outlined above. /// /// ```rust, ignore -/// fn App(cx: Context, props: &()) -> Element { +/// fn App(cx: Scope<()>) -> Element { /// cx.render(rsx!{ /// div { "Hello World" } /// }) @@ -103,25 +103,24 @@ use std::{any::Any, collections::VecDeque, pin::Pin, sync::Arc, task::Poll}; /// } /// ``` pub struct VirtualDom { - base_scope: ScopeId, - - // it's stored here so the props are dropped when the VirtualDom is dropped - _root_caller: Box Fn(&'r ScopeState) -> Element<'r> + 'static>, - scopes: Box, - receiver: UnboundedReceiver, - - sender: UnboundedSender, - + // should always be ScopeId(0) + base_scope: ScopeId, pending_messages: VecDeque, - dirty_scopes: IndexSet, + + channel: ( + UnboundedSender, + UnboundedReceiver, + ), + + caller: *mut dyn for<'r> Fn(&'r ScopeState) -> Element<'r>, } // Methods to create the VirtualDom impl VirtualDom { - /// Create a new VirtualDOM with a component that does not have special props. + /// Create a new VirtualDom with a component that does not have special props. /// /// # Description /// @@ -140,12 +139,12 @@ impl VirtualDom { /// let dom = VirtualDom::new(Example); /// ``` /// - /// Note: the VirtualDOM is not progressed, you must either "run_with_deadline" or use "rebuild" to progress it. + /// Note: the VirtualDom is not progressed, you must either "run_with_deadline" or use "rebuild" to progress it. pub fn new(root: Component<()>) -> Self { Self::new_with_props(root, ()) } - /// Create a new VirtualDOM with the given properties for the root component. + /// Create a new VirtualDom with the given properties for the root component. /// /// # Description /// @@ -169,15 +168,18 @@ impl VirtualDom { /// let dom = VirtualDom::new(Example); /// ``` /// - /// Note: the VirtualDOM is not progressed on creation. You must either "run_with_deadline" or use "rebuild" to progress it. + /// Note: the VirtualDom is not progressed on creation. You must either "run_with_deadline" or use "rebuild" to progress it. /// /// ```rust, ignore /// let mut dom = VirtualDom::new_with_props(Example, SomeProps { name: "jane" }); /// let mutations = dom.rebuild(); /// ``` pub fn new_with_props(root: Component

, root_props: P) -> Self { - let (sender, receiver) = futures_channel::mpsc::unbounded::(); - Self::new_with_props_and_scheduler(root, root_props, sender, receiver) + Self::new_with_props_and_scheduler( + root, + root_props, + futures_channel::mpsc::unbounded::(), + ) } /// Launch the VirtualDom, but provide your own channel for receiving and sending messages into the scheduler @@ -192,26 +194,26 @@ impl VirtualDom { pub fn new_with_props_and_scheduler( root: Component

, root_props: P, - sender: UnboundedSender, - receiver: UnboundedReceiver, + channel: ( + UnboundedSender, + UnboundedReceiver, + ), ) -> Self { - // move these two things onto the heap so we have stable ptrs - let scopes = Box::new(ScopeArena::new(sender.clone())); + // move these two things onto the heap so we have stable ptrs even if the VirtualDom itself is moved + let scopes = Box::new(ScopeArena::new(channel.0.clone())); let root_props = Box::new(root_props); - // create the root caller which will properly drop its props when the VirtualDom is dropped - let mut _root_caller: Box Fn(&'r ScopeState) -> Element<'r> + 'static> = - Box::new(move |scope: &ScopeState| -> Element { + // effectively leak the caller so we can drop it when the VirtualDom is dropped + let caller: *mut dyn for<'r> Fn(&'r ScopeState) -> Element<'r> = + Box::into_raw(Box::new(move |scope: &ScopeState| -> Element { // Safety: The props at this pointer can never be moved. // Also, this closure will never be ran when the VirtualDom is destroyed. // This is where the root lifetime of the VirtualDom originates. - let props: *const P = root_props.as_ref(); - let props = unsafe { &*props }; - root(Scope { scope, props }) - }); + let props = unsafe { std::mem::transmute::<&P, &P>(root_props.as_ref()) }; + let scp = Scope { scope, props }; + root(scp) + })); - // safety: the raw pointer is aliased or used after this point. - let caller: *mut dyn Fn(&ScopeState) -> Element = _root_caller.as_mut(); let base_scope = scopes.new_with_key(root as _, caller, None, ElementId(0), 0, 0); let mut dirty_scopes = IndexSet::new(); @@ -223,11 +225,10 @@ impl VirtualDom { Self { scopes, base_scope, - receiver, - _root_caller, + caller, pending_messages, dirty_scopes, - sender, + channel, } } @@ -260,7 +261,7 @@ impl VirtualDom { /// let sender = dom.get_scheduler_channel(); /// ``` pub fn get_scheduler_channel(&self) -> futures_channel::mpsc::UnboundedSender { - self.sender.clone() + self.channel.0.clone() } /// Add a new message to the scheduler queue directly. @@ -275,7 +276,7 @@ impl VirtualDom { /// dom.insert_scheduler_message(SchedulerMsg::Immediate(ScopeId(0))); /// ``` pub fn insert_scheduler_message(&self, msg: SchedulerMsg) { - self.sender.unbounded_send(msg).unwrap() + self.channel.0.unbounded_send(msg).unwrap() } /// Check if the [`VirtualDom`] has any pending updates or work to be done. @@ -314,18 +315,18 @@ impl VirtualDom { if self.pending_messages.is_empty() { if self.scopes.pending_futures.borrow().is_empty() { self.pending_messages - .push_front(self.receiver.next().await.unwrap()); + .push_front(self.channel.1.next().await.unwrap()); } else { use futures_util::future::{select, Either}; - match select(PollTasks(&mut self.scopes), self.receiver.next()).await { + match select(PollTasks(&mut self.scopes), self.channel.1.next()).await { Either::Left((_, _)) => {} Either::Right((msg, _)) => self.pending_messages.push_front(msg.unwrap()), } } } - while let Ok(Some(msg)) = self.receiver.try_next() { + while let Ok(Some(msg)) = self.channel.1.try_next() { self.pending_messages.push_front(msg); } @@ -378,7 +379,7 @@ impl VirtualDom { /// # Example /// /// ```rust, ignore - /// fn App(cx: Context, props: &()) -> Element { + /// fn App(cx: Scope<()>) -> Element { /// cx.render(rsx!( div {"hello"} )) /// } /// @@ -416,15 +417,14 @@ impl VirtualDom { if !ran_scopes.contains(&scopeid) { ran_scopes.insert(scopeid); - if self.scopes.run_scope(scopeid) { - let (old, new) = - (self.scopes.wip_head(scopeid), self.scopes.fin_head(scopeid)); - diff_state.stack.push(DiffInstruction::Diff { new, old }); - diff_state.stack.scope_stack.push(scopeid); + self.scopes.run_scope(scopeid); - let scope = scopes.get_scope(scopeid).unwrap(); - diff_state.stack.element_stack.push(scope.container); - } + let (old, new) = (self.scopes.wip_head(scopeid), self.scopes.fin_head(scopeid)); + diff_state.stack.push(DiffInstruction::Diff { new, old }); + diff_state.stack.scope_stack.push(scopeid); + + let scope = scopes.get_scope(scopeid).unwrap(); + diff_state.stack.element_stack.push(scope.container); } } @@ -466,30 +466,29 @@ impl VirtualDom { /// apply_edits(edits); /// ``` pub fn rebuild(&mut self) -> Mutations { + let scope_id = self.base_scope; let mut diff_state = DiffState::new(&self.scopes); - let scope_id = self.base_scope; - if self.scopes.run_scope(scope_id) { - diff_state - .stack - .create_node(self.scopes.fin_head(scope_id), MountType::Append); - - diff_state.stack.element_stack.push(ElementId(0)); - diff_state.stack.scope_stack.push(scope_id); - - diff_state.work(|| false); - } + self.scopes.run_scope(scope_id); + diff_state + .stack + .create_node(self.scopes.fin_head(scope_id), MountType::Append); + diff_state.stack.element_stack.push(ElementId(0)); + diff_state.stack.scope_stack.push(scope_id); + diff_state.work(|| false); diff_state.mutations } - /// Compute a manual diff of the VirtualDOM between states. + /// Compute a manual diff of the VirtualDom between states. /// /// This can be useful when state inside the DOM is remotely changed from the outside, but not propagated as an event. /// /// In this case, every component will be diffed, even if their props are memoized. This method is intended to be used /// to force an update of the DOM when the state of the app is changed outside of the app. /// + /// To force a reflow of the entire VirtualDom, use `ScopeId(0)` as the scope_id. + /// /// # Example /// ```rust, ignore /// #[derive(PartialEq, Props)] @@ -513,10 +512,9 @@ impl VirtualDom { /// ``` pub fn hard_diff<'a>(&'a mut self, scope_id: ScopeId) -> Option> { let mut diff_machine = DiffState::new(&self.scopes); - if self.scopes.run_scope(scope_id) { - diff_machine.force_diff = true; - diff_machine.diff_scope(scope_id); - } + self.scopes.run_scope(scope_id); + diff_machine.force_diff = true; + diff_machine.diff_scope(scope_id); Some(diff_machine.mutations) } @@ -525,7 +523,7 @@ impl VirtualDom { /// Useful when needing to render nodes from outside the VirtualDom, such as in a test. /// /// ```rust - /// fn Base(cx: Context, props: &()) -> Element { + /// fn Base(cx: Scope<()>) -> Element { /// rsx!(cx, div {}) /// } /// @@ -545,7 +543,7 @@ impl VirtualDom { /// Useful when needing to render nodes from outside the VirtualDom, such as in a test. /// /// ```rust - /// fn Base(cx: Context, props: &()) -> Element { + /// fn Base(cx: Scope<()>) -> Element { /// rsx!(cx, div {}) /// } /// @@ -567,7 +565,7 @@ impl VirtualDom { /// /// /// ```rust - /// fn Base(cx: Context, props: &()) -> Element { + /// fn Base(cx: Scope<()>) -> Element { /// rsx!(cx, div {}) /// } /// @@ -589,7 +587,7 @@ impl VirtualDom { /// /// /// ```rust - /// fn Base(cx: Context, props: &()) -> Element { + /// fn Base(cx: Scope<()>) -> Element { /// rsx!(cx, div {}) /// } /// @@ -619,6 +617,17 @@ impl VirtualDom { } } +impl Drop for VirtualDom { + fn drop(&mut self) { + // ensure the root component's caller is dropped + let caller = unsafe { Box::from_raw(self.caller) }; + drop(caller); + + // destroy the root component (which will destroy all of the other scopes) + // load the root node and descend + } +} + #[derive(Debug)] pub enum SchedulerMsg { // events from the host @@ -644,7 +653,7 @@ pub enum SchedulerMsg { /// /// # Example /// ```rust -/// fn App(cx: Context, props: &()) -> Element { +/// fn App(cx: Scope<()>) -> Element { /// rsx!(cx, div { /// onclick: move |_| println!("Clicked!") /// }) diff --git a/packages/core/tests/earlyabort.rs b/packages/core/tests/earlyabort.rs new file mode 100644 index 000000000..713fe7ccb --- /dev/null +++ b/packages/core/tests/earlyabort.rs @@ -0,0 +1,80 @@ +#![allow(unused, non_upper_case_globals, non_snake_case)] + +//! Prove that the dom works normally through virtualdom methods. +//! +//! This methods all use "rebuild" which completely bypasses the scheduler. +//! Hard rebuilds don't consume any events from the event queue. + +use dioxus::{prelude::*, DomEdit, ScopeId}; +use dioxus_core as dioxus; +use dioxus_core_macro::*; +use dioxus_html as dioxus_elements; + +mod test_logging; +use DomEdit::*; + +const IS_LOGGING_ENABLED: bool = false; + +fn new_dom(app: Component

, props: P) -> VirtualDom { + test_logging::set_up_logging(IS_LOGGING_ENABLED); + VirtualDom::new_with_props(app, props) +} + +/// This test ensures that if a component aborts early, it is replaced with a placeholder. +/// In debug, this should also toss a warning. +#[test] +fn test_early_abort() { + const app: Component<()> = |cx| { + let val = cx.use_hook(|_| 0, |f| f); + + *val += 1; + + if *val == 2 { + return None; + } + + rsx!(cx, div { "Hello, world!" }) + }; + + let mut dom = new_dom(app, ()); + + let edits = dom.rebuild(); + assert_eq!( + edits.edits, + [ + CreateElement { + tag: "div", + root: 1, + }, + CreateTextNode { + text: "Hello, world!", + root: 2, + }, + AppendChildren { many: 1 }, + AppendChildren { many: 1 }, + ] + ); + + let edits = dom.hard_diff(ScopeId(0)).unwrap(); + assert_eq!( + edits.edits, + [CreatePlaceholder { root: 3 }, ReplaceWith { root: 1, m: 1 },], + ); + + let edits = dom.hard_diff(ScopeId(0)).unwrap(); + assert_eq!( + edits.edits, + [ + CreateElement { + tag: "div", + root: 2, + }, + CreateTextNode { + text: "Hello, world!", + root: 4, + }, + AppendChildren { many: 1 }, + ReplaceWith { root: 3, m: 1 }, + ] + ); +} diff --git a/packages/core/tests/miri_stress.rs b/packages/core/tests/miri_stress.rs new file mode 100644 index 000000000..c51daa536 --- /dev/null +++ b/packages/core/tests/miri_stress.rs @@ -0,0 +1,126 @@ +/* +Stress Miri as much as possible. + +Prove that we don't leak memory and that our methods are safe. + +Specifically: +- [ ] VirtualDom drops memory safely +- [ ] Borrowed components don't expose invalid pointers +- [ ] Async isn't busted +*/ + +use dioxus::{prelude::*, DomEdit, ScopeId}; +use dioxus_core as dioxus; +use dioxus_core_macro::*; +use dioxus_html as dioxus_elements; + +mod test_logging; +use DomEdit::*; + +const IS_LOGGING_ENABLED: bool = false; + +fn new_dom(app: Component

, props: P) -> VirtualDom { + test_logging::set_up_logging(IS_LOGGING_ENABLED); + VirtualDom::new_with_props(app, props) +} + +/// This test ensures that if a component aborts early, it is replaced with a placeholder. +/// In debug, this should also toss a warning. +#[test] +fn test_memory_leak() { + fn app(cx: Scope<()>) -> Element { + let val = cx.use_hook(|_| 0, |f| f); + + *val += 1; + + if *val == 2 || *val == 4 { + return None; + } + + let name = cx.use_hook(|_| String::from("asd"), |f| f); + + cx.render(rsx!( + div { "Hello, world!" } + child() + child() + child() + child() + child() + child() + borrowed_child(na: name) + borrowed_child(na: name) + borrowed_child(na: name) + borrowed_child(na: name) + borrowed_child(na: name) + )) + } + + fn child(cx: Scope<()>) -> Element { + rsx!(cx, div { + "goodbye world" + }) + } + + #[derive(Props)] + struct BorrowedProps<'a> { + na: &'a str, + } + + fn borrowed_child<'a>(cx: Scope<'a, BorrowedProps<'a>>) -> Element { + rsx!(cx, div { + "goodbye {cx.props.na}" + child() + child() + }) + } + + let mut dom = new_dom(app, ()); + + dom.rebuild(); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); +} + +#[test] +fn memo_works_properly() { + fn app(cx: Scope<()>) -> Element { + let val = cx.use_hook(|_| 0, |f| f); + + *val += 1; + + if *val == 2 || *val == 4 { + return None; + } + + let name = cx.use_hook(|_| String::from("asd"), |f| f); + + cx.render(rsx!( + div { "Hello, world!" } + child(na: "asd".to_string()) + )) + } + + #[derive(PartialEq, Props)] + struct ChildProps { + na: String, + } + + fn child(cx: Scope) -> Element { + rsx!(cx, div { + "goodbye world" + }) + } + + let mut dom = new_dom(app, ()); + + dom.rebuild(); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); +} diff --git a/packages/desktop/src/lib.rs b/packages/desktop/src/lib.rs index 7de3bdd8c..2e962f800 100644 --- a/packages/desktop/src/lib.rs +++ b/packages/desktop/src/lib.rs @@ -64,6 +64,8 @@ pub fn run( let modifiers = ModifiersState::default(); let event_loop = EventLoop::new(); + log::debug!("Starting event loop"); + event_loop.run(move |window_event, event_loop, control_flow| { *control_flow = ControlFlow::Wait; diff --git a/packages/router/Cargo.toml b/packages/router/Cargo.toml index e12468436..41822b97f 100644 --- a/packages/router/Cargo.toml +++ b/packages/router/Cargo.toml @@ -15,6 +15,11 @@ dioxus-core = { path = "../core", version = "^0.1.3", default-features = false } dioxus-html = { path = "../html", version = "^0.1.0", default-features = false } dioxus-core-macro = { path = "../core-macro", version = "^0.1.2" } +serde = "1.0.130" +url = "2.2.2" +url_serde = "0.2.0" +serde_urlencoded = "0.7" + web-sys = { version = "0.3", features = [ "Attr", "Document", @@ -26,21 +31,13 @@ web-sys = { version = "0.3", features = [ "UrlSearchParams", "Window", ], optional = true } - -serde = "1.0.130" - -serde_urlencoded = "0.7" - -wasm-bindgen = "0.2" -js-sys = "0.3" -gloo = "0.4" -route-recognizer = "0.3.1" -url = "2.2.2" -url_serde = "0.2.0" +wasm-bindgen = { version = "0.2", optional = true } +js-sys = { version = "0.3", optional = true } +gloo = { version = "0.4", optional = true } [features] -default = ["web", "derive"] +default = ["derive"] web = ["web-sys"] desktop = [] mobile = [] diff --git a/packages/router/src/lib.rs b/packages/router/src/lib.rs index cadfb8218..0ce88d59b 100644 --- a/packages/router/src/lib.rs +++ b/packages/router/src/lib.rs @@ -6,137 +6,13 @@ use dioxus_core as dioxus; use dioxus_core::prelude::*; use dioxus_core_macro::{rsx, Props}; use dioxus_html as dioxus_elements; -use wasm_bindgen::{JsCast, JsValue}; -use web_sys::{window, Event}; +// use wasm_bindgen::{JsCast, JsValue}; use crate::utils::strip_slash_suffix; pub trait Routable: 'static + Send + Clone + PartialEq {} impl Routable for T where T: 'static + Send + Clone + PartialEq {} -pub struct RouterService { - historic_routes: Vec, - history_service: RefCell, - base_ur: RefCell>, -} - -impl RouterService { - fn push_route(&self, r: R) { - todo!() - // self.historic_routes.borrow_mut().push(r); - } - - fn get_current_route(&self) -> &str { - todo!() - } - - fn update_route_impl(&self, url: String, push: bool) { - let history = web_sys::window().unwrap().history().expect("no history"); - let base = self.base_ur.borrow(); - let path = match base.as_ref() { - Some(base) => { - let path = format!("{}{}", base, url); - if path.is_empty() { - "/".to_string() - } else { - path - } - } - None => url, - }; - - if push { - history - .push_state_with_url(&JsValue::NULL, "", Some(&path)) - .expect("push history"); - } else { - history - .replace_state_with_url(&JsValue::NULL, "", Some(&path)) - .expect("replace history"); - } - let event = Event::new("popstate").unwrap(); - - web_sys::window() - .unwrap() - .dispatch_event(&event) - .expect("dispatch"); - } -} - -/// This hould only be used once per app -/// -/// You can manually parse the route if you want, but the derived `parse` method on `Routable` will also work just fine -pub fn use_router(cx: &ScopeState, mut parse: impl FnMut(&str) -> R + 'static) -> &R { - // for the web, attach to the history api - cx.use_hook( - |f| { - // - use gloo::events::EventListener; - - let base = window() - .unwrap() - .document() - .unwrap() - .query_selector("base[href]") - .ok() - .flatten() - .and_then(|base| { - let base = JsCast::unchecked_into::(base).href(); - let url = web_sys::Url::new(&base).unwrap(); - - if url.pathname() != "/" { - Some(strip_slash_suffix(&base).to_string()) - } else { - None - } - }); - - let location = window().unwrap().location(); - let pathname = location.pathname().unwrap(); - let initial_route = parse(&pathname); - - let service: RouterService = RouterService { - historic_routes: vec![initial_route], - history_service: RefCell::new( - web_sys::window().unwrap().history().expect("no history"), - ), - base_ur: RefCell::new(base), - }; - - // let base = base_url(); - // let url = route.to_path(); - // pending_routes: RefCell::new(vec![]), - // service.history_service.push_state(data, title); - - // cx.provide_state(service); - - let regenerate = cx.schedule_update(); - - // // when "back" is called by the user, we want to to re-render the component - let listener = EventListener::new(&web_sys::window().unwrap(), "popstate", move |_| { - // - regenerate(); - }); - - service - }, - |state| { - let base = state.base_ur.borrow(); - if let Some(base) = base.as_ref() { - // - let path = format!("{}{}", base, state.get_current_route()); - } - let history = state.history_service.borrow(); - - state.historic_routes.last().unwrap() - }, - ) -} - -pub fn use_router_service(cx: &ScopeState) -> Option<&Rc>> { - cx.use_hook(|_| cx.consume_state::>(), |f| f.as_ref()) -} - #[derive(Props)] pub struct LinkProps<'a, R: Routable> { to: R, @@ -161,12 +37,13 @@ pub struct LinkProps<'a, R: Routable> { } pub fn Link<'a, R: Routable>(cx: Scope<'a, LinkProps<'a, R>>) -> Element { - let service = use_router_service::(&cx)?; - cx.render(rsx! { - a { - href: format_args!("{}", (cx.props.href)(&cx.props.to)), - onclick: move |_| service.push_route(cx.props.to.clone()), - // todo!() {&cx.props.children}, - } - }) + let service = todo!(); + // let service: todo!() = use_router_service::(&cx)?; + // cx.render(rsx! { + // a { + // href: format_args!("{}", (cx.props.href)(&cx.props.to)), + // onclick: move |_| service.push_route(cx.props.to.clone()), + // // todo!() {&cx.props.children}, + // } + // }) } diff --git a/packages/router/src/platform/web.rs b/packages/router/src/platform/web.rs index e69de29bb..3630fec85 100644 --- a/packages/router/src/platform/web.rs +++ b/packages/router/src/platform/web.rs @@ -0,0 +1,126 @@ +use web_sys::{window, Event}; +pub struct RouterService { + historic_routes: Vec, + history_service: RefCell, + base_ur: RefCell>, +} + +impl RouterService { + fn push_route(&self, r: R) { + todo!() + // self.historic_routes.borrow_mut().push(r); + } + + fn get_current_route(&self) -> &str { + todo!() + } + + fn update_route_impl(&self, url: String, push: bool) { + let history = web_sys::window().unwrap().history().expect("no history"); + let base = self.base_ur.borrow(); + let path = match base.as_ref() { + Some(base) => { + let path = format!("{}{}", base, url); + if path.is_empty() { + "/".to_string() + } else { + path + } + } + None => url, + }; + + if push { + history + .push_state_with_url(&JsValue::NULL, "", Some(&path)) + .expect("push history"); + } else { + history + .replace_state_with_url(&JsValue::NULL, "", Some(&path)) + .expect("replace history"); + } + let event = Event::new("popstate").unwrap(); + + web_sys::window() + .unwrap() + .dispatch_event(&event) + .expect("dispatch"); + } +} + +pub fn use_router_service(cx: &ScopeState) -> Option<&Rc>> { + cx.use_hook(|_| cx.consume_state::>(), |f| f.as_ref()) +} + +/// This hould only be used once per app +/// +/// You can manually parse the route if you want, but the derived `parse` method on `Routable` will also work just fine +pub fn use_router(cx: &ScopeState, mut parse: impl FnMut(&str) -> R + 'static) -> &R { + // for the web, attach to the history api + cx.use_hook( + #[cfg(not(feature = "web"))] + |_| {}, + #[cfg(feature = "web")] + |f| { + // + use gloo::events::EventListener; + + let base = window() + .unwrap() + .document() + .unwrap() + .query_selector("base[href]") + .ok() + .flatten() + .and_then(|base| { + let base = JsCast::unchecked_into::(base).href(); + let url = web_sys::Url::new(&base).unwrap(); + + if url.pathname() != "/" { + Some(strip_slash_suffix(&base).to_string()) + } else { + None + } + }); + + let location = window().unwrap().location(); + let pathname = location.pathname().unwrap(); + let initial_route = parse(&pathname); + + let service: RouterService = RouterService { + historic_routes: vec![initial_route], + history_service: RefCell::new( + web_sys::window().unwrap().history().expect("no history"), + ), + base_ur: RefCell::new(base), + }; + + // let base = base_url(); + // let url = route.to_path(); + // pending_routes: RefCell::new(vec![]), + // service.history_service.push_state(data, title); + + // cx.provide_state(service); + + let regenerate = cx.schedule_update(); + + // // when "back" is called by the user, we want to to re-render the component + let listener = EventListener::new(&web_sys::window().unwrap(), "popstate", move |_| { + // + regenerate(); + }); + + service + }, + |state| { + let base = state.base_ur.borrow(); + if let Some(base) = base.as_ref() { + // + let path = format!("{}{}", base, state.get_current_route()); + } + let history = state.history_service.borrow(); + + state.historic_routes.last().unwrap() + }, + ) +} diff --git a/packages/router/src/utils.rs b/packages/router/src/utils.rs index a8e9a2c35..48afe0d80 100644 --- a/packages/router/src/utils.rs +++ b/packages/router/src/utils.rs @@ -1,5 +1,5 @@ -use wasm_bindgen::JsCast; -use web_sys::window; +// use wasm_bindgen::JsCast; +// use web_sys::window; pub(crate) fn strip_slash_suffix(path: &str) -> &str { path.strip_suffix('/').unwrap_or(path) From e2e4d431e14e9e91b3301e994363c042400e687e Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 20 Dec 2021 22:33:13 -0500 Subject: [PATCH 18/21] wip: adjust memoization --- packages/core/examples/borrowed.rs | 2 +- packages/core/examples/hooks.rs | 4 - packages/core/examples/works.rs | 31 +- packages/core/src/diff.rs | 193 +++++----- packages/core/src/lib.rs | 18 +- packages/core/src/mutations.rs | 5 + packages/core/src/nodes.rs | 177 +++++----- packages/core/src/scopearena.rs | 355 ------------------- packages/core/src/{scope.rs => scopes.rs} | 408 +++++++++++++++++++--- packages/core/src/virtual_dom.rs | 224 ++++++++---- packages/core/tests/diffing.rs | 2 +- packages/core/tests/earlyabort.rs | 4 +- packages/core/tests/lifecycle.rs | 26 +- packages/core/tests/miri_stress.rs | 184 +++++++++- packages/ssr/src/lib.rs | 2 +- 15 files changed, 932 insertions(+), 703 deletions(-) delete mode 100644 packages/core/src/scopearena.rs rename packages/core/src/{scope.rs => scopes.rs} (55%) diff --git a/packages/core/examples/borrowed.rs b/packages/core/examples/borrowed.rs index 784f48740..f4dc7d955 100644 --- a/packages/core/examples/borrowed.rs +++ b/packages/core/examples/borrowed.rs @@ -20,7 +20,7 @@ struct Borrowed<'a> { fn App2<'a>(cx: Scope<'a, Borrowed<'a>>) -> Element { let g = eat2(&cx); - todo!() + rsx!(cx, "") } fn eat2(s: &ScopeState) {} diff --git a/packages/core/examples/hooks.rs b/packages/core/examples/hooks.rs index 969d9f3f2..131aae0e6 100644 --- a/packages/core/examples/hooks.rs +++ b/packages/core/examples/hooks.rs @@ -4,7 +4,3 @@ use dioxus_core_macro::*; use dioxus_html as dioxus_elements; fn main() {} - -fn App(cx: Scope<()>) -> Element { - todo!() -} diff --git a/packages/core/examples/works.rs b/packages/core/examples/works.rs index f96c40e88..d8e171042 100644 --- a/packages/core/examples/works.rs +++ b/packages/core/examples/works.rs @@ -6,16 +6,15 @@ use dioxus_core_macro::*; use dioxus_html as dioxus_elements; fn main() { - let _ = VirtualDom::new(Parent); + let _ = VirtualDom::new(parent); } -fn Parent(cx: Scope<()>) -> Element { +fn parent(cx: Scope<()>) -> Element { let value = cx.use_hook(|_| String::new(), |f| f); cx.render(rsx! { div { - Child { name: value } - Fragment { "asd" } + child( name: value ) } }) } @@ -25,11 +24,11 @@ struct ChildProps<'a> { name: &'a str, } -fn Child<'a>(cx: Scope<'a, ChildProps<'a>>) -> Element { +fn child<'a>(cx: Scope<'a, ChildProps<'a>>) -> Element { cx.render(rsx! { div { h1 { "it's nested" } - Child2 { name: cx.props.name } + grandchild( name: cx.props.name ) } }) } @@ -39,8 +38,26 @@ struct Grandchild<'a> { name: &'a str, } -fn Child2<'a>(cx: Scope<'a, Grandchild<'a>>) -> Element { +fn grandchild<'a>(cx: Scope<'a, Grandchild>) -> Element<'a> { cx.render(rsx! { div { "Hello {cx.props.name}!" } + great_grandchild( name: cx.props.name ) }) } + +fn great_grandchild<'a>(cx: Scope<'a, Grandchild>) -> Element<'a> { + cx.render(rsx! { + div { + h1 { "it's nested" } + } + }) +} + +/* +can we implement memoization as a wrapper or something? Like we just intercept the +render function? + + + + +*/ diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs index 7a5e00810..9603f1c0f 100644 --- a/packages/core/src/diff.rs +++ b/packages/core/src/diff.rs @@ -239,15 +239,6 @@ impl<'bump> DiffStack<'bump> { } impl<'bump> DiffState<'bump> { - pub fn diff_scope(&mut self, id: ScopeId) { - let (old, new) = (self.scopes.wip_head(id), self.scopes.fin_head(id)); - self.stack.push(DiffInstruction::Diff { old, new }); - self.stack.scope_stack.push(id); - let scope = self.scopes.get_scope(id).unwrap(); - self.stack.element_stack.push(scope.container); - self.work(|| false); - } - /// Progress the diffing for this "fiber" /// /// This method implements a depth-first iterative tree traversal. @@ -415,7 +406,7 @@ impl<'bump> DiffState<'bump> { } // todo: the settext optimization - + // // if children.len() == 1 { // if let VNode::Text(vtext) = children[0] { // self.mutations.set_text(vtext.text, real_id.as_u64()); @@ -436,40 +427,32 @@ impl<'bump> DiffState<'bump> { let parent_idx = self.stack.current_scope().unwrap(); // Insert a new scope into our component list - let parent_scope = self.scopes.get_scope(parent_idx).unwrap(); - let height = parent_scope.height + 1; - let subtree = parent_scope.subtree.get(); - - let parent_scope = self.scopes.get_scope_raw(parent_idx); - let caller = unsafe { std::mem::transmute(vcomponent.caller as *const _) }; - let fc_ptr = vcomponent.user_fc; - - let container = *self.stack.element_stack.last().unwrap(); - - let new_idx = - self.scopes - .new_with_key(fc_ptr, caller, parent_scope, container, height, subtree); + let caller = unsafe { std::mem::transmute(vcomponent.props as *const _) }; + let new_idx = self.scopes.new_with_key( + vcomponent.user_fc, + caller, + Some(parent_idx), + self.stack.element_stack.last().copied().unwrap(), + 0, + ); // Actually initialize the caller's slot with the right address - vcomponent.associated_scope.set(Some(new_idx)); + vcomponent.scope.set(Some(new_idx)); - if !vcomponent.can_memoize { - let cur_scope = self.scopes.get_scope(parent_idx).unwrap(); - let extended = unsafe { std::mem::transmute(vcomponent) }; - cur_scope.items.borrow_mut().borrowed_props.push(extended); - } else { - // the props are currently bump allocated but we need to move them to the heap + match vcomponent.can_memoize { + true => { + // promote the props onto the heap + // when we diff these nodes, we'll want to move it over + vcomponent.props.promote(); + } + false => { + // track this component internally so we know the right drop order + let cur_scope = self.scopes.get_scope(parent_idx).unwrap(); + let extended = unsafe { std::mem::transmute(vcomponent) }; + cur_scope.items.borrow_mut().borrowed_props.push(extended); + } } - // TODO: add noderefs to current noderef list Noderefs - let _new_component = self.scopes.get_scope(new_idx).unwrap(); - - log::debug!( - "initializing component {:?} with height {:?}", - new_idx, - height + 1 - ); - // Run the scope for one iteration to initialize it self.scopes.run_scope(new_idx); @@ -477,11 +460,6 @@ impl<'bump> DiffState<'bump> { let nextnode = self.scopes.fin_head(new_idx); self.stack.create_component(new_idx, nextnode); - // todo: subtrees - // if new_component.is_subtree_root.get() { - // self.stack.push_subtree(); - // } - // Finally, insert this scope as a seen node. self.mutations.dirty_scopes.insert(new_idx); } @@ -494,15 +472,23 @@ impl<'bump> DiffState<'bump> { use VNode::*; match (old_node, new_node) { // Check the most common cases first + // these are *actual* elements, not wrappers around lists (Text(old), Text(new)) => { self.diff_text_nodes(old, new, old_node, new_node); } + (Element(old), Element(new)) => self.diff_element_nodes(old, new, old_node, new_node), + (Placeholder(old), Placeholder(new)) => { + if let Some(root) = old.dom_id.get() { + self.scopes.update_node(new_node, root); + new.dom_id.set(Some(root)) + } + } + + // These two sets are pointers to nodes but are not actually nodes themselves (Component(old), Component(new)) => { self.diff_component_nodes(old_node, new_node, *old, *new) } (Fragment(old), Fragment(new)) => self.diff_fragment_nodes(old, new), - (Placeholder(old), Placeholder(new)) => self.diff_placeholder_nodes(old, new), - (Element(old), Element(new)) => self.diff_element_nodes(old, new, old_node, new_node), // The normal pathway still works, but generates slightly weird instructions // This pathway just ensures we get create and replace @@ -708,21 +694,14 @@ impl<'bump> DiffState<'bump> { old: &'bump VComponent<'bump>, new: &'bump VComponent<'bump>, ) { - let scope_addr = old.associated_scope.get().unwrap(); - - log::debug!( - "Diffing components. old_scope: {:?}, old_addr: {:?}, new_addr: {:?}", - scope_addr, - old.user_fc, - new.user_fc - ); + let scope_addr = old.scope.get().unwrap(); // Make sure we're dealing with the same component (by function pointer) if old.user_fc == new.user_fc { self.stack.scope_stack.push(scope_addr); // Make sure the new component vnode is referencing the right scope id - new.associated_scope.set(Some(scope_addr)); + new.scope.set(Some(scope_addr)); // make sure the component's caller function is up to date let scope = self @@ -730,12 +709,45 @@ impl<'bump> DiffState<'bump> { .get_scope(scope_addr) .unwrap_or_else(|| panic!("could not find {:?}", scope_addr)); - scope.caller.set(unsafe { std::mem::transmute(new.caller) }); + /* + old.props is the previous vcomponent + existing_props is the current ScopeState's + */ + let existing_props = unsafe { &*scope.render.get() }; + if old.can_memoize { + // let props_are_the_same = unsafe { existing_props.memoize(new.props) }; - // React doesn't automatically memoize, but we do. - let props_are_the_same = old.comparator.unwrap(); + if !props_are_the_same || self.force_diff { + // release the old props since they will be overwritten next frame + // existing_props.release(); - if self.force_diff || !props_are_the_same(new) { + // move the old props onto the heap + // todo: maybe we can reuse the old props box? + new.props.promote(); + + scope + .render + .set(unsafe { std::mem::transmute(new.props as *const dyn AnyProps) }); + + // this should auto drop the previous props + self.scopes.run_scope(scope_addr); + + self.diff_node( + self.scopes.wip_head(scope_addr), + self.scopes.fin_head(scope_addr), + ); + } else { + // release the old props since they will be overwritten next frame + if existing_props.as_ptr() != old.props.as_ptr() { + old.props.release(); + } + } + } else { + scope + .render + .set(unsafe { std::mem::transmute(new.props as *const dyn AnyProps) }); + + // this should auto drop the previous props self.scopes.run_scope(scope_addr); self.diff_node( self.scopes.wip_head(scope_addr), @@ -764,11 +776,6 @@ impl<'bump> DiffState<'bump> { self.diff_children(old.children, new.children); } - // probably will get inlined - fn diff_placeholder_nodes(&mut self, old: &'bump VPlaceholder, new: &'bump VPlaceholder) { - new.dom_id.set(old.dom_id.get()) - } - // ============================================= // Utilities for creating new diff instructions // ============================================= @@ -792,33 +799,8 @@ impl<'bump> DiffState<'bump> { // Remember, fragments can never be empty (they always have a single child) match (old, new) { ([], []) => {} - ([], _) => { - // we need to push the - self.stack.create_children(new, MountType::Append); - } - (_, []) => { - self.remove_nodes(old, true); - } - - // todo: placeholders explicitly replace fragments - // - // ([VNode::Placeholder(old_anchor)], [VNode::Placeholder(new_anchor)]) => { - // old_anchor.dom_id.set(new_anchor.dom_id.get()); - // } - // ([VNode::Placeholder(_)], _) => { - // self.stack - // .create_children(new, MountType::Replace { old: &old[0] }); - // } - // (_, [VNode::Placeholder(_)]) => { - // let new: &'bump VNode<'bump> = &new[0]; - // if let Some(first_old) = old.get(0) { - // self.remove_nodes(&old[1..], true); - // self.stack - // .create_node(new, MountType::Replace { old: first_old }); - // } else { - // self.stack.create_node(new, MountType::Append {}); - // } - // } + ([], _) => self.stack.create_children(new, MountType::Append), + (_, []) => self.remove_nodes(old, true), _ => { let new_is_keyed = new[0].key().is_some(); let old_is_keyed = old[0].key().is_some(); @@ -1216,7 +1198,7 @@ impl<'bump> DiffState<'bump> { search_node = frag.children.last(); } VNode::Component(el) => { - let scope_id = el.associated_scope.get().unwrap(); + let scope_id = el.scope.get().unwrap(); search_node = Some(self.scopes.root_node(scope_id)); } } @@ -1233,7 +1215,7 @@ impl<'bump> DiffState<'bump> { search_node = Some(&frag.children[0]); } VNode::Component(el) => { - let scope_id = el.associated_scope.get().unwrap(); + let scope_id = el.scope.get().unwrap(); search_node = Some(self.scopes.root_node(scope_id)); } VNode::Text(t) => break t.dom_id.get(), @@ -1250,8 +1232,6 @@ impl<'bump> DiffState<'bump> { .try_mounted_id() .unwrap_or_else(|| panic!("broke on {:?}", old)); - log::debug!("element parent is {:?}", el.parent_id.get()); - self.mutations.replace_with(id, nodes_created as u32); self.remove_nodes(el.children, false); } @@ -1270,11 +1250,11 @@ impl<'bump> DiffState<'bump> { } VNode::Component(c) => { - let node = self.scopes.fin_head(c.associated_scope.get().unwrap()); + let node = self.scopes.fin_head(c.scope.get().unwrap()); self.replace_node(node, nodes_created); - let scope_id = c.associated_scope.get().unwrap(); - log::debug!("Destroying scope {:?}", scope_id); + let scope_id = c.scope.get().unwrap(); + self.scopes.try_remove(scope_id).unwrap(); } } @@ -1282,7 +1262,7 @@ impl<'bump> DiffState<'bump> { /// schedules nodes for garbage collection and pushes "remove" to the mutation stack /// remove can happen whenever - fn remove_nodes( + pub(crate) fn remove_nodes( &mut self, nodes: impl IntoIterator>, gen_muts: bool, @@ -1323,20 +1303,17 @@ impl<'bump> DiffState<'bump> { } VNode::Component(c) => { - self.destroy_vomponent(c, gen_muts); + let scope_id = c.scope.get().unwrap(); + let root = self.scopes.root_node(scope_id); + self.remove_nodes(Some(root), gen_muts); + + log::debug!("Destroying scope {:?}", scope_id); + self.scopes.try_remove(scope_id).unwrap(); } } } } - fn destroy_vomponent(&mut self, vc: &VComponent, gen_muts: bool) { - let scope_id = vc.associated_scope.get().unwrap(); - let root = self.scopes.root_node(scope_id); - self.remove_nodes(Some(root), gen_muts); - log::debug!("Destroying scope {:?}", scope_id); - self.scopes.try_remove(scope_id).unwrap(); - } - /// Adds a listener closure to a scope during diff. fn attach_listener_to_scope(&mut self, listener: &'bump Listener<'bump>, scope: &ScopeState) { let long_listener = unsafe { std::mem::transmute(listener) }; diff --git a/packages/core/src/lib.rs b/packages/core/src/lib.rs index 9055d8729..aeb3b56f1 100644 --- a/packages/core/src/lib.rs +++ b/packages/core/src/lib.rs @@ -6,8 +6,7 @@ pub(crate) mod diff; pub(crate) mod lazynodes; pub(crate) mod mutations; pub(crate) mod nodes; -pub(crate) mod scope; -pub(crate) mod scopearena; +pub(crate) mod scopes; pub(crate) mod virtual_dom; pub(crate) mod innerlude { @@ -16,8 +15,8 @@ pub(crate) mod innerlude { pub use crate::lazynodes::*; pub use crate::mutations::*; pub use crate::nodes::*; - pub use crate::scope::*; - pub(crate) use crate::scopearena::*; + pub use crate::scopes::*; + pub(crate) use crate::scopes::*; pub use crate::virtual_dom::*; /// An [`Element`] is a possibly-none [`VNode`] created by calling `render` on [`Scope`] or [`ScopeState`]. @@ -61,7 +60,7 @@ pub(crate) mod innerlude { /// // ... /// }; /// ``` - pub type Component

= for<'a> fn(Scope<'a, P>) -> Element<'a>; + pub type Component

= fn(Scope

) -> Element; } pub use crate::innerlude::{ @@ -86,3 +85,12 @@ pub mod exports { pub use bumpalo; pub use futures_channel; } + +/// Functions that wrap unsafe functionality to prevent us from misusing it at the callsite +pub(crate) mod unsafe_utils { + use crate::VNode; + + pub unsafe fn extend_vnode<'a, 'b>(node: &'a VNode<'a>) -> &'b VNode<'b> { + std::mem::transmute(node) + } +} diff --git a/packages/core/src/mutations.rs b/packages/core/src/mutations.rs index 862a42df4..2e6333386 100644 --- a/packages/core/src/mutations.rs +++ b/packages/core/src/mutations.rs @@ -45,6 +45,11 @@ pub enum DomEdit<'bump> { many: u32, }, + // // save a possibly-fragment node as a template + // SaveAsTemplate { + // many: u32, + // }, + // "Root" refers to the item directly // it's a waste of an instruction to push the root directly ReplaceWith { diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index a6f288a52..3d14a332c 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -6,6 +6,7 @@ use crate::{ innerlude::{Element, Properties, Scope, ScopeId, ScopeState}, lazynodes::LazyNodes, + Component, }; use bumpalo::{boxed::Box as BumpBox, Bump}; use std::{ @@ -84,7 +85,7 @@ pub enum VNode<'src> { /// /// ```rust, ignore /// fn Example(cx: Scope<()>) -> Element { - /// todo!() + /// ... /// } /// /// let mut vdom = VirtualDom::new(); @@ -186,6 +187,7 @@ impl Debug for VNode<'_> { write!(s, "VNode::VFragment {{ children: {:?} }}", frag.children) } VNode::Component(comp) => write!(s, "VNode::VComponent {{ fc: {:?}}}", comp.user_fc), + // VNode::Component(comp) => write!(s, "VNode::VComponent {{ fc: {:?}}}", comp.user_fc), } } } @@ -354,26 +356,89 @@ impl Clone for EventHandler<'_> { /// Only supports the functional syntax pub struct VComponent<'src> { pub key: Option<&'src str>, - - pub associated_scope: Cell>, - - // Function pointer to the FC that was used to generate this component + pub scope: Cell>, + pub can_memoize: bool, pub user_fc: *const (), + pub props: Option>>, +} - pub(crate) can_memoize: bool, +pub(crate) struct VComponentProps

{ + // Props start local + // If they are static, then they can get promoted onto the heap + pub render_fn: Component

, + pub props: P, + pub memo: unsafe fn(&P, &P) -> bool, +} - pub(crate) _hard_allocation: Cell>, +pub trait AnyProps { + fn as_ptr(&self) -> *const (); + fn release(&self); + fn replace_heap(&self, new: Box); - // Raw pointer into the bump arena for the props of the component - pub(crate) bump_props: *const (), + // move the props from the bump arena onto the heap + fn promote(&self); + fn render<'a>(&'a self, bump: &'a ScopeState) -> Element<'a>; + unsafe fn memoize(&self, other: &dyn AnyProps) -> bool; +} - // during the "teardown" process we'll take the caller out so it can be dropped properly - pub(crate) caller: &'src dyn Fn(&'src ScopeState) -> Element, +impl

AnyProps for VComponentProps

{ + fn as_ptr(&self) -> *const () { + &self.props as *const _ as *const () + // // todo: maybe move this into an enum + // let heap_props = self.heap_props.borrow(); + // if let Some(b) = heap_props.as_ref() { + // b.as_ref() as *const _ as *const () + // } else { + // let local_props = self.local_props.borrow(); + // local_props.as_ref().unwrap() as *const _ as *const () + // } + } - pub(crate) comparator: Option<&'src dyn Fn(&VComponent) -> bool>, + // this will downcat the other ptr as our swallowed type! + // you *must* make this check *before* calling this method + // if your functions are not the same, then you will downcast a pointer into a different type (UB) + unsafe fn memoize(&self, other: &dyn AnyProps) -> bool { + let real_other: &P = &*(other.as_ptr() as *const _ as *const P); + let real_us: &P = &*(self.as_ptr() as *const _ as *const P); + (self.memo)(real_us, real_other) + } - // todo: re-add this - pub(crate) drop_props: RefCell>>, + fn release(&self) { + panic!("don't release props anymore"); + // if let Some(heap_props) = self.heap_props.borrow_mut().take() { + // dbg!("releasing heap"); + // drop(heap_props) + // } else if let Some(local_props) = self.local_props.borrow_mut().take() { + // dbg!("releasing local"); + // drop(local_props) + // } else { + // dbg!("trying to do a double release"); + // } + } + + fn promote(&self) { + panic!("don't promote props anymore"); + // dbg!("promoting props"); + // if let Some(props) = self.local_props.borrow_mut().take() { + // let mut heap_slot = self.heap_props.borrow_mut(); + // *heap_slot = Some(Box::new(props)); + // } + } + + fn render<'a>(&'a self, scope: &'a ScopeState) -> Element<'a> { + let props: &P = &self.props; + let inline_props = unsafe { std::mem::transmute::<&P, &P>(props) }; + + (self.render_fn)(Scope { + scope, + props: inline_props, + }) + } + + fn replace_heap(&self, new: Box) { + // let new = new.downcast::

().unwrap(); + // self.heap_props.borrow_mut().replace(new); + } } /// This struct provides an ergonomic API to quickly build VNodes. @@ -517,75 +582,23 @@ impl<'a> NodeFactory<'a> { where P: Properties + 'a, { - let bump = self.bump; - let props = bump.alloc(props); - let bump_props = props as *mut P as *mut (); - let user_fc = component as *const (); + VNode::Component(self.bump.alloc(VComponent { + key: key.map(|f| self.raw_text(f).0), + scope: Default::default(), + can_memoize: P::IS_STATIC, + user_fc: component as *const (), + props: Some(RefCell::new(Box::new(VComponentProps { + // local_props: RefCell::new(Some(props)), + // heap_props: RefCell::new(None), + props, + memo: P::memoize, // smuggle the memoization function across borders - let comparator: &mut dyn Fn(&VComponent) -> bool = bump.alloc_with(|| { - move |other: &VComponent| { - if user_fc == other.user_fc { - // Safety - // - We guarantee that Component

is the same by function pointer - // - Because Component

is the same, then P must be the same (even with generics) - // - Non-static P are autoderived to memoize as false - // - This comparator is only called on a corresponding set of bumpframes - // - // It's only okay to memoize if there are no children and the props can be memoized - // Implementing memoize is unsafe and done automatically with the props trait - unsafe { - let real_other: &P = &*(other.bump_props as *const _ as *const P); - props.memoize(real_other) - } - } else { - false - } - } - }); - - let drop_props = { - // create a closure to drop the props - let mut has_dropped = false; - - let drop_props: &mut dyn FnMut() = bump.alloc_with(|| { - move || unsafe { - if !has_dropped { - let real_other = bump_props as *mut _ as *mut P; - let b = BumpBox::from_raw(real_other); - std::mem::drop(b); - - has_dropped = true; - } else { - panic!("Drop props called twice - this is an internal failure of Dioxus"); - } - } - }); - - let drop_props = unsafe { BumpBox::from_raw(drop_props) }; - - RefCell::new(Some(drop_props)) - }; - - let key = key.map(|f| self.raw_text(f).0); - - let caller: &'a mut dyn Fn(&'a ScopeState) -> Element = - bump.alloc(move |scope: &ScopeState| -> Element { - let props: &'_ P = unsafe { &*(bump_props as *const P) }; - component(Scope { scope, props }) - }); - - let can_memoize = P::IS_STATIC; - - VNode::Component(bump.alloc(VComponent { - user_fc, - comparator: Some(comparator), - bump_props, - caller, - key, - can_memoize, - drop_props, - associated_scope: Cell::new(None), - _hard_allocation: Cell::new(None), + // i'm sorry but I just need to bludgeon the lifetimes into place here + // this is safe because we're managing all lifetimes to originate from previous calls + // the intricacies of Rust's lifetime system make it difficult to properly express + // the transformation from this specific lifetime to the for<'a> lifetime + render_fn: unsafe { std::mem::transmute(component) }, + }))), })) } diff --git a/packages/core/src/scopearena.rs b/packages/core/src/scopearena.rs deleted file mode 100644 index a08455895..000000000 --- a/packages/core/src/scopearena.rs +++ /dev/null @@ -1,355 +0,0 @@ -use bumpalo::Bump; -use futures_channel::mpsc::UnboundedSender; -use fxhash::{FxHashMap, FxHashSet}; -use slab::Slab; -use std::{ - borrow::Borrow, - cell::{Cell, RefCell}, -}; - -use crate::innerlude::*; - -pub(crate) type FcSlot = *const (); - -pub(crate) struct Heuristic { - hook_arena_size: usize, - node_arena_size: usize, -} - -// a slab-like arena with stable references even when new scopes are allocated -// uses a bump arena as a backing -// -// has an internal heuristics engine to pre-allocate arenas to the right size -pub(crate) struct ScopeArena { - pub pending_futures: RefCell>, - scope_counter: Cell, - pub(crate) sender: UnboundedSender, - bump: Bump, - - pub scopes: RefCell>, - pub heuristics: RefCell>, - free_scopes: RefCell>, - nodes: RefCell>>, -} - -impl ScopeArena { - pub(crate) fn new(sender: UnboundedSender) -> Self { - let bump = Bump::new(); - - // allocate a container for the root element - // this will *never* show up in the diffing process - let el = bump.alloc(VElement { - tag_name: "root", - namespace: None, - key: None, - dom_id: Cell::new(Some(ElementId(0))), - parent_id: Default::default(), - listeners: &[], - attributes: &[], - children: &[], - }); - - let node = bump.alloc(VNode::Element(el)); - let mut nodes = Slab::new(); - let root_id = nodes.insert(unsafe { std::mem::transmute(node as *const _) }); - - debug_assert_eq!(root_id, 0); - - Self { - scope_counter: Cell::new(0), - bump, - pending_futures: RefCell::new(FxHashSet::default()), - scopes: RefCell::new(FxHashMap::default()), - heuristics: RefCell::new(FxHashMap::default()), - free_scopes: RefCell::new(Vec::new()), - nodes: RefCell::new(nodes), - sender, - } - } - - /// Safety: - /// - Obtaining a mutable refernece to any Scope is unsafe - /// - Scopes use interior mutability when sharing data into components - pub(crate) fn get_scope(&self, id: ScopeId) -> Option<&ScopeState> { - unsafe { self.scopes.borrow().get(&id).map(|f| &**f) } - } - - pub(crate) fn get_scope_raw(&self, id: ScopeId) -> Option<*mut ScopeState> { - self.scopes.borrow().get(&id).copied() - } - - pub(crate) fn new_with_key( - &self, - fc_ptr: *const (), - caller: *const dyn Fn(&ScopeState) -> Element, - parent_scope: Option<*mut ScopeState>, - container: ElementId, - height: u32, - subtree: u32, - ) -> ScopeId { - let new_scope_id = ScopeId(self.scope_counter.get()); - self.scope_counter.set(self.scope_counter.get() + 1); - - /* - This scopearena aggressively reuse old scopes when possible. - We try to minimize the new allocations for props/arenas. - - However, this will probably lead to some sort of fragmentation. - I'm not exactly sure how to improve this today. - */ - match self.free_scopes.borrow_mut().pop() { - // No free scope, make a new scope - None => { - let (node_capacity, hook_capacity) = self - .heuristics - .borrow() - .get(&fc_ptr) - .map(|h| (h.node_arena_size, h.hook_arena_size)) - .unwrap_or_default(); - - let frames = [BumpFrame::new(node_capacity), BumpFrame::new(node_capacity)]; - - let scope = self.bump.alloc(ScopeState { - sender: self.sender.clone(), - container, - our_arena_idx: new_scope_id, - parent_scope, - height, - frames, - subtree: Cell::new(subtree), - is_subtree_root: Cell::new(false), - - caller: Cell::new(caller), - generation: 0.into(), - - shared_contexts: Default::default(), - - items: RefCell::new(SelfReferentialItems { - listeners: Default::default(), - borrowed_props: Default::default(), - tasks: Default::default(), - }), - - hook_arena: Bump::new(), - hook_vals: RefCell::new(Vec::with_capacity(hook_capacity)), - hook_idx: Default::default(), - }); - - let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); - debug_assert!(any_item.is_none()); - } - - // Reuse a free scope - Some(old_scope) => { - let scope = unsafe { &mut *old_scope }; - scope.caller.set(caller); - scope.parent_scope = parent_scope; - scope.height = height; - scope.subtree = Cell::new(subtree); - scope.our_arena_idx = new_scope_id; - scope.container = container; - let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); - debug_assert!(any_item.is_none()); - } - } - - new_scope_id - } - - // Removes a scope and its descendents from the arena - pub fn try_remove(&self, id: ScopeId) -> Option<()> { - self.ensure_drop_safety(id); - - // Safety: - // - ensure_drop_safety ensures that no references to this scope are in use - // - this raw pointer is removed from the map - let scope = unsafe { &mut *self.scopes.borrow_mut().remove(&id).unwrap() }; - scope.reset(); - - self.free_scopes.borrow_mut().push(scope); - - Some(()) - } - - pub fn reserve_node(&self, node: &VNode) -> ElementId { - let mut els = self.nodes.borrow_mut(); - let entry = els.vacant_entry(); - let key = entry.key(); - let id = ElementId(key); - let node: *const VNode = node as *const _; - let node = unsafe { std::mem::transmute::<*const VNode, *const VNode>(node) }; - entry.insert(node); - id - } - - pub fn update_node(&self, node: &VNode, id: ElementId) { - let node = unsafe { std::mem::transmute::<*const VNode, *const VNode>(node) }; - *self.nodes.borrow_mut().get_mut(id.0).unwrap() = node; - } - - pub fn collect_garbage(&self, id: ElementId) { - self.nodes.borrow_mut().remove(id.0); - } - - /// This method cleans up any references to data held within our hook list. This prevents mutable aliasing from - /// causing UB in our tree. - /// - /// This works by cleaning up our references from the bottom of the tree to the top. The directed graph of components - /// essentially forms a dependency tree that we can traverse from the bottom to the top. As we traverse, we remove - /// any possible references to the data in the hook list. - /// - /// References to hook data can only be stored in listeners and component props. During diffing, we make sure to log - /// all listeners and borrowed props so we can clear them here. - /// - /// This also makes sure that drop order is consistent and predictable. All resources that rely on being dropped will - /// be dropped. - pub(crate) fn ensure_drop_safety(&self, scope_id: ScopeId) { - if let Some(scope) = self.get_scope(scope_id) { - let mut items = scope.items.borrow_mut(); - - // make sure we drop all borrowed props manually to guarantee that their drop implementation is called before we - // run the hooks (which hold an &mut Reference) - // recursively call ensure_drop_safety on all children - items.borrowed_props.drain(..).for_each(|comp| { - let scope_id = comp - .associated_scope - .get() - .expect("VComponents should be associated with a valid Scope"); - - self.ensure_drop_safety(scope_id); - - let mut drop_props = comp.drop_props.borrow_mut().take().unwrap(); - drop_props(); - }); - - // Now that all the references are gone, we can safely drop our own references in our listeners. - items - .listeners - .drain(..) - .for_each(|listener| drop(listener.callback.callback.borrow_mut().take())); - } - } - - // pub(crate) fn run_scope(&self, id: ScopeId) -> bool { - - pub(crate) fn run_scope(&self, id: ScopeId) { - // Cycle to the next frame and then reset it - // This breaks any latent references, invalidating every pointer referencing into it. - // Remove all the outdated listeners - self.ensure_drop_safety(id); - - // todo: we *know* that this is aliased by the contents of the scope itself - let scope = unsafe { &mut *self.get_scope_raw(id).expect("could not find scope") }; - - // Safety: - // - We dropped the listeners, so no more &mut T can be used while these are held - // - All children nodes that rely on &mut T are replaced with a new reference - scope.hook_idx.set(0); - - // book keeping to ensure safety around the borrowed data - { - // Safety: - // - We've dropped all references to the wip bump frame with "ensure_drop_safety" - unsafe { scope.reset_wip_frame() }; - - let mut items = scope.items.borrow_mut(); - - // just forget about our suspended nodes while we're at it - items.tasks.clear(); - - // guarantee that we haven't screwed up - there should be no latent references anywhere - debug_assert!(items.listeners.is_empty()); - debug_assert!(items.borrowed_props.is_empty()); - debug_assert!(items.tasks.is_empty()); - } - - let render: &dyn Fn(&ScopeState) -> Element = unsafe { &*scope.caller.get() }; - - /* - If the component returns None, then we fill in a placeholder node. This will wipe what was there. - - An alternate approach is to leave the Real Dom the same, but that can lead to safety issues and a lot more checks. - */ - if let Some(node) = render(scope) { - if !scope.items.borrow().tasks.is_empty() { - self.pending_futures.borrow_mut().insert(id); - } - - let frame = scope.wip_frame(); - let node = frame.bump.alloc(node); - frame.node.set(unsafe { std::mem::transmute(node) }); - } else { - let frame = scope.wip_frame(); - let node = frame - .bump - .alloc(VNode::Placeholder(frame.bump.alloc(VPlaceholder { - dom_id: Default::default(), - }))); - frame.node.set(unsafe { std::mem::transmute(node) }); - } - - // make the "wip frame" contents the "finished frame" - // any future dipping into completed nodes after "render" will go through "fin head" - scope.cycle_frame(); - } - - pub fn call_listener_with_bubbling(&self, event: UserEvent, element: ElementId) { - let nodes = self.nodes.borrow(); - let mut cur_el = Some(element); - - while let Some(id) = cur_el.take() { - if let Some(el) = nodes.get(id.0) { - let real_el = unsafe { &**el }; - if let VNode::Element(real_el) = real_el { - // - for listener in real_el.listeners.borrow().iter() { - if listener.event == event.name { - let mut cb = listener.callback.callback.borrow_mut(); - if let Some(cb) = cb.as_mut() { - (cb)(event.data.clone()); - } - } - } - - cur_el = real_el.parent_id.get(); - } - } - } - } - - // The head of the bumpframe is the first linked NodeLink - pub fn wip_head(&self, id: ScopeId) -> &VNode { - let scope = self.get_scope(id).unwrap(); - let frame = scope.wip_frame(); - let node = unsafe { &*frame.node.get() }; - unsafe { std::mem::transmute::<&VNode, &VNode>(node) } - } - - // The head of the bumpframe is the first linked NodeLink - pub fn fin_head(&self, id: ScopeId) -> &VNode { - let scope = self.get_scope(id).unwrap(); - let frame = scope.fin_frame(); - let node = unsafe { &*frame.node.get() }; - unsafe { std::mem::transmute::<&VNode, &VNode>(node) } - } - - pub fn root_node(&self, id: ScopeId) -> &VNode { - self.fin_head(id) - } -} - -// when dropping the virtualdom, we need to make sure and drop everything important -impl Drop for ScopeArena { - fn drop(&mut self) { - for (_, scopeptr) in self.scopes.get_mut().drain() { - let scope = unsafe { bumpalo::boxed::Box::from_raw(scopeptr) }; - drop(scope); - } - - // these are probably complete invalid unfortunately ? - for scopeptr in self.free_scopes.get_mut().drain(..) { - let scope = unsafe { bumpalo::boxed::Box::from_raw(scopeptr) }; - drop(scope); - } - } -} diff --git a/packages/core/src/scope.rs b/packages/core/src/scopes.rs similarity index 55% rename from packages/core/src/scope.rs rename to packages/core/src/scopes.rs index 40bcd8aca..96c29c684 100644 --- a/packages/core/src/scope.rs +++ b/packages/core/src/scopes.rs @@ -1,8 +1,9 @@ -use crate::innerlude::*; - use futures_channel::mpsc::UnboundedSender; +use fxhash::{FxHashMap, FxHashSet}; +use slab::Slab; use std::{ any::{Any, TypeId}, + borrow::Borrow, cell::{Cell, RefCell}, collections::HashMap, future::Future, @@ -10,8 +11,351 @@ use std::{ rc::Rc, }; +use crate::{innerlude::*, unsafe_utils::extend_vnode}; use bumpalo::{boxed::Box as BumpBox, Bump}; +pub(crate) type FcSlot = *const (); + +pub(crate) struct Heuristic { + hook_arena_size: usize, + node_arena_size: usize, +} + +// a slab-like arena with stable references even when new scopes are allocated +// uses a bump arena as a backing +// +// has an internal heuristics engine to pre-allocate arenas to the right size +pub(crate) struct ScopeArena { + pub pending_futures: RefCell>, + pub scope_counter: Cell, + pub sender: UnboundedSender, + pub bump: Bump, + pub scopes: RefCell>, + pub heuristics: RefCell>, + pub free_scopes: RefCell>, + pub nodes: RefCell>>, +} + +impl ScopeArena { + pub(crate) fn new(sender: UnboundedSender) -> Self { + let bump = Bump::new(); + + // allocate a container for the root element + // this will *never* show up in the diffing process + // todo: figure out why this is necessary. i forgot. whoops. + let el = bump.alloc(VElement { + tag_name: "root", + namespace: None, + key: None, + dom_id: Cell::new(Some(ElementId(0))), + parent_id: Default::default(), + listeners: &[], + attributes: &[], + children: &[], + }); + + let node = bump.alloc(VNode::Element(el)); + let mut nodes = Slab::new(); + let root_id = nodes.insert(unsafe { std::mem::transmute(node as *const _) }); + + debug_assert_eq!(root_id, 0); + + Self { + scope_counter: Cell::new(0), + bump, + pending_futures: RefCell::new(FxHashSet::default()), + scopes: RefCell::new(FxHashMap::default()), + heuristics: RefCell::new(FxHashMap::default()), + free_scopes: RefCell::new(Vec::new()), + nodes: RefCell::new(nodes), + sender, + } + } + + /// Safety: + /// - Obtaining a mutable refernece to any Scope is unsafe + /// - Scopes use interior mutability when sharing data into components + pub(crate) fn get_scope(&self, id: ScopeId) -> Option<&ScopeState> { + unsafe { self.scopes.borrow().get(&id).map(|f| &**f) } + } + + pub(crate) fn get_scope_raw(&self, id: ScopeId) -> Option<*mut ScopeState> { + self.scopes.borrow().get(&id).copied() + } + + pub(crate) fn new_with_key( + &self, + fc_ptr: *const (), + vcomp: Box, + parent_scope: Option, + container: ElementId, + subtree: u32, + ) -> ScopeId { + let new_scope_id = ScopeId(self.scope_counter.get()); + self.scope_counter.set(self.scope_counter.get() + 1); + let parent_scope = parent_scope.map(|f| self.get_scope_raw(f)).flatten(); + let height = parent_scope + .as_ref() + .map(|f| unsafe { &**f }) + .map(|f| f.height + 1) + .unwrap_or_default(); + + /* + This scopearena aggressively reuse old scopes when possible. + We try to minimize the new allocations for props/arenas. + + However, this will probably lead to some sort of fragmentation. + I'm not exactly sure how to improve this today. + */ + match self.free_scopes.borrow_mut().pop() { + // No free scope, make a new scope + None => { + let (node_capacity, hook_capacity) = self + .heuristics + .borrow() + .get(&fc_ptr) + .map(|h| (h.node_arena_size, h.hook_arena_size)) + .unwrap_or_default(); + + let frames = [BumpFrame::new(node_capacity), BumpFrame::new(node_capacity)]; + + let scope = self.bump.alloc(ScopeState { + sender: self.sender.clone(), + container, + our_arena_idx: new_scope_id, + parent_scope, + height, + frames, + subtree: Cell::new(subtree), + is_subtree_root: Cell::new(false), + + props: vcomp, + generation: 0.into(), + + shared_contexts: Default::default(), + + items: RefCell::new(SelfReferentialItems { + listeners: Default::default(), + borrowed_props: Default::default(), + tasks: Default::default(), + }), + + hook_arena: Bump::new(), + hook_vals: RefCell::new(Vec::with_capacity(hook_capacity)), + hook_idx: Default::default(), + }); + + let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); + debug_assert!(any_item.is_none()); + } + + // Reuse a free scope + Some(old_scope) => { + let scope = unsafe { &mut *old_scope }; + scope.props.set(vcomp); + scope.parent_scope = parent_scope; + scope.height = height; + scope.subtree = Cell::new(subtree); + scope.our_arena_idx = new_scope_id; + scope.container = container; + let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); + debug_assert!(any_item.is_none()); + } + } + + new_scope_id + } + + // Removes a scope and its descendents from the arena + pub fn try_remove(&self, id: ScopeId) -> Option<()> { + self.ensure_drop_safety(id); + + // Safety: + // - ensure_drop_safety ensures that no references to this scope are in use + // - this raw pointer is removed from the map + let scope = unsafe { &mut *self.scopes.borrow_mut().remove(&id).unwrap() }; + scope.reset(); + + todo!("drop"); + // unsafe { &*scope.render.get() }.release(); + + self.free_scopes.borrow_mut().push(scope); + + Some(()) + } + + pub fn reserve_node<'a>(&self, node: &'a VNode<'a>) -> ElementId { + let mut els = self.nodes.borrow_mut(); + let entry = els.vacant_entry(); + let key = entry.key(); + let id = ElementId(key); + let node = unsafe { extend_vnode(node) }; + entry.insert(node as *const _); + id + } + + pub fn update_node<'a>(&self, node: &'a VNode<'a>, id: ElementId) { + let node = unsafe { extend_vnode(node) }; + *self.nodes.borrow_mut().get_mut(id.0).unwrap() = node; + } + + pub fn collect_garbage(&self, id: ElementId) { + self.nodes.borrow_mut().remove(id.0); + } + + /// This method cleans up any references to data held within our hook list. This prevents mutable aliasing from + /// causing UB in our tree. + /// + /// This works by cleaning up our references from the bottom of the tree to the top. The directed graph of components + /// essentially forms a dependency tree that we can traverse from the bottom to the top. As we traverse, we remove + /// any possible references to the data in the hook list. + /// + /// References to hook data can only be stored in listeners and component props. During diffing, we make sure to log + /// all listeners and borrowed props so we can clear them here. + /// + /// This also makes sure that drop order is consistent and predictable. All resources that rely on being dropped will + /// be dropped. + pub(crate) fn ensure_drop_safety(&self, scope_id: ScopeId) { + if let Some(scope) = self.get_scope(scope_id) { + let mut items = scope.items.borrow_mut(); + + // make sure we drop all borrowed props manually to guarantee that their drop implementation is called before we + // run the hooks (which hold an &mut Reference) + // recursively call ensure_drop_safety on all children + items.borrowed_props.drain(..).for_each(|comp| { + let scope_id = comp + .scope + .get() + .expect("VComponents should be associated with a valid Scope"); + + self.ensure_drop_safety(scope_id); + + let g = comp.props.take(); + // comp.props.release(); + }); + + // Now that all the references are gone, we can safely drop our own references in our listeners. + items + .listeners + .drain(..) + .for_each(|listener| drop(listener.callback.callback.borrow_mut().take())); + } + } + + pub(crate) fn run_scope(&self, id: ScopeId) { + // Cycle to the next frame and then reset it + // This breaks any latent references, invalidating every pointer referencing into it. + // Remove all the outdated listeners + self.ensure_drop_safety(id); + + // todo: we *know* that this is aliased by the contents of the scope itself + let scope = unsafe { &mut *self.get_scope_raw(id).expect("could not find scope") }; + + // Safety: + // - We dropped the listeners, so no more &mut T can be used while these are held + // - All children nodes that rely on &mut T are replaced with a new reference + scope.hook_idx.set(0); + + // book keeping to ensure safety around the borrowed data + { + // Safety: + // - We've dropped all references to the wip bump frame with "ensure_drop_safety" + unsafe { scope.reset_wip_frame() }; + + let mut items = scope.items.borrow_mut(); + + // just forget about our suspended nodes while we're at it + items.tasks.clear(); + + // guarantee that we haven't screwed up - there should be no latent references anywhere + debug_assert!(items.listeners.is_empty()); + debug_assert!(items.borrowed_props.is_empty()); + debug_assert!(items.tasks.is_empty()); + } + + // safety: this is definitely not dropped + + /* + If the component returns None, then we fill in a placeholder node. This will wipe what was there. + An alternate approach is to leave the Real Dom the same, but that can lead to safety issues and a lot more checks. + + Instead, we just treat the `None` as a shortcut to placeholder. + If the developer wants to prevent a scope from updating, they should control its memoization instead. + + Also, the way we implement hooks allows us to cut rendering short before the next hook is recalled. + I'm not sure if React lets you abort the component early, but we let you do that. + */ + if let Some(node) = scope.props.render(scope) { + if !scope.items.borrow().tasks.is_empty() { + self.pending_futures.borrow_mut().insert(id); + } + + let frame = scope.wip_frame(); + let node = frame.bump.alloc(node); + frame.node.set(unsafe { extend_vnode(node) }); + } else { + let frame = scope.wip_frame(); + let node = frame + .bump + .alloc(VNode::Placeholder(frame.bump.alloc(VPlaceholder { + dom_id: Default::default(), + }))); + frame.node.set(unsafe { extend_vnode(node) }); + } + + // make the "wip frame" contents the "finished frame" + // any future dipping into completed nodes after "render" will go through "fin head" + scope.cycle_frame(); + } + + pub fn call_listener_with_bubbling(&self, event: UserEvent, element: ElementId) { + let nodes = self.nodes.borrow(); + let mut cur_el = Some(element); + + while let Some(id) = cur_el.take() { + if let Some(el) = nodes.get(id.0) { + let real_el = unsafe { &**el }; + if let VNode::Element(real_el) = real_el { + for listener in real_el.listeners.borrow().iter() { + if listener.event == event.name { + let mut cb = listener.callback.callback.borrow_mut(); + if let Some(cb) = cb.as_mut() { + // todo: arcs are pretty heavy to clone + // we really want to convert arc to rc + // unfortunately, the SchedulerMsg must be send/sync to be sent across threads + // we could convert arc to rc internally or something + (cb)(event.data.clone()); + } + } + } + + cur_el = real_el.parent_id.get(); + } + } + } + } + + // The head of the bumpframe is the first linked NodeLink + pub fn wip_head(&self, id: ScopeId) -> &VNode { + let scope = self.get_scope(id).unwrap(); + let frame = scope.wip_frame(); + let node = unsafe { &*frame.node.get() }; + unsafe { extend_vnode(node) } + } + + // The head of the bumpframe is the first linked NodeLink + pub fn fin_head(&self, id: ScopeId) -> &VNode { + let scope = self.get_scope(id).unwrap(); + let frame = scope.fin_frame(); + let node = unsafe { &*frame.node.get() }; + unsafe { extend_vnode(node) } + } + + pub fn root_node(&self, id: ScopeId) -> &VNode { + self.fin_head(id) + } +} + /// Components in Dioxus use the "Context" object to interact with their lifecycle. /// /// This lets components access props, schedule updates, integrate hooks, and expose shared state. @@ -72,34 +416,29 @@ pub struct ScopeId(pub usize); /// use case they might have. pub struct ScopeState { pub(crate) parent_scope: Option<*mut ScopeState>, - pub(crate) container: ElementId, - pub(crate) our_arena_idx: ScopeId, - pub(crate) height: u32, + pub(crate) sender: UnboundedSender, + // todo: subtrees + pub(crate) is_subtree_root: Cell, pub(crate) subtree: Cell, - pub(crate) is_subtree_root: Cell, - - pub(crate) generation: Cell, + pub(crate) props: Option>>, + // nodes, items pub(crate) frames: [BumpFrame; 2], - - pub(crate) caller: Cell<*const dyn Fn(&ScopeState) -> Element>, - + pub(crate) generation: Cell, pub(crate) items: RefCell>, + // hooks pub(crate) hook_arena: Bump, - pub(crate) hook_vals: RefCell>, - pub(crate) hook_idx: Cell, + // shared state -> todo: move this out of scopestate pub(crate) shared_contexts: RefCell>>, - - pub(crate) sender: UnboundedSender, } pub struct SelfReferentialItems<'a> { @@ -143,7 +482,6 @@ impl ScopeState { /// /// ```rust, ignore /// fn App(cx: Scope<()>) -> Element { - /// todo!(); /// rsx!(cx, div { "Subtree {id}"}) /// }; /// ``` @@ -251,7 +589,7 @@ impl ScopeState { /// Get the Root Node of this scope pub fn root_node(&self) -> &VNode { - let node = unsafe { &*self.wip_frame().node.get() }; + let node = unsafe { &*self.fin_frame().node.get() }; unsafe { std::mem::transmute(node) } } @@ -465,45 +803,37 @@ impl ScopeState { &self.wip_frame().bump } - pub(crate) fn drop_hooks(&mut self) { - self.hook_vals.get_mut().drain(..).for_each(|state| { - let as_mut = unsafe { &mut *state }; - let boxed = unsafe { bumpalo::boxed::Box::from_raw(as_mut) }; - drop(boxed); - }); - } - + // todo: disable bookkeeping on drop (unncessary) pub(crate) fn reset(&mut self) { - // we're just reusing scopes so we need to clear it out - self.drop_hooks(); - + // first: book keaping self.hook_idx.set(0); - - self.hook_arena.reset(); - self.shared_contexts.get_mut().clear(); self.parent_scope = None; self.generation.set(0); self.is_subtree_root.set(false); self.subtree.set(0); - self.frames[0].reset(); - self.frames[1].reset(); + // next: shared context data + self.shared_contexts.get_mut().clear(); + // next: reset the node data let SelfReferentialItems { borrowed_props, listeners, tasks, } = self.items.get_mut(); - borrowed_props.clear(); listeners.clear(); tasks.clear(); - } -} + self.frames[0].reset(); + self.frames[1].reset(); -impl Drop for ScopeState { - fn drop(&mut self) { - self.drop_hooks(); + // Finally, free up the hook values + self.hook_arena.reset(); + self.hook_vals.get_mut().drain(..).for_each(|state| { + let as_mut = unsafe { &mut *state }; + let boxed = unsafe { bumpalo::boxed::Box::from_raw(as_mut) }; + drop(boxed); + }); } } diff --git a/packages/core/src/virtual_dom.rs b/packages/core/src/virtual_dom.rs index 13551d337..55902831c 100644 --- a/packages/core/src/virtual_dom.rs +++ b/packages/core/src/virtual_dom.rs @@ -8,7 +8,10 @@ use futures_util::{Future, StreamExt}; use fxhash::FxHashSet; use indexmap::IndexSet; use smallvec::SmallVec; -use std::{any::Any, collections::VecDeque, pin::Pin, sync::Arc, task::Poll}; +use std::{ + any::Any, cell::RefCell, collections::VecDeque, iter::FromIterator, pin::Pin, sync::Arc, + task::Poll, +}; /// A virtual node s ystem that progresses user events and diffs UI trees. /// @@ -103,10 +106,8 @@ use std::{any::Any, collections::VecDeque, pin::Pin, sync::Arc, task::Poll}; /// } /// ``` pub struct VirtualDom { - scopes: Box, + scopes: ScopeArena, - // should always be ScopeId(0) - base_scope: ScopeId, pending_messages: VecDeque, dirty_scopes: IndexSet, @@ -114,8 +115,6 @@ pub struct VirtualDom { UnboundedSender, UnboundedReceiver, ), - - caller: *mut dyn for<'r> Fn(&'r ScopeState) -> Element<'r>, } // Methods to create the VirtualDom @@ -174,7 +173,10 @@ impl VirtualDom { /// let mut dom = VirtualDom::new_with_props(Example, SomeProps { name: "jane" }); /// let mutations = dom.rebuild(); /// ``` - pub fn new_with_props(root: Component

, root_props: P) -> Self { + pub fn new_with_props

(root: Component

, root_props: P) -> Self + where + P: 'static, + { Self::new_with_props_and_scheduler( root, root_props, @@ -188,8 +190,8 @@ impl VirtualDom { /// VirtualDom to be created just to retrieve its channel receiver. /// /// ```rust - /// let (sender, receiver) = futures_channel::mpsc::unbounded(); - /// let dom = VirtualDom::new_with_scheduler(Example, (), sender, receiver); + /// let channel = futures_channel::mpsc::unbounded(); + /// let dom = VirtualDom::new_with_scheduler(Example, (), channel); /// ``` pub fn new_with_props_and_scheduler( root: Component

, @@ -199,36 +201,25 @@ impl VirtualDom { UnboundedReceiver, ), ) -> Self { - // move these two things onto the heap so we have stable ptrs even if the VirtualDom itself is moved - let scopes = Box::new(ScopeArena::new(channel.0.clone())); - let root_props = Box::new(root_props); + let scopes = ScopeArena::new(channel.0.clone()); - // effectively leak the caller so we can drop it when the VirtualDom is dropped - let caller: *mut dyn for<'r> Fn(&'r ScopeState) -> Element<'r> = - Box::into_raw(Box::new(move |scope: &ScopeState| -> Element { - // Safety: The props at this pointer can never be moved. - // Also, this closure will never be ran when the VirtualDom is destroyed. - // This is where the root lifetime of the VirtualDom originates. - let props = unsafe { std::mem::transmute::<&P, &P>(root_props.as_ref()) }; - let scp = Scope { scope, props }; - root(scp) - })); - - let base_scope = scopes.new_with_key(root as _, caller, None, ElementId(0), 0, 0); - - let mut dirty_scopes = IndexSet::new(); - dirty_scopes.insert(base_scope); - - // todo: add a pending message to the scheduler to start the scheduler? - let pending_messages = VecDeque::new(); + scopes.new_with_key( + root as *const _, + Box::new(VComponentProps { + props: root_props, + memo: |_a, _b| false, + render_fn: unsafe { std::mem::transmute(root) }, + }), + None, + ElementId(0), + 0, + ); Self { scopes, - base_scope, - caller, - pending_messages, - dirty_scopes, channel, + dirty_scopes: IndexSet::from_iter([ScopeId(0)]), + pending_messages: VecDeque::new(), } } @@ -237,9 +228,18 @@ impl VirtualDom { /// This is useful for traversing the tree from the root for heuristics or alternsative renderers that use Dioxus /// directly. /// + /// This method is equivalent to calling `get_scope(ScopeId(0))` + /// /// # Example + /// + /// ```rust + /// let mut dom = VirtualDom::new(example); + /// dom.rebuild(); + /// + /// + /// ``` pub fn base_scope(&self) -> &ScopeState { - self.get_scope(self.base_scope).unwrap() + self.get_scope(ScopeId(0)).unwrap() } /// Get the [`ScopeState`] for a component given its [`ScopeId`] @@ -248,7 +248,7 @@ impl VirtualDom { /// /// /// - pub fn get_scope<'a>(&'a self, id: ScopeId) -> Option<&'a ScopeState> { + pub fn get_scope(&self, id: ScopeId) -> Option<&ScopeState> { self.scopes.get_scope(id) } @@ -260,7 +260,7 @@ impl VirtualDom { /// let dom = VirtualDom::new(App); /// let sender = dom.get_scheduler_channel(); /// ``` - pub fn get_scheduler_channel(&self) -> futures_channel::mpsc::UnboundedSender { + pub fn get_scheduler_channel(&self) -> UnboundedSender { self.channel.0.clone() } @@ -273,10 +273,12 @@ impl VirtualDom { /// # Example /// ```rust, ignore /// let dom = VirtualDom::new(App); - /// dom.insert_scheduler_message(SchedulerMsg::Immediate(ScopeId(0))); + /// dom.handle_message(SchedulerMsg::Immediate(ScopeId(0))); /// ``` - pub fn insert_scheduler_message(&self, msg: SchedulerMsg) { - self.channel.0.unbounded_send(msg).unwrap() + pub fn handle_message(&mut self, msg: SchedulerMsg) { + if self.channel.0.unbounded_send(msg).is_ok() { + self.process_all_messages(); + } } /// Check if the [`VirtualDom`] has any pending updates or work to be done. @@ -326,26 +328,38 @@ impl VirtualDom { } } - while let Ok(Some(msg)) = self.channel.1.try_next() { - self.pending_messages.push_front(msg); - } + // Move all the messages into the queue + self.process_all_messages(); + } + } - if let Some(msg) = self.pending_messages.pop_back() { - match msg { - // just keep looping, the task is now saved but we should actually poll it - SchedulerMsg::NewTask(id) => { - self.scopes.pending_futures.borrow_mut().insert(id); - } - SchedulerMsg::UiEvent(event) => { - if let Some(element) = event.element { - self.scopes.call_listener_with_bubbling(event, element); - } - } - SchedulerMsg::Immediate(s) => { - self.dirty_scopes.insert(s); - } + /// Manually kick the VirtualDom to process any + pub fn process_all_messages(&mut self) { + // clear out the scheduler queue + while let Ok(Some(msg)) = self.channel.1.try_next() { + self.pending_messages.push_front(msg); + } + + // process all the messages pulled from the queue + while let Some(msg) = self.pending_messages.pop_back() { + self.process_message(msg); + } + } + + pub fn process_message(&mut self, msg: SchedulerMsg) { + match msg { + // just keep looping, the task is now saved but we should actually poll it + SchedulerMsg::NewTask(id) => { + self.scopes.pending_futures.borrow_mut().insert(id); + } + SchedulerMsg::UiEvent(event) => { + if let Some(element) = event.element { + self.scopes.call_listener_with_bubbling(event, element); } } + SchedulerMsg::Immediate(s) => { + self.dirty_scopes.insert(s); + } } } @@ -466,7 +480,7 @@ impl VirtualDom { /// apply_edits(edits); /// ``` pub fn rebuild(&mut self) -> Mutations { - let scope_id = self.base_scope; + let scope_id = ScopeId(0); let mut diff_state = DiffState::new(&self.scopes); self.scopes.run_scope(scope_id); @@ -510,12 +524,24 @@ impl VirtualDom { /// /// let edits = dom.diff(); /// ``` - pub fn hard_diff<'a>(&'a mut self, scope_id: ScopeId) -> Option> { + pub fn hard_diff(&mut self, scope_id: ScopeId) -> Mutations { let mut diff_machine = DiffState::new(&self.scopes); self.scopes.run_scope(scope_id); + + let (old, new) = ( + diff_machine.scopes.wip_head(scope_id), + diff_machine.scopes.fin_head(scope_id), + ); + diff_machine.force_diff = true; - diff_machine.diff_scope(scope_id); - Some(diff_machine.mutations) + diff_machine.stack.push(DiffInstruction::Diff { old, new }); + diff_machine.stack.scope_stack.push(scope_id); + + let scope = diff_machine.scopes.get_scope(scope_id).unwrap(); + diff_machine.stack.element_stack.push(scope.container); + diff_machine.work(|| false); + + diff_machine.mutations } /// Renders an `rsx` call into the Base Scope's allocator. @@ -531,7 +557,7 @@ impl VirtualDom { /// let nodes = dom.render_nodes(rsx!("div")); /// ``` pub fn render_vnodes<'a>(&'a self, lazy_nodes: Option>) -> &'a VNode<'a> { - let scope = self.scopes.get_scope(self.base_scope).unwrap(); + let scope = self.scopes.get_scope(ScopeId(0)).unwrap(); let frame = scope.wip_frame(); let factory = NodeFactory { bump: &frame.bump }; let node = lazy_nodes.unwrap().call(factory); @@ -554,7 +580,7 @@ impl VirtualDom { let mut machine = DiffState::new(&self.scopes); machine.stack.push(DiffInstruction::Diff { new, old }); machine.stack.element_stack.push(ElementId(0)); - machine.stack.scope_stack.push(self.base_scope); + machine.stack.scope_stack.push(ScopeId(0)); machine.work(|| false); machine.mutations } @@ -572,11 +598,12 @@ impl VirtualDom { /// let dom = VirtualDom::new(Base); /// let nodes = dom.render_nodes(rsx!("div")); /// ``` - pub fn create_vnodes<'a>(&'a self, left: Option>) -> Mutations<'a> { - let nodes = self.render_vnodes(left); + pub fn create_vnodes<'a>(&'a self, nodes: Option>) -> Mutations<'a> { let mut machine = DiffState::new(&self.scopes); machine.stack.element_stack.push(ElementId(0)); - machine.stack.create_node(nodes, MountType::Append); + machine + .stack + .create_node(self.render_vnodes(nodes), MountType::Append); machine.work(|| false); machine.mutations } @@ -602,29 +629,78 @@ impl VirtualDom { let (old, new) = (self.render_vnodes(left), self.render_vnodes(right)); let mut create = DiffState::new(&self.scopes); - create.stack.scope_stack.push(self.base_scope); + create.stack.scope_stack.push(ScopeId(0)); create.stack.element_stack.push(ElementId(0)); create.stack.create_node(old, MountType::Append); create.work(|| false); let mut edit = DiffState::new(&self.scopes); - edit.stack.scope_stack.push(self.base_scope); + edit.stack.scope_stack.push(ScopeId(0)); edit.stack.element_stack.push(ElementId(0)); edit.stack.push(DiffInstruction::Diff { old, new }); - edit.work(&mut || false); + edit.work(|| false); (create.mutations, edit.mutations) } } +/* +Scopes and ScopeArenas are never dropped internally. +An app will always occupy as much memory as its biggest form. +This means we need to handle all specifics of drop *here*. It's easier +to reason about centralizing all the drop logic in one spot rather than scattered in each module. + +Broadly speaking, we want to use the remove_nodes method to clean up *everything* +This will drop listeners, borrowed props, and hooks for all components. +We need to do this in the correct order - nodes at the very bottom must be dropped first to release +the borrow chain. + +Once the contents of the tree have been cleaned up, we can finally clean up the +memory used by ScopeState itself. + +questions: +should we build a vcomponent for the root? +- probably - yes? +- store the vcomponent in the root dom + +- 1: Use remove_nodes to use the ensure_drop_safety pathway to safely drop the tree +- 2: Drop the ScopeState itself + + + +*/ impl Drop for VirtualDom { fn drop(&mut self) { - // ensure the root component's caller is dropped - let caller = unsafe { Box::from_raw(self.caller) }; - drop(caller); + // the best way to drop the dom is to replace the root scope with a dud + // the diff infrastructure will then finish the rest + let scope = self.scopes.get_scope(ScopeId(0)).unwrap(); - // destroy the root component (which will destroy all of the other scopes) - // load the root node and descend + // todo: move the remove nodes method onto scopearena + // this will clear *all* scopes *except* the root scope + let mut machine = DiffState::new(&self.scopes); + machine.remove_nodes([scope.root_node()], false); + + // Now, clean up the root scope + // safety: there are no more references to the root scope + let scope = unsafe { &mut *self.scopes.get_scope_raw(ScopeId(0)).unwrap() }; + scope.reset(); + + // make sure there are no "live" components + for (_, scopeptr) in self.scopes.scopes.get_mut().drain() { + let scope = unsafe { bumpalo::boxed::Box::from_raw(scopeptr) }; + drop(scope); + } + + for scopeptr in self.scopes.free_scopes.get_mut().drain(..) { + let mut scope = unsafe { bumpalo::boxed::Box::from_raw(scopeptr) }; + scope.reset(); + drop(scope); + } + + // Safety: all refereneces to this caller have been dropped + // the pointer is still valid since we haven't moved it since the virtualdom was created + // ensure the root component's caller is dropped + // drop(unsafe { Box::from_raw(self.caller) }); } } diff --git a/packages/core/tests/diffing.rs b/packages/core/tests/diffing.rs index b8c86e615..2125cb9fb 100644 --- a/packages/core/tests/diffing.rs +++ b/packages/core/tests/diffing.rs @@ -15,7 +15,7 @@ mod test_logging; fn new_dom() -> VirtualDom { const IS_LOGGING_ENABLED: bool = false; test_logging::set_up_logging(IS_LOGGING_ENABLED); - VirtualDom::new(|cx| todo!()) + VirtualDom::new(|cx| rsx!(cx, "hi")) } use DomEdit::*; diff --git a/packages/core/tests/earlyabort.rs b/packages/core/tests/earlyabort.rs index 713fe7ccb..ef77beac9 100644 --- a/packages/core/tests/earlyabort.rs +++ b/packages/core/tests/earlyabort.rs @@ -55,13 +55,13 @@ fn test_early_abort() { ] ); - let edits = dom.hard_diff(ScopeId(0)).unwrap(); + let edits = dom.hard_diff(ScopeId(0)); assert_eq!( edits.edits, [CreatePlaceholder { root: 3 }, ReplaceWith { root: 1, m: 1 },], ); - let edits = dom.hard_diff(ScopeId(0)).unwrap(); + let edits = dom.hard_diff(ScopeId(0)); assert_eq!( edits.edits, [ diff --git a/packages/core/tests/lifecycle.rs b/packages/core/tests/lifecycle.rs index 2da5b5bd6..798870250 100644 --- a/packages/core/tests/lifecycle.rs +++ b/packages/core/tests/lifecycle.rs @@ -46,13 +46,13 @@ fn manual_diffing() { #[test] fn events_generate() { static App: Component<()> = |cx| { - let mut count = use_state(&cx, || 0); + let count = cx.use_hook(|_| 0, |f| f); let inner = match *count { 0 => { rsx! { div { - onclick: move |_| count += 1, + onclick: move |_| *count += 1, div { "nested" } @@ -105,8 +105,8 @@ fn events_generate() { #[test] fn components_generate() { static App: Component<()> = |cx| { - let mut render_phase = use_state(&cx, || 0); - render_phase += 1; + let render_phase = cx.use_hook(|_| 0, |f| f); + *render_phase += 1; cx.render(match *render_phase { 0 => rsx!("Text0"), @@ -140,7 +140,7 @@ fn components_generate() { ] ); - let edits = dom.hard_diff(ScopeId(0)).unwrap(); + let edits = dom.hard_diff(ScopeId(0)); assert_eq!( edits.edits, [ @@ -152,7 +152,7 @@ fn components_generate() { ] ); - let edits = dom.hard_diff(ScopeId(0)).unwrap(); + let edits = dom.hard_diff(ScopeId(0)); assert_eq!( edits.edits, [ @@ -164,7 +164,7 @@ fn components_generate() { ] ); - let edits = dom.hard_diff(ScopeId(0)).unwrap(); + let edits = dom.hard_diff(ScopeId(0)); assert_eq!( edits.edits, [ @@ -173,13 +173,13 @@ fn components_generate() { ] ); - let edits = dom.hard_diff(ScopeId(0)).unwrap(); + let edits = dom.hard_diff(ScopeId(0)); assert_eq!( edits.edits, [CreatePlaceholder { root: 5 }, ReplaceWith { root: 4, m: 1 },] ); - let edits = dom.hard_diff(ScopeId(0)).unwrap(); + let edits = dom.hard_diff(ScopeId(0)); assert_eq!( edits.edits, [ @@ -191,7 +191,7 @@ fn components_generate() { ] ); - let edits = dom.hard_diff(ScopeId(0)).unwrap(); + let edits = dom.hard_diff(ScopeId(0)); assert_eq!( edits.edits, [ @@ -207,7 +207,7 @@ fn components_generate() { ] ); - let edits = dom.hard_diff(ScopeId(0)).unwrap(); + let edits = dom.hard_diff(ScopeId(0)); assert_eq!( edits.edits, [ @@ -222,8 +222,8 @@ fn components_generate() { fn component_swap() { // simple_logger::init(); static App: Component<()> = |cx| { - let mut render_phase = use_state(&cx, || 0); - render_phase += 1; + let render_phase = cx.use_hook(|_| 0, |f| f); + *render_phase += 1; cx.render(match *render_phase { 0 => rsx!( diff --git a/packages/core/tests/miri_stress.rs b/packages/core/tests/miri_stress.rs index c51daa536..2091a8e3a 100644 --- a/packages/core/tests/miri_stress.rs +++ b/packages/core/tests/miri_stress.rs @@ -9,7 +9,7 @@ Specifically: - [ ] Async isn't busted */ -use dioxus::{prelude::*, DomEdit, ScopeId}; +use dioxus::{prelude::*, DomEdit, SchedulerMsg, ScopeId}; use dioxus_core as dioxus; use dioxus_core_macro::*; use dioxus_html as dioxus_elements; @@ -55,12 +55,6 @@ fn test_memory_leak() { )) } - fn child(cx: Scope<()>) -> Element { - rsx!(cx, div { - "goodbye world" - }) - } - #[derive(Props)] struct BorrowedProps<'a> { na: &'a str, @@ -74,6 +68,10 @@ fn test_memory_leak() { }) } + fn child(cx: Scope<()>) -> Element { + rsx!(cx, div { "goodbye world" }) + } + let mut dom = new_dom(app, ()); dom.rebuild(); @@ -100,7 +98,7 @@ fn memo_works_properly() { cx.render(rsx!( div { "Hello, world!" } - child(na: "asd".to_string()) + child(na: "asdfg".to_string()) )) } @@ -110,9 +108,7 @@ fn memo_works_properly() { } fn child(cx: Scope) -> Element { - rsx!(cx, div { - "goodbye world" - }) + rsx!(cx, div { "goodbye world" }) } let mut dom = new_dom(app, ()); @@ -123,4 +119,170 @@ fn memo_works_properly() { dom.hard_diff(ScopeId(0)); dom.hard_diff(ScopeId(0)); dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); + dom.hard_diff(ScopeId(0)); +} + +#[test] +fn free_works_on_root_props() { + fn app(cx: Scope) -> Element { + cx.render(rsx! { + child(a: "alpha") + child(a: "beta") + child(a: "gamma") + child(a: "delta") + }) + } + + #[derive(Props, PartialEq)] + struct ChildProps { + a: &'static str, + } + + fn child(cx: Scope) -> Element { + rsx!(cx, "child {cx.props.a}") + } + + struct Custom { + val: String, + } + + impl Drop for Custom { + fn drop(&mut self) { + dbg!("dropped!"); + } + } + + let mut dom = new_dom( + app, + Custom { + val: String::from("asd"), + }, + ); + dom.rebuild(); +} + +#[test] +fn free_works_on_borrowed() { + fn app(cx: Scope<()>) -> Element { + cx.render(rsx! { + child(a: "alpha", b: "asd".to_string()) + }) + } + #[derive(Props)] + struct ChildProps<'a> { + a: &'a str, + b: String, + } + + fn child<'a>(cx: Scope<'a, ChildProps<'a>>) -> Element { + dbg!("rendering child"); + rsx!(cx, "child {cx.props.a}, {cx.props.b}") + } + + impl Drop for ChildProps<'_> { + fn drop(&mut self) { + dbg!("dropped child!"); + } + } + + let mut dom = new_dom(app, ()); + let _ = dom.rebuild(); +} + +#[test] +fn free_works_on_root_hooks() { + /* + On Drop, scopearena drops all the hook contents. + */ + + struct Droppable(T); + impl Drop for Droppable { + fn drop(&mut self) { + dbg!("dropping droppable"); + } + } + + fn app(cx: Scope<()>) -> Element { + let name = cx.use_hook(|_| Droppable(String::from("asd")), |f| f); + rsx!(cx, div { "{name.0}" }) + } + + let mut dom = new_dom(app, ()); + let _ = dom.rebuild(); +} + +#[test] +fn old_props_arent_stale() { + fn app(cx: Scope<()>) -> Element { + dbg!("rendering parent"); + let cnt = cx.use_hook(|_| 0, |f| f); + *cnt += 1; + + if *cnt == 1 { + rsx!(cx, div { child(a: "abcdef".to_string()) }) + } else { + rsx!(cx, div { child(a: "abcdef".to_string()) }) + } + } + + #[derive(Props, PartialEq)] + struct ChildProps { + a: String, + } + fn child(cx: Scope) -> Element { + dbg!("rendering child", &cx.props.a); + rsx!(cx, div { "child {cx.props.a}" }) + } + + let mut dom = new_dom(app, ()); + let _ = dom.rebuild(); + + dom.handle_message(SchedulerMsg::Immediate(ScopeId(0))); + dom.work_with_deadline(|| false); + + dom.handle_message(SchedulerMsg::Immediate(ScopeId(0))); + dom.work_with_deadline(|| false); + + dom.handle_message(SchedulerMsg::Immediate(ScopeId(0))); + dom.work_with_deadline(|| false); + + dbg!("forcing update to child"); + + dom.handle_message(SchedulerMsg::Immediate(ScopeId(1))); + dom.work_with_deadline(|| false); + + dom.handle_message(SchedulerMsg::Immediate(ScopeId(1))); + dom.work_with_deadline(|| false); + + dom.handle_message(SchedulerMsg::Immediate(ScopeId(1))); + dom.work_with_deadline(|| false); +} + +#[test] +fn basic() { + fn app(cx: Scope<()>) -> Element { + rsx!(cx, div { + child(a: "abcdef".to_string()) + }) + } + + #[derive(Props, PartialEq)] + struct ChildProps { + a: String, + } + + fn child(cx: Scope) -> Element { + dbg!("rendering child", &cx.props.a); + rsx!(cx, div { "child {cx.props.a}" }) + } + + let mut dom = new_dom(app, ()); + let _ = dom.rebuild(); + + dom.handle_message(SchedulerMsg::Immediate(ScopeId(0))); + dom.work_with_deadline(|| false); + + dom.handle_message(SchedulerMsg::Immediate(ScopeId(0))); + dom.work_with_deadline(|| false); } diff --git a/packages/ssr/src/lib.rs b/packages/ssr/src/lib.rs index a29a7db1c..e0f5a91bb 100644 --- a/packages/ssr/src/lib.rs +++ b/packages/ssr/src/lib.rs @@ -244,7 +244,7 @@ impl<'a> TextRenderer<'a, '_> { } } VNode::Component(vcomp) => { - let idx = vcomp.associated_scope.get().unwrap(); + let idx = vcomp.scope.get().unwrap(); if let (Some(vdom), false) = (self.vdom, self.cfg.skip_components) { let new_node = vdom.get_scope(idx).unwrap().root_node(); From 78d9056e35deb6e87ea2929cc5369e35b8a20847 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 20 Dec 2021 23:31:33 -0500 Subject: [PATCH 19/21] feat: it works with a new bump each time!! --- packages/core/src/diff.rs | 71 +++++++-------- packages/core/src/nodes.rs | 4 +- packages/core/src/scopes.rs | 148 ++++++++++++++++++------------- packages/core/src/virtual_dom.rs | 9 +- 4 files changed, 121 insertions(+), 111 deletions(-) diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs index 9603f1c0f..886195a86 100644 --- a/packages/core/src/diff.rs +++ b/packages/core/src/diff.rs @@ -88,6 +88,8 @@ //! More info on how to improve this diffing algorithm: //! - https://hacks.mozilla.org/2019/03/fast-bump-allocated-virtual-doms-with-rust-and-wasm/ +use std::borrow::BorrowMut; + use crate::innerlude::*; use fxhash::{FxHashMap, FxHashSet}; use smallvec::{smallvec, SmallVec}; @@ -427,10 +429,11 @@ impl<'bump> DiffState<'bump> { let parent_idx = self.stack.current_scope().unwrap(); // Insert a new scope into our component list - let caller = unsafe { std::mem::transmute(vcomponent.props as *const _) }; + let props: Box = vcomponent.props.borrow_mut().take().unwrap(); + let props: Box = unsafe { std::mem::transmute(props) }; let new_idx = self.scopes.new_with_key( vcomponent.user_fc, - caller, + props, Some(parent_idx), self.stack.element_stack.last().copied().unwrap(), 0, @@ -441,9 +444,7 @@ impl<'bump> DiffState<'bump> { match vcomponent.can_memoize { true => { - // promote the props onto the heap - // when we diff these nodes, we'll want to move it over - vcomponent.props.promote(); + // todo: implement promotion logic. save us from boxing props that we don't need } false => { // track this component internally so we know the right drop order @@ -709,43 +710,30 @@ impl<'bump> DiffState<'bump> { .get_scope(scope_addr) .unwrap_or_else(|| panic!("could not find {:?}", scope_addr)); - /* - old.props is the previous vcomponent - existing_props is the current ScopeState's - */ - let existing_props = unsafe { &*scope.render.get() }; - if old.can_memoize { - // let props_are_the_same = unsafe { existing_props.memoize(new.props) }; + // take the new props out regardless + // when memoizing, push to the existing scope if memoization happens + let new_props = new.props.borrow_mut().take().unwrap(); - if !props_are_the_same || self.force_diff { - // release the old props since they will be overwritten next frame - // existing_props.release(); - - // move the old props onto the heap - // todo: maybe we can reuse the old props box? - new.props.promote(); - - scope - .render - .set(unsafe { std::mem::transmute(new.props as *const dyn AnyProps) }); - - // this should auto drop the previous props - self.scopes.run_scope(scope_addr); - - self.diff_node( - self.scopes.wip_head(scope_addr), - self.scopes.fin_head(scope_addr), - ); + let should_run = { + if old.can_memoize { + let props_are_the_same = unsafe { + scope + .props + .borrow() + .as_ref() + .unwrap() + .memoize(new_props.as_ref()) + }; + !props_are_the_same || self.force_diff } else { - // release the old props since they will be overwritten next frame - if existing_props.as_ptr() != old.props.as_ptr() { - old.props.release(); - } + true } - } else { - scope - .render - .set(unsafe { std::mem::transmute(new.props as *const dyn AnyProps) }); + }; + + if should_run { + let _old_props = scope + .props + .replace(unsafe { std::mem::transmute(Some(new_props)) }); // this should auto drop the previous props self.scopes.run_scope(scope_addr); @@ -753,7 +741,10 @@ impl<'bump> DiffState<'bump> { self.scopes.wip_head(scope_addr), self.scopes.fin_head(scope_addr), ); - } + } else { + // memoization has taken place + drop(new_props); + }; self.stack.scope_stack.pop(); } else { diff --git a/packages/core/src/nodes.rs b/packages/core/src/nodes.rs index 3d14a332c..419264ec8 100644 --- a/packages/core/src/nodes.rs +++ b/packages/core/src/nodes.rs @@ -359,7 +359,7 @@ pub struct VComponent<'src> { pub scope: Cell>, pub can_memoize: bool, pub user_fc: *const (), - pub props: Option>>, + pub props: RefCell>>, } pub(crate) struct VComponentProps

{ @@ -587,7 +587,7 @@ impl<'a> NodeFactory<'a> { scope: Default::default(), can_memoize: P::IS_STATIC, user_fc: component as *const (), - props: Some(RefCell::new(Box::new(VComponentProps { + props: RefCell::new(Some(Box::new(VComponentProps { // local_props: RefCell::new(Some(props)), // heap_props: RefCell::new(None), props, diff --git a/packages/core/src/scopes.rs b/packages/core/src/scopes.rs index 96c29c684..7536202b0 100644 --- a/packages/core/src/scopes.rs +++ b/packages/core/src/scopes.rs @@ -91,15 +91,18 @@ impl ScopeArena { container: ElementId, subtree: u32, ) -> ScopeId { + // Increment the ScopeId system. ScopeIDs are never reused let new_scope_id = ScopeId(self.scope_counter.get()); self.scope_counter.set(self.scope_counter.get() + 1); - let parent_scope = parent_scope.map(|f| self.get_scope_raw(f)).flatten(); + + // Get the height of the scope let height = parent_scope - .as_ref() - .map(|f| unsafe { &**f }) - .map(|f| f.height + 1) + .map(|id| self.get_scope(id).map(|scope| scope.height)) + .flatten() .unwrap_or_default(); + let parent_scope = parent_scope.map(|f| self.get_scope_raw(f)).flatten(); + /* This scopearena aggressively reuse old scopes when possible. We try to minimize the new allocations for props/arenas. @@ -107,60 +110,39 @@ impl ScopeArena { However, this will probably lead to some sort of fragmentation. I'm not exactly sure how to improve this today. */ - match self.free_scopes.borrow_mut().pop() { - // No free scope, make a new scope - None => { - let (node_capacity, hook_capacity) = self - .heuristics - .borrow() - .get(&fc_ptr) - .map(|h| (h.node_arena_size, h.hook_arena_size)) - .unwrap_or_default(); + if let Some(old_scope) = self.free_scopes.borrow_mut().pop() { + // reuse the old scope + let scope = unsafe { &mut *old_scope }; + scope.props.get_mut().replace(vcomp); + scope.parent_scope = parent_scope; + scope.height = height; + scope.subtree.set(subtree); + scope.our_arena_idx = new_scope_id; + scope.container = container; + let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); + debug_assert!(any_item.is_none()); + } else { + // else create a new scope + let (node_capacity, hook_capacity) = self + .heuristics + .borrow() + .get(&fc_ptr) + .map(|h| (h.node_arena_size, h.hook_arena_size)) + .unwrap_or_default(); - let frames = [BumpFrame::new(node_capacity), BumpFrame::new(node_capacity)]; - - let scope = self.bump.alloc(ScopeState { - sender: self.sender.clone(), - container, - our_arena_idx: new_scope_id, - parent_scope, + self.scopes.borrow_mut().insert( + new_scope_id, + self.bump.alloc(ScopeState::new( height, - frames, - subtree: Cell::new(subtree), - is_subtree_root: Cell::new(false), - - props: vcomp, - generation: 0.into(), - - shared_contexts: Default::default(), - - items: RefCell::new(SelfReferentialItems { - listeners: Default::default(), - borrowed_props: Default::default(), - tasks: Default::default(), - }), - - hook_arena: Bump::new(), - hook_vals: RefCell::new(Vec::with_capacity(hook_capacity)), - hook_idx: Default::default(), - }); - - let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); - debug_assert!(any_item.is_none()); - } - - // Reuse a free scope - Some(old_scope) => { - let scope = unsafe { &mut *old_scope }; - scope.props.set(vcomp); - scope.parent_scope = parent_scope; - scope.height = height; - scope.subtree = Cell::new(subtree); - scope.our_arena_idx = new_scope_id; - scope.container = container; - let any_item = self.scopes.borrow_mut().insert(new_scope_id, scope); - debug_assert!(any_item.is_none()); - } + container, + new_scope_id, + self.sender.clone(), + parent_scope, + vcomp, + node_capacity, + hook_capacity, + )), + ); } new_scope_id @@ -176,9 +158,6 @@ impl ScopeArena { let scope = unsafe { &mut *self.scopes.borrow_mut().remove(&id).unwrap() }; scope.reset(); - todo!("drop"); - // unsafe { &*scope.render.get() }.release(); - self.free_scopes.borrow_mut().push(scope); Some(()) @@ -230,8 +209,7 @@ impl ScopeArena { self.ensure_drop_safety(scope_id); - let g = comp.props.take(); - // comp.props.release(); + drop(comp.props.take()); }); // Now that all the references are gone, we can safely drop our own references in our listeners. @@ -285,7 +263,10 @@ impl ScopeArena { Also, the way we implement hooks allows us to cut rendering short before the next hook is recalled. I'm not sure if React lets you abort the component early, but we let you do that. */ - if let Some(node) = scope.props.render(scope) { + + let props = scope.props.borrow(); + let render = props.as_ref().unwrap(); + if let Some(node) = render.render(scope) { if !scope.items.borrow().tasks.is_empty() { self.pending_futures.borrow_mut().insert(id); } @@ -425,7 +406,7 @@ pub struct ScopeState { pub(crate) is_subtree_root: Cell, pub(crate) subtree: Cell, - pub(crate) props: Option>>, + pub(crate) props: RefCell>>, // nodes, items pub(crate) frames: [BumpFrame; 2], @@ -449,6 +430,47 @@ pub struct SelfReferentialItems<'a> { // Public methods exposed to libraries and components impl ScopeState { + fn new( + height: u32, + container: ElementId, + our_arena_idx: ScopeId, + sender: UnboundedSender, + parent_scope: Option<*mut ScopeState>, + vcomp: Box, + node_capacity: usize, + hook_capacity: usize, + ) -> Self { + let frames = [BumpFrame::new(node_capacity), BumpFrame::new(node_capacity)]; + + ScopeState { + sender, + container, + our_arena_idx, + parent_scope, + props: RefCell::new(Some(vcomp)), + height, + frames, + + // todo: subtrees + subtree: Cell::new(0), + is_subtree_root: Cell::new(false), + + generation: 0.into(), + + shared_contexts: Default::default(), + + items: RefCell::new(SelfReferentialItems { + listeners: Default::default(), + borrowed_props: Default::default(), + tasks: Default::default(), + }), + + hook_arena: Bump::new(), + hook_vals: RefCell::new(Vec::with_capacity(hook_capacity)), + hook_idx: Default::default(), + } + } + /// Get the subtree ID that this scope belongs to. /// /// Each component has its own subtree ID - the root subtree has an ID of 0. This ID is used by the renderer to route diff --git a/packages/core/src/virtual_dom.rs b/packages/core/src/virtual_dom.rs index 55902831c..40205d9ca 100644 --- a/packages/core/src/virtual_dom.rs +++ b/packages/core/src/virtual_dom.rs @@ -8,10 +8,7 @@ use futures_util::{Future, StreamExt}; use fxhash::FxHashSet; use indexmap::IndexSet; use smallvec::SmallVec; -use std::{ - any::Any, cell::RefCell, collections::VecDeque, iter::FromIterator, pin::Pin, sync::Arc, - task::Poll, -}; +use std::{any::Any, collections::VecDeque, iter::FromIterator, pin::Pin, sync::Arc, task::Poll}; /// A virtual node s ystem that progresses user events and diffs UI trees. /// @@ -207,8 +204,8 @@ impl VirtualDom { root as *const _, Box::new(VComponentProps { props: root_props, - memo: |_a, _b| false, - render_fn: unsafe { std::mem::transmute(root) }, + memo: |_a, _b| unreachable!("memo on root will neve be run"), + render_fn: root, }), None, ElementId(0), From b997b8ebbb82b5b9e9119bd2eb25335e2ed009d0 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 21 Dec 2021 00:46:10 -0500 Subject: [PATCH 20/21] feat: enable children properly --- packages/core-macro/src/lib.rs | 2 +- packages/core-macro/src/props/mod.rs | 24 ++++- packages/core/examples/component_children.rs | 40 +++++++ packages/core/src/diff.rs | 48 ++++----- packages/core/src/lib.rs | 1 - packages/core/src/nodes.rs | 107 +++++-------------- packages/core/src/scopes.rs | 14 +-- packages/core/tests/lifecycle.rs | 17 ++- packages/desktop/src/lib.rs | 2 +- packages/ssr/src/lib.rs | 4 +- 10 files changed, 128 insertions(+), 131 deletions(-) create mode 100644 packages/core/examples/component_children.rs diff --git a/packages/core-macro/src/lib.rs b/packages/core-macro/src/lib.rs index 6d36280cb..268c38276 100644 --- a/packages/core-macro/src/lib.rs +++ b/packages/core-macro/src/lib.rs @@ -17,7 +17,7 @@ pub fn format_args_f(input: TokenStream) -> TokenStream { .into() } -#[proc_macro_derive(Props, attributes(builder))] +#[proc_macro_derive(Props, attributes(props))] pub fn derive_typed_builder(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = parse_macro_input!(input as syn::DeriveInput); match props::impl_my_derive(&input) { diff --git a/packages/core-macro/src/props/mod.rs b/packages/core-macro/src/props/mod.rs index c13f1b174..c2b667524 100644 --- a/packages/core-macro/src/props/mod.rs +++ b/packages/core-macro/src/props/mod.rs @@ -3,8 +3,8 @@ //! However, it has been adopted to fit the Dioxus Props builder pattern. //! //! For dioxus, we make a few changes: -//! - automatically implement Into

{ - // Props start local - // If they are static, then they can get promoted onto the heap pub render_fn: Component

, - pub props: P, pub memo: unsafe fn(&P, &P) -> bool, + pub props: P, } pub trait AnyProps { fn as_ptr(&self) -> *const (); - fn release(&self); - fn replace_heap(&self, new: Box); - - // move the props from the bump arena onto the heap - fn promote(&self); fn render<'a>(&'a self, bump: &'a ScopeState) -> Element<'a>; unsafe fn memoize(&self, other: &dyn AnyProps) -> bool; } @@ -384,16 +376,9 @@ pub trait AnyProps { impl

AnyProps for VComponentProps

{ fn as_ptr(&self) -> *const () { &self.props as *const _ as *const () - // // todo: maybe move this into an enum - // let heap_props = self.heap_props.borrow(); - // if let Some(b) = heap_props.as_ref() { - // b.as_ref() as *const _ as *const () - // } else { - // let local_props = self.local_props.borrow(); - // local_props.as_ref().unwrap() as *const _ as *const () - // } } + // Safety: // this will downcat the other ptr as our swallowed type! // you *must* make this check *before* calling this method // if your functions are not the same, then you will downcast a pointer into a different type (UB) @@ -403,41 +388,9 @@ impl

AnyProps for VComponentProps

{ (self.memo)(real_us, real_other) } - fn release(&self) { - panic!("don't release props anymore"); - // if let Some(heap_props) = self.heap_props.borrow_mut().take() { - // dbg!("releasing heap"); - // drop(heap_props) - // } else if let Some(local_props) = self.local_props.borrow_mut().take() { - // dbg!("releasing local"); - // drop(local_props) - // } else { - // dbg!("trying to do a double release"); - // } - } - - fn promote(&self) { - panic!("don't promote props anymore"); - // dbg!("promoting props"); - // if let Some(props) = self.local_props.borrow_mut().take() { - // let mut heap_slot = self.heap_props.borrow_mut(); - // *heap_slot = Some(Box::new(props)); - // } - } - fn render<'a>(&'a self, scope: &'a ScopeState) -> Element<'a> { - let props: &P = &self.props; - let inline_props = unsafe { std::mem::transmute::<&P, &P>(props) }; - - (self.render_fn)(Scope { - scope, - props: inline_props, - }) - } - - fn replace_heap(&self, new: Box) { - // let new = new.downcast::

().unwrap(); - // self.heap_props.borrow_mut().replace(new); + let props = unsafe { std::mem::transmute::<&P, &P>(&self.props) }; + (self.render_fn)(Scope { scope, props }) } } @@ -463,7 +416,7 @@ impl<'a> NodeFactory<'a> { /// Directly pass in text blocks without the need to use the format_args macro. pub fn static_text(&self, text: &'static str) -> VNode<'a> { VNode::Text(self.bump.alloc(VText { - dom_id: empty_cell(), + id: empty_cell(), text, is_static: true, })) @@ -492,7 +445,7 @@ impl<'a> NodeFactory<'a> { VNode::Text(self.bump.alloc(VText { text, is_static, - dom_id: empty_cell(), + id: empty_cell(), })) } @@ -545,14 +498,14 @@ impl<'a> NodeFactory<'a> { let key = key.map(|f| self.raw_text(f).0); VNode::Element(self.bump.alloc(VElement { - tag_name, + tag: tag_name, key, namespace, listeners, attributes, children, - dom_id: empty_cell(), - parent_id: empty_cell(), + id: empty_cell(), + parent: empty_cell(), })) } @@ -621,9 +574,7 @@ impl<'a> NodeFactory<'a> { } if nodes.is_empty() { - VNode::Placeholder(self.bump.alloc(VPlaceholder { - dom_id: empty_cell(), - })) + VNode::Placeholder(self.bump.alloc(VPlaceholder { id: empty_cell() })) } else { VNode::Fragment(VFragment { children: nodes.into_bump_slice(), @@ -643,9 +594,7 @@ impl<'a> NodeFactory<'a> { } if nodes.is_empty() { - VNode::Placeholder(self.bump.alloc(VPlaceholder { - dom_id: empty_cell(), - })) + VNode::Placeholder(self.bump.alloc(VPlaceholder { id: empty_cell() })) } else { let children = nodes.into_bump_slice(); @@ -686,9 +635,9 @@ impl<'a> NodeFactory<'a> { } if nodes.is_empty() { - Some(VNode::Placeholder(self.bump.alloc(VPlaceholder { - dom_id: empty_cell(), - }))) + Some(VNode::Placeholder( + self.bump.alloc(VPlaceholder { id: empty_cell() }), + )) } else { let children = nodes.into_bump_slice(); @@ -766,9 +715,7 @@ impl<'a> IntoVNode<'a> for Option> { fn into_vnode(self, cx: NodeFactory<'a>) -> VNode<'a> { match self { Some(lazy) => lazy.call(cx), - None => VNode::Placeholder(cx.bump.alloc(VPlaceholder { - dom_id: empty_cell(), - })), + None => VNode::Placeholder(cx.bump.alloc(VPlaceholder { id: empty_cell() })), } } } diff --git a/packages/core/src/scopes.rs b/packages/core/src/scopes.rs index 7536202b0..c11f3a996 100644 --- a/packages/core/src/scopes.rs +++ b/packages/core/src/scopes.rs @@ -44,11 +44,11 @@ impl ScopeArena { // this will *never* show up in the diffing process // todo: figure out why this is necessary. i forgot. whoops. let el = bump.alloc(VElement { - tag_name: "root", + tag: "root", namespace: None, key: None, - dom_id: Cell::new(Some(ElementId(0))), - parent_id: Default::default(), + id: Cell::new(Some(ElementId(0))), + parent: Default::default(), listeners: &[], attributes: &[], children: &[], @@ -279,7 +279,7 @@ impl ScopeArena { let node = frame .bump .alloc(VNode::Placeholder(frame.bump.alloc(VPlaceholder { - dom_id: Default::default(), + id: Default::default(), }))); frame.node.set(unsafe { extend_vnode(node) }); } @@ -310,7 +310,7 @@ impl ScopeArena { } } - cur_el = real_el.parent_id.get(); + cur_el = real_el.parent.get(); } } } @@ -869,7 +869,7 @@ impl BumpFrame { let node = &*bump.alloc(VText { text: "placeholdertext", - dom_id: Default::default(), + id: Default::default(), is_static: false, }); let node = bump.alloc(VNode::Text(unsafe { std::mem::transmute(node) })); @@ -881,7 +881,7 @@ impl BumpFrame { self.bump.reset(); let node = self.bump.alloc(VText { text: "placeholdertext", - dom_id: Default::default(), + id: Default::default(), is_static: false, }); let node = self diff --git a/packages/core/tests/lifecycle.rs b/packages/core/tests/lifecycle.rs index 798870250..dd8c66627 100644 --- a/packages/core/tests/lifecycle.rs +++ b/packages/core/tests/lifecycle.rs @@ -109,14 +109,14 @@ fn components_generate() { *render_phase += 1; cx.render(match *render_phase { - 0 => rsx!("Text0"), - 1 => rsx!(div {}), - 2 => rsx!("Text2"), - 3 => rsx!(Child {}), - 4 => rsx!({ None as Option<()> }), - 5 => rsx!("text 3"), - 6 => rsx!({ (0..2).map(|f| rsx!("text {f}")) }), - 7 => rsx!(Child {}), + 1 => rsx!("Text0"), + 2 => rsx!(div {}), + 3 => rsx!("Text2"), + 4 => rsx!(Child {}), + 5 => rsx!({ None as Option<()> }), + 6 => rsx!("text 3"), + 7 => rsx!({ (0..2).map(|f| rsx!("text {f}")) }), + 8 => rsx!(Child {}), _ => todo!(), }) }; @@ -220,7 +220,6 @@ fn components_generate() { #[test] fn component_swap() { - // simple_logger::init(); static App: Component<()> = |cx| { let render_phase = cx.use_hook(|_| 0, |f| f); *render_phase += 1; diff --git a/packages/desktop/src/lib.rs b/packages/desktop/src/lib.rs index 2e962f800..5a1591fff 100644 --- a/packages/desktop/src/lib.rs +++ b/packages/desktop/src/lib.rs @@ -132,7 +132,7 @@ impl DesktopController { runtime.block_on(async move { // LocalSet::new().block_on(&runtime, async move { let mut dom = - VirtualDom::new_with_props_and_scheduler(root, props, sender, receiver); + VirtualDom::new_with_props_and_scheduler(root, props, (sender, receiver)); let edits = dom.rebuild(); diff --git a/packages/ssr/src/lib.rs b/packages/ssr/src/lib.rs index e0f5a91bb..075ef0908 100644 --- a/packages/ssr/src/lib.rs +++ b/packages/ssr/src/lib.rs @@ -168,7 +168,7 @@ impl<'a> TextRenderer<'a, '_> { } } - write!(f, "<{}", el.tag_name)?; + write!(f, "<{}", el.tag)?; let mut inner_html = None; let mut attr_iter = el.attributes.iter().peekable(); @@ -233,7 +233,7 @@ impl<'a> TextRenderer<'a, '_> { } } - write!(f, "", el.tag_name)?; + write!(f, "", el.tag)?; if self.cfg.newline { writeln!(f)?; } From fa106be1f5a45fa5707e66542e52c9f09e8cea7a Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 21 Dec 2021 00:58:14 -0500 Subject: [PATCH 21/21] wip: clean it up a bit --- packages/core/README.md | 39 ++++++++++++++++++++++++++++++++ packages/core/src/diff.rs | 2 -- packages/core/src/scopes.rs | 23 +++++++------------ packages/core/src/virtual_dom.rs | 25 ++++++++------------ packages/desktop/src/lib.rs | 2 +- packages/web/src/dom.rs | 2 +- 6 files changed, 59 insertions(+), 34 deletions(-) diff --git a/packages/core/README.md b/packages/core/README.md index 71ee252cb..ff60c905a 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -4,6 +4,45 @@ This is the core crate for the Dioxus Virtual DOM. This README will focus on the To build new apps with Dioxus or to extend the ecosystem with new hooks or components, use the higher-level `dioxus` crate with the appropriate feature flags. + +```rust +fn app(cx: Scope<()>) -> Element { + cx.render(rsx!( + div { "hello world" } + )) +} + + +fn main() { + let mut renderer = SomeRenderer::new(); + + + // Creating a new virtualdom from a component + let mut dom = VirtualDom::new(app); + + // Patching the renderer with the changes to draw the screen + let edits = dom.rebuild(); + renderer.apply(edits); + + // Injecting events + dom.handle_message(SchedulerMsg::UserEvent()); + +} + + + + + + + + + + + + + + +``` ## Internals Dioxus-core builds off the many frameworks that came before it. Notably, Dioxus borrows these concepts: diff --git a/packages/core/src/diff.rs b/packages/core/src/diff.rs index 2480652dd..2de598796 100644 --- a/packages/core/src/diff.rs +++ b/packages/core/src/diff.rs @@ -1295,8 +1295,6 @@ impl<'bump> DiffState<'bump> { let scope_id = c.scope.get().unwrap(); let root = self.scopes.root_node(scope_id); self.remove_nodes(Some(root), gen_muts); - - log::debug!("Destroying scope {:?}", scope_id); self.scopes.try_remove(scope_id).unwrap(); } } diff --git a/packages/core/src/scopes.rs b/packages/core/src/scopes.rs index c11f3a996..0b024f011 100644 --- a/packages/core/src/scopes.rs +++ b/packages/core/src/scopes.rs @@ -123,13 +123,6 @@ impl ScopeArena { debug_assert!(any_item.is_none()); } else { // else create a new scope - let (node_capacity, hook_capacity) = self - .heuristics - .borrow() - .get(&fc_ptr) - .map(|h| (h.node_arena_size, h.hook_arena_size)) - .unwrap_or_default(); - self.scopes.borrow_mut().insert( new_scope_id, self.bump.alloc(ScopeState::new( @@ -139,8 +132,11 @@ impl ScopeArena { self.sender.clone(), parent_scope, vcomp, - node_capacity, - hook_capacity, + self.heuristics + .borrow() + .get(&fc_ptr) + .map(|h| (h.node_arena_size, h.hook_arena_size)) + .unwrap_or_default(), )), ); } @@ -437,19 +433,16 @@ impl ScopeState { sender: UnboundedSender, parent_scope: Option<*mut ScopeState>, vcomp: Box, - node_capacity: usize, - hook_capacity: usize, + (node_capacity, hook_capacity): (usize, usize), ) -> Self { - let frames = [BumpFrame::new(node_capacity), BumpFrame::new(node_capacity)]; - ScopeState { sender, container, our_arena_idx, parent_scope, - props: RefCell::new(Some(vcomp)), height, - frames, + props: RefCell::new(Some(vcomp)), + frames: [BumpFrame::new(node_capacity), BumpFrame::new(node_capacity)], // todo: subtrees subtree: Cell::new(0), diff --git a/packages/core/src/virtual_dom.rs b/packages/core/src/virtual_dom.rs index 40205d9ca..d652ba326 100644 --- a/packages/core/src/virtual_dom.rs +++ b/packages/core/src/virtual_dom.rs @@ -345,11 +345,10 @@ impl VirtualDom { pub fn process_message(&mut self, msg: SchedulerMsg) { match msg { - // just keep looping, the task is now saved but we should actually poll it SchedulerMsg::NewTask(id) => { self.scopes.pending_futures.borrow_mut().insert(id); } - SchedulerMsg::UiEvent(event) => { + SchedulerMsg::Event(event) => { if let Some(element) = event.element { self.scopes.call_listener_with_bubbling(event, element); } @@ -640,6 +639,7 @@ impl VirtualDom { (create.mutations, edit.mutations) } } + /* Scopes and ScopeArenas are never dropped internally. An app will always occupy as much memory as its biggest form. @@ -662,9 +662,6 @@ should we build a vcomponent for the root? - 1: Use remove_nodes to use the ensure_drop_safety pathway to safely drop the tree - 2: Drop the ScopeState itself - - - */ impl Drop for VirtualDom { fn drop(&mut self) { @@ -684,27 +681,26 @@ impl Drop for VirtualDom { // make sure there are no "live" components for (_, scopeptr) in self.scopes.scopes.get_mut().drain() { + // safety: all scopes were made in the bump's allocator + // They are never dropped until now. The only way to drop is through Box. let scope = unsafe { bumpalo::boxed::Box::from_raw(scopeptr) }; drop(scope); } for scopeptr in self.scopes.free_scopes.get_mut().drain(..) { + // safety: all scopes were made in the bump's allocator + // They are never dropped until now. The only way to drop is through Box. let mut scope = unsafe { bumpalo::boxed::Box::from_raw(scopeptr) }; scope.reset(); drop(scope); } - - // Safety: all refereneces to this caller have been dropped - // the pointer is still valid since we haven't moved it since the virtualdom was created - // ensure the root component's caller is dropped - // drop(unsafe { Box::from_raw(self.caller) }); } } #[derive(Debug)] pub enum SchedulerMsg { // events from the host - UiEvent(UserEvent), + Event(UserEvent), // setstate Immediate(ScopeId), @@ -746,20 +742,19 @@ pub enum SchedulerMsg { /// ``` #[derive(Debug)] pub struct UserEvent { - /// The originator of the event trigger + /// The originator of the event trigger if available pub scope_id: Option, + /// The priority of the event to be scheduled around ongoing work pub priority: EventPriority, /// The optional real node associated with the trigger pub element: Option, /// The event type IE "onclick" or "onmouseover" - /// - /// The name that the renderer will use to mount the listener. pub name: &'static str, - /// Event Data + /// The event data to be passed onto the event handler pub data: Arc, } diff --git a/packages/desktop/src/lib.rs b/packages/desktop/src/lib.rs index 5a1591fff..a4eee7b33 100644 --- a/packages/desktop/src/lib.rs +++ b/packages/desktop/src/lib.rs @@ -210,7 +210,7 @@ impl DesktopController { "user_event" => { let event = events::trigger_from_serialized(req.params.unwrap()); log::debug!("User event: {:?}", event); - sender.unbounded_send(SchedulerMsg::UiEvent(event)).unwrap(); + sender.unbounded_send(SchedulerMsg::Event(event)).unwrap(); } "initialize" => { is_ready.store(true, std::sync::atomic::Ordering::Relaxed); diff --git a/packages/web/src/dom.rs b/packages/web/src/dom.rs index c92dd3400..40568807b 100644 --- a/packages/web/src/dom.rs +++ b/packages/web/src/dom.rs @@ -300,7 +300,7 @@ impl WebsysDom { // "Result" cannot be received from JS // Instead, we just build and immediately execute a closure that returns result match decode_trigger(event) { - Ok(synthetic_event) => trigger.as_ref()(SchedulerMsg::UiEvent(synthetic_event)), + Ok(synthetic_event) => trigger.as_ref()(SchedulerMsg::Event(synthetic_event)), Err(e) => log::error!("Error decoding Dioxus event attribute. {:#?}", e), }; });