reactjs / react-php-v8js

PHP library that renders React components on the server
Other
1.33k stars 127 forks source link

Use ReactDOM APIs #19

Closed zpao closed 8 years ago

zpao commented 8 years ago

This updates ReactJS.php to require that the provided libsrc also has ReactDOM and ReactDOMServer exposed as globals. I think this ultimately is the best path forward for the time being.

I updated the example to build such a bundle. But I don't have PHP set up right to run this so I haven't actually tested this. Anybody want to sanity check this?

CC people who have filed issues recently @Finetuned @daslicht @tauseefk

Finetuned commented 8 years ago

@zpao Yes, that works.

        $ls = array();
        $ls[] = "print('RDS Keys = ' + Object.keys(global.ReactDOMServer));";
        $req = implode(";\n", $ls);
        echo $this->executeJS($req);

returns

RDS Keys = renderToString,renderToStaticMarkup,version
talyssonoc commented 8 years ago

Some news about when it will get merged?

18601673727 commented 8 years ago

We want this got merged please.

edisonthk commented 8 years ago

We need this pull request to be merged please.

stroborobo commented 8 years ago

Any news on this one?

zpao commented 8 years ago

Sorry for the delay. I think I might end up doing this slightly differently now that we ship react-dom-server.js which has the API we want, as opposed to building our own package (even though that is easy). I'll take a look today.