Commit activity
Last 12 weeks · 18 commits
Community health
4 of 6 standards met
Recent fixes
The dev server now encodes a variant only when the browser requests it. A cold page in waits for 3 files instead of 40. Previews, concurrent loads and scrolling with many images also do less work. Unused helpers are removed. Changes middleware serves and encodes the file on its first request. The module only records how to encode it. Variants and previews are computed once when the client and server environments ask for them at the same time. writes to a temporary file and renames it, so a parallel build never reads a partial file. The preview dominant color is read from a 400px copy. ignores , so the copy goes through raw pixels first. Lazy images share one per . , and are removed. The type moved to . Proof : 209 passed (188 node, 21 browser). New test for concurrent requests. It fails when the dedup is removed (2 writes instead of 1). New browser test: 3 images with 2 margins create 2 observers, and all 3 images still load. Checked in a real dev server on with Chromium. Every variant returned 200 with the right , and all images loaded. Cost Measured on an 8-core Mac. Fixtures are the 5 example photos, 4 copies upscaled to 6000px and one 1200px transparent PNG. Runs are interleaved, median of 6 to 8. Measured and not applied: Decoding each source once and resizing every variant from that copy saves 12% to 19% of build encode time. It needs raw buffers held in memory, eviction, and a cache version bump because output bytes change. Caching decoded BlurHash previews. A decode costs 0.2 ms. Checking transparency on a smaller copy. Averaging can hide a single transparent pixel, and that image would get JPEG with black where the transparency was. Risk The dominant color for 3 of the 10 fixtures moved one histogram step. Cached previews keep their old color, since the cache version is unchanged. Dev variants are served with . The name contains a content hash. The middleware matches the whole file name, so a request cannot reach outside . differs on , so merging into will conflict there. Everything under is the same on both branches. 🤖 Generated with Claude Code
Moves the pnpm version from the workflows to the field in . reads when is not set, so CI uses the same version as before. pnpm switches to this version locally too, so contributors and CI install with the same pnpm. The version now lives in one place instead of in every setup step. The workflow pinned only the major, so this uses its latest release. Checked locally: workflow YAML parses, and in the repo reports 12.15.0. 🤖 Generated with Claude Code
Summary Adds opt-in ThumbHash placeholders alongside the existing inline image and BlurHash previews. is an optional peer dependency and is only imported when this preview type is enabled. Why ThumbHash is a useful alternative to BlurHash because it: has a compact binary representation; supports transparency; includes an approximate aspect ratio; does not require component-count configuration. This implementation keeps the hash as a , matching the upstream API instead of introducing an internal base64 representation. Implementation Add to the Vite plugin placeholder options. Encode local images with from an EXIF-corrected, max-100px RGBA sample. Preserve alpha in the server-side average placeholder color. Decode in the browser with . Keep independent of ; generated modules inject the decoder only when needed. Support ThumbHash placeholders from . Serialize cached/remote hash bytes as arrays and restore them to in generated modules. Keep the existing BlurHash API unchanged; string hashes remain BlurHash, binary hashes are ThumbHash. Add a ThumbHash example, docs, tests, and a minor changeset. Testing Validated with: frozen ; package build; all example builds; Node tests; Playwright Chromium browser tests. Coverage includes local and remote placeholders, EXIF orientation, the 100px encoding limit, alpha-aware colors, restoration, decoder injection, browser decoding, and preview cleanup after image load.
Repository: solidjs/solid-image. Description: Image component Stars: 8, Forks: 1. Primary language: TypeScript. Languages: TypeScript (99.6%), CSS (0.4%). License: MIT. Latest release: @solidjs/image@0.4.0 (3w ago). Open PRs: 1, open issues: 0. Last activity: 1w ago. Community health: 75%. Top contributors: lxsmnsyc, github-actions[bot], birkskyum, subframe7536.