-
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
[Presentation] Remove uses of export * from
in Presentation Util plugin
#145633
Conversation
resolveWithMissingImage, | ||
encode, | ||
parseDataUrl, | ||
} from './lib'; |
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 unsure about exporting these modules from common/index.ts
. It might not be necessary since, unlike the public
and server
directories, other plugins can import deeply from common
directories (ex. import { fontStyle } from '@kbn/presentation-util-plugin/common/lib
). But maybe it's better practice to publish these modules from the top level of common
as we do with public
and server
?
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 personally like this approach a lot. I'm not sure why common
is considered an exception to this deep imports rule.
Pinging @elastic/kibana-presentation (Team:Presentation) |
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! This looks a lot cleaner and easier to grok. I like keeping the separation between common and public very obvious rather than re-exporting items from public
.
It looks like it didn't result in any major bundle size changes either. LGTM!
@@ -6,9 +6,6 @@ | |||
* Side Public License, v 1. | |||
*/ | |||
|
|||
// TODO: https://github.com/elastic/kibana/issues/110893 | |||
/* eslint-disable @kbn/eslint/no_export_all */ |
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.
Awesome!
resolveWithMissingImage, | ||
encode, | ||
parseDataUrl, | ||
} from './lib'; |
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 personally like this approach a lot. I'm not sure why common
is considered an exception to this deep imports rule.
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Any counts in public APIs
Async chunks
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: |
…154385) ## Summary Fixes a regression where the image upload component does not load for Canvas image elements. Starting with PR #145633 modules in `@kbn/presentation-util-plugin/common` are no longer exported from the `@kbn/presentation-util-plugin/public` module. The imports in the `ImageUpload` module should have also been updated to the `@kbn/presentation-util-plugin/common` module. Fixes #154356
…lastic#154385) ## Summary Fixes a regression where the image upload component does not load for Canvas image elements. Starting with PR elastic#145633 modules in `@kbn/presentation-util-plugin/common` are no longer exported from the `@kbn/presentation-util-plugin/public` module. The imports in the `ImageUpload` module should have also been updated to the `@kbn/presentation-util-plugin/common` module. Fixes elastic#154356 (cherry picked from commit 8724518)
…nts (#154385) (#154393) # Backport This will backport the following commits from `main` to `8.7`: - [[Canvas] Fix image upload component not loading for image elements (#154385)](#154385) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nick Peihl","email":"nick.peihl@elastic.co"},"sourceCommit":{"committedDate":"2023-04-04T20:38:58Z","message":"[Canvas] Fix image upload component not loading for image elements (#154385)\n\n## Summary\r\n\r\nFixes a regression where the image upload component does not load for\r\nCanvas image elements.\r\n\r\nStarting with PR #145633 modules in\r\n`@kbn/presentation-util-plugin/common` are no longer exported from the\r\n`@kbn/presentation-util-plugin/public` module. The imports in the\r\n`ImageUpload` module should have also been updated to the\r\n`@kbn/presentation-util-plugin/common` module.\r\n\r\nFixes #154356","sha":"8724518804e1755587de90b9d22a9a04512d2ea6","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","loe:hours","impact:high","Feature:Canvas","v8.8.0","v8.7.1"],"number":154385,"url":"https://github.com/elastic/kibana/pull/154385","mergeCommit":{"message":"[Canvas] Fix image upload component not loading for image elements (#154385)\n\n## Summary\r\n\r\nFixes a regression where the image upload component does not load for\r\nCanvas image elements.\r\n\r\nStarting with PR #145633 modules in\r\n`@kbn/presentation-util-plugin/common` are no longer exported from the\r\n`@kbn/presentation-util-plugin/public` module. The imports in the\r\n`ImageUpload` module should have also been updated to the\r\n`@kbn/presentation-util-plugin/common` module.\r\n\r\nFixes #154356","sha":"8724518804e1755587de90b9d22a9a04512d2ea6"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/154385","number":154385,"mergeCommit":{"message":"[Canvas] Fix image upload component not loading for image elements (#154385)\n\n## Summary\r\n\r\nFixes a regression where the image upload component does not load for\r\nCanvas image elements.\r\n\r\nStarting with PR #145633 modules in\r\n`@kbn/presentation-util-plugin/common` are no longer exported from the\r\n`@kbn/presentation-util-plugin/public` module. The imports in the\r\n`ImageUpload` module should have also been updated to the\r\n`@kbn/presentation-util-plugin/common` module.\r\n\r\nFixes #154356","sha":"8724518804e1755587de90b9d22a9a04512d2ea6"}},{"branch":"8.7","label":"v8.7.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nick Peihl <nick.peihl@elastic.co>
Fixes #110893
Summary
Replaces uses of
export *
with of explicit imports inpublic/index.ts
in Presentation Util plugin.For reviewers:
This may look daunting as it touches many files across several plugins. I recommend looking at the change on this line first. Prior to this PR this line exports modules from the
common/lib
directory in thepublic
module. This should not be necessary since other plugins should be able to access these modules from@kbn/presentation-util-plugin/common
directly.