Skip to content

feat: make edge image opt-in instead of opt-out #1935

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

Merged
merged 15 commits into from
Mar 1, 2023
Merged

feat: make edge image opt-in instead of opt-out #1935

merged 15 commits into from
Mar 1, 2023

Conversation

sarahetter
Copy link

@sarahetter sarahetter commented Feb 22, 2023

Summary

Makes edge ipx opt-in instead of opt-out. Does not deprecate any of the old IPX related env vars, such as NEXT_DISABLE_EDGE_IMAGES or DISABLE_IPX
To use edge images, you must set NEXT_FORCE_EDGE_IMAGES=true. IPX is created as a regular Netlify Function by default, and will not be run on the edge.

@stephmarie17 can you please check my updates to the README file?

Test plan

  1. Run NEXT_FORCE_EDGE_IMAGES=true ntl deploy --build on the default demo, go to logs and check that the next/image handler edge function exists
  2. Run ntl deploy --build on the default demo, go to logs, and check that the next/image handler edge function does not exist
  3. Check default demo /image route, make sure images are showing up - (this is not running on the edge anymore, but images should still appear)

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

Closes https://github.com/netlify/pod-ecosystem-frameworks/issues/342

Screenshot 2023-02-23 at 11 39 47 AM

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality
  • Add docs when necessary

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@sarahetter sarahetter requested a review from a team February 22, 2023 21:49
@netlify
Copy link

netlify bot commented Feb 22, 2023

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit 147a3a0
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/63ffc185aa5ca10007573698
😎 Deploy Preview https://deploy-preview-1935--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 22, 2023

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit 147a3a0
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/63ffc185b134da0008d4e6aa
😎 Deploy Preview https://deploy-preview-1935--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 22, 2023

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit 147a3a0
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/63ffc185562edd00080651af
😎 Deploy Preview https://deploy-preview-1935--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 22, 2023

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit 147a3a0
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/63ffc1850dfb2e0008c0a6c8
😎 Deploy Preview https://deploy-preview-1935--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 22, 2023

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit 147a3a0
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/63ffc185d2182a000864ea11
😎 Deploy Preview https://deploy-preview-1935--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 22, 2023

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 147a3a0
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/63ffc1854ddd0900085e3f77
😎 Deploy Preview https://deploy-preview-1935--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 22, 2023

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 147a3a0
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/63ffc185a562e10008638dbe
😎 Deploy Preview https://deploy-preview-1935--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 22, 2023

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit 147a3a0
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/63ffc1857522160008a09e1a
😎 Deploy Preview https://deploy-preview-1935--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Feb 22, 2023

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit 147a3a0
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/63ffc1853ef323000787ad07
😎 Deploy Preview https://deploy-preview-1935--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sarahetter sarahetter changed the title Make edge image opt-in instead of opt-out feat: make edge image opt-in instead of opt-out Feb 23, 2023
@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Feb 23, 2023
Copy link

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested things out and it works great:

  • The default demo site loads all the images as expected.
  • with opt-in set to true we have ipx for edge
 5. Edge Functions bundling                                    
────────────────────────────────────────────────────────────────

Packaging Edge Functions from .netlify/edge-functions directory:
 - ipx
 - next_app_app_edge_page
 - next_pages_api_og
 - next_pages_edge__id_
 - rsc-data

(Edge Functions bundling completed in 2.3s)
  • and without edge for ipx when opt-in is not enabled (default)
5. Edge Functions bundling                                    
────────────────────────────────────────────────────────────────

Packaging Edge Functions from .netlify/edge-functions directory:
 - next_app_app_edge_page
 - next_pages_api_og
 - next_pages_edge__id_
 - rsc-data

(Edge Functions bundling completed in 1.2s)

:shipit:

Copy link

@stephmarie17 stephmarie17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few small suggestions in the README. Looks good!

sarahetter and others added 5 commits February 28, 2023 15:09
Co-authored-by: Stephanie <[email protected]>
Co-authored-by: Stephanie <[email protected]>
Co-authored-by: Stephanie <[email protected]>
Co-authored-by: Stephanie <[email protected]>
Co-authored-by: Stephanie <[email protected]>
@kodiakhq kodiakhq bot merged commit 7a63d2f into main Mar 1, 2023
@kodiakhq kodiakhq bot deleted the opt-in branch March 1, 2023 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants