ascorbic / unpic

Universal image CDN translator
https://unpic.pics/lib
280 stars 31 forks source link

feat: support Astro _image endpoint #94

Closed jlarmstrongiv closed 8 months ago

jlarmstrongiv commented 9 months ago

Closes https://github.com/ascorbic/unpic/issues/93

jlarmstrongiv commented 9 months ago

Hey! Thanks for this. We just need a few things to get this ready to merge.

As well as the individual comments, framework transformers need to implement delegateUrl. This is needed so that if the user passes a URL with an href that matches another CDN, we use that instead of the local server. Take a look at the Next.js tests for examples.

Sure! I think the delegateUrl function that next and vercel uses looks good to me, so I moved it to utils and used it for astro too

jlarmstrongiv commented 9 months ago

Just wanted to say thank you for your help reviewing this PR @ascorbic ๐Ÿ‘ great suggestions

jlarmstrongiv commented 9 months ago

I fixed those issues and squashed to a single commit ๐Ÿ‘

jlarmstrongiv commented 9 months ago

Hi @ascorbic ๐Ÿ‘‹ please let me know if thereโ€™s anything else I need to fix with this PRโ€”thanks again for reviewing ๐Ÿ‘

jstormail2 commented 8 months ago

@ascorbic and @jlarmstrongiv are there any blockers for this PR? I found unpic-img has an astro component, and wanted to use it with the astro assets image endpoint in my project

jlarmstrongiv commented 8 months ago

Thank you @ascorbic ! Your suggestions were very helpful ๐Ÿ˜„