Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I like this project, and I believe its implementation fits perfectly with SSR, as features like Suspense can be done better than frameworks like React do.
I already have an implementation with somewhat working hydration, but it is still too raw to use, this version of PR only has SSR, and I may split it to multiple PRs if you want.
SSR is implemented using partial html dom in Rust, and not optimized, I have some ideas on reducing the memory footprint, but they require a custom rendering macro, which will be able to statically optimize some of parts for both CSR and SSR cases.
Note that for hydration, we don't likely need any intermediate representation for elements, in my testing replacing Node with similar one with
replaceWith/parentNode.replaceChild
doesn't affect performance that much, and it is pretty cheap to rebuild full tree and reattach it with replacements, instead of finding all the nodes and then attaching event handlers to nodes that are already rendered by SSROverall, this branch is very unfinished, but I accept suggestions on the current implementation, as it pretty much matches what I'll do next.