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

fix(nuxt): defer render-blocking prefetches until after load #9475

Merged
merged 4 commits into from
Dec 2, 2022

Conversation

danielroe
Copy link
Member

❓ 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

Two related performance bugs:

  1. When loading a page with links, these pages are prefetched immediately, which will delay the DOM Content Loaded event. This PR defers initialising observer until component is mounted, and additionally waits until the entire app is hydrated.

  2. If we are rendering a page with inlined styles, vite will immediately inject a preload for the very same CSS chunk that is inlined; we can use control of the chunk preloader to skip loading those chunks.

πŸ“ Checklist

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

@danielroe danielroe added the bug Something isn't working label Dec 2, 2022
@danielroe danielroe requested a review from pi0 December 2, 2022 13:33
@danielroe danielroe self-assigned this Dec 2, 2022
@codesandbox
Copy link

codesandbox bot commented Dec 2, 2022

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

packages/vite/src/client.ts Outdated Show resolved Hide resolved
@danielroe danielroe merged commit 52421a9 into main Dec 2, 2022
@danielroe danielroe deleted the fix/defer-prefetching branch December 2, 2022 16:13
@pi0 pi0 mentioned this pull request Dec 15, 2022
6 tasks
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe mentioned this pull request Jan 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants