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

feat: add slot event part docs to foundation #5912

Merged
merged 12 commits into from
May 2, 2022

Conversation

chrisdholt
Copy link
Member

Pull Request

📖 Description

This PR does an initial pass to add jsdocs to enable support for slots, events, and parts in the CEM analyzer.

Two components have some gaps due to how composable they are - Calendar and Data Grid.

🎫 Issues

closes #5904

👩‍💻 Reviewer Notes

📑 Test Plan

✅ Checklist

General

  • I have included a change request file using $ yarn change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

⏭ Next Steps

@chrisdholt chrisdholt force-pushed the users/chhol/add-slot-event-part-docs-to-foundation branch from 3eab1f3 to 33ebe47 Compare April 28, 2022 17:11
@chrisdholt
Copy link
Member Author

@scomea are you able to add this context for data-grid once this PR goes in? I'm did not feel familiar enough with the code to address everything.

* @slot end - Content which can be provided between the start slot and icon
* @slot heading - Content which serves as the accordion item heading and text of the expand button
* @slot - The default slot for accordion item content
* @slot - expanded-icon - The expanded icon
Copy link
Contributor

Choose a reason for hiding this comment

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

The analyzer uses the hyphen as the separator between the name and the description. These hyphens between @slot and the name should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I did almost all of these manually, I'll do one last check for any time it's not the default slot.

@scomea
Copy link
Collaborator

scomea commented Apr 28, 2022

@scomea are you able to add this context for data-grid once this PR goes in? I'm did not feel familiar enough with the code to address everything.

Ok.
#5913

@chrisdholt chrisdholt added the fast-components:final Issues or PR's to include in the final release of fast-components label Apr 28, 2022
* @csspart input-container - The element representing the visual checked or radio indicator
* @csspart checkbox - The element wrapping the `menuitemcheckbox` indicator
* @csspart radio - The element wrapping the `menuitemradio` indicator
* @scspart content - The element wrapping the menu item content
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo. Should be "@csspart".

@nicholasrice
Copy link
Contributor

Wow, thanks Chris! I'm so happy we're finally able to get these flags in. One thing that catches my eye here is that it documents the foundation components as if they are a single component, template and class, where in this package those two are never actually combined. For example, the ES6 class conceptually never has css parts or slots because those are template concerns. I don't know if we should change anything now because we would likely need to adjust the CEM code, but to me it would make more sense if the class and templates are both documented w/ their respective TSDoc flags. Any thoughts on that? We can take to an issue if needed.

@chrisdholt
Copy link
Member Author

Wow, thanks Chris! I'm so happy we're finally able to get these flags in. One thing that catches my eye here is that it documents the foundation components as if they are a single component, template and class, where in this package those two are never actually combined. For example, the ES6 class conceptually never has css parts or slots because those are template concerns. I don't know if we should change anything now because we would likely need to adjust the CEM code, but to me it would make more sense if the class and templates are both documented w/ their respective TSDoc flags. Any thoughts on that? We can take to an issue if needed.

I fired this off without much investigation after a few conversations with @williamw2, so I have zero thoughts. Totally open, just going by the initial convention shared. I’ll default to him :)

@williamw2 williamw2 mentioned this pull request Apr 29, 2022
9 tasks
@williamw2
Copy link
Contributor

@nicholasrice I don't think that's going to work. The problem is in how we declare the templates as a const function that returns a template. The CEM analyzer sees it as just a function and seems to ignore any jsdoc tags that don't apply to functions. Then the markdown generator simply renders it in a "function" table with just a name and description. I'm currently manually excluding the template functions from the markdown output as they didn't seem useful. The plan is to eventually replace the CEM markdown generation with a custom solution. Maybe we can try to address this then.

@chrisdholt chrisdholt force-pushed the users/chhol/add-slot-event-part-docs-to-foundation branch 3 times, most recently from dd16f5b to 0b64722 Compare May 2, 2022 20:25
@chrisdholt chrisdholt force-pushed the users/chhol/add-slot-event-part-docs-to-foundation branch from 0b64722 to 490e6ee Compare May 2, 2022 20:40
@chrisdholt chrisdholt merged commit 8327524 into master May 2, 2022
@chrisdholt chrisdholt deleted the users/chhol/add-slot-event-part-docs-to-foundation branch May 2, 2022 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fast-components:final Issues or PR's to include in the final release of fast-components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add slot, event and css shadow part JSDoc tags to Fast-Foundation components
5 participants