-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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(warn): avoid warning on empty children with Suspense #3962
Conversation
@@ -26,7 +26,7 @@ export function resolveComponent( | |||
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name | |||
} | |||
|
|||
export const NULL_DYNAMIC_COMPONENT = Symbol() | |||
export const NULL_DYNAMIC_COMPONENT = Symbol(__DEV__ ? 'Null' : undefined) |
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.
I did this to make it Similar to Text
, Static
, and other existing symbols in vnode.ts. It could also be moved with the other existing vnodes
Size report
|
@@ -104,6 +104,7 @@ export type VNodeProps = { | |||
|
|||
type VNodeChildAtom = | |||
| VNode | |||
| typeof NULL_DYNAMIC_COMPONENT |
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.
This turns out to be possible so I added it
019bd78
to
81dc090
Compare
Would be nice to merge this PR if it's ready, or maybe keep the related issue #4016 open. |
Could you bump this one? So far this warning generated probably a few terabytes of logs. |
e09f847
to
ed587e3
Compare
Size ReportBundles
Usages
|
The actual use case comes from Vue Router when doing:
Component
will benull
initially (initial navigation) or when nothing is matched. The warning could be avoided by using<component v-if="Component" :is="Component" />
but I think having the warn could be confusing for users as they would be looking for a multi-node root they don't haveI also added missing tests for the existing warning