feat(fast-design-system): improve ergonomics of the fast design system #4973
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 madeallComponents
into a registry itself so that it can be passed directly to the design system. Here's what the code would now be:👩💻 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
$ yarn change
⏭ Next Steps
As soon as this PR is in, we need to do two pretty quick follow up tasks:
provideFluentUIDesignSystem()
DesignSystem.getOrCreate()...