Skip to content

Commit

Permalink
fix(typescript): fix documentation on 'serializeShadowRoot' flag (#5927)
Browse files Browse the repository at this point in the history
* fix(typescript): fix documentation on 'serializeShadowRoot' flag

* update note in changelog
  • Loading branch information
christian-bromann committed Aug 6, 2024
1 parent 28f4d21 commit 277e3e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* **testing:** update Jest types ([#5910](https://github.com/ionic-team/stencil/issues/5910)) ([5f8c969](https://github.com/ionic-team/stencil/commit/5f8c9692d41b58d3706c61db9a33215294e70049)), fixes [#5908](https://github.com/ionic-team/stencil/issues/5908)
* **core:** update TypeScript to v5.5 ([#5898](https://github.com/ionic-team/stencil/issues/5898)) ([5e74837](https://github.com/ionic-team/stencil/commit/5e748378fd14fa5c6aaf0e001e8763a0ba3cf57c))

### Note

As we’ve made further enhancements to support declarative Shadow DOM, the Stencil team has determined that it’s not feasible to allow users to render a shadow component as a scoped component after compilation, such as by calling `renderToString` with `serializeShadowRoot: false`. This is because Stencil compiles styles for either shadow or scoped mode during the compilation process, embedding these styles into the hydrate module. Once this compilation is complete, the styles cannot be transformed to support the other mode. Recognizing that this change would impact the current functionality, the Stencil team has decided to proceed with this update. Moving forward, we recommend serializing all components marked with shadow: true as declarative Shadow DOM.


## 🏉 [4.19.2](https://github.com/ionic-team/stencil/compare/v4.19.1...v4.19.2) (2024-07-02)
Expand Down
8 changes: 4 additions & 4 deletions src/declarations/stencil-public-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -943,10 +943,10 @@ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
*/
removeHtmlComments?: boolean;
/**
* If set to `false` Stencil will ignore the fact that a component has a `shadow: true`
* flag and serializes it as a scoped component. If set to `true` the component will
* be rendered within a Declarative Shadow DOM.
* @default false
* If set to `true` the component will be rendered within a Declarative Shadow DOM.
* If set to `false` Stencil will ignore the contents of the shadow root and render the
* element as given in provided template.
* @default true
*/
serializeShadowRoot?: boolean;
/**
Expand Down

0 comments on commit 277e3e3

Please sign in to comment.