Skip to content

Client mode reveals the page twice #718

Backlog

Description

@Espoir-Loem

Problem

In client mode the server ships a complete document, then the browser renders again. React and Solid show a shell and replace it in an effect (islands/react.js:116-124, islands/solid.js:97-101). Preact, Vue and Svelte rebuild the body on the client (docs/routing/fbr/layouts/README.md:19-39). That second reveal is visible and can move content after first paint.

Change to make

Reuse the server HTML when it is complete and only hydrate the parts that need interactivity. Add an e2e test that records body replacements and CLS for each framework's root layout, using the probe from tests/e2e/test_layout_first_paint.py.

Out of scope

The boot gate, HMR body replacement and ISR cache have their own issues.

Checks

Body replacements should stay at 0 and CLS at 0.000 when the server HTML is complete, for React, Solid, Preact, Vue and Svelte.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions