Files
egui/scripts/wasm_bindgen_check.sh
David MannandClaude Opus 5.5 eabac81511 Make next's CI green again: format, spelling, clippy, cargo-deny and the web demo build (#66)
* Make next's CI green again

The checks on `next` fail for every pull request, for reasons that have
nothing to do with the pull requests themselves:

- Format: rustfmt in two eframe web files, taplo in two manifests.
- Typos: British spellings; a test table of words cut into pieces is
  fenced off with `spellchecker:off`/`on`.
- Clippy with `-D warnings`: `map_or` with a call, a single-pattern
  `match`, needless borrows, the deprecated `Id::new` in a test, hash
  iteration in tests and the text_perf example, and a `dead_code`
  expectation that test builds don't fulfil.
- scripts/lint.py: blank lines, `#[inline]` on builder methods, and
  `core::iter::zip`/`chain` instead of `.zip(`/`.chain(`.
- cargo-deny: update tokio, url, rustls-webpki and webpki-roots past
  their advisories, allow the storytold/winit git source, and allow the
  path wildcard of egui_extras' egui_kittest dev-dependency.
- Web demo: eframe now has an inline JS snippet, which wasm-bindgen
  can't emit with `--no-modules`, so the demo and the wasm-bindgen check
  use `--target web` and the pages load it as an ES module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use AsyncFd::register in the async example and refresh stale snapshots

tokio 1.54 deprecates `AsyncFd::new` (RUSTSEC-2026-0386), which fails the
example's clippy run under `-D warnings`. Register an owned duplicate of the
event loop's fd instead, as #46 does on main.

Eleven kittest snapshots no longer matched on the macOS runner: the pointer
arrow in the checkbox and button snapshots, a one-pixel tooltip edge, and the
right edge of the italics frame. They went stale while the test binaries did
not compile; this takes the runner's renders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix a broken intra-doc link in TextEditCursorPurpose

`cargo doc --document-private-items` with `-D warnings` can't resolve
`Self::preedit_range` on an enum variant's field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 21:33:01 -05:00

42 lines
867 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$script_path/.."
if [[ $* == --skip-setup ]]
then
echo "Skipping setup_web.sh"
else
echo "Running setup_web.sh"
./scripts/setup_web.sh
fi
CRATE_NAME="egui_demo_app"
FEATURES="wgpu,http,persistence"
echo "Building rust…"
BUILD=debug # debug builds are faster
(cd crates/$CRATE_NAME &&
cargo build \
--quiet \
--lib \
--target wasm32-unknown-unknown \
--no-default-features \
--features ${FEATURES}
)
TARGET="target"
echo "Generating JS bindings for wasm…"
rm -f "${CRATE_NAME}_bg.wasm" # Remove old output (if any)
TARGET_NAME="${CRATE_NAME}.wasm"
wasm-bindgen "${TARGET}/wasm32-unknown-unknown/$BUILD/$TARGET_NAME" \
--out-dir . --target web --no-typescript
# Remove output:
rm -f "${CRATE_NAME}_bg.wasm"
rm -f "${CRATE_NAME}.js"