-
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
[Security Solution] kbn package for generic hook utils #101976
Conversation
Updates references, and fixes a few missing config that were preventing packages from building.
Similar to useAsync (a nearly identical interface), this is meant to wrap a thunk returning an observable, allowing conditional invocation and progressive updates as the observable continues to emit.
Pinging @elastic/security-solution (Team: SecuritySolution) |
This function (and its tests) were moved to the hook-utils package; this was simply missed.
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.
LGTM, thanks for breaking this package out! Makes sense
@elasticmachine merge upstream |
The build system does not currently support these typescript features. While a valid fix would also have been to build separate browser and node targets a la elastic#99390, the use here was very minimal and so changing to a supported syntax was the most pragmatic fix.
@mistic @jbudz would one of you be able to verify that this package builds correctly for all target environments? I recall @FrankHassanabad that should be done before merging this. |
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.
lgtm
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @rylnd |
* Adds boilerplate for new hook-utils package * Move existing, identified utils into our hook-utils package Updates references, and fixes a few missing config that were preventing packages from building. * Extracts a common type and adds a little more JSdoc for clarity * Adds new useObservable hook Similar to useAsync (a nearly identical interface), this is meant to wrap a thunk returning an observable, allowing conditional invocation and progressive updates as the observable continues to emit. * Remove orphaned test This function (and its tests) were moved to the hook-utils package; this was simply missed. * Remove optional chaining from kbn package The build system does not currently support these typescript features. While a valid fix would also have been to build separate browser and node targets a la elastic#99390, the use here was very minimal and so changing to a supported syntax was the most pragmatic fix. * Update old reference in test file Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # package.json
…2539) * Adds boilerplate for new hook-utils package * Move existing, identified utils into our hook-utils package Updates references, and fixes a few missing config that were preventing packages from building. * Extracts a common type and adds a little more JSdoc for clarity * Adds new useObservable hook Similar to useAsync (a nearly identical interface), this is meant to wrap a thunk returning an observable, allowing conditional invocation and progressive updates as the observable continues to emit. * Remove orphaned test This function (and its tests) were moved to the hook-utils package; this was simply missed. * Remove optional chaining from kbn package The build system does not currently support these typescript features. While a valid fix would also have been to build separate browser and node targets a la #99390, the use here was very minimal and so changing to a supported syntax was the most pragmatic fix. * Update old reference in test file Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # package.json
Summary
This abstracts a package of generic hooks and utilities being consumed in a few other plugins. The possibility of such a package was identified as part of #100375, but the need for a new
useObservable
hook and no great place to put it were good enough reasons to create this package.Checklist
For maintainers