Skip to content

Commit

Permalink
chore!: upgrade deps
Browse files Browse the repository at this point in the history
* new version of `@vue/composition-api` with breaking changes
  • Loading branch information
danielroe committed Dec 20, 2020
1 parent d597184 commit 0512fc8
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 155 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,36 +65,36 @@
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-typescript": "^7.12.7",
"@babel/runtime": "^7.12.5",
"@release-it/conventional-changelog": "^2.0.0",
"@sanity/client": "^2.1.0",
"@sanity/image-url": "^0.140.19",
"@siroc/eslint-config": "^0.2.0",
"@siroc/jest-preset": "^0.2.0",
"@types/jest": "^26.0.18",
"@types/jest": "^26.0.19",
"@types/jsdom": "^16.2.5",
"@types/memory-fs": "^0.3.2",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"@vue/composition-api": "1.0.0-beta.21",
"@vue/test-utils": "^1.1.1",
"@typescript-eslint/eslint-plugin": "^4.10.0",
"@typescript-eslint/parser": "^4.10.0",
"@vue/composition-api": "1.0.0-beta.22",
"@vue/test-utils": "^1.1.2",
"codecov": "^3.8.1",
"eslint": "^7.15.0",
"eslint-config-prettier": "^7.0.0",
"eslint": "^7.16.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-prettier": "^3.2.0",
"eslint-plugin-prettier": "^3.3.0",
"expect-type": "^0.11.0",
"flush-promises": "^1.0.2",
"husky": "^4.3.5",
"husky": "^4.3.6",
"jest": "^26.6.3",
"lint-staged": "^10.5.3",
"memory-fs": "^0.5.0",
"prettier": "^2.2.1",
"release-it": "14.2.2",
"siroc": "^0.6.0",
"typescript": "^4.1.2",
"typescript": "^4.1.3",
"vue": "2.6.12",
"vue-server-renderer": "^2.6.12",
"vue-template-compiler": "^2.6.12"
Expand Down
6 changes: 4 additions & 2 deletions src/cache.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { VueConstructor } from 'vue'
import {
computed,
getCurrentInstance,
Expand All @@ -20,13 +21,14 @@ const cache = reactive<Record<string, CacheEntry<any>>>({})
export function ensureInstance() {
const instance = getCurrentInstance()
if (!instance) throw new Error('You must call this from within a component')
return instance
return instance.proxy as InstanceType<VueConstructor>
}

export function getServerInstance() {
const instance = getCurrentInstance()

if (instance?.$isServer) return instance
if (instance?.proxy.$isServer)
return instance.proxy as InstanceType<VueConstructor>
return false
}

Expand Down
Loading

0 comments on commit 0512fc8

Please sign in to comment.