-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Use loaders to improve initial load time of resources #11
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
base: feat/sb-10
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 222e7b3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
3836f3c to
222e7b3
Compare
| } | ||
|
|
||
| return PreviewDecorator(StoryFn, context); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually still need the decorator at all?
Couldn't everything be done in a loader?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need it to react to changes in the addon panel, when users select/deselect a CSS resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we convert to use globals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be an option but it would require reworking the resource list a bit. Each story should have a different set of "picked" resources (so you can write a story for your component with each major version of Bootstrap or each font you're using).
Correct me if my understanding is wrong here -> So then to use globals, we'd want stories to redefine globals, which means the parameter must be an object (so it gets merged correctly). But the parameter currently is an array, so there'd be a breaking change for users' config.
I didn't wanna invest much more effort into this addon, so I just wanted to get loaders in because it makes a decent difference visually when you load your stories. If globals is significantly more future proof or if I've missed some benefits, happy to reconsider!
No description provided.