perf: keep document-drive state in shallowRef
and prefetch pages/components
#2118
+43
β7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Linked issue
#2100
β Type of change
π Description
This PR implements two changes to speed up the experience on document-driven sites. It should be considered a proof-of-concept and likely warrants further testing.
First, we take advantage of the new rich JSON payloads to avoid having fully reactive page data. For deeply nested arrays of objects, this is likely to make a huge performance impact.
Second, we preload content queries and the components used on those pages (if the
body
attribute is present).In order to enable testing this out on a large site/codebase, I've deployed a patched version of nuxt content:
(Bear in mind that to test out the document driven changes you will need to stay within the
/docs
subpath as other pages do not use this strategy and will not be affected by these improvements.)π Checklist