Skip to content

Commit

Permalink
Merge pull request #3751 from alibaba/release-next
Browse files Browse the repository at this point in the history
 Release
  • Loading branch information
SoloJiang authored Nov 12, 2020
2 parents b390a8d + 5e7041d commit 5cd39bb
Show file tree
Hide file tree
Showing 213 changed files with 3,193 additions and 3,743 deletions.
37 changes: 5 additions & 32 deletions docs/guide/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,24 @@ order: 1
cover: https://gw.alicdn.com/tfs/TB1vBRYaVOWBuNjy0FiXXXFxVXa-2558-1306.jpg
---

> 简单而友好的前端研发体系
## 特性


- **React 研发框架**:通过 icejs 研发框架集成目录规范、路由、状态管理、样式、权限管理、微前端等最佳实践
- **可视化智能开发助手**:通过 VS Code 插件集合 Iceworks 简化前端工程复杂度,提供可视化、配置化等能力
- **丰富的物料**:基于物料拼装提高项目开发效率,同时提供丰富的 React/Vue 物料
- **自定义物料**:不同团队可基于物料开发工具快速开发构建私有的物料体系

## 生态

### ice.js

> 开箱即用的 React 研发框架
- 提供 React 项目开发的最佳实践,包含工程配置、路由、状态管理、数据请求、调试日志等解决方案
- 开箱即用的工程能力,包含 TypeScript、Less/Sass/CSS Modules 等,无需关心繁琐的 webpack 基础配置
- 结合阿里业务沉淀的大量开发规范,包括目录规范、代码风格、单元测试等方面
- 约定优于配置的设计理念,让开发者能够更加专注于业务逻辑开发

### Iceworks

> 基于 VS Code 插件的可视化开发助手
- 在 VS Code 中支持可视化创建项目、启动调试等能力
- 提供强大的代码智能提示能力,让编码更加智能

### 物料

- 支持 Fusion Design、Ant Design、ElementUI 等不同 UI 组件的官方物料
- 提供强大的自定义物料能力,不同团队可以快速定制脚手架、沉淀业务相关物料
- 通过 Fusion 物料中心的托管,可以快速形成物料文档
- 结合 Iceworks 可以方便的在 VS Code 中使用消费开发好的物料

### 领域解决方案

- icestark:面向大型工作台的微前端解决方案
- ahooks:提供丰富的 React Hooks 选择

### 相关链接

| GitHub | npm | 文档 | 描述 |
|----------------|-----------------------------------------|--------------|-----------|
| [icejs](https://github.com/alibaba/ice) | ![](https://img.shields.io/npm/v/ice.js.svg) | [docs](/docs/guide/intro) |基于 React 的通用框架|
| [icejs](https://github.com/alibaba/ice) | ![](https://img.shields.io/npm/v/ice.js.svg) | [docs](/docs/guide/intro) |基于 React.js 的通用框架|
| [Iceworks](https://github.com/ice-lab/iceworks) | ![](https://vsmarketplacebadge.apphb.com/version-short/iceworks-team.iceworks.svg?logo=visual-studio-code) | [docs](/docs/iceworks/about) |可视化智能开发助手|
| [icestark](https://github.com/ice-lab/icestark) | ![](https://img.shields.io/npm/v/@ice/stark.svg) | [docs](/docs/icestark/guide/about) |面向大型应用的微前端解决方案|
| [icestore](https://github.com/ice-lab/icestore) | ![](https://img.shields.io/npm/v/@ice/store.svg) | [docs](https://github.com/ice-lab/icestore#icestore) |轻量简洁的状态管理方案|
| [ahooks](https://github.com/ice-lab/icestore) | ![](https://img.shields.io/npm/v/ahooks.svg) | [docs](https://ahooks.js.org/zh-CN) |基于业务沉淀的丰富完备的 React Hooks|

## 常见问题

Expand All @@ -67,6 +39,7 @@ cover: https://gw.alicdn.com/tfs/TB1vBRYaVOWBuNjy0FiXXXFxVXa-2558-1306.jpg

#### 飞冰可以使用哪些 UI 组件?


飞冰的框架和工具都不耦合 UI 组件,因此开发者可以选择自己喜欢的 UI 组件使用,比如:

- [使用 fusion 组件](/docs/guide/advance/fusion)
Expand Down
3 changes: 1 addition & 2 deletions docs/guide/advance/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $ npm install build-plugin-ice-auth --save-dev

大多数情况下权限管理通常需要从服务端获取权限数据,然后在前端通过权限对比以此控制页面、操作等等权限行为。在 icejs 框架中约定通过 `getInitialData` 从服务端异步获取初始化的权限数据,并且约定最终返回格式为 `{auth: {[key: string]: boolean }}` 的形式。


```tsx
import { runApp, request, IAppConfig } from 'ice';

Expand Down Expand Up @@ -84,8 +85,6 @@ Home.pageConfig = {
};
```

> 除了 pageConfig.auth 的方式,页面级鉴权也可通过在 `src/routes.ts` 中配置 wrappers 字段实现,可参考 [wrappers 配置](/docs/guide/basic/router?路由高阶组件)
## 操作权限

在某些场景下,如某个组件中要根据角色判断是否有操作权限,我们可以通过 `useAuth` Hooks 在组件中获取权限数据,同时也可以更新初始的权限数据。
Expand Down
17 changes: 17 additions & 0 deletions docs/guide/advance/icestark.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,20 @@ runApp(appConfig)
只需要这么简单,你的 SPA 应用就可以变成微前端的子应用了。

关于微前端的更多内容,请查看文档 [icestark](/docs/icestark/about)

### UMD 规范微应用

> build-plugin-icestark@2.0.0 以上版本支持
`build.json` 中配置 umd 属性即可导出标准 UMD 规范的微应用:

```json
{
"plugins": [
["build-plugin-icestark", {
"umd": true,
"library": "microApp" // UMD 模块导出名称,选填。默认为项目 package.json 中的 name 字段
}]
]
}
```
4 changes: 2 additions & 2 deletions docs/guide/basic/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function Example() {

### useSearchParams

**已废弃**请使用 getSearchParams。用于在非路由函数组件中解析 url 参数。
**已废弃**,用于在非路由函数组件中解析 url 参数。

假设当前 URL 为 `https://example.com?foo=bar`,解析查询参数如下:

Expand All @@ -192,7 +192,7 @@ function Example() {

### withSearchParams

**已废弃**请使用 getSearchParams。`useSearchParams` 对应,用在 Class Component 中。
**已废弃**,与 `useSearchParams` 对应,用在 Class Component 中。

```tsx
import { withSearchParams } from 'ice';
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/basic/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const appConfig = {
// 可选,根节点 DOM 元素,更灵活的 rootId
mountNode: document.getElementById('ice-container'),

// 可选,是否解析路由组件的查询参数,默认 true
// 可选,是否解析路由组件的查询参数
parseSearchParams: true

// 可选,自定义添加 Provider
Expand Down
27 changes: 27 additions & 0 deletions docs/guide/basic/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,35 @@ icejs 中一般不允许修改该配置。
}
```

### polyfill

- 类型:`string`
- 默认值:`"entry"`
- 可选值:`"usage"` | `false`

配置 `@babel/preset-env` 处理 `polyfill` 的逻辑。

#### polyfill: "entry"
根据配置的 `browserslist` 字段在每个文件开头都引入对应的 `polyfill`

#### polyfill: "usage"
根据源码中使用到的代码按需引入 `polyfill`

**注意:** 在这种模式下,默认不会去分析 `node_modules` 里的代码,如果需要的话,请看 `compileDependencies` 字段相关的说明,添加相关需要编译的依赖。

#### polyfill: false
不引入任何 `polyfill`

```json
{
"polyfill": false
}
```

### injectBabel

**已废弃**,请使用 `polyfill` 替代。

- 类型:`string`
- 默认值:`polyfill`

Expand Down
4 changes: 1 addition & 3 deletions docs/guide/basic/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ export default {

### 在模型中调用 service

> 结合 [状态管理文档](/docs/guide/basic/store) 使用
* `service`:约定数据请求统一管理在 services 目录下;
* `model`:约定数据请求统一在 models 里进行调用;
* `view`:最终在视图里通过调用 models 的 effects 的方法触发数据请求。
Expand Down Expand Up @@ -107,7 +105,7 @@ export default {

```ts
import React, { useEffect } from 'react';
import store from '@/store';
import { store } from 'ice';

const HomePage = () => {
// 调用定义的 user 模型
Expand Down
Loading

0 comments on commit 5cd39bb

Please sign in to comment.