Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: support Astro _image endpoint#94

Merged
ascorbic merged 4 commits into
ascorbic:mainfrom
jlarmstrongiv:main
Dec 5, 2023
Merged

feat: support Astro _image endpoint#94
ascorbic merged 4 commits into
ascorbic:mainfrom
jlarmstrongiv:main

Conversation

@jlarmstrongiv

Copy link
Copy Markdown
Contributor

Closes #93

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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.

Comment thread src/transformers/astro.test.ts
Comment thread src/transformers/astro.ts Outdated
@jlarmstrongiv

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

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

Comment thread src/transformers/astro.ts Outdated
Comment thread src/utils.ts Outdated
@jlarmstrongiv

Copy link
Copy Markdown
Contributor Author

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

@jlarmstrongiv

Copy link
Copy Markdown
Contributor Author

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

@jstormail2

Copy link
Copy Markdown

@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

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks!

@ascorbic ascorbic merged commit b015190 into ascorbic:main Dec 5, 2023
@mixie-bot mixie-bot Bot mentioned this pull request Dec 5, 2023
@jlarmstrongiv

Copy link
Copy Markdown
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: support Astro transformer

3 participants