Skip to content
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

Merged
merged 5 commits into from
Sep 21, 2022
Merged

Allow passing fetch() Response to set:html #4832

merged 5 commits into from
Sep 21, 2022

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Sep 21, 2022

Changes

Testing

  • New test cases added in packages/astro/test/set-html.test.js for all scenarios.

Docs

@changeset-bot
Copy link

changeset-bot bot commented Sep 21, 2022

🦋 Changeset detected

Latest commit: 4cf67b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
astro Minor
@e2e/astro-component Patch
@e2e/error-cyclic Patch
@e2e/error-react-spectrum Patch
@e2e/error-sass Patch
@e2e/errors Patch
@e2e/hydration-race Patch
@e2e/lit-component Patch
@e2e/preact-component Patch
@e2e/react-component Patch
@e2e/solid-component Patch
@e2e/solid-recurse Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution Patch
@e2e/third-party-astro Patch

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

@matthewp matthewp added the semver: minor Change triggers a `minor` release label Sep 21, 2022
@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Sep 21, 2022
@matthewp matthewp changed the title ALlow passing fetch() Response to set:html Allow passing fetch() Response to set:html Sep 21, 2022
```
* `Iterable`s (non-async):
```astro
<div set:html={(function * () {
Copy link
Member

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[] = [];
Copy link
Member

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?

Copy link
Member

@Princesseuh Princesseuh left a 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

Copy link
Contributor

@tony-sull tony-sull left a 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 👍

packages/astro/src/runtime/server/jsx.ts Outdated Show resolved Hide resolved
@matthewp matthewp merged commit 73f215d into main Sep 21, 2022
@matthewp matthewp deleted the astro-unescape branch September 21, 2022 23:07
@astrobot-houston astrobot-houston mentioned this pull request Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oddities rendering ReadableStream
4 participants