Skip to content
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

Merged
merged 7 commits into from
Sep 24, 2020

Conversation

brittanyjoiner15
Copy link
Contributor

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.

@@ -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';
Copy link
Contributor

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.

Copy link
Contributor Author

@brittanyjoiner15 brittanyjoiner15 Sep 22, 2020

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';

?

Copy link
Contributor Author

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!

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@brittanyjoiner15 brittanyjoiner15 marked this pull request as ready for review September 22, 2020 20:17
@brittanyjoiner15 brittanyjoiner15 requested review from a team as code owners September 22, 2020 20:17
@brittanyjoiner15 brittanyjoiner15 requested a review from a team September 22, 2020 20:17
@brittanyjoiner15 brittanyjoiner15 requested review from a team as code owners September 22, 2020 20:17
@brittanyjoiner15 brittanyjoiner15 requested a review from a team September 22, 2020 20:17
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Sep 22, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

Copy link
Contributor

@cjcenizal cjcenizal left a 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.

@smith smith added v7.10.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes labels Sep 22, 2020
@Dosant
Copy link
Contributor

Dosant commented Sep 23, 2020

@brittanyjoiner15, @spalger want to confirm: because of #78100 importing lodash/* instead of lodash would bundle redundant code, correct?

Copy link
Contributor

@peteharverson peteharverson left a 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?

Copy link
Contributor

@ogupte ogupte left a 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!

Copy link
Member

@weltenwort weltenwort left a 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

Copy link
Contributor

@peteharverson peteharverson left a 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

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security changes LGTM! 👍

@smith smith removed their request for review September 24, 2020 14:28
@smith smith mentioned this pull request Sep 24, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@brittanyjoiner15 brittanyjoiner15 merged commit 63ce752 into elastic:master Sep 24, 2020
@mshustov mshustov mentioned this pull request Sep 24, 2020
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 28, 2020
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 78156 or prevent reminders by adding the backport:skip label.

smith added a commit to smith/kibana that referenced this pull request Sep 28, 2020
* 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]>
brittanyjoiner15 added a commit to brittanyjoiner15/kibana that referenced this pull request Sep 28, 2020
* 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]>
@brittanyjoiner15
Copy link
Contributor Author

brittanyjoiner15 commented Sep 28, 2020

@smith I just did the backport for 7.x

@kibanamachine
Copy link
Contributor

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.

@Dosant Dosant mentioned this pull request Sep 30, 2020
@kibanamachine
Copy link
Contributor

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
@kibanamachine
Copy link
Contributor

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.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 1, 2020
smith pushed a commit that referenced this pull request Oct 1, 2020
* Adding comment about importing lodash library (#78156)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.