From 2d5b6fad4e17bc18c804faf0bf1fede0e8f4d199 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Fri, 8 Sep 2023 11:52:03 -0700 Subject: [PATCH] fix(docs-infra): Ensure experimental tag shows up on docs (#51712) The experimental tag is part of the stability tags along with "deprecated". This commit updates some code to pick up experimental as well. PR Close #51712 --- aio/content/guide/releases.md | 6 ++++++ aio/src/styles/2-modules/label/_label-theme.scss | 6 ++++-- aio/tools/transforms/angular-api-package/index.js | 1 + .../angular-api-package/tag-defs/experimental.js | 4 ++++ .../transforms/templates/api/base.template.html | 9 ++++++++- .../transforms/templates/api/decorator.template.html | 7 ++++++- .../templates/api/includes/decorator-overview.html | 8 +++++++- .../transforms/templates/api/lib/memberHelpers.html | 12 ++++++++++++ 8 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 aio/tools/transforms/angular-api-package/tag-defs/experimental.js diff --git a/aio/content/guide/releases.md b/aio/content/guide/releases.md index 10014c67b31..21e44e7a1c1 100644 --- a/aio/content/guide/releases.md +++ b/aio/content/guide/releases.md @@ -183,6 +183,12 @@ This may be because we want to gather feedback from real applications before sta The policies and practices that are described in this document do not apply to APIs marked as Developer Preview. Such APIs can change at any time, even in new patch versions of the framework. Teams should decide for themselves whether the benefits of using Developer Preview APIs are worth the risk of breaking changes outside of our normal use of semantic versioning. +## Experimental + +These are APIs might not become stable at all or have significant changes before becoming stable. + +The policies and practices that are described in this document do not apply to APIs marked as experimental. Such APIs can change at any time, even in new patch versions of the framework. Teams should decide for themselves whether the benefits of using experimental APIs are worth the risk of breaking changes outside of our normal use of semantic versioning. + diff --git a/aio/src/styles/2-modules/label/_label-theme.scss b/aio/src/styles/2-modules/label/_label-theme.scss index cb2e545d709..09089323f2b 100644 --- a/aio/src/styles/2-modules/label/_label-theme.scss +++ b/aio/src/styles/2-modules/label/_label-theme.scss @@ -14,7 +14,8 @@ &.deprecated, &.security, &.impure-pipe, - &.dev-preview { + &.dev-preview, + &.experimental { background-color: constants.$brightred; } @@ -30,7 +31,8 @@ color: constants.$white; background-color: constants.$accentblue; - @each $name, $symbol in constants.$api-symbols { + @each $name, + $symbol in constants.$api-symbols { &.#{$name} { background: map.get($symbol, background); } diff --git a/aio/tools/transforms/angular-api-package/index.js b/aio/tools/transforms/angular-api-package/index.js index c0745d45ed5..5dda3f21320 100644 --- a/aio/tools/transforms/angular-api-package/index.js +++ b/aio/tools/transforms/angular-api-package/index.js @@ -191,6 +191,7 @@ module.exports = 'description', 'security', 'deprecated', + 'experimental', 'see', 'usageNotes', ]; diff --git a/aio/tools/transforms/angular-api-package/tag-defs/experimental.js b/aio/tools/transforms/angular-api-package/tag-defs/experimental.js new file mode 100644 index 00000000000..5da1fac0d0b --- /dev/null +++ b/aio/tools/transforms/angular-api-package/tag-defs/experimental.js @@ -0,0 +1,4 @@ +module.exports = function() { + return {name: 'experimental'}; + }; + \ No newline at end of file diff --git a/aio/tools/transforms/templates/api/base.template.html b/aio/tools/transforms/templates/api/base.template.html index 912b336bd80..8ea39c7b114 100644 --- a/aio/tools/transforms/templates/api/base.template.html +++ b/aio/tools/transforms/templates/api/base.template.html @@ -14,7 +14,8 @@ ] } - {% for crumb in doc.breadCrumbs %}{% if not loop.last %} {$ breadcrumbDelimiter() $} {% if crumb.path %}{$ crumb.text $}{% else %}{$ crumb.text $}{% endif %}{% endif %}{% endfor %} + {% for crumb in doc.breadCrumbs %}{% if not loop.last %} {$ breadcrumbDelimiter() $} {% if crumb.path %}{$ crumb.text $}{% else %}{$ crumb.text $}{% endif %}{% endif %}{% endfor %} {$ github.githubLinks(doc, versionInfo) $} @@ -39,6 +40,12 @@ developer preview {% endif %} + {%- if doc.experimental !== undefined %} + + {% endif %} {%- endblock %} diff --git a/aio/tools/transforms/templates/api/decorator.template.html b/aio/tools/transforms/templates/api/decorator.template.html index 1e876310071..10ccd9bf6b6 100644 --- a/aio/tools/transforms/templates/api/decorator.template.html +++ b/aio/tools/transforms/templates/api/decorator.template.html @@ -23,6 +23,11 @@ preview {% endif %} + {%- if option.experimental %} + + {% endif %} {$ github.githubLinks(option, versionInfo) $} @@ -59,4 +64,4 @@ {% endfor %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/aio/tools/transforms/templates/api/includes/decorator-overview.html b/aio/tools/transforms/templates/api/includes/decorator-overview.html index 1809d1ab452..445f7d2b9c6 100644 --- a/aio/tools/transforms/templates/api/includes/decorator-overview.html +++ b/aio/tools/transforms/templates/api/includes/decorator-overview.html @@ -19,6 +19,12 @@ developer preview {% endif %} + {%- if doc.experimental !== undefined %} + + {% endif %} {$ option.shortDescription | marked $} @@ -38,4 +44,4 @@ {$ renderOptionsTable(doc) $} {$ descendants.renderDescendants(doc, 'decorator', 'Subclasses') $} -{%- endif -%} \ No newline at end of file +{%- endif -%} diff --git a/aio/tools/transforms/templates/api/lib/memberHelpers.html b/aio/tools/transforms/templates/api/lib/memberHelpers.html index 13531666b51..313f0bb3a99 100644 --- a/aio/tools/transforms/templates/api/lib/memberHelpers.html +++ b/aio/tools/transforms/templates/api/lib/memberHelpers.html @@ -94,6 +94,12 @@ developer preview {% endif %} + {%- if doc.experimental !== undefined %} + + {% endif %} {%- if method.deprecated %} {% endif %} @@ -234,6 +240,12 @@ developer preview {% endif %} + {%- if doc.experimental !== undefined %} + + {% endif %} {%- if property.deprecated %} {% endif %}