From 4a8790ac1b5b53dc9c586c013dc6a40415e169d5 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 24 Oct 2024 17:32:39 +0200 Subject: [PATCH] fix: update to rxjs 7 (#1280) Updates to rxjs 7 to fix the deployment and keep us up to date. --- package.json | 2 +- .../pages/component-viewer/component-viewer.ts | 4 ++-- src/app/shared/stack-blitz/stack-blitz-writer.ts | 7 +++---- yarn.lock | 15 +++------------ 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 16ed8ec5..2c58f03a 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@stackblitz/sdk": "^1.5.2", "moment": "^2.29.1", "path-normalize": "^6.0.7", - "rxjs": "^6.6.7", + "rxjs": "^7.8.1", "tslib": "^2.3.0", "zone.js": "~0.14.10" }, diff --git a/src/app/pages/component-viewer/component-viewer.ts b/src/app/pages/component-viewer/component-viewer.ts index 0b00ceb8..9c3ea879 100644 --- a/src/app/pages/component-viewer/component-viewer.ts +++ b/src/app/pages/component-viewer/component-viewer.ts @@ -49,7 +49,7 @@ import {ExampleViewer} from '../../shared/example-viewer/example-viewer'; export class ComponentViewer implements OnDestroy { componentDocItem = new ReplaySubject(1); sections: Set = new Set(['overview', 'api']); - private _destroyed = new Subject(); + private _destroyed = new Subject(); constructor(_route: ActivatedRoute, private router: Router, public _componentPageTitle: ComponentPageTitle, @@ -98,7 +98,7 @@ export class ComponentBaseView implements OnInit, OnDestroy { readonly viewers = viewChildren(DocViewer); showToc: Observable; - private _destroyed = new Subject(); + private _destroyed = new Subject(); constructor( public componentViewer: ComponentViewer, diff --git a/src/app/shared/stack-blitz/stack-blitz-writer.ts b/src/app/shared/stack-blitz/stack-blitz-writer.ts index 8f0635c8..fa59685e 100644 --- a/src/app/shared/stack-blitz/stack-blitz-writer.ts +++ b/src/app/shared/stack-blitz/stack-blitz-writer.ts @@ -1,8 +1,8 @@ import {HttpClient} from '@angular/common/http'; import {Injectable, NgZone} from '@angular/core'; import {EXAMPLE_COMPONENTS, ExampleData} from '@angular/components-examples'; -import {Observable} from 'rxjs'; -import {shareReplay, take} from 'rxjs/operators'; +import {Observable, firstValueFrom} from 'rxjs'; +import {shareReplay} from 'rxjs/operators'; import stackblitz from '@stackblitz/sdk'; @@ -169,8 +169,7 @@ export class StackBlitzWriter { this._fileCache.set(fileUrl, stream); } - // The `take(1)` is necessary, because the Promise from `toPromise` resolves on complete. - return stream.pipe(take(1)).toPromise(); + return firstValueFrom(stream); } /** diff --git a/yarn.lock b/yarn.lock index ba95ba5d..82f3bcf6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12771,7 +12771,7 @@ __metadata: path-normalize: "npm:^6.0.7" protractor: "npm:^7.0.0" puppeteer: "npm:~21.1.0" - rxjs: "npm:^6.6.7" + rxjs: "npm:^7.8.1" sass: "npm:^1.70.0" shelljs: "npm:^0.8.4" ts-node: "npm:^8.10.2" @@ -15763,7 +15763,7 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:7.8.1, rxjs@npm:^7.5.5": +"rxjs@npm:7.8.1, rxjs@npm:^7.5.5, rxjs@npm:^7.8.1": version: 7.8.1 resolution: "rxjs@npm:7.8.1" dependencies: @@ -15772,15 +15772,6 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:^6.6.7": - version: 6.6.7 - resolution: "rxjs@npm:6.6.7" - dependencies: - tslib: "npm:^1.9.0" - checksum: 10c0/e556a13a9aa89395e5c9d825eabcfa325568d9c9990af720f3f29f04a888a3b854f25845c2b55875d875381abcae2d8100af9cacdc57576e7ed6be030a01d2fe - languageName: node - linkType: hard - "safe-array-concat@npm:^1.1.2": version: 1.1.2 resolution: "safe-array-concat@npm:1.1.2" @@ -17420,7 +17411,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.3": +"tslib@npm:^1.8.1, tslib@npm:^1.9.3": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: 10c0/69ae09c49eea644bc5ebe1bca4fa4cc2c82b7b3e02f43b84bd891504edf66dbc6b2ec0eef31a957042de2269139e4acff911e6d186a258fb14069cd7f6febce2