-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix: Fix the judgment logic of isHomePage in QIANKUN #11265
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #11265 +/- ##
==========================================
+ Coverage 29.01% 29.15% +0.13%
==========================================
Files 484 483 -1
Lines 14708 14607 -101
Branches 3474 3447 -27
==========================================
- Hits 4268 4258 -10
+ Misses 9683 9601 -82
+ Partials 757 748 -9 ☔ View full report in Codecov by Sentry. |
@@ -31,10 +33,12 @@ export default (props: any) => { | |||
}, []); | |||
|
|||
const { title, description } = props.themeConfig; | |||
|
|||
const location = useLocation?.(); |
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.
会的。没有加的话测试用例报错。如果使用了 mpa 模式也会出问题。
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.
后面 umi 文档应该要迁移到 dumi ,这个地方感觉不太优雅。
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.
之前用 try-catch 搞了一个版本,感觉太丑了,就换成可选链了。
要不先合了?如果微前端部署的话,home page 判断错误,永远跳不了主页了。
isHomePage 的判断逻辑漏掉了以微前端方式部署 doc 时情况。