Repository navigation
Conversation
Keep the server head during hydration so visits that stay on the homepage can skip renderer work. Warm lazy chunks on slower connections and render the analytics beacon on the server.
🤖 CLOSED
GitHub closed this pull request. No further automated Review will run. |
The preview showed a first-navigation delay and mixed startup CPU. Keep the eager path for ordinary visits and start slow-network warming before hydration finishes.
There was a problem hiding this comment.
Harlan Agent Kit posted this automated review. AI open source policy.
Automated Review: READY.
Optional follow-ups
Logged (74/100) · Eager routes now wait on a dynamic import during Nuxt startup
The module replaces Nuxt's client head plugin for every production entry. The stock plugin installed the head synchronously. Bare `/` and other eager entry routes now start the wrapper and suspend Nuxt plugin setup on a dynamic import. The server's modulepreload hint can start fetching the chunk earlier, but setup still waits for import resolution before later plugins can run.
Optional follow-up: Keep the stock renderer in the synchronous client startup path for eager entries.
Logged (68/100) · A failed lazy import can leave the destination with the homepage head
On the pilot, a rejected renderer or options import clears the cached promises and logs the error. Navigation and head writes call `load()` without awaiting it, so the destination page can finish while its title and metadata remain queued. If the last activation attempt fails, the settled page has no recovery until another call triggers `load()`.
Optional follow-up: Fall back to the eager renderer on import failure and replay the queued head entries.
Logged (56/100) · Head changes made during hydration can stay queued indefinitely
A normal entry patch before `app:suspense:resolve` changes the queue without starting the renderer. Nuxt's suspense hook calls `head.render()`, which returns `false` while the lazy shell is inactive. The wrapper then marks hydration complete without flushing any queued changes. A client-only title or metadata update during mount can therefore remain invisible for the entire visit.
Optional follow-up: Flush hydration-time changes that differ from the server head when suspense resolves.
Logged (53/100) · The rollout diagram omits the homepage pilot URL
The diagram labels the green path “Homepage HTML and chunk names” and assigns the eager preload to “Other routes.” The server emits the lazy marker only for a non-streamed request to `/?head=lazy`. A reviewer opening bare `/` to validate the diagram measures the eager branch. [Controller image 1](https://github.com/user-attachments/assets/deefa201-0578-4a9a-8587-83e1f44b7c9f)
Optional follow-up: Label the lazy branch `/?head=lazy` in the diagram and name that URL in the pull request description.
Logged (48/100) · The options chunk can be prefetched before the pilot checks connection speed
The options branch records its chunk and exits before clearing `preload` and `prefetch`. The pinned Vue bundle renderer gives JavaScript chunks both flags by default and collects hints for dependencies of dynamic imports. Suppressing the eager entry's own hint therefore still leaves its shared options dependency eligible for an SSR prefetch on the fast-connection pilot, ahead of the client connection check.
Optional follow-up: Suppress default SSR resource hints for the options chunk and let the route-specific loader schedule it.
Logged (22/100) · A question mark inside a query value can disable the pilot
Splitting the request path on `?` with a limit of two discards everything after a second literal question mark. A valid request such as `/?source=docs?ref&head=lazy` therefore loses the selector and silently runs the eager control.
Optional follow-up: Parse the request URL and read the selector from its search parameters.
🔗 Linked issue
❓ Type of change
📚 Description
Use
/?head=lazyto opt into delayed client head rendering. Slow and unknown connections warm the renderer and its options early. Cloudflare Analytics renders in the server HTML.Regular visits use Nuxt's eager renderer. The Worker preview saved 72 ms of main-thread CPU at 80 ms RTT and added 193 ms at 250 ms RTT. The first title update was 13 ms slower and 67 ms faster, respectively. This pilot pins the lazy runtime to an exact revision from Unhead #1063.