Page MenuHomePhabricator

[e.cash] add image sharp package
ClosedPublic

Authored by johnkuney on Jul 25 2023, 04:40.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC3f1ebc4b939c: [e.cash] add image sharp package
Summary

I noticed some images are taking a bit long to load, particularly on blog pages.
This package is recomended from next to compliment their image optimization, and hopefully cut down on some load times

Test Plan

preview the site and see if images feel faster

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Any link to the source you mention in the summary ? It looks weird to me that adding a module does magic without any config, also I have no idea how this works and I want to check.

Any link to the source you mention in the summary ? It looks weird to me that adding a module does magic without any config, also I have no idea how this works and I want to check.

Yep my bad, I noticed in the build logs it recommends it and points to this page https://nextjs.org/docs/messages/sharp-missing-in-production

I'm a bit skeptical too, but apparently you just add it and... magic ha

Screen Shot 2023-07-25 at 11.26.26 AM.png (762×3 px, 490 KB)

bytesofman added a subscriber: bytesofman.

ran npm run build on diff and no sharp warning, uninstalled sharp and got warning

apart from the lack of warning, I don't see any difference in the build size.

.next/static/media after each build, the svg and png files are the same size

.... so... not entirely clear if this provides any benefit at this time (mb it only helps with jpgs?)

However, next docs do recommend it as better for prod, and it does make sense that they would select other tradeoffs for npm run dev vs deployments (spend less time optimizing assets as you are kind of redeploying every second or so in the dev environment, more important to see behavior / feature changes in real time than loaded images).

This revision is now accepted and ready to land.Jul 25 2023, 19:00
This revision was automatically updated to reflect the committed changes.