diff --git a/packages/autofmt/README.md b/packages/autofmt/README.md index 128eb11b5..b0a418ee6 100644 --- a/packages/autofmt/README.md +++ b/packages/autofmt/README.md @@ -20,7 +20,7 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-autofmt/latest/dioxus-autofmt) | +[API Docs](https://docs.rs/dioxus-autofmt/latest/dioxus_autofmt) | [Chat](https://discord.gg/XgGxMSkvUM) @@ -45,5 +45,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/core-macro/Cargo.toml b/packages/core-macro/Cargo.toml index 1f8a236de..5338a7acc 100644 --- a/packages/core-macro/Cargo.toml +++ b/packages/core-macro/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] diff --git a/packages/core-macro/README.md b/packages/core-macro/README.md index 4a2d101e7..60654396e 100644 --- a/packages/core-macro/README.md +++ b/packages/core-macro/README.md @@ -20,7 +20,7 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-core-macro/latest/dioxus-core-macro) | +[API Docs](https://docs.rs/dioxus-core-macro/latest/dioxus_core_macro) | [Chat](https://discord.gg/XgGxMSkvUM) @@ -29,7 +29,7 @@ `dioxus-core-macro` provides a handful of helpful macros used by the `dioxus` crate. These include: - The `rsx!` macro that underpins templates and node creation -- The `inline_props` that transforms function arguments into an auto-derived struct +- The `inline_props` macro transforms function arguments into an auto-derived struct - The `format_args_f` macro which allows f-string formatting with support for expressions @@ -44,5 +44,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/core/Cargo.toml b/packages/core/Cargo.toml index 8f9b71035..9651ac483 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/core/README.md b/packages/core/README.md index d3ad1946f..e70872410 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -13,7 +13,7 @@ dioxus-core is a fast and featureful VirtualDom implementation written in and fo - Error boundaries through the `anyhow` crate - Customizable memoization -If just starting out, check out the Guides first. +If you are just starting, check out the Guides first. # General Theory @@ -21,7 +21,7 @@ The dioxus-core `VirtualDom` object is built around the concept of a `Template`. Each component in the VirtualDom works as a dedicated render loop where re-renders are triggered by events external to the VirtualDom, or from the components themselves. -When each component re-renders, it must return an `Element`. In Dioxus, the `Element` type is an alias for `Result`. Between two renders, Dioxus compares the inner `VNode` object, and calculates the differences of the dynamic portions of each internal `Template`. If any attributes or elements are different between the old layout and new layout, Dioxus will write modifications to the `Mutations` object. +When each component re-renders, it must return an `Element`. In Dioxus, the `Element` type is an alias for `Result`. Between two renders, Dioxus compares the inner `VNode` object and calculates the differences between the dynamic portions of each internal `Template`. If any attributes or elements are different between the old layout and the new layout, Dioxus will write modifications to the `Mutations` object. Dioxus expects the target renderer to save its nodes in a list. Each element is given a numerical ID which can be used to directly index into that list for O(1) lookups. @@ -63,7 +63,7 @@ dom.wait_for_work().await; dom.render_with_deadline(tokio::time::sleep(Duration::from_millis(16))); ``` -If an event occurs from outside the virtualdom while waiting for work, then we can cancel the wait using a `select!` block and inject the event. +If an event occurs from outside the VirtualDom while waiting for work, then we can cancel the wait using a `select!` block and inject the event. ```rust, ignore loop { @@ -88,18 +88,18 @@ 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 -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: +Dioxus-core hits a very high level of parity with mature frameworks. However, Dioxus also brings some new unique features: - managed lifetimes for borrowed data - placeholder approach for suspended vnodes - fiber/interruptible diffing algorithm -- custom memory allocator for vnodes and all text content +- 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 +- mirrored-slab approach for remote VirtualDoms - 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 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. +There's certainly more to the story, but these optimizations make Dioxus memory use and allocation count extremely minimal. For an average application, no allocations may be needed 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 a valuable resource. Combined with the memory-efficient footprint of Wasm compilation, Dioxus apps can scale to thousands of components and still stay snappy. @@ -112,5 +112,5 @@ The final implementation of Dioxus must: - 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. +- Be "live". Components should be able to be both server-rendered and client rendered without needing frontend APIs. +- Be modular. Components and hooks should work anywhere without worrying about the target platform. diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index 5f1ea27d7..93fd0b29a 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/packages/desktop/README.md b/packages/desktop/README.md index 3ce4c5820..9b1e7ad58 100644 --- a/packages/desktop/README.md +++ b/packages/desktop/README.md @@ -20,7 +20,7 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-desktop/latest/dioxus-desktop) | +[API Docs](https://docs.rs/dioxus-desktop/latest/dioxus_desktop) | [Chat](https://discord.gg/XgGxMSkvUM) @@ -37,10 +37,10 @@ This requires that webview is installed on the target system. WebView is install ## Features - Simple, one-line launch for desktop apps -- Dioxus virtualdom running on a native thread +- Dioxus VirtualDom running on a native thread - Full HTML/CSS support via `wry` and `tao` - Exposed `window` and `Proxy` types from tao for direct window manipulation -- Helpful hooks for +- Helpful hooks for accessing the window, WebView, and running javascript. ## Contributing @@ -53,5 +53,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/desktop/src/readme.md b/packages/desktop/src/readme.md index 3ac0d66df..567b05fcf 100644 --- a/packages/desktop/src/readme.md +++ b/packages/desktop/src/readme.md @@ -18,10 +18,11 @@ $ cargo new --bin demo $ cd app ``` -Add Dioxus with the `desktop` feature: +Add Dioxus and the `desktop` renderer feature: ```shell -$ cargo add dioxus --features desktop +$ cargo add dioxus +$ cargo add dioxus-desktop ``` Edit your `main.rs`: diff --git a/packages/dioxus/README.md b/packages/dioxus/README.md index 2e5a03b1e..4dc007096 100644 --- a/packages/dioxus/README.md +++ b/packages/dioxus/README.md @@ -229,7 +229,7 @@ of logic. Hooks provide us a way of retrieving state from the `Scope` and using it to render UI elements. By convention, all hooks are functions that should start with `use_`. We can -use hooks to define state and modify it from within listeners. +use hooks to define the state and modify it from within listeners. ```rust, ignore fn app(cx: Scope) -> Element { @@ -249,7 +249,7 @@ In a sense, hooks let us add a field of state to our component without declaring an explicit state 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: +Most hooks you'll write are simply compositions of other hooks: ```rust, ignore fn use_username(cx: &ScopeState, id: Uuid) -> bool { @@ -309,7 +309,7 @@ Beyond this overview, Dioxus supports: Good luck! -## Inspiration, Resources, Alternatives and Credits +## Inspiration, Resources, Alternatives, and Credits Dioxus is inspired by: - React: for its hooks, concurrency, suspense @@ -318,7 +318,7 @@ Dioxus is inspired by: 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 state management -- Sycamore: supports function components, web, ssr, but closer to SolidJS than React +- Sycamore: supports function components, web, ssr, but is closer to SolidJS than React - MoonZoom/Seed: opinionated frameworks based on the Elm model (message, update) - no hooks We've put a lot of work into making Dioxus ergonomic and *familiar*. diff --git a/packages/fermi/Cargo.toml b/packages/fermi/Cargo.toml index 5d0222599..9591a4f25 100644 --- a/packages/fermi/Cargo.toml +++ b/packages/fermi/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react", "state-management"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/fermi/README.md b/packages/fermi/README.md index 711b1a43a..bd7d38ac4 100644 --- a/packages/fermi/README.md +++ b/packages/fermi/README.md @@ -40,9 +40,9 @@ Inspired by atom-based state management solutions, all state in Fermi starts as static NAME: Atom<&str> = |_| "Dioxus"; ``` -From anywhere in our app, we can read our the value of our atom: +From anywhere in our app, we can read the value of our atom: -```rust, ignore +```rust, ignores fn NameCard(cx: Scope) -> Element { let name = use_read(cx, NAME); cx.render(rsx!{ h1 { "Hello, {name}"} }) @@ -83,9 +83,9 @@ $ cargo run --example fermi ## Features -Broadly our feature set to required to be released includes: +Broadly our feature set required to be released includes: - [x] Support for Atoms -- [x] Support for AtomRef (for values that aren't clone) +- [x] Support for AtomRef (for values that aren't `Clone`) - [ ] Support for Atom Families - [ ] Support for memoized Selectors - [ ] Support for memoized SelectorFamilies diff --git a/packages/hooks/Cargo.toml b/packages/hooks/Cargo.toml index e040272b7..c1b31ea65 100644 --- a/packages/hooks/Cargo.toml +++ b/packages/hooks/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/packages/hooks/README.md b/packages/hooks/README.md index f809aa57e..6d6f56d50 100644 --- a/packages/hooks/README.md +++ b/packages/hooks/README.md @@ -20,7 +20,7 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-hooks/latest/dioxus-hooks) | +[API Docs](https://docs.rs/dioxus-hooks/latest/dioxus_hooks) | [Chat](https://discord.gg/XgGxMSkvUM) @@ -54,5 +54,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/html/Cargo.toml b/packages/html/Cargo.toml index 1256a27cc..2159acb7b 100644 --- a/packages/html/Cargo.toml +++ b/packages/html/Cargo.toml @@ -7,8 +7,8 @@ description = "HTML Element pack for Dioxus - a concurrent renderer-agnostic Vir license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" -documentation = "https://docs.rs/dioxus" -keywords = ["dom", "ui", "gui", "react", "wasm"] +documentation = "https://dioxuslabs.com" +keywords = ["dom", "ui", "gui", "react"] [dependencies] dioxus-core = { path = "../core", version = "^0.3.0" } diff --git a/packages/html/README.md b/packages/html/README.md index 8d04ab042..7bae7e197 100644 --- a/packages/html/README.md +++ b/packages/html/README.md @@ -20,7 +20,7 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-html/latest/dioxus-html) | +[API Docs](https://docs.rs/dioxus-html/latest/dioxus_html) | [Chat](https://discord.gg/XgGxMSkvUM) @@ -61,7 +61,7 @@ impl DioxusElement for div { All elements should be defined as a zero-sized-struct (also known as unit struct). These structs are zero-cost and just provide the type-level trickery to Rust for compile-time correct templates. -Attributes would then be implemented as methods on these unit structs. +Attributes would then be implemented as constants on these unit structs. The HTML namespace is defined mostly with macros. However, the expanded form would look something like this: ```rust @@ -71,14 +71,8 @@ impl DioxusElement for base { const NAME_SPACE: Option<&'static str> = None; } impl base { - #[inline] - fn href<'a>(&self, f: NodeFactory<'a>, v: Arguments) -> Attribute<'a> { - f.attr("href", v, None, false) - } - #[inline] - fn target<'a>(&self, f: NodeFactory<'a>, v: Arguments) -> Attribute<'a> { - f.attr("target", v, None, false) - } + const href: (&'static str, Option<'static str>, bool) = ("href", None, false); + const target: (&'static str, Option<'static str>, bool) = ("target", None, false); } ``` Because attributes are defined as methods on the unit struct, they guard the attribute creation behind a compile-time correct interface. @@ -114,5 +108,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/interpreter/README.md b/packages/interpreter/README.md index af3f7debc..cb01f2cc7 100644 --- a/packages/interpreter/README.md +++ b/packages/interpreter/README.md @@ -20,7 +20,7 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-interpreter-js/latest/dioxus-interpreter-js) | +[API Docs](https://docs.rs/dioxus-interpreter-js/latest/dioxus_interpreter_js) | [Chat](https://discord.gg/XgGxMSkvUM) @@ -42,5 +42,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/liveview/Cargo.toml b/packages/liveview/Cargo.toml index 0fc26674c..7c3ccb675 100644 --- a/packages/liveview/Cargo.toml +++ b/packages/liveview/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react", "liveview"] description = "Build server-side apps with Dioxus" license = "MIT/Apache-2.0" diff --git a/packages/liveview/README.md b/packages/liveview/README.md index 3a3721a3b..6ab109f8e 100644 --- a/packages/liveview/README.md +++ b/packages/liveview/README.md @@ -20,13 +20,13 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-liveview/latest/dioxus-liveview) | +[API Docs](https://docs.rs/dioxus-liveview/latest/dioxus_liveview) | [Chat](https://discord.gg/XgGxMSkvUM) ## Overview -`dioxus-liveview` provides adapters for running the Dioxus VirtualDom over a websocket connection. +`dioxus-liveview` provides adapters for running the Dioxus VirtualDom over a WebSocket connection. The current backend frameworks supported include: @@ -34,9 +34,9 @@ The current backend frameworks supported include: - Warp - Salvo -Dioxus-LiveView exports a number of primitives to wire up an app into an existing backend framework. +Dioxus-LiveView exports some primitives to wire up an app into an existing backend framework. -- A threadpool for spawning the `!Send` VirtualDom and interacting with it from the websocket +- A ThreadPool for spawning the `!Send` VirtualDom and interacting with it from WebSockets - An adapter for transforming various socket types into the `LiveViewSocket` type - The glue to load the interpreter into your app @@ -51,5 +51,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/mobile/Cargo.toml b/packages/mobile/Cargo.toml index df23c7c4a..3595e76d7 100644 --- a/packages/mobile/Cargo.toml +++ b/packages/mobile/Cargo.toml @@ -7,7 +7,7 @@ description = "Mobile-compatible renderer for Dioxus" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react"] license = "MIT/Apache-2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/mobile/README.md b/packages/mobile/README.md index ceb043d9c..7af09e970 100644 --- a/packages/mobile/README.md +++ b/packages/mobile/README.md @@ -19,7 +19,7 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-mobile/latest/dioxus-mobile) | +[API Docs](https://docs.rs/dioxus-mobile/latest/dioxus_mobile) | [Chat](https://discord.gg/XgGxMSkvUM) @@ -94,7 +94,7 @@ fn app(cx: Scope) -> Element { } ``` -To configure the webview, menubar, and other important desktop-specific features, checkout out some of the launch configuration in the [API reference](https://docs.rs/dioxus-mobile/). +To configure the web view, menubar, and other important desktop-specific features, checkout out some of the launch configurations in the [API reference](https://docs.rs/dioxus-mobile/). ## Future Steps @@ -113,5 +113,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/native-core-macro/Cargo.toml b/packages/native-core-macro/Cargo.toml index 759d8ff00..6a37f75b2 100644 --- a/packages/native-core-macro/Cargo.toml +++ b/packages/native-core-macro/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react"] [lib] diff --git a/packages/native-core-macro/README.md b/packages/native-core-macro/README.md index a8c9db60b..90d7123b1 100644 --- a/packages/native-core-macro/README.md +++ b/packages/native-core-macro/README.md @@ -19,13 +19,13 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-native-core-macro/latest/dioxus-native-core-macro) | +[API Docs](https://docs.rs/dioxus-native-core-macro/latest/dioxus_native_core_macro) | [Chat](https://discord.gg/XgGxMSkvUM) ## Overview -`dioxus-native-core-macro` provides a handful of macros used by native-core for native renderers like TUI, Blitz, and Freya to derive their own state. +`dioxus-native-core-macro` provides a handful of macros used by native-core for native renderers like TUI, Blitz, and Freya to derive their state. ## Contributing @@ -39,5 +39,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/native-core/Cargo.toml b/packages/native-core/Cargo.toml index 67cbdd8e4..76718390d 100644 --- a/packages/native-core/Cargo.toml +++ b/packages/native-core/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" description = "Build natively rendered apps with Dioxus" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react"] [dependencies] diff --git a/packages/native-core/README.md b/packages/native-core/README.md index 210d95ba0..c467d37de 100644 --- a/packages/native-core/README.md +++ b/packages/native-core/README.md @@ -19,15 +19,15 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-native-core/latest/dioxus-native-core) | +[API Docs](https://docs.rs/dioxus-native-core/latest/dioxus_native_core) | [Chat](https://discord.gg/XgGxMSkvUM) ## Overview -`dioxus-native-core` provides a number of helpful utilities for lazily resolving computed values of the Dioxus VirtualDom to be used in conjunction with a native rendering engine. +`dioxus-native-core` provides several helpful utilities for lazily resolving computed values of the Dioxus VirtualDom to be used in conjunction with a native rendering engine. -The main "value-add" of this crate over implementing your own native tree is that this tree is incrementally recomputed using the Dioxus VirtualDom's edit stream. Only parts of the tree that rely on each other will be redrawn - all else will be ignored. +The main "value-add" of this crate over implementing your native tree is that this tree is incrementally recomputed using the Dioxus VirtualDom's edit stream. Only parts of the tree that rely on each other will be redrawn - all else will be ignored. ## Contributing @@ -41,5 +41,5 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/router/README.md b/packages/router/README.md index f5db366a9..43bc2df2b 100644 --- a/packages/router/README.md +++ b/packages/router/README.md @@ -19,13 +19,13 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-router/latest/dioxus-router) | +[API Docs](https://docs.rs/dioxus-router/latest/dioxus_router) | [Chat](https://discord.gg/XgGxMSkvUM) ## Overview -Dioxus Router is a first-party Router for all your Dioxus Apps. It provides a React-Router style interface using somewhat loose typing rules. +Dioxus Router is a first-party Router for all your Dioxus Apps. It provides a React-Router-style interface using somewhat loose typing rules. ```rust, ignore fn app() { @@ -52,6 +52,6 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/rsx/Cargo.toml b/packages/rsx/Cargo.toml index d0b906abd..6f98b5f47 100644 --- a/packages/rsx/Cargo.toml +++ b/packages/rsx/Cargo.toml @@ -6,8 +6,8 @@ license = "MIT/Apache-2.0" description = "Core functionality for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" -documentation = "https://docs.rs/dioxus-rsx" -keywords = ["dom", "ui", "gui", "react", "wasm"] +documentation = "https://dioxuslabs.com" +keywords = ["dom", "ui", "gui", "react"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/rsx/README.md b/packages/rsx/README.md index 7d99bcae5..707416b98 100644 --- a/packages/rsx/README.md +++ b/packages/rsx/README.md @@ -19,7 +19,7 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/dioxus-rsx/latest/dioxus-rsx) | +[API Docs](https://docs.rs/dioxus-rsx/latest/dioxus_rsx) | [Chat](https://discord.gg/XgGxMSkvUM) @@ -38,6 +38,6 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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/ssr/Cargo.toml b/packages/ssr/Cargo.toml index 7ea53f83a..0ce901b5a 100644 --- a/packages/ssr/Cargo.toml +++ b/packages/ssr/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT/Apache-2.0" repository = "https://github.com/DioxusLabs/dioxus/" homepage = "https://dioxuslabs.com" documentation = "https://dioxuslabs.com" -keywords = ["dom", "ui", "gui", "react", "wasm"] +keywords = ["dom", "ui", "gui", "react", "ssr"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/packages/ssr/README.md b/packages/ssr/README.md index 7619d6626..ef5931874 100644 --- a/packages/ssr/README.md +++ b/packages/ssr/README.md @@ -15,7 +15,7 @@ This crate is a part of the broader Dioxus ecosystem. For more resources about D ## Overview -Dioxus SSR provides utilities to render Dioxus components to valid HTML. Once rendered, the HTML can be rehydrated client side or served from your web-server of choice. +Dioxus SSR provides utilities to render Dioxus components to valid HTML. Once rendered, the HTML can be rehydrated client-side or served from your web server of choice. ```rust, ignore let app: Component = |cx| cx.render(rsx!(div {"hello world!"})); @@ -23,17 +23,17 @@ let app: Component = |cx| cx.render(rsx!(div {"hello world!"})); let mut vdom = VirtualDom::new(app); let _ = vdom.rebuild(); -let text = dioxus_ssr::render_vdom(&vdom); +let text = dioxus_ssr::render(&vdom); assert_eq!(text, "
hello world!
") ``` ## Basic Usage -The simplest example is to simply render some `rsx!` nodes to html. This can be done with the [`render_lazy`] api. +The simplest example is to simply render some `rsx!` nodes to HTML. This can be done with the [`render_lazy`] API. ```rust, ignore -let content = dioxus_ssr::render(rsx!{ +let content = dioxus_ssr::render_lazy(rsx!{ div { (0..5).map(|i| rsx!( "Number: {i}" @@ -45,10 +45,10 @@ let content = dioxus_ssr::render(rsx!{ ## Rendering a VirtualDom ```rust, ignore -let mut dom = VirtualDom::new(app); -let _ = dom.rebuild(); +let mut vdom = VirtualDom::new(app); +let _ = vdom.rebuild(); -let content = dioxus_ssr::render_vdom(&dom); +let content = dioxus_ssr::render(&vdom); ``` @@ -57,37 +57,42 @@ let content = dioxus_ssr::render_vdom(&dom); ## Usage in pre-rendering -This crate is particularly useful in pre-generating pages server-side and then selectively loading dioxus client-side to pick up the reactive elements. +This crate is particularly useful in pre-generating pages server-side and then selectively loading Dioxus client-side to pick up the reactive elements. -In fact, this crate supports hydration out of the box. However, it is extremely important that both the client and server will generate the exact same VirtualDOMs - the client picks up its VirtualDOM assuming that the pre-rendered page output is the same. To do this, you need to make sure that your VirtualDOM implementation is deterministic! This could involve either serializing our app state and sending it to the client, hydrating only parts of the page, or building tests to ensure what's rendered on the server is the same as the client. +This crate supports hydration out of the box. However, both the client and server must generate the *exact* same VirtualDOMs - the client picks up its VirtualDOM assuming that the pre-rendered page output is the same. To do this, you need to make sure that your VirtualDOM implementation is deterministic! This could involve either serializing our app state and sending it to the client, hydrating only parts of the page, or building tests to ensure what's rendered on the server is the same as the client. With pre-rendering enabled, this crate will generate element nodes with Element IDs pre-associated. During hydration, the Dioxus-WebSys renderer will attach the Virtual nodes to these real nodes after a page query. -To enable pre-rendering, simply configure the `SsrConfig` with pre-rendering enabled. +To enable pre-rendering, simply set the pre-rendering flag to true. ```rust, ignore -let dom = VirtualDom::new(App); +let mut vdom = VirtualDom::new(App); -let text = dioxus_ssr::render_vdom(App, Config { pre_render: true, ..Default::default() }); +let _ = vdom.rebuild(); + +let mut renderer = dioxus_ssr::Renderer::new(); +renderer.pre_render = true; + +let text = renderer.render(&vdom); ``` ## Usage in server-side rendering -Dioxus SSR can also be to render on the server. Obviously, you can just render the VirtualDOM to a string and send that down. +Dioxus SSR can also be used to render on the server. You can just render the VirtualDOM to a string and send that to the client. ```rust, ignore -let text = dioxus_ssr::render_vdom(&vdom); +let text = dioxus_ssr::render(&vdom); assert_eq!(text, "
hello world!
") ``` -The rest of the space - IE doing this more efficiently, caching the virtualdom, etc, will all need to be a custom implementation for now. +The rest of the space - IE doing this more efficiently, caching the VirtualDom, etc, will all need to be a custom implementation for now. ## Usage without a VirtualDom -Dioxus SSR needs an arena to allocate from - whether it be the VirtualDom or a dedicated Bump allocator. To render `rsx!` directly to a string, you'll want to create an `SsrRenderer` and call `render_lazy`. +Dioxus SSR needs an arena to allocate from - whether it be the VirtualDom or a dedicated Bump allocator. To render `rsx!` directly to a string, you'll want to create a `Renderer` and call `render_lazy`. ```rust, ignore -let text = dioxus_ssr::SsrRenderer::new().render_lazy(rsx!{ +let text = dioxus_ssr::Renderer::new().render_lazy(rsx!{ div { "hello world" } }); assert_eq!(text, "
hello world!
") @@ -104,4 +109,4 @@ let text = render_lazy!(rsx!( div { "hello world" } )); Dioxus SSR is a powerful tool to generate static sites. Using Dioxus for static site generation _is_ a bit overkill, however. The new documentation generation library, Doxie, is essentially Dioxus SSR on steroids designed for static site generation with client-side hydration. -Again, simply render the VirtualDOM to a string using `render_vdom` or any of the other render methods. +Again, simply render the VirtualDOM to a string using `render` or any of the other render methods. diff --git a/packages/tui/README.md b/packages/tui/README.md index ccce60ea3..aa0c4b3fc 100644 --- a/packages/tui/README.md +++ b/packages/tui/README.md @@ -61,9 +61,9 @@ fn app(cx: Scope) -> Element { ## Background -You can use Html-like semantics with stylesheets, inline styles, tree hierarchy, components, and more in your [`text-based user interface (TUI)`](https://en.wikipedia.org/wiki/Text-based_user_interface) application. +You can use Html-like semantics with inline styles, tree hierarchy, components, and more in your [`text-based user interface (TUI)`](https://en.wikipedia.org/wiki/Text-based_user_interface) application. -Rink is basically a port of [Ink](https://github.com/vadimdemedes/ink) but for [`Rust`](https://www.rust-lang.org/) and [`Dioxus`](https://dioxuslabs.com/). Rink doesn't depend on Node.js or any other JavaScript runtime, so your binaries are portable and beautiful. +Rink is essentially a port of [Ink](https://github.com/vadimdemedes/ink) but for [`Rust`](https://www.rust-lang.org/) and [`Dioxus`](https://dioxuslabs.com/). Rink doesn't depend on Node.js or any other JavaScript runtime, so your binaries are portable and beautiful. ## Limitations @@ -82,13 +82,14 @@ Rendering a VirtualDom works fine, but the ecosystem of hooks is not yet ready. ## Features Rink features: -- [x] Flexbox based layout system +- [x] Flexbox-based layout system - [ ] CSS selectors - [x] inline CSS support - [x] Built-in focusing system -- [ ] high-quality keyboard support -* [ ] Support for events, hooks, and callbacks1 -* [ ] Html tags2 +* [x] Widgets1 +* [ ] Support for events, hooks, and callbacks2 +* [ ] Html tags3 -1 Basic keyboard and mouse events are implemented. -2 Currently, HTML tags don't translate into any meaning inside of rink. So an `input` won't really mean anything nor does it have any additional functionality. +1 Currently only a subset of the input element is implemented as a component (not an element). The `Input` component supports sliders, text, numbers, passwords, buttons, and checkboxes. +2 Basic keyboard, mouse, and focus events are implemented. +3 Currently, most HTML tags don't translate into any meaning inside of Dioxus TUI. So an `input` *element* won't mean anything nor does it have any additional functionality. diff --git a/packages/web/README.md b/packages/web/README.md index 0789ac522..d3f4c1aeb 100644 --- a/packages/web/README.md +++ b/packages/web/README.md @@ -5,8 +5,8 @@ [![Build Status][actions-badge]][actions-url] [![Discord chat][discord-badge]][discord-url] -[crates-badge]: https://img.shields.io/crates/v/rsx-rosetta.svg -[crates-url]: https://crates.io/crates/rsx-rosetta +[crates-badge]: https://img.shields.io/crates/v/dioxus-web.svg +[crates-url]: https://crates.io/crates/dioxus-web [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg [mit-url]: https://github.com/dioxuslabs/dioxus/blob/master/LICENSE @@ -19,15 +19,15 @@ [Website](https://dioxuslabs.com) | [Guides](https://dioxuslabs.com/guide/) | -[API Docs](https://docs.rs/rsx-rosetta/latest/rsx-rosetta) | +[API Docs](https://docs.rs/dioxus-web/latest/dioxus_web) | [Chat](https://discord.gg/XgGxMSkvUM) ## Overview Run Dioxus in the browser using WebAssembly. -- Relies on sledgehammer and websys to modify the dom -- Supports instant hotreloading via the Dioxus CLI +- Relies on [sledgehammer-bindgen](https://github.com/Demonthos/sledgehammer_bindgen) and [web-sys](https://github.com/rustwasm/wasm-bindgen/tree/main/crates/web-sys) to modify the dom +- Supports instant hot reloading via the Dioxus CLI - Around 60k gzipped ## Contributing @@ -41,6 +41,6 @@ This project is licensed under the [MIT license]. [mit license]: https://github.com/DioxusLabs/dioxus/blob/master/LICENSE-MIT Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in Dioxus 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.