Skip to content

refactor(client): add type CustomInspectorTab#1082

Open
skirtles-code wants to merge 1 commit intovuejs:mainfrom
skirtles-code:ts-pluginid
Open

refactor(client): add type CustomInspectorTab#1082
skirtles-code wants to merge 1 commit intovuejs:mainfrom
skirtles-code:ts-pluginid

Conversation

@skirtles-code
Copy link
Copy Markdown
Contributor

Currently there's a TS error on this line in SplitScreen.vue:

customPluginId.value = tab.pluginId

Property 'pluginId' does not exist on type 'ModuleBuiltinTab'.

This PR attempts to fix that by introducing a new type, CustomInspectorTab, which extends ModuleBuiltinTab and adds pluginId.

There's a similar error in custom-inspector-tab-view.vue, but it's currently suppressed using @ts-expect-error. That error is also fixed by these changes, so @ts-expect-error has been removed.

I've also introduced some helper functions, isCustomTab and isCustomInspectorTab, in SplitScreen.vue. These should be functionally equivalent to the existing code but they use is to narrow the type of tab, helping to avoid the repeated use of as. In particular, this avoids the need to change customPluginId.value = tab.pluginId to customPluginId.value = (tab as CustomInspectorTab).pluginId.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit bc6ceea
🔍 Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/69cdd4d34dbed8000897df60

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 2, 2026

Open in StackBlitz

@vue/devtools-applet

npm i https://pkg.pr.new/@vue/devtools-applet@1082

@vue/devtools-core

npm i https://pkg.pr.new/@vue/devtools-core@1082

@vue/devtools

npm i https://pkg.pr.new/@vue/devtools@1082

@vue/devtools-api

npm i https://pkg.pr.new/@vue/devtools-api@1082

@vue/devtools-kit

npm i https://pkg.pr.new/@vue/devtools-kit@1082

@vue/devtools-electron

npm i https://pkg.pr.new/@vue/devtools-electron@1082

@vue/devtools-shared

npm i https://pkg.pr.new/@vue/devtools-shared@1082

@vue/devtools-ui

npm i https://pkg.pr.new/@vue/devtools-ui@1082

vite-plugin-vue-devtools

npm i https://pkg.pr.new/vite-plugin-vue-devtools@1082

commit: bc6ceea

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