core
core copied to clipboard
feat(types): add new HTML attributes for improved JSX support
- Move
enterKeyHint,exportparts, andpartattributes toHTMLAttributes. According to https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/70409 - Added
fetchpriorityattribute toImgHTMLAttributes. - Updated
IntrinsicElementAttributesto includesetelement support.
Summary by CodeRabbit
- New Features
- Added support for the
enterKeyHintattribute on more HTML elements. - Introduced support for the global HTML attributes
exportpartsandpart. - Added support for the
fetchpriorityattribute on image elements. - Enabled use of the SVG
setelement.
- Added support for the
Walkthrough
JSX type declarations in packages/runtime-dom/src/jsx.ts were updated: added enterkeyhint, deprecated enterKeyHint alias, added exportparts and part to HTML attributes, added fetchpriority to image attributes, removed enterkeyhint/enterKeyHint from InputHTMLAttributes, and added set: SVGAttributes to intrinsic SVG mappings.
Changes
| Cohort / File(s) | Change Summary |
|---|---|
JSX typingspackages/runtime-dom/src/jsx.ts |
- Added `enterkeyhint?: 'enter' |
Estimated code review effort
π― 3 (Moderate) | β±οΈ ~20 minutes
Potential attention points:
- Ensure deprecated
enterKeyHintalias usage is correctly handled across the codebase. - Verify
fetchpriorityunion matches platform spec and other typings. - Confirm adding
setto SVG intrinsic mappings does not shadow or conflict with existing SVG elements or attributes.
Possibly related PRs
- vuejs/core#14090 β touches
enterkeyhint/enterKeyHinthandling inpackages/runtime-dom/src/jsx.ts, likely overlapping this change.
Poem
I nibble on tokens and types at night,
Hopping through attributes until they're right.
Parts and hints and priorities appear,
An SVGsetbounds safely near.
A joyful rabbit celebrates with a bite π
Pre-merge checks and finishing touches
β Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. |
| Title check | β Passed | The title accurately summarizes the main change: adding new HTML attributes to JSX type definitions for improved support. |
| Docstring Coverage | β Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
β¨ Finishing touches
- [ ] π Generate docstrings
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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 @coderabbitai help to get the list of available commands and usage tips.
@johnsoncodehk @sxzz
Size Report
Bundles
| File | Size | Gzip | Brotli |
|---|---|---|---|
| runtime-dom.global.prod.js | 103 kB | 38.9 kB | 35.1 kB |
| vue.global.prod.js | 161 kB | 58.8 kB | 52.4 kB |
Usages
| Name | Size | Gzip | Brotli |
|---|---|---|---|
| createApp (CAPI only) | 46.9 kB | 18.3 kB | 16.8 kB |
| createApp | 55 kB | 21.4 kB | 19.6 kB |
| createSSRApp | 59.3 kB | 23.1 kB | 21.1 kB |
| defineCustomElement | 60.6 kB | 23.1 kB | 21.1 kB |
| overall | 69.3 kB | 26.6 kB | 24.3 kB |
@vue/compiler-core
npm i https://pkg.pr.new/@vue/compiler-core@13370
@vue/compiler-dom
npm i https://pkg.pr.new/@vue/compiler-dom@13370
@vue/compiler-sfc
npm i https://pkg.pr.new/@vue/compiler-sfc@13370
@vue/compiler-ssr
npm i https://pkg.pr.new/@vue/compiler-ssr@13370
@vue/reactivity
npm i https://pkg.pr.new/@vue/reactivity@13370
@vue/runtime-core
npm i https://pkg.pr.new/@vue/runtime-core@13370
@vue/runtime-dom
npm i https://pkg.pr.new/@vue/runtime-dom@13370
@vue/server-renderer
npm i https://pkg.pr.new/@vue/server-renderer@13370
@vue/shared
npm i https://pkg.pr.new/@vue/shared@13370
vue
npm i https://pkg.pr.new/vue@13370
@vue/compat
npm i https://pkg.pr.new/@vue/compat@13370
commit: 3237554
This breaks Vant's CI: https://github.com/vuejs/ecosystem-ci/actions/runs/19490366056/job/55781263942