Skip to content

fix(vue-app): handle missing payloads on full static #8314

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

Merged
merged 10 commits into from
Nov 25, 2020
Merged

Conversation

atinux
Copy link
Member

@atinux atinux commented Nov 7, 2020

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

In full static, we generate a payload.js for each route, expect for ignored pages.

When navigating on client-side to a page not statically generated, it will anyway try to fetch the payload, leading to a 404 error in the console:

94172662-0ffb5a80-fe93-11ea-89b1-3f060d1ee988

This PR will create a manifest.js grouping all routes generated, so we can avoid fetching payloads for not generated routes.

Left to do:

  • Generate a manifest.js instead with routes key inside (will be useful later on to add more fields)
  • Check behaviour with router.base defined
  • Add an option generate.manifest to disable the behaviour when in serverless (payload can be generated on-demand)
  • Update the full static fixture and test the behaviour (instead of manual testing)

Fixes #7717

Checklist:

  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Fixes #7717

Verified

This commit was signed with the committer’s verified signature.
Darksonn Alice Ryhl
@codecov-io
Copy link

Codecov Report

Merging #8314 (495c86a) into dev (2c6610c) will decrease coverage by 0.11%.
The diff coverage is 13.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #8314      +/-   ##
==========================================
- Coverage   68.70%   68.58%   -0.12%     
==========================================
  Files          91       91              
  Lines        3863     3871       +8     
  Branches     1051     1054       +3     
==========================================
+ Hits         2654     2655       +1     
- Misses        982      987       +5     
- Partials      227      229       +2     
Flag Coverage Δ
unittests 68.58% <13.33%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/vue-renderer/src/renderers/ssr.js 0.00% <0.00%> (ø)
packages/generator/src/generator.js 83.09% <25.00%> (-2.41%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c6610c...495c86a. Read the comment docs.

@pi0
Copy link
Member

pi0 commented Nov 8, 2020

One more suggestion: We shall preload manifest.json chunk in renderer (SPA and SSR)

Verified

This commit was signed with the committer’s verified signature.
Darksonn Alice Ryhl

Verified

This commit was signed with the committer’s verified signature.
Darksonn Alice Ryhl
atinux and others added 2 commits November 9, 2020 17:08

Verified

This commit was signed with the committer’s verified signature.
Darksonn Alice Ryhl

Verified

This commit was signed with the committer’s verified signature.
Darksonn Alice Ryhl
@pi0 pi0 force-pushed the fix/static-payloads branch from d5edf0c to c7dbae1 Compare November 9, 2020 17:26
@danielroe
Copy link
Member

It would be good to add the ability to check there is a newer version of code available on the server and (if so) refresh in the background.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@pi0 pi0 mentioned this pull request Nov 19, 2020
6 tasks
@atinux atinux marked this pull request as ready for review November 20, 2020 17:53
@atinux atinux requested a review from pi0 November 24, 2020 14:14
pi0
pi0 previously approved these changes Nov 25, 2020
@pi0 pi0 merged commit 691f21c into dev Nov 25, 2020
@pi0 pi0 deleted the fix/static-payloads branch November 25, 2020 14:19
@pi0 pi0 mentioned this pull request Nov 30, 2020
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Full static mode dynamic pages payload 404 errors (i18n module)
4 participants