-
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] Complete package migration; delete plugin #138962
[Shared UX] Complete package migration; delete plugin #138962
Conversation
Pinging @elastic/apm-ui (Team:apm) |
Pinging @elastic/uptime (Team:uptime) |
d8d94a3
to
18c6233
Compare
Sorry for the widespread pings, I rebased and ended up integrating the commits, rather than rebasing upon them. Apologies, should be all set now! |
Pinging @elastic/unified-observability (Team:Observability) |
6a6bc23
to
1b96f68
Compare
1b96f68
to
7261e65
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.
Operations changes LGTM! So glad we've made it here
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.
Code review only, let me know if there is a certain part here that needs to be actually tested.
@@ -67,8 +67,6 @@ | |||
"savedObjectsManagement": "src/plugins/saved_objects_management", | |||
"server": "src/legacy/server", | |||
"share": "src/plugins/share", | |||
"sharedUX": "src/plugins/shared_ux", | |||
"sharedUXComponents": "packages/kbn-shared-ux-components/src", |
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.
🙌
getRedirectAppLinksKibanaDependenciesMock() | ||
getRedirectAppLinksKibanaDependenciesMock(), | ||
{ | ||
isMergeableObject: isPlainObject, |
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.
What is this change?
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.
deepmerge
merges objects, so jest.fn()
objects were also getting merged, which meant they were no longer mocked functions. isMergeableObject
allows one to create a function to test if the object should be merged or not. In this case, I'm saying deepmerge
should only merge the object if it passes lodash.isPlainObject
.
const { hasESData, hasUserDataView } = services; | ||
|
||
return ( | ||
<KibanaNoDataPageContext.Provider value={{ hasESData, hasUserDataView }}> |
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.
why do we need to explicitly destructure services
here?
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.
services
could include a lot of other things, as TS types do not prevent passing objects with more than is necessary. By destructuring first, we exclude anything extra that was passed, and keep the context value from being unintentionally bloated.
<span>Second Item</span>, | ||
]; | ||
|
||
export class StorybookMock extends AbstractStorybookMock< |
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 feels a bit overly complicated. Do we need this AbstractStorybookMock
?
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 needed a way to make sure that all Storybook mocks followed the same API. This allows us to compose mocked values for services without having to know what services consumed components need.
I grant you: it's complicated. But it's working at the moment. We'll probably refactor it at some point, but I had to start somewhere.
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.
Code review only, Actionable Observability import changes LGTM.
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.
kibana-gis changes LGTM
code review
8a53424
to
a99027e
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.
Import path change to the getting_started page in the home
plugin LGTM
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.
apm changes lgtm
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
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 trust others have reviewed the code - just a designers approval here 😊
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.
Security Solution changes LGTM!
Thank you all! |
* [Shared UX] Complete package migration; delete plugin * [CI] Auto-commit changed files from 'node scripts/generate packages_build_manifest' * Fix types, fix tests * Create Storybook config package; organize Storybook * [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs' * Revise Storybook config package; make mock packages compatible with web Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR is large, but completes the migration of Shared UX components to the new package architecture in Kibana.
What does this PR do?
NoDataPage
,NoDataConfigPage
andKibanaPageTemplate
into separate packages.impl
,mocks
andtypes
packages.@kbn/shared-ux-components
and@kbn/shared-ux-services
packages.@kbn/shared-ux-storybook
package in favor of a local configuration:/packages/shared-ux/.storybook
.sharedUX
plugin and deletes it.What remains
You may see some
README
files with boilerplate content. In my next PR, I'm reviewing and adding documentation to all of our component packages. I'm also adding more tests using the new mocks. Check out the Shared UX Project Roadmap for more details, or reach out to me directly.