-
Notifications
You must be signed in to change notification settings - Fork 2
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
Alex/use avatar #418
base: master
Are you sure you want to change the base?
Alex/use avatar #418
Conversation
a43ea2e
to
5c386ab
Compare
* const {Mention,users,loading,updateConfig,updateUserOrInstanceId} = useMention("fakeUserName", config) | ||
* return <> | ||
* {Mention} | ||
* </> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我感觉这个更适合做成一个组件,而不是钩子
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得做成钩子灵活点,有更多组合,可以不使用内置的Mention
组件,只借助其搜索users的能力也可以自己拼出来类似Mention
组件。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
但你这个钩子已经集成了 Mention
组件,用户如果要自定义它,那么这里实际会额外渲染一个用不上的内置 Mention
组件,这是完全不需要的开销。要么你的钩子就不要自带 Mention 组件,另外封装一个组件来调用你的这个钩子,由这个组件去带上 Mention
,而不是这个钩子。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我感觉有点过度设计了,如果现阶段没有明确需要复用它的地方,不用着急把它抽出来并把它做成一个非常抽象的接口,可以先在构件那边实现,需要复用的时候再拎出来。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那打算放在哪个仓库?
不只是agile的comment构件,业务构件也有用到Mention
,都是自己实现的,设计也许前后也不一样,我这样改也是有一个统一的标准,同时也不失灵活性。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那可以加一个 libs/user-components
吧,记得在实现上区分组件与钩子,不要把组件混到钩子里了。
libs/hooks/src/useUserInfoByNameOrInstanceId/useUserInfoByNameOrInstanceId.ts
Show resolved
Hide resolved
BREAKING CHANGE Closes INFRA-001
Closes INFRA-001
5c386ab
to
ed7e52e
Compare
依赖检查
组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。
请勾选以下两组选项其中之一:
或者:
提交信息检查
Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。
破坏性变更:
feat
作为提交类型。BREAKING CHANGE: 你的变更说明
。新特性:
feat
作为提交类型。问题修复:
fix
作为提交类型。杂项工作:
即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:
chore
,docs
,test
等作为提交类型。