runem / web-component-analyzer

CLI that analyzes web components and emits documentation
https://runem.github.io/web-component-analyzer
MIT License
502 stars 63 forks source link

[request] - support @deprecated #103

Open bennypowers opened 4 years ago

bennypowers commented 4 years ago

We want to use the @deprecated JSDoc tag to announce via the README and intellisense that a certain property should not be used, without releasing breaking changes.

It would be wonderful if this input

/**
 * Size of the internal icon in px
 * @attr icon-size
 * @type {Number}
 * @deprecated Since 3.0.0. Use `--icon-size` CSS property instead. Will be removed at next major version.
 */
@property({ type: Number, attribute: 'icon-size' }) iconSize = 20;

Which currently produces this README table:

## Properties

| Property| Attribute | Type| Default | Description |
|---------|-----------|-----|---------|-------------|
| `iconSize` | `icon-size` | `number` | 20| The internal icon's size. |

Would produce instead this expected table

## Properties

| Property| Attribute | Type| Default | Description |
|---------|-----------|-----|---------|-------------|
| `iconSize` | `icon-size` | `number` | 20| The internal icon's size.<br/>\
*DEPRECATED* Since 3.0.0. Use `--icon-size` CSS property instead. Will be removed at next major version.                          |
daKmoR commented 4 years ago

uh very nice 🤗

how about also including it in custom-element.json? strawman proposal

... 
{ properties: [
  { name: 'iconSize', type: 'number', deprecated: true, deprecatedMessage: '...' }
]
bennypowers commented 4 years ago

yes. for the purposes of this request, implementation in custom-elements.json is implied as well

yinonov commented 3 years ago

it doesn't seem to be picking that up image