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

TD Mono: component optimization #5047

Open
zhangpaopao0609 opened this issue Feb 19, 2025 · 5 comments
Open

TD Mono: component optimization #5047

zhangpaopao0609 opened this issue Feb 19, 2025 · 5 comments
Assignees
Labels
monorepo monorepo

Comments

@zhangpaopao0609
Copy link
Collaborator

zhangpaopao0609 commented Feb 19, 2025

你建议的方案是什么

组件写法优化。

前置说明:仅第 1.1 点是必须要修改的,其它点都可以不做,在这里只是提出,如果可以做,就顺便一起了

提议如下:

1. 手动修改的部分

  1. 组件修改为 script setup return 的模式(现存部分组件是用的 render 函数)
    Image
  2. 组件存在额外 types.tsinterface.ts 的,全部修改为 types/xx.ts(待命名)
  3. 组件存在 const.ts 的,全部修改为 const/index.ts
  4. 组件存在 hook 的,全部挪动到 hooks/*.ts,如存在多个,加上 hooks/index.ts
  5. 组件存在 util 的,全部挪动到 utils/*.ts,如存在多个,加上 utils/index.ts
  6. 如非必要,请统一写法(props不需要解构,也不需要额外空行)
    Image

2. 生成的部分

  1. 收拢 doc,修改为 _docs/*.md
  2. 收拢 props,修改为 props/*.ts
  3. 收拢 types,修改为 types/*.ts (这个还没想好,额外的和生成的肯定放一起,但命名?)
Copy link
Contributor

👋 @zhangpaopao0609,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@zhangpaopao0609 zhangpaopao0609 changed the title TD Mono: components optimize TD Mono: component optimization Feb 19, 2025
@zhangpaopao0609 zhangpaopao0609 added the monorepo monorepo label Feb 19, 2025
@uyarn

This comment has been minimized.

@chaishi

This comment has been minimized.

@uyarn uyarn added the 💭 discussion we are discussing label Feb 20, 2025
@zhangpaopao0609

This comment has been minimized.

@zhangpaopao0609
Copy link
Collaborator Author

zhangpaopao0609 commented Feb 21, 2025

@uyarn 讨论后,决定先修改第 1 部分的内容,第 2 部分保留意见,本次不做处理。

第 1 部分处理结论如下:

  1. 确认修改为 script setup return 的模式,可参考 affix checkbox` 等组件的处理方式
  2. 组件存在额外 types.tsinterface.ts 的,统一修改为 types.ts
  3. 组件存在 const.ts 的,统一修改为 consts/index.ts
  4. 组件存在 hook 的,全部挪动到 hooks/*.ts,如存在多个,加上 hooks/index.ts
  5. 组件存在 util 的,全部挪动到 utils/*.ts,如存在多个,加上 utils/index.ts
  6. 如非必要,统一写法(props不需要解构,也不需要额外空行)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
monorepo monorepo
Projects
None yet
Development

No branches or pull requests

3 participants