-
-
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
Official example: try moving options to manager.js
#9323
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/p8c4py0u9 |
For 6.0.0 the documentation is correct. For 5.3 we need to reverse this documentation a bit, to tell users to keep setting the global parameter |
I can confirm that:
I added a FIX in |
@tmeasday I did find what @Hypnosphi found too: When a user would make migrate all options to
Also regarding theming, I have a PR open for 5.3 to document how theming + addon-docs is special: #9661 @Hypnosphi WDYT? after this PR, this becomes perfectly valid config: // manager.js
import { addons } from '@storybook/addons';
import { themes } from '@storybook/theming';
addons.setConfig({
showRoots: true,
theme: themes.light, // { base: 'dark', brandTitle: 'Storybook!' },
storySort: (a, b) =>
a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true }),
}); |
|
lib/api/src/modules/stories.ts
Outdated
@@ -229,7 +230,7 @@ const initStoriesApi = ({ | |||
hierarchyRootSeparator: rootSeparator = undefined, | |||
hierarchySeparator: groupSeparator = undefined, | |||
showRoots = undefined, | |||
} = (parameters && parameters.options) || {}; |
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.
@ndelangen do you think we should come up with a principled way to pull configuration from both parameters and .getConfig()
? It seems like this comes up a bit and maybe there should be a single API for it?
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.
For instance @atanasster does something very similar in #9095
# Conflicts: # examples/official-storybook/manager.js
lib/api/src/modules/stories.ts
Outdated
warnRemovingHierarchySeparators(); | ||
if (usingShowRoots) warnUsingHierarchySeparatorsAndShowRoots(); | ||
({ root, groups } = parseKind(kind, { | ||
rootSeparator: rootSeparator || '|', |
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.
Are we removing these in 6.0? Or are we planning to patch this back to 5.3? Or will we do that in a separate PR?
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.
Yeah removing those deprecations is on my wishlist
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 know a single key on your keyboard that could make your wish come 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.
I'm well aware of existence of the delete
key on my keyboard
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.
# Conflicts: # lib/api/src/modules/stories.ts # package.json # yarn.lock
👏 |
I tried applying https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#using-managerjs to our own example storybook
I found two issues:
showRoots
doesn't workmanager.js
doesn't hot reload: e.g. if you change it totheme: themes.dark
, it applies only after page reload