umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.31k stars 2.65k forks source link

umi supports prerender, isomorphic, server side render (SSR) ? #377

Closed aletus closed 6 years ago

aletus commented 6 years ago

Since umi is described as next.js like, does umi support prerendering of HTML pages when build?

I tried the exportStatic option but it doesn't seem to prerender the page.

sorrycc commented 6 years ago
superlbr commented 6 years ago

on my view, ssr is powered by a backend server, such as eggjs However, umi is just going to be a package tool to build dist. Here's an example of [egg with umi]()

Found some similar project: ssr plugin for egg.js avet --build top of Next.js and Egg.js egg-react-webpack-boilerplate react-koa2-ssr

aletus commented 6 years ago

@sorrycc I agree with umi build and static site hosting, SSR is not needed.

However prerendering the initial HTMLs are really good to speed up the load time and also for search engine optimization SEO. Looking forward to get it added to umi.

I am also looking for a way to generate google Accelerated Mobile Page AMP when doing umi build.

Right now I have to hand coded the AMP HTML separately and it is duplicated work.

antenando commented 5 years ago

I don't want to reopen this issue but I think this is the best place to ask this.

Is there a proper way I can make certain(s) page(s) SSR (maybe like config.openPages ?) server side renderable ?

In this case I'm looking for a way a page can be indexed by the web crawlers, i.e. Google.

ycjcl868 commented 5 years ago

support ssr:

https://github.com/umijs/umi-example-ssr
https://github.com/umijs/umi-example-ssr-with-egg