Skip to content

Comments

docs (#3331): clarify imported types on defineProps#3348

Open
bencodezen wants to merge 1 commit intomainfrom
docs/3331-clarify-imported-types-on-defineProps
Open

docs (#3331): clarify imported types on defineProps#3348
bencodezen wants to merge 1 commit intomainfrom
docs/3331-clarify-imported-types-on-defineProps

Conversation

@bencodezen
Copy link
Member

Description of Problem

#3331

Proposed Solution

Add clarifying language on both the composition-api guide as well as the API doc page as well.

Additional Information

@netlify
Copy link

netlify bot commented Feb 22, 2026

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit 6fe0e07
🔍 Latest deploy log https://app.netlify.com/projects/vuejs/deploys/699b3a214937780009536024
😎 Deploy Preview https://deploy-preview-3348--vuejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Vue TypeScript docs to clarify how defineProps handles imported prop types, addressing confusion around whether “imported types” includes local project files and dependencies.

Changes:

  • Clarifies that Props can be imported via relative imports, path aliases, or external dependencies.
  • Updates script setup API docs to state that imported types can be resolved in dev mode when TypeScript is available.
  • Minor wording tweaks around the Vue 3.3 limitation resolution note.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/guide/typescript/composition-api.md Clarifies imported-type sources for defineProps and adjusts wording around 3.3 limitations.
src/api/sfc-script-setup.md Updates dev-mode inference description for imported types and adjusts wording around 3.3 limitations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

```

This also works if `Props` is imported from an external source. This feature requires TypeScript to be a peer dependency of Vue.
This also works if `Props` is imported from another file such as a relative import, a path alias (e.g,. `@/types`), or an external dependency (e.g., `node_modules`). This feature requires TypeScript to be a peer dependency of Vue.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

Typo in the example punctuation: "(e.g,. @/types)" should be "(e.g., @/types)".

Suggested change
This also works if `Props` is imported from another file such as a relative import, a path alias (e.g,. `@/types`), or an external dependency (e.g., `node_modules`). This feature requires TypeScript to be a peer dependency of Vue.
This also works if `Props` is imported from another file such as a relative import, a path alias (e.g., `@/types`), or an external dependency (e.g., `node_modules`). This feature requires TypeScript to be a peer dependency of Vue.

Copilot uses AI. Check for mistakes.
In version 3.2 and below, the generic type parameter for `defineProps()` were limited to a type literal or a reference to a local interface.

This limitation has been resolved in 3.3. The latest version of Vue supports referencing imported and a limited set of complex types in the type parameter position. However, because the type to runtime conversion is still AST-based, some complex types that require actual type analysis, e.g. conditional types, are not supported. You can use conditional types for the type of a single prop, but not the entire props object.
This limitation was resolved in 3.3. The latest version of Vue supports referencing imported and a limited set of complex types in the type parameter position. However, because the type to runtime conversion is still AST-based, some complex types that require actual type analysis, e.g. conditional types, are not supported. You can use conditional types for the type of a single prop, but not the entire props object.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

Grammar issue: "supports referencing imported and a limited set of complex types" is missing a noun after "imported" (likely "imported types"). As written it reads incorrectly.

Copilot uses AI. Check for mistakes.
- In version 3.2 and below, the generic type parameter for `defineProps()` were limited to a type literal or a reference to a local interface.

This limitation has been resolved in 3.3. The latest version of Vue supports referencing imported and a limited set of complex types in the type parameter position. However, because the type to runtime conversion is still AST-based, some complex types that require actual type analysis, e.g. conditional types, are not supported. You can use conditional types for the type of a single prop, but not the entire props object.
This limitation was resolved in 3.3. The latest version of Vue supports referencing imported and a limited set of complex types in the type parameter position. However, because the type to runtime conversion is still AST-based, some complex types that require actual type analysis, e.g. conditional types, are not supported. You can use conditional types for the type of a single prop, but not the entire props object.
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

Grammar issue: "supports referencing imported and a limited set of complex types" is missing a noun after "imported" (likely "imported types"). As written it reads incorrectly.

Copilot uses AI. Check for mistakes.
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.

1 participant