Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nuxt): only fetch payloads for prerendered routes #18419

Closed
wants to merge 2 commits into from

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

#14507

resolves #15024

❓ 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

This PR adds support for an app manifest (at /manifest.json) which contains, at the moment, simply a list of routes for which there are corresponding payloads. With the implementation of route rules this manifest can be extended/modified. In addition, it can be extended with a build hash to allow version change detection.

With this PR:

  • we will not fetch payloads for pages that were not prerendered (they would give a 404)
  • will will fetch all payloads if there is an SSR/hybrid app
  • we can fetch payloads in development mode if experimental.payloadExtraction is set by the user to true (there are more edge cases, such as CORS, with client-side fetching, so I felt it was better to set default to false in dev mode so user handles them properly, in case they are not prerendering all their pages).
  • support for hybrid payload extraction (e.g. some but not all routes have SSR payloads) is deferred to implementation of route rules

(Note, @pi0, I'm also happy to go ahead and implement route rules, but thought we could adopt this approach for now and modify it at that point.)

πŸ“ Checklist

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

@danielroe danielroe self-assigned this Jan 21, 2023
@codesandbox
Copy link

codesandbox bot commented Jan 21, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant