v0.4.0
Two major features land in this release: on-demand image transforms and a reworked font pipeline. Both are breaking (the workspace is pre-1.0), so check Migration below.
On-demand image transforms — @pro-laico/images
@pro-laico/images is now a full on-demand image pipeline. Uploads store only the original; there's no fixed size ladder. The first time a page asks for a given size, a Sharp-backed endpoint (/api/img/:id) resizes and crops it to the image's focal point, streams it back same-origin with immutable cache headers, and caches the result in a new hidden generatedImages collection so it's only ever built once.
Render with the bundled <ResponsiveImage> component, a plain <img> whose srcset points at the endpoint (no next/image), in server or client trees:
<ResponsiveImage image={image} aspectRatio="16:9" sizes="(max-width: 768px) 100vw, 50vw" />Highlights:
- Focal-point cropping with an admin picker whose live ratio previews match the rendered crop exactly.
- Built-in blur placeholders generated on upload, replacing the
@oversightstudio/blur-data-urlspeer. Tune or disable with thebluroption. - Correct cache invalidation: every URL carries a version token derived from the file + focal point, so editing either busts immutable browser/CDN caches, and stale cached variants are purged automatically (and via a "Purge variants" button).
- A new standalone
images-onlyexample app to see it in isolation.
Font typefaces & optimize-on-upload — @pro-laico/fonts
A font is now one typeface that holds its weight/style files (Regular, Bold, Italic, …) through a new fontFile upload collection, fed to next/font/local as a single family.
- Optimize-on-upload (
fontsPlugin({ optimize: true })): each weight is subset to a WOFF2 on save (defaultlatincharset), the untouched original is archived infontOriginal, weight/style/family are auto-detected viafontkit, and the size reduction is reported.subset-font+fontkitship bundled (no consumer install). - A premium drag uploader replaces the native upload UI: drop one or many files, get a client-side preview with duplicate detection, assign roles, and save. Files are staged and only written on save, so abandoning a draft leaves no orphans.
Breaking changes & migration
@pro-laico/images
Imagesno longer pre-generates WebPimageSizes(stores the original only). On SQL adapters this drops the old size columns; setpregenerateSizes: trueto restore the legacy ladder.- Removed: the
@oversightstudio/blur-data-urlspeer (blur is built in). - The
ImageChildblock renders<ResponsiveImage>instead ofnext/image. Migrate by rendering through<ResponsiveImage>and dropping anyblurDataUrlsPluginwiring. - New setup: pass
sharptobuildConfig, add'sharp'toserverExternalPackages, setNEXT_PUBLIC_SERVER_URL, and registergeneratedImageswith your storage adapter (server-side uploads).
@pro-laico/fonts
- A
fontis now a non-upload typeface (previously one upload = one weight). Role slots become a singlerelationship → font; weight files live in the newfontFilecollection;optimize/staticDir/mimeTypesmove fromfontOptionstofontFileOptions. TheGET /api/fonts/exportshape is unchanged. Migrate by re-pointing each role at a typeface id and regenerating types. - With
optimizeon: registerfontFile+fontOriginalfor server-side uploads and add['subset-font', 'harfbuzzjs', 'fontkit']toserverExternalPackages.
All @pro-laico/* packages share this version (lockstep 0.4.0). Compare: v0.3.4...v0.4.0.