-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
🎉 Cloudflare images #4214
🎉 Cloudflare images #4214
Conversation
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2024-11-29 21:55:45 UTC |
2d8a8e0
to
deda2e9
Compare
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.
Great work! I'm happy we are finally doing this.
- Too bad we didn't talk about this sooner, but I think it would make sense to use the official TS library for Cloudflare API instead of making the raw fetch requests for some more (type) safety and a nicer DX.
- Will the existing old image URLs keep working at least for a few months, ideally indefinitely? I'm thinking about the atom feeds and newsletters, at least the DI newsletter references the image URL directly. And who knows how many links in the wild point to one of our images. I think it would be worth to spend a few hours on this if necessary.
- This wasn't too bad, but I'd appreciate it if a feature like this was split into multiple smaller PRs in the future, which would be easier to review.
const { admin } = useContext(AdminAppContext) | ||
const [images, setImages] = useState<DbEnrichedImage[]>([]) | ||
const [filenameSearchValue, setFilenameSearchValue] = useState("") | ||
const api = useMemo( |
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 is an unusual usage of useMemo
. Is there a reason why we do this? It doesn't seem like we really need it, and if we do, useCallback
would be IMO nicer.
Hey there! Just a drive by comment as I got an email about Martin's review. I'd be in favour of polishing this quite a bit - I think it would be nice if we don't have to touch images for a long time after this :) |
95bfa84
to
095aff1
Compare
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.
A really nice improvement! 🎉
Aside from small issues I slacked you about, the main piece of feedback is around possible benefits of checksums in the images
table.
f559b0c
to
4e88784
Compare
ecd06dd
to
24576e2
Compare
Adds support for Cloudflare Images
Drops support for Gdrive Images
Project checklist
Can be QA'd on staging, or locally with the following steps:
yarn runDbMigrations
yarn syncCloudflareImages
Images can now be created, updated, and deleted in the admin, under
/admin/images
All environments share the same "prod" cloudflare images space, so it's okay to delete the images that are currently uploaded now, but eventually we'll have to be careful not to delete images in prod from our local & staging environments 😬
TODO
googleId
from the images table and type definitions once this PR has proven to be stable