Renderers are now packages, not features. (#387)
* feat: use synchronous router design * feat: function to get router out of dom * chore: restructure workspace to use renderers as packages, not features
This commit is contained in:
1 parent
c97ca7dff6
commit
d9546d9504
181 files changed
+487
-1463
No files matched your search
@@ -39,7 +39,7 @@ tower = { version = "0.4.12", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
dioxus = { path = "../../" }
|
||||
dioxus = { path = "../dioxus" }
|
||||
warp = "0.3"
|
||||
axum = { version = "0.5.1", features = ["ws"] }
|
||||
tower = "0.4.12"
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
#![cfg(feature = "axum")]
|
||||
|
||||
use axum::{extract::ws::WebSocketUpgrade, response::Html, routing::get, Router};
|
||||
use dioxus_core::{Element, LazyNodes, Scope};
|
||||
#[cfg(not(feature = "axum"))]
|
||||
fn main() {}
|
||||
|
||||
#[cfg(feature = "axum")]
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
use axum::{extract::ws::WebSocketUpgrade, response::Html, routing::get, Router};
|
||||
use dioxus_core::{Element, LazyNodes, Scope};
|
||||
pretty_env_logger::init();
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
cx.render(LazyNodes::new(|f| f.text(format_args!("hello world!"))))
|
||||
}
|
||||
|
||||
let addr: std::net::SocketAddr = ([127, 0, 0, 1], 3030).into();
|
||||
|
||||
let view = dioxus_liveview::new(addr);
|
||||
@@ -27,7 +32,3 @@ async fn main() {
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
cx.render(LazyNodes::new(|f| f.text(format_args!("hello world!"))))
|
||||
}
|
||||
@@ -1,12 +1,18 @@
|
||||
#![cfg(feature = "warp")]
|
||||
|
||||
use dioxus_core::{Element, LazyNodes, Scope};
|
||||
use dioxus_liveview as liveview;
|
||||
use warp::ws::Ws;
|
||||
use warp::Filter;
|
||||
#[cfg(not(feature = "warp"))]
|
||||
fn main() {}
|
||||
|
||||
#[cfg(feature = "warp")]
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
use dioxus_core::{Element, LazyNodes, Scope};
|
||||
use dioxus_liveview as liveview;
|
||||
use warp::ws::Ws;
|
||||
use warp::Filter;
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
cx.render(LazyNodes::new(|f| f.text(format_args!("hello world!"))))
|
||||
}
|
||||
|
||||
pretty_env_logger::init();
|
||||
|
||||
let addr = ([127, 0, 0, 1], 3030);
|
||||
@@ -27,7 +33,3 @@ async fn main() {
|
||||
}));
|
||||
warp::serve(routes).run(addr).await;
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
cx.render(LazyNodes::new(|f| f.text(format_args!("hello world!"))))
|
||||
}
|
||||
Reference in new issue
Block a user