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(fast-design-system): improve ergonomics of the fast design system #4973

Merged

Conversation

EisenbergEffect
Copy link
Contributor

@EisenbergEffect EisenbergEffect commented Jul 20, 2021

Pull Request

📖 Description

Based on community feedback and some potential error cases, I've added a provideFASTDesignSystem function as the default way of getting a design system instance. Additionally, I've made allComponents into a registry itself so that it can be passed directly to the design system. Here's what the code would now be:

provideFASTDesignSystem().register(allComponent);

👩‍💻 Reviewer Notes

This is an additive change to mostly improve ergonomics but to also provide a more standard setup function which we can augment the content of in the future without breaking consumers.

📑 Test Plan

Existing tests passing. New APIs are consumed in the process of running the storybook, and so are validated there.

✅ 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.

⏭ Next Steps

As soon as this PR is in, we need to do two pretty quick follow up tasks:

  • Update the FluentUI Web Components with the same pattern e.g. provideFluentUIDesignSystem()
  • Update our documentations to use these functions rather than DesignSystem.getOrCreate()...

@@ -151,4 +155,19 @@ export const allComponents = {
fastToolbar,
fastTreeView,
fastTreeItem,
register(container?: Container) {
Copy link
Contributor

Choose a reason for hiding this comment

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

way nicer!

Copy link
Member

@chrisdholt chrisdholt left a comment

Choose a reason for hiding this comment

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

Sweet!

@EisenbergEffect EisenbergEffect merged commit b335929 into master Jul 21, 2021
@EisenbergEffect EisenbergEffect deleted the users/eisenbergeffect/fast-design-system-ergonomics branch July 21, 2021 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants