You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds some more nesting examples with hydration markup (#7123)
# Pull Request
## 📖 Description
This change adds a bit more to the documentation for rendering hydratable markup by adding more nesting examples to showcase how nested templates interact with each other.
## ✅ Checklist
### General
<!--- Review the list and put an x in the boxes that apply. -->
- [x] I have included a change request file using `$ npm run change`
- [ ] I have added tests for my changes.
- [ ] I have tested my changes.
- [x] I have updated the project documentation to reflect my changes.
- [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/main/CONTRIBUTING.md) documentation and followed the [standards](https://github.com/microsoft/fast/blob/main/CODE_OF_CONDUCT.md#our-standards) for this project.
Copy file name to clipboardExpand all lines: packages/web-components/fast-html/RENDERING.md
+186Lines changed: 186 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -185,6 +185,21 @@ An attribute binding is tracked using a dataset attribute with the name `data-fe
185
185
186
186
#### Examples
187
187
188
+
**Note**
189
+
Examples shown below mostly skip the wrapping custom element and the internal template element with `shadowrootmode="open"`.
190
+
191
+
Typically along with the content from the examples below, the rendering should include:
192
+
193
+
```html
194
+
<my-componentdefer-hydrationneeds-hydration>
195
+
<templateshadowrootmode="open"shadowroot="open">
196
+
<!-- hydratable content -->
197
+
</template>
198
+
</my-component>
199
+
```
200
+
201
+
The `needs-hydration` attribute is controlled by the hydration logic once `defer-hydration` has been removed, there is no need to modify it manually but it must be included to indicate that this component has not yet been hydrated.
This example shows the wrapping custom element tag as well as the template component with `shadowrootmode="open"` for the sake of illustrating an example that would exist in the DOM.
0 commit comments