Skip to content

Conversation

@johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Feb 24, 2025

This PR is all about improving the implementations of defineComponent type inference. It's not a complete rewrite because we can't aggressively rewrite or remove existing types/interfaces to maintain backward compatibility (if we have plans for Vue 4 we can revisit that.)

Improvements / Changes

  • TS completion in component options is 40% faster
  • The "this" type in data and props options is more accurate
  • New DefineComponent2 type passes the structured component options type parameter as is, which streamlined .d.ts output on tsc emit: props types are now printed as is to .d.ts, same types are no longer serialized to multiple parameters in DefineComponent (reduce about 35% code in naive-ui .d.ts)
  • Tsc performance improved by about 8% in elk repo
  • Prop options (type, required, default, validator) can now navigate to TS definitions
  • emits: {} is now correctly handled as an empty event set
  • Simplified mixins, extends options inference (no longer using ComponentOptionsMixin intermediate type)
  • Simplify h function overloads (remove dependency on helper types such as DefineComponent, ConcreteComponent, etc.)

@johnsoncodehk
Copy link
Member Author

/ecosystem-ci run

@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vuejs vuejs deleted a comment from johnsoncodehk Mar 31, 2025
@vue-bot
Copy link
Contributor

vue-bot commented Mar 31, 2025

📝 Ran ecosystem CI: Open

suite result latest scheduled
pinia success success
router success success
primevue success success
nuxt success success
quasar success success
language-tools success success
vite-plugin-vue success success
vue-simple-compiler success success
vitepress success success
test-utils success success
vue-i18n success success
vueuse success success
vue-macros success success
vant success success
vuetify success success
radix-vue success success

@coderabbitai
Copy link

coderabbitai bot commented Jul 15, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@GeoffreyParrier
Copy link

Sorry to bother but will this be added to 3.6?
Asking in case it's lost down the PRs list as it isn't added to Next Minor (view)

@edison1105 edison1105 moved this to Todo in Next Minor Nov 6, 2025
: T['props']
: {}
> &
T['__typeProps'] &
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
T['__typeProps'] &
IfAny<T['__typeProps'], {}, T['__typeProps']> &

fix vuejs/language-tools#5420 (comment)

@johnsoncodehk johnsoncodehk marked this pull request as draft December 5, 2025 16:43
@KazariEX
Copy link
Member

KazariEX commented Dec 6, 2025

Minimal repro of the latest ci error.

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

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

6 participants