-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Tech/improvements #10052
Tech/improvements #10052
Conversation
@@ -26,5 +26,10 @@ export const extractProps = componentName => { | |||
export const extractComponentDescription = componentName => { | |||
const json = getJSONDoc(); | |||
const componentDoc = json.included.find(doc => doc.attributes.name === componentName); | |||
|
|||
if (!componentDoc) { |
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've discovered that sometimes the parameter.component isn't there, and then this code throws because componentDoc is undefined
import { visitExample } from '../helper'; | ||
|
||
describe('Navigation', () => { | ||
beforeEach(() => { | ||
before(() => { |
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 should make the test run a little faster
const Title = styled.div` | ||
font-weight: ${props => props.theme.typography.weight.bold}; | ||
`; | ||
const Title = styled.div(({ theme }) => ({ |
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 makes the bundle smaller, and compilation faster
@@ -276,8 +276,10 @@ export class StoryRenderer { | |||
} | |||
|
|||
renderDocs({ context, storyStore }: { context: RenderContext; storyStore: StoryStore }) { | |||
const { kind, parameters } = context; | |||
|
|||
const { kind, parameters, id } = 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.
When storybook initially renders, the url contains id="*".
This is a non-valid storyId, but it's because the manager doesn't know a valid ID yet.
This code makes it so docs-mode doesn't throw when that happens.
@@ -54,15 +54,15 @@ const Desktop = React.memo<DesktopProps>( | |||
{({ navProps, mainProps, panelProps, previewProps }) => ( | |||
<Fragment> | |||
<S.Sidebar {...navProps}> | |||
<Sidebar debug={navProps} /> | |||
<Sidebar /> |
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.
Useful for debugging, but bad for performance.
@@ -7,3 +7,7 @@ | |||
YARN_FLAGS = "--version" | |||
DOTENV_DISPLAY_WARNING = "none" | |||
STORYBOOK_EXAMPLE_APP ="true" | |||
[[headers]] |
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 is to enable CORS on our examples
.
.