Skip to content

Commit

Permalink
fix(compiler): deprecate scriptDataOpts (#5737)
Browse files Browse the repository at this point in the history
* fix(compiler): deprecate scriptDataOpts

STENCIL-665

* Update src/declarations/stencil-public-compiler.ts

Co-authored-by: Alice Pote <alice.writes.wrongs@gmail.com>

---------

Co-authored-by: Alice Pote <alice.writes.wrongs@gmail.com>
  • Loading branch information
christian-bromann and alicewriteswrongs committed May 8, 2024
1 parent b0a9f7b commit da25aaa
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app-data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const BUILD: BuildConditionals = {
cloneNodeFix: false,
hydratedAttribute: false,
hydratedClass: true,
// TODO(STENCIL-1305): remove this option
scriptDataOpts: false,
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
scopedSlotTextContentFix: false,
Expand Down
1 change: 1 addition & 0 deletions src/compiler/app-core/app-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export const updateBuildConditionals = (config: ValidatedConfig, b: BuildConditi
b.lifecycleDOMEvents = !!(b.isDebug || config._isTesting || config.extras.lifecycleDOMEvents);
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
b.scopedSlotTextContentFix = !!config.extras.scopedSlotTextContentFix;
// TODO(STENCIL-1305): remove this option
b.scriptDataOpts = config.extras.scriptDataOpts;
b.attachStyles = true;
b.invisiblePrehydration = typeof config.invisiblePrehydration === 'undefined' ? true : config.invisiblePrehydration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const getHydrateBuildConditionals = (cmps: d.ComponentCompilerMeta[]) =>
build.shadowDomShim = true;
build.hydratedAttribute = false;
build.hydratedClass = true;
// TODO(STENCIL-1305): remove this option
build.scriptDataOpts = false;
build.attachStyles = true;

Expand Down
1 change: 1 addition & 0 deletions src/declarations/stencil-private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export interface BuildConditionals extends Partial<BuildFeatures> {
hydratedAttribute?: boolean;
hydratedClass?: boolean;
initializeNextTick?: boolean;
// TODO(STENCIL-1305): remove this option
scriptDataOpts?: boolean;
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
shadowDomShim?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/declarations/stencil-public-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ interface ConfigExtrasBase {
* It is possible to assign data to the actual `<script>` element's `data-opts` property,
* which then gets passed to Stencil's initial bootstrap. This feature is only required
* for very special cases and rarely needed. Defaults to `false`.
* @deprecated This option has been deprecated and will be removed in a future major version of Stencil.
*/
scriptDataOpts?: boolean;

Expand Down
1 change: 1 addition & 0 deletions src/testing/reset-build-conditionals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function resetBuildConditionals(b: d.BuildConditionals) {
b.appendChildSlotFix = false;
b.cloneNodeFix = false;
b.hotModuleReplacement = false;
// TODO(STENCIL-1305): remove this option
b.scriptDataOpts = false;
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
b.scopedSlotTextContentFix = false;
Expand Down

0 comments on commit da25aaa

Please sign in to comment.