diff --git a/Cargo.lock b/Cargo.lock index 58671f6..c519ade 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,12 +69,6 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3df27b8d5ddb458c5fb1bbc1ce172d4a38c614a97d550b0ac89003897fb01de4" -[[package]] -name = "async-once-cell" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288f83726785267c6f2ef073a3d83dc3f9b81464e9f99898240cced85fce35a" - [[package]] name = "async-stream" version = "0.3.6" @@ -855,7 +849,6 @@ dependencies = [ "serde", "subsecond", "warnings", - "wasm-splitter", ] [[package]] @@ -4496,30 +4489,6 @@ dependencies = [ "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]] name = "wasm-streams" version = "0.4.2" @@ -5042,7 +5011,6 @@ dependencies = [ "chrono", "deadpool-postgres", "dioxus", - "dioxus-router", "dotenvy", "getrandom 0.2.17", "http", diff --git a/Cargo.toml b/Cargo.toml index e5cba55..ee6b615 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,8 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -dioxus = { version = "0.7.9", features = ["fullstack", "router", "wasm-split"] } -dioxus-router = { version = "0.7.9", features = ["wasm-split"] } +dioxus = { version = "0.7.9", features = ["fullstack", "router"] } serde = { version = "1.0", features = ["derive"] } tokio = { version = "1.52", features = ["full"], optional = true } tokio-postgres = { version = "0.7", features = ["with-chrono-0_4"], optional = true } diff --git a/Makefile b/Makefile index 83c51d7..0fcf388 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ build: @$(MAKE) build-editor @$(MAKE) highlight-css @tailwindcss -i input.css -o public/style.css --minify - @dx build --release --wasm-split + @dx build --release highlight-css: @cargo run --bin generate_highlight_css @@ -19,7 +19,7 @@ dev: @tailwindcss -i input.css -o public/style.css --watch & \ TAILWIND_PID=$$!; \ 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: @tailwindcss -i input.css -o public/style.css diff --git a/amp b/amp new file mode 100644 index 0000000..e69de29 diff --git a/scripts/fix-wasm-paths.py b/scripts/fix-wasm-paths.py deleted file mode 100755 index 94e64db..0000000 --- a/scripts/fix-wasm-paths.py +++ /dev/null @@ -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()