Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Place identical browser engine profile beside upstream override

skylar taylor-barrick8c557fcb7d12
diff --git a/Cargo.toml b/Cargo.toml
index 9c0d91160..65e6c12d2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -82,8 +82,8 @@ codegen-units = 1
# The browser build (apps/photocraft-web, `data-cargo-profile` in its index.html). Hosts cap the
# size of a single file (Cloudflare Pages/Workers: 25 MiB), and the wasm is downloaded on every
-# visit, so this profile optimizes for size: fat LTO, opt-level "z" for the UI shell, and "s" for
-# other crates except pixel processing, which keeps opt-level 3 for filters and compositing. panic
+# visit, so this profile optimizes for size: fat LTO, opt-level "z" for the UI, command, and I/O
+# shells, and "s" for other crates except pixel processing, which keeps opt-level 3. panic
# stays the target default (wasm32-unknown-unknown aborts; AGENTS.md's `panic = "unwind"` is for
# the native app shell). packaging/web/package.sh fails the build above 24 MiB.
[profile.wasm-release]
@@ -101,6 +101,15 @@ opt-level = "s"
[profile.wasm-release.package.photocraft-ui-egui]
opt-level = "z"
+# Keep browser command dispatch, import/export glue, and the entry point compact. Native
+# builds and the speed-oriented pixel-processing overrides below retain their settings.
+[profile.wasm-release.package.photocraft-engine]
+opt-level = "z"
+[profile.wasm-release.package.photocraft-io]
+opt-level = "z"
+[profile.wasm-release.package.photocraft-web]
+opt-level = "z"
+
[profile.wasm-release.package.photocraft-raster]
opt-level = 3
[profile.wasm-release.package.photocraft-color]
@@ -114,6 +123,3 @@ opt-level = 3
[profile.wasm-release.package.photocraft-paint]
opt-level = 3
-# Size-focused command orchestration in the browser; pixel kernels keep their overrides above.
-[profile.wasm-release.package.photocraft-engine]
-opt-level = "z"