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

RFC: Documentation-related Metadata #26

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

RFC: Documentation-related Metadata #26

wants to merge 16 commits into from

Conversation

mysticflute
Copy link

@mysticflute
Copy link
Author

@diervo looks like I don't have access to add reviewers to this PR. Can you please be a reviewer and also add others, probably @apapko and @caridy and whoever else, thanks!

@diervo
Copy link
Contributor

diervo commented Mar 11, 2020

@mysticflute gave you access

@diervo diervo added the draft label Mar 11, 2020
text/0000-documentation-related-metadata.md Outdated Show resolved Hide resolved
text/0000-documentation-related-metadata.md Outdated Show resolved Hide resolved

The following keys will be recognized in the frontmatter:

* __category__ `string` \
Copy link
Member

Choose a reason for hiding this comment

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

What is the default value if any? What happens if no category is specified, is it considered as unclassified?

Copy link
Author

Choose a reason for hiding this comment

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

It would be up to the consumer to decide which text to use to describe a lack of categorization. None of these fields would be considered required from the compiler standpoint.


* __category__ `string` \
The main category for the module. Only one may be specified. Salesforce will maintain a list of recognized categories in public documentation and the VS Code extension for code completion/linting. For applications like the Component Library, values that match the whitelist will be displayed on the component’s reference page. Also see the filters on the homepage of the [Component Library](https://developer.salesforce.com/docs/component-library/overview/components) for other ways this information can be used.
* __experience__ `string[]` \
Copy link
Member

Choose a reason for hiding this comment

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

What is the default value?
Is there a way to a module is portable and available in all the experience out of the box? Listing all the experiences is not an option here, since we might add new experiences in the futures and modules hardcoding all the experiences will need to be updated to add the new experience to the list.

Copy link
Author

Choose a reason for hiding this comment

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

yes that's a good point. An 'All' experience is reasonable. The risk is that people will tend to use that without testing their components in the experience, or new experiences may be added that some existing components don't support.

text/0000-documentation-related-metadata.md Outdated Show resolved Hide resolved
* __experience__ `string[]` \
One or more Salesforce experiences that the module works in. Salesforce will maintain a list of recognized experiences in public documentation and the VS Code extension for code completion/linting. For applications like the Component Library, values that match the whitelist will be displayed on the component’s reference page. Also see the filters on the homepage of the [Component Library](https://developer.salesforce.com/docs/component-library/overview/components) for other ways this information can be used.
* __isSubComponent__ `boolean` \
This denotes that the component is only intended for use inside of another component, for example `lightning-breadcrumb` is only used inside of `lightning-breadcrumbs`. The Component Library may use this information for filtering options, to automatically cross-link pages, or to provide [component grouping](https://gus.lightning.force.com/lightning/r/a07B0000006HrUNIA0/view). Also this information could be used for linting.
Copy link
Member

Choose a reason for hiding this comment

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

In order to implement component grouping, we will need more information than just a boolean.
Have you thought of having a property called validParentComponent that would reference in which context this component can be used.

Copy link
Author

Choose a reason for hiding this comment

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

Yes that's a good idea.

text/0000-documentation-related-metadata.md Outdated Show resolved Hide resolved
One or more Salesforce experiences that the module works in. Salesforce will maintain a list of recognized experiences in public documentation and the VS Code extension for code completion/linting. For applications like the Component Library, values that match the whitelist will be displayed on the component’s reference page. Also see the filters on the homepage of the [Component Library](https://developer.salesforce.com/docs/component-library/overview/components) for other ways this information can be used.
* __isSubComponent__ `boolean` \
This denotes that the component is only intended for use inside of another component, for example `lightning-breadcrumb` is only used inside of `lightning-breadcrumbs`. The Component Library may use this information for filtering options, to automatically cross-link pages, or to provide [component grouping](https://gus.lightning.force.com/lightning/r/a07B0000006HrUNIA0/view). Also this information could be used for linting.
* __deprecated__ `boolean` \
Copy link
Member

Choose a reason for hiding this comment

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

Is there an existing way deprecation is already specified?

I am not aware of a standard way to mark a component as deprecated.

Does it make more sense to use the @deprecated tag from JSDoc?

It makes sense to keep the @deprecated notation in JSDoc. Even if a module/component is not deprecated, some of their methods and properties might be.

Also, should we have another field for the replacement component?

It is not uncommon that a deprecated module doesn't have a 1-1 replacement. Deprecated requires most of the time some free form text to indicate how to migrate, we can ask for deprecated modules to add a banner in the documentation explaining the migration strategy. We can also add another property called deprecationMessage to have a standard way to surface in the component library and the different tools.

Copy link
Author

@mysticflute mysticflute May 7, 2020

Choose a reason for hiding this comment

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

I like the idea of deprecationMessage, as that can be used easier in tools like the editor LSPs. For more complicated scenarios I agree this could be supplemented with more information in the documentation itself.

When I talked with Alex and Ravi it came up that a deprecation flag might be added to the .js-meta.xml file. I'm not sure if it belongs there, but I agree the @deprecated tag works better than in the doc metadata, so how we flag deprecation can be a separate discussion.

mysticflute and others added 8 commits May 7, 2020 18:36
Co-authored-by: Ravi Jayaramappa <ravi.jayaramappa@salesforce.com>
Co-authored-by: Pierre-Marie Dartus <dartus.pierremarie@gmail.com>
Co-authored-by: Pierre-Marie Dartus <dartus.pierremarie@gmail.com>
Co-authored-by: Pierre-Marie Dartus <dartus.pierremarie@gmail.com>
Co-authored-by: Ravi Jayaramappa <ravi.jayaramappa@salesforce.com>
@pmdartus pmdartus added draft and removed draft labels Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants