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

[Lens] Clean and inline disabling of react-hooks/exhaustive-deps eslint rule #70010

Merged
merged 8 commits into from
Aug 6, 2020

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Jun 25, 2020

Summary

Fixes #49564

Allows to enable react-hooks/exhaustive-deps eslint rule.

  • 17/26 warnings were removed by refactoring of the code - the easy ones, where I only needed to add missing dependencies and haven't observed any performance problems.

  • 9/26 is more complicated and I'll tackle it in separate PR(s) to not make this PR too bloated. For now, I've inlined turning off the eslint rule for these specific cases. That would stop us from producing more code that breaks the rule.

@mbondyra mbondyra added Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 Feature:Lens v7.9.0 labels Jun 25, 2020
// redirectTo,
// state.persistedDoc,
]);
useEffect(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

indentation change because of added comment

isUnmounted = true;
};
}, [allLoaded]);
useEffect(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

indentation change because of added comment

});
}
}, [props.doc]);
useEffect(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

indentation change because of added comment

state.activeDatasourceId && !state.datasourceStates[state.activeDatasourceId].isLoading
? props.datasourceMap[state.activeDatasourceId]
: undefined;
useEffect(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

indentation change because of added comment

if (!dragDropContext.dragging || !activeDatasourceId) {
return;
}
const suggestionForDraggedField = useMemo(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

indentation change because of added comment

framePublicAPI.query,
framePublicAPI.filters,
]);
const expression = useMemo(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

indentation change because of added comment

nextRequest.current = performLoad;
return;
}
useEffect(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

indentation change because of added comment

@mbondyra mbondyra changed the title [Lens] wip exhaustive deps rule [Lens] Clean and inline disabling of react-hooks/exhaustive-deps eslint rule Jul 30, 2020
@mbondyra mbondyra marked this pull request as ready for review July 30, 2020 06:01
@mbondyra mbondyra requested a review from a team July 30, 2020 06:01
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@mbondyra mbondyra added release_note:skip Skip the PR/issue when compiling release notes v7.10.0 and removed v7.9.0 labels Jul 30, 2020
@mbondyra
Copy link
Contributor Author

@elasticmachine merge upstream

@mbondyra
Copy link
Contributor Author

mbondyra commented Aug 3, 2020

@elasticmachine merge upstream

@mbondyra
Copy link
Contributor Author

mbondyra commented Aug 5, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
lens 25.0KB +35.0B 25.0KB

page load bundle size

id value diff baseline
lens 842.9KB +40.0B 842.9KB

History

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

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

LGTM, I tested and couldn't find any significant regressions

@mbondyra mbondyra merged commit 626fbc2 into elastic:master Aug 6, 2020
@mbondyra mbondyra deleted the eslint-exhaustive-deps branch August 6, 2020 08:10
mbondyra added a commit to mbondyra/kibana that referenced this pull request Aug 6, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Aug 6, 2020
* master: (208 commits)
  Observability Overview fix extra basepath prepend for alerting fetch (elastic#74465)
  [Lens] Clean and inline disabling of react-hooks/exhaustive-deps eslint rule (elastic#70010)
  Skip "space with index pattern management disabled" functional test for cloud env (elastic#74073)
  Filter out non-security jobs when collecting Detections telemetry (elastic#74456)
  [Security Solution][Test] Enzyme test for related events button (elastic#74411)
  [SECURITY_SOLUTION] add z-index to get over nav bar (elastic#74427)
  Rename package configs SO to package policies (elastic#74422)
  [DOCS] Add Kibana alerts to Stack Monitoring (elastic#73762)
  skip flaky suite (elastic#71390)
  [ML] DF Analytics: adds functional tests for edit form (elastic#73885)
  Rename agent configs SO to agent policies (elastic#74397)
  [Jenkins] run CI when plugin readmes change (elastic#74388)
  [Metrics UI] Fix validating Metrics Explorer URL (elastic#74311)
  fixing encoding issue with \ for enroll command (elastic#74379)
  [Ingest Manager] Update package registry for testing to f6b01d (elastic#74341)
  Change experimental message for visualizations (elastic#74354)
  [Alerting] Reload the Alerts List when alerts are deleted (elastic#73715)
  [Enterprise Search] Fix/DRY out plugin i18n strings (elastic#74323)
  update empty prompt in analytics list (elastic#74174)
  [Task Manager] Correctly handle `running` tasks when calling RunNow and reduce flakiness in related tests (elastic#73244)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Check hooks for exhaustive deps, remove linting exception
4 participants