Skip to content

Conversation

@cjcenizal
Copy link
Contributor

Per #72947 (comment), this change requires consumers of useRequest to depend on the hook's return values instead of the values resolved by the sendRequest function. It also renames this function to resendRequest to disambiguate it with the standalone sendRequest module.

@cjcenizal cjcenizal added chore v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Sep 4, 2020
@cjcenizal cjcenizal requested a review from a team as a code owner September 4, 2020 16:38
@cjcenizal cjcenizal requested a review from a team September 4, 2020 16:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Sep 4, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together @cjcenizal

I would have preferred to simply have a new handler in the lib for that without the need of making any other changes. Would that be possible?

const resendRequest = useCallback(async () => {
  await sendRequest();
}, [sendRequest]);

I like the sendRequest internal naming as it is as it makes things simpler.

EDIT: actually, as you removed the return statement, it could just be

return {
  isInitialRequest,
  isLoading,
  error,
  data,
  resendRequest: sendRequest, // Gives the user the ability to manually request data
};

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

I like the renaming, Ingest Manager changes LGTM

@cjcenizal
Copy link
Contributor Author

cjcenizal commented Sep 8, 2020

@sebelga Can we keep it as-is? I changed the name for a couple reasons which I think are an improvement:

  • To disambiguate it from the sendRequest module. Many apps consume both sendRequest and useRequest and it can become confusing to reason about which one is in use, especially when doing a wide grep. 😄
  • To clarify that it's about optionally sending subsequent requests beyond the initial one, which will always be sent.

@sebelga
Copy link
Contributor

sebelga commented Sep 10, 2020

@elasticmachine merge upstream

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

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

Changes LGTM! Thanks for making these changes 👍

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
indexLifecycleManagement 185.4KB +32.0B 185.3KB
indexManagement 1.5MB +14.0B 1.5MB
ingestManager 1.1MB +38.0B 1.1MB
ingestPipelines 738.5KB +10.0B 738.4KB
snapshotRestore 763.3KB +18.0B 763.3KB
watcher 602.5KB +2.0B 602.5KB
total +114.0B

page load bundle size

id value diff baseline
esUiShared 995.0KB -131.0B 995.2KB

History

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v7.10.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants