Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs-infra): render deprecated markers for CLI command options #28111

Closed
wants to merge 3 commits into from

Conversation

wKoza
Copy link
Contributor

@wKoza wKoza commented Jan 13, 2019

fixes #27563
fixes #27423

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

Show a deprecated label near option cli deprecated

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #27563 #27423

No deprecated information near cli options that were deprecated. The information exists however in build.json file.

{
      "name": "vendorSourceMap",
      "description": "Resolve vendor packages sourcemaps.",
      "type": "boolean",
      "default": false,
      "required": false,
      "aliases": [],
      "hidden": false,
      "deprecated": true
    },

What is the new behavior?

We have a deprecated label and we can add a message below whether we change trueby a text:

{
      "name": "vendorSourceMap",
      "description": "Resolve vendor packages sourcemaps.",
      "type": "boolean",
      "default": false,
      "required": false,
      "aliases": [],
      "hidden": false,
      "deprecated": "lorem ipsum ..."
    },

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@wKoza wKoza requested a review from a team as a code owner January 13, 2019 11:42
@petebacondarwin petebacondarwin added feature Issue that requests a new feature comp: docs-infra labels Jan 13, 2019
@ngbot ngbot bot added this to the needsTriage milestone Jan 13, 2019
@petebacondarwin petebacondarwin added the target: patch This PR is targeted for the next patch release label Jan 13, 2019
@mary-poppins
Copy link

You can preview 7b78082 at https://pr28111-7b78082.ngbuilds.io/.

Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the styling you have chosen for deprecated CLI options is a little to strong:

screenshot 2019-01-13 at 19 17 24

While we do use the red deprecated badge in the top heading for a whole page, we only use crossed through styling on the element name when referring to a deprecated within a page, with a bold Deprecated: marker followed by the deprecated message.

screenshot 2019-01-13 at 19 16 38

I think we should keep this in the same style.

@@ -56,6 +56,7 @@
<code class="cli-option-syntax no-auto-link">{$ renderOption(option.name, option.type, option.default, option.enum) $}</code>
</td>
<td>
{% if option.deprecated !== undefined and option.deprecated !== false %}<label class="raised cli-deprecated">deprecated</label> {% if option.deprecated !== true %} {$ option.deprecated | marked $} {% endif %}{% endif %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the CLI code base the deprecated value is:

  /**
   * Deprecation. If this flag is not false a warning will be shown on the console. Either `true`
   * or a string to show the user as a notice.
   */
  deprecated?: boolean | string;

So I think it is actually enough to check {% if option.deprecated %}, right? If it is undefined or false then this if will fail. Or are we concerned about the empty string: "" - @hansl ?

@wKoza
Copy link
Contributor Author

wKoza commented Jan 13, 2019

About the style, I've been inspired by the read-only label . But, I agree that it could be shrill. I'll change this.

@wKoza
Copy link
Contributor Author

wKoza commented Jan 14, 2019

So, with the actual system of markdown renderer, we cannot have 'Deprecated' and a string on the same line. Have 'Deprecated' and 'its explain' on two separate lines is ambiguous.

Either we have a boolean

deprecated: true

and it'll display Deprecated

or we have a string and we have to set

deprecated: "**Deprecated:** lorem ipsum"

and it'll display Deprecated: lorem ipsum

It's ok for you ?

@petebacondarwin
Copy link
Member

Check out this template:

{% if overload.deprecated !== undefined %}
<div class="deprecated">
{$ ('**Deprecated** ' + overload.deprecated) | marked $}
</div>{% endif %}

@mary-poppins
Copy link

You can preview ad8cdcc at https://pr28111-ad8cdcc.ngbuilds.io/.

Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there! I still think that we should cross through the syntax text of the deprecated item:

screenshot 2019-01-14 at 14 52 33

@mary-poppins
Copy link

You can preview 71f1269 at https://pr28111-71f1269.ngbuilds.io/.

Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Thanks @wKoza again!

@petebacondarwin petebacondarwin added the action: merge The PR is ready for merge by the caretaker label Jan 14, 2019
@petebacondarwin petebacondarwin added this to MERGE in docs-infra Jan 14, 2019
@@ -7,4 +7,3 @@
.cli-option-syntax {
white-space: pre;
}

Copy link
Member

@gkalpak gkalpak Jan 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭
UPDATE: Oh, it was an extra line 🤗

petebacondarwin pushed a commit to petebacondarwin/angular that referenced this pull request Jan 14, 2019
petebacondarwin pushed a commit to petebacondarwin/angular that referenced this pull request Jan 14, 2019
petebacondarwin pushed a commit to petebacondarwin/angular that referenced this pull request Jan 14, 2019
AndrewKushnir pushed a commit that referenced this pull request Jan 16, 2019
AndrewKushnir pushed a commit that referenced this pull request Jan 16, 2019
wKoza added a commit to wKoza/angular that referenced this pull request Jan 18, 2019
wKoza added a commit to wKoza/angular that referenced this pull request Jan 18, 2019
wKoza added a commit to wKoza/angular that referenced this pull request Jan 18, 2019
wKoza added a commit to wKoza/angular that referenced this pull request Jan 18, 2019
ngfelixl pushed a commit to ngfelixl/angular that referenced this pull request Jan 28, 2019
ngfelixl pushed a commit to ngfelixl/angular that referenced this pull request Jan 28, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker aio: preview cla: yes feature Issue that requests a new feature target: patch This PR is targeted for the next patch release
Projects
5 participants