feat(jsx-runtime): use interface instead of type for ReservedProps
closed #12384
Summary by CodeRabbit
-
Refactor
- Updated internal type declarations for improved extensibility. No changes to user-facing features or behavior.
Size Report
Bundles
| File | Size | Gzip | Brotli |
|---|---|---|---|
| runtime-dom.global.prod.js | 102 kB | 38.7 kB | 34.8 kB |
| vue.global.prod.js | 160 kB | 58.6 kB | 52.2 kB |
Usages
| Name | Size | Gzip | Brotli |
|---|---|---|---|
| createApp (CAPI only) | 46.8 kB | 18.3 kB | 16.8 kB |
| createApp | 54.9 kB | 21.3 kB | 19.5 kB |
| createSSRApp | 59.1 kB | 23.1 kB | 21 kB |
| defineCustomElement | 60.3 kB | 23 kB | 21 kB |
| overall | 69.1 kB | 26.5 kB | 24.2 kB |
@vue/compiler-core
npm i https://pkg.pr.new/@vue/compiler-core@12385
@vue/compiler-dom
npm i https://pkg.pr.new/@vue/compiler-dom@12385
@vue/compiler-sfc
npm i https://pkg.pr.new/@vue/compiler-sfc@12385
@vue/compiler-ssr
npm i https://pkg.pr.new/@vue/compiler-ssr@12385
@vue/reactivity
npm i https://pkg.pr.new/@vue/reactivity@12385
@vue/runtime-core
npm i https://pkg.pr.new/@vue/runtime-core@12385
@vue/runtime-dom
npm i https://pkg.pr.new/@vue/runtime-dom@12385
@vue/server-renderer
npm i https://pkg.pr.new/@vue/server-renderer@12385
@vue/shared
npm i https://pkg.pr.new/@vue/shared@12385
vue
npm i https://pkg.pr.new/vue@12385
@vue/compat
npm i https://pkg.pr.new/@vue/compat@12385
commit: e00f009
[!CAUTION]
Review failed
The pull request is closed.
Walkthrough
The PR converts ReservedProps in packages/runtime-dom/src/jsx.ts from a type alias to an exported interface with the same optional properties (key, ref, ref_for, ref_key), enabling interface merging and module augmentation without changing property types.
Changes
| Cohort / File(s) | Change Summary |
|---|---|
JSX typingspackages/runtime-dom/src/jsx.ts |
ReservedProps changed from export type ReservedProps = { ... } to export interface ReservedProps { ... } (same properties preserved). |
Sequence Diagram(s)
sequenceDiagram
participant User as User code (d.ts)
participant RuntimeJSX as packages/runtime-dom/src/jsx.ts
User->>RuntimeJSX: declare module augmentation adding fields to ReservedProps
Note right of RuntimeJSX: ReservedProps is an interface\nso declaration merging applies
RuntimeJSX-->>User: merged ReservedProps visible to JSX typings
Estimated code review effort
๐ฏ 2 (Simple) | โฑ๏ธ ~10 minutes
- Review focus:
packages/runtime-dom/src/jsx.tsfor correct export and no accidental API surface change. - Verify downstream consumers/typedefs compile (module augmentation works as intended).
Possibly related PRs
- vuejs/core#12771 โ Modifies the same
ReservedPropssymbol inpackages/runtime-dom/src/jsx.ts(adds| undefinedto optional properties); likely related to JSX typings adjustments.
Suggested labels
easy to merge
Suggested reviewers
- jh-leong
Poem
Iโm a rabbit in code, nibbling types with care,
ReservedProps grew ears and now welcomes your flair.
Hop in with augmentations, merge what you please,
JSX fields flourish among interfaces and trees. ๐โจ
โจ Finishing touches
- [ ] ๐ Generate docstrings
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
๐ Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
๐ฅ Commits
Reviewing files that changed from the base of the PR and between e00f0098e4e7364cbc89f9c9942407d4df03011e and f02f79b7c5896596924886c5f755ea48d333e56a.
๐ Files selected for processing (1)
-
packages/runtime-dom/src/jsx.ts(1 hunks)
Comment @coderabbitai help to get the list of available commands and usage tips.