Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt)!: remove initialCache option #8885

Merged
merged 3 commits into from Nov 10, 2022
Merged

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Nov 10, 2022

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Race condition issue in #3985 seems to be resolved. Removing initialCache option and only use utility to preserve payload data while hydrating.

BREAKING CHANGE: Payload cache won't be used when doing client-side navigation back to same page and fresh data will be fetched.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Nov 10, 2022

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@pi0 pi0 requested a review from danielroe November 10, 2022 12:10
@netlify
Copy link

netlify bot commented Nov 10, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit b859e22
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/636cf6fb017cdd00085f5059

@pi0 pi0 requested a review from Atinux November 10, 2022 12:10
@danielroe
Copy link
Member

I was too quick - looks like the test fixture is rightly finding an issue.

@pi0
Copy link
Member Author

pi0 commented Nov 10, 2022

It is a breaking change coming with this PR indeed. When navigating on client-side, the initial payload cache won't be used as option is dropped. Later will add actual cache support as mentioned in #3985

@danielroe
Copy link
Member

As I understand it, that will basically break the payloadExtraction implementation because this will only be used on initial load (which was the case even if payloads were not extracted).

If we merge this without fixing this, I think we should also disable payloadExtraction by default.

@pi0 pi0 marked this pull request as draft November 10, 2022 12:38
@pi0 pi0 force-pushed the refactor/drop-initial-cache branch from 672fb1e to 33eb38b Compare November 10, 2022 12:41
@danielroe
Copy link
Member

danielroe commented Nov 10, 2022

Note: now that I think about it, I think we should disable payload extraction by default anyway as I think there's some more refinement/discussion to do, particularly around useData, etc. that we probably can't adequately handle before the stable release.

@pi0 pi0 marked this pull request as ready for review November 10, 2022 13:05
@pi0
Copy link
Member Author

pi0 commented Nov 10, 2022

Updated implementation to keep CSR payloads permanently (like initialCache: true) in nuxt.static so both behaviors can be preserved.

@pi0 pi0 merged commit 52c2bff into main Nov 10, 2022
@pi0 pi0 deleted the refactor/drop-initial-cache branch November 10, 2022 13:28
@pi0 pi0 mentioned this pull request Nov 15, 2022
johannschopplich added a commit to johannschopplich/nuxt-kql that referenced this pull request Dec 6, 2022
johannschopplich added a commit to johannschopplich/nuxt-api-party that referenced this pull request Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants