Skip to content
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

ReactJS server (ReactDOMServer) side rendering #16

Closed
CaptainN opened this issue Jul 25, 2016 · 2 comments
Closed

ReactJS server (ReactDOMServer) side rendering #16

CaptainN opened this issue Jul 25, 2016 · 2 comments

Comments

@CaptainN
Copy link

Hi,

I've been trying to get this to work for React with server side rendering, and I'm curious whether you have ever tried that. If that could work, that could be a great way to bridge the gap with React based SPAs, and the need for server side rendering on PHP hosts that don't support running JS (no V8 extension, etc.).

I did a quick test where I tried to bundle a little hello world React component with JSPM (using defaults - bundle everything with SystemJS and default babel - ES5 - settings). It didn't work though, giving me an error about being unable to convert undefined or null.

Even better may be to use babel to convert JSX to ES6 compatible code in individual modules, and use the package import support that seems to exist within js2php. Do you think something like this could work?

I still also have to work out how to pull in npm modules (like React and ReactDOM) in an effective way.

Great project - thanks!

@endel
Copy link
Owner

endel commented Jul 25, 2016

Hi @CaptainN, thanks for checking out.

This project is not intended for heavy code conversion such as porting libraries completely, as it still lacks a lot of JavaScript features and has some known issues. It might be safe to use for very tiny pieces of code, other than that I wouldn't trust its output.

Have you tried using something like this? More info

Cheers!

@endel endel closed this as completed Jul 25, 2016
@CaptainN
Copy link
Author

Ah, good to know. :-)

I did look into alternatives, but was hoping to find a solution that didn't rely on the V8 extension.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants