You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for async components. This doesn't make much sense in pure client components and results in janky interactions (the component pops into existence after the async task), but
Components can be purely server-side, which this is pretty essential,
Minicomp isn't the kind of library to decide on UX of stuff built with it.
Async Rendering
So what should be possible is something like this:
If the component function returns a promise, then the content should be added to the host when that promise is resolved.
Async Rehydration
I don't know whether this would be useful or not. But similarly we could just rehydrate when the promise is resolved (basically, an SSRTemplate is resolved).
In this case, the previously yielded content will be replaced. For SSRTemplates, each yielded template can try to rehydrate the host, the end result being up to developers to manage (I guess? using such components on server and the client should be considered a bit more).
Hooks
Use of hooks should be before any await keyword, as otherwise the hooks context won't work. This might cause development confusion, so perhaps this requires further contemplation in design? Maybe other mechanisms specifically targeting async server-side rendering (perhaps beyond the scope of this package) are to be used?
The text was updated successfully, but these errors were encountered:
Add support for async components. This doesn't make much sense in pure client components and results in janky interactions (the component pops into existence after the async task), but
Async Rendering
So what should be possible is something like this:
If the component function returns a promise, then the content should be added to the host when that promise is resolved.
Async Rehydration
I don't know whether this would be useful or not. But similarly we could just rehydrate when the promise is resolved (basically, an
SSRTemplate
is resolved).Async Generators
This could enable convenient loading states:
In this case, the previously yielded content will be replaced. For
SSRTemplate
s, each yielded template can try to rehydrate the host, the end result being up to developers to manage (I guess? using such components on server and the client should be considered a bit more).Hooks
Use of hooks should be before any
await
keyword, as otherwise the hooks context won't work. This might cause development confusion, so perhaps this requires further contemplation in design? Maybe other mechanisms specifically targeting async server-side rendering (perhaps beyond the scope of this package) are to be used?The text was updated successfully, but these errors were encountered: