Skip to content

Feat/semi UI 19#2991

Closed
zaw929 wants to merge 21 commits intoDouyinFE:mainfrom
zaw929:feat/semi-ui-19
Closed

Feat/semi UI 19#2991
zaw929 wants to merge 21 commits intoDouyinFE:mainfrom
zaw929:feat/semi-ui-19

Conversation

@zaw929
Copy link

@zaw929 zaw929 commented Sep 19, 2025

中文模板 / Chinese Template

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR description

Fixes #

Changelog

🇨🇳 Chinese

  • Fix: 修复 ...

🇺🇸 English

  • Fix: fix ...

Checklist

  • Test or no need
  • Document or no need
  • Changelog or no need

Other

  • Skip Changelog

Additional information

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 19, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ce613ba:

Sandbox Source
pr-story Configuration

@YannLynn YannLynn self-requested a review September 22, 2025 02:50
name: Build and Publish
runs-on: ubuntu-latest
needs: [test-react-18, test-react-19]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/'))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前的发布逻辑是:
依赖:只有当上面两个作业都成功后才会执行(needs: [test-react-18, test-react-19])
条件:仅在 push 且分支为 main 或 release/* 时执行(PR 不会触发)

改成像 workflow/publish.yml 那样的主动触发比较合适。

const triggerDom = this.triggerRef && this.triggerRef.current;
/* REACT_18_START */
const optionsDom = ReactDOM.findDOMNode(optionInstance);
/* REACT_18_END */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

findomNode 这块的修改不能直接照搬 react 19 官网的指南。

ReactDOM.findDOMNode 返回的是原生 dom,但是 Class 组件中通过 ref.current 获取到的是组件实例而非原生 dom。optionsDom 在后续的操作中需要通过 containers 判断真实 dom,所以这里修改前后的 optionsDom 实际并不等价。

Copy link
Collaborator

@pointhalo pointhalo Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是不等价。
但是感觉问题在于,即使是 18 ,也不需要 findDOMNode,除Tooltip组件外的其他组件,这个逻辑其实可以直接换掉。
A组件使用 Popover时的 props.content本身就是具体组件自己传进去的,A组件完全可以在传进去之前加上 ref,不需要通过 findDOMNode找。

zhaoanwei added 3 commits September 22, 2025 19:34
Change-Id: Ief96bc72ea2dcfa88a82c04bec19de048a3f2f26
Change-Id: If466319952aec516400931e958fbe9d802558ca3
@zaw929 zaw929 closed this Sep 23, 2025
@zaw929 zaw929 deleted the feat/semi-ui-19 branch September 23, 2025 09:05
@zaw929 zaw929 restored the feat/semi-ui-19 branch September 23, 2025 09:08
@zaw929 zaw929 reopened this Sep 24, 2025
zhaoanwei added 2 commits September 24, 2025 16:39
Change-Id: I4a80e30a505fb147befa0deeac6e244901af5384
Change-Id: Ib35e6ee04c884b83941073c5681d2b7b87be9b5b
render() {
const child = React.Children.only(this.props.children);
const { ref } = child as any;
return React.cloneElement(child as React.ReactElement, {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image 从child 中拿ref 是不是得参考这个修改下写法

@@ -451,7 +456,13 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> {
getTriggerNode: () => {
let triggerDOM = this.triggerEl.current;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getTriggerNode (456行)和getTriggerDom(489行) 没有啥区别,功能应该是一样的?

@YyumeiZhang
Copy link
Collaborator

ReactElement处理好像不是很全?
image

@@ -0,0 +1,117 @@
name: React Multi-Version Build and Publish
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对比了下原来的 publish.yml。有以下问题

  1. 没有和版本号管理相关的逻辑
    publish.yml
  • 通过 scripts/version.js 生成版本号,并写入环境变量 RELEASE_VERSION。
  • 通过 npm view $PKG_NAME versions --json 获取线上版本列表,写入 VERSION_LIST 环境变量。
  • 通过 lerna version $RELEASE_VERSION ... 统一管理所有包的版本号。

react-versions.yml

  • 没有自动生成/管理版本号的逻辑,发布时直接用 npm publish,没有显式的版本号处理和多包统一版本号管理。发出去就是 latest(!!!)
  1. 没有变更检测与自动提交
    发布成功,产生新的版本号,相关的逻辑提交到对应分支也是没有的,当然提交应该是需要登陆git账号的?

  2. 其他的一些操作,和测试无关
    比如 scripts/sitemap_update.js 脚本执行

@zaw929
Copy link
Author

zaw929 commented Sep 29, 2025

ReactElement在运行时需要兼容,类型定义无需
20250929-114834

zhaoanwei added 3 commits September 29, 2025 19:51
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.

4 participants