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

[embeddable rebuild] useBatchedOptionalPublishingSubjects #180221

Merged
merged 18 commits into from
Apr 10, 2024

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Apr 5, 2024

Fixes #180088

  1. Changes observable pipe from debounceTime(), skip(1) to skip(1), debounceTime(). Updates test to verify this change results in subscription getting fired when observable.next is called before debounceTime fires.
  2. rename useBatchedPublishingSubjects to useBatchedOptionalPublishingSubjects. Remove useMemo since spreading subjects results in new array every time and useMemo does nothing.
  3. Update PresentationPanelInternal to use useBatchedOptionalPublishingSubjects
  4. create new useBatchedPublishingSubjects that types subjects as PublishingSubject[]. New

@nreese
Copy link
Contributor Author

nreese commented Apr 5, 2024

/ci

@nreese
Copy link
Contributor Author

nreese commented Apr 5, 2024

/ci

@nreese
Copy link
Contributor Author

nreese commented Apr 5, 2024

/ci

@nreese
Copy link
Contributor Author

nreese commented Apr 5, 2024

/ci

@nreese nreese marked this pull request as ready for review April 7, 2024 14:34
@nreese nreese requested a review from a team as a code owner April 7, 2024 14:34
@nreese nreese added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas release_note:skip Skip the PR/issue when compiling release notes project:embeddableRebuild v8.14.0 labels Apr 7, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@nreese
Copy link
Contributor Author

nreese commented Apr 8, 2024

@elasticmachine merge upstream

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Great idea to separate out the optional from the required batcher. This way 90% of use cases can use the more efficient and smaller code. Nice jest tests also!

@nreese
Copy link
Contributor Author

nreese commented Apr 9, 2024

@elasticmachine merge upstream

@nreese nreese requested a review from a team as a code owner April 9, 2024 15:13
@nreese nreese requested review from ferullo and paul-tavares April 9, 2024 15:13
@nreese
Copy link
Contributor Author

nreese commented Apr 9, 2024

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Apr 9, 2024

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Apr 9, 2024

@elasticmachine merge upstream

@nreese nreese requested a review from a team as a code owner April 9, 2024 21:25
Copy link
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

Changes made to image embeddable LGTM - makes sense now that useBatchedPublishingSubjects needs all publishing subjects to be defined 👍

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
imageEmbeddable 65.0KB 64.6KB -416.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
presentationPanel 42.1KB 42.0KB -32.0B
Unknown metric groups

API count

id before after diff
@kbn/presentation-publishing 180 182 +2

ESLint disabled line counts

id before after diff
@kbn/presentation-publishing 1 2 +1

Total ESLint disabled count

id before after diff
@kbn/presentation-publishing 1 2 +1

History

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

Copy link
Contributor

@eokoneyo eokoneyo left a comment

Choose a reason for hiding this comment

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

Code changes review only

@nreese nreese merged commit 83cb0e4 into elastic:main Apr 10, 2024
16 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 10, 2024
semd pushed a commit to semd/kibana that referenced this pull request Apr 10, 2024
…0221)

Fixes elastic#180088

1. Changes observable pipe from `debounceTime(), skip(1)` to `skip(1),
debounceTime()`. Updates test to verify this change results in
subscription getting fired when observable.next is called before
debounceTime fires.
2. rename `useBatchedPublishingSubjects` to
`useBatchedOptionalPublishingSubjects`. Remove `useMemo` since spreading
subjects results in new array every time and useMemo does nothing.
3. Update `PresentationPanelInternal` to use
`useBatchedOptionalPublishingSubjects`
4. create new `useBatchedPublishingSubjects` that types subjects as
`PublishingSubject[]`. New

---------

Co-authored-by: Kibana Machine <[email protected]>
semd added a commit to semd/kibana that referenced this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting project:embeddableRebuild release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clean up useBatchedPublishingSubjects
7 participants