]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
chore: deleted unused file
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 12 Feb 2025 11:04:12 +0000 (12:04 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 12 Feb 2025 13:15:46 +0000 (14:15 +0100)
packages/pinia/src/index.ts
packages/pinia/src/vue2-plugin.ts [deleted file]
vitest.config.ts

index 87f845cf70ea811372a53d7e6dfc00899a432216..c398e016f18bdcd19cf9a4c2b68abd39b22bf664 100644 (file)
@@ -76,6 +76,4 @@ export type {
 
 export { acceptHMRUpdate } from './hmr'
 
-export { PiniaVuePlugin } from './vue2-plugin'
-
 export * from './globalExtensions'
diff --git a/packages/pinia/src/vue2-plugin.ts b/packages/pinia/src/vue2-plugin.ts
deleted file mode 100644 (file)
index 2ca3d05..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-import type { Plugin } from 'vue'
-import { registerPiniaDevtools } from './devtools'
-import { IS_CLIENT } from './env'
-import { Pinia, piniaSymbol, setActivePinia } from './rootStore'
-
-/**
- * Vue 2 Plugin that must be installed for pinia to work. Note **you don't need
- * this plugin if you are using Nuxt.js**. Use the `buildModule` instead:
- * https://pinia.vuejs.org/ssr/nuxt.html.
- *
- * @example
- * ```js
- * import Vue from 'vue'
- * import { PiniaVuePlugin, createPinia } from 'pinia'
- *
- * Vue.use(PiniaVuePlugin)
- * const pinia = createPinia()
- *
- * new Vue({
- *   el: '#app',
- *   // ...
- *   pinia,
- * })
- * ```
- *
- * @param _Vue - `Vue` imported from 'vue'.
- */
-export const PiniaVuePlugin: Plugin = function (_Vue) {
-  // Equivalent of
-  // app.config.globalProperties.$pinia = pinia
-  _Vue.mixin({
-    beforeCreate() {
-      const options = this.$options
-      if (options.pinia) {
-        const pinia = options.pinia as Pinia
-        // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31
-        /* istanbul ignore else */
-        if (!(this as any)._provided) {
-          const provideCache = {}
-          Object.defineProperty(this, '_provided', {
-            get: () => provideCache,
-            set: (v) => Object.assign(provideCache, v),
-          })
-        }
-        ;(this as any)._provided[piniaSymbol as any] = pinia
-
-        // propagate the pinia instance in an SSR friendly way
-        // avoid adding it to nuxt twice
-        /* istanbul ignore else */
-        if (!this.$pinia) {
-          this.$pinia = pinia
-        }
-
-        pinia._a = this as any
-        if (IS_CLIENT) {
-          // this allows calling useStore() outside of a component setup after
-          // installing pinia's plugin
-          setActivePinia(pinia)
-        }
-        if (__USE_DEVTOOLS__ && IS_CLIENT) {
-          registerPiniaDevtools(pinia._a, pinia)
-        }
-      } else if (!this.$pinia && options.parent && options.parent.$pinia) {
-        this.$pinia = options.parent.$pinia
-      }
-    },
-    destroyed() {
-      delete this._pStores
-    },
-  })
-}
index 592825c53a996f54a8cb40021eaaadffb767dcfc..187a4d144da5f2af11dcc6b3285ac2158268593b 100644 (file)
@@ -54,7 +54,6 @@ export default defineConfig({
         '**/src/index.ts',
         '**/*.test-d.ts',
         'packages/pinia/src/devtools',
-        'packages/pinia/src/vue2-plugin.ts',
         'packages/pinia/src/hmr.ts',
       ],
     },