Skip to content

WIP: feat: upgrade to vue-tsc v3#2134

Draft
Y0me wants to merge 12 commits intounovue:v2from
Y0me:2043-better-typecheck
Draft

WIP: feat: upgrade to vue-tsc v3#2134
Y0me wants to merge 12 commits intounovue:v2from
Y0me:2043-better-typecheck

Conversation

@Y0me
Copy link
Contributor

@Y0me Y0me commented Aug 26, 2025

This PR begins addressing #2043 (opened by @cyyynthia) by upgrading to Vue Language Services v3 and starting to resolve the typing issues it surfaces.

What’s inside :

  • packages/core -> vue-tsc@3.0.6 for type-checking.
  • initial fixes for type-safety issues across components, mostly around event typing and safer element handling.
  • introduced new DOM utilities to replace unsafe casts (need to check if this affects performance, especially in Slider component).

Notes :

  • New DOM helpers are strictly typed for HTMLElement, which excludes SVGElement. This shouldn’t affect most use cases, but it’s worth keeping in mind if any components interact with SVG nodes.

This is still a WIP — I haven’t had time to fully test everything yet. Most changes are small and localized, but I’d really appreciate feedback and a fresh pair of eyes to help bring this across the finish line.

@Y0me Y0me changed the title WIP: vue-tsc v3 upgrade and type-safety/readability improvements WIP: vue-tsc v3 upgrade Aug 26, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 26, 2025

Open in StackBlitz

npm i https://pkg.pr.new/reka-ui@2134

commit: 392efba

@Y0me Y0me changed the title WIP: vue-tsc v3 upgrade WIP: feat: upgrade to vue-tsc v3 Aug 26, 2025
Copy link
Contributor

@cyyynthia cyyynthia left a comment

Choose a reason for hiding this comment

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

Disclaimer: I'm not a maintainer and don't speak on behalf of the Reka maintainers or the unovue team 😅

* @param vnode - An Element or Vue ComponentPublicInstance, or null.
* @returns The corresponding HTMLElement if available, otherwise undefined.
*/
export function getHTMLElementFromVNode(vnode: Element | ComponentPublicInstance | null): HTMLElement | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since Reka already heavily leverages vueuse it might be a good idea to rely on their helpers instead, which are compatible with SVG elements

https://vueuse.org/core/unrefElement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will look into that this week

:ref="(node: ComponentPublicInstance) => {
headFocusProxyRef = unrefElement(node) as HTMLElement
return undefined
:ref="(node) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure how to feel about these refs; would perhaps be better to keep the raw ref and unwrap when needed..? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Moving the handlers out of the template is a good idea imho, perhaps it'd be a good idea to also do this change in other files? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, wanting to do that for other files too... But motivation at this time of day was falling apart. 😅

@Y0me Y0me requested a review from cyyynthia September 1, 2025 07:04
@Y0me Y0me marked this pull request as draft September 1, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants