revert: disable wasm-split due to fullstack SSR incompatibility
wasm-split is incompatible with Dioxus fullstack SSR/hydration. The feature causes hydration failures because split WASM chunks are not available during client-side hydration of server-rendered HTML. Changes reverted: - Remove wasm-split feature from dioxus and dioxus-router - Remove --wasm-split flag from dx build in Makefile
This commit is contained in:
parent
73fd3c30e2
commit
f81656bb18
32
Cargo.lock
generated
32
Cargo.lock
generated
@ -69,12 +69,6 @@ version = "0.13.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3df27b8d5ddb458c5fb1bbc1ce172d4a38c614a97d550b0ac89003897fb01de4"
|
checksum = "3df27b8d5ddb458c5fb1bbc1ce172d4a38c614a97d550b0ac89003897fb01de4"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "async-once-cell"
|
|
||||||
version = "0.5.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-stream"
|
name = "async-stream"
|
||||||
version = "0.3.6"
|
version = "0.3.6"
|
||||||
@ -855,7 +849,6 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"subsecond",
|
"subsecond",
|
||||||
"warnings",
|
"warnings",
|
||||||
"wasm-splitter",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4496,30 +4489,6 @@ dependencies = [
|
|||||||
"wasmparser",
|
"wasmparser",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasm-split-macro"
|
|
||||||
version = "0.7.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "540776437e21577983e166d89a0c65f355c0409a20e27ca79f72798d7192f0a3"
|
|
||||||
dependencies = [
|
|
||||||
"base16",
|
|
||||||
"digest 0.10.7",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"sha2 0.10.9",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasm-splitter"
|
|
||||||
version = "0.7.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e70a57a19a59bd771cd2db8320d6a65de1763995e9fbdc0d1508301138526231"
|
|
||||||
dependencies = [
|
|
||||||
"async-once-cell",
|
|
||||||
"wasm-split-macro",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-streams"
|
name = "wasm-streams"
|
||||||
version = "0.4.2"
|
version = "0.4.2"
|
||||||
@ -5042,7 +5011,6 @@ dependencies = [
|
|||||||
"chrono",
|
"chrono",
|
||||||
"deadpool-postgres",
|
"deadpool-postgres",
|
||||||
"dioxus",
|
"dioxus",
|
||||||
"dioxus-router",
|
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
"getrandom 0.2.17",
|
"getrandom 0.2.17",
|
||||||
"http",
|
"http",
|
||||||
|
|||||||
@ -4,8 +4,7 @@ version = "0.1.0"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dioxus = { version = "0.7.9", features = ["fullstack", "router", "wasm-split"] }
|
dioxus = { version = "0.7.9", features = ["fullstack", "router"] }
|
||||||
dioxus-router = { version = "0.7.9", features = ["wasm-split"] }
|
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
tokio = { version = "1.52", features = ["full"], optional = true }
|
tokio = { version = "1.52", features = ["full"], optional = true }
|
||||||
tokio-postgres = { version = "0.7", features = ["with-chrono-0_4"], optional = true }
|
tokio-postgres = { version = "0.7", features = ["with-chrono-0_4"], optional = true }
|
||||||
|
|||||||
4
Makefile
4
Makefile
@ -4,7 +4,7 @@ build:
|
|||||||
@$(MAKE) build-editor
|
@$(MAKE) build-editor
|
||||||
@$(MAKE) highlight-css
|
@$(MAKE) highlight-css
|
||||||
@tailwindcss -i input.css -o public/style.css --minify
|
@tailwindcss -i input.css -o public/style.css --minify
|
||||||
@dx build --release --wasm-split
|
@dx build --release
|
||||||
|
|
||||||
highlight-css:
|
highlight-css:
|
||||||
@cargo run --bin generate_highlight_css
|
@cargo run --bin generate_highlight_css
|
||||||
@ -19,7 +19,7 @@ dev:
|
|||||||
@tailwindcss -i input.css -o public/style.css --watch & \
|
@tailwindcss -i input.css -o public/style.css --watch & \
|
||||||
TAILWIND_PID=$$!; \
|
TAILWIND_PID=$$!; \
|
||||||
trap 'kill $$TAILWIND_PID 2>/dev/null; exit' INT TERM EXIT; \
|
trap 'kill $$TAILWIND_PID 2>/dev/null; exit' INT TERM EXIT; \
|
||||||
dx serve --addr 0.0.0.0
|
dx serve --addr 0.0.0.0 --wasm-split
|
||||||
|
|
||||||
css:
|
css:
|
||||||
@tailwindcss -i input.css -o public/style.css
|
@tailwindcss -i input.css -o public/style.css
|
||||||
|
|||||||
@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
"""
|
|
||||||
Fix WASM paths for Dioxus production builds.
|
|
||||||
|
|
||||||
Dioxus 0.7 hashes WASM/JS files and places them in assets/, but index.html
|
|
||||||
still references the old wasm/ paths. This script creates symlinks to bridge
|
|
||||||
the gap.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
manifest_path = "target/dx/yggdrasil/release/web/.manifest.json"
|
|
||||||
|
|
||||||
if not os.path.exists(manifest_path):
|
|
||||||
print("Manifest not found, skipping WASM path fix")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
with open(manifest_path) as f:
|
|
||||||
data = json.load(f)
|
|
||||||
|
|
||||||
wasm_dir = "target/dx/yggdrasil/release/web/public/wasm"
|
|
||||||
assets_dir = "target/dx/yggdrasil/release/web/public/assets"
|
|
||||||
os.makedirs(wasm_dir, exist_ok=True)
|
|
||||||
|
|
||||||
for path, info_list in data["assets"].items():
|
|
||||||
if "wasm/" in path:
|
|
||||||
for info in info_list:
|
|
||||||
bundled = info["bundled_path"]
|
|
||||||
original_name = os.path.basename(path)
|
|
||||||
src = os.path.join(assets_dir, bundled)
|
|
||||||
dst = os.path.join(wasm_dir, original_name)
|
|
||||||
|
|
||||||
if os.path.exists(src):
|
|
||||||
if os.path.islink(dst) or os.path.exists(dst):
|
|
||||||
os.remove(dst)
|
|
||||||
os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst)
|
|
||||||
print(f"Linked: wasm/{original_name} -> assets/{bundled}")
|
|
||||||
else:
|
|
||||||
print(f"ERROR: Source not found: {src}")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
Loading…
x
Reference in New Issue
Block a user