From 53227abe7bcad861e69411184c93b2497261094b Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 20 Mar 2018 18:22:59 +0200 Subject: [PATCH] build(aio): upgrade `rxjs` to `6.0.0-beta.0` (#22872) PR Close #22872 --- aio/package.json | 3 +- aio/scripts/_payload-limits.json | 2 +- aio/src/app/app.component.spec.ts | 3 +- aio/src/app/app.component.ts | 4 +- .../api/api-list.component.spec.ts | 2 +- .../custom-elements/api/api-list.component.ts | 4 +- .../app/custom-elements/api/api.service.ts | 3 +- .../code/code.component.spec.ts | 43 ++++++++++++------- .../custom-elements/code/code.component.ts | 9 +++- .../code/pretty-printer.service.ts | 3 +- .../contributor-list.component.spec.ts | 2 +- .../contributor/contributor.service.ts | 2 +- .../app/custom-elements/elements-loader.ts | 10 ++--- .../resource/resource-list.component.spec.ts | 2 +- .../resource/resource.service.ts | 2 +- .../file-not-found-search.component.spec.ts | 2 +- .../search/file-not-found-search.component.ts | 2 +- .../app/documents/document.service.spec.ts | 2 +- aio/src/app/documents/document.service.ts | 4 +- .../doc-viewer/doc-viewer.component.spec.ts | 9 ++-- .../layout/doc-viewer/doc-viewer.component.ts | 4 +- aio/src/app/layout/toc/toc.component.spec.ts | 3 +- aio/src/app/layout/toc/toc.component.ts | 4 +- .../top-menu/top-menu.component.spec.ts | 2 +- aio/src/app/navigation/navigation.service.ts | 3 +- .../search/search-box/search-box.component.ts | 2 +- aio/src/app/search/search.service.spec.ts | 2 +- aio/src/app/search/search.service.ts | 5 +-- aio/src/app/shared/custom-icon-registry.ts | 2 +- aio/src/app/shared/location.service.spec.ts | 2 +- aio/src/app/shared/location.service.ts | 2 +- aio/src/app/shared/scroll-spy.service.ts | 4 +- aio/src/app/shared/scroll.service.ts | 2 +- aio/src/app/shared/toc.service.spec.ts | 2 +- aio/src/app/shared/toc.service.ts | 2 +- aio/src/app/shared/web-worker.ts | 2 +- .../app/sw-updates/sw-updates.service.spec.ts | 2 +- aio/src/app/sw-updates/sw-updates.service.ts | 3 +- aio/src/testing/doc-viewer-utils.ts | 2 +- aio/src/testing/location.service.ts | 2 +- aio/src/testing/search.service.ts | 2 +- aio/tslint.json | 2 +- aio/yarn.lock | 18 ++++---- 43 files changed, 89 insertions(+), 98 deletions(-) diff --git a/aio/package.json b/aio/package.json index 0233a7e07f..d36a51e416 100644 --- a/aio/package.json +++ b/aio/package.json @@ -89,7 +89,8 @@ "core-js": "^2.4.1", "jasmine": "^2.6.0", "ng-pwa-tools": "^0.0.10", - "rxjs": "^5.5.2", + "rxjs": "^6.0.0-beta.0", + "rxjs-compat": "^6.0.0-beta.0", "tslib": "^1.9.0", "web-animations-js": "^2.2.5", "zone.js": "^0.8.19" diff --git a/aio/scripts/_payload-limits.json b/aio/scripts/_payload-limits.json index c38258c045..d0259bd3f4 100755 --- a/aio/scripts/_payload-limits.json +++ b/aio/scripts/_payload-limits.json @@ -3,7 +3,7 @@ "master": { "uncompressed": { "inline": 1971, - "main": 774095, + "main": 743696, "polyfills": 40272, "prettify": 14888 } diff --git a/aio/src/app/app.component.spec.ts b/aio/src/app/app.component.spec.ts index 7b7e32aca5..ffc043d55b 100644 --- a/aio/src/app/app.component.spec.ts +++ b/aio/src/app/app.component.spec.ts @@ -6,8 +6,7 @@ import { HttpClient } from '@angular/common/http'; import { MatProgressBar, MatSidenav } from '@angular/material'; import { By } from '@angular/platform-browser'; -import { Observable } from 'rxjs/Observable'; -import { timer } from 'rxjs/observable/timer'; +import { Observable, timer } from 'rxjs'; import 'rxjs/add/operator/mapTo'; import { AppComponent } from './app.component'; diff --git a/aio/src/app/app.component.ts b/aio/src/app/app.component.ts index 094688dccd..ae0b30e72a 100644 --- a/aio/src/app/app.component.ts +++ b/aio/src/app/app.component.ts @@ -13,9 +13,7 @@ import { SearchResults } from 'app/search/interfaces'; import { SearchService } from 'app/search/search.service'; import { TocService } from 'app/shared/toc.service'; -import { Observable } from 'rxjs/Observable'; -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; -import { combineLatest } from 'rxjs/observable/combineLatest'; +import { BehaviorSubject, combineLatest, Observable } from 'rxjs'; import 'rxjs/add/operator/first'; const sideNavView = 'SideNav'; diff --git a/aio/src/app/custom-elements/api/api-list.component.spec.ts b/aio/src/app/custom-elements/api/api-list.component.spec.ts index 68bc6bee74..3c3864dca4 100644 --- a/aio/src/app/custom-elements/api/api-list.component.spec.ts +++ b/aio/src/app/custom-elements/api/api-list.component.spec.ts @@ -1,5 +1,5 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; +import { BehaviorSubject } from 'rxjs'; import { ApiListComponent } from './api-list.component'; import { ApiItem, ApiSection, ApiService } from './api.service'; diff --git a/aio/src/app/custom-elements/api/api-list.component.ts b/aio/src/app/custom-elements/api/api-list.component.ts index cf39591260..10d98ccd4c 100644 --- a/aio/src/app/custom-elements/api/api-list.component.ts +++ b/aio/src/app/custom-elements/api/api-list.component.ts @@ -8,9 +8,7 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; -import { ReplaySubject } from 'rxjs/ReplaySubject'; -import { combineLatest } from 'rxjs/observable/combineLatest'; +import { combineLatest, Observable, ReplaySubject } from 'rxjs'; import { LocationService } from 'app/shared/location.service'; import { ApiSection, ApiService } from './api.service'; diff --git a/aio/src/app/custom-elements/api/api.service.ts b/aio/src/app/custom-elements/api/api.service.ts index 32ee99baba..b982ca53bc 100644 --- a/aio/src/app/custom-elements/api/api.service.ts +++ b/aio/src/app/custom-elements/api/api.service.ts @@ -1,8 +1,7 @@ import { Injectable, OnDestroy } from '@angular/core'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; -import { ReplaySubject } from 'rxjs/ReplaySubject'; -import { Subject } from 'rxjs/Subject'; +import { ReplaySubject, Subject } from 'rxjs'; import 'rxjs/add/operator/do'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/takeUntil'; diff --git a/aio/src/app/custom-elements/code/code.component.spec.ts b/aio/src/app/custom-elements/code/code.component.spec.ts index 26b409c145..423ccd2593 100644 --- a/aio/src/app/custom-elements/code/code.component.spec.ts +++ b/aio/src/app/custom-elements/code/code.component.spec.ts @@ -3,6 +3,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { MatSnackBar } from '@angular/material'; import { By } from '@angular/platform-browser'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; +import 'rxjs/add/operator/first'; +import 'rxjs/add/operator/toPromise'; import { CodeComponent } from './code.component'; import { CodeModule } from './code.module'; @@ -61,44 +63,53 @@ describe('CodeComponent', () => { })); describe('pretty printing', () => { - it('should format a one-line code sample', () => { + const untilCodeFormatted = () => { + const emitter = hostComponent.codeComponent.codeFormatted; + return emitter.first().toPromise(); + }; + const hasLineNumbers = async () => { + // presence of `
  • `s are a tell-tale for line numbers + await untilCodeFormatted(); + return 0 < fixture.nativeElement.querySelectorAll('li').length; + }; + + it('should format a one-line code sample', async () => { + hostComponent.setCode(oneLineCode); + await untilCodeFormatted(); + // 'pln' spans are a tell-tale for syntax highlighing const spans = fixture.nativeElement.querySelectorAll('span.pln'); expect(spans.length).toBeGreaterThan(0, 'formatted spans'); }); - function hasLineNumbers() { - // presence of `
  • `s are a tell-tale for line numbers - return 0 < fixture.nativeElement.querySelectorAll('li').length; - } - - it('should format a one-line code sample without linenums by default', () => { - expect(hasLineNumbers()).toBe(false); + it('should format a one-line code sample without linenums by default', async () => { + hostComponent.setCode(oneLineCode); + expect(await hasLineNumbers()).toBe(false); }); - it('should add line numbers to one-line code sample when linenums set true', () => { + it('should add line numbers to one-line code sample when linenums set true', async () => { hostComponent.linenums = 'true'; fixture.detectChanges(); - expect(hasLineNumbers()).toBe(true); + expect(await hasLineNumbers()).toBe(true); }); - it('should format a small multi-line code without linenums by default', () => { + it('should format a small multi-line code without linenums by default', async () => { hostComponent.setCode(smallMultiLineCode); - expect(hasLineNumbers()).toBe(false); + expect(await hasLineNumbers()).toBe(false); }); - it('should add line numbers to a big multi-line code by default', () => { + it('should add line numbers to a big multi-line code by default', async () => { hostComponent.setCode(bigMultiLineCode); - expect(hasLineNumbers()).toBe(true); + expect(await hasLineNumbers()).toBe(true); }); - it('should format big multi-line code without linenums when linenums set false', () => { + it('should format big multi-line code without linenums when linenums set false', async () => { hostComponent.linenums = false; fixture.detectChanges(); hostComponent.setCode(bigMultiLineCode); - expect(hasLineNumbers()).toBe(false); + expect(await hasLineNumbers()).toBe(false); }); }); diff --git a/aio/src/app/custom-elements/code/code.component.ts b/aio/src/app/custom-elements/code/code.component.ts index a1b4a21df8..5324fd37aa 100644 --- a/aio/src/app/custom-elements/code/code.component.ts +++ b/aio/src/app/custom-elements/code/code.component.ts @@ -1,8 +1,9 @@ -import { Component, ElementRef, ViewChild, Input, OnChanges } from '@angular/core'; +import { Component, ElementRef, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'; import { Logger } from 'app/shared/logger.service'; import { PrettyPrinter } from './pretty-printer.service'; import { CopierService } from 'app/shared/copier.service'; import { MatSnackBar } from '@angular/material/snack-bar'; +import 'rxjs/add/operator/do'; /** * If linenums is not set, this is the default maximum number of lines that @@ -93,6 +94,8 @@ export class CodeComponent implements OnChanges { get title(): string { return this._title; } private _title: string; + @Output() codeFormatted = new EventEmitter(); + /** The element in the template that will display the formatted code. */ @ViewChild('codeContainer') codeContainer: ElementRef; @@ -115,7 +118,9 @@ export class CodeComponent implements OnChanges { this.setCodeHtml(leftAlignedCode); // start with unformatted code this.codeText = this.getCodeText(); // store the unformatted code as text (for copying) - this.pretty.formatCode(leftAlignedCode, this.language, this.getLinenums(leftAlignedCode)) + this.pretty + .formatCode(leftAlignedCode, this.language, this.getLinenums(leftAlignedCode)) + .do(() => this.codeFormatted.emit()) .subscribe(c => this.setCodeHtml(c), err => { /* ignore failure to format */ } ); } diff --git a/aio/src/app/custom-elements/code/pretty-printer.service.ts b/aio/src/app/custom-elements/code/pretty-printer.service.ts index cdfed57360..0f1f60f370 100644 --- a/aio/src/app/custom-elements/code/pretty-printer.service.ts +++ b/aio/src/app/custom-elements/code/pretty-printer.service.ts @@ -1,7 +1,6 @@ import { Injectable } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; -import { fromPromise } from 'rxjs/observable/fromPromise'; +import { from as fromPromise, Observable } from 'rxjs'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/first'; diff --git a/aio/src/app/custom-elements/contributor/contributor-list.component.spec.ts b/aio/src/app/custom-elements/contributor/contributor-list.component.spec.ts index 6d20348747..4ecb04612c 100644 --- a/aio/src/app/custom-elements/contributor/contributor-list.component.spec.ts +++ b/aio/src/app/custom-elements/contributor/contributor-list.component.spec.ts @@ -1,6 +1,6 @@ import { ReflectiveInjector } from '@angular/core'; -import { of } from 'rxjs/observable/of'; +import { of } from 'rxjs'; import { ContributorGroup } from './contributors.model'; import { ContributorListComponent } from './contributor-list.component'; diff --git a/aio/src/app/custom-elements/contributor/contributor.service.ts b/aio/src/app/custom-elements/contributor/contributor.service.ts index bbfa4599ef..c84067450d 100644 --- a/aio/src/app/custom-elements/contributor/contributor.service.ts +++ b/aio/src/app/custom-elements/contributor/contributor.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs/Observable'; +import { Observable } from 'rxjs'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/publishLast'; diff --git a/aio/src/app/custom-elements/elements-loader.ts b/aio/src/app/custom-elements/elements-loader.ts index da32cf0137..1316608e50 100644 --- a/aio/src/app/custom-elements/elements-loader.ts +++ b/aio/src/app/custom-elements/elements-loader.ts @@ -5,9 +5,7 @@ import { NgModuleRef, } from '@angular/core'; import { ELEMENT_MODULE_PATHS_TOKEN } from './element-registry'; -import { of } from 'rxjs/observable/of'; -import { Observable } from 'rxjs/Observable'; -import { fromPromise } from 'rxjs/observable/fromPromise'; +import { from as fromPromise, Observable, of } from 'rxjs'; import { createCustomElement } from '@angular/elements'; @Injectable() @@ -26,14 +24,14 @@ export class ElementsLoader { * the browser. Custom elements that are registered will be removed from the list of unregistered * elements so that they will not be queried in subsequent calls. */ - loadContainingCustomElements(element: HTMLElement): Observable { + loadContainingCustomElements(element: HTMLElement): Observable { const selectors: any[] = Array.from(this.elementsToLoad.keys()) .filter(s => element.querySelector(s)); - if (!selectors.length) { return of(null); } + if (!selectors.length) { return of(undefined); } // Returns observable that completes when all discovered elements have been registered. - return fromPromise(Promise.all(selectors.map(s => this.register(s))).then(result => null)); + return fromPromise(Promise.all(selectors.map(s => this.register(s))).then(result => undefined)); } /** Registers the custom element defined on the WithCustomElement module factory. */ diff --git a/aio/src/app/custom-elements/resource/resource-list.component.spec.ts b/aio/src/app/custom-elements/resource/resource-list.component.spec.ts index ecbee8f02c..c42ae7d01a 100644 --- a/aio/src/app/custom-elements/resource/resource-list.component.spec.ts +++ b/aio/src/app/custom-elements/resource/resource-list.component.spec.ts @@ -1,7 +1,7 @@ import { ReflectiveInjector } from '@angular/core'; import { PlatformLocation } from '@angular/common'; -import { of } from 'rxjs/observable/of'; +import { of } from 'rxjs'; import { ResourceListComponent } from './resource-list.component'; import { ResourceService } from './resource.service'; diff --git a/aio/src/app/custom-elements/resource/resource.service.ts b/aio/src/app/custom-elements/resource/resource.service.ts index ff64c51e6f..d372cf4a8c 100644 --- a/aio/src/app/custom-elements/resource/resource.service.ts +++ b/aio/src/app/custom-elements/resource/resource.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs/Observable'; +import { Observable } from 'rxjs'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/publishLast'; diff --git a/aio/src/app/custom-elements/search/file-not-found-search.component.spec.ts b/aio/src/app/custom-elements/search/file-not-found-search.component.spec.ts index f1a903b811..3cf746e7a9 100644 --- a/aio/src/app/custom-elements/search/file-not-found-search.component.spec.ts +++ b/aio/src/app/custom-elements/search/file-not-found-search.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { Subject } from 'rxjs/Subject'; +import { Subject } from 'rxjs'; import { LocationService } from 'app/shared/location.service'; import { MockLocationService } from 'testing/location.service'; import { SearchResults } from 'app/search/interfaces'; diff --git a/aio/src/app/custom-elements/search/file-not-found-search.component.ts b/aio/src/app/custom-elements/search/file-not-found-search.component.ts index 119b118739..b4b62ccdff 100644 --- a/aio/src/app/custom-elements/search/file-not-found-search.component.ts +++ b/aio/src/app/custom-elements/search/file-not-found-search.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; +import { Observable } from 'rxjs'; import { LocationService } from 'app/shared/location.service'; import { SearchResults } from 'app/search/interfaces'; import { SearchService } from 'app/search/search.service'; diff --git a/aio/src/app/documents/document.service.spec.ts b/aio/src/app/documents/document.service.spec.ts index 3fb484cfc8..ab2f56d28c 100644 --- a/aio/src/app/documents/document.service.spec.ts +++ b/aio/src/app/documents/document.service.spec.ts @@ -1,7 +1,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { Subscription } from 'rxjs/Subscription'; +import { Subscription } from 'rxjs'; import { LocationService } from 'app/shared/location.service'; import { MockLocationService } from 'testing/location.service'; diff --git a/aio/src/app/documents/document.service.ts b/aio/src/app/documents/document.service.ts index 70169fc5d0..23536502d1 100644 --- a/aio/src/app/documents/document.service.ts +++ b/aio/src/app/documents/document.service.ts @@ -1,9 +1,7 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpErrorResponse } from '@angular/common/http'; -import { Observable } from 'rxjs/Observable'; -import { AsyncSubject } from 'rxjs/AsyncSubject'; -import { of } from 'rxjs/observable/of'; +import { AsyncSubject, Observable, of } from 'rxjs'; import 'rxjs/add/operator/catch'; import 'rxjs/add/operator/switchMap'; diff --git a/aio/src/app/layout/doc-viewer/doc-viewer.component.spec.ts b/aio/src/app/layout/doc-viewer/doc-viewer.component.spec.ts index 8e4f9839c5..302a025a44 100644 --- a/aio/src/app/layout/doc-viewer/doc-viewer.component.spec.ts +++ b/aio/src/app/layout/doc-viewer/doc-viewer.component.spec.ts @@ -1,8 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { Title, Meta } from '@angular/platform-browser'; -import { Observable } from 'rxjs/Observable'; -import { of } from 'rxjs/observable/of'; +import { Observable, of } from 'rxjs'; import { FILE_NOT_FOUND_ID, FETCHING_ERROR_ID } from 'app/documents/document.service'; import { Logger } from 'app/shared/logger.service'; @@ -297,13 +296,11 @@ describe('DocViewerComponent', () => { let loadElementsSpy: jasmine.Spy; const doRender = (contents: string | null, id = 'foo') => - new Promise((resolve, reject) => - docViewer.render({contents, id}).subscribe(resolve, reject)); + docViewer.render({contents, id}).toPromise(); beforeEach(() => { const elementsLoader = TestBed.get(ElementsLoader) as MockElementsLoader; - loadElementsSpy = - elementsLoader.loadContainingCustomElements.and.returnValue(of([])); + loadElementsSpy = elementsLoader.loadContainingCustomElements.and.returnValue(of(undefined)); prepareTitleAndTocSpy = spyOn(docViewer, 'prepareTitleAndToc'); swapViewsSpy = spyOn(docViewer, 'swapViews').and.returnValue(of(undefined)); }); diff --git a/aio/src/app/layout/doc-viewer/doc-viewer.component.ts b/aio/src/app/layout/doc-viewer/doc-viewer.component.ts index 8ab529b96e..855fdc7dae 100644 --- a/aio/src/app/layout/doc-viewer/doc-viewer.component.ts +++ b/aio/src/app/layout/doc-viewer/doc-viewer.component.ts @@ -1,9 +1,7 @@ import { Component, ElementRef, EventEmitter, Input, OnDestroy, Output } from '@angular/core'; import { Title, Meta } from '@angular/platform-browser'; -import { Observable } from 'rxjs/Observable'; -import { of } from 'rxjs/observable/of'; -import { timer } from 'rxjs/observable/timer'; +import { Observable, of, timer } from 'rxjs'; import 'rxjs/add/operator/catch'; import 'rxjs/add/operator/do'; import 'rxjs/add/operator/switchMap'; diff --git a/aio/src/app/layout/toc/toc.component.spec.ts b/aio/src/app/layout/toc/toc.component.spec.ts index c736177729..9b2341cc7d 100644 --- a/aio/src/app/layout/toc/toc.component.spec.ts +++ b/aio/src/app/layout/toc/toc.component.spec.ts @@ -1,8 +1,7 @@ import { Component, CUSTOM_ELEMENTS_SCHEMA, DebugElement } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; -import { asap } from 'rxjs/scheduler/asap'; +import { asapScheduler as asap, BehaviorSubject } from 'rxjs'; import { ScrollService } from 'app/shared/scroll.service'; import { TocComponent } from './toc.component'; diff --git a/aio/src/app/layout/toc/toc.component.ts b/aio/src/app/layout/toc/toc.component.ts index 4194976f84..9e05d8c76c 100644 --- a/aio/src/app/layout/toc/toc.component.ts +++ b/aio/src/app/layout/toc/toc.component.ts @@ -1,7 +1,5 @@ import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; -import { Subject } from 'rxjs/Subject'; -import { asap } from 'rxjs/scheduler/asap'; +import { asapScheduler as asap, Observable, Subject } from 'rxjs'; import 'rxjs/add/observable/combineLatest'; import 'rxjs/add/operator/subscribeOn'; import 'rxjs/add/operator/takeUntil'; diff --git a/aio/src/app/layout/top-menu/top-menu.component.spec.ts b/aio/src/app/layout/top-menu/top-menu.component.spec.ts index a892003fc7..fbc6efde79 100644 --- a/aio/src/app/layout/top-menu/top-menu.component.spec.ts +++ b/aio/src/app/layout/top-menu/top-menu.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; +import { BehaviorSubject } from 'rxjs'; import { TopMenuComponent } from './top-menu.component'; import { NavigationService, NavigationViews } from 'app/navigation/navigation.service'; diff --git a/aio/src/app/navigation/navigation.service.ts b/aio/src/app/navigation/navigation.service.ts index a15e6c387d..c2e9fe62ce 100644 --- a/aio/src/app/navigation/navigation.service.ts +++ b/aio/src/app/navigation/navigation.service.ts @@ -1,8 +1,7 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs/Observable'; -import { combineLatest } from 'rxjs/observable/combineLatest'; +import { combineLatest, Observable } from 'rxjs'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/publishLast'; import 'rxjs/add/operator/publishReplay'; diff --git a/aio/src/app/search/search-box/search-box.component.ts b/aio/src/app/search/search-box/search-box.component.ts index 7ef3149636..27f6f385d5 100644 --- a/aio/src/app/search/search-box/search-box.component.ts +++ b/aio/src/app/search/search-box/search-box.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit, ViewChild, ElementRef, EventEmitter, Output } from '@angular/core'; import { LocationService } from 'app/shared/location.service'; -import { Subject } from 'rxjs/Subject'; +import { Subject } from 'rxjs'; import 'rxjs/add/operator/distinctUntilChanged'; /** diff --git a/aio/src/app/search/search.service.spec.ts b/aio/src/app/search/search.service.spec.ts index edab5ad19a..507b010564 100644 --- a/aio/src/app/search/search.service.spec.ts +++ b/aio/src/app/search/search.service.spec.ts @@ -1,6 +1,6 @@ import { ReflectiveInjector, NgZone } from '@angular/core'; import { fakeAsync, tick } from '@angular/core/testing'; -import { Observable } from 'rxjs/Observable'; +import { Observable } from 'rxjs'; import 'rxjs/add/observable/of'; import { SearchService } from './search.service'; import { WebWorkerClient } from 'app/shared/web-worker'; diff --git a/aio/src/app/search/search.service.ts b/aio/src/app/search/search.service.ts index 51c349c787..b3dbef0123 100644 --- a/aio/src/app/search/search.service.ts +++ b/aio/src/app/search/search.service.ts @@ -5,10 +5,7 @@ can be found in the LICENSE file at http://angular.io/license */ import { NgZone, Injectable } from '@angular/core'; -import { Observable } from 'rxjs/Observable'; -import { ReplaySubject } from 'rxjs/ReplaySubject'; -import { race } from 'rxjs/observable/race'; -import { timer } from 'rxjs/observable/timer'; +import { Observable, race, ReplaySubject, timer } from 'rxjs'; import 'rxjs/add/operator/concatMap'; import 'rxjs/add/operator/first'; import 'rxjs/add/operator/publishReplay'; diff --git a/aio/src/app/shared/custom-icon-registry.ts b/aio/src/app/shared/custom-icon-registry.ts index 8ac0dbed9e..3448aa7639 100644 --- a/aio/src/app/shared/custom-icon-registry.ts +++ b/aio/src/app/shared/custom-icon-registry.ts @@ -1,5 +1,5 @@ import { InjectionToken, Inject, Injectable } from '@angular/core'; -import { of } from 'rxjs/observable/of'; +import { of } from 'rxjs'; import { MatIconRegistry } from '@angular/material/icon'; import { HttpClient } from '@angular/common/http'; import { DomSanitizer } from '@angular/platform-browser'; diff --git a/aio/src/app/shared/location.service.spec.ts b/aio/src/app/shared/location.service.spec.ts index 0f1f09f875..cabdb466bc 100644 --- a/aio/src/app/shared/location.service.spec.ts +++ b/aio/src/app/shared/location.service.spec.ts @@ -1,7 +1,7 @@ import { ReflectiveInjector } from '@angular/core'; import { Location, LocationStrategy, PlatformLocation } from '@angular/common'; import { MockLocationStrategy } from '@angular/common/testing'; -import { Subject } from 'rxjs/Subject'; +import { Subject } from 'rxjs'; import { GaService } from 'app/shared/ga.service'; import { SwUpdatesService } from 'app/sw-updates/sw-updates.service'; diff --git a/aio/src/app/shared/location.service.ts b/aio/src/app/shared/location.service.ts index 762a96838c..285b761989 100644 --- a/aio/src/app/shared/location.service.ts +++ b/aio/src/app/shared/location.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { Location, PlatformLocation } from '@angular/common'; -import { ReplaySubject } from 'rxjs/ReplaySubject'; +import { ReplaySubject } from 'rxjs'; import 'rxjs/add/operator/do'; import { GaService } from 'app/shared/ga.service'; diff --git a/aio/src/app/shared/scroll-spy.service.ts b/aio/src/app/shared/scroll-spy.service.ts index 9983fda5e6..df46488afd 100644 --- a/aio/src/app/shared/scroll-spy.service.ts +++ b/aio/src/app/shared/scroll-spy.service.ts @@ -1,8 +1,6 @@ import { Inject, Injectable } from '@angular/core'; import { DOCUMENT } from '@angular/platform-browser'; -import { Observable } from 'rxjs/Observable'; -import { ReplaySubject } from 'rxjs/ReplaySubject'; -import { Subject } from 'rxjs/Subject'; +import { Observable, ReplaySubject, Subject } from 'rxjs'; import 'rxjs/add/observable/fromEvent'; import 'rxjs/add/operator/auditTime'; import 'rxjs/add/operator/distinctUntilChanged'; diff --git a/aio/src/app/shared/scroll.service.ts b/aio/src/app/shared/scroll.service.ts index f7002a27d2..764433b747 100644 --- a/aio/src/app/shared/scroll.service.ts +++ b/aio/src/app/shared/scroll.service.ts @@ -1,7 +1,7 @@ import { Injectable, Inject } from '@angular/core'; import { PlatformLocation } from '@angular/common'; import { DOCUMENT } from '@angular/platform-browser'; -import {fromEvent} from 'rxjs/observable/fromEvent'; +import { fromEvent } from 'rxjs'; export const topMargin = 16; /** diff --git a/aio/src/app/shared/toc.service.spec.ts b/aio/src/app/shared/toc.service.spec.ts index f3af3d071c..8839f7e23a 100644 --- a/aio/src/app/shared/toc.service.spec.ts +++ b/aio/src/app/shared/toc.service.spec.ts @@ -1,6 +1,6 @@ import { ReflectiveInjector } from '@angular/core'; import { DOCUMENT, DomSanitizer, SafeHtml } from '@angular/platform-browser'; -import { Subject } from 'rxjs/Subject'; +import { Subject } from 'rxjs'; import { ScrollItem, ScrollSpyInfo, ScrollSpyService } from 'app/shared/scroll-spy.service'; import { TocItem, TocService } from './toc.service'; diff --git a/aio/src/app/shared/toc.service.ts b/aio/src/app/shared/toc.service.ts index df5f50b94f..a0d2206ea6 100644 --- a/aio/src/app/shared/toc.service.ts +++ b/aio/src/app/shared/toc.service.ts @@ -1,6 +1,6 @@ import { Inject, Injectable } from '@angular/core'; import { DOCUMENT, DomSanitizer, SafeHtml } from '@angular/platform-browser'; -import { ReplaySubject } from 'rxjs/ReplaySubject'; +import { ReplaySubject } from 'rxjs'; import { ScrollSpyInfo, ScrollSpyService } from 'app/shared/scroll-spy.service'; diff --git a/aio/src/app/shared/web-worker.ts b/aio/src/app/shared/web-worker.ts index b2e23b854d..464e32fe07 100644 --- a/aio/src/app/shared/web-worker.ts +++ b/aio/src/app/shared/web-worker.ts @@ -5,7 +5,7 @@ can be found in the LICENSE file at http://angular.io/license */ import {NgZone} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; +import {Observable} from 'rxjs'; export interface WebWorkerMessage { type: string; diff --git a/aio/src/app/sw-updates/sw-updates.service.spec.ts b/aio/src/app/sw-updates/sw-updates.service.spec.ts index ff4bb5b714..b9bf55b533 100644 --- a/aio/src/app/sw-updates/sw-updates.service.spec.ts +++ b/aio/src/app/sw-updates/sw-updates.service.spec.ts @@ -1,7 +1,7 @@ import { ReflectiveInjector } from '@angular/core'; import { fakeAsync, tick } from '@angular/core/testing'; import { NgServiceWorker } from '@angular/service-worker'; -import { Subject } from 'rxjs/Subject'; +import { Subject } from 'rxjs'; import 'rxjs/add/operator/take'; import { Logger } from 'app/shared/logger.service'; diff --git a/aio/src/app/sw-updates/sw-updates.service.ts b/aio/src/app/sw-updates/sw-updates.service.ts index 8cc3bdf4d6..9dfae1c924 100644 --- a/aio/src/app/sw-updates/sw-updates.service.ts +++ b/aio/src/app/sw-updates/sw-updates.service.ts @@ -1,7 +1,6 @@ import { Injectable, OnDestroy } from '@angular/core'; import { NgServiceWorker } from '@angular/service-worker'; -import { Observable } from 'rxjs/Observable'; -import { Subject } from 'rxjs/Subject'; +import { Observable, Subject } from 'rxjs'; import 'rxjs/add/observable/of'; import 'rxjs/add/operator/concat'; import 'rxjs/add/operator/debounceTime'; diff --git a/aio/src/testing/doc-viewer-utils.ts b/aio/src/testing/doc-viewer-utils.ts index ed2e3ed858..cc7a207805 100644 --- a/aio/src/testing/doc-viewer-utils.ts +++ b/aio/src/testing/doc-viewer-utils.ts @@ -1,7 +1,7 @@ import { Component, NgModule, ViewChild } from '@angular/core'; import { Title, Meta } from '@angular/platform-browser'; -import { Observable } from 'rxjs/Observable'; +import { Observable } from 'rxjs'; import { DocumentContents } from 'app/documents/document.service'; import { DocViewerComponent } from 'app/layout/doc-viewer/doc-viewer.component'; diff --git a/aio/src/testing/location.service.ts b/aio/src/testing/location.service.ts index 78fabd3ae0..a729b6a2f7 100644 --- a/aio/src/testing/location.service.ts +++ b/aio/src/testing/location.service.ts @@ -1,4 +1,4 @@ -import { BehaviorSubject } from 'rxjs/BehaviorSubject'; +import { BehaviorSubject } from 'rxjs'; export class MockLocationService { urlSubject = new BehaviorSubject(this.initialUrl); diff --git a/aio/src/testing/search.service.ts b/aio/src/testing/search.service.ts index 4d06f47e86..cdc10b9c50 100644 --- a/aio/src/testing/search.service.ts +++ b/aio/src/testing/search.service.ts @@ -1,4 +1,4 @@ -import { Subject } from 'rxjs/Subject'; +import { Subject } from 'rxjs'; import { SearchResults } from 'app/search/interfaces'; export class MockSearchService { diff --git a/aio/tslint.json b/aio/tslint.json index 6cd9172348..33e18ee266 100644 --- a/aio/tslint.json +++ b/aio/tslint.json @@ -13,7 +13,7 @@ "curly": true, "eofline": true, "forin": true, - "import-blacklist": [true, "rxjs"], + "import-blacklist": true, "import-spacing": true, "indent": [ true, diff --git a/aio/yarn.lock b/aio/yarn.lock index 0d848d0b07..c6313e2b65 100644 --- a/aio/yarn.lock +++ b/aio/yarn.lock @@ -7528,11 +7528,9 @@ rx@2.3.24: version "2.3.24" resolved "https://registry.yarnpkg.com/rx/-/rx-2.3.24.tgz#14f950a4217d7e35daa71bbcbe58eff68ea4b2b7" -rxjs@^5.5.2: - version "5.5.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.2.tgz#28d403f0071121967f18ad665563255d54236ac3" - dependencies: - symbol-observable "^1.0.1" +rxjs-compat@^6.0.0-beta.0: + version "6.0.0-beta.0" + resolved "https://registry.yarnpkg.com/rxjs-compat/-/rxjs-compat-6.0.0-beta.0.tgz#386007624f6d771ce89ec48e31460f9177d19ac4" rxjs@^5.5.6: version "5.5.7" @@ -7540,6 +7538,12 @@ rxjs@^5.5.6: dependencies: symbol-observable "1.0.1" +rxjs@^6.0.0-beta.0: + version "6.0.0-beta.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.0.0-beta.0.tgz#cf241936be39d8279ed0b2be4bf417777301f65a" + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -8417,10 +8421,6 @@ symbol-observable@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" -symbol-observable@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" - symbol-tree@^3.2.1: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6"