-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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(assets): Allow users to set a custom endpoint to use for image optimization #8467
Conversation
🦋 Changeset detectedLatest commit: eeabe3e The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
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.
Thanks @Princesseuh! Just a couple of docs notes from me.
* { | ||
* image: { | ||
* // Example: Use a custom image endpoint | ||
* endpoint: './src/image-endpoint.ts', |
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.
Do we have docs we could link to for what the contents of image-endpoint.ts
should look like?
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.
We don't, but there's kinda no defined shape for it, it's a normal endpoint, you can technically answer anything you want from it.
Co-authored-by: Chris Swithinbank <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
Changes
What the title says!
Q: Why do we need this?
A: It unlocks the ability for adapters to set a endpoint that's more suited to their platform. For instance, maybe the Deno adapter would set an endpoint that uses
Deno.readFile
instead of using afetch
. We don't have those endpoints yet, but we could with this!In addition, this is a nice things for users who want more control over the endpoint, especially in SSR you might want to use an empty endpoint or something to avoid having the image service bundled in completely.
This is ultimately a stepping stone to fix those three issues:
<Image>
component when transforming local images #5699Testing
Added a test
Docs
Added docs!