Skip to content
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

fix(devtools): setup the settings panel immediately #2858

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions packages/pinia/src/devtools/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@ const MUTATIONS_LAYER_ID = 'pinia:mutations'
const INSPECTOR_ID = 'pinia'
const { assign } = Object

const pluginDescriptor = {
id: 'dev.esm.pinia',
label: 'Pinia 🍍',
logo: 'https://pinia.vuejs.org/logo.svg',
packageName: 'pinia',
homepage: 'https://pinia.vuejs.org',
componentStateTypes,
settings: {
logStoreChanges: {
label: 'Notify about new/deleted stores',
type: 'boolean',
defaultValue: true,
},
// useEmojis: {
// label: 'Use emojis in messages ⚡️',
// type: 'boolean',
// defaultValue: true,
// },
},
} as const

/**
* Gets the displayed name of a store in devtools
*
Expand All @@ -55,12 +76,7 @@ const getStoreType = (id: string) => '🍍 ' + id
export function registerPiniaDevtools(app: DevtoolsApp, pinia: Pinia) {
setupDevtoolsPlugin(
{
id: 'dev.esm.pinia',
label: 'Pinia 🍍',
logo: 'https://pinia.vuejs.org/logo.svg',
packageName: 'pinia',
homepage: 'https://pinia.vuejs.org',
componentStateTypes,
...pluginDescriptor,
app,
},
(api) => {
Expand Down Expand Up @@ -308,25 +324,8 @@ function addStoreToDevtools(app: DevtoolsApp, store: StoreGeneric) {

setupDevtoolsPlugin(
{
id: 'dev.esm.pinia',
label: 'Pinia 🍍',
logo: 'https://pinia.vuejs.org/logo.svg',
packageName: 'pinia',
homepage: 'https://pinia.vuejs.org',
componentStateTypes,
...pluginDescriptor,
app,
settings: {
logStoreChanges: {
label: 'Notify about new/deleted stores',
type: 'boolean',
defaultValue: true,
},
// useEmojis: {
// label: 'Use emojis in messages ⚡️',
// type: 'boolean',
// defaultValue: true,
// },
},
},
(api) => {
// gracefully handle errors
Expand Down
Loading