-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
fix(runtime-core): add undefined
to NativeType
type (fix #13593)
#13594
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe type alias Changes
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🪛 Biome (1.9.4)packages/runtime-core/src/apiSetupHelpers.ts[error] 329-329: Don't use 'Function' as a type. Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs. (lint/complexity/noBannedTypes) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
undefined
to NativeType
typeundefined
to NativeType
type (fix #13593)
undefined
to NativeType
type (fix #13593)undefined
to NativeType
type (fix #13593)
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Fixes: #13593
See that issue for more information
The
InferDefault
type filters out any type that isn't listed inNativeType
, and instead requests a function that returns the type intersected with an empty object ({}
). However, the intersection with an empty object discardsnull
andundefined
(According to the docs). This isn't an issue fornull
, because it is explicitly listed as aNativeType
, however this causes an issue forundefined
.Currently, when
exactOptionalPropertyTypes
andstrictNullChecks
are true, you cannot set a prop's default value toundefined
even if it's listed as a possible type. This fixes the issue by explicitly letting it be a default valueSummary by CodeRabbit