Skip to content

Commit c06b0a2

Browse files
committed
refactor(codegen): produce .ngfactory.dart/ts files instead of .template.dart/ts files.
This is needed as we will soon store other things into the generated files, not only the templates.
1 parent 0c600cf commit c06b0a2

File tree

42 files changed

+96
-96
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+96
-96
lines changed

modules/angular2/src/compiler/offline_compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function _resolveStyleStatements(compileResult: StylesCompileResult): o.Statemen
126126
function _templateModuleUrl(comp: CompileDirectiveMetadata): string {
127127
var moduleUrl = comp.type.moduleUrl;
128128
var urlWithoutSuffix = moduleUrl.substring(0, moduleUrl.length - MODULE_SUFFIX.length);
129-
return `${urlWithoutSuffix}.template${MODULE_SUFFIX}`;
129+
return `${urlWithoutSuffix}.ngfactory${MODULE_SUFFIX}`;
130130
}
131131

132132
function _stylesModuleUrl(stylesheetUrl: string, shim: boolean): string {

modules_dart/transform/lib/src/transform/common/names.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ const REFLECTOR_IMPORT = 'package:angular2/src/core/reflection/reflection.dart';
1515
const REFLECTOR_PREFIX = '_ngRef';
1616
const REGISTER_TYPE_METHOD_NAME = 'registerType';
1717
const SUMMARY_META_EXTENSION = '.ng_summary.json';
18-
const TEMPLATE_EXTENSION = '.template.dart';
18+
const TEMPLATE_EXTENSION = '.ngfactory.dart';
1919

2020
/// Note that due to the implementation of `_toExtension`, ordering is
2121
/// important. For example, putting '.dart' first in this list will cause
22-
/// incorrect behavior because it will (incompletely) match '.template.dart'
22+
/// incorrect behavior because it will (incompletely) match '.ngfactory.dart'
2323
/// files.
2424
const ALL_EXTENSIONS = const [
2525
DEFERRED_EXTENSION,

modules_dart/transform/lib/src/transform/common/options.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class TransformerOptions {
9090
///
9191
/// This option is strictly for internal testing and is not available as an
9292
/// option on the transformer.
93-
/// Setting this to `false` means that our generated .template.dart files do
93+
/// Setting this to `false` means that our generated .ngfactory.dart files do
9494
/// not have any compiled templates or change detectors defined in them.
9595
/// These files will not be usable, but this allows us to test the code output
9696
/// of the transformer without breaking when compiled template internals

modules_dart/transform/lib/src/transform/deferred_rewriter/rewriter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import 'package:angular2/src/transform/common/url_resolver.dart';
1717
/// `_entryPoint`
1818
/// 2. Removes any libraries that don't require angular codegen.
1919
/// 3. For the remaining libraries, rewrites the import to the corresponding
20-
/// `.template.dart` file.
20+
/// `.ngfactory.dart` file.
2121
/// 4. Chains a future to the `loadLibrary` call which initializes the
2222
/// library.
2323
///

modules_dart/transform/lib/src/transform/directive_metadata_linker/ng_deps_linker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import 'package:barback/barback.dart';
1616
///
1717
/// For example, if entry_point.dart imports dependency.dart, this will check if
1818
/// dependency.ng_meta.json exists. If it does, we add an entry to the
19-
/// `depImports` of [NgDepsModel] for dependency.template.dart.
19+
/// `depImports` of [NgDepsModel] for dependency.ngfactory.dart.
2020
///
2121
/// We use this information later to ensure that each file's dependencies are
2222
/// initialized when that file is initialized.

modules_dart/transform/lib/src/transform/directive_metadata_linker/transformer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import 'ng_meta_linker.dart';
2222
/// Said another way, after this step there should be an entry in this `NgMeta`
2323
/// object for all `Directives` visible from its associated `.dart` file.
2424
///
25-
/// This step also ensures that, if `a.dart` imports `b.dart`, `a.template.dart`
26-
/// imports `b.template.dart` (if it exists) and we note that this is a
25+
/// This step also ensures that, if `a.dart` imports `b.dart`, `a.ngfactory.dart`
26+
/// imports `b.ngfactory.dart` (if it exists) and we note that this is a
2727
/// ngDeps dependency, ensuring that a's `initReflector` function calls b's
2828
/// `initReflector' function.
2929
///

modules_dart/transform/lib/src/transform/reflection_remover/transformer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import 'remove_reflection_capabilities.dart';
1919
/// The goal of this is to break the app's dependency on dart:mirrors.
2020
///
2121
/// This transformer assumes that {@link DirectiveProcessor} and {@link DirectiveLinker}
22-
/// have already been run and that a .template.dart file has been generated for
22+
/// have already been run and that a .ngfactory.dart file has been generated for
2323
/// {@link options.entryPoint}. The instantiation of {@link ReflectionCapabilities} is
24-
/// replaced by calling `initReflector` in that .template.dart file.
24+
/// replaced by calling `initReflector` in that .ngfactory.dart file.
2525
class ReflectionRemover extends Transformer implements LazyTransformer {
2626
final TransformerOptions options;
2727

modules_dart/transform/lib/src/transform/template_compiler/generator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import 'package:angular2/src/transform/common/options.dart' show CODEGEN_DEBUG_M
1919

2020
import 'compile_data_creator.dart';
2121

22-
/// Generates `.template.dart` files to initialize the Angular2 system.
22+
/// Generates `.ngfactory.dart` files to initialize the Angular2 system.
2323
///
2424
/// - Processes the `.ng_meta.json` file represented by `assetId` using
2525
/// `createCompileData`.

modules_dart/transform/test/transform/deferred_rewriter/complex_deferred_example/expected/index.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ library web_foo;
33
import 'package:angular2/src/core/application.dart';
44
import 'package:angular2/src/core/reflection/reflection.dart';
55
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';
6-
import 'hello.template.dart' deferred as a; // ng_deps. Should be rewritten.
6+
import 'hello.ngfactory.dart' deferred as a; // ng_deps. Should be rewritten.
77
import 'b.dart' deferred as b; // No ng_deps. Shouldn't be rewritten.
88

99
void main() {

modules_dart/transform/test/transform/deferred_rewriter/simple_deferred_example/expected/index.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ library web_foo;
33
import 'package:angular2/src/core/application.dart';
44
import 'package:angular2/src/core/reflection/reflection.dart';
55
import 'package:angular2/src/core/reflection/reflection_capabilities.dart';
6-
import 'hello.template.dart' deferred as a;
6+
import 'hello.ngfactory.dart' deferred as a;
77

88
void main() {
99
reflector.reflectionCapabilities = new ReflectionCapabilities();

0 commit comments

Comments
 (0)