-
-
Notifications
You must be signed in to change notification settings - Fork 9k
feat(runtime-vapor): implement defineVaporComponent types #13831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
❌ Deploy Preview for vue-sfc-playground failed. Why did it fail? →
|
1511253 to
3b73568
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements comprehensive TypeScript type definitions for defineVaporComponent with support for both functional and object-based component definitions. It adds strong typing for props, emits, slots, and expose mechanisms, while also enabling co-usage of Vapor and VDom by adjusting JSX type definitions.
- Enhanced type inference: Added
DefineVaporComponentand related types with full generic support for props, emits, slots, and exposed values - Improved component signatures: Updated
VaporComponentInstance,FunctionalVaporComponent, andObjectVaporComponentwith proper generic parameters - JSX compatibility: Modified constructor signatures to use
new (props?: P)pattern, enabling Vapor and VDom co-usage in JSX
Reviewed changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime-vapor/src/apiDefineComponent.ts | Adds comprehensive type overloads and exports for defineVaporComponent |
| packages/runtime-vapor/src/component.ts | Updates component types with generic parameters for props, emits, slots, and exposed values |
| packages/runtime-vapor/src/index.ts | Exports new type definitions for public API |
| packages/runtime-vapor/src/fragment.ts | Renames internal render method to renderBranch for clarity |
| packages/runtime-vapor/src/components/Transition.ts | Updates function signature and return type consistency |
| packages/runtime-core/src/h.ts | Updates constructor signature to new (props?: P) pattern |
| packages/runtime-core/src/components/*.ts | Updates constructor signatures for Teleport, Suspense, KeepAlive |
| packages-private/dts-test/vapor/*.tsx | Adds comprehensive type tests for new Vapor component types |
| packages-private/dts-test/tsconfig.test.json | Configures JSX types for testing |
| test files | Adds String() conversions and type assertions where needed for stricter types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // @ts-expect-error wrong prop types | ||
| c = <MyComponent a={'wrong type'} b="foo" dd={{ n: 1 }} ddd={['foo']} /> | ||
| // @ts-expect-error wrong prop types | ||
| c = <MyComponent ggg="baz" /> |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value assigned to c here is unused.
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
… method for consistency.
JSX.ElementAttributesPropertyandJSX.ElementClassto support Vapor and VDom co-usage.Using the constructor's first parameter as JSX props instead.