Open
Conversation
a43ea2e to
5c386ab
Compare
weareoutman
requested changes
Sep 14, 2022
| * const {Mention,users,loading,updateConfig,updateUserOrInstanceId} = useMention("fakeUserName", config) | ||
| * return <> | ||
| * {Mention} | ||
| * </> |
Member
Author
There was a problem hiding this comment.
我觉得做成钩子灵活点,有更多组合,可以不使用内置的Mention组件,只借助其搜索users的能力也可以自己拼出来类似Mention组件。
Member
There was a problem hiding this comment.
但你这个钩子已经集成了 Mention 组件,用户如果要自定义它,那么这里实际会额外渲染一个用不上的内置 Mention 组件,这是完全不需要的开销。要么你的钩子就不要自带 Mention 组件,另外封装一个组件来调用你的这个钩子,由这个组件去带上 Mention,而不是这个钩子。
Member
There was a problem hiding this comment.
我感觉有点过度设计了,如果现阶段没有明确需要复用它的地方,不用着急把它抽出来并把它做成一个非常抽象的接口,可以先在构件那边实现,需要复用的时候再拎出来。
Member
Author
There was a problem hiding this comment.
那打算放在哪个仓库?
不只是agile的comment构件,业务构件也有用到Mention,都是自己实现的,设计也许前后也不一样,我这样改也是有一个统一的标准,同时也不失灵活性。
Member
There was a problem hiding this comment.
那可以加一个 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
依赖检查
组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。
请勾选以下两组选项其中之一:
或者:
提交信息检查
Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。
破坏性变更:
feat作为提交类型。BREAKING CHANGE: 你的变更说明。新特性:
feat作为提交类型。问题修复:
fix作为提交类型。杂项工作:
即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:
chore,docs,test等作为提交类型。