Skip to content

Commit 94100dc

Browse files
committed
refactor: leftovers
1 parent ec56622 commit 94100dc

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

README.md

-6
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ A few notes about the project and possible questions:
111111
npm install pinia
112112
```
113113

114-
If you are using Vue <2.7, make sure to install latest `@vue/composition-api`:
115-
116-
```bash
117-
npm install pinia @vue/composition-api
118-
```
119-
120114
## Usage
121115

122116
### Install the plugin

packages/pinia/src/store.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ const skipHydrateMap = /*#__PURE__*/ new WeakMap<any, any>()
127127
* @returns obj
128128
*/
129129
export function skipHydrate<T = any>(obj: T): T {
130+
// TODO: check if can be simplified for Vue 2.7
130131
return isVue2
131-
? // in @vue/composition-api, the refs are sealed so defineProperty doesn't work...
132+
? // in @vue/composition-api (no needed in Vue 2.7),
133+
// the refs are sealed so defineProperty doesn't work...
132134
/* istanbul ignore next */ skipHydrateMap.set(obj, 1) && obj
133135
: Object.defineProperty(obj, skipHydrateSymbol, {})
134136
}

rollup.config.mjs

+1-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ function createConfig(buildName, output, plugins = []) {
9696
output.globals = {
9797
'vue-demi': 'VueDemi',
9898
vue: 'Vue',
99-
'@vue/composition-api': 'vueCompositionApi',
10099
}
101100

102101
const isProductionBuild = /\.prod\.[cm]?js$/.test(output.file)
@@ -127,7 +126,7 @@ function createConfig(buildName, output, plugins = []) {
127126
// during a single build.
128127
hasTSChecked = true
129128

130-
const external = ['vue-demi', 'vue', '@vue/composition-api']
129+
const external = ['vue-demi', 'vue']
131130
if (
132131
!isGlobalBuild &&
133132
// pinia.prod.cjs should not require `@vue/devtools-api` (like Vue)

0 commit comments

Comments
 (0)