mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 06:34:20 +00:00
Merge pull request #744 from Demonthos/update-readmes
Update READMEs and tags for the 0.3 release
This commit is contained in:
commit
e5b39bb61f
31 changed files with 110 additions and 109 deletions
|
@ -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.
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<VNode>`. 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<VNode>`. 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.
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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`:
|
||||
|
|
|
@ -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*.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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, "<div>hello world!</div>")
|
||||
```
|
||||
|
||||
|
||||
## 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, "<div>hello world!</div>")
|
||||
```
|
||||
|
||||
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, "<div>hello world!</div>")
|
||||
|
@ -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.
|
||||
|
|
|
@ -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 callbacks<sup>1</sup>
|
||||
* [ ] Html tags<sup>2</sup>
|
||||
* [x] Widgets<sup>1</sup>
|
||||
* [ ] Support for events, hooks, and callbacks<sup>2</sup>
|
||||
* [ ] Html tags<sup>3</sup>
|
||||
|
||||
<sup>1</sup> Basic keyboard and mouse events are implemented.
|
||||
<sup>2</sup> 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.
|
||||
<sup>1</sup> 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.
|
||||
<sup>2</sup> Basic keyboard, mouse, and focus events are implemented.
|
||||
<sup>3</sup> 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.
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in a new issue