Umi: Provide umi 3 project using Ssr + Redux below the examples directory

Created on 22 May 2020  ·  9Comments  ·  Source: umijs/umi

What is the right way, best practices of running umi project with redux, redux persist and running ssr enabled ? There is documentation or no examples about it. It would be super nice if this is doable from maintainers. Please show us the best practices of it.

PR Welcome type(ssr)

Most helpful comment

Note: The usage in screenshot below is from Umi docs. This routing does not work with SSR.
Screen Shot 2020-05-23 at 15 17 51
Branching with layout components in routes brokes the SSR somehow @ycjcl868

What about wrapping the pages with the layout component.

<MyLayout> <div> Here is my page at /user/login </div> </MyLayout>

That's also my workaround plan, I just wanted to share that ssr does not work naturally with umi routes which includes layoutings.

All 9 comments

Why not use @umijs/plugin-dva

Because dva has its own standarts, I want to keep pure Redux and my project is pretty large so I dont want to refactor my whole state management.

Also, just like umi and antd, Dva has too much documentation issues. Everything is Chinese, its hard to understand things via Google translate.

+1 for SSR example with antd

+1 for SSR example with antd

If you use antd, the SSR does not work with the routes logic of Antd.

In Antd you use layouts below the absolute path like in this link. But umi takes them as a page, anything below that layouts does never render from server.

Note: The usage in screenshot below is from Umi docs. This routing does not work with SSR.
Screen Shot 2020-05-23 at 15 17 51

Branching with layout components in routes brokes the SSR somehow @ycjcl868

Note: The usage in screenshot below is from Umi docs. This routing does not work with SSR.
Screen Shot 2020-05-23 at 15 17 51

Branching with layout components in routes brokes the SSR somehow @ycjcl868

What about wrapping the pages with the layout component.

<MyLayout> <div> Here is my page at /user/login </div> </MyLayout>

Note: The usage in screenshot below is from Umi docs. This routing does not work with SSR.
Screen Shot 2020-05-23 at 15 17 51
Branching with layout components in routes brokes the SSR somehow @ycjcl868

What about wrapping the pages with the layout component.

<MyLayout> <div> Here is my page at /user/login </div> </MyLayout>

That's also my workaround plan, I just wanted to share that ssr does not work naturally with umi routes which includes layoutings.

Hello @ozkanonur. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please be sure to fill in the default template in the Pull Request, provide changelog/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @ozkanonur,我们完全同意你的提议/反馈,欢迎直接在此仓库创建一个 Pull Request 来解决这个问题。请务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。

Was this page helpful?
0 / 5 - 0 ratings

Related issues

liuxinqiong picture liuxinqiong  ·  3Comments

nguyenhuutinh picture nguyenhuutinh  ·  3Comments

afc163 picture afc163  ·  3Comments

miaojinxing picture miaojinxing  ·  3Comments

y2891663091 picture y2891663091  ·  4Comments