From 2b2a847ad78f3a497fade51d57af01283500132d Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Mon, 31 Aug 2020 17:21:25 -0400 Subject: [PATCH] refactor(migrations): remove rxjs usage within static queries migration (#38657) rxjs was only used within one location within the static queries migration to workaround a previous limitation that schematics could not directly use a promise. However, promise support has been available since 8.0. This change removes the observable promise wrapping. It also removes an any cast that was previously needed to workaround rxjs version mismatches during compilation. PR Close #38657 --- .../core/schematics/migrations/static-queries/index.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/core/schematics/migrations/static-queries/index.ts b/packages/core/schematics/migrations/static-queries/index.ts index b0c684a78e..06f61ec974 100644 --- a/packages/core/schematics/migrations/static-queries/index.ts +++ b/packages/core/schematics/migrations/static-queries/index.ts @@ -9,7 +9,6 @@ import {logging} from '@angular-devkit/core'; import {Rule, SchematicContext, SchematicsException, Tree} from '@angular-devkit/schematics'; import {relative} from 'path'; -import {from} from 'rxjs'; import * as ts from 'typescript'; import {NgComponentTemplateVisitor} from '../../utils/ng_component_template'; @@ -41,11 +40,7 @@ interface AnalyzedProject { /** Entry point for the V8 static-query migration. */ export default function(): Rule { - return (tree: Tree, context: SchematicContext) => { - // We need to cast the returned "Observable" to "any" as there is a - // RxJS version mismatch that breaks the TS compilation. - return from(runMigration(tree, context).then(() => tree)) as any; - }; + return runMigration; } /** Runs the V8 migration static-query migration for all determined TypeScript projects. */