Client mode reveals the page twice

Open
#718 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
fastapi, javascript, python, react, vite

Research direction

Start with islands/react.js, islands/solid.js, and the client-rendering guidance in docs/routing/fbr/layouts/README.md, then inspect the probe in tests/e2e/test_layout_first_paint.py. Add an e2e test covering each framework root layout and record body replacements and CLS. Done means complete server HTML causes zero body replacements and 0.000 CLS for React, Solid, Preact, Vue, and Svelte.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
11
Forks
6
Avg merge
2h 14m
Merged PRs (30d)
265

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NexyPy/nexy

All issues in NexyPy/nexy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.