-
-
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
Allow passing fetch() Response to set:html #4832
Conversation
🦋 Changeset detectedLatest commit: 4cf67b5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
``` | ||
* `Iterable`s (non-async): | ||
```astro | ||
<div set:html={(function * () { |
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.
generators!
@@ -141,12 +142,12 @@ export async function renderJSX(result: SSRResult, vnode: any): Promise<any> { | |||
); | |||
} | |||
if (typeof output !== 'string' && Symbol.asyncIterator in output) { | |||
let body = ''; | |||
//let parts: Uint8Array[] = []; |
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.
Seems like a left over 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.
Seems good to me, just a nit about a left over 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.
Now that's fancy, set:html
now has support for all the different forms of async data 🚀
LGTM 👍
Changes
<Fragment set:html={fetch('/posts/legacy-post.html')} />
and more.ReadableStream
#4828Testing
packages/astro/test/set-html.test.js
for all scenarios.Docs