mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 06:34:20 +00:00
Pre-release 0.6.0-alpha.0 (#2755)
* CI: add docsrs to ci * add env vars * no need for tokio things * whoops, wrong rust nightly * add swc * bump crate versions to 0.6.0-alpha.0 * hoist up warnings and shuffle cargo.toml * update cargos and disable warnings from ci * attempt fix of aws * attempt disabling aws_lc_sys globally * pull in lc-sys * add fips feature to fix docs * turn on features for aws-lc-sys on cargo-doc-all * pass along more args * fix cfg docs * fix: flakey gen box test * fix: doc_cfg in static gen * dont include readme * fix error on static gen * remove random line * temporarily disable warnings * simplify axum desktop so it doesnt count as a lib * fix binstall link * bump locks * lock fixes * revert axum desktop * dont publish some crates
This commit is contained in:
parent
4ffcef16af
commit
0cbcef735f
22 changed files with 1927 additions and 435 deletions
56
.github/workflows/main.yml
vendored
56
.github/workflows/main.yml
vendored
|
@ -38,23 +38,10 @@ concurrency:
|
|||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_INCREMENTAL: "0"
|
||||
RUST_BACKTRACE: 1
|
||||
rust_nightly: nightly-2024-07-01
|
||||
|
||||
jobs:
|
||||
check:
|
||||
if: github.event.pull_request.draft == false
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: sudo apt-get update
|
||||
- run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-all-crates: "true"
|
||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||
- run: cargo check --all --examples --tests --all-features --all-targets
|
||||
|
||||
check-msrv:
|
||||
if: github.event.pull_request.draft == false
|
||||
name: Check MSRV
|
||||
|
@ -148,6 +135,45 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
- name: Check for typos
|
||||
uses: crate-ci/typos@master
|
||||
|
||||
docs:
|
||||
if: github.event.pull_request.draft == false
|
||||
name: Docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Rust ${{ env.rust_nightly }}
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: ${{ env.rust_nightly }}
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-all-crates: "true"
|
||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||
- name: "doc --lib --all-features"
|
||||
run: |
|
||||
cargo doc --workspace --no-deps --all-features --document-private-items
|
||||
env:
|
||||
RUSTFLAGS: --cfg docsrs
|
||||
RUSTDOCFLAGS: --cfg docsrs
|
||||
# todo: re-enable warnings
|
||||
# RUSTDOCFLAGS: --cfg docsrs -Dwarnings
|
||||
|
||||
check:
|
||||
if: github.event.pull_request.draft == false
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: sudo apt-get update
|
||||
- run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-all-crates: "true"
|
||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||
- run: cargo check --workspace --all-features --all-targets
|
||||
|
||||
clippy:
|
||||
if: github.event.pull_request.draft == false
|
||||
name: Clippy
|
||||
|
|
2054
Cargo.lock
generated
2054
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
72
Cargo.toml
72
Cargo.toml
|
@ -59,38 +59,43 @@ members = [
|
|||
exclude = ["examples/mobile_demo", "examples/openid_connect_demo"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.5.2"
|
||||
version = "0.6.0-alpha.0"
|
||||
|
||||
# dependencies that are shared across packages
|
||||
[workspace.dependencies]
|
||||
dioxus = { path = "packages/dioxus", version = "0.5.0" }
|
||||
dioxus-lib = { path = "packages/dioxus-lib", version = "0.5.0" }
|
||||
dioxus-core = { path = "packages/core", version = "0.5.0" }
|
||||
dioxus-core-macro = { path = "packages/core-macro", version = "0.5.0" }
|
||||
dioxus-config-macro = { path = "packages/config-macro", version = "0.5.0" }
|
||||
dioxus-router = { path = "packages/router", version = "0.5.0" }
|
||||
dioxus-router-macro = { path = "packages/router-macro", version = "0.5.0" }
|
||||
dioxus-html = { path = "packages/html", default-features = false, version = "0.5.0" }
|
||||
dioxus-html-internal-macro = { path = "packages/html-internal-macro", version = "0.5.0" }
|
||||
dioxus-hooks = { path = "packages/hooks", version = "0.5.0" }
|
||||
dioxus-web = { path = "packages/web", default-features = false, version = "0.5.0" }
|
||||
dioxus-ssr = { path = "packages/ssr", version = "0.5.0", default-features = false }
|
||||
dioxus-desktop = { path = "packages/desktop", version = "0.5.0", default-features = false }
|
||||
dioxus-mobile = { path = "packages/mobile", version = "0.5.0" }
|
||||
dioxus-interpreter-js = { path = "packages/interpreter", version = "0.5.0" }
|
||||
dioxus-liveview = { path = "packages/liveview", version = "0.5.0" }
|
||||
dioxus-autofmt = { path = "packages/autofmt", version = "0.5.0" }
|
||||
dioxus-check = { path = "packages/check", version = "0.5.0" }
|
||||
dioxus-rsx = { path = "packages/rsx", version = "0.5.0" }
|
||||
rsx-rosetta = { path = "packages/rsx-rosetta", version = "0.5.0" }
|
||||
dioxus-signals = { path = "packages/signals", version = "0.5.0" }
|
||||
dioxus-cli-config = { path = "packages/cli-config", version = "0.5.0", default-features = false}
|
||||
generational-box = { path = "packages/generational-box", version = "0.5.0" }
|
||||
dioxus-hot-reload = { path = "packages/hot-reload", version = "0.5.0" }
|
||||
dioxus-fullstack = { path = "packages/fullstack", version = "0.5.0" }
|
||||
dioxus-static-site-generation = { path = "packages/static-generation", version = "0.5.0" }
|
||||
dioxus_server_macro = { path = "packages/server-macro", version = "0.5.0", default-features = false }
|
||||
lazy-js-bundle = { path = "packages/lazy-js-bundle", version = "0.5.0" }
|
||||
dioxus = { path = "packages/dioxus", version = "0.6.0-alpha.0" }
|
||||
dioxus-lib = { path = "packages/dioxus-lib", version = "0.6.0-alpha.0" }
|
||||
dioxus-core = { path = "packages/core", version = "0.6.0-alpha.0" }
|
||||
dioxus-core-macro = { path = "packages/core-macro", version = "0.6.0-alpha.0" }
|
||||
dioxus-config-macro = { path = "packages/config-macro", version = "0.6.0-alpha.0" }
|
||||
dioxus-router = { path = "packages/router", version = "0.6.0-alpha.0" }
|
||||
dioxus-router-macro = { path = "packages/router-macro", version = "0.6.0-alpha.0" }
|
||||
dioxus-html = { path = "packages/html", version = "0.6.0-alpha.0", default-features = false }
|
||||
dioxus-html-internal-macro = { path = "packages/html-internal-macro", version = "0.6.0-alpha.0" }
|
||||
dioxus-hooks = { path = "packages/hooks", version = "0.6.0-alpha.0" }
|
||||
dioxus-web = { path = "packages/web", version = "0.6.0-alpha.0", default-features = false }
|
||||
dioxus-ssr = { path = "packages/ssr", version = "0.6.0-alpha.0", default-features = false }
|
||||
dioxus-desktop = { path = "packages/desktop", version = "0.6.0-alpha.0", default-features = false }
|
||||
dioxus-mobile = { path = "packages/mobile", version = "0.6.0-alpha.0" }
|
||||
dioxus-interpreter-js = { path = "packages/interpreter", version = "0.6.0-alpha.0" }
|
||||
dioxus-liveview = { path = "packages/liveview", version = "0.6.0-alpha.0" }
|
||||
dioxus-autofmt = { path = "packages/autofmt", version = "0.6.0-alpha.0" }
|
||||
dioxus-check = { path = "packages/check", version = "0.6.0-alpha.0" }
|
||||
dioxus-rsx = { path = "packages/rsx", version = "0.6.0-alpha.0" }
|
||||
rsx-rosetta = { path = "packages/rsx-rosetta", version = "0.6.0-alpha.0" }
|
||||
dioxus-signals = { path = "packages/signals", version = "0.6.0-alpha.0" }
|
||||
dioxus-cli-config = { path = "packages/cli-config", version = "0.6.0-alpha.0", default-features = false}
|
||||
generational-box = { path = "packages/generational-box", version = "0.6.0-alpha.0" }
|
||||
dioxus-hot-reload = { path = "packages/hot-reload", version = "0.6.0-alpha.0" }
|
||||
dioxus-fullstack = { path = "packages/fullstack", version = "0.6.0-alpha.0" }
|
||||
dioxus-static-site-generation = { path = "packages/static-generation", version = "0.6.0-alpha.0" }
|
||||
dioxus_server_macro = { path = "packages/server-macro", version = "0.6.0-alpha.0", default-features = false }
|
||||
lazy-js-bundle = { path = "packages/lazy-js-bundle", version = "0.6.0-alpha.0" }
|
||||
|
||||
manganis-cli-support = { version = "0.3.0-alpha.0", features = ["html"] }
|
||||
manganis = { version = "0.3.0-alpha.0", default-features = false }
|
||||
warnings = { version = "0.2.0" }
|
||||
|
||||
tracing = "0.1.37"
|
||||
tracing-futures = "0.2.5"
|
||||
toml = "0.8"
|
||||
|
@ -105,8 +110,6 @@ wasm-bindgen-futures = "0.4.42"
|
|||
html_parser = "0.7.0"
|
||||
thiserror = "1.0.40"
|
||||
prettyplease = { version = "0.2.20", features = ["verbatim"] }
|
||||
manganis-cli-support = { git = "hhttps://github.com/DioxusLabs/manganis", features = ["html"] }
|
||||
manganis = { git = "https://github.com/DioxusLabs/manganis" }
|
||||
const_format = "0.2.32"
|
||||
cargo_toml = { version = "0.20.3" }
|
||||
tauri-utils = { version = "=1.5.*" }
|
||||
|
@ -114,13 +117,14 @@ tauri-bundler = { version = "=1.4.*" }
|
|||
lru = "0.12.2"
|
||||
async-trait = "0.1.77"
|
||||
axum = "0.7.0"
|
||||
axum-server = { version = "0.6.0", default-features = false }
|
||||
axum-server = { version = "0.7.1", default-features = false }
|
||||
tower = "0.4.13"
|
||||
http = "1.0.0"
|
||||
notify = { version = "6.1.1" }
|
||||
tower-http = "0.5.2"
|
||||
hyper = "1.0.0"
|
||||
hyper-rustls = { version= "0.27.2", default-features = false , features=["native-tokio","http1","tls12","logging","ring"]}
|
||||
rustls = { version="0.23.12", default-features=false, features =["logging","std","tls12","ring"] }
|
||||
serde_json = "1.0.61"
|
||||
serde = "1.0.61"
|
||||
syn = "2.0"
|
||||
|
@ -141,6 +145,9 @@ tokio-tungstenite = { version = "0.23.1" }
|
|||
# cli, cli-config
|
||||
dirs = "5.0.1"
|
||||
|
||||
criterion = { version = "0.5" }
|
||||
|
||||
|
||||
[profile.dev.package.dioxus-core-macro]
|
||||
opt-level = 3
|
||||
|
||||
|
@ -162,7 +169,6 @@ debug-assertions = false
|
|||
# It is not meant to be published, but is used so "cargo run --example XYZ" works properly
|
||||
[package]
|
||||
name = "dioxus-examples"
|
||||
version = "0.5.2"
|
||||
authors = ["Jonathan Kelley"]
|
||||
edition = "2021"
|
||||
description = "Top level crate for the Dioxus repository"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
[package]
|
||||
name = "dioxus-cli"
|
||||
version = "0.5.2"
|
||||
# version = { workspace = true }
|
||||
version = { workspace = true }
|
||||
authors = ["Jonathan Kelley"]
|
||||
edition = "2021"
|
||||
description = "CLI tool for developing, testing, and publishing Dioxus apps"
|
||||
|
@ -39,7 +38,7 @@ anyhow = "1"
|
|||
hyper = { workspace = true }
|
||||
hyper-util = "0.1.3"
|
||||
hyper-rustls = { workspace = true }
|
||||
rustls = {version="0.23.11", default-features=false, features =["logging","std","tls12","ring"]}
|
||||
rustls = { workspace = true }
|
||||
subprocess = "0.2.9"
|
||||
rayon = "1.8.0"
|
||||
console = "0.15.8"
|
||||
|
@ -130,7 +129,10 @@ tempfile = "3.3"
|
|||
|
||||
[package.metadata.binstall]
|
||||
# temporarily, we're going to use the 0.5.0 download page for all binaries
|
||||
pkg-url = "{ repo }/releases/download/v0.5.0/dx-{ target }-v{ version }{ archive-suffix }"
|
||||
pkg-url = "{ repo }/releases/download/v{ version }/dx-{ target }-v{ version }{ archive-suffix }"
|
||||
|
||||
# the old one...
|
||||
# pkg-url = "{ repo }/releases/download/v0.5.0/dx-{ target }-v{ version }{ archive-suffix }"
|
||||
|
||||
# pkg-url = "{ repo }/releases/download/v{ version }/dx-{ target }{ archive-suffix }"
|
||||
pkg-fmt = "tgz"
|
||||
|
|
|
@ -24,7 +24,7 @@ serde = { version = "1", features = ["derive"], optional = true }
|
|||
generational-box = { workspace = true }
|
||||
rustversion = "1.0.17"
|
||||
const_format = { workspace = true }
|
||||
warnings = { git = "https://github.com/DioxusLabs/warnings" }
|
||||
warnings = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { workspace = true, features = ["full"] }
|
||||
|
|
|
@ -90,16 +90,26 @@ hot-reload = ["dep:dioxus-hot-reload", "dioxus-signals"]
|
|||
gnu = []
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
default-features = false
|
||||
features = ["tokio_runtime", "hot-reload"]
|
||||
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
|
||||
default-features = false
|
||||
targets = [
|
||||
"x86_64-unknown-linux-gnu",
|
||||
"x86_64-pc-windows-msvc",
|
||||
"aarch64-apple-darwin",
|
||||
"aarch64-apple-ios",
|
||||
"aarch64-linux-android",
|
||||
"armv7-linux-androideabi",
|
||||
]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
|
||||
[dev-dependencies]
|
||||
dioxus = { workspace = true, features = ["desktop"] }
|
||||
exitcode = "1.1.2"
|
||||
reqwest = { workspace = true, features = ["json"] }
|
||||
http-range = { version = "0.1.5" }
|
||||
dioxus-ssr = { workspace = true, version = "0.5.0", default-features = false }
|
||||
dioxus-ssr = { workspace = true, default-features = false }
|
||||
separator = "0.4.1"
|
||||
rand = { version = "0.8.4", features = ["small_rng"] }
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
|
||||
#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
|
||||
#![deny(missing_docs)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
mod app;
|
||||
mod assets;
|
||||
|
|
|
@ -66,7 +66,7 @@ third-party-renderer = []
|
|||
futures-util = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
rand = { version = "0.8.4", features = ["small_rng"] }
|
||||
criterion = "0.3.5"
|
||||
criterion = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
env_logger = "0.10.0"
|
||||
tokio = { workspace = true, features = ["full"] }
|
||||
|
|
|
@ -49,6 +49,8 @@ futures-util = { workspace = true }
|
|||
futures-channel = { workspace = true }
|
||||
ciborium = { workspace = true }
|
||||
base64 = { workspace = true }
|
||||
rustls = { workspace = true, optional = true }
|
||||
hyper-rustls = { workspace = true, optional = true }
|
||||
|
||||
pin-project = { version = "1.1.2", optional = true }
|
||||
thiserror = { workspace = true, optional = true }
|
||||
|
@ -61,6 +63,8 @@ web-sys = { version = "0.3.61", optional = true, features = ["Window", "Document
|
|||
dioxus-cli-config = { workspace = true, features = ["read-config"], optional = true }
|
||||
clap = { version = "4.5.7", optional = true, features = ["derive"] }
|
||||
|
||||
aws-lc-rs = { version = "1.8.1", optional = true }
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
tokio = { workspace = true, features = ["rt", "sync"], optional = true }
|
||||
|
||||
|
@ -82,7 +86,7 @@ web = ["dep:dioxus-web", "dep:web-sys"]
|
|||
desktop = ["dep:dioxus-desktop", "server_fn/reqwest", "dioxus_server_macro/reqwest"]
|
||||
mobile = ["dep:dioxus-mobile"]
|
||||
default-tls = ["server_fn/default-tls"]
|
||||
rustls = ["server_fn/rustls"]
|
||||
rustls = ["server_fn/rustls", "dep:rustls", "dep:hyper-rustls"]
|
||||
axum = ["dep:axum", "dep:tower-http", "server", "server_fn/axum", "dioxus_server_macro/axum", "default-tls"]
|
||||
server = [
|
||||
"server_fn/ssr",
|
||||
|
@ -109,4 +113,4 @@ server = [
|
|||
|
||||
[package.metadata.docs.rs]
|
||||
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
|
||||
features = ["axum", "web"]
|
||||
features = ["axum", "web", "dep:aws-lc-rs"]
|
||||
|
|
|
@ -21,7 +21,7 @@ sqlx = { version = "0.7.0", features = [
|
|||
"postgres",
|
||||
"sqlite",
|
||||
"_unstable-all-types",
|
||||
"tls-rustls",
|
||||
"tls-native-tls",
|
||||
"runtime-tokio",
|
||||
], optional = true }
|
||||
http = { workspace = true, optional = true }
|
||||
|
|
69
packages/fullstack/examples/axum-desktop/src/main.rs
Normal file
69
packages/fullstack/examples/axum-desktop/src/main.rs
Normal file
|
@ -0,0 +1,69 @@
|
|||
#![allow(non_snake_case)]
|
||||
use dioxus::prelude::*;
|
||||
|
||||
/// Run with `cargo run --features desktop`
|
||||
#[cfg(feature = "desktop")]
|
||||
fn main() {
|
||||
// Set the url of the server where server functions are hosted.
|
||||
dioxus::fullstack::prelude::server_fn::client::set_server_url("http://127.0.0.1:8080");
|
||||
|
||||
// And then launch the app
|
||||
dioxus::prelude::launch_desktop(app);
|
||||
}
|
||||
|
||||
/// Run with `cargo run --features server`
|
||||
#[cfg(all(feature = "server", not(feature = "desktop")))]
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
use server_fn::axum::register_explicit;
|
||||
|
||||
let listener = tokio::net::TcpListener::bind("127.0.0.01:8080")
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
register_explicit::<PostServerData>();
|
||||
register_explicit::<GetServerData>();
|
||||
|
||||
axum::serve(
|
||||
listener,
|
||||
axum::Router::new()
|
||||
.register_server_functions()
|
||||
.into_make_service(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
pub fn app() -> Element {
|
||||
let mut count = use_signal(|| 0);
|
||||
let mut text = use_signal(|| "...".to_string());
|
||||
|
||||
rsx! {
|
||||
h1 { "High-Five counter: {count}" }
|
||||
button { onclick: move |_| count += 1, "Up high!" }
|
||||
button { onclick: move |_| count -= 1, "Down low!" }
|
||||
button {
|
||||
onclick: move |_| async move {
|
||||
if let Ok(data) = get_server_data().await {
|
||||
println!("Client received: {}", data);
|
||||
text.set(data.clone());
|
||||
post_server_data(data).await.unwrap();
|
||||
}
|
||||
},
|
||||
"Run a server function"
|
||||
}
|
||||
"Server said: {text}"
|
||||
}
|
||||
}
|
||||
|
||||
#[server(PostServerData)]
|
||||
async fn post_server_data(data: String) -> Result<(), ServerFnError> {
|
||||
println!("Server received: {}", data);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[server(GetServerData)]
|
||||
async fn get_server_data() -> Result<String, ServerFnError> {
|
||||
Ok("Hello from the server!".to_string())
|
||||
}
|
|
@ -3,6 +3,7 @@ name = "dioxus-hackernews"
|
|||
version = "0.1.0"
|
||||
authors = ["Evan Almloff <evanalmloff@gmail.com>"]
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ parking_lot = "0.12.1"
|
|||
|
||||
[dev-dependencies]
|
||||
rand = "0.8.5"
|
||||
criterion = "0.3"
|
||||
criterion = { workspace = true }
|
||||
|
||||
[features]
|
||||
debug_borrows = []
|
||||
|
|
|
@ -12,27 +12,6 @@ use generational_box::{GenerationalBox, Storage, SyncStorage, UnsyncStorage};
|
|||
#[allow(unused)]
|
||||
fn compile_fail() {}
|
||||
|
||||
#[test]
|
||||
fn reused() {
|
||||
fn reused_test<S: Storage<i32>>() {
|
||||
let first_ptr;
|
||||
{
|
||||
let owner = S::owner();
|
||||
first_ptr = owner.insert(1).raw_ptr();
|
||||
drop(owner);
|
||||
}
|
||||
{
|
||||
let owner = S::owner();
|
||||
let second_ptr = owner.insert(1234).raw_ptr();
|
||||
assert_eq!(first_ptr, second_ptr);
|
||||
drop(owner);
|
||||
}
|
||||
}
|
||||
|
||||
reused_test::<UnsyncStorage>();
|
||||
reused_test::<SyncStorage>();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn leaking_is_ok() {
|
||||
fn leaking_is_ok_test<S: Storage<String>>() {
|
||||
|
|
27
packages/generational-box/tests/reused.rs
Normal file
27
packages/generational-box/tests/reused.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
//! This test needs to be in its own file such that it doesn't share
|
||||
//! an address space with the other tests.
|
||||
//!
|
||||
//! That will cause random failures on CI.
|
||||
|
||||
use generational_box::{Storage, SyncStorage, UnsyncStorage};
|
||||
|
||||
#[test]
|
||||
fn reused() {
|
||||
fn reused_test<S: Storage<i32>>() {
|
||||
let first_ptr;
|
||||
{
|
||||
let owner = S::owner();
|
||||
first_ptr = owner.insert(1).raw_ptr();
|
||||
drop(owner);
|
||||
}
|
||||
{
|
||||
let owner = S::owner();
|
||||
let second_ptr = owner.insert(1234).raw_ptr();
|
||||
assert_eq!(first_ptr, second_ptr);
|
||||
drop(owner);
|
||||
}
|
||||
}
|
||||
|
||||
reused_test::<UnsyncStorage>();
|
||||
reused_test::<SyncStorage>();
|
||||
}
|
|
@ -22,7 +22,7 @@ slab = { workspace = true }
|
|||
futures-util = { workspace = true}
|
||||
generational-box.workspace = true
|
||||
rustversion = "1.0.17"
|
||||
warnings = { git = "https://github.com/DioxusLabs/warnings" }
|
||||
warnings = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
futures-util = { workspace = true, default-features = false }
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
name = "suspense-carousel"
|
||||
edition = "2021"
|
||||
version.workspace = true
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
async-std = "1.12.0"
|
||||
|
|
|
@ -53,7 +53,7 @@ fullstack = ["dep:dioxus-fullstack"]
|
|||
axum = { workspace = true, features = ["ws"] }
|
||||
dioxus = { workspace = true, features = ["router"] }
|
||||
dioxus-ssr = { workspace = true }
|
||||
criterion = { version = "0.5", features = ["async_tokio", "html_reports"] }
|
||||
criterion = { workspace = true, features = ["async_tokio", "html_reports"] }
|
||||
ciborium = { version = "0.2.1" }
|
||||
base64 = { version = "0.21.0" }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
|
|
@ -22,7 +22,7 @@ once_cell = "1.18.0"
|
|||
rustc-hash = { workspace = true }
|
||||
futures-channel = { workspace = true }
|
||||
futures-util = { workspace = true }
|
||||
warnings = { git = "https://github.com/DioxusLabs/warnings" }
|
||||
warnings = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
dioxus = { workspace = true }
|
||||
|
|
|
@ -27,16 +27,17 @@ tracing.workspace = true
|
|||
|
||||
[dev-dependencies]
|
||||
dioxus = { workspace = true }
|
||||
criterion = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
server = ["dioxus-fullstack/server", "dioxus-router/ssr", "dep:dioxus-ssr", "dep:tokio", "dep:http", "dep:axum", "dep:tower-http", "dep:dioxus-hot-reload", "dep:dioxus-cli-config", "dep:tower"]
|
||||
web = ["dioxus-fullstack/web", "dioxus-router/web", "dep:dioxus-web"]
|
||||
|
||||
[[bench]]
|
||||
name = "incremental"
|
||||
required-features = ["ssr"]
|
||||
harness = false
|
||||
# [[bench]]
|
||||
# name = "incremental"
|
||||
# required-features = ["server"]
|
||||
# harness = false
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
#![allow(non_snake_case)]
|
||||
#![doc(html_logo_url = "https://avatars.githubusercontent.com/u/79236386")]
|
||||
#![doc(html_favicon_url = "https://avatars.githubusercontent.com/u/79236386")]
|
||||
#![deny(missing_docs)]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
//! Static generation for Dioxus
|
||||
|
||||
mod config;
|
||||
pub use config::*;
|
||||
|
|
Loading…
Reference in a new issue