core icon indicating copy to clipboard operation
core copied to clipboard

feat(types): add new HTML attributes for improved JSX support

Open jeffwcx opened this issue 6 months ago β€’ 4 comments

  • Move enterKeyHint, exportparts, and part attributes to HTMLAttributes. According to https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/70409
  • Added fetchpriority attribute to ImgHTMLAttributes.
  • Updated IntrinsicElementAttributes to include set element support.

Summary by CodeRabbit

  • New Features
    • Added support for the enterKeyHint attribute on more HTML elements.
    • Introduced support for the global HTML attributes exportparts and part.
    • Added support for the fetchpriority attribute on image elements.
    • Enabled use of the SVG set element.

jeffwcx avatar May 22 '25 04:05 jeffwcx

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 typings
packages/runtime-dom/src/jsx.ts
- Added `enterkeyhint?: 'enter'

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Potential attention points:

  • Ensure deprecated enterKeyHint alias usage is correctly handled across the codebase.
  • Verify fetchpriority union matches platform spec and other typings.
  • Confirm adding set to SVG intrinsic mappings does not shadow or conflict with existing SVG elements or attributes.

Possibly related PRs

  • vuejs/core#14090 β€” touches enterkeyhint / enterKeyHint handling in packages/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 SVG set bounds 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.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar May 22 '25 04:05 coderabbitai[bot]

@johnsoncodehk @sxzz

jeffwcx avatar May 22 '25 04:05 jeffwcx

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

github-actions[bot] avatar May 22 '25 08:05 github-actions[bot]

Open in StackBlitz

@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

pkg-pr-new[bot] avatar May 22 '25 08:05 pkg-pr-new[bot]

This breaks Vant's CI: https://github.com/vuejs/ecosystem-ci/actions/runs/19490366056/job/55781263942

haoqunjiang avatar Nov 19 '25 05:11 haoqunjiang