This repository was archived by the owner on Apr 6, 2023. It is now read-only.
feat(vite-node): on-demand manifest generation#3968
Merged
Conversation
✅ Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Member
Author
|
FOUC fixed by #4106 |
Member
|
Quickly looking it is an amazing improvement!! Two small changes would like to add before merging:
|
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
On top of #3967
It's not working correctly yet, because of two blockers:
1 - On-demand manifest loading timing
Since with Vite Node, everything is on-demand now. Thus we don't know the module graph until we actually trigger the rendering. While
vue-bundler-rendererseems to assume the format has been bundled based and requests the manifest and server bundle at the same timingframework/packages/nitro/src/runtime/app/render.ts
Lines 18 to 24 in ac40c97
It causes the FOUC on initial load (and missing entries for newly discovered CSS modules). I see two ways of fixing it:
clientManifestoption ofcreateRendererpossibility to be a function invue-bundler-rendererso we could evaluate after we request the renderingframework/packages/vite/src/runtime/server.mjs
Lines 23 to 24 in 949def6
2 - Manifest Cache
Since this change, the manifest is now on-demand and does not change during the development. Causing it reuses the cache and does not re-fetch:
framework/packages/nitro/src/runtime/app/render.ts
Line 14 in ac40c97
Do you know if there is a way to force cleaning the cache, or did I missed anything?