-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[shared-ux][packages] 2. Create Storybook Package #127548
[shared-ux][packages] 2. Create Storybook Package #127548
Conversation
9899ec7
to
ad6a03a
Compare
d27684c
to
13efeb8
Compare
ad6a03a
to
f9571c7
Compare
...defaultConfig, | ||
stories: [ | ||
'../../../kbn-shared-ux*/**/*.stories.+(tsx|mdx)', | ||
'../../../../src/plugins/shared_ux/**/*.stories.+(tsx|mdx)', |
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 is ok for a package to have a reference to plugin?
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 now we're not really counting this as a "reference". Storybook is very development-time specific, nothing about it ends up in the build, and this doesn't exactly load code or integrate with the build systems, node module loaders, etc...
We're okay with storybook packages reading stories from throughout the repo. It seems to make sense considering the tool, so Operations has "blessed" this exception.
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 can add this to the documentation for this package, to clear up any confusion.
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 don't understand why we need this package. To provide implementation for the services for use in storybook files? Why can't this be a part of services pacakge. Or at least, should the package be called storybook-services
?
@majagrubic The reason for this package is because, when you depend on a package, you get all of the code that comes with it... just like an Packages can be further and further divided by subject matter or dependency. For example, I expect |
* [shared-ux][packages] 3. Create Utility Package * [shared-ux][packages] 4. Create Components Package (#127551) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
⏳ Build in-progress, with failuresFailed CI Steps
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
* [shared-ux][packages] 1. Create Services Package * Address review feedback * [shared-ux][packages] 2. Create Storybook Package (#127548) * [shared-ux][packages] 2. Create Storybook Package * [shared-ux][packages] 3. Create Utility Package (#127549) * [shared-ux][packages] 3. Create Utility Package * [shared-ux][packages] 4. Create Components Package (#127551) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * Merging * Adding docs * A few fixes * Fix TS types * Fix TS types * Fix i18n Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* [shared-ux][packages] 1. Create Services Package * Address review feedback * [shared-ux][packages] 2. Create Storybook Package (elastic#127548) * [shared-ux][packages] 2. Create Storybook Package * [shared-ux][packages] 3. Create Utility Package (elastic#127549) * [shared-ux][packages] 3. Create Utility Package * [shared-ux][packages] 4. Create Components Package (elastic#127551) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * Merging * Adding docs * A few fixes * Fix TS types * Fix TS types * Fix i18n Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR refactors the Shared UX Storybook configuration to use
@kbn/shared-ux-services
, and moves it from theshared_ux
plugin to a package.Why?
With only a few components, we've run into issues with circular dependencies. Our plugin is consuming code and types from other plugins, and once we do, those plugins can't use our plugin or its components. To mitigate this, we need to keep Shared UX as stateless and dependency free as possible.
Talking with ops, it became clear our assets don't actually need a plugin lifecycle to operate. This PR is one step in decoupling our components, services and utilities to packages.
TODO
.mdx
documentation.