arco-design-vue icon indicating copy to clipboard operation
arco-design-vue copied to clipboard

Optimization Plan

Open oljc opened this issue 9 months ago • 1 comments

Component Library Optimization

To continuously improve the quality and user experience of the component library, a series of optimization plans have been made, including but not limited to:

1. Adjusting the Monorepo Strategy to Improve Open-Source Library Maintainability

Background: The original lerna + yarn solution has been in use for several years. Based on feedback received, there are many issues that impact the maintenance and contribution experience. Therefore, we plan to optimize this process.

Plan: Migrate to pnpm.

2. Optimization Testing

Background: Currently, jest is used for testing, but as the community versions have evolved, unit tests have not been updated in line with those changes.

  • Low test coverage
  • Flaky tests (inconsistent pass/fail)
  • Outdated tests that have not kept up with recent code changes

Plan: Migrate the test framework to Vitest to take advantage of faster test execution, better support for modern JavaScript features, and improved integration with Vue.js. Why Vitest?

3. Enhancing TypeScript Types

Background: As TypeScript and Vue versions have evolved, there have been issues with incomplete or inaccurate type definitions, which negatively impact developer experience.

Plan: Patch missing or inaccurate types, export necessary types and interfaces, and refine the type definitions to ensure better developer tooling and improve overall type safety.

This issue is used to track and summarize the optimization progress, ensuring the smooth implementation of improvements. If any issues arise, feel free to raise them, and we will actively consider all feedback!


组件库优化

为了不断提升组件库的质量和开发体验,制定了一系列的优化计划,包括但不限于:

1. 调整多包管理策略,提高开源库可维护性

问题背景:原本的lerna + yarn 已经是几年前的方案,期间收到很多反馈存在诸多问题,考虑到影响贡献者的维护和贡献体验计划优化。

计划: 迁移至 pnpm

2. 完善测试,提升代码质量

问题背景:目前使用 jest 进行测试,但随着社区版本的更新变化未及时更新单元测试,导致目的测试存在一些缺失和失败情况,测试效果较差。

  • 覆盖率低
  • 部分单元测试失败,无法稳定通过
  • 测试过时,未及时更新对应单元测试

计划:鉴于本次优化涉及测试文件调整较多,考虑将测试框架迁移至 Vitest。为什么是 Vitest?

3. 完善 TypeScript 类型

问题背景:随着 TypeScript 和 Vue 版本的迭代更新,开发者在使用组件库时可能遇到 TypeScript 类型不准确或不完善的问题。

  • 可能的类型定义缺漏,开发者使用时无法获得类型提示
  • 内部某些变量或函数的类型定义过于宽泛,无法提供准确的类型检查

计划:查缺补漏进行全面的类型修复与更新,查缺补漏完善 TypeScript 类型定义与导出,确保类型定义的准确性,提高开发者使用体验。

本 issue 用于跟踪汇总优化进度,确保各项改进顺利进行。期间如有错误,欢迎提出,积极采纳!

oljc avatar Feb 21 '25 01:02 oljc

  • [x] #3438
    • [x] #3443
  • [ ] Optimization Testing
  • [ ] Type
    • [x] #3474
    • [ ] Optimize component props export

oljc avatar Feb 21 '25 01:02 oljc