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

[Part2] 兼容 component1/component2 适配度 #1098

Merged
merged 14 commits into from
Feb 6, 2024

Conversation

imsenyu
Copy link
Collaborator

@imsenyu imsenyu commented Feb 5, 2024

第二批,如下组件的 Hooks 实现均只有 Event(和计算属性),需要处理好支付宝/微信双端的 props/properties/methods/sjs,并保持 XML 编译不变

  • Badge
  • ActionSheet
  • CheckListItem
  • Grid
  • Mask
  • Modal
  • Button

支付宝微信双边回归完成后会打钩

Copy link
Contributor

github-actions bot commented Feb 5, 2024

🎊 PR Preview d09288a has been successfully built and deployed to https://ant-design-ant-design-mini-preview-pr-1098.surge.sh

🕐 Build time: 275.574s

🤖 By surge-preview

@imsenyu imsenyu changed the title [Part2] 兼容 component1/component2 适配度 WIP: [Part2] 兼容 component1/component2 适配度 Feb 5, 2024
@imsenyu imsenyu requested a review from bytemain February 5, 2024 14:07
@imsenyu imsenyu assigned HadesTang, xrkffgg and imsenyu and unassigned HadesTang and xrkffgg Feb 5, 2024
@imsenyu
Copy link
Collaborator Author

imsenyu commented Feb 5, 2024

  • 微信 demo 中 Grid onTap 触发了2次,一次是 e.currentTarget.dataset.item 另一次是 e.target.dataset.item 与本次改动无关

@imsenyu
Copy link
Collaborator Author

imsenyu commented Feb 5, 2024

  • 微信 CheckListItem 的 this.props.item 在微信需要处理成 this.properties/data.item

@ottomao
Copy link
Collaborator

ottomao commented Feb 6, 2024

本质需求是兼容 component1 模式的小程序,对吧?

未来如果这批组件里要增加一些逻辑,可能又得切到 functional 的方案上,这时候会产生 breaking change、开发者无法自动升级了

antd-mini v1 升级 v2 的时候,为了避免可能的概念混淆,我们强行要求大家启用 component2 ( https://mini.ant.design/guide/migration-v2 )。现在是有已知的无法升级反馈么?

@imsenyu
Copy link
Collaborator Author

imsenyu commented Feb 6, 2024

本质需求是兼容 component1 模式的小程序,对吧?

未来如果这批组件里要增加一些逻辑,可能又得切到 functional 的方案上,这时候会产生 breaking change、开发者无法自动升级了

antd-mini v1 升级 v2 的时候,为了避免可能的概念混淆,我们强行要求大家启用 component2 ( https://mini.ant.design/guide/migration-v2 )。现在是有已知的无法升级反馈么?

有很多待办的事情,包括组件执行及渲染性能优化、多渲染平台样式适配、component1/基础库1.0/基础库2.0低版本适配、集成测试运行环境。以上问题可以归纳为 2 个疑惑

  1. component2 对小程序生态的影响
  2. 新增能力对 functional-mini 的依赖

1: 不应该以 component1/2 作为界定判断标准,准确地来说,基础库1.0的component2功能正确性比基础库2.0的component2正确性差很多(尤其是在使用slot的事情),基础库2.0在最近2年的版本内支持了 sjs事件,observers,lifetimes,relations 等生态上有需求的功能。对于一个面向生态的组件库来说,应该做到的是「如果当前基础库支持,直接用;如果当前基础库不支持(包括基础库1.0、钉钉低版本但开发者无法升级)等情况,降级功能达到可用。

实际案例在 匿名(公网不透出) 升级 component2 已经排了半年了,到现在还没开工,一回归就出问题
「为了避免可能的概念混淆,我们强行要求大家启用 component2」在小程序生态上是有损的,只有维护者开心而已。

  1. 功能怎么样都能实现,新增能力如果要使用 XML、基础库底层能力,不用 functional-mini 更容易。对于 functional-mini 而言, 在实际的业务中得到验证和改进可能更重要。可以先看下在体验、效能、成本这三个维度上 functional-mini 解决了哪些问题,又可能带来哪些新的问题,性能有没有变好,自身开发效率有没有变快,开发者接入有没有门槛,问题排查有没有变复杂

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f793c45) 89.96% compared to head (d09288a) 89.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1098      +/-   ##
==========================================
- Coverage   89.96%   89.95%   -0.02%     
==========================================
  Files         150      150              
  Lines        3677     3672       -5     
  Branches      912      913       +1     
==========================================
- Hits         3308     3303       -5     
  Misses        316      316              
  Partials       53       53              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ottomao
Copy link
Collaborator

ottomao commented Feb 6, 2024

  1. functional-mini 是实验性的功能,接受大家争议讨论 ( Ref: https://github.com/ant-design/functional-mini )
  2. 「开发者开心」是非常重要的事情,这是我们维护的动力
  3. 维护一个小程序库好难,瞻前顾后,新特性上了还要管各种老库。累了...

@imsenyu imsenyu changed the title WIP: [Part2] 兼容 component1/component2 适配度 [Part2] 兼容 component1/component2 适配度 Feb 6, 2024
@imsenyu
Copy link
Collaborator Author

imsenyu commented Feb 6, 2024

  1. functional-mini 是实验性的功能,接受大家争议讨论 ( Ref: https://github.com/ant-design/functional-mini )
  2. 「开发者开心」是非常重要的事情,这是我们维护的动力
  3. 维护一个小程序库好难,瞻前顾后,新特性上了还要管各种老库。累了...

那就优化下这个 #1099

@DiamondYuan DiamondYuan merged commit c5b8d92 into master Feb 6, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

5 participants