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

[RFC] Warn user if have react-router or react-router-dom in package.json #2120

Closed
1 task
sorrycc opened this issue Mar 18, 2019 · 6 comments
Closed
1 task
Labels

Comments

@sorrycc
Copy link
Member

sorrycc commented Mar 18, 2019

背景

参考 sorrycc/blog#82,由于 umi 现在允许用户自定义 react-router-dom 等库的版本,所以可能会出现不一致。比如 react-router 和 react-router-dom 版本不一致时会出现问题。

思路

几个方案:

  1. 启动之前做一些检测,包括这个路由版本不一致的问题,提醒用户
  2. 不支持 react-router 和 react-router-dom 的版本自定义

有点倾向方案 2 。

跟进

  • PR
@imhele
Copy link
Contributor

imhele commented Mar 18, 2019

使用 umi-plugin-react 开启 locale ,再额外引入不同版本的 umi-plugin-locale 也会出现同类问题,两个不同版本的依赖创建了两个闭包,import 到的内容不一致,可以考虑用 umi 的 alias 配置屏蔽掉部分用户额外引入的依赖

@xiaohuoni
Copy link
Member

路由这一块还是放在umi统一管理,没什么好选择的。一些组件和工具类包,可以允许用户自定义版本

@yutingzhao1991
Copy link
Contributor

yutingzhao1991 commented Mar 19, 2019

+1 react-router 和 react-router-dom 感觉没有什么理由要支持用户自定义,我理解路由这块 react-router 都应该是对用户不可见的。

@imhele 说的问题应该就可以用类似 启动之前做一些检测,包括这个路由版本不一致的问题,提醒用户 这样的提醒来解决就好了。

@stale
Copy link

stale bot commented May 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 18, 2019
@sorrycc sorrycc removed the wontfix label May 19, 2019
@stale
Copy link

stale bot commented Jul 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@sorrycc
Copy link
Member Author

sorrycc commented Jul 18, 2019

已锁定。

@sorrycc sorrycc closed this as completed Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants