codify "platform" into resolution logic, server-fn/fullstack overhaul (#4596)

overhaul dioxus fullstack using a new implementation of server_fn

This PR is a complete rewrite of dioxus fullstack designed to improve compatibility with axum and to fix a number of compilation errors based on feature flag unification plumbing through macros.
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-10-03 18:26:19 -07:00
1 parent 8421c3aef0
commit f2b1c6d97f
424 files changed
+17284 -6624

No files matched your search

@@ -12,3 +12,6 @@ runs:
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/swift
sudo docker image prune --all --force || true
+35 -154
View File
@@ -45,7 +45,7 @@ jobs:
check-msrv:
if: github.event.pull_request.draft == false
name: Check MSRV
runs-on: ubuntu-24.04
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.86.0
@@ -66,7 +66,7 @@ jobs:
test:
if: github.event.pull_request.draft == false
name: Test Suite
runs-on: ubuntu-24.04
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- name: Free Disk Space
@@ -87,7 +87,7 @@ jobs:
release-test:
if: github.event.pull_request.draft == false
name: Test Suite with Optimizations
runs-on: ubuntu-24.04
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- name: Free Disk Space
@@ -108,7 +108,7 @@ jobs:
fmt:
if: github.event.pull_request.draft == false
name: Rustfmt
runs-on: ubuntu-24.04
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.86.0
@@ -122,7 +122,7 @@ jobs:
docs:
if: github.event.pull_request.draft == false
name: Docs
runs-on: ubuntu-24.04
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- uses: awalsh128/cache-apt-pkgs-action@latest
@@ -145,7 +145,7 @@ jobs:
test-docs:
if: github.event.pull_request.draft == false
name: Test Docs
runs-on: ubuntu-24.04
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- uses: awalsh128/cache-apt-pkgs-action@latest
@@ -166,7 +166,7 @@ jobs:
check:
if: github.event.pull_request.draft == false
name: Check
runs-on: ubuntu-24.04
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- uses: awalsh128/cache-apt-pkgs-action@latest
@@ -182,7 +182,7 @@ jobs:
clippy:
if: github.event.pull_request.draft == false
name: Clippy
runs-on: ubuntu-24.04
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- uses: awalsh128/cache-apt-pkgs-action@latest
@@ -202,7 +202,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-latest]
os: [blacksmith-4vcpu-ubuntu-2404, macos-latest]
steps:
- uses: actions/checkout@v5
- uses: nixbuild/nix-quick-install-action@master
@@ -220,7 +220,7 @@ jobs:
playwright:
if: github.event.pull_request.draft == false
name: Playwright Tests
runs-on: macos-latest
runs-on: blacksmith-8vcpu-ubuntu-2404
strategy:
matrix:
platform:
@@ -229,6 +229,9 @@ jobs:
steps:
# Do our best to cache the toolchain and node install steps
- uses: actions/checkout@v5
- name: Free Disk Space
if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404-arm' }}
uses: ./.github/actions/free-disk-space
- uses: actions/setup-node@v4
with:
node-version: 24
@@ -297,18 +300,9 @@ jobs:
args: "--package dioxus-desktop",
platform: "ios",
}
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-24.04,
toolchain: "1.86.0",
cross: false,
command: "build",
args: "--all --tests",
platform: "desktop",
}
- {
target: aarch64-unknown-linux-gnu,
os: ubuntu-24.04-arm,
os: blacksmith-4vcpu-ubuntu-2404-arm,
toolchain: "1.86.0",
cross: false,
command: "build",
@@ -317,16 +311,36 @@ jobs:
}
- {
target: aarch64-linux-android,
os: ubuntu-24.04,
os: blacksmith-4vcpu-ubuntu-2404,
toolchain: "1.86.0",
cross: true,
command: "build",
args: "--package dioxus-desktop",
platform: "android",
}
# commented out because it's having issues with space on the device, but we already test it above
# - {
# target: x86_64-unknown-linux-gnu,
# os: ubuntu-24.04,
# toolchain: "1.86.0",
# cross: false,
# command: "build",
# args: "--all --tests",
# platform: "desktop",
# }
steps:
- uses: actions/checkout@v5
- name: Free Disk Space
if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404-arm' }}
uses: ./.github/actions/free-disk-space
- uses: awalsh128/cache-apt-pkgs-action@latest
if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404-arm' }}
with:
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libudev-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
version: ${{ matrix.platform.target }}-${{ matrix.platform.os }} # disambiguate since we're in a matrix and this caching action doesn't factor in these variables
- name: install stable
uses: dtolnay/rust-toolchain@master
with:
@@ -338,16 +352,6 @@ jobs:
if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
uses: ilammy/setup-nasm@v1
- name: Free Disk Space
if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' }}
uses: ./.github/actions/free-disk-space
- uses: awalsh128/cache-apt-pkgs-action@latest
if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' }}
with:
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libudev-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
version: ${{ matrix.platform.target }}-${{ matrix.platform.os }} # disambiguate since we're in a matrix and this caching action doesn't factor in these variables
- name: Install cross
if: ${{ matrix.platform.cross == true }}
uses: taiki-e/install-action@cross
@@ -386,126 +390,3 @@ jobs:
working-directory: ${{ env.UV_WORKSPACE }}
run: |
cargo test --workspace --tests
# Only run semver checks if the PR is not a draft and does not have the breaking label
# Breaking PRs don't need to follow semver since they are breaking changes
# However, this means we won't attempt to backport them, so you should be careful about using this label, as it will
# likely make future backporting difficult
#
# todo: fix this so even if breaking changes have been merged, the fix can be backported
#
# This will stop working once the first breaking change has been merged, so we should really try to just backport the fix
# and *then* run the semver checks. Basically "would backporting this PR cause a breaking change on stable?"
#
# semver:
# if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'breaking')
# name: Semver Check
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v5
# - uses: dtolnay/rust-toolchain@1.86.0
# - uses: Swatinem/rust-cache@v2
# with:
# cache-all-crates: "true"
# cache-on-failure: "true"
# - name: Check semver
# uses: obi1kenobi/cargo-semver-checks-action@v2
# with:
# manifest-path: ./Cargo.toml
# exclude: "dioxus-cli, dioxus-ext"
# Releases for the CLI on a per-branch basis
# nightly-cli:
# if: github.event.pull_request.draft == false
# runs-on: ${{ matrix.platform.os }}
# strategy:
# matrix:
# platform:
# - {
# target: x86_64-pc-windows-msvc,
# os: windows-latest
# }
# - {
# target: aarch64-pc-windows-msvc,
# os: windows-latest
# }
# - {
# target: x86_64-apple-darwin,
# os: macos-13
# }
# - {
# target: aarch64-apple-darwin,
# os: macos-latest
# }
# - {
# target: x86_64-unknown-linux-gnu,
# os: ubuntu-24.04
# }
# - {
# target: aarch64-unknown-linux-gnu,
# os: ubuntu-24.04-arm
# }
# - {
# target: x86_64-unknown-linux-musl,
# os: ubuntu-24.04
# }
# - {
# target: aarch64-unknown-linux-musl,
# os: ubuntu-24.04-arm
# }
# steps:
# - name: Checkout
# uses: actions/checkout@v5
# - name: Install openssl on macos
# if: matrix.platform.os == 'macos-latest'
# run: brew install openssl
# - name: Install nasm for windows (tls)
# if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
# uses: ilammy/setup-nasm@v1
# - name: Free Disk Space
# if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' }}
# uses: ./.github/actions/free-disk-space
# - uses: awalsh128/cache-apt-pkgs-action@latest
# if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' }}
# with:
# packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev musl-tools
# version: 1.0
# - name: Install stable
# uses: dtolnay/rust-toolchain@master
# with:
# toolchain: "1.86.0"
# targets: ${{ matrix.platform.target }}
# - uses: Swatinem/rust-cache@v2
# with:
# cache-all-crates: "true"
# save-if: ${{ github.ref == 'refs/heads/main' }}
# - name: Free Disk Space
# uses: jlumbroso/free-disk-space@v1.3.1
# with: # speed things up a bit
# large-packages: false
# docker-images: false
# swap-storage: false
# # Todo: we want `cargo install dx` to actually just use a prebuilt binary instead of building it
# - name: Build CLI
# run: |
# cargo build --release --package dioxus-cli --target ${{ matrix.platform.target }}
# - name: Upload CLI binaries
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: dx-${{ matrix.platform.target }}-${{ github.event.number || github.ref_name }}
# path: ./target/${{ matrix.platform.target }}/release/dx
# retention-days: ${{ github.ref == 'refs/heads/main' && 90 || 30 }}
# overwrite: true
# - name: Output artifact ID
# run: echo 'Artifact ID is ${{ steps.artifact-upload-step.outputs.artifact-id }}'
+2 -2
View File
@@ -23,7 +23,7 @@ jobs:
# Attempt to backport a merged pull request to the latest stable release
backport:
name: Backport pull request
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2404
# Don't run on closed unmerged pull requests, or pull requests with the "breaking" label
if: github.event.pull_request.merged && !contains(github.event.pull_request.labels.*.name, 'breaking')
@@ -34,7 +34,7 @@ jobs:
# Upload nightly docs to the website
docs:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2404
permissions:
contents: write
steps:
+1 -1
View File
@@ -22,7 +22,7 @@ permissions:
jobs:
promote:
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- name: Publish the next pre-release
+2 -2
View File
@@ -58,9 +58,9 @@ jobs:
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
os: blacksmith-4vcpu-ubuntu-2404
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
os: blacksmith-4vcpu-ubuntu-2404
# - target: x86_64-unknown-linux-musl
# os: ubuntu-24.04
# - target: aarch64-unknown-linux-musl
+2 -2
View File
@@ -16,7 +16,7 @@ jobs:
typos:
if: github.event.pull_request.draft == false
name: Check for typos
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- name: Check for typos
@@ -26,7 +26,7 @@ jobs:
link-check:
if: github.event.pull_request.draft == false
name: Check For Invalid Links
runs-on: ubuntu-latest
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- name: Restore lychee cache