Add image optimization guide and playground example#1045
Open
joefairburn wants to merge 2 commits intoredwoodjs:mainfrom
Open
Add image optimization guide and playground example#1045joefairburn wants to merge 2 commits intoredwoodjs:mainfrom
joefairburn wants to merge 2 commits intoredwoodjs:mainfrom
Conversation
47b1c28 to
90db000
Compare
Member
|
This might be best as a community playground, then you don't have to have tests for it. Since it's 3rd party functionality that's OK. |
41f4654 to
880bc40
Compare
Contributor
Author
Absolutely - moved it to community now! |
Add guide for using Cloudflare Images with a reusable <Image> component, covering static files, R2 buckets, and external origins.
Adds a community playground demonstrating responsive image optimization using Cloudflare Image Transformations and a custom <Image> component with srcSet generation, priority loading, fill mode, and an unoptimized escape hatch for SVGs.
880bc40 to
ae218d9
Compare
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.
Summary
docs/guides/frontend/images.mdx) covering image optimization with Cloudflare Image Transformations and a responsive<Image>componentplayground/imagesexample demonstrating the guide in a working RedwoodSDK appWhat's in the playground example
/_image/*transform route — Worker route that reads?w=and?q=query params, rewrites the path to a static file, and fetches withcf.imageoptions (width, quality, scale-down fit)<Image>component — Responsive React component that generatessrcSetentries across common device widths (640–3840px), capped at 2x the base width. Supportsfillmode,priorityloading (eager+fetchpriority="high"), and anunoptimizedescape hatch for SVGsTest plan
npm run checkpasses (types clean)npm run buildsucceeds