types(jsx): improve autocomplete type#14237
Conversation
WalkthroughAdds multiple TypeScript type aliases describing HTML autocomplete/autofill tokens in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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: |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/runtime-dom/src/jsx.ts (1)
626-629: LGTM!The updated type provides better autocomplete suggestions while maintaining backward compatibility.
For consistency, consider applying
InputAutoCompleteAttributeto other elements that support theautocompleteattribute in a follow-up PR:
FormHTMLAttributes.autocomplete(line 484)SelectHTMLAttributes.autocomplete(line 799)TextareaHTMLAttributes.autocomplete(line 833)These currently use
string | undefined.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/runtime-dom/src/jsx.ts
⏰ 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). (1)
- GitHub Check: test / e2e-test
🔇 Additional comments (1)
packages/runtime-dom/src/jsx.ts (1)
564-624: Well-structured autocomplete type definitions following established patterns.The type definitions correctly model the HTML autofill field names with composable template literal types. The approach mirrors the existing
InputTypeHTMLAttributepattern on lines 539-562, and the(string & {})escape hatch ensures backward compatibility while providing autocomplete for known values.Only exporting
InputAutoCompleteAttributewhile keeping intermediate types internal is the right call, as per the previous review feedback.
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
|
This caused some of my components which declared props with I could only fix this by omitting In particular this is the part that's problematic: `${OptionalPrefixToken<AutoFillSection>}${OptionalPrefixToken<AutoFillAddressKind>}${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}`removing the prefix tokens also makes the errors go away: `${AutoFillField}${OptionalPostfixToken<AutoFillCredentialField>}` |
Thanks for reporting this. I think it’s related to #10514 , but I’m not sure whether there’s a fix plan. |
## [0.3.21](v0.3.20...v0.3.21) (2026-02-09) ### 🐛 Fixes #### fixed Recorder animation ([37daf6e](37daf6e)) #### workaround for @vuejs/core/14237 ([f6a27db](f6a27db)) vuejs/core#14237
The code is sourced from DefinitelyTyped
Summary by CodeRabbit
autocompleteattributes, offering richer, more specific autocomplete options and stronger typing for billing, shipping, contact, and credential-related form fields — enhancing IDE suggestions and reducing form-related type errors.✏️ Tip: You can customize this high-level summary in your review settings.