Skip to content

Conversation

@jeffwcx
Copy link
Contributor

@jeffwcx jeffwcx commented May 22, 2025

Summary by CodeRabbit

  • New Features

    • Added support for enterkeyhint across more HTML elements.
    • Added global HTML attributes exportparts and part.
    • Added fetchpriority attribute for images.
    • Enabled use of the SVG set element.
  • Deprecated / Removed

    • CamelCase enterKeyHint kept as deprecated alias.
    • Input-specific enterkeyhint/enterKeyHint entries removed.

- Move `enterKeyHint`, `exportparts`, and `part` attributes to `HTMLAttributes`.
- Added `fetchpriority` attribute to `ImgHTMLAttributes`.
- Updated `IntrinsicElementAttributes` to include `set` element support.
@coderabbitai
Copy link

coderabbitai bot commented May 22, 2025

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

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.

@jeffwcx
Copy link
Contributor Author

jeffwcx commented May 22, 2025

@johnsoncodehk @sxzz

@KazariEX KazariEX added scope: types 🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. labels May 22, 2025
@github-actions
Copy link

github-actions bot commented May 22, 2025

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented May 22, 2025

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

@edison1105 edison1105 added the ready to merge The PR is ready to be merged. label May 22, 2025
@edison1105 edison1105 changed the title feat(types): add new HTML attributes for improved JSX support fix(types): add new HTML attributes for improved JSX support Nov 18, 2025
@edison1105 edison1105 changed the title fix(types): add new HTML attributes for improved JSX support types(jsx): add new HTML attributes for improved JSX support Nov 18, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/runtime-dom/src/jsx.ts (1)

362-369: Global exportparts and part attributes are appropriately exposed

Adding exportparts and part as string-typed global HTML attributes matches their usage for web components and fits the existing typing approach in this interface.

If you want stricter consistency with nearby attributes (e.g. id?: string | undefined), you could also add | undefined to both types, but the current form is functionally fine.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce753e2 and 56ec249.

📒 Files selected for processing (1)
  • packages/runtime-dom/src/jsx.ts (4 hunks)
⏰ 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). (6)
  • GitHub Check: test / lint-and-test-dts
  • GitHub Check: test / e2e-test
  • GitHub Check: test / unit-test
  • GitHub Check: test / unit-test-windows
  • GitHub Check: continuous-release
  • GitHub Check: autofix
🔇 Additional comments (2)
packages/runtime-dom/src/jsx.ts (2)

289-301: Canonical enterkeyhint + deprecated enterKeyHint alias look correct

Using lowercase enterkeyhint as the primary attribute and a deprecated enterKeyHint alias typed via HTMLAttributes['enterkeyhint'] is consistent with the rest of this file and avoids duplication while keeping backwards compatibility.


1304-1304: Adding set to intrinsic SVG elements completes coverage

Including set: SVGAttributes alongside the other SVG animation elements (e.g. animate, animateTransform) is consistent with the existing mapping and improves JSX coverage for SVG.

Copy link

@coderabbitai coderabbitai bot left a 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/runtime-dom/src/jsx.ts (1)

362-369: Add | undefined to exportparts and part for consistency.

Both attributes should include | undefined to match the pattern used by all other optional string attributes in HTMLAttributes (e.g., accesskey, dir, id, lang, title).

Apply this diff:

   /**
    * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts
    */
-  exportparts?: string
+  exportparts?: string | undefined
   /**
    * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part
    */
-  part?: string
+  part?: string | undefined
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56ec249 and 3237554.

📒 Files selected for processing (1)
  • packages/runtime-dom/src/jsx.ts (4 hunks)
⏰ 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). (2)
  • GitHub Check: test / e2e-test
  • GitHub Check: test / unit-test-windows
🔇 Additional comments (3)
packages/runtime-dom/src/jsx.ts (3)

289-301: Excellent resolution of the casing issue!

The lowercase enterkeyhint as the primary attribute with a deprecated camelCase enterKeyHint alias properly addresses the previous review concern. This follows the file's convention of using lowercase for HTML attributes while providing backward compatibility.


522-522: LGTM!

The fetchpriority attribute correctly includes | undefined and is consistent with other optional union-type attributes in ImgHTMLAttributes.


1304-1304: Addition of set element is correct.

The <set> element is one of the four standard SVG animation elements, and the mapping to SVGAttributes is appropriate. Verification confirms SVGAttributes is properly defined and exported at line 849, with no conflicts in the codebase.

@edison1105 edison1105 merged commit 3942dbe into vuejs:main Nov 18, 2025
14 checks passed
@haoqunjiang
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍰 p2-nice-to-have Priority 2: this is not breaking anything but nice to have it addressed. ready to merge The PR is ready to be merged. scope: types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants