-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Responsive Images #124
base: main
Are you sure you want to change the base?
Responsive Images #124
Conversation
to avoid upstream rate-limiting timeout (504)
This branch is running in CodeSandbox. Use the links below to review this PR faster. |
...metadata, | ||
})) | ||
assets.map(({ value, ...rest }, i) => | ||
batchDelay(i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Demo App Preview: https://d11mwnosflssyy.cloudfront.net/ |
Code Coverage ReportCoverage after merging batch-asset-download into main
Coverage Report
|
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2aa6bfc. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
@@ -0,0 +1,5 @@ | |||
/** Customizable Configuration for the Generator */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This config can be reused to configure the generator based on project needs, e.g. as an alternative to special tokens
"src/", | ||
"./generator-config.ts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publish config
.resize( | ||
width === 'full' // full res version | ||
? undefined | ||
: { | ||
// resize to max-size, this might sometimes create duplicates, | ||
// if the source image is small, but this makes the | ||
width: width, | ||
height: width, | ||
fit: 'inside', | ||
withoutEnlargement: true, | ||
} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resize based on config and combine with full-res version
src={src} | ||
{...srcToSrcSet(src)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use helper to auto-generate sourceset
Michael was unhappy with something in this commit. Unfortunately I have no recollection of what the issue was.
Largest resolution
Smaller resolution
Also added batching of asset download to work around rate-limiting issues.