-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[SharedUX/React render] prevent double-nested EuiProvider #182005
[SharedUX/React render] prevent double-nested EuiProvider #182005
Conversation
Pinging @elastic/appex-sharedux (Team:SharedUX) |
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.
Great work. Might wait for @cee-chen to weigh in, but I think it's ok to address later/async.
import type { I18nStart } from '@kbn/core-i18n-browser'; | ||
|
||
// @ts-expect-error EUI exports this component internally, but Kibana isn't picking it up its types | ||
import { useIsNestedEuiProvider } from '@elastic/eui/lib/components/provider/nested'; |
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.
@cee-chen Can this be something addressed in a future EUI release? Or is this a mistake somehow, (I don't see how).
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.
Not a mistake, this has been done other places in Kibana as well (whenever devs reach into @elastic/eui/lib
). TBH I'm not 100% sure it's solvable on just the EUI level - I think it's a weird factor of how Kibana optimizes shared dependencies and its bazel pipeline. We might need to loop in KibanaOps for this as I'm not too sure why this happens either - I do believe it used to work at some point.
@@ -11,9 +11,9 @@ import useObservable from 'react-use/lib/useObservable'; | |||
|
|||
import { EuiThemeProvider, EuiThemeProviderProps } from '@elastic/eui'; | |||
|
|||
// @ts-ignore EUI exports this component internally, but Kibana isn't picking it up its types | |||
// @ts-expect-error EUI exports this component internally, but Kibana isn't picking it up its types |
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.
Nice catch.
// @ts-expect-error EUI exports this component internally, but Kibana isn't picking it up its types | ||
import { useIsNestedEuiProvider } from '@elastic/eui/lib/components/provider/nested'; | ||
// @ts-expect-error EUI exports this component internally, but Kibana isn't picking it up its types | ||
import { emitEuiProviderWarning } from '@elastic/eui/lib/services/theme/warning'; |
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.
Did we look into adding this to kbn-ui-shared-deps?
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.
Thanks for the suggestion. I am looking into it now: dd3f12a
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.
TIL this is an option - going to bookmark this for future reference 👀
This reverts commit 0ec663b.
Broken by dd3f12a... still working on this. |
/ci |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
…2005) ## Summary Addresses extraneous errors discovered in elastic#180819 --------- Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
Summary
Addresses extraneous errors discovered in #180819