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

能不能开一个SSR-branch #20

Closed
LucasIcarus opened this issue Aug 8, 2016 · 9 comments
Closed

能不能开一个SSR-branch #20

LucasIcarus opened this issue Aug 8, 2016 · 9 comments

Comments

@LucasIcarus
Copy link

基于vuepack全面换了Vue 2.0+套装之后的版本写了一个vue-ssr版本的template, 稍微调整了下工作流, up能不能开个ssr的分支让我pr一下?

@egoist
Copy link
Owner

egoist commented Aug 8, 2016

可以吧,我待会到家看看。

ps:说到 up,此处应有弹幕(๑°3°๑)

@egoist
Copy link
Owner

egoist commented Aug 8, 2016

可以的话我觉得还是提交到 https://github.com/egoist/vue-isomorphic-starter 这个 Repo ?

@LucasIcarus
Copy link
Author

@egoist 啊嘞, 早知道有这个我就不自己写了... 我先看下...

@LucasIcarus
Copy link
Author

改动有点大... 我用的还是express, 而且用了babel-cli.. 基本的工作流脱胎于react的那个isomorphic starterkit, 要不我基于巨巨的那个isomorphic再写一个好了

另外问个问题.. ssr的话把页面内容直接强耦合在server/index.js里面是不是不太好? 如果要用xtpl之类的模版和renderToStream还有没有配合的可能?

@egoist
Copy link
Owner

egoist commented Aug 8, 2016

可以吧,这个略带实验性质。

xtpl 和 renderToStream 配合是什么意思

@LucasIcarus
Copy link
Author

Node.js后端使用模板引擎渲染一般都是res.render(filename, injections) 这种形式吧, 用stream的话是不是就不能用模板引擎了? 我是想表达这个意思

@egoist
Copy link
Owner

egoist commented Aug 8, 2016

嗯,直接使用 res.render 的模板引擎是不支持 stream 的

@egoist
Copy link
Owner

egoist commented Aug 8, 2016

似乎可以不使用 res.render,有一些支持 stream 的模板引擎 https://github.com/marko-js/marko#rendering-a-template

@LucasIcarus
Copy link
Author

@egoist 巨巨果然还是厉害啊! 但是又要去学一个轮子啊啊啊啊啊....
估计isomorphic的pr要在明天了, 可能只能做点修修剪剪的工作了.. 祝好~

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