WebReflection / WebReflection/linkedom
[FEATURE] Implement `Element`'s `getHTML()` to improve SSR of web components
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 2.1k
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
As per https://github.com/WebReflection/linkedom/issues/210#issuecomment-3803892846, I am filing an issue to add support for getHTML().
Recently baseline (2024) across browsers, makes sense to implement in Linkedom. MDN
Element.getHTML({serializableShadowRoots: true})
Example
<hello-world>
<span>Slotted Hello World!</span>
</hello-world>
class HelloWorld extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open", serializable: true });
}
....
}
Rendered as this:
<hello-world>
<span>Slotted Hello World</span>
<template shadowroot="open" shadowrootserializable="">
<style>
:host {
display: inline-block;
background: pink;
border: 2px dashed yellow;
}
</style>
<div><slot></slot></div>
</template>
</hello-world>
Contributor guide
No contributing guide indexed for this repository
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
The issue names no file or test. Start with the Element.getHTML API and the linked MDN documentation, then identify Linkedom’s existing Element serialization entry point. Compare the requested serializable shadow-root output with the example; done means supporting the described output for web components and shadow roots.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100