-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
chore(open-next): apply various improvements #8304
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
chore(open-next): apply various improvements #8304
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@vicb it would be great if you could have a look and validate the open-next changes if you get a chance 🙂 |
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.
Pull Request Overview
This PR upgrades the @opennextjs/cloudflare package from version 1.6.4 to 1.11.0 and implements enhanced caching and image optimization features for the Cloudflare deployment.
Key changes:
- Upgraded
@opennextjs/cloudflareto version 1.11.0, which includes updated dependencies like@opennextjs/awsand new packages (rclone.js,@types/rclone.js,adm-zip) - Migrated from KV-based caching to R2-based incremental caching with regional cache support and Durable Objects queue
- Added custom Cloudflare image loader to leverage Cloudflare's image transformation service
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updated package versions including @opennextjs/cloudflare (1.6.4→1.11.0), @opennextjs/aws (3.7.4→3.8.5), and added new dependencies (rclone.js, @types/rclone.js, adm-zip) |
| apps/site/package.json | Upgraded @opennextjs/cloudflare dependency specification to ^1.11.0 |
| apps/site/wrangler.jsonc | Replaced KV namespace with R2 bucket configuration and added Durable Objects bindings for queue handling |
| apps/site/open-next.config.ts | Updated configuration to use R2-based incremental cache with regional caching, DO queue, and cache interception |
| apps/site/next.config.mjs | Added conditional image loader configuration to use Cloudflare's custom image loader when deploying to Cloudflare |
| apps/site/cloudflare-image-loader.ts | New file implementing custom image loader for Cloudflare's image transformation service |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8304 +/- ##
==========================================
- Coverage 76.40% 76.37% -0.03%
==========================================
Files 118 118
Lines 9928 9928
Branches 334 335 +1
==========================================
- Hits 7585 7583 -2
- Misses 2341 2343 +2
Partials 2 2 ☔ View full report in Codecov by Sentry. |
93cdecb to
28ccc13
Compare
|
Lighthouse Results
|
vicb
left a comment
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.
Changes look good to me when comments are addressed, thanks Dario!
A few notes:
- Cloudflare images need to be enabled/configured for the account
- R2 batch upload had been implemented recently to speed up cache asset upload. There are a few environment variables to set for this to work. I'll write the doc for it this week. Before that R2 upload could be slow.
|
Thanks Victor for the updates. Will keep an eye on your docs. Also, where can we enabled Cloudflare Images? |
https://developers.cloudflare.com/images/get-started/#enable-transformations-on-your-zone I already did that on the testing/staging account |
opennextjs/docs#189 about R2 batching was just merged to the docs. The 3 environments variables should be added the build time time env vars (provided you use Cloudflare CD). |
28ccc13 to
65b4b4b
Compare
…emove the `build:default` script
… R2 env variables
0192bce to
dbf3b69
Compare
Co-authored-by: Claudio Wunder <[email protected]> Signed-off-by: Dario Piotrowicz <[email protected]>
ovflowd
left a comment
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.
LGTM!
|
|
@ovflowd regarding the image loader documentation, I've added a very fried section in the md file with a link to the cloudflare docs: dbf3b69 as I didn't feel like more was needed, but please let me know if you think that this might not suffice 🙂 |
Thanks @ovflowd! Sorry this PR took a while! 😅 |
Yeah, if it has a link to other external resources (if any available) that'd be good, except that. Feel free to merge the PR
You good! Appreciate for the patience here ❤️ |
|
I've enabled auto-merge 🙂 @avivkeller could you go back to the unresolved conversations you started and make sure you're happy where we landed, and in that case resolve the conversations? 🙂 |
Description
This PR adds various open-next improvements to the site (mainly for better performance)
The changes are:
@opennextjs/cloudflareto the latest version (1.12.0)--turbo🚀build:defaultscriptValidation
I've validated these changes locally by running
pnpm cloudflare:previewThe workflow running on this PR also validates the open-next build.
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.