createViewCompiler function

TemplateCompiler createViewCompiler(
  1. BuildStep buildStep,
  2. CompilerFlags flags
)

Creates the elements necessary to implement view classes.

NOTE: This is seperate from createTemplateCompiler, because some of the functionality provided by TemplateViewCompiler is currently used by other sub-systems, such as the stylesheet compiler.

Implementation

TemplateCompiler createViewCompiler(
  BuildStep buildStep,
  CompilerFlags flags,
) {
  final schemaRegistry = DomElementSchemaRegistry();
  return TemplateCompiler(
    DirectiveCompiler(),
    StyleCompiler(flags),
    ViewCompiler(flags, ng.ExpressionParser(), schemaRegistry),
    DartEmitter(),
  );
}