chore: release - #10
Open
github-actions[bot] wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@solidjs/image@0.2.0
Minor Changes
3b00d0b: The default output is now WebP and JPEG. The old default listed PNG first, so every browser downloaded PNG, the largest format for photos.
Formats are now offered smallest first, whatever order
outputlists them in. Theimgfalls back to JPEG or PNG, which every browser reads.A transparent image gets PNG in place of JPEG, so its transparent pixels are no longer painted black. An opaque image drops PNG when JPEG is also listed.
f6bdade: Add an opt-in BlurHash preview. Set
placeholder: { type: "blurhash" }in the plugin and installblurhash, which is an optional peer dependency. The number of components is picked per image from its aspect ratio, so there is nothing else to configure.The server paints the average color of the image, and the browser decodes the hash into a blur. Remote images can return
{ hash, color }fromtransformURLand get the same preview.6165dc7: The
imgnow carries asrcsetof the last output format, so a browser that supports none of thesourceformats still picks a sized variant. It used to fall back to the full size original.The original image is no longer imported.
src.sourcepoints at the largest variant of the fallback format, so the untouched original never reaches the bundle.Processed images go through the bundler on build, so
base,assetsDirand the build manifest now apply to them. The dev server still writes them to the public directory.Encoded images are now cached between builds in the Vite cache directory, so a build only encodes images that changed.
sizesnow reaches theimgas well as everysource, since theimgcarries its ownsrcset.SolidImagetakes aneagerprop for the image above the fold. It loads right away instead of waiting for the observer, and the server renders it in full so the browser finds it while parsing the page.Readers with no JavaScript now get the image. The server renders a
noscriptcopy alongside the lazy one.52c7b8c: Local images now ship an inline preview. The plugin emits a downscaled copy as a data URL plus the dominant color, and the component paints it behind the image until it loads. Turn it off with
placeholder: false.SolidImagetakes asizesprop, which is forwarded to everysource. Without it the browser assumes the image spans the full viewport width and downloads a larger variant than it needs.The
fallbackprop is now optional. Leave it out and the image is revealed as soon as it loads.Processed images are cached. The file name now covers the source file, the format, the width and the quality, and an existing file is reused instead of encoded again. Changing the quality no longer serves a stale image.
196c88c: Images are no longer enlarged. Sizes wider than the source are dropped and the source width is used instead, so
srcsetonly lists real widths.Photos are turned upright using their EXIF orientation, and their reported width and height match how they display.
Animated images keep every frame when the output is WebP. Other formats keep the first frame instead of stacking every frame into one image.
JPEG files are smaller at the same quality, and WebP and PNG are compressed harder. The extra encoding time is only paid once, since results are cached.
The build cache now keys on file content instead of modification time, so it still hits after a fresh checkout in CI.
publicPathnow defaults to Vite's public directory, so processed images are reachable on the dev server without setting it.Every
imgnow carries its intrinsicwidthandheight, and thenoscriptcopy usesloading="lazy".ad3867c: AVIF now encodes at quality 50 by default, and other formats at 80. AVIF reaches similar visual quality at a lower number, and the old shared default of 80 made AVIF files several times larger.
qualityalso accepts an object to set formats one by one.Cached files now carry a pipeline version, so a plugin update that changes encoding does not reuse old files. Previews are cached on disk like the variants, each image's file and metadata are read once per build, and cached files unused for a week are removed at startup.
GIF is now a supported input and is processed by default. Animated GIFs keep every frame when the output is WebP or GIF.
An eager image is now preloaded from the head and gets a high fetch priority. Lazy images decode asynchronously by default. Props that are set still win.
Image processing is capped at the number of CPU cores at once. Set
concurrencyto change it.Patch Changes
1d68da6: Images now load. The
imgelement receives the source, and the brokensourceelement that was rendered without a transformer is gone.The shipped stylesheet now matches the rendered markup. Elements are tagged with
data-solid-imageinstead ofdata-start-image.The default image quality is now 80. It was 0.8, which sharp rejects. The
qualityoption is now optional.