kuoruan/v8go-polyfills

ReactJS SSR Example?

terfender opened this issue · 2 comments

Hi @kuoruan ,

I would really love to see an example/template on how I can use this lib with ReactJS using SSR serving.

I am trying to import my compile ReactJS code and injecting it into ctx.RunScript function.
However, I get this error:

panic serving [::1]:52970: ReferenceError: require is not defined

Can you please advise?

Will this lib support LazyLoad feature as well?

Hi @terfender, you should build your server code with webpack before running it with V8.

Hi @terfender , you can get the SSR code here: https://github.com/kuoruan/go-v8-react-ssr

But some frontend page are not ready yet, I will do it later.