From fc24a569c61d6320d99436afa588d08511b038e2 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 20 Aug 2026 10:47:21 +0000 Subject: [PATCH] Public-release prep: refresh build sizes in docs, add CI README and docs/API.md still quoted the pre-terser-pass sizes (15.7/8.8 KB); the artifacts are 15.5 KB (7.4 gz) and 8.5 KB (4.5 gz) now. The new workflow runs the full test matrix (source, min, tiny, renamed builds) on pushes and pull requests, and fails if dist/ was not rebuilt after a change to src/ or tools/. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_015piLaxMdBsDLcyHRLSzKWK --- .github/workflows/test.yml | 21 +++++++++++++++++++++ README.md | 8 ++++---- docs/API.md | 4 ++-- 3 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..8cc419b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,21 @@ +name: test + +on: + push: + branches: [main] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm install + - run: npm run test:all + # the built artifacts are committed (the demo pages load them) — fail if a + # change to src/ or tools/ was pushed without rebuilding dist/ + - run: npm run build + - run: git diff --exit-code -- dist diff --git a/README.md b/README.md index 5d2811d..98519f2 100644 --- a/README.md +++ b/README.md @@ -290,7 +290,7 @@ each facet derives its own normal so the shading is flat. ## Minified build -`dist/tinywebgpu.min.js` — **15.7 KB** (7.7 KB gzipped), versus 91 KB for the source. Rebuild it with +`dist/tinywebgpu.min.js` — **15.5 KB** (7.4 KB gzipped), versus 91 KB for the source. Rebuild it with `npm run build:min` (esbuild is the only dev dependency; consumers still install nothing). It is a **production artifact and it is silent**: every `console` warning is stripped, and so are @@ -306,10 +306,10 @@ accident. ## Tiny build (inline / on-chain embedding) When the library has to be *inlined* — a single self-contained HTML file, an on-chain generative -artwork with a hard byte budget — 15.7 KB of it is still mostly features you are not using. A +artwork with a hard byte budget — 15.5 KB of it is still mostly features you are not using. A procedural piece renders from a shader and never touches image loading, readback, or PNG export. -`npm run build:tiny` produces **`dist/tinywebgpu.tiny.js` — 8.8 KB** (4.6 KB gzipped) by dropping +`npm run build:tiny` produces **`dist/tinywebgpu.tiny.js` — 8.5 KB** (4.5 KB gzipped) by dropping every optional entry point, and adding `--iife --no-banner` gets a classic `