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

前端代码质量工程 #14

Open
winixt opened this issue Aug 7, 2021 · 0 comments
Open

前端代码质量工程 #14

winixt opened this issue Aug 7, 2021 · 0 comments

Comments

@winixt
Copy link
Owner

winixt commented Aug 7, 2021

为什么需要有代码质量工程?

一个团队逐步壮大之后,因为开发人员风格各异、需求的毒打、协调沟通等问题,代码熵增的速度会急剧上升,直接表现就是线上问题频发。

如何在团队不断壮大,需求不断增加,对研发效率要求越来越高的前提下,保障(甚至提升)我们的代码质量?

一、代码质量检测 workflow

定制从代码编写,到提交到远程仓库的工作流。

  1. 定制团队代码规范,包括 ts、js、css 等。

  2. 配套代码规范的格式化 + 检测工具:prettier + eslint + styleLint 等。

  3. 沉淀团队代码最佳实践到代码扫描工具,并将此工具集成到 ci 流程。

  4. Code Review

二、基础能力沉淀

基础能力的沉淀不仅仅是代码,还需要配套的单元测试、高质量的文档。文档查阅次数 必定 >>>>>> 代码查阅次数。

  1. 应用框架沉淀 fesjs
  2. 通用功能函数沉淀 we-utils
  3. 基础组件库沉淀 we-design
  4. 通用复杂聚合组件 we-components
  5. 公共业务逻辑沉淀 we-use
  6. 公共业务组件沉淀 wb-components

三、业务测约定

跟业务方达成共识,共同约定一些能共同或者通用的东西,方便后续做自动化和代码生成。

  1. 约定需求文档格式,使得需求文档能够通过代码进行拆解分析
  2. 沉淀通用需求属性(page / 查询等)

四、质量与效率齐飞

基于上述基础能力的沉淀,在某些垂直领域、甚至通用场景,实现更高的逻辑聚合能力。例如:代码生成、页面生成。

  1. 接口文档 + 需求文档(作为接口文档的补充) > (推导) > 前端页面
  2. 页面搭建
  3. ???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant