Skip to content

Commit 277e3e3

Browse files
authoredAug 6, 2024··
fix(typescript): fix documentation on 'serializeShadowRoot' flag (#5927)
* fix(typescript): fix documentation on 'serializeShadowRoot' flag * update note in changelog
1 parent 28f4d21 commit 277e3e3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
 

‎CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
* **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)
1616
* **core:** update TypeScript to v5.5 ([#5898](https://github.com/ionic-team/stencil/issues/5898)) ([5e74837](https://github.com/ionic-team/stencil/commit/5e748378fd14fa5c6aaf0e001e8763a0ba3cf57c))
1717

18+
### Note
19+
20+
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.
1821

1922

2023
## 🏉 [4.19.2](https://github.com/ionic-team/stencil/compare/v4.19.1...v4.19.2) (2024-07-02)

‎src/declarations/stencil-public-compiler.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -943,10 +943,10 @@ export interface SerializeDocumentOptions extends HydrateDocumentOptions {
943943
*/
944944
removeHtmlComments?: boolean;
945945
/**
946-
* If set to `false` Stencil will ignore the fact that a component has a `shadow: true`
947-
* flag and serializes it as a scoped component. If set to `true` the component will
948-
* be rendered within a Declarative Shadow DOM.
949-
* @default false
946+
* If set to `true` the component will be rendered within a Declarative Shadow DOM.
947+
* If set to `false` Stencil will ignore the contents of the shadow root and render the
948+
* element as given in provided template.
949+
* @default true
950950
*/
951951
serializeShadowRoot?: boolean;
952952
/**

0 commit comments

Comments
 (0)
Please sign in to comment.