Conversation
Change-Id: I05940820f391fe0a6ddc2fc09003ec66ad398e20
|
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:
|
.github/workflows/react-versions.yml
Outdated
| 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/')) |
There was a problem hiding this comment.
目前的发布逻辑是:
依赖:只有当上面两个作业都成功后才会执行(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 */ |
There was a problem hiding this comment.
findomNode 这块的修改不能直接照搬 react 19 官网的指南。
ReactDOM.findDOMNode 返回的是原生 dom,但是 Class 组件中通过 ref.current 获取到的是组件实例而非原生 dom。optionsDom 在后续的操作中需要通过 containers 判断真实 dom,所以这里修改前后的 optionsDom 实际并不等价。
There was a problem hiding this comment.
这个是不等价。
但是感觉问题在于,即使是 18 ,也不需要 findDOMNode,除Tooltip组件外的其他组件,这个逻辑其实可以直接换掉。
A组件使用 Popover时的 props.content本身就是具体组件自己传进去的,A组件完全可以在传进去之前加上 ref,不需要通过 findDOMNode找。
Change-Id: Ief96bc72ea2dcfa88a82c04bec19de048a3f2f26
Change-Id: If466319952aec516400931e958fbe9d802558ca3
Change-Id: I6b684a9f6822325e8fb9145b2f55328957250229
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, { |
| @@ -451,7 +456,13 @@ export default class Tooltip extends BaseComponent<TooltipProps, TooltipState> { | |||
| getTriggerNode: () => { | |||
| let triggerDOM = this.triggerEl.current; | |||
There was a problem hiding this comment.
getTriggerNode (456行)和getTriggerDom(489行) 没有啥区别,功能应该是一样的?
| @@ -0,0 +1,117 @@ | |||
| name: React Multi-Version Build and Publish | |||
There was a problem hiding this comment.
对比了下原来的 publish.yml。有以下问题
- 没有和版本号管理相关的逻辑
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(!!!)
-
没有变更检测与自动提交
发布成功,产生新的版本号,相关的逻辑提交到对应分支也是没有的,当然提交应该是需要登陆git账号的? -
其他的一些操作,和测试无关
比如 scripts/sitemap_update.js 脚本执行
Change-Id: I7d78a78dfe47994cbc97cea6b5512bc6880e8506
Change-Id: I660d9e1d68f8063a5e8757220fe57b235f473ea6
… into feat/semi-ui-19 Change-Id: I4b5d6252dcf1bca70cdbff65b6b00fa64c2ceeee



中文模板 / Chinese Template
What kind of change does this PR introduce? (check at least one)
PR description
Fixes #
Changelog
🇨🇳 Chinese
🇺🇸 English
Checklist
Other
Additional information