-
Notifications
You must be signed in to change notification settings - Fork 233
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
feat: Add imagesDimensions field. #1059
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
📦 Next.js Bundle Analysis for xlogThis analysis was generated by the Next.js Bundle Analysis action. 🤖
|
Page | Size (compressed) |
---|---|
global |
88 KB (🟡 +11 B) |
Details
The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.
Any third party scripts you have added directly to your app using the <script>
tag are not accounted for in this analysis
If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!
WHAT
🤖[deprecated] Generated by Copilot at 3fc91b6
This pull request adds functionality to detect and store the dimensions of images that are part of the metadata content for pages and feed items. It uses the
image-size
package as a dependency and modifies the database schema, the Prisma schema, the API routes, and the types to handle the image dimensions. It also adds a helper functiondecoratePageForImageDimensions
to fetch and add the dimensions from the image files.🤖[deprecated] Generated by Copilot at 3fc91b6
WHY
Now, The
/api/feed
and/api/pages
api could include the image dimensions field. The client could use this field to better display the cover image in some situations, such as in the masonry list.Caching image dimensions
/api/feed
Fetching result:/api/pages
Fetching result:HOW
🤖[deprecated] Generated by Copilot at 3fc91b6
image-size
package as a dependency to get image dimensions (link, link, link, link)image_dimensions
column toMetadata
table in database schema (link, link)imageDimensions
property toExpandedNote
type (link)src/queries/page.server.ts
(link, link, link)decoratePageForImageDimensions
function in feed and pages routes to add image dimensions to metadata content (link, link, link, link)CLAIM REWARDS
For first-time contributors, please leave your xLog address and Discord ID below to claim your rewards.