Skip to content

Commit d9546d9

Browse files
authored
Renderers are now packages, not features. (DioxusLabs#387)
* feat: use synchronous router design * feat: function to get router out of dom * chore: restructure workspace to use renderers as packages, not features
1 parent c97ca7d commit d9546d9

File tree

181 files changed

+487
-1463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+487
-1463
lines changed

.github/workflows/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ jobs:
4040
- uses: actions-rs/cargo@v1
4141
with:
4242
command: test
43-
args: --features "desktop, ssr, router"
43+
args: --all --tests

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
- uses: actions-rs/cargo@v1
4444
with:
4545
command: check
46+
args: --all --examples --tests
4647

4748
test:
4849
if: github.event.pull_request.draft == false

.github/workflows/windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ jobs:
7171
rustc -Vv
7272
cargo -V
7373
set RUST_BACKTRACE=1
74-
cargo build --features "desktop, ssr, router"
75-
cargo test --features "desktop, ssr, router"
74+
cargo build --all --tests --examples
75+
cargo test --all --tests
7676
shell: cmd

Cargo.toml

Lines changed: 24 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,10 @@
1-
[package]
2-
name = "dioxus"
3-
version = "0.2.4"
4-
authors = ["Jonathan Kelley"]
5-
edition = "2021"
6-
description = "Core functionality for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences"
7-
license = "MIT OR Apache-2.0"
8-
repository = "https://github.com/DioxusLabs/dioxus/"
9-
homepage = "https://dioxuslabs.com"
10-
documentation = "https://dioxuslabs.com"
11-
keywords = ["dom", "ui", "gui", "react", "wasm"]
12-
rust-version = "1.60.0"
13-
14-
[dependencies]
15-
dioxus-core = { path = "./packages/core", version = "^0.2.1" }
16-
dioxus-html = { path = "./packages/html", version = "^0.2.1", optional = true }
17-
dioxus-core-macro = { path = "./packages/core-macro", version = "^0.2.1", optional = true }
18-
dioxus-hooks = { path = "./packages/hooks", version = "^0.2.1", optional = true }
19-
fermi = { path = "./packages/fermi", version = "^0.2.1", optional = true }
20-
21-
dioxus-web = { path = "./packages/web", version = "^0.2.1", optional = true }
22-
dioxus-desktop = { path = "./packages/desktop", version = "^0.2.3", optional = true }
23-
dioxus-ssr = { path = "./packages/ssr", version = "^0.2.1", optional = true }
24-
25-
dioxus-router = { path = "./packages/router", version = "^0.2.3", optional = true }
26-
dioxus-interpreter-js = { path = "./packages/interpreter", version = "^0.2.1", optional = true }
27-
dioxus-tui = { path = "./packages/tui", version = "^0.2.2", optional = true }
28-
29-
dioxus-rsx = { path = "./packages/rsx", optional = true }
30-
dioxus-rsx-interpreter = { path = "./packages/rsx_interpreter", optional = true }
31-
dioxus-liveview = { path = "./packages/liveview", version = "^0.1.0", optional = true }
32-
33-
dioxus-native-core = { path = "./packages/native-core", version = "^0.2.0", optional = true }
34-
dioxus-native-core-macro = { path = "./packages/native-core-macro", version = "^0.2.0", optional = true }
35-
36-
# dioxus-mobile = { path = "./packages/mobile", version = "^0.2.0", optional = true }
37-
# dioxus-rsx = { path = "./packages/rsx", optional = true }
38-
# macro = ["dioxus-core-macro", "dioxus-rsx"]
39-
40-
[features]
41-
default = ["macro", "hooks", "html"]
42-
43-
macro = ["dioxus-core-macro", "dioxus-rsx"]
44-
hooks = ["dioxus-hooks"]
45-
html = ["dioxus-html"]
46-
ssr = ["dioxus-ssr"]
47-
web = ["dioxus-web", "dioxus-router?/web"]
48-
desktop = ["dioxus-desktop"]
49-
router = ["dioxus-router"]
50-
tui = ["dioxus-tui"]
51-
liveview = ["dioxus-liveview"]
52-
hot-reload = ["dioxus-core-macro/hot-reload", "dioxus-rsx-interpreter", "dioxus-desktop?/hot-reload", "dioxus-web?/hot-reload", "dioxus-router?/hot-reload"]
53-
native-core = ["dioxus-native-core", "dioxus-native-core-macro"]
541

552
[workspace]
563
members = [
4+
"packages/dioxus",
575
"packages/core",
586
"packages/core-macro",
7+
"packages/router",
598
"packages/html",
609
"packages/hooks",
6110
"packages/web",
@@ -71,11 +20,32 @@ members = [
7120
"packages/rsx_interpreter",
7221
"packages/native-core",
7322
"packages/native-core-macro",
74-
"packages/rsx-prelude",
7523
"docs/guide",
7624
]
7725

26+
27+
# This is a "virtual package"
28+
# It is not meant to be published, but is used so "cargo run --example XYZ" works properly
29+
[package]
30+
name = "dioxus-examples"
31+
version = "0.0.0"
32+
authors = ["Jonathan Kelley"]
33+
edition = "2021"
34+
description = "Top level crate for the Dioxus repository"
35+
license = "MIT OR Apache-2.0"
36+
repository = "https://github.com/DioxusLabs/dioxus/"
37+
homepage = "https://dioxuslabs.com"
38+
documentation = "https://dioxuslabs.com"
39+
keywords = ["dom", "ui", "gui", "react", "wasm"]
40+
rust-version = "1.60.0"
41+
42+
7843
[dev-dependencies]
44+
dioxus = { path = "./packages/dioxus" }
45+
dioxus-desktop = { path = "./packages/desktop" }
46+
dioxus-ssr = { path = "./packages/ssr" }
47+
dioxus-router = { path = "./packages/router" }
48+
fermi = { path = "./packages/fermi" }
7949
futures-util = "0.3.21"
8050
log = "0.4.14"
8151
num-format = "0.4.0"
@@ -87,21 +57,6 @@ serde_json = "1.0.79"
8757
rand = { version = "0.8.4", features = ["small_rng"] }
8858
tokio = { version = "1.16.1", features = ["full"] }
8959
reqwest = { version = "0.11.9", features = ["json"] }
90-
dioxus = { path = ".", features = ["desktop", "ssr", "router", "fermi", "tui", "hot-reload"] }
9160
fern = { version = "0.6.0", features = ["colored"] }
92-
criterion = "0.3.5"
9361
thiserror = "1.0.30"
9462
env_logger = "0.9.0"
95-
96-
97-
[[bench]]
98-
name = "create"
99-
harness = false
100-
101-
[[bench]]
102-
name = "jsframework"
103-
harness = false
104-
105-
[[bench]]
106-
name = "tui_update"
107-
harness = false

docs/guide/Cargo.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ description = "Dioxus guide, including testable examples"
66
license = "MIT/Apache-2.0"
77

88
[dev-dependencies]
9-
dioxus = { path = "../..", features = ["desktop", "web", "ssr", "router", "fermi", "tui"] }
9+
dioxus = { path = "../../packages/dioxus" }
10+
dioxus-desktop = { path = "../../packages/desktop" }
11+
dioxus-web = { path = "../../packages/web" }
12+
dioxus-ssr = { path = "../../packages/ssr" }
13+
dioxus-router = { path = "../../packages/router" }
14+
dioxus-tui = { path = "../../packages/tui" }
15+
fermi = { path = "../../packages/fermi" }
16+
17+
18+
# dioxus = { path = "../../packages/dioxus", features = ["desktop", "web", "ssr", "router", "fermi", "tui"] }
1019
serde = { version = "1.0.138", features=["derive"] }
1120
reqwest = { version = "0.11.11", features = ["json"] }
12-
tokio = { version = "1.19.2" , features=[]}
21+
tokio = { version = "1.19.2" , features=[]}

docs/guide/examples/boolean_attribute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use dioxus::prelude::*;
33

44
fn main() {
5-
dioxus::desktop::launch(App);
5+
dioxus_desktop::launch(App);
66
}
77

88
fn App(cx: Scope) -> Element {

docs/guide/examples/component_borrowed_props.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use dioxus::prelude::*;
33

44
fn main() {
5-
dioxus::desktop::launch(App);
5+
dioxus_desktop::launch(App);
66
}
77

88
// ANCHOR: App

docs/guide/examples/component_children.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use dioxus::prelude::*;
44

55
fn main() {
6-
dioxus::desktop::launch(App);
6+
dioxus_desktop::launch(App);
77
}
88

99
fn App(cx: Scope) -> Element {

docs/guide/examples/component_children_inspect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use dioxus::prelude::*;
44

55
fn main() {
6-
dioxus::desktop::launch(App);
6+
dioxus_desktop::launch(App);
77
}
88

99
fn App(cx: Scope) -> Element {

docs/guide/examples/component_element_props.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use dioxus::prelude::*;
44

55
fn main() {
6-
dioxus::desktop::launch(App);
6+
dioxus_desktop::launch(App);
77
}
88

99
fn App(cx: Scope) -> Element {

0 commit comments

Comments
 (0)