-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
devexTicket that can be managed by developer advocate without dev teamTicket that can be managed by developer advocate without dev team
Milestone
Description
As a developer
I want to write async JSX components on the server
In order to use functions I don't control
Notes
Provide any useful information (Technical, Design)
https://www.graalvm.org/latest/reference-manual/js/JavaInteroperability/#promises
Here is an example of an async component:
async function Comp() {
const value = await Promise.resolve(42);
return <strong>{value}</strong>
}The goal of this story is to be able to render it in a JSX view/template on the server.
Technical notes
There are two levels of async support:
- Easy mode: only allow the template/view function to be async, and await it before piping the result to
renderToString - Hard mode: figure out a way to use
renderToStreamand reconstruct the HTML tree
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
devexTicket that can be managed by developer advocate without dev teamTicket that can be managed by developer advocate without dev team