eggjs / egg

🥚 Born to build better enterprise frameworks and apps with Node.js & Koa
https://eggjs.org
MIT License
18.87k stars 1.81k forks source link

Support server-rendered React #328

Closed afc163 closed 6 years ago

afc163 commented 7 years ago

like https://github.com/zeit/next.js/

popomore commented 7 years ago

现在搞的是这个 https://github.com/eggjs/egg-view-react

shepherdwind commented 7 years ago

这个还用 babel-registry 了,https://github.com/eggjs/egg-view-react/blob/master/test/fixtures/apps/view-react-test/app/controller/test.js ,这样不好吧

popomore commented 7 years ago

额,单元测试,不然没法跑 Eward Song notifications@github.com于2017年2月11日 周六20:28写道:

这个还用 babel-registry 了, https://github.com/eggjs/egg-view-react/blob/master/test/fixtures/apps/view-react-test/app/controller/test.js ,这样不好吧

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/eggjs/egg/issues/328#issuecomment-279140847, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWA1ReloGtYdoXKr4QokxhMfss4XiIrks5rbaligaJpZM4L5eeQ .

wangking873 commented 7 years ago

建议出 1.egg-view-next(react) 2.egg-view-nuxt(vue2)

ghost commented 7 years ago

egg-next看到有人写了一个egg-next来做这个事情

MinJieLiu commented 7 years ago

强烈建议使用 next.js 作为 react 渲染方案😘,是因为作为 view 使用 react 没有如 ejs 那样简单。

前端构建都是一个复杂的过程。而 next.js 已经把相应的坑踩遍,两者搭配起来应该更好。

如果单独写一个 egg-view-react。那又有什么意义呢?那样又要重新踩一遍坑,不容易适应各种需求,而且迟迟不能稳定。

@popomore

atian25 commented 7 years ago

之前 next.js 1.x 的时候,好像对 koa 的支持不好,要 hack 的方式,现在不知道怎么样了。

可以单独写个 egg-nextjs

dead-horse commented 7 years ago

我前一阵子研究 next.js 的时候还是不支持 koa 的,现在 koa 接入 next 都是通过设置 ctx.responed = false 后交由 next.js 处理响应,这个模式在 koa(egg) 下会导致很多中间件失效。

hubcarl commented 6 years ago

基于Egg + React + Webpack3/Webpack2 多页面和单页面服务端渲染同构工程骨架项目: https://github.com/hubcarl/egg-react-webpack-boilerplate

likeswinds commented 6 years ago

https://github.com/nuxt-community/koa-template 墙裂建议

djyde commented 6 years ago

Hi, I am working on https://github.com/djyde/serlina and its Egg binding https://github.com/serlina-community/egg-serlina I think this is the best serverside-rendering solution for Egg application!

https://medium.com/@djyde/serlina-a-progressive-react-serverside-rendering-framework-a4de2d71d984 https://medium.com/@djyde/egg-serlina-%EF%B8%8F-533493862698

atian25 commented 6 years ago

@djyde cool~ could add it to https://github.com/eggjs/awesome-egg

fengmk2 commented 6 years ago

@djyde serlina look beautiful!

open-cipher commented 6 years ago

Hi,

I've been working on a EggJS plugin that integrates NextJS. egg-frost

I have been able to set this plugin and render pages using NextJS render engine (in development mode).

I hope it helps. Feedback is always welcome 😄

lirl-cn commented 6 years ago

Hi,

I've been working on a EggJS plugin that integrates NextJS. egg-frost

I have been able to set this plugin and render pages using NextJS render engine (in development mode).

I hope it helps. Feedback is always welcome 😄

Read the document but don't use

yangchongduo commented 5 years ago

@dead-horse 给个导致很多中间件失败的demo ,如果导致了你怎么处理的?