Skip to content

Commit

Permalink
doc: improve (umijs#970)
Browse files Browse the repository at this point in the history
* improve docs

* Add english version of docs
  • Loading branch information
sorrycc authored Sep 1, 2018
1 parent 15a67e7 commit bbbf586
Show file tree
Hide file tree
Showing 47 changed files with 3,454 additions and 247 deletions.
193 changes: 130 additions & 63 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,83 +1,150 @@
module.exports = {
title: 'UmiJS',
description: '🌋 可插拔的企业级 react 应用框架。',
// locales: {
// '/': {
// lang: 'en-US',
// description: 'Blazing-fast next.js-like framework for React apps.',
// },
// '/zh/': {
// lang: 'zh-CN',
// description: '极快的类 Next.js 的 React 应用框架。',
// },
// },
locales: {
'/': {
lang: 'en-US',
description: '🌋 Pluggable enterprise-level react application framework.',
},
'/zh/': {
lang: 'zh-CN',
description: '🌋 可插拔的企业级 react 应用框架。',
},
},
serviceWorker: {},
themeConfig: {
repo: 'umijs/umi',
lastUpdated: 'Last Updated',
editLinks: true,
editLinkText: '在 GitHub 上编辑此页',
docsDir: 'docs',
serviceWorker: {
updatePopup: {
message: 'New content is available.',
buttonText: 'Refresh',
},
},
nav: [
{ text: '指南', link: '/guide/' },
{ text: '配置', link: '/config/' },
{ text: 'API', link: '/api/' },
{ text: '插件', link: '/plugin/' },
{ text: 'V1 文档', link: 'https://v1.umijs.org/' },
{ text: '发布日志', link: 'https://github.com/umijs/umi/releases' },
],
sidebar: {
'/guide/': [
{
title: '指南',
collapsable: false,
children: [
'',
'getting-started',
'examples-and-boilerplates',
'app-structure',
'router',
'navigate-between-pages',
'config',
'html-template',
locales: {
'/': {
selectText: 'Languages',
label: 'English',
editLinkText: 'Edit this page on GitHub',
nav: [
{ text: 'Guide', link: '/guide/' },
{ text: 'Config', link: '/config/' },
{ text: 'API', link: '/api/' },
{ text: 'Plugin', link: '/plugin/' },
{ text: 'V1 Docs', link: 'https://v1.umijs.org/' },
{ text: 'Changelog', link: 'https://github.com/umijs/umi/releases' },
],
sidebar: {
'/guide/': [
{
title: 'Guide',
collapsable: false,
children: [
'',
'getting-started',
'create-umi-app',
'examples',
'app-structure',
'router',
'navigate-between-pages',
'config',
'html-template',
],
},
{
title: 'Advanced',
collapsable: false,
children: ['mock-data', 'with-dva', 'load-on-demand', 'deploy'],
},
{
title: 'Reference',
collapsable: false,
children: ['faq', 'migration', 'env-variables'],
},
],
'/config/': [''],
'/api/': [''],
'/plugin/': [
{
title: 'Plugin',
collapsable: false,
children: [''],
},
{
title: 'Offcial Plugins',
collapsable: false,
children: ['umi-plugin-react'],
},
{
title: 'Develop Plugin',
collapsable: false,
children: ['develop'],
},
],
},
{
title: '进阶',
collapsable: false,
children: ['mock-data', 'with-dva', 'load-on-demand', 'deploy'],
},
{
title: '参考',
collapsable: false,
children: ['faq', 'migration', 'env-variables'],
},
],
'/config/': [''],
'/api/': [''],
'/plugin/': [
{
title: '插件',
collapsable: false,
children: [''],
},
{
title: '官方插件',
collapsable: false,
children: ['umi-plugin-react'],
},
{
title: '插件开发',
collapsable: false,
children: ['develop'],
},
'/zh/': {
selectText: '选择语言',
label: '简体中文',
editLinkText: '在 GitHub 上编辑此页',
nav: [
{ text: '指南', link: '/guide/' },
{ text: '配置', link: '/config/' },
{ text: 'API', link: '/api/' },
{ text: '插件', link: '/plugin/' },
{ text: 'V1 文档', link: 'https://v1.umijs.org/' },
{ text: '发布日志', link: 'https://github.com/umijs/umi/releases' },
],
sidebar: {
'/zh/guide/': [
{
title: '指南',
collapsable: false,
children: [
'',
'getting-started',
'create-umi-app',
'examples',
'app-structure',
'router',
'navigate-between-pages',
'config',
'html-template',
],
},
{
title: '进阶',
collapsable: false,
children: ['mock-data', 'with-dva', 'load-on-demand', 'deploy'],
},
{
title: '参考',
collapsable: false,
children: ['faq', 'migration', 'env-variables'],
},
],
'/zh/config/': [''],
'/zh/api/': [''],
'/zh/plugin/': [
{
title: '插件',
collapsable: false,
children: [''],
},
{
title: '官方插件',
collapsable: false,
children: ['umi-plugin-react'],
},
{
title: '插件开发',
collapsable: false,
children: ['develop'],
},
],
},
],
},
},
},
};
2 changes: 1 addition & 1 deletion docs/.vuepress/override.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$accentColor = #FD9111
$accentColor = #029ffd
$textColor = #2c3e50
$borderColor = #eaecef
$codeBgColor = #282c34
Empty file added docs/.vuepress/style.styl
Empty file.
42 changes: 21 additions & 21 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
---
home: true
actionText: 快速上手
actionText: Get Started
actionLink: /guide/
features:
- title: 插件化
details: umi 的整个生命周期都是插件化的,甚至其内部实现就是由大量插件组成,比如 pwa、按需加载、一键切换 preact、一键兼容 ie9 等等,都是由插件实现。
- title: 开箱即用
details: 你只需一个 umi 依赖就可启动开发,无需安装 reactpreactwebpackreact-routerbabeljest 等等。
- title: 约定式路由
details: 类 next.js 的约定式路由,无需再维护一份冗余的路由配置,支持权限、动态路由、嵌套路由等等。
- title: Pluggable
details: The entire lifecycle of umi is composed of plugins, and such as pwa, on-demand loading, one-click switching preact, one-button compatibility ie9, etc., all implemented by plugins.
- title: Out Of Box
details: You only need a umi dependency to start development without having to install react, preact, webpack, react-router, babel, jest, and more.
- title: Conventional Routing
details: Next.js like and full featured routing conventions, support permissions, dynamic routing, nested routing, and more.
footer: MIT Licensed | Copyright © 2017-present
---

### 入门非常简单
### Getting started is very simple

```bash
# 安装
# Install deps
$ yarn global add umi # 或者 npm install -g umi

# 新建应用
# Create application
$ mkdir myapp && cd myapp

# 新建页面
# Create page
$ umi generate page index

# 本地开发
# Start dev server
$ umi dev

# 构建上线
# Build and deploy
$ umi build
```

[10 分钟入门 umi 视频版](https://youtu.be/vkAUGUlYm24)
[Getting started with a 10 minutes video](https://youtu.be/vkAUGUlYm24)

### 社区
## Community

#### 钉钉群
### Telegram

<img src="https://gw.alipayobjects.com/zos/rmsportal/wsBGpRlCOkmxHzMHuyAT.jpg" width="60" />
[https://t.me/joinchat/G0DdHw-44FO7Izt4K1lLFQ](https://t.me/joinchat/G0DdHw-44FO7Izt4K1lLFQ)

#### 微信群
### 钉钉群

群满 100 人,请加 `sorryccpro` 好友备注 `umi` 邀请加入。
<img src="https://gw.alipayobjects.com/zos/rmsportal/wsBGpRlCOkmxHzMHuyAT.jpg" width="60" />

#### Telegram
### 微信群

[https://t.me/joinchat/G0DdHw-44FO7Izt4K1lLFQ](https://t.me/joinchat/G0DdHw-44FO7Izt4K1lLFQ)
群满 100 人,请加 `sorryccpro` 好友备注 `umi` 邀请加入。
4 changes: 4 additions & 0 deletions docs/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
sidebarDepth: 2
---

::: warning
This article has not been translated yet. Wan't to help us out? Click the `Edit this page on GitHub` at the end of the page.
:::

# API

## 路由
Expand Down
8 changes: 6 additions & 2 deletions docs/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
sidebarDepth: 2
---

# 配置
# Configuration

## 基本配置
::: warning
This article has not been translated yet. Wan't to help us out? Click the `Edit this page on GitHub` at the end of the page.
:::

## Basic

### plugins

Expand Down
33 changes: 18 additions & 15 deletions docs/guide/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Introduce

# 介绍
::: warning
This article has not been translated yet. Wan't to help us out? Click the `Edit this page on GitHub` at the end of the page.
:::

UmiJS,发音类似中文的**乌米**,是一个可插拔的企业级 react 应用框架,在蚂蚁金服内部(通过 Bigfish)服务于除小程序外的所有前端应用类型,包括中后台项目、H5 应用、静态站点、chair(egg)应用等,大概 500+ 项目,在阿里的其他 BU 以及业界也有不少应用。

Expand All @@ -9,13 +12,13 @@ UmiJS,发音类似中文的**乌米**,是一个可插拔的企业级 react

之前,工具是编译时的,框架是运行时的,两者互不强依赖,相互独立。但是,我们发现,把两者结合起来会让框架更强大,对使用者也更友好。比如,我在 pages 目录下建立 404.js 的文件,然后他就变成了整个项目的 fallback 路由,这在工具和框架分离的情况下是很难做到的。

## 架构
## Architecture

下图是 umi 的架构图。
The figure below is the architecture of umi.

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

## 从源码到上线的生命周期管理
## From Source Code To Production

市面上的框架基本都是从源码到构建产物,很少会考虑到各种发布流程,而 umi 则多走了这一步。

Expand All @@ -25,17 +28,17 @@ UmiJS,发音类似中文的**乌米**,是一个可插拔的企业级 react

umi 首先会加载用户的配置和插件,然后基于配置或者目录,生成一份路由配置,再基于此路由配置,把 JS/CSS 源码和 HTML 完整地串联起来。用户配置的参数和插件会影响流程里的每个环节。

## 特性

* 📦 **开箱即用**内置 react、react-router
* 🏈 **类 next.js [功能完备](/guide/router.html)的路由约定**,同时支持配置的路由方式
* 🎉 **完善的插件体系**,覆盖从源码到构建产物的每个生命周期
* 🚀 **高性能**,通过插件支持 PWA、以路由为单元的 code splitting
* 💈 **支持静态页面导出**,适配各种环境,比如中台业务、无线业务、[egg](https://github.com/eggjs/egg)、支付宝钱包、云凤蝶等
* 🚄 **开发启动快**,支持一键开启 [dll](/plugin/umi-plugin-react.html#dll) [hard-source-webpack-plugin](/plugin/umi-plugin-react.html#hardSource)
* 🐠 **一键兼容到 IE9**,基于 [umi-plugin-polyfills](/plugin/umi-plugin-react.html#polyfills)
* 🍁 **完善的 TypeScript 支持**,包括 d.ts 定义和 umi test
* 🌴 **与 dva 数据流的深入融合**,支持 duck directorymodel 的自动加载、code splitting 等等
## Features

* 📦 **Out of box**built-in react、react-router, etc
* 🏈 **Next.js like and [full featured](./router.html) routing conventions**, also support configured routing
* 🎉 **Complete plugin system**, covering every lifecycle from source code to production
* 🚀 **High performance**, support PWA, route level code splitting, etc via plugin
* 💈 **Support static export**, , adapt to various environments, such as console app, mobile app, [egg](https://github.com/eggjs/egg), Alipay wallet, etc
* 🚄 **Fast dev startup**, support enable [dll](../plugin/umi-plugin-react.html#dll) and [hard-source-webpack-plugin](../plugin/umi-plugin-react.html#hardSource) with config
* 🐠 **Compatible IE9**, based on [umi-plugin-polyfills](../plugin/umi-plugin-react.html#polyfills)
* 🍁 **Support TypeScript**, including d.ts definition and `umi test`
* 🌴 **Deep integration with [dva](https://dvajs.com/)**, support duck directory, automatic loading of model, code splitting, etc

## 他和 dva、roadhog 是什么关系?

Expand Down
6 changes: 5 additions & 1 deletion docs/guide/app-structure.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# 目录及约定
# Directory and Convension

::: warning
This article has not been translated yet. Wan't to help us out? Click the `Edit this page on GitHub` at the end of the page.
:::

在文件和目录的组织上,umi 尽量选择了约定的方式。

Expand Down
6 changes: 5 additions & 1 deletion docs/guide/config.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# 配置
# Configuration

::: warning
This article has not been translated yet. Wan't to help us out? Click the `Edit this page on GitHub` at the end of the page.
:::

## 配置文件

Expand Down
Loading

0 comments on commit bbbf586

Please sign in to comment.