Skip to content

Commit

Permalink
chore: apply patch for syncing asyncData and nuxtData
Browse files Browse the repository at this point in the history
nuxt/nuxt#22277. Dunno, but this does fix my issue
  • Loading branch information
logotip4ik committed Aug 26, 2023
1 parent e3c7f72 commit 0463b45
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .yarn/patches/nuxt-npm-3.7.0-1603ad03d3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/dist/app/composables/asyncData.js b/dist/app/composables/asyncData.js
index d7ecff5ec0c17891f9eb6da15c68d59fef57d951..0851dfc675f6c2df32367cc48854c9e4104cc8b8 100644
--- a/dist/app/composables/asyncData.js
+++ b/dist/app/composables/asyncData.js
@@ -20,8 +20,8 @@ export function useAsyncData(...args) {
options.lazy = options.lazy ?? false;
options.immediate = options.immediate ?? true;
const nuxt = useNuxtApp();
- const getCachedData = () => nuxt.isHydrating ? nuxt.payload.data[key] : nuxt.static.data[key];
- const hasCachedData = () => getCachedData() !== void 0;
+ const getCachedData = () => nuxt.isHydrating ? toRef(nuxt.payload.data, key) : nuxt.static.data[key];
+ const hasCachedData = () => unref(getCachedData()) !== void 0;
if (!nuxt._asyncData[key] || !options.immediate) {
nuxt._asyncData[key] = {
data: ref(getCachedData() ?? options.default()),
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
},
"packageManager": "yarn@3.6.2",
"resolutions": {
"nuxt": "patch:nuxt@npm%3A3.7.0#./.yarn/patches/nuxt-npm-3.7.0-1603ad03d3.patch",
"tinykeys": "patch:tinykeys@npm%3A2.1.0#./.yarn/patches/tinykeys-npm-2.1.0-819feeaed0.patch",
"@tiptap/core": "patch:@tiptap/core@npm%3A2.1.6#./.yarn/patches/@tiptap-core-npm-2.0.4-25bd396515.patch",
"@tiptap/extension-link": "patch:@tiptap/extension-link@npm%3A2.1.6#./.yarn/patches/@tiptap-extension-link-npm-2.1.0-266d67cf34.patch"
Expand Down
75 changes: 74 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10914,7 +10914,7 @@ __metadata:
languageName: node
linkType: hard

"nuxt@npm:^3.6.5, nuxt@npm:^3.7.0":
"nuxt@npm:3.7.0":
version: 3.7.0
resolution: "nuxt@npm:3.7.0"
dependencies:
Expand Down Expand Up @@ -10987,6 +10987,79 @@ __metadata:
languageName: node
linkType: hard

"nuxt@patch:nuxt@npm%3A3.7.0#./.yarn/patches/nuxt-npm-3.7.0-1603ad03d3.patch::locator=keycap%40workspace%3A.":
version: 3.7.0
resolution: "nuxt@patch:nuxt@npm%3A3.7.0#./.yarn/patches/nuxt-npm-3.7.0-1603ad03d3.patch::version=3.7.0&hash=74a80e&locator=keycap%40workspace%3A."
dependencies:
"@nuxt/devalue": ^2.0.2
"@nuxt/kit": 3.7.0
"@nuxt/schema": 3.7.0
"@nuxt/telemetry": ^2.4.1
"@nuxt/ui-templates": ^1.3.1
"@nuxt/vite-builder": 3.7.0
"@unhead/dom": ^1.3.7
"@unhead/ssr": ^1.3.7
"@unhead/vue": ^1.3.7
"@vue/shared": ^3.3.4
acorn: 8.10.0
c12: ^1.4.2
chokidar: ^3.5.3
cookie-es: ^1.0.0
defu: ^6.1.2
destr: ^2.0.1
devalue: ^4.3.2
esbuild: ^0.19.2
escape-string-regexp: ^5.0.0
estree-walker: ^3.0.3
fs-extra: ^11.1.1
globby: ^13.2.2
h3: ^1.8.0
hookable: ^5.5.3
jiti: ^1.19.3
klona: ^2.0.6
knitwork: ^1.0.0
magic-string: ^0.30.3
mlly: ^1.4.1
nitropack: ^2.6.1
nuxi: ^3.7.0
nypm: ^0.3.1
ofetch: ^1.3.3
ohash: ^1.1.3
pathe: ^1.1.1
perfect-debounce: ^1.0.0
pkg-types: ^1.0.3
prompts: ^2.4.2
scule: ^1.0.0
std-env: ^3.4.3
strip-literal: ^1.3.0
ufo: ^1.3.0
ultrahtml: ^1.3.0
uncrypto: ^0.1.3
unctx: ^2.3.1
unenv: ^1.7.3
unimport: ^3.2.0
unplugin: ^1.4.0
unplugin-vue-router: ^0.6.4
untyped: ^1.4.0
vue: ^3.3.4
vue-bundle-renderer: ^2.0.0
vue-devtools-stub: ^0.1.0
vue-router: ^4.2.4
peerDependencies:
"@parcel/watcher": ^2.1.0
"@types/node": ^14.18.0 || >=16.10.0
peerDependenciesMeta:
"@parcel/watcher":
optional: true
"@types/node":
optional: true
bin:
nuxi: bin/nuxt.mjs
nuxt: bin/nuxt.mjs
checksum: c15c91dd182347dbeebed58565640176628eb257e996d30296d3aef8b676f902865cbc01a32af227983a763ec2201841580b2ef3e7bd95527112f6266f7f6f1c
languageName: node
linkType: hard

"nypm@npm:^0.2.2":
version: 0.2.2
resolution: "nypm@npm:0.2.2"
Expand Down

0 comments on commit 0463b45

Please sign in to comment.