All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Web Worker offloading — WASM encoding now runs off the main thread via a dedicated module Worker (
optimizer.worker.ts), with automatic fallback to main-thread execution in SSR/Node.js environments. Eliminates jank on encode-heavy pages. workerBridge.tssingleton — shared Worker instance across alluseImageOptimizerhook invocations; input buffers transferred asTransferable(zero-copy) to avoid doubling memory on large images.- SIMD128 WASM optimization —
target-feature=+simd128applied via.cargo/config.tomlscoped towasm32-unknown-unknownonly. ~2× faster encoding on Chrome 91+, Firefox 89+, Safari 16.4+. - Docker multi-stage build for
snapbolt-server(packages/server/Dockerfile) — Alpine-based, statically linked via musl, final image ~15 MB. No OpenSSL dependency. - macOS Intel (x64) CLI binary —
@thinkgrid/snapbolt-cli-darwin-x64now listed inoptionalDependencies; npm installs the correct binary automatically on Intel Macs. - Comprehensive test suite — 37 TypeScript unit tests across
useImageOptimizer,SmartImage, andworkerBridge; additional Rust unit tests forsnapbolt-core(resize variants, quality boundaries, AVIF error, format coverage) andsnapbolt-cli(directory scanning, subdirectory recursion, non-image skipping, valid PNG → WebP output). tsconfig.test.json— separate TypeScript config for test files withnodetypes andwebworkerlib, scoped tosrc/**/*.test.*.vitest.config.ts— explicit Vitest config withjsdomenvironment andtsconfig.test.jsonreference.benchmarks/run.js— Node.js benchmark script; measures per-image optimization time and size savings using@thinkgrid/snapbolt-cli.
SmartImagepreload link cleanup — changeddocument.head.removeChild(link)tolink.remove()in the priorityuseEffectcleanup. PreventsNotFoundError(DOM code 8) when test cleanup order is non-deterministic.- CI
macos-13removed — GitHub deprecated themacos-13runner. Bothci.ymlandrelease.ymlnow cross-compiledarwin-x64frommacos-latest(ARM64) by passing--target x86_64-apple-darwintonapi build. - TypeScript build error —
"webworker"added totsconfig.jsonlibarray, resolvingCannot find name 'DedicatedWorkerGlobalScope'(TS2304) in CIbuild:tsstep.
tsconfig.jsonlibarray expanded:["dom", "dom.iterable", "esnext", "webworker"]- CI
clijob matrix converted from simpleoslist to explicitincludeentries withtargetfields, matching the release workflow.
- CLI
optionalDependenciesmissing —packages/cli/package.jsonwas not listing any platform sub-packages, sonpm install @thinkgrid/snapbolt-clinever downloaded the native.nodebinary on any platform. Added all 18 platform entries. Most visibly affected macOS Intel users. - GitHub Actions release workflow —
build-climatrix was only buildingdarwin-arm64(macos-latest). Added explicitdarwin-x64matrix entry targetingx86_64-apple-darwin. - Scope rename — all package names updated from
@think-grid-labs/*to@thinkgrid/*acrosspackage.jsonfiles, import paths, and documentation.
SmartImageReact component with two rendering modes:- Server mode — builds
src,srcset(responsive), andsizesURLs pointing at snapbolt-server or the Next.js handler - WASM mode — falls back to client-side encoding when no
serverUrlis configured; shows shimmer skeleton while encoding
- Server mode — builds
SnapboltProvidercontext —serverUrl,defaultQuality,defaultFormat,breakpointspropsfillprop — absolute positioning +object-fit: cover, mirroringnext/image's fill behaviour- Blur placeholder —
placeholder="blur"+blurDataURLwith CSS fade-out transition after the main image loads priorityprop — setsfetchpriority="high",loading="eager", and injects<link rel="preload">intodocument.headfor LCP images- Per-image
serverUrloverride — bypasses the provider value for a singleSmartImageinstance snapbolt-serverstandalone Axum HTTP microservice:GET /image?url=&w=&h=&q=&fmt=endpoint- moka LRU in-memory cache (configurable size)
- SSRF protection via
ALLOWED_DOMAINSenv var - Content-Negotiation: serves AVIF when
Accept: image/avifis present, otherwise WebP GET /healthendpoint
- Next.js API route handler —
export { GET } from '@thinkgrid/snapbolt/handler'; one-line integration with no config required useImageOptimizerhook improvements —cacheoption (Cache API, defaulttrue),crossOriginoption,width/heightcanvas resize before encoding
useImageOptimizernow accepts an options object as the second argument in addition to a plain quality number:useImageOptimizer(src, { quality: 80, width: 1200 })
snapbolt-coreRust crate —optimize_buffer()supporting WebP output (nativelibwebp-sysin native builds, pure-Rustimagecrate encoder in WASM), JPEG, and PNG; Lanczos3 resizesnapbolt-cliNAPI addon —optimizeImage(buffer, quality?, width?, height?, format?)andoptimizeDirectory(path)Node.js exports; Rayon parallel directory processing- WASM build via
wasm-packtargetingwasm32-unknown-unknown; exportsoptimize_image_sync(bytes, quality)anddefaultinit function useImageOptimizerhook (initial version) — URL string source only; fetch → WASM encode →blob:URL- Monorepo structure —
packages/core,packages/cli,packages/snapbolt,packages/serverwith npm workspaces - GitHub Actions — CI (
ci.yml) and release (release.yml) workflows