T44d Web · Gallery builds for wasm32: one story per section by URL, themed by the host
The gallery's entry runs natively or, on wasm32, from a wasm_bindgen start through gpui_web, single-threaded with WebGL2 fallback. ?page, ?story and ?theme choose what shows; an unknown one fails in the page and the log. set_theme switches the mode later. Pictures load from ELY_GALLERY_ASSETS. scripts/stories.py writes examples/gallery/stories.json from the pages.
This commit is contained in:
83 files changed
+1000
-455
No files matched your search
+13
@@ -60,6 +60,12 @@ rustix = { version = "1", default-features = false, features = ["std", "fs"] }
|
||||
[dev-dependencies]
|
||||
env_logger = "0.11"
|
||||
|
||||
[target.'cfg(target_family = "wasm")'.dev-dependencies]
|
||||
gpui_web = { git = "https://github.com/zed-industries/zed", rev = "1a28cff4b409169bac058bca40dfbfeb7621d19b" }
|
||||
js-sys = "0.3"
|
||||
wasm-bindgen = "0.2"
|
||||
web-sys = { version = "0.3", features = ["Location", "UrlSearchParams", "Window"] }
|
||||
|
||||
[target.'cfg(target_os = "macos")'.dev-dependencies]
|
||||
core-foundation = "0.10"
|
||||
core-graphics = "0.24"
|
||||
@@ -71,6 +77,13 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("cargo-cli
|
||||
[lints.clippy]
|
||||
all = { level = "warn", priority = -1 }
|
||||
|
||||
# The web gallery: small over fast, one unit so LTO sees everything.
|
||||
[profile.web]
|
||||
inherits = "release"
|
||||
opt-level = "z"
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
|
||||
[[example]]
|
||||
name = "gallery"
|
||||
path = "examples/gallery/main.rs"
|
||||
Reference in new issue
Block a user