Skip to content
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

feat: support suspense event #7053

Open
wants to merge 1 commit into
base: release/next
Choose a base branch
from
Open

Conversation

XXXMrG
Copy link
Collaborator

@XXXMrG XXXMrG commented Feb 21, 2025

#6994

改为使用 performance.mark 以避免事件监听时可能存在的时序问题

@XXXMrG XXXMrG changed the base branch from master to release/next February 21, 2025 06:50
@XXXMrG XXXMrG requested a review from answershuto February 21, 2025 06:51
@@ -156,6 +156,11 @@ export function withSuspense(Component) {
<SuspenseContext.Provider value={suspenseState}>
<Component {...componentProps} />
<Data id={id} />
<script
dangerouslySetInnerHTML={{
__html: `performance && typeof performance.mark === "function" && performance.mark("ice-suspense-loaded", { detail: "suspense:${id}" })`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

我建议是只派发不在这里做实际的“行为”。
比如如果后面的需求改成了“每个边界中所有图片加载完成”的耗时的 mark,那应该怎么改?

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.

2 participants