Skip to content

Commit

Permalink
refactor: leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Nov 22, 2024
1 parent ec56622 commit 94100dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ A few notes about the project and possible questions:
npm install pinia
```

If you are using Vue <2.7, make sure to install latest `@vue/composition-api`:

```bash
npm install pinia @vue/composition-api
```

## Usage

### Install the plugin
Expand Down
4 changes: 3 additions & 1 deletion packages/pinia/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ const skipHydrateMap = /*#__PURE__*/ new WeakMap<any, any>()
* @returns obj
*/
export function skipHydrate<T = any>(obj: T): T {
// TODO: check if can be simplified for Vue 2.7
return isVue2
? // in @vue/composition-api, the refs are sealed so defineProperty doesn't work...
? // in @vue/composition-api (no needed in Vue 2.7),
// the refs are sealed so defineProperty doesn't work...
/* istanbul ignore next */ skipHydrateMap.set(obj, 1) && obj
: Object.defineProperty(obj, skipHydrateSymbol, {})
}
Expand Down
3 changes: 1 addition & 2 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ function createConfig(buildName, output, plugins = []) {
output.globals = {
'vue-demi': 'VueDemi',
vue: 'Vue',
'@vue/composition-api': 'vueCompositionApi',
}

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

const external = ['vue-demi', 'vue', '@vue/composition-api']
const external = ['vue-demi', 'vue']
if (
!isGlobalBuild &&
// pinia.prod.cjs should not require `@vue/devtools-api` (like Vue)
Expand Down

0 comments on commit 94100dc

Please sign in to comment.