-
-
Notifications
You must be signed in to change notification settings - Fork 465
perf(language-core): drop internal component #5532
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
base: master
Are you sure you want to change the base?
Conversation
vue-component-meta
vue-component-type-helpers
@vue/language-core
@vue/language-plugin-pug
@vue/language-server
@vue/language-service
vue-tsc
@vue/typescript-plugin
commit: |
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 a performance improvement by dropping the __VLS_self
internal component variable and refactoring the component type system to use __VLS_export
instead. The changes streamline template type checking and improve TypeScript compilation performance by reducing redundant internal component representations.
Key changes:
- Replace
__VLS_self
with__VLS_export
throughout the codebase - Refactor component type generation to use direct exports instead of internal proxy components
- Update test fixtures to reflect improved type inference (removing unnecessary
| undefined
unions)
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/language-core/lib/codegen/script/componentSelf.ts |
Complete file removal - eliminates internal component self-reference generation |
packages/typescript-plugin/lib/requests/utils.ts |
Updates component type resolution to use __VLS_export instead of __VLS_self |
packages/language-core/lib/codegen/script/index.ts |
Refactors script generation to use const exports and direct component references |
packages/language-core/lib/codegen/script/template.ts |
Major restructuring of template context generation and binding logic |
Test fixtures | Multiple test files updated to reflect improved type inference |
Comments suppressed due to low confidence (1)
packages/tsc/tests/typecheck.spec.ts:15
- The removal of the withScript.vue test case suggests that a previously failing test scenario is no longer being covered. This could indicate that error handling for a specific edge case is no longer being validated.
"test-workspace/tsc/failureFixtures/#5071/withoutScript.vue(2,26): error TS1005: ';' expected.",
return { | ||
name: ts.isVariableDeclaration(parent) ? _getNodeText(parent.name) : undefined, | ||
name: ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name) | ||
? _getNodeText(parent.name) | ||
: undefined, |
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 condition checks for both ts.isVariableDeclaration(parent)
and ts.isIdentifier(parent.name)
but only returns the result of the second check. This could cause a runtime error if parent
is not a variable declaration but the first condition passes, leading to accessing .name
on an incompatible node type.
Copilot uses AI. Check for mistakes.
No description provided.