-
Notifications
You must be signed in to change notification settings - Fork 19
Add renderToString and renderToStaticMarkup
#6
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
Add renderToString and renderToStaticMarkup
#6
Conversation
|
I believe this PR resolves purescript-react/purescript-react-basic#63. |
|
2 hours ago? I wanted to upstream this just now: const reactDom = require("react-dom/server")
exports.renderToString = reactDom.renderToStringforeign import renderToString ∷ JSX -> StringAnd I was wondering the same thing about effectfulness. I didn't model it that way out of laziness but I suppose it wouldn't really hurt either. |
|
You're right, it probably doesn't hurt to have an But I'm more interested in whether or not it is correct to model them with or without an |
|
Commented on it above as well.. I'm not really sure. It could throw, but that's not a normal path so maybe that doesn't matter. |
|
It'd be great to have the streaming functions as well, but that introduces Node dependencies. Which reminds me, |
|
I've kind of been lazy about this whole thing because the server-side version of suspense is still up in the air and I was curious how that would change things. I'd guess it'd be through new functions though to preserve compatibility so it is more laziness than a real concern. |
|
@spicydonuts Are there any particular changes you'd like me to make to this PR? FWIW, I think that introducing the streaming functions may fit better in a separate PR since, as you pointed out, it introduces Node dependencies. |
|
That's fine with me |
|
Thanks! |
This PR adds support for the following
ReactDOMServermethods:renderToStringrenderToStaticMarkupI opted not to add the stream-based methods at this time (mostly cause I don't feel like typing the streams), but I can do that if it is desired.