From 0bff6f1d36374a41b43230a84f9aac9fff42a74f Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 2 Aug 2021 15:23:41 +0200 Subject: [PATCH] refactor: use vue-demi --- docs/vite.config.js | 2 +- src/createPinia.ts | 2 +- src/devtools/formatting.ts | 2 +- src/devtools/plugin.ts | 9 ++++++++- src/hmr.ts | 2 +- src/mapHelpers.ts | 2 +- src/rootStore.ts | 2 +- src/store.ts | 2 +- src/subscriptions.ts | 2 +- src/testing.ts | 2 +- src/types.ts | 2 +- vite.config.ts | 2 +- 12 files changed, 19 insertions(+), 12 deletions(-) diff --git a/docs/vite.config.js b/docs/vite.config.js index c51ed741..7e51b2f3 100644 --- a/docs/vite.config.js +++ b/docs/vite.config.js @@ -6,6 +6,6 @@ export default defineConfig({ __BROWSER__: 'true', }, optimizeDeps: { - exclude: ['@vueuse/shared', '@vueuse/core'], + exclude: ['vue-demi', '@vueuse/shared', '@vueuse/core'], }, }) diff --git a/src/createPinia.ts b/src/createPinia.ts index 5f4bf497..de7bec4a 100644 --- a/src/createPinia.ts +++ b/src/createPinia.ts @@ -4,7 +4,7 @@ import { setActivePinia, piniaSymbol, } from './rootStore' -import { ref, App, markRaw, effectScope } from 'vue' +import { ref, App, markRaw, effectScope } from 'vue-demi' import { registerPiniaDevtools, devtoolsPlugin } from './devtools' import { IS_CLIENT } from './env' import { StateTree, StoreGeneric } from './types' diff --git a/src/devtools/formatting.ts b/src/devtools/formatting.ts index 212c79d8..178a34b5 100644 --- a/src/devtools/formatting.ts +++ b/src/devtools/formatting.ts @@ -4,7 +4,7 @@ import { CustomInspectorState, } from '@vue/devtools-api' import { MutationType, StoreGeneric } from '../types' -import { DebuggerEvent } from 'vue' +import { DebuggerEvent } from 'vue-demi' import { Pinia } from '../rootStore' import { isPinia } from './utils' diff --git a/src/devtools/plugin.ts b/src/devtools/plugin.ts index 746b4e75..e3f8d5d8 100644 --- a/src/devtools/plugin.ts +++ b/src/devtools/plugin.ts @@ -1,5 +1,12 @@ import { setupDevtoolsPlugin, TimelineEvent } from '@vue/devtools-api' -import { App, ComponentPublicInstance, markRaw, toRaw, unref, watch } from 'vue' +import { + App, + ComponentPublicInstance, + markRaw, + toRaw, + unref, + watch, +} from 'vue-demi' import { Pinia, PiniaPluginContext } from '../rootStore' import { GettersTree, diff --git a/src/hmr.ts b/src/hmr.ts index 61ad82e9..f6cdf536 100644 --- a/src/hmr.ts +++ b/src/hmr.ts @@ -1,4 +1,4 @@ -import { isRef, isReactive } from 'vue' +import { isRef, isReactive } from 'vue-demi' import { Pinia } from './rootStore' import { isPlainObject, StoreDefinition, StoreGeneric, _Method } from './types' diff --git a/src/mapHelpers.ts b/src/mapHelpers.ts index 600c0fb8..db847794 100644 --- a/src/mapHelpers.ts +++ b/src/mapHelpers.ts @@ -1,4 +1,4 @@ -import { ComponentPublicInstance } from 'vue' +import { ComponentPublicInstance } from 'vue-demi' import { GettersTree, _Method, diff --git a/src/rootStore.ts b/src/rootStore.ts index 9b3eaa5a..ff6cf9fb 100644 --- a/src/rootStore.ts +++ b/src/rootStore.ts @@ -1,4 +1,4 @@ -import { App, EffectScope, InjectionKey, Plugin, Ref, warn } from 'vue' +import { App, EffectScope, InjectionKey, Plugin, Ref, warn } from 'vue-demi' import { StateTree, PiniaCustomProperties, diff --git a/src/store.ts b/src/store.ts index c2cf11cb..1b009449 100644 --- a/src/store.ts +++ b/src/store.ts @@ -17,7 +17,7 @@ import { toRefs, Ref, ref, -} from 'vue' +} from 'vue-demi' import { StateTree, SubscriptionCallback, diff --git a/src/subscriptions.ts b/src/subscriptions.ts index aae8996d..86fef170 100644 --- a/src/subscriptions.ts +++ b/src/subscriptions.ts @@ -1,4 +1,4 @@ -import { getCurrentInstance, onUnmounted } from 'vue' +import { getCurrentInstance, onUnmounted } from 'vue-demi' import { _Method } from './types' export function addSubscription( diff --git a/src/testing.ts b/src/testing.ts index f93ab03c..ffdf61be 100644 --- a/src/testing.ts +++ b/src/testing.ts @@ -1,4 +1,4 @@ -import { App, createApp } from 'vue' +import { App, createApp } from 'vue-demi' import { createPinia } from './createPinia' import { Pinia, PiniaStorePlugin, setActivePinia } from './rootStore' diff --git a/src/types.ts b/src/types.ts index 204db643..3cbe0189 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { ComputedRef, DebuggerEvent, Ref, UnwrapRef } from 'vue' +import { ComputedRef, DebuggerEvent, Ref, UnwrapRef } from 'vue-demi' import { Pinia } from './rootStore' /** diff --git a/vite.config.ts b/vite.config.ts index 5a5c18d6..064353e1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,6 +10,6 @@ export default defineConfig({ __TEST__: 'false', }, optimizeDeps: { - exclude: ['@vueuse/shared', '@vueuse/core'], + exclude: ['vue-demi', '@vueuse/shared', '@vueuse/core'], }, }) -- 2.47.2