Skip to content

docs: add TypeScript example for writing plugins - #3457

Open
pooridev wants to merge 1 commit into
vuejs:mainfrom
pooridev:docs/typescript-plugin-example
Open

docs: add TypeScript example for writing plugins#3457
pooridev wants to merge 1 commit into
vuejs:mainfrom
pooridev:docs/typescript-plugin-example

Conversation

@pooridev

Copy link
Copy Markdown

Description of Problem

The Writing a Plugin guide only shows JavaScript. After Vue 3.4, app.use() is typed against Plugin, so a plain { install } object often fails type-checking unless it is annotated. Maintainers asked for a short TypeScript subsection rather than sending people to Discord.

Fixes #2729

Proposed Solution

Add a TypeScript subsection with the public Plugin type and satisfies Plugin (and a named-export variant), matching the pattern already used for custom directives. Also note that types should be imported from vue, not internal runtime-core paths.

Additional Information

The satisfies Plugin example is the one @brc-dd suggested on the issue. No runtime change.

Test plan

  • Preview the Plugins page and confirm the new TypeScript subsection renders next to the existing JS examples
  • Confirm the Plugin API link resolves

Made with Cursor

Show how to type a plugin with Plugin and satisfies so app.use()
accepts it without casts. Fixes vuejs#2729.

Co-authored-by: Cursor <cursoragent@cursor.com>
@netlify

netlify Bot commented Aug 16, 2026

Copy link
Copy Markdown

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit 83e567f
🔍 Latest deploy log https://app.netlify.com/projects/vuejs/deploys/6a823adb2f6ad900089352fa
😎 Deploy Preview https://deploy-preview-3457--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.

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.

Custom plugin in Typescript after Vue 3.4 update

1 participant