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

Improve router #26

Closed
4 tasks done
sorrycc opened this issue Dec 18, 2017 · 4 comments
Closed
4 tasks done

Improve router #26

sorrycc opened this issue Dec 18, 2017 · 4 comments

Comments

@sorrycc
Copy link
Member

sorrycc commented Dec 18, 2017

  • use react-router-dom
  • support props.query
  • support variable path (consider static generate)
  • support global layout
@sorrycc
Copy link
Member Author

sorrycc commented Jan 20, 2018

路由改造 Action:

  • 默认非静态化,支持通过 exportStatic 进行配置
  • 静态化的页面文件默认用 xx/index.html,而不是 xx.html,这样更规范,支持通过 exportStatic.htmlSuffix 配置
  • 支持变量路由(文件或目录),比如 $userId
  • 支持 layout,通过 pages/_layout.js
  • 支持配置式的路由,通过 pages/_routes.json

@sorrycc sorrycc mentioned this issue Jan 21, 2018
7 tasks
@sorrycc
Copy link
Member Author

sorrycc commented Jan 22, 2018

默认非静态化,支持通过 exportStatic 进行配置

比如,项目中有以下文件,

/pages/index.js
/pages/list.js
/pages/user.js

构建之后,

static/
index.html
list.html
user.html

但是有一些 SPA 场景,只要输出一个通用的 index.html 即可。即:

static/
index.html

所以,

  • 默认输出一个通用的 index.html
  • 如果有配 exportStatic: true,则输出所有

Action:

  • generateHTML 中根据 exportStatic 配置,判断是否输出一个

@sorrycc
Copy link
Member Author

sorrycc commented Jan 22, 2018

支持配置式的路由,通过 src/_routes.json 或 _routes.json

  • 支持读取 _routes.json 的方式获取路由配置,先只支持 JSON 格式
  • 改写路由配置格式,和 react-router-config 的保持一致
  • umi-plugin-yunfengdie 支持新的路由格式

@sorrycc
Copy link
Member Author

sorrycc commented Jan 26, 2018

Done

xierenyuan pushed a commit to xierenyuan/umi that referenced this issue Jun 23, 2022
* feat: logger

* fix: types

* fix: utils debug

* test: ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant