T44d Web · Hidden demos keep still, wide ones scroll whole, pastes read the web's clipboard
This commit is contained in:
26 files changed
+211
-101
No files matched your search
+1
-1
@@ -11,7 +11,7 @@ OUT = ROOT / "examples/gallery/stories.json"
|
||||
CALL = re.compile(r"(?<![\w.])(?:(\w+)::)?(\w+)\s*\(")
|
||||
CHAIN = re.compile(r"\s*\.\s*\w+\s*(?:::<[^>]*>\s*)?\(")
|
||||
|
||||
# Components a story draws beyond its title's, by page and the title's first name.
|
||||
# What a story draws beyond its title's names.
|
||||
SHOWN = {
|
||||
("forms", "Form"): ["FormLabel", "FormError"],
|
||||
("tables", "DataTable"): ["Sparkline"],
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# Builds the browser gallery into <out>; ELY_GALLERY_ASSETS is the address of <out>/assets/.
|
||||
# Builds the browser gallery; ELY_GALLERY_ASSETS addresses <out>/assets/.
|
||||
set -eu
|
||||
out=$(mkdir -p "${1:?usage: scripts/web.sh <out dir>}" && cd "$1" && pwd)
|
||||
: "${ELY_GALLERY_ASSETS:?set ELY_GALLERY_ASSETS to the address of <out>/assets/, ending in /}"
|
||||
@@ -10,12 +10,12 @@ wasm-bindgen --version | grep -qx "wasm-bindgen $version" || {
|
||||
exit 1
|
||||
}
|
||||
command -v wasm-opt >/dev/null || { echo "wasm-opt needed: brew install binaryen, or npm i -g binaryen" >&2; exit 1; }
|
||||
# gpui_web's wasm_thread asks for an unstable feature even single-threaded, as Zed's own web build does.
|
||||
# gpui_web's wasm_thread needs an unstable feature, as in Zed.
|
||||
RUSTC_BOOTSTRAP=1 cargo build --example gallery --target wasm32-unknown-unknown --profile web
|
||||
wasm="${CARGO_TARGET_DIR:-target}/wasm32-unknown-unknown/web/examples/gallery.wasm"
|
||||
wasm-bindgen "$wasm" --out-dir "$out" --out-name gallery --target web --no-typescript \
|
||||
--remove-name-section --remove-producers-section
|
||||
# Cloudflare serves no file over 25 MiB; -Oz takes a seventh off, though not off the gzip.
|
||||
# Cloudflare serves no file over 25 MiB; -Oz leaves room.
|
||||
wasm-opt -Oz --enable-bulk-memory --enable-nontrapping-float-to-int --enable-sign-ext \
|
||||
--enable-mutable-globals --enable-reference-types --enable-multivalue \
|
||||
"$out/gallery_bg.wasm" -o "$out/gallery_bg.wasm"
|
||||
|
||||
Reference in new issue
Block a user