一键导入
update-dioxus-fork
Update dioxus to use a custom fork/branch instead of a crates.io release. Use when you need unreleased fixes or patches.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Update dioxus to use a custom fork/branch instead of a crates.io release. Use when you need unreleased fixes or patches.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | update-dioxus-fork |
| description | Update dioxus to use a custom fork/branch instead of a crates.io release. Use when you need unreleased fixes or patches. |
Update dioxus to use a custom Git fork instead of a crates.io release. This is for when you need unreleased fixes.
From the fork repository, collect:
SuperKenVery/dioxus)fix/hash-filename-when-wasm-split)git rev-parse HEAD)grep '^version' Cargo.toml in the workspace root)Verify the branch is pushed to GitHub:
git ls-remote origin BRANCH_NAME
Change all dioxus crates to git dependencies:
dioxus = { git = "https://github.com/OWNER/dioxus.git", branch = "BRANCH", features = ["fullstack", "router"] }
dioxus-cli-config = { git = "https://github.com/OWNER/dioxus.git", branch = "BRANCH" }
dioxus-logger = { git = "https://github.com/OWNER/dioxus.git", branch = "BRANCH" }
Run cargo update to refresh the lock file.
grep '^name = "wasm-bindgen"' -A 1 Cargo.lock
Replace the dioxus-cli override to build from GitHub source using fetchFromGitHub + fetchCargoVendor:
dioxus-cli = eachSystem (pkgs: pkgs.dioxus-cli.overrideAttrs (oldAttrs: {
version = "VERSION-DESCRIPTION";
src = pkgs.fetchFromGitHub {
owner = "OWNER";
repo = "dioxus";
rev = "FULL_COMMIT_HASH";
hash = "HASH";
};
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (oldAttrs) pname;
version = "VERSION-DESCRIPTION";
src = pkgs.fetchFromGitHub {
owner = "OWNER";
repo = "dioxus";
rev = "FULL_COMMIT_HASH";
hash = "HASH";
};
hash = "CARGO_VENDOR_HASH";
};
postPatch = "";
}));
Dioxus.lock is NOT needed with this approach — delete it if it exists.
Source hash:
nix-prefetch-url --unpack "https://github.com/OWNER/dioxus/archive/FULL_COMMIT_HASH.tar.gz"
# Convert to SRI:
nix hash convert --hash-algo sha256 --to sri HASH_FROM_ABOVE
Cargo vendor hash (use empty hash "" and read the "got:" line):
nix build --impure --expr '
let pkgs = import (builtins.getFlake "nixpkgs") {};
in pkgs.rustPlatform.fetchCargoVendor {
src = pkgs.fetchFromGitHub {
owner = "OWNER";
repo = "dioxus";
rev = "FULL_COMMIT_HASH";
hash = "SOURCE_HASH_FROM_ABOVE";
};
pname = "dioxus-cli";
version = "VERSION";
hash = "";
}
' 2>&1 | grep "got:"
If the wasm-bindgen version changed (step 4), update the hashes. The version is auto-detected from Cargo.lock, but hashes must be updated manually.
# fetchCrate hash
nix build --impure --expr '
let pkgs = import (builtins.getFlake "nixpkgs") {};
in pkgs.fetchCrate {
pname = "wasm-bindgen-cli";
version = "NEW_VERSION";
hash = "";
}
' 2>&1 | grep "got:"
# fetchCargoVendor hash
nix build --impure --expr '
let pkgs = import (builtins.getFlake "nixpkgs") {};
src = pkgs.fetchCrate {
pname = "wasm-bindgen-cli";
version = "NEW_VERSION";
hash = "HASH_FROM_ABOVE";
};
in pkgs.rustPlatform.fetchCargoVendor {
inherit src;
pname = "wasm-bindgen-cli";
version = "NEW_VERSION";
hash = "";
}
' 2>&1 | grep "got:"
Run nix flake check or attempt a build to verify everything resolves correctly.
When the fix is merged upstream and released, revert to a crates.io release using the update-dioxus skill. Key changes:
fetchFromGitHub → importCargoLock with Dioxus.lock (or remove override if nixpkgs matches)Dioxus.lock from the dioxus repo's Cargo.lock at the release tag