nslot and ncc wrappers change the DOM tree with display:contents
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 56/100
Research direction
Start by comparing the server-rendered and client-rendered DOM in the layout and island unit tests, focusing on nexy/modules/compiler/generator/logic.py and nexy/modules/compiler/frontend_templates.py. Investigate how the <slot> and <ncc> wrappers affect child selectors and hydration attributes, and establish whether the wrappers can be removed without changing the client runtime contract. Done means wrapper-free selectors produce the same computed styles in both rendering modes, the hydration data remains available to the client, and the existing layout and island tests pass.
Written by the indexing model from the issue text.
Description
Problem
nslot and ncc are rendered as real elements with display: contents:
nexy/modules/compiler/generator/logic.py:19 wraps layout children in
<nslot style='display:contents;'>, and
nexy/modules/compiler/frontend_templates.py:34 puts display: contents; on <ncc>.
Neither element creates a box, but both create a node in the DOM tree. Selectors that cross a
layout or island boundary, such as >, :first-child, :nth-child, grid and flex item
selectors, see a different tree in the server HTML than in a fully client render. Scripts that
walk children meet the same node.
Change to make
Measure the difference first with a focused test, then carry the mount data without inserting an
element into the layout tree, or give the wrappers a stable role and document the tree they
create. The hydration attributes on <ncc> must stay available to the client runtime.
Out of scope
The client reveal (#718), the ISR cache (#717) and the boot gate have their own issues.
Checks
Selectors written against the wrapper-free markup give the same computed style in server mode and
in client mode. The layout and island unit tests still pass.
- Dominant language
- Python
- Stars
- 11
- Forks
- 6
- Avg merge
- 2h 14m
- Merged PRs (30d)
- 265
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NexyPy/nexy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:cli difficulty:intermediate enhancement
Difficulty 2/5 Half a day Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
area:cli area:docs question
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:docs difficulty:beginner good first issue priority:3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
area:docs difficulty:beginner good first issue priority:3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jxxghp/MoviePilot#7699 ·
Maintainers usually reply within 1 day
-
bug TAG: unit tests
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
learningequality/ricecooker#898 ·
-
next
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
j3ko/agent-plugins#80 ·
Maintainers usually reply within 1 day
-
bug:unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Heroic-Games-Launcher/HeroicGamesLauncher#6187 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
BCStudentSoftwareDevTeam/cas#491 ·
Maintainers usually reply within 8 days