Update all docs links to 0.6, release 0.6 (#3225)

* update doc links to 0.6
* add new splash pages for crates
* update keyword features
* remove some unnecessary links
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-12-06 19:15:15 -08:00
1 parent d7d2c2fd53
commit 66a50240bc
58 files changed
+298 -229

No files matched your search

+1 -2
View File
@@ -7,8 +7,7 @@ description = "Autofomatter for Dioxus RSX"
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com"
keywords = ["dom", "ui", "gui", "react"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
keywords = ["web", "desktop", "mobile", "gui", "wasm"]
[dependencies]
dioxus-rsx = { workspace = true }
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5) |
[Guides](https://dioxuslabs.com/learn/0.6) |
[API Docs](https://docs.rs/dioxus-autofmt/latest/dioxus_autofmt) |
[Chat](https://discord.gg/XgGxMSkvUM)
+1 -2
View File
@@ -7,8 +7,7 @@ description = "Checks Dioxus RSX files for issues"
license = "MIT/Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com"
keywords = ["dom", "ui", "gui", "react"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
keywords = ["web", "desktop", "mobile", "gui", "wasm"]
[dependencies]
proc-macro2 = { workspace = true, features = ["span-locations"] }
+2 -2
View File
@@ -15,13 +15,13 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5) |
[Guides](https://dioxuslabs.com/learn/0.6) |
[API Docs](https://docs.rs/dioxus-check) |
[Chat](https://discord.gg/XgGxMSkvUM)
## Overview
`dioxus-check` analyzes Dioxus source code and reports errors and warnings. Primarily, it enforces the [Rules of Hooks](https://dioxuslabs.com/learn/0.5/reference/hooks#rules-of-hooks).
`dioxus-check` analyzes Dioxus source code and reports errors and warnings. Primarily, it enforces the [Rules of Hooks](https://dioxuslabs.com/learn/0.6/reference/hooks#rules-of-hooks).
## Contributing
+3 -3
View File
@@ -162,11 +162,11 @@ impl Display for IssueReport {
#[allow(clippy::enum_variant_names)] // we'll add non-hook ones in the future
/// Issues that might be found via static analysis of a Dioxus file.
pub enum Issue {
/// <https://dioxuslabs.com/learn/0.5/reference/hooks#no-hooks-in-conditionals>
/// <https://dioxuslabs.com/learn/0.6/reference/hooks#no-hooks-in-conditionals>
HookInsideConditional(HookInfo, ConditionalInfo),
/// <https://dioxuslabs.com/learn/0.5/reference/hooks#no-hooks-in-loops>
/// <https://dioxuslabs.com/learn/0.6/reference/hooks#no-hooks-in-loops>
HookInsideLoop(HookInfo, AnyLoopInfo),
/// <https://dioxuslabs.com/learn/0.5/reference/hooks#no-hooks-in-closures>
/// <https://dioxuslabs.com/learn/0.6/reference/hooks#no-hooks-in-closures>
HookInsideClosure(HookInfo, ClosureInfo),
HookInsideAsync(HookInfo, AsyncInfo),
HookOutsideComponent(HookInfo),
+1 -1
View File
@@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com"
description = "CLI Configuration for dioxus-cli"
keywords = ["dom", "ui", "gui", "react", ]
keywords = ["web", "desktop", "mobile", "gui", "wasm"]
[dependencies]
wasm-bindgen = { workspace = true, optional = true }
+2 -2
View File
@@ -3,10 +3,10 @@ name = "dioxus-cli"
version = { workspace = true }
authors = ["Jonathan Kelley"]
edition = "2021"
description = "CLI tool for developing, testing, and publishing Dioxus apps"
description = "CLI for building fullstack web, desktop, and mobile apps with a single codebase."
repository = "https://github.com/DioxusLabs/dioxus/"
license = "MIT OR Apache-2.0"
keywords = ["react", "gui", "cli", "dioxus", "wasm"]
keywords = ["mobile", "gui", "cli", "dioxus", "wasm"]
rust-version = "1.79.0"
[dependencies]
-3
View File
@@ -63,9 +63,6 @@ default_platform = "web"
[web.app]
title = "Hello"
[web.watcher]
[web.resource.dev]
```
The full anatomy of `Dioxus.toml` is shown on the [Dioxus website](https://dioxuslabs.com/learn/0.5/CLI/configure).
+1 -1
View File
@@ -7,7 +7,7 @@ description = "Configuration macros for Dioxus"
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com"
keywords = ["dom", "ui", "gui", "react"]
keywords = ["web", "desktop", "mobile", "gui", "wasm"]
[lib]
proc-macro = true
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5) |
[Guide](https://dioxuslabs.com/learn/0.6) |
[API Docs](https://docs.rs/dioxus-config-macro/latest/dioxus_config_macro/) |
[Chat](https://discord.gg/XgGxMSkvUM)
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5) |
[Guides](https://dioxuslabs.com/learn/0.6) |
[API Docs](https://docs.rs/dioxus-core-macro/latest/dioxus_core_macro) |
[Chat](https://discord.gg/XgGxMSkvUM)
+1 -1
View File
@@ -1055,7 +1055,7 @@ Finally, call `.build()` to create the instance of `{name}`.
name: field_name, ..
} = field;
if *field_name == "key" {
return Err(Error::new_spanned(field_name, "Naming a prop `key` is not allowed because the name can conflict with the built in key attribute. See https://dioxuslabs.com/learn/0.5/reference/dynamic_rendering#rendering-lists for more information about keys"));
return Err(Error::new_spanned(field_name, "Naming a prop `key` is not allowed because the name can conflict with the built in key attribute. See https://dioxuslabs.com/learn/0.6/reference/dynamic_rendering#rendering-lists for more information about keys"));
}
let StructInfo {
ref builder_name, ..
+2 -2
View File
@@ -3,11 +3,11 @@ name = "dioxus-core"
version = { workspace = true }
authors = ["Jonathan Kelley"]
edition = "2021"
description = "Core functionality for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences"
description = "Build fullstack web, desktop, and mobile apps with a single codebase."
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com"
keywords = ["dom", "ui", "gui", "react"]
keywords = ["web", "desktop", "mobile", "gui", "wasm"]
[dependencies]
dioxus-core-types = { workspace = true }
+1 -1
View File
@@ -81,7 +81,7 @@ fn main() {
## Contributing
- Check out the website [section on contributing](https://dioxuslabs.com/learn/0.5/contributing).
- Check out the website [section on contributing](https://dioxuslabs.com/learn/0.6/contributing).
- Report issues on our [issue tracker](https://github.com/dioxuslabs/dioxus/issues).
- [Join](https://discord.gg/XgGxMSkvUM) the discord and ask questions!
+1 -1
View File
@@ -6,7 +6,7 @@ edition = "2021"
description = "WebView renderer for Dioxus"
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com/learn/0.5/getting_started"
homepage = "https://dioxuslabs.com/learn/0.6/getting_started"
keywords = ["dom", "ui", "gui", "react"]
[dependencies]
+2 -2
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5) |
[Guides](https://dioxuslabs.com/learn/0.6) |
[API Docs](https://docs.rs/dioxus-desktop/latest/dioxus_desktop) |
[Chat](https://discord.gg/XgGxMSkvUM)
@@ -25,7 +25,7 @@
This requires that webview is installed on the target system. WebView is installed by default on macOS and iOS devices, but might not come preinstalled on Windows or Linux devices. To fix these issues, follow the [instructions in the guide](guide-url).
[guide-url]: https://dioxuslabs.com/learn/0.5/getting_started
[guide-url]: https://dioxuslabs.com/learn/0.6/getting_started
## Features
+1 -1
View File
@@ -47,4 +47,4 @@ To configure the webview, menubar, and other important desktop-specific features
## Future Steps
Make sure to read the [Dioxus Guide](https://dioxuslabs.com/learn/0.5/) if you already haven't!
Make sure to read the [Dioxus Guide](https://dioxuslabs.com/learn/0.6/) if you already haven't!
+2 -2
View File
@@ -3,10 +3,10 @@ name = "dioxus-lib"
version = { workspace = true }
authors = ["Jonathan Kelley", "Dioxus Labs", "ealmloff"]
edition = "2021"
description = "Portable, performant, and ergonomic framework for building cross-platform user interfaces in Rust"
description = "Build fullstack web, desktop, and mobile apps with a single codebase."
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com/learn/0.5/"
homepage = "https://dioxuslabs.com/learn/0.6/"
keywords = ["dom", "ui", "gui", "react", "wasm"]
rust-version = "1.79.0"
+23 -14
View File
@@ -1,20 +1,29 @@
<div>
<h1>🌗🚀 Dioxus (lib)</h1>
<p>
<strong>A concurrent, functional, virtual DOM for Rust</strong>
</p>
<div align="center">
<style>
@media (prefers-color-scheme: dark) { .darkmode-image { display: none; } }
@media (prefers-color-scheme: light) { .lightmode-image { display: none; } }
</style>
<img
src="https://github.com/user-attachments/assets/6c7e227e-44ff-4e53-824a-67949051149c"
alt="Build web, desktop, and mobile apps with a single codebase."
width="100%"
class="darkmode-image"
>
<img
src="https://github.com/user-attachments/assets/9c6a5fac-806d-4391-80d0-d87d63c406eb"
alt="Build web, desktop, and mobile apps with a single codebase."
width="100%"
class="lightmode-image"
>
<div>
<a href=https://dioxuslabs.com/learn/0.6/getting_started>Getting Started</a> | <a href="https://dioxuslabs.com/learn/0.6">Book (0.6)</a> | <a href="https://github.com/DioxusLabs/dioxus/tree/main/examples">Examples</a>
</div>
</div>
---
> This crate implements dioxus-lib which is a renderer-free version of Dioxus. This crate is intended to be used by library authors who need a stable core version of dioxus withuot pulling in renderer-related dependencies on accident.
# Resources
This overview provides a brief introduction to Dioxus. For a more in-depth guide, make sure to check out:
- [Getting Started](https://dioxuslabs.com/learn/0.5/getting_started)
- [Book (0.5)](https://dioxuslabs.com/learn/0.5)
- [Examples](https://github.com/DioxusLabs/dioxus/tree/main/examples)
# Overview and Goals
Dioxus makes it easy to quickly build complex user interfaces with Rust. Any Dioxus app can run in the web browser,
@@ -202,7 +211,7 @@ fn App() -> Element {
```
Hooks are sensitive to how they are used. To use hooks, you must abide by the
["rules of hooks"](https://dioxuslabs.com/learn/0.5/reference/hooks#rules-of-hooks):
["rules of hooks"](https://dioxuslabs.com/learn/0.6/reference/hooks#rules-of-hooks):
- Functions with "use\_" should not be called in callbacks
- Functions with "use\_" should not be called out of order
+11 -4
View File
@@ -3,11 +3,11 @@ name = "dioxus"
version = { workspace = true }
authors = ["Jonathan Kelley", "Dioxus Labs", "ealmloff"]
edition = "2021"
description = "Portable, performant, and ergonomic framework for building cross-platform user interfaces in Rust"
description = "Build fullstack web, desktop, and mobile apps with a single codebase."
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com/learn/0.5/"
keywords = ["dom", "ui", "gui", "react", "wasm"]
homepage = "https://dioxuslabs.com"
keywords = ["web", "desktop", "mobile", "gui", "wasm"]
rust-version = "1.79.0"
[dependencies]
@@ -29,7 +29,7 @@ dioxus-ssr = { workspace = true, optional = true }
manganis = { workspace = true, features = ["dioxus"], optional = true }
dioxus-logger = { workspace = true, optional = true }
serde = { version = "1.0.136", optional = true }
serde = { workspace = true, optional = true }
dioxus-cli-config = { workspace = true, optional = true }
[target.'cfg(not(any(target_arch = "wasm32", target_os = "ios", target_os = "android")))'.dependencies]
@@ -91,3 +91,10 @@ features = [
"liveview",
"server"
]
targets = [
"wasm32-unknown-unknown",
"aarch64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
"aarch64-linux-android",
]
+59 -42
View File
@@ -1,42 +1,65 @@
<div>
<h1>🌗🚀 Dioxus</h1>
<p>
<strong>A concurrent, functional, virtual DOM for Rust</strong>
</p>
<div align="center">
<style>
@media (prefers-color-scheme: dark) { .darkmode-image { display: none; } }
@media (prefers-color-scheme: light) { .lightmode-image { display: none; } }
</style>
<img
src="https://github.com/user-attachments/assets/6c7e227e-44ff-4e53-824a-67949051149c"
alt="Build web, desktop, and mobile apps with a single codebase."
width="100%"
class="darkmode-image"
>
<img
src="https://github.com/user-attachments/assets/9c6a5fac-806d-4391-80d0-d87d63c406eb"
alt="Build web, desktop, and mobile apps with a single codebase."
width="100%"
class="lightmode-image"
>
<div>
<a href=https://dioxuslabs.com/learn/0.6/getting_started>Getting Started</a> | <a href="https://dioxuslabs.com/learn/0.6">Book (0.6)</a> | <a href="https://github.com/DioxusLabs/dioxus/tree/main/examples">Examples</a>
</div>
</div>
# Resources
---
Dioxus is a framework for building cross-platform apps in Rust. With one codebase, you can build web, desktop, and mobile apps with fullstack server functions. Dioxus is designed to be easy to learn for developers familiar with web technologies like HTML, CSS, and JavaScript.
This overview provides a brief introduction to Dioxus. For a more in-depth guide, make sure to check out:
<div align="center">
<img src="https://github.com/user-attachments/assets/dddae6a9-c13b-4a88-84e8-dc98c1286d2a" alt="App with dioxus" height="600px">
</div>
- [Getting Started](https://dioxuslabs.com/learn/0.5/getting_started)
- [Book (0.5)](https://dioxuslabs.com/learn/0.5)
- [Examples](https://github.com/DioxusLabs/dioxus/tree/main/examples)
## At a glance
# Overview and Goals
Dioxus is crossplatform app framework that empowers developer to build beautiful, fast, type-safe apps with Rust. By default, Dioxus apps are declared with HTML and CSS. Dioxus includes a number of useful features:
Dioxus makes it easy to quickly build complex user interfaces with Rust. Any Dioxus app can run in the web browser,
as a desktop app, as a mobile app, or anywhere else provided you build the right renderer.
- Hotreloading of RSX markup and assets
- Interactive CLI with logging, project templates, linting, and more
- Integrated bundler for deploying to the web, macOS, Linux, and Windows
- Support for modern web features like SSR, Hydration, and HTML streaming
- Direct access to system APIs through JNI (Android), CoreFoundation (Apple), and web-sys (web)
- Type-safe application routing and server functions
Dioxus is heavily inspired by React, supporting many of the same concepts:
## Quick start
- Hooks for state
- VirtualDom & diffing
- Concurrency, fibers, and asynchronous rendering
- JSX-like templating syntax
To get started with Dioxus, you'll want to grab the dioxus-cli tool: `dx`. We distribute `dx` with `cargo-binstall` - if you already have binstall skip this step.
```shell
# skip if you already have cargo-binstall
cargo install cargo-binstall
If you know React, then you know Dioxus.
# install the precompiled `dx` tool
cargo binstall dioxus-cli
Dioxus is _substantially_ more performant than many of the other Rust UI libraries (Yew/Percy) and is _significantly_ more performant
than React—roughly competitive with InfernoJS.
# create a new app, following the template
dx new my-app && cd my-app
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.
# and then serve!
dx serve --platform desktop
```
## Brief Overview
## Your first app
All Dioxus apps are built by composing functions that start with a capital letter and return an `Element`.
All Dioxus apps are built by composing functions return an `Element`.
To launch an app, we use the `launch` method and use features in `Cargo.toml` to specify which renderer we want to use. In the launch function, we pass the app's root `Component`.
To launch an app, we use the `launch` method. In the launch function, we pass the app's root `Component`.
```rust, no_run
use dioxus::prelude::*;
@@ -107,10 +130,9 @@ fn App() -> Element {
## Components
We can compose these function components to build a complex app. Each new
component we design must take some Properties. For components with no explicit properties, we can omit the type altogether.
We can compose these function components to build a complex app. Each new component takes some Properties. For components with no explicit properties, we can omit the type altogether.
In Dioxus, all properties are memorized by default with Clone and PartialEq. For props you can't clone, simply wrap the fields in a [`ReadOnlySignal`](dioxus_signals::ReadOnlySignal) and Dioxus will handle converting types for you.
In Dioxus, all properties are memoized by default with `Clone` and `PartialEq`. For props you can't clone, simply wrap the fields in a [`ReadOnlySignal`](dioxus_signals::ReadOnlySignal) and Dioxus will handle converting types for you.
```rust, no_run
# use dioxus::prelude::*;
@@ -142,16 +164,14 @@ fn Header(title: String, color: String) -> Element {
}
```
> You can read more about props in the [reference](https://dioxuslabs.com/learn/0.5/reference/component_props).
> You can read more about props in the [reference](https://dioxuslabs.com/learn/0.6/reference/component_props).
## Hooks
While components are reusable forms of UI elements, hooks are reusable forms
of logic. Hooks provide a way of retrieving state from Dioxus' internal `Scope` and using
While components are reusable forms of UI elements, hooks are reusable forms of logic. Hooks provide a way of retrieving state from Dioxus' internal `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 the state and modify it from within listeners.
By convention, all hooks are functions that should start with `use_`. We can use hooks to define the state and modify it from within listeners.
```rust, no_run
# use dioxus::prelude::*;
@@ -164,17 +184,14 @@ fn App() -> Element {
}
```
Hooks are sensitive to how they are used. To use hooks, you must abide by the
["rules of hooks"](https://dioxuslabs.com/learn/0.5/reference/hooks#rules-of-hooks):
Hooks are sensitive to how they are used. To use hooks, you must abide by the ["rules of hooks"](https://dioxuslabs.com/learn/0.6/reference/hooks#rules-of-hooks):
- Hooks can only be called in the body of a component or another hook. Not inside of another expression like a loop, conditional or function call.
- Hooks should start with "use\_"
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.
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.
Dioxus includes many built-in hooks that you can use in your components. If those hooks don't fit your use case, you can also extend Dioxus with [custom hooks](https://dioxuslabs.com/learn/0.5/cookbook/state/custom_hooks).
Dioxus includes many built-in hooks that you can use in your components. If those hooks don't fit your use case, you can also extend Dioxus with custom hooks.
## Putting it all together
@@ -201,18 +218,18 @@ fn App() -> Element {
## Conclusion
This overview doesn't cover everything. Make sure to check out the [tutorial](https://dioxuslabs.com/learn/0.5/guide) and [reference](https://dioxuslabs.com/learn/0.5/reference) on the official
This overview doesn't cover everything. Make sure to check out the [tutorial](https://dioxuslabs.com/learn/0.6/guide) and [guides](https://dioxuslabs.com/learn/0.6/guides) on the official
website for more details.
Beyond this overview, Dioxus supports:
- [Server-side rendering](https://dioxuslabs.com/learn/0.5/reference/fullstack)
- Server-side rendering
- Concurrent rendering (with async support)
- Web/Desktop/Mobile support
- Pre-rendering and hydration
- Fragments, and Suspense
- Inline-styles
- [Custom event handlers](https://dioxuslabs.com/learn/0.5/reference/event_handlers#handler-props)
- Custom event handlers
- Custom elements
- Basic fine-grained reactivity (IE SolidJS/Svelte)
- and more!
+3 -2
View File
@@ -9,12 +9,13 @@
//! - `html`: (default) exports `dioxus-html` as the default elements to use in rsx
//! - `hooks`: (default) re-exports `dioxus-hooks`
//! - `hot-reload`: (default) enables hot rsx reloading in all renderers that support it
//! - `router`: exports the [router](https://dioxuslabs.com/learn/0.5/router) and enables any router features for the current platform
//! - `router`: exports the [router](https://dioxuslabs.com/learn/0.6/router) and enables any router features for the current platform
//! - `third-party-renderer`: Just disables warnings about no active platform when no renderers are enabled
//! - `logger`: Enable the default tracing subscriber for Dioxus apps
//!
//! Platform features (the current platform determines what platform the [`launch()`] function runs):
//!
//! - `fullstack`: enables the fullstack platform. This must be used in combination with the `web` feature for wasm builds and `axum` feature for server builds
//! - `fullstack`: enables the fullstack platform. This must be used in combination with the `web` feature for wasm builds and `server` feature for server builds
//! - `desktop`: enables the desktop platform
//! - `mobile`: enables the mobile platform
//! - `web`: enables the web platform. If the fullstack platform is enabled, this will set the fullstack platform to client mode
+1 -1
View File
@@ -7,7 +7,7 @@ authors = ["Jonathan Kelley"]
description = "Wire format for the Dioxus CLI"
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com/learn/0.5/"
homepage = "https://dioxuslabs.com/learn/0.6/"
keywords = ["dom", "ui", "gui", "react", "wasm"]
rust-version = "1.79.0"
+3 -3
View File
@@ -28,11 +28,11 @@ Formats the current file as RSX.
This overview provides a brief introduction to Dioxus. For a more in-depth guide, make sure to check out:
- [Getting Started](https://dioxuslabs.com/learn/0.5/getting_started)
- [Book (0.5)](https://dioxuslabs.com/learn/0.5)
- [Getting Started](https://dioxuslabs.com/learn/0.6/getting_started)
- [Book (0.6)](https://dioxuslabs.com/learn/0.6)
## Contributing
- Check out the website [section on contributing](https://dioxuslabs.com/learn/0.5/contributing).
- Check out the website [section on contributing](https://dioxuslabs.com/learn/0.6/contributing).
- Report issues on our [issue tracker](https://github.com/dioxuslabs/dioxus/issues).
- [Join](https://discord.gg/XgGxMSkvUM) the discord and ask questions!
+3 -3
View File
@@ -3,11 +3,11 @@ name = "dioxus-fullstack"
authors = ["Jonathan Kelley", "Evan Almloff"]
version = { workspace = true }
edition = "2021"
description = "Fullstack Dioxus Utilities"
description = "Fullstack utilities for Dioxus: Build fullstack web, desktop, and mobile apps with a single codebase."
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com"
keywords = ["ui", "gui", "react", "server", "fullstack"]
keywords = ["web", "desktop", "mobile", "gui", "server"]
resolver = "2"
[dependencies]
@@ -58,7 +58,7 @@ thiserror = { workspace = true, optional = true }
bytes = "1.4.0"
tower = { workspace = true, features = ["util"], optional = true }
tower-layer = { version = "0.3.2", optional = true }
parking_lot = { version = "0.12.1", features = ["send_guard"], optional = true }
parking_lot = { workspace = true, features = ["send_guard"], optional = true }
web-sys = { version = "0.3.61", optional = true, features = ["Window", "Document", "Element", "HtmlDocument", "Storage", "console"] }
dioxus-cli-config = { workspace = true, optional = true }
+2 -2
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/) |
[Guides](https://dioxuslabs.com/learn/0.6/) |
[API Docs](https://docs.rs/dioxus-fullstack/latest/dioxus_fullstack/) |
[Chat](https://discord.gg/XgGxMSkvUM)
@@ -138,7 +138,7 @@ async fn get_meaning(of: String) -> Result<Option<u32>, ServerFnError> {
## Getting Started
To get started with full stack Dioxus, check out our [getting started guide](https://dioxuslabs.com/learn/0.5/getting_started), or the [full stack examples](https://github.com/DioxusLabs/dioxus/tree/master/examples).
To get started with full stack Dioxus, check out our [getting started guide](https://dioxuslabs.com/learn/0.6/getting_started), or the [full stack examples](https://github.com/DioxusLabs/dioxus/tree/master/examples).
## Contributing
+2 -2
View File
@@ -10,8 +10,8 @@ keywords = ["generational", "box", "memory", "allocator"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
parking_lot = "0.12.1"
tracing.workspace = true
parking_lot = { workspace = true }
tracing = { workspace = true }
[dev-dependencies]
rand = { workspace = true }
+10 -10
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/) |
[Guides](https://dioxuslabs.com/learn/0.6/) |
[API Docs](https://docs.rs/dioxus-hooks/latest/dioxus_hooks) |
[Chat](https://discord.gg/XgGxMSkvUM)
@@ -29,7 +29,7 @@
- use_memo
- use_coroutine
Unlike React, none of these hooks are foundational since they all build off the primitive `use_hook`. You can extend these hooks with [custom hooks](https://dioxuslabs.com/learn/0.5/cookbook/state/custom_hooks) in your own code. If you think they would be useful for the broader community, you can open a PR to add your hook to the [Dioxus Awesome](https://github.com/DioxusLabs/awesome-dioxus) list.
Unlike React, none of these hooks are foundational since they all build off the primitive `use_hook`. You can extend these hooks with [custom hooks](https://dioxuslabs.com/learn/0.6/cookbook/state/custom_hooks) in your own code. If you think they would be useful for the broader community, you can open a PR to add your hook to the [Dioxus Awesome](https://github.com/DioxusLabs/awesome-dioxus) list.
## State Cheat Sheet
@@ -41,9 +41,9 @@ Depending on where you need to access the state, you can put your state in one o
| Location | Where can you access the state? | Recommended for Libraries? | Examples |
| ---------------------------------------------------------------------------------------- | ------------------------------- | -------------------------- | --------------------------------------------------------------------------- |
| [Hooks](https://docs.rs/dioxus-hooks/latest/dioxus_hooks/fn.use_signal.html) | Any components you pass it to | ✅ | `use_signal(\|\| 0)`, `use_memo(\|\| state() * 2)` |
| [Context](https://docs.rs/dioxus-hooks/latest/dioxus_hooks/fn.use_context_provider.html) | Any child components | ✅ | `use_context_provider(\|\| Signal::new(0))`, `use_context::<Signal<i32>>()` |
| [Global](https://docs.rs/dioxus/latest/dioxus/prelude/struct.Signal.html#method.global) | Anything in your app | ❌ | `Signal::global(\|\| 0)` |
| [Hooks](https://docs.rs/dioxus-hooks/latest/dioxus_hooks/fn.use_signal.html) | Any components you pass it to | ✅ | `use_signal(\|\| 0)`, `use_memo(\|\| state() * 2)` |
| [Context](https://docs.rs/dioxus-hooks/latest/dioxus_hooks/fn.use_context_provider.html) | Any child components | ✅ | `use_context_provider(\|\| Signal::new(0))`, `use_context::<Signal<i32>>()` |
| [Global](https://docs.rs/dioxus/latest/dioxus/prelude/struct.Signal.html#method.global) | Anything in your app | ❌ | `Signal::global(\|\| 0)` |
### Derived State
@@ -51,9 +51,9 @@ If you don't have an initial value for your state, you can derive your state fro
| Hook | Reactive (reruns when dependencies change) | Async | Memorizes Output | Example |
| ----------------------------------------------------------------------------------- | ------------------------------------------ | ----- | ---------------- | ----------------------------------------------------------------------------------- |
| [`use_memo`](https://docs.rs/dioxus/latest/dioxus/prelude/fn.use_memo.html) | ✅ | ❌ | ✅ | `use_memo(move \|\| count() * 2)` |
| [`use_resource`](https://docs.rs/dioxus/latest/dioxus/prelude/fn.use_resource.html) | ✅ | ✅ | ❌ | `use_resource(move \|\| reqwest::get(format!("/users/{user_id}")))` |
| [`use_future`](https://docs.rs/dioxus/latest/dioxus/prelude/fn.use_future.html) | ❌ | ✅ | ❌ | `use_future(move \|\| println!("{:?}", reqwest::get(format!("/users/{user_id}"))))` |
| [`use_memo`](https://docs.rs/dioxus/latest/dioxus/prelude/fn.use_memo.html) | ✅ | ❌ | ✅ | `use_memo(move \|\| count() * 2)` |
| [`use_resource`](https://docs.rs/dioxus/latest/dioxus/prelude/fn.use_resource.html) | ✅ | ✅ | ❌ | `use_resource(move \|\| reqwest::get(format!("/users/{user_id}")))` |
| [`use_future`](https://docs.rs/dioxus/latest/dioxus/prelude/fn.use_future.html) | ❌ | ✅ | ❌ | `use_future(move \|\| println!("{:?}", reqwest::get(format!("/users/{user_id}"))))` |
### Persistent State
@@ -61,8 +61,8 @@ The core hooks library doesn't provide hooks for persistent state, but you can e
| State | Sharable | Example |
| ---------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------- |
| [`use_persistent`](https://github.com/DioxusLabs/sdk/tree/master/examples/storage) | ❌ | `use_persistent("unique_key", move \|\| initial_state)` |
| [`Router<Route> {}`](https://dioxuslabs.com/learn/0.5/router) | ✅ | `#[derive(Routable, Clone, PartialEq)] enum Route { #[route("/user/:id")] Homepage { id: u32 } }` |
| [`use_persistent`](https://github.com/DioxusLabs/sdk/tree/master/examples/storage) | ❌ | `use_persistent("unique_key", move \|\| initial_state)` |
| [`Router<Route> {}`](https://dioxuslabs.com/learn/0.6/router) | ✅ | `#[derive(Routable, Clone, PartialEq)] enum Route { #[route("/user/:id")] Homepage { id: u32 } }` |
## Contributing
+2 -2
View File
@@ -3,7 +3,7 @@
You will often need to move state around between your components. Dioxus provides three different ways to pass around state:
1. Just pass your values as [props](https://dioxuslabs.com/learn/0.5/reference/component_props):
1. Just pass your values as [props](https://dioxuslabs.com/learn/0.6/reference/component_props):
```rust
# use dioxus::prelude::*;
@@ -30,7 +30,7 @@ fn IncrementButton(mut count: Signal<i32>) -> Element {
This is the most common way to pass state around. It is the most explicit and local to your component. Use this when it isn't overly annoying to pass around a value.
2. Use [use_context](https://dioxuslabs.com/learn/0.5/reference/context) to pass state from a parent component to all children:
2. Use [use_context](https://dioxuslabs.com/learn/0.6/reference/context) to pass state from a parent component to all children:
```rust
# use dioxus::prelude::*;
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/) |
[Guides](https://dioxuslabs.com/learn/0.6/) |
[API Docs](https://docs.rs/dioxus-html/latest/dioxus_html) |
[Chat](https://discord.gg/XgGxMSkvUM)
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/) |
[Guides](https://dioxuslabs.com/learn/0.6/) |
[API Docs](https://docs.rs/dioxus-interpreter-js/latest/dioxus_interpreter_js) |
[Chat](https://discord.gg/XgGxMSkvUM)
+1 -1
View File
@@ -3,7 +3,7 @@ name = "dioxus-liveview"
version = { workspace = true }
edition = "2021"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com/learn/0.5/getting_started"
homepage = "https://dioxuslabs.com/learn/0.6/getting_started"
keywords = ["dom", "ui", "gui", "react", "liveview"]
description = "Build server-side apps with Dioxus"
authors = ["Jonathan Kelley", "Evan Almloff"]
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/) |
[Guides](https://dioxuslabs.com/learn/0.6/) |
[API Docs](https://docs.rs/dioxus-liveview/latest/dioxus_liveview) |
[Chat](https://discord.gg/XgGxMSkvUM)
+1 -1
View File
@@ -5,7 +5,7 @@ authors = ["Jonathan Kelley"]
edition = "2021"
description = "Mobile-compatible renderer for Dioxus"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com/learn/0.5/getting_started"
homepage = "https://dioxuslabs.com/learn/0.6/getting_started"
keywords = ["dom", "ui", "gui", "react"]
license = "MIT OR Apache-2.0"
+2 -2
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/) |
[Guides](https://dioxuslabs.com/learn/0.6/) |
[API Docs](https://docs.rs/dioxus-mobile/latest/dioxus_mobile) |
[Chat](https://discord.gg/XgGxMSkvUM)
@@ -29,7 +29,7 @@ Dioxus Mobile supports both iOS and Android. However, Android support is still q
Getting set up with mobile can but quite challenging. The tooling here isn't great (yet) and might take some hacking around to get things working. macOS M1 is broadly unexplored and might not work for you.
You can read [our guide](https://dioxuslabs.com/learn/0.5/getting_started) on mobile development with Dioxus to get started.
You can read [our guide](https://dioxuslabs.com/learn/0.6/getting_started) on mobile development with Dioxus to get started.
## Contributing
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/router/) |
[Guides](https://dioxuslabs.com/learn/0.6/router/) |
[API Docs](https://docs.rs/dioxus-router/latest/dioxus_router) |
[Chat](https://discord.gg/XgGxMSkvUM)
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/) |
[Guides](https://dioxuslabs.com/learn/0.6/) |
[API Docs](https://docs.rs/rsx-rosetta/latest/rsx-rosetta) |
[Chat](https://discord.gg/XgGxMSkvUM)
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/) |
[Guides](https://dioxuslabs.com/learn/0.6/) |
[API Docs](https://docs.rs/dioxus-rsx/latest/dioxus_rsx) |
[Chat](https://discord.gg/XgGxMSkvUM)
+3 -3
View File
@@ -3,7 +3,7 @@ name = "dioxus-signals"
authors = ["Jonathan Kelley", "Evan Almloff"]
version = { workspace = true }
edition = "2021"
description = "Signals for Dioxus"
description = "Reactivie signals for Dioxus: Build fullstack web, desktop, and mobile apps with a single codebase."
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com"
@@ -17,8 +17,8 @@ dioxus-core = { workspace = true }
generational-box = { workspace = true }
tracing = { workspace = true }
serde = { workspace = true, features = ["derive"], optional = true }
parking_lot = "0.12.1"
once_cell = { workspace = true }
parking_lot = { workspace = true}
once_cell = { workspace = true}
rustc-hash = { workspace = true }
futures-channel = { workspace = true }
futures-util = { workspace = true }
+3
View File
@@ -11,6 +11,9 @@ pub struct ReadOnlySignal<T: 'static, S: Storage<SignalData<T>> = UnsyncStorage>
inner: Signal<T, S>,
}
/// A signal that can only be read from.
pub type ReadSignal<T, S> = ReadOnlySignal<T, S>;
impl<T: 'static, S: Storage<SignalData<T>>> From<Signal<T, S>> for ReadOnlySignal<T, S> {
fn from(inner: Signal<T, S>) -> Self {
Self { inner }
+2 -2
View File
@@ -9,8 +9,8 @@
This crate is a part of the broader Dioxus ecosystem. For more resources about Dioxus, check out:
- [Getting Started](https://dioxuslabs.com/learn/0.5/getting_started)
- [Book](https://dioxuslabs.com/learn/0.5/)
- [Getting Started](https://dioxuslabs.com/learn/0.6/getting_started)
- [Book](https://dioxuslabs.com/learn/0.6/)
- [Examples](https://github.com/DioxusLabs/dioxus/tree/main/examples)
## Overview
+3 -3
View File
@@ -3,11 +3,11 @@ name = "dioxus-web"
version = { workspace = true }
authors = ["Jonathan Kelley"]
edition = "2021"
description = "Web renderer for Dioxus using websys"
description = "Web-sys renderer for Dioxus: Build fullstack web, desktop, and mobile apps with a single codebase."
license = "MIT OR Apache-2.0"
repository = "https://github.com/DioxusLabs/dioxus/"
homepage = "https://dioxuslabs.com/learn/0.5/getting_started"
keywords = ["dom", "ui", "gui", "react", "wasm"]
homepage = "https://dioxuslabs.com/learn/0.6/getting_started"
keywords = ["dom", "ui", "gui", "web", "wasm"]
[dependencies]
dioxus-core = { workspace = true }
+1 -1
View File
@@ -15,7 +15,7 @@
[discord-url]: https://discord.gg/XgGxMSkvUM
[Website](https://dioxuslabs.com) |
[Guides](https://dioxuslabs.com/learn/0.5/) |
[Guides](https://dioxuslabs.com/learn/0.6/) |
[API Docs](https://docs.rs/dioxus-web/latest/dioxus_web) |
[Chat](https://discord.gg/XgGxMSkvUM)