-
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
Adding comment about importing lodash library #78156
Adding comment about importing lodash library #78156
Conversation
@@ -5,6 +5,8 @@ | |||
*/ | |||
|
|||
import axios from 'axios'; | |||
// Prefer importing entire lodash library, e.g. import { get } from "lodash" | |||
// eslint-disable-next-line no-restricted-imports | |||
import { omitBy, isNil } from 'lodash/fp'; |
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 think we need an exception for lodash/fp
as I'm pretty sure you can't access lodash/fp any other way. I've added that import to the shared bundle so we should allow people to use it.
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.
Ah i briefly thought about this and then forgot when I did the find and replace.
@smith can you help me with what the regex would be for this?
find // Prefer importing entire lodash library, e.g. import { get } from "lodash"\n// es-lint-disable-next-line no-restricted-imports\nimport(.*)from 'lodash/fp';
replace import$1from 'lodash/fp';
?
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.
@spalger just updated the rule and removed comments on lodash/fp imports!
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!
Pinging @elastic/apm-ui (Team:apm) |
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.
ES UI comments LGTM.
@brittanyjoiner15, @spalger want to confirm: because of #78100 importing |
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.
A lot of the ml files, plus a few others, have had extra blank lines added without comments. Is that a mistake?
x-pack/plugins/ml/server/models/annotation_service/annotation.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/bucket_span_estimator/bucket_span_estimator.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/ml/server/models/results_service/build_anomaly_table_items.js
Outdated
Show resolved
Hide resolved
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 comments looking good to me!
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.
infra
plugin 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.
ML and Transforms plugin 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.
Security changes LGTM! 👍
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
* added comment about importing lodash library * fixed space with prefer * cleaned up extra space and removed comments for lodash/fp * took out the comment in server files * Remove newlines Co-authored-by: Nathan L Smith <[email protected]>
* added comment about importing lodash library * fixed space with prefer * cleaned up extra space and removed comments for lodash/fp * took out the comment in server files * Remove newlines Co-authored-by: Nathan L Smith <[email protected]>
@smith I just did the backport for 7.x |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
1 similar comment
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Was initially working on #74539 to clean up lodash imports and pull the specific module rather than entire lodash library, but @spalger has a better improvement in #78100 that would clean up bundling by importing the entire library.
This PR has found instances across Kibana where people are referencing lodash and not adding the entire library, but should be per Spencer's new update.