From 8a5cd2200a9083573fb50037462266c8c0bf57ea Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Fri, 6 Jul 2018 09:31:46 -0700 Subject: [PATCH] fix(ivy): allow building router with ngtsc (#24862) This commit adds the ivy-local tag to //packages/router. Since the router depends on //packages/upgrade, it makes that package compatible with ngtsc as well. PR Close #24862 --- packages/router/BUILD.bazel | 1 + packages/upgrade/BUILD.bazel | 1 + packages/upgrade/src/dynamic/upgrade_adapter.ts | 2 +- packages/upgrade/src/dynamic/upgrade_ng1_adapter.ts | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/router/BUILD.bazel b/packages/router/BUILD.bazel index 547927f85b..9a73da61c4 100644 --- a/packages/router/BUILD.bazel +++ b/packages/router/BUILD.bazel @@ -30,6 +30,7 @@ ng_package( entry_point = "packages/router/index.js", tags = [ "ivy-jit", + "ivy-local", "release-with-framework", ], deps = [ diff --git a/packages/upgrade/BUILD.bazel b/packages/upgrade/BUILD.bazel index 09bff3383e..92f3ddd17f 100644 --- a/packages/upgrade/BUILD.bazel +++ b/packages/upgrade/BUILD.bazel @@ -27,6 +27,7 @@ ng_package( entry_point = "packages/upgrade/index.js", tags = [ "ivy-jit", + "ivy-local", "release-with-framework", ], deps = [ diff --git a/packages/upgrade/src/dynamic/upgrade_adapter.ts b/packages/upgrade/src/dynamic/upgrade_adapter.ts index 0ce767c1f0..cc16325dc1 100644 --- a/packages/upgrade/src/dynamic/upgrade_adapter.ts +++ b/packages/upgrade/src/dynamic/upgrade_adapter.ts @@ -571,7 +571,7 @@ export class UpgradeAdapter { }; // At this point we have ng1 injector and we have prepared // ng1 components to be upgraded, we now can bootstrap ng2. - @NgModule(ngModule) + @NgModule({jit: true, ...ngModule}) class DynamicNgUpgradeModule { constructor() {} ngDoBootstrap() {} diff --git a/packages/upgrade/src/dynamic/upgrade_ng1_adapter.ts b/packages/upgrade/src/dynamic/upgrade_ng1_adapter.ts index ffee28a0bf..b31657bc7b 100644 --- a/packages/upgrade/src/dynamic/upgrade_ng1_adapter.ts +++ b/packages/upgrade/src/dynamic/upgrade_ng1_adapter.ts @@ -45,7 +45,7 @@ export class UpgradeNg1ComponentAdapterBuilder { // TODO(tbosch): find or file a bug against TypeScript for this. const directive = {selector: selector, inputs: this.inputsRename, outputs: this.outputsRename}; - @Directive(directive) + @Directive({jit: true, ...directive}) class MyClass { // TODO(issue/24571): remove '!'. directive !: angular.IDirective;