Skip to content

Commit

Permalink
docs: refact via vuepress
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Jun 11, 2018
1 parent 073d8f7 commit aa2db7a
Show file tree
Hide file tree
Showing 22 changed files with 3,187 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ package-lock.json
.next/
examples/**/.umi
examples/**/.umi-production

/website/build
yarn.lock
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2018 ChenCheng ([email protected])
Copyright (c) 2016-present ChenCheng ([email protected])

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,18 @@ Want more?
* 在 gitc 分享 dva 的 PPT :[React 应用框架在蚂蚁金服的实践](http://slides.com/sorrycc/dva)
* 如果还在用 [email protected],请尽快 [升级到 2.x](https://github.com/sorrycc/blog/issues/48)

## Community(中文)
## Community

> 之前在 dvaantdpro 1、2 群的请勿重复加入。
### 微信群

<img src="https://gw.alipayobjects.com/zos/rmsportal/WdeuPFPzlKkfEWtxxeGL.jpg" width="200" />
<img src="https://gw.alipayobjects.com/zos/rmsportal/QwuMhmBXFuAqYvzktiGk.png" width="60" />

注:群满 100 人后,可加 `sorryccpro` 备注 `dva` 邀请加入。

### Telegram

[https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg](https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg)

扫码加微信群。(群满 100 人后,可加 `sorryccpro` 备注 `dva` 邀请加入)

## License

Expand Down
8 changes: 5 additions & 3 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@

## 社区

> 之前在 dvaantdpro 1、2 群的请勿重复加入。
### 微信群

<img src="https://gw.alipayobjects.com/zos/rmsportal/WdeuPFPzlKkfEWtxxeGL.jpg" width="200" />
群满 100 人,可加 `sorryccpro` 备注 `dva` 邀请加入。

扫码加微信群。(群满 100 人后,可加 `sorryccpro` 备注 `dva` 邀请加入)
### Telegram

[https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg](https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg)

## License

Expand Down
39 changes: 39 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
title: 'DvaJS',
description: 'React and redux based, lightweight and elm-style framework.',
themeConfig: {
repo: 'dvajs/dva',
lastUpdated: 'Last Updated',
editLinks: true,
editLinkText: '在 GitHub 上编辑此页',
docsDir: 'docs',
nav: [
{ text: '指南', link: '/guide/' },
{ text: 'API', link: '/api/' },
{ text: '知识地图', link: '/knowledgemap/' },
{ text: '发布日志', link: 'https://github.com/dvajs/dva/releases' },
],
sidebar: {
'/guide/': [
{
title: '指南',
collapsable: false,
children: [
'',
'getting-started',
'examples-and-boilerplates',
'concepts',
'introduce-class',
],
},
{
title: '社区',
collapsable: false,
children: ['fig-show', 'develop-complex-spa', 'source-code-explore'],
},
],
'/api/': [''],
'/knowledgemap/': [''],
},
},
};
4 changes: 4 additions & 0 deletions docs/.vuepress/override.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$accentColor = #fc54c3
$textColor = #2c3e50
$borderColor = #eaecef
$codeBgColor = #282c34
25 changes: 25 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
home: true
actionText: 快速上手 →
actionLink: /guide/
features:
- title: 易学易用
details: 仅有 6 个 api,对 redux 用户尤其友好,配合 umi 使用后更是降低为 0 API
- title: elm 概念
details: 通过 reducers, effects 和 subscriptions 组织 model,简化 redux 和 redux-saga 引入的概念
- title: 插件机制
details: 比如 dva-loading 可以自动处理 loading 状态,不用一遍遍地写 showLoading 和 hideLoading
footer: MIT Licensed | Copyright © 2017-present
---

### 社区

#### 微信群

<img src="https://gw.alipayobjects.com/zos/rmsportal/QwuMhmBXFuAqYvzktiGk.png" width="60" />

注:群满 100 人后,可加 `sorryccpro` 备注 `dva` 邀请加入。

#### Telegram

[https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg](https://t.me/joinchat/G0DdHw9tDZC-_NmdKY2jYg)
8 changes: 6 additions & 2 deletions docs/API_zh-CN.md → docs/api/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# API
---
sidebarDepth: 2
---

[View this in English](./API.md)
# API

## 输出文件

### dva

默认输出文件。
Expand Down Expand Up @@ -50,6 +53,7 @@ const UserPageComponent = dynamic({
* component:返回 Promise 的函数,Promise 返回 React Component

## dva API

### `app = dva(opts)`

创建应用,返回 dva 实例。(注:dva 支持多实例)
Expand Down
32 changes: 32 additions & 0 deletions docs/guide/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 介绍

dva 首先是一个基于 [redux](https://github.com/reduxjs/redux)[redux-saga](https://github.com/redux-saga/redux-saga) 的数据流方案,然后为了简化开发体验,dva 还额外内置了 [react-router](https://github.com/ReactTraining/react-router)[fetch](https://github.com/github/fetch),所以也可以理解为一个轻量级的应用框架。

## 特性

* **易学易用**,仅有 6 个 api,对 redux 用户尤其友好,[配合 umi 使用](https://umijs.org/guide/with-dva.html)后更是降低为 0 API
* **elm 概念**,通过 reducers, effects 和 subscriptions 组织 model
* **插件机制**,比如 [dva-loading](https://github.com/dvajs/dva/tree/master/packages/dva-loading) 可以自动处理 loading 状态,不用一遍遍地写 showLoading 和 hideLoading
* **支持 HMR**,基于 [babel-plugin-dva-hmr](https://github.com/dvajs/babel-plugin-dva-hmr) 实现 components、routes 和 models 的 HMR

## 他是如何工作的?

## 他是怎么来的?

* [Why dva and what's dva](https://github.com/dvajs/dva/issues/1)
* [支付宝前端应用架构的发展和选择](https://www.github.com/sorrycc/blog/issues/6)

## 谁在用?

## 为什么不是...?

### redux
### mobx

## 命名由来?

> D.Va拥有一部强大的机甲,它具有两台全自动的近距离聚变机炮、可以使机甲飞跃敌人或障碍物的推进器、 还有可以抵御来自正面的远程攻击的防御矩阵。
—— 来自 [守望先锋](http://ow.blizzard.cn/heroes/dva)

<img src="https://zos.alipayobjects.com/rmsportal/psagSCVHOKQVqqNjjMdf.jpg" width="200" height="200" />
8 changes: 5 additions & 3 deletions docs/Concepts_zh-CN.md → docs/guide/concepts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Concepts
---
sidebarDepth: 2
---

[View this in English](./Concepts.md)
# Dva 概念

## 数据流向

Expand Down Expand Up @@ -112,7 +114,7 @@ app.router(({history}) =>

所以在 dva 中,通常需要 connect Model的组件都是 Route Components,组织在`/routes/`目录下,而`/components/`目录下则是纯组件(Presentational Components)。

## 参考引申
## 参考

- [redux docs](http://redux.js.org/docs/Glossary.html)
- [redux docs 中文](http://cn.redux.js.org/index.html)
Expand Down
Loading

0 comments on commit aa2db7a

Please sign in to comment.