-
Notifications
You must be signed in to change notification settings - Fork 195
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
chore(storybook): fix code loading on docs pages [CSS-1070] #3440
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: e6f0e83 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 |
🚀 Deployed on https://pr-3440--spectrum-css.netlify.app |
@@ -40,7 +40,6 @@ | |||
"@etchteam/storybook-addon-status": "^5.0.0", | |||
"@storybook/addon-a11y": "^8.4.6", | |||
"@storybook/addon-actions": "^8.4.6", | |||
"@storybook/addon-console": "^3.0.0", |
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.
This plugin adds little value and is pretty slow as well so I included here to ensure reasonable load times for pages.
@@ -51,7 +50,6 @@ | |||
"@storybook/core-events": "^8.4.6", | |||
"@storybook/manager-api": "^8.4.6", | |||
"@storybook/preview-api": "^8.4.6", | |||
"@storybook/testing-library": "^0.2.2", |
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.
Also unused so removed this to prevent any conflicting code loaded.
@@ -94,11 +81,6 @@ export const parameters = { | |||
}, | |||
status: { | |||
statuses: { | |||
migrated: { |
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.
Unused code
useTabs: false, | ||
htmlWhitespaceSensitivity: "ignore", | ||
}, | ||
highlighter: { | ||
showLineNumbers: true, |
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.
Show duplicate line numbers when this is set to true
File metricsSummaryTotal size: 4.27 MB* 🎉 No changes detected in any packages * Size determined by adding together the size of the main file for all packages in the library.* Results are not gzipped or minified. * An ASCII character in UTF-8 is 8 bits or 1 byte. |
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.
I see a brief delay before the code loads after hitting Show code
but it no longer freezes or locks up the application.
These changes reduced the amount of code in the "Show code" snippets. However, for components with large amounts of markup, they still render very slowly and can cause the page to become unresponsive.
|
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.
As Ruben just noted, it's still giving "Page Unresponsive" for many components (Chrome, Mac). Some ones I tested of note:
- Accordion: will show the unresponsive message, but the code actually loads a few seconds later after that initial delay
- Checkbox: unresponsive message but the code never loads and page fully locks up after waiting
- Card and Button: code does load but there is still a bit of a delay
6237e13
to
7c8c3cc
Compare
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.
This appears to be loading a lot faster now. I'm now able to load the Checkbox and Accordion code. Was it related to the icon loading and/or Typekit loading?
One significant question below about whether --test
should be in there, otherwise I think it's good to go.
7a3404a
to
8655320
Compare
365da61
to
96ac257
Compare
1340b84
to
a479cc4
Compare
a479cc4
to
e6f0e83
Compare
Description
The "Show code" feature is causing Storybook to freeze, which means that a user cannot view the reference markup on the documentation (without using the inspector).
Upon investigation, I determined this was caused by the testing grid injecting so much markup onto docs pages that it was overloading the code previewer. The testing code now returns only the template on docs pages when the Variant() function is used.
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Open the storybook docs page for any component:
Regression testing
Validate:
To-do list