-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
fix(compat): ensure false value on input value retains attribute #13216
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
Conversation
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: |
WalkthroughThe update adjusts the compatibility logic for handling attribute coercion in the runtime. Specifically, it prevents the removal of the Changes
Assessment against linked issues
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure ✨ Finishing Touches
🪧 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 (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/vue-compat/__tests__/misc.spec.ts (1)
219-219
: Consider using a more specific type than 'Function'The static analysis tool flagged the use of
Function
as a type, which is generally discouraged in TypeScript. Consider explicitly defining the function shape for better type safety.- (deprecationData[DeprecationTypes.ATTR_FALSE_VALUE].message as Function)( + (deprecationData[DeprecationTypes.ATTR_FALSE_VALUE].message as (arg: string) => string)(🧰 Tools
🪛 Biome (1.9.4)
[error] 219-219: 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)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (2)
packages/runtime-dom/src/modules/attrs.ts
(1 hunks)packages/vue-compat/__tests__/misc.spec.ts
(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
packages/vue-compat/__tests__/misc.spec.ts
[error] 219-219: 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)
🔇 Additional comments (2)
packages/runtime-dom/src/modules/attrs.ts (1)
82-82
: Good fix for handling false value on input elementsThis change correctly implements an exception for input elements with value="false", ensuring the attribute is retained rather than being removed. This fix addresses the issue where setting a false value on an input would incorrectly remove the attribute entirely.
packages/vue-compat/__tests__/misc.spec.ts (1)
211-223
: Appropriate test case to validate the fixThis test properly verifies that:
- The value attribute is retained when set to false on an input element
- The attribute value is correctly set to the string "false"
- No deprecation warning is emitted in this specific case
The test is well-structured and provides good coverage for the implemented fix.
🧰 Tools
🪛 Biome (1.9.4)
[error] 219-219: 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)
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
close #13205
Summary by CodeRabbit
Bug Fixes
value
attribute from<input>
elements when bound tofalse
, ensuring it remains as"false"
and no warning is shown.Tests
false
to thevalue
attribute on<input>
elements behaves correctly and does not trigger a warning.