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.
This commit is contained in:
Tobias Bosch
2016-04-19 08:26:43 -07:00
parent 0c600cf6e3
commit c06b0a2371
42 changed files with 96 additions and 96 deletions

View File

@ -15,11 +15,11 @@ const REFLECTOR_IMPORT = 'package:angular2/src/core/reflection/reflection.dart';
const REFLECTOR_PREFIX = '_ngRef';
const REGISTER_TYPE_METHOD_NAME = 'registerType';
const SUMMARY_META_EXTENSION = '.ng_summary.json';
const TEMPLATE_EXTENSION = '.template.dart';
const TEMPLATE_EXTENSION = '.ngfactory.dart';
/// Note that due to the implementation of `_toExtension`, ordering is
/// important. For example, putting '.dart' first in this list will cause
/// incorrect behavior because it will (incompletely) match '.template.dart'
/// incorrect behavior because it will (incompletely) match '.ngfactory.dart'
/// files.
const ALL_EXTENSIONS = const [
DEFERRED_EXTENSION,

View File

@ -90,7 +90,7 @@ class TransformerOptions {
///
/// This option is strictly for internal testing and is not available as an
/// option on the transformer.
/// Setting this to `false` means that our generated .template.dart files do
/// Setting this to `false` means that our generated .ngfactory.dart files do
/// not have any compiled templates or change detectors defined in them.
/// These files will not be usable, but this allows us to test the code output
/// of the transformer without breaking when compiled template internals

View File

@ -17,7 +17,7 @@ import 'package:angular2/src/transform/common/url_resolver.dart';
/// `_entryPoint`
/// 2. Removes any libraries that don't require angular codegen.
/// 3. For the remaining libraries, rewrites the import to the corresponding
/// `.template.dart` file.
/// `.ngfactory.dart` file.
/// 4. Chains a future to the `loadLibrary` call which initializes the
/// library.
///

View File

@ -16,7 +16,7 @@ import 'package:barback/barback.dart';
///
/// For example, if entry_point.dart imports dependency.dart, this will check if
/// dependency.ng_meta.json exists. If it does, we add an entry to the
/// `depImports` of [NgDepsModel] for dependency.template.dart.
/// `depImports` of [NgDepsModel] for dependency.ngfactory.dart.
///
/// We use this information later to ensure that each file's dependencies are
/// initialized when that file is initialized.

View File

@ -22,8 +22,8 @@ import 'ng_meta_linker.dart';
/// Said another way, after this step there should be an entry in this `NgMeta`
/// object for all `Directives` visible from its associated `.dart` file.
///
/// This step also ensures that, if `a.dart` imports `b.dart`, `a.template.dart`
/// imports `b.template.dart` (if it exists) and we note that this is a
/// This step also ensures that, if `a.dart` imports `b.dart`, `a.ngfactory.dart`
/// imports `b.ngfactory.dart` (if it exists) and we note that this is a
/// ngDeps dependency, ensuring that a's `initReflector` function calls b's
/// `initReflector' function.
///

View File

@ -19,9 +19,9 @@ import 'remove_reflection_capabilities.dart';
/// The goal of this is to break the app's dependency on dart:mirrors.
///
/// This transformer assumes that {@link DirectiveProcessor} and {@link DirectiveLinker}
/// have already been run and that a .template.dart file has been generated for
/// have already been run and that a .ngfactory.dart file has been generated for
/// {@link options.entryPoint}. The instantiation of {@link ReflectionCapabilities} is
/// replaced by calling `initReflector` in that .template.dart file.
/// replaced by calling `initReflector` in that .ngfactory.dart file.
class ReflectionRemover extends Transformer implements LazyTransformer {
final TransformerOptions options;

View File

@ -19,7 +19,7 @@ import 'package:angular2/src/transform/common/options.dart' show CODEGEN_DEBUG_M
import 'compile_data_creator.dart';
/// Generates `.template.dart` files to initialize the Angular2 system.
/// Generates `.ngfactory.dart` files to initialize the Angular2 system.
///
/// - Processes the `.ng_meta.json` file represented by `assetId` using
/// `createCompileData`.