Right now, if someone wants to write documentation for their code, they have to use namespaces (like "sap.ui.webc.main"). This is because JSDoc doesn't understand where to assign the comments otherwise. This makes things a bit harder for developers. So, we decided to use a different documentation standard, which is called "custom-elements-manifest." To switch from "api.json" to "custom-elements.json," we need to replace the JSDoc plugin with "custom-elements-manifest/analyzer."
Once we make this change, the way we write our documentation will be different. We'll have to update our JSDoc comments by getting rid of the namespaces, removing tags that we don't use anymore, and so on.
Expectation:
Revise documentation using the details provided below.
Note: With these tags only deprecated, since and privacy status could be changed. If you want to change the description use @param tag in the event description.
Note: Now, you have to specify the privacy of the parameter with privacy tag and also to describe the parameter in event comment.
Note: Interface name is automatically generated from accessor name and @name tag is redundant.
Interface changes
In order to remove sap.ui.webc.main/fiori namespaces we have to replace variable declared interfaces with a TypeScript declared interfaces. At the moment interfaces are only markes but for some of the markers a real interfaces exist so the changes are following:
Interface that can't be transformed to a real interface
## Before
const IButton = "sap.ui.webc.main.IButton";
## After
interface IButton extends HTMLElement { }
Interface that can be transformed to a real interface
NOTE: If the interface is created to describe abstract component (component that doesn't have template) we remove the interface and start to use the class since.
This issue is follow up of https://github.com/SAP/ui5-webcomponents/issues/6958
Background:
Right now, if someone wants to write documentation for their code, they have to use namespaces (like "sap.ui.webc.main"). This is because JSDoc doesn't understand where to assign the comments otherwise. This makes things a bit harder for developers. So, we decided to use a different documentation standard, which is called "custom-elements-manifest." To switch from "api.json" to "custom-elements.json," we need to replace the JSDoc plugin with "custom-elements-manifest/analyzer."
Once we make this change, the way we write our documentation will be different. We'll have to update our JSDoc comments by getting rid of the namespaces, removing tags that we don't use anymore, and so on.
Expectation:
Revise documentation using the details provided below.
Table on contents
JSDOC changes
Class tags
@class
@class
@constructor
@constructor
@public
/@protected
/@private
@public
@protected
@private
@since
@since
1.2.0@deprecated
@depreaceted
@deprecated
version 1.4.0@abstract
@abstract
@implements
@implements
{ShowcaseType}@extends
@extends
ShowcaseType@slot
@csspart
Note: Class name is automatically generated and
@alias
tag is redudantNote: Tag name is automatically generated and
@tagName
is redundantNote: If the component implements more than 1 interface use
@implements
tag for every interface, instead of separating them with comma.Property and getter (readonly property) tags
@public
/@protected
/@private
@public
@protected
@private
@since
@since
1.2.0@deprecated
@depreaceted
@deprecated
version 1.4.0@default
(required for public properties/getters)@default
"myDefaultValue"@formProperty
@formProperty
@formEvents
@formEvents
change inputNote: Type is autmatially calculated from the accesor name.
Note: Property name is automatically generated from accessor name and
@name
tag is redundant.Slot tags
Property slot
Property slot is the slot that has accessor
@public
/@protected
/@private
@public
@protected
@private
@since
@since
1.2.0@deprecated
@depreaceted
@deprecated
version 1.4.0Note: Slot name is automatically generated from accessor name and
@slot
tag is redundant.Note: Type is automatically calculated from the accessor type
Note: If the default is set to true inside the decorator, the slot will appear as default.
Unnamed slot
Property slot is the default slot that doesn't have accessor. This slot is declared inside class comment using
@slot
tag.Event tags
Event tags
@param
@param
{ShowcaseType} testParameter description@public
/@protected
/@private
@public
@protected
@private
@since
@since
1.2.0@deprecated
@depreaceted
@deprecated
version 1.4.0@allowPreventDefault
@allowPreventDefault
@native
@native
Event parameter tags
Now, you can specify
@public
/@protected
/@private
(required if there is a@param tag
with the same name)@public
@protected
@private
@since
@since
1.2.0@deprecated
@depreaceted
@deprecated
version 1.4.0Note: With these tags only deprecated, since and privacy status could be changed. If you want to change the description use
@param
tag in the event description. Note: Now, you have to specify the privacy of the parameter with privacy tag and also to describe the parameter in event comment.Method tags
@param
@param
param1 parameter description showcase@param
{ShowcaseType} [param2] optional parameter description showcase@public
/@protected
/@private
@public
@protected
@private
@since
@since
1.2.0@deprecated
@depreaceted
@deprecated
version 1.4.0@returns
@returns
return description showcaseNote: Parameters type and return types is generated automatically
Note: Method name is automatically generated from accessor name and
@method
/@name
tag is redundant.Note:
@async
method is redundant because only return type is usedNote:
@static
tag is redundant because it's automatically calculated when the method is staticCSS Part
YOu can defined css part inside class comment using
@csspart
tag.Enum and enum member tags
@public
/@protected
/@private
(required for enum members)@public
@protected
@private
@since
@since
1.2.0@deprecated
@depreaceted
@deprecated
version 1.4.0Note: Enum name is automatically generated from accessor name and
@alias
tag is redundant.Interface tags
@public
/@protected
/@private
@public
@protected
@private
@since
@since
1.2.0@deprecated
@depreaceted
@deprecated
version 1.4.0Note: Interface name is automatically generated from accessor name and @name tag is redundant.
Interface changes
In order to remove sap.ui.webc.main/fiori namespaces we have to replace variable declared interfaces with a TypeScript declared interfaces. At the moment interfaces are only markes but for some of the markers a real interfaces exist so the changes are following:
Interface that can't be transformed to a real interface
Interface that can be transformed to a real interface
NOTE: If the interface is created to describe abstract component (component that doesn't have template) we remove the interface and start to use the class since.
Fixes: #7388 #7075 #6306