From 016b475c32f6ddbcb72d24feac23422c4897273c Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 14:14:41 -0800 Subject: [PATCH 1/9] Fix: move miri to the main CI so it gets run less --- .github/workflows/main.yml | 31 +++++++++ .github/workflows/miri.yml | 133 ------------------------------------- 2 files changed, 31 insertions(+), 133 deletions(-) delete mode 100644 .github/workflows/miri.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f0b66b951..61a6492fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -107,6 +107,37 @@ jobs: - uses: actions/checkout@v4 - run: cargo clippy --workspace --examples --tests -- -D warnings + miri: + env: + CARGO_UNSTABLE_SPARSE_REGISTRY: 'true' + RUSTFLAGS: -Dwarnings + RUST_BACKTRACE: 1 + MIRIFLAGS: -Zmiri-tag-gc=1 + # Change to specific Rust release to pin + rust_stable: stable + rust_nightly: nightly-2023-11-16 + rust_clippy: 1.70.0 + + steps: + - uses: actions/checkout@v4 + - uses: ilammy/setup-nasm@v1 + - name: Install Rust ${{ env.rust_nightly }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.rust_nightly }} + components: miri + - uses: Swatinem/rust-cache@v2 + - name: miri + # Many of tests in tokio/tests and doctests use #[tokio::test] or + # #[tokio::main] that calls epoll_create1 that Miri does not support. + # run: cargo miri test --features full --lib --no-fail-fast + run: | + cargo miri test --package dioxus-core -- --exact --nocapture + cargo miri test --package dioxus-native-core --test miri_native -- --exact --nocapture + env: + MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields + PROPTEST_CASES: 10 + matrix_test: runs-on: ${{ matrix.platform.os }} env: diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml deleted file mode 100644 index 6c8a260b3..000000000 --- a/.github/workflows/miri.yml +++ /dev/null @@ -1,133 +0,0 @@ -name: Miri Tests - -on: - push: - # Run in PRs and for bors, but not on master. - branches: - - 'auto' - - 'try' - paths: - - packages/** - - examples/** - - src/** - - .github/** - - lib.rs - - Cargo.toml - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - branches: - - 'master' - schedule: - - cron: '6 6 * * *' # At 6:06 UTC every day. - -env: - CARGO_UNSTABLE_SPARSE_REGISTRY: 'true' - RUSTFLAGS: -Dwarnings - RUST_BACKTRACE: 1 - # Change to specific Rust release to pin - rust_stable: stable - rust_nightly: nightly-2023-11-16 - rust_clippy: 1.70.0 - # When updating this, also update: - # - README.md - # - tokio/README.md - # - CONTRIBUTING.md - # - tokio/Cargo.toml - # - tokio-util/Cargo.toml - # - tokio-test/Cargo.toml - # - tokio-stream/Cargo.toml - # rust_min: 1.49.0 - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - test: - runs-on: ${{ matrix.os }} - env: - RUST_BACKTRACE: 1 - HOST_TARGET: ${{ matrix.host_target }} - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - host_target: x86_64-unknown-linux-gnu - # - os: macos-latest - # host_target: x86_64-apple-darwin - # - os: windows-latest - # host_target: i686-pc-windows-msvc - # - os: windows-latest - # host_target: i686-pc-windows-msvc - # - os: windows-latest - # host_target: i686-pc-windows-msvc - # - os: windows-latest - # host_target: i686-pc-windows-msvc - steps: - - name: Set the tag GC interval to 1 on linux - if: runner.os == 'Linux' - run: echo "MIRIFLAGS=-Zmiri-tag-gc=1" >> $GITHUB_ENV - - - uses: actions/checkout@v4 - - uses: ilammy/setup-nasm@v1 - - name: Install Rust ${{ env.rust_nightly }} - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.rust_nightly }} - components: miri - - uses: Swatinem/rust-cache@v2 - - name: miri - # Many of tests in tokio/tests and doctests use #[tokio::test] or - # #[tokio::main] that calls epoll_create1 that Miri does not support. - # run: cargo miri test --features full --lib --no-fail-fast - run: | - cargo miri test --package dioxus-core -- --exact --nocapture - cargo miri test --package dioxus-native-core --test miri_native -- --exact --nocapture - - # working-directory: tokio - env: - MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields - PROPTEST_CASES: 10 - - # Cache the global cargo directory, but NOT the local `target` directory which - # we cannot reuse anyway when the nightly changes (and it grows quite large - # over time). - # - name: Add cache for cargo - # id: cache - # uses: actions/cache@v3 - # with: - # path: | - # # Taken from . - # ~/.cargo/bin - # ~/.cargo/registry/index - # ~/.cargo/registry/cache - # ~/.cargo/git/db - # # contains package information of crates installed via `cargo install`. - # ~/.cargo/.crates.toml - # ~/.cargo/.crates2.json - # key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - # restore-keys: ${{ runner.os }}-cargo - - # - name: Install rustup-toolchain-install-master - # if: ${{ steps.cache.outputs.cache-hit != 'true' }} - # shell: bash - # run: | - # cargo install -f rustup-toolchain-install-master - # - name: Install "master" toolchain - # shell: bash - # run: | - # if [[ ${{ github.event_name }} == 'schedule' ]]; then - # echo "Building against latest rustc git version" - # git ls-remote https://github.com/rust-lang/rust/ HEAD | cut -f 1 > rust-version - # fi - # toolchain --host ${{ matrix.host_target }} - # - name: Show Rust version - # run: | - # rustup show - # rustc -Vv - # cargo -V - # - name: Test - # run: | - # MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" cargo +nightly miri test --package dioxus-core --test miri_stress -- --exact --nocapture - # MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" cargo +nightly miri test --package dioxus-native-core --test miri_native -- --exact --nocapture From c02e32c95c55e83131afd3ce2e1815b730e8e8cb Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 14:16:11 -0800 Subject: [PATCH 2/9] Use sccache for miri --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61a6492fe..dcb8f95c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -126,7 +126,7 @@ jobs: with: toolchain: ${{ env.rust_nightly }} components: miri - - uses: Swatinem/rust-cache@v2 + - uses: mozilla-actions/sccache-action@v0.0.3 - name: miri # Many of tests in tokio/tests and doctests use #[tokio::test] or # #[tokio::main] that calls epoll_create1 that Miri does not support. From d84e518ab2bdd4607d3b8afd60f3d63f83562b0d Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 14:21:09 -0800 Subject: [PATCH 3/9] Move playwright too --- .github/workflows/main.yml | 44 +++++++++++++++++++++++++++ .github/workflows/playwright.yml | 52 -------------------------------- 2 files changed, 44 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/playwright.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dcb8f95c6..2cc0b3b30 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,6 +108,9 @@ jobs: - run: cargo clippy --workspace --examples --tests -- -D warnings miri: + if: github.event.pull_request.draft == false + name: Miri + runs-on: ubuntu-latest env: CARGO_UNSTABLE_SPARSE_REGISTRY: 'true' RUSTFLAGS: -Dwarnings @@ -138,6 +141,47 @@ jobs: MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields PROPTEST_CASES: 10 + playwright: + if: github.event.pull_request.draft == false + name: Playwright Tests + runs-on: ubuntu-latest + run: + working-directory: ./playwright-tests + steps: + # Do our best to cache the toolchain and node install steps + - uses: actions/checkout@v4 + - uses: ilammy/setup-nasm@v1 + - uses: actions/setup-node@v4 + with: + node-version: 16 + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown + - uses: Swatinem/rust-cache@v2 + - name: Install dependencies + run: npm ci + - name: Install Playwright + run: npm install -D @playwright/test + - name: Install Playwright Browsers + run: npx playwright install --with-deps + # Cache the CLI by using cargo run internally + # - name: Install Dioxus CLI + # uses: actions-rs/cargo@v1 + # with: + # command: install + # args: --path packages/cli + - name: Run Playwright tests + run: npx playwright test + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + + matrix_test: runs-on: ${{ matrix.platform.os }} env: diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index 6b1b5acf0..000000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Playwright Tests -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] -defaults: - run: - working-directory: ./playwright-tests - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - test: - if: github.event.pull_request.draft == false - timeout-minutes: 60 - runs-on: ubuntu-latest - steps: - # Do our best to cache the toolchain and node install steps - - uses: actions/checkout@v4 - - uses: ilammy/setup-nasm@v1 - - uses: actions/setup-node@v4 - with: - node-version: 16 - - name: Install Rust - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v2 - - name: Install dependencies - run: npm ci - - name: Install Playwright - run: npm install -D @playwright/test - - name: Install Playwright Browsers - run: npx playwright install --with-deps - # Cache the CLI by using cargo run internally - # - name: Install Dioxus CLI - # uses: actions-rs/cargo@v1 - # with: - # command: install - # args: --path packages/cli - - name: Run Playwright tests - run: npx playwright test - - uses: actions/upload-artifact@v4 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 From 75a45358546fed5f25e80f4175bbe217cffd73b1 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 14:21:53 -0800 Subject: [PATCH 4/9] Use mozilla cache for playwright --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2cc0b3b30..a202a9cf2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -159,7 +159,7 @@ jobs: with: toolchain: stable targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v2 + - uses: mozilla-actions/sccache-action@v0.0.3 - name: Install dependencies run: npm ci - name: Install Playwright From 998535b8df885f9fdcc95fa48e2fa7e7de72c507 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 14:27:03 -0800 Subject: [PATCH 5/9] Fix main.yml CI --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a202a9cf2..34b62cd0b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -145,8 +145,9 @@ jobs: if: github.event.pull_request.draft == false name: Playwright Tests runs-on: ubuntu-latest - run: - working-directory: ./playwright-tests + defaults: + run: + working-directory: ./app steps: # Do our best to cache the toolchain and node install steps - uses: actions/checkout@v4 From bc96a3e4fb84127d5276ad02655ba001c3a9ad76 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 14:29:43 -0800 Subject: [PATCH 6/9] Fix working directory --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 34b62cd0b..34941c449 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -147,7 +147,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: ./app + working-directory: ./playwright-tests steps: # Do our best to cache the toolchain and node install steps - uses: actions/checkout@v4 From 6f15e0e92401464ccca84c838e09fc8b18649a9e Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 14:37:05 -0800 Subject: [PATCH 7/9] Fix ci failure on unused cfg deps --- .github/workflows/main.yml | 12 ++++++------ packages/core/src/runtime.rs | 1 + packages/html/src/file_data.rs | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 34941c449..5f5eb369a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,11 +42,11 @@ jobs: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" steps: + - run: sudo apt-get update + - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev - uses: dtolnay/rust-toolchain@stable - uses: mozilla-actions/sccache-action@v0.0.3 - uses: ilammy/setup-nasm@v1 - - run: sudo apt-get update - - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev - uses: actions/checkout@v4 - run: cargo check --all --examples --tests @@ -60,11 +60,11 @@ jobs: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" steps: + - 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: mozilla-actions/sccache-action@v0.0.3 - uses: ilammy/setup-nasm@v1 - - run: sudo apt-get update - - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev - uses: davidB/rust-cargo-make@v1 - uses: browser-actions/setup-firefox@latest - uses: jetli/wasm-pack-action@v0.4.0 @@ -98,11 +98,11 @@ jobs: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" steps: + - run: sudo apt-get update + - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev - uses: dtolnay/rust-toolchain@stable - uses: mozilla-actions/sccache-action@v0.0.3 - uses: ilammy/setup-nasm@v1 - - run: sudo apt-get update - - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev - run: rustup component add clippy - uses: actions/checkout@v4 - run: cargo clippy --workspace --examples --tests -- -D warnings diff --git a/packages/core/src/runtime.rs b/packages/core/src/runtime.rs index f3735b020..c3aaab790 100644 --- a/packages/core/src/runtime.rs +++ b/packages/core/src/runtime.rs @@ -133,6 +133,7 @@ impl Runtime { /// } /// } /// +/// # #[allow(non_snake_case)] /// fn Component(cx: Scope) -> Element { /// cx.use_hook(|| RuntimeGuard::new(cx.props.runtime.clone())); /// diff --git a/packages/html/src/file_data.rs b/packages/html/src/file_data.rs index e206015bb..b15eaab2b 100644 --- a/packages/html/src/file_data.rs +++ b/packages/html/src/file_data.rs @@ -1,4 +1,4 @@ -use std::{any::Any, collections::HashMap}; +use std::any::Any; pub trait HasFileData: std::any::Any { fn files(&self) -> Option> { @@ -10,7 +10,7 @@ pub trait HasFileData: std::any::Any { /// A file engine that serializes files to bytes #[derive(serde::Serialize, serde::Deserialize, Debug, PartialEq, Clone)] pub struct SerializedFileEngine { - pub files: HashMap>, + pub files: std::collections::HashMap>, } #[cfg(feature = "serialize")] From 28a9dc6805c3fb36001ef9ade1065a2ad7ab2057 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 14:54:02 -0800 Subject: [PATCH 8/9] Pin assets sha to keep CI in check --- Cargo.toml | 11 ++++++++--- examples/custom_assets.rs | 2 +- examples/file_explorer.rs | 2 +- examples/tailwind/Cargo.toml | 1 + examples/tailwind/src/main.rs | 2 +- examples/todomvc.rs | 2 +- packages/cli/Cargo.toml | 3 ++- packages/cli/src/cli/bundle.rs | 1 + packages/desktop/Cargo.toml | 7 ++----- packages/dioxus/Cargo.toml | 3 --- packages/dioxus/src/lib.rs | 3 --- packages/fullstack/Cargo.toml | 3 ++- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 25beb4d33..b231106b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,6 +98,12 @@ thiserror = "1.0.40" prettyplease = { package = "prettier-please", version = "0.2", features = [ "verbatim", ] } +manganis-cli-support = { git = "https://github.com/DioxusLabs/collect-assets", rev = "94ea6f7", features = [ + "webp", + "html", +] } +manganis = { git = "https://github.com/DioxusLabs/collect-assets", rev = "94ea6f7" } + # This is a "virtual package" # It is not meant to be published, but is used so "cargo run --example XYZ" works properly @@ -136,8 +142,7 @@ reqwest = { version = "0.11.9", features = ["json"] } env_logger = "0.10.0" simple_logger = "4.0.0" thiserror = { workspace = true } - - -[dependencies] +manganis = { workspace = true } tracing-subscriber = "0.3.17" http-range = "0.1.5" + diff --git a/examples/custom_assets.rs b/examples/custom_assets.rs index 7eb9db375..9f46df924 100644 --- a/examples/custom_assets.rs +++ b/examples/custom_assets.rs @@ -10,7 +10,7 @@ fn app(cx: Scope) -> Element { p { "This should show an image:" } - img { src: mg!(image("examples/assets/logo.png").format(ImageType::Avif)).to_string() } + img { src: manganis::mg!(image("examples/assets/logo.png").format(ImageType::Avif)).to_string() } } }) } diff --git a/examples/file_explorer.rs b/examples/file_explorer.rs index f0534cbf8..3ff757c60 100644 --- a/examples/file_explorer.rs +++ b/examples/file_explorer.rs @@ -18,7 +18,7 @@ fn main() { ); } -const _STYLE: &str = mg!(file("./examples/assets/fileexplorer.css")); +const _STYLE: &str = manganis::mg!(file("./examples/assets/fileexplorer.css")); fn app(cx: Scope) -> Element { let files = use_ref(cx, Files::new); diff --git a/examples/tailwind/Cargo.toml b/examples/tailwind/Cargo.toml index 26ac202f1..f61f1def8 100644 --- a/examples/tailwind/Cargo.toml +++ b/examples/tailwind/Cargo.toml @@ -13,6 +13,7 @@ publish = false [dependencies] dioxus = { path = "../../packages/dioxus" } +manganis = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] dioxus-desktop = { path = "../../packages/desktop" } diff --git a/examples/tailwind/src/main.rs b/examples/tailwind/src/main.rs index 10124e47c..fe0016651 100644 --- a/examples/tailwind/src/main.rs +++ b/examples/tailwind/src/main.rs @@ -2,7 +2,7 @@ use dioxus::prelude::*; -const _STYLE: &str = mg!(file("./public/tailwind.css")); +const _STYLE: &str = manganis::mg!(file("./public/tailwind.css")); fn main() { #[cfg(not(target_arch = "wasm32"))] diff --git a/examples/todomvc.rs b/examples/todomvc.rs index cdf41aaa0..c891ae832 100644 --- a/examples/todomvc.rs +++ b/examples/todomvc.rs @@ -7,7 +7,7 @@ fn main() { dioxus_desktop::launch(app); } -const _STYLE: &str = mg!(file("./examples/assets/todomvc.css")); +const _STYLE: &str = manganis::mg!(file("./examples/assets/todomvc.css")); #[derive(PartialEq, Eq, Clone, Copy)] pub enum FilterState { diff --git a/packages/cli/Cargo.toml b/packages/cli/Cargo.toml index d22ac7031..ffcd29dc8 100644 --- a/packages/cli/Cargo.toml +++ b/packages/cli/Cargo.toml @@ -76,7 +76,8 @@ toml_edit = "0.19.11" tauri-bundler = { version = "=1.4.*", features = ["native-tls-vendored"] } tauri-utils = "=1.5.*" -manganis-cli-support = { git = "https://github.com/DioxusLabs/collect-assets", features = ["webp", "html"] } +# todo: don't make this optional +manganis-cli-support = { workspace = true, features = ["webp", "html"] } dioxus-autofmt = { workspace = true } dioxus-check = { workspace = true } diff --git a/packages/cli/src/cli/bundle.rs b/packages/cli/src/cli/bundle.rs index a2231b31f..3b0be6ef9 100644 --- a/packages/cli/src/cli/bundle.rs +++ b/packages/cli/src/cli/bundle.rs @@ -136,6 +136,7 @@ impl Bundle { } // Add all assets from collect assets to the bundle + #[cfg(feature = "collect-assets")] { let config = manganis_cli_support::Config::current(); let location = config.assets_serve_location().to_string(); diff --git a/packages/desktop/Cargo.toml b/packages/desktop/Cargo.toml index d7c1bb403..d18b6efa4 100644 --- a/packages/desktop/Cargo.toml +++ b/packages/desktop/Cargo.toml @@ -53,10 +53,7 @@ tao = { version = "0.24.0", features = ["rwh_05"] } [target.'cfg(any(target_os = "windows",target_os = "macos",target_os = "linux",target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies] # This is only for debug mode, and it appears mobile does not support some packages this uses -manganis-cli-support = { git = "https://github.com/DioxusLabs/collect-assets", optional = true, features = [ - "webp", - "html", -] } +manganis-cli-support = { workspace = true, optional = true, features = ["webp", "html"] } rfd = "0.12" global-hotkey = "0.4.1" muda = "0.11.3" @@ -76,7 +73,7 @@ fullscreen = ["wry/fullscreen"] transparent = ["wry/transparent"] devtools = ["wry/devtools"] hot-reload = ["dioxus-hot-reload"] -asset-collect = ["manganis-cli-support"] +collect-assets = ["manganis-cli-support"] gnu = [] [package.metadata.docs.rs] diff --git a/packages/dioxus/Cargo.toml b/packages/dioxus/Cargo.toml index 170f0321e..b88cebe27 100644 --- a/packages/dioxus/Cargo.toml +++ b/packages/dioxus/Cargo.toml @@ -16,7 +16,6 @@ dioxus-html = { workspace = true, optional = true } dioxus-core-macro = { workspace = true, optional = true } dioxus-hooks = { workspace = true, optional = true } dioxus-rsx = { workspace = true, optional = true } -manganis = { git = "https://github.com/DioxusLabs/collect-assets" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] dioxus-hot-reload = { workspace = true, optional = true } @@ -37,8 +36,6 @@ criterion = "0.3.5" thiserror = { workspace = true } env_logger = "0.10.0" tokio = { workspace = true, features = ["full"] } -# dioxus-edit-stream = { workspace = true } - [[bench]] name = "jsframework" diff --git a/packages/dioxus/src/lib.rs b/packages/dioxus/src/lib.rs index 1e64715b0..6256e96d7 100644 --- a/packages/dioxus/src/lib.rs +++ b/packages/dioxus/src/lib.rs @@ -22,9 +22,6 @@ pub use dioxus_rsx as rsx; pub use dioxus_core_macro as core_macro; pub mod prelude { - pub use manganis; - pub use manganis::mg; - #[cfg(feature = "hooks")] pub use crate::hooks::*; diff --git a/packages/fullstack/Cargo.toml b/packages/fullstack/Cargo.toml index 17e8ad4f6..05e26a5ef 100644 --- a/packages/fullstack/Cargo.toml +++ b/packages/fullstack/Cargo.toml @@ -69,7 +69,7 @@ web-sys = { version = "0.3.61", features = ["Window", "Document", "Element", "Ht [target.'cfg(any(target_os = "windows",target_os = "macos",target_os = "linux",target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies] # This is only for debug mode, and it appears mobile does not support some packages this uses -manganis-cli-support = { git = "https://github.com/DioxusLabs/collect-assets", features = ["webp", "html"] } +manganis-cli-support = { workspace = true, features = ["webp", "html"], optional = true } [features] default = ["hot-reload"] @@ -83,3 +83,4 @@ salvo = ["dep:salvo", "ssr", "http-body-util"] ssr = ["server_fn/ssr", "dioxus_server_macro/ssr", "tokio", "tokio-util", "tokio-stream", "dioxus-ssr", "tower", "hyper", "http", "dioxus-router?/ssr", "tower-layer", "anymap", "tracing-futures", "pin-project", "thiserror"] default-tls = ["server_fn/default-tls"] rustls = ["server_fn/rustls"] +collect-assets = ["manganis-cli-support"] From ce75a13d264285a888620646337cdcc7a8e2656d Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Mon, 8 Jan 2024 15:00:05 -0800 Subject: [PATCH 9/9] apply sccache for all jobs in main workflow --- .github/workflows/main.yml | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5f5eb369a..47734a7ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,16 +31,17 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + jobs: check: if: github.event.pull_request.draft == false name: Check runs-on: ubuntu-latest - env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" steps: - run: sudo apt-get update - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev @@ -54,11 +55,6 @@ jobs: if: github.event.pull_request.draft == false name: Test Suite runs-on: ubuntu-latest - env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" steps: - run: sudo apt-get update - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev @@ -75,11 +71,6 @@ jobs: if: github.event.pull_request.draft == false name: Rustfmt runs-on: ubuntu-latest - env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" steps: - uses: dtolnay/rust-toolchain@stable - uses: mozilla-actions/sccache-action@v0.0.3 @@ -92,11 +83,6 @@ jobs: if: github.event.pull_request.draft == false name: Clippy runs-on: ubuntu-latest - env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" steps: - run: sudo apt-get update - run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev @@ -186,10 +172,6 @@ jobs: matrix_test: runs-on: ${{ matrix.platform.os }} env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" RUST_CARGO_COMMAND: ${{ matrix.platform.cross == true && 'cross' || 'cargo' }} strategy: matrix: