-
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 Solutions] Removes tech debt of exporting all from linter rule for security_solution plugin #120188
[Security Solutions] Removes tech debt of exporting all from linter rule for security_solution plugin #120188
Conversation
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Any counts in public APIs
Async chunks
Public APIs missing exports
Page load bundle
History
To update your PR or re-run it, just comment with: |
@@ -14,7 +14,7 @@ import { TimelineEventsDetailsItem } from '../../../../common/search_strategy'; | |||
import { useRuleWithFallback } from '../../../detections/containers/detection_engine/rules/use_rule_with_fallback'; | |||
|
|||
import { TestProviders, TestProvidersComponent } from '../../mock'; | |||
import { TimelineId } from '../../../../common'; | |||
import { TimelineId } from '../../../../common/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.
can this be a import type
?
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.
These can, but most of the times these are auto-inferred by typescript. There are linter rules for forcing these with an auto-fix as well so I am not going to overly worry about them in these few cases for this PR.
@@ -14,7 +14,8 @@ import { BrowserFields } from '../../containers/source'; | |||
import { OnUpdateColumns } from '../../../timelines/components/timeline/events'; | |||
import * as i18n from './translations'; | |||
import { EventFieldsData } from './types'; | |||
import { BrowserField, ColumnHeaderOptions } from '../../../../common'; | |||
import { ColumnHeaderOptions } from '../../../../common/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.
Same here, can these be import type
?
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.
These can, but most of the times these are auto-inferred by typescript. There are linter rules for forcing these with an auto-fix as well so I am not going to overly worry about them in these few cases for this PR.
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 - left a few comments where I wasn't sure if it was worth doing import type
vs import
but I know that wasn't the main concern of this PR.
…ule for security_solution plugin (elastic#120188) ## Summary See: elastic#110903 This removes the top level API `export *` spots from: * `security_solution` plugin by removing _all_ the exports from `security_solution/common/index.ts` since non of those were shared outside this plugin. Look at the metrics from the build below and you will see _huge_ drops off numbers across the board for required API documentation to the page load size. In the file `security_solution/common/index.ts` I now put the advice of: ``` // Careful of exporting anything from this file as any file(s) you export here will cause your page bundle size to increase. // If you're using functions/types/etc... internally it's best to import directly from their paths than expose the functions/types/etc... here. // You should _only_ expose functions/types/etc... that need to be shared with other plugins here. ``` But really I doubt we will have to share anything from `security_solutions` plugin to another plugin or expose it for anyone else. So I think this is 👍 the way forward to not expose anything directly from `security_solution/common/index.ts` anymore.
…ule for security_solution plugin (#120188) (#120270) ## Summary See: #110903 This removes the top level API `export *` spots from: * `security_solution` plugin by removing _all_ the exports from `security_solution/common/index.ts` since non of those were shared outside this plugin. Look at the metrics from the build below and you will see _huge_ drops off numbers across the board for required API documentation to the page load size. In the file `security_solution/common/index.ts` I now put the advice of: ``` // Careful of exporting anything from this file as any file(s) you export here will cause your page bundle size to increase. // If you're using functions/types/etc... internally it's best to import directly from their paths than expose the functions/types/etc... here. // You should _only_ expose functions/types/etc... that need to be shared with other plugins here. ``` But really I doubt we will have to share anything from `security_solutions` plugin to another plugin or expose it for anyone else. So I think this is 👍 the way forward to not expose anything directly from `security_solution/common/index.ts` anymore.
…ule for security_solution plugin (elastic#120188) ## Summary See: elastic#110903 This removes the top level API `export *` spots from: * `security_solution` plugin by removing _all_ the exports from `security_solution/common/index.ts` since non of those were shared outside this plugin. Look at the metrics from the build below and you will see _huge_ drops off numbers across the board for required API documentation to the page load size. In the file `security_solution/common/index.ts` I now put the advice of: ``` // Careful of exporting anything from this file as any file(s) you export here will cause your page bundle size to increase. // If you're using functions/types/etc... internally it's best to import directly from their paths than expose the functions/types/etc... here. // You should _only_ expose functions/types/etc... that need to be shared with other plugins here. ``` But really I doubt we will have to share anything from `security_solutions` plugin to another plugin or expose it for anyone else. So I think this is 👍 the way forward to not expose anything directly from `security_solution/common/index.ts` anymore.
Summary
See: #110903
This removes the top level API
export *
spots from:security_solution
pluginby removing all the exports from
security_solution/common/index.ts
since non of those were shared outside this plugin. Look at the metrics from the build below and you will see huge drops off numbers across the board for required API documentation to the page load size.In the file
security_solution/common/index.ts
I now put the advice of:But really I doubt we will have to share anything from
security_solutions
plugin to another plugin or expose it for anyone else. So I think this is 👍 the way forward to not expose anything directly fromsecurity_solution/common/index.ts
anymore.