-
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
Upgrade RxJS to 7 #129087
Upgrade RxJS to 7 #129087
Conversation
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.
Expressions changes LGTM 👍
While searching the ingestion system for any [upcoming deprecations](#129087), I noticed these scripts are no longer used.
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 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.
LGTM - only 2 files (package.json and yarn.lock) have QA team on them. Since this PR is targeting 8.3.0, we have a good amount of time before FF and GA to ensure there's no negative impacts and it helps to get it merged ASAP.
removing EDIT: adding @mattkime |
@@ -73,7 +74,7 @@ export class ReportingCsvPanelAction implements ActionDefinition<ActionContext> | |||
} | |||
|
|||
public async getSearchSource(savedSearch: SavedSearch, _embeddable: ISearchEmbeddable) { | |||
const [{ uiSettings }, { data }] = await this.startServices$.pipe(first()).toPromise(); | |||
const [{ uiSettings }, { data }] = await firstValueFrom(this.startServices$.pipe(first())); |
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.
nit: maybe first()
is not necessary here:
const [{ uiSettings }, { data }] = await firstValueFrom(this.startServices$.pipe(first())); | |
const [{ uiSettings }, { data }] = await firstValueFrom(this.startServices$); |
const delays$ = firstValueFrom( | ||
delayOnClaimConflicts(of(maxWorkers), of(pollInterval), taskLifecycleEvents$, 80, 2).pipe( | ||
take(2), | ||
bufferCount(2) | ||
) | ||
); |
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.
All of these refactoring introducing firstValueFrom
seem to have dropped the typing.
Could we bring those back?
Other than that it looks good to me but I don't want to lose the type checks.
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.
As agreed on Slack. Even when the types are correctly inferred, we want to be explicit about them. Added them back in the form of firstValueFrom<number[]>(...)
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 once the typing is addressed 👍
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
…disable-server-side * 'main' of github.com:elastic/kibana: (35 commits) [Uptime] remove latency limit warnings when using monitor management (elastic#129597) [Security Solution] [ReponseOps] Executes Cases Cypress test when there is a change on cases plugin (elastic#129992) Paramaterized Discover tests (elastic#129684) [Security Solution][Investigations] - Minor bug fixes (elastic#130054) [DOCS} Adds technical preview to Lens annotations (elastic#130058) [Security solution] [Endpoint] Revisit blocklist wrong labels (elastic#128773) [Security Solutions] Adds API docs for value lists (elastic#129962) [CI] Move jest tests to spot instances, and fix spot retries in PRs (elastic#130045) chore(NA): upgrades rules_node_js to v5.4.0 (elastic#130051) [SecuritySolution] Remove the cell hovers actions for agent status (elastic#130042) Upgrade RxJS to 7 (elastic#129087) [SecuritySolution] Clean up CaseContext (elastic#130036) Revert "chore(NA): upgrades rules_node_js to v5.4.0 (elastic#130021)" Use RuleDataReader to query for threshold signal history (elastic#129763) Remove securityRulesCancelEnabled setting and set shorter default timeouts (elastic#129769) Upgrade EUI to v54.0.0 (elastic#129653) [Security Solution] More Ransomware exceptionable fields (elastic#130039) Add e2e for the apm integration policy form (elastic#129860) chore(NA): upgrades rules_node_js to v5.4.0 (elastic#130021) [ML] Fix Single Metric Viewer chart failing to load if no points during calendar event (elastic#130000) ... # Conflicts: # x-pack/plugins/screenshotting/server/screenshots/index.test.ts
…rint-media-attempt-2 * 'main' of github.com:elastic/kibana: (75 commits) [Lens] Hide disabled toolbar entries (elastic#129994) Fix explore tables don't display data when a global filter is applied (elastic#130024) [Console] Add option to disable keyboard shortcuts (elastic#128887) [Discover] Update refreshOnClick flaky test (elastic#130001) [Uptime] remove latency limit warnings when using monitor management (elastic#129597) [Security Solution] [ReponseOps] Executes Cases Cypress test when there is a change on cases plugin (elastic#129992) Paramaterized Discover tests (elastic#129684) [Security Solution][Investigations] - Minor bug fixes (elastic#130054) [DOCS} Adds technical preview to Lens annotations (elastic#130058) [Security solution] [Endpoint] Revisit blocklist wrong labels (elastic#128773) [Security Solutions] Adds API docs for value lists (elastic#129962) [CI] Move jest tests to spot instances, and fix spot retries in PRs (elastic#130045) chore(NA): upgrades rules_node_js to v5.4.0 (elastic#130051) [SecuritySolution] Remove the cell hovers actions for agent status (elastic#130042) Upgrade RxJS to 7 (elastic#129087) [SecuritySolution] Clean up CaseContext (elastic#130036) Revert "chore(NA): upgrades rules_node_js to v5.4.0 (elastic#130021)" Use RuleDataReader to query for threshold signal history (elastic#129763) Remove securityRulesCancelEnabled setting and set shorter default timeouts (elastic#129769) Upgrade EUI to v54.0.0 (elastic#129653) ... # Conflicts: # x-pack/plugins/screenshotting/server/formats/pdf/index.ts
Summary
I needed an easy and repetitive task to clear my mind, so I thought I'd try what it would take to upgrade RxJS to the latest.
Fun fact: RxJS recently released 7.5.5, and we were sitting on 6.5.5. We're doing a whole major jump 😜
It might close #79751.
Motivation
Recently, we've identified a few performance issues related to RxJS observables:
This PR is to check how hard would it be to upgrade. If green, we can take a look at https://github.com/elastic/kibana-load-testing/ to measure the effect as compared to
main
.Main breaking changes
observable.toPromise()
is deprecated.firstValueFrom
orlastValueFrom
are the way to go now. Refer to https://rxjs.dev/deprecations/to-promise for a deeper explanation.void
Subject
s now need to be explicit in their declarationnew Subject<void>()
or calls to.next()
will fail because they expect one parameter.redux-observer
to 2.0.0 because the previous version did not work with RxJS v7Scheduler
now does not depend on thesetTimeout
, sojest.advanceTimers
do not work any longer. We can eitherdelay
or use thefakeScheduler
helper in our tests.Performance tests results
It appears that the overall response time has been improved, except for the Canvas scenario:
cc @dmlemeshko to make better sense of the data 🙏
APM data
cc @lizozom and @mshustov, would you mind helping out to retrieve the APM stats to find out how would this affect the memory consumption?
Checklist
Delete any items that are not applicable to this PR.
For maintainers