From 43bb31c6c6acf3d6dc1f499d7e85da325934b5d7 Mon Sep 17 00:00:00 2001 From: Tim Blasi Date: Mon, 7 Mar 2016 10:38:42 -0800 Subject: [PATCH] refactor(dart/transform): Use targeted transformers TL;DR: Modify pubspec.yaml files to use the recommended "targeted" transformers. The unified "simple" angular2 transformer still works as always, but we want to encourage use of the targeted transformers whereever possible. See [the wiki](https://github.com/angular/angular/wiki/Advanced-Transformer-Configuration) for details about targeted transformers. See #1872 --- modules/angular2_material/pubspec.yaml | 2 +- modules/benchmarks/pubspec.yaml | 5 +++-- modules/playground/pubspec.yaml | 9 +++++++-- modules_dart/payload/hello_world/pubspec.yaml | 7 +++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/angular2_material/pubspec.yaml b/modules/angular2_material/pubspec.yaml index e7c96cbb59..68df1ad244 100644 --- a/modules/angular2_material/pubspec.yaml +++ b/modules/angular2_material/pubspec.yaml @@ -17,4 +17,4 @@ dependency_overrides: dev_dependencies: guinness2: '0.0.4' transformers: -- angular2 +- angular2/transform/codegen diff --git a/modules/benchmarks/pubspec.yaml b/modules/benchmarks/pubspec.yaml index 4b827ef76a..4386acff02 100644 --- a/modules/benchmarks/pubspec.yaml +++ b/modules/benchmarks/pubspec.yaml @@ -15,8 +15,9 @@ dependency_overrides: angular2: path: ../angular2 transformers: -- angular2: - entry_points: +- angular2/transform/codegen +- angular2/transform/reflection_remover: + $include: - web/src/compiler/compiler_benchmark.dart - web/src/costs/index.dart - web/src/di/di_benchmark.dart diff --git a/modules/playground/pubspec.yaml b/modules/playground/pubspec.yaml index 4ed693a9b8..c76655b9ed 100644 --- a/modules/playground/pubspec.yaml +++ b/modules/playground/pubspec.yaml @@ -17,9 +17,10 @@ dependency_overrides: path: ../angular2_material matcher: '0.12.0+1' transformers: -- angular2: +- angular2/transform/codegen: platform_directives: 'package:angular2/src/common/directives.dart#CORE_DIRECTIVES' - entry_points: +- angular2/transform/reflection_remover: + $include: - web/src/animate/index.dart - web/src/async/index.dart - web/src/gestures/index.dart @@ -54,6 +55,10 @@ transformers: - web/src/web_workers/router/index.dart - web/src/web_workers/router/background_index.dart - web/src/zippy_component/index.dart +- angular2/transform/deferred_rewriter: + # No playground apps use deferred imports, but in general + # all libraries with deferred imports should be included. + $include: [] - $dart2js: $include: diff --git a/modules_dart/payload/hello_world/pubspec.yaml b/modules_dart/payload/hello_world/pubspec.yaml index 30ec384dea..c46afe332a 100644 --- a/modules_dart/payload/hello_world/pubspec.yaml +++ b/modules_dart/payload/hello_world/pubspec.yaml @@ -9,11 +9,10 @@ dependency_overrides: angular2: path: ../../../dist/dart/angular2 transformers: -- angular2: +- angular2/transform/codegen: platform_directives: 'package:angular2/src/common/directives.dart#CORE_DIRECTIVES' - entry_points: - - web/index.dart - +- angular2/transform/reflection_remover: + $include: [web/index.dart] - $dart2js: minify: true commandLineOptions: