-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[SSR] Add and implement ToHtmlString
trait for all virtual dom nodes
#1154
Comments
Could this also be used in testing Yew components? |
Hey, I would be interested in picking this up. To my knowledge Would you be happy to implement something similar for yew? Or maybe a different VComp implementation behind ssr feature flag. |
Hey @chillcaw! Happy to hear about your interest in picking this up!
I'm definitely more in this camp. Basically everything we use Happy to plan this out in more detail once you start diving in :) |
I definitely agree with you there, I think this is worth the time investment. I am definitely looking forward to using Yew once this is supported. I suppose there are a few ways of doing this. I guess the primary goal is to make One thing I'm unsure of is if we're able to check A Rust SSR project might look like the following:
I would be keen to hear your thoughts on the above. 😺 |
I think a feature flag would work well, could you elaborate more on why you think this might not work?
I think a check for
Looks roughly like what I was imagining 👍 I'm a little afraid of devs having a hard time splitting |
Also, FYI this isn't blocked anymore. Getting the html string of a component node (VComp) should be pretty easy now |
It maybe "pretty easy now", but I can't figure out how do I convert even most simples example to a string:
(Trying to do a really simple static site generator.) |
It may be helpful to give an example. This is very crucial functionality that's pretty hard to track down in the docs between Yew and web_sys. Edit: Now that I think about it, the Components documentation should probably add an example that includes creating a VComp or other VNode object -> converting to HTML -> putting it in the view. I can do it, except for converting the VNode object to an HTML string. Still haven't quite figured that out. |
Is your feature request related to a problem? Please describe.
There is no way to convert yew virtual dom nodes (VNode variants) into html strings for use in server side rendering or static site generation
Describe the solution you'd like
Add and implement
ToHtmlString
trait for all virtual dom nodesAdditional context
Prior work: #874
The text was updated successfully, but these errors were encountered: