ProjectEvergreen / ProjectEvergreen/wcc
Fragment (empty) tag support
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 126
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
Summary
One rule with JSX is that there can only be one top level node in the render tree.
export default class Header extends HTMLElement {
connectedCallback() {
this.render();
}
render() {
return (
<header>
<nav>...</nav>
</header>
<h1>Welcome to my website!</h1>
);
}
}
customElements.define('app-header', Header);
Details
The "fragment" wrapping tag convention can effectively act as a pass through tag that wont be part of the rendered output, but helps from a quality of life perspective when authoring JSX
export default class Header extends HTMLElement {
connectedCallback() {
this.render();
}
render() {
return (
<>
<header>
<nav>...</nav>
</header>
<h1>Welcome to my website!</h1>
</>
);
}
}
customElements.define('app-header', Header);
Contributor 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.
Research direction
Start by locating the JSX parsing and rendering entry points responsible for enforcing a single top-level node. Trace how JSX fragments are represented and emitted, then verify that the fragment wrapper is omitted while its children remain in the rendered output. Add or update coverage for the empty fragment syntax shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100