2017-01-27 17:39:48 -08:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 12:08:49 -07:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2017-01-27 17:39:48 -08:00
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2018-10-24 16:02:25 -07:00
|
|
|
//////////////////////////////////////
|
|
|
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
|
|
// (see bottom of file) //
|
|
|
|
//////////////////////////////////////
|
|
|
|
|
2017-01-27 17:39:48 -08:00
|
|
|
/**
|
|
|
|
* @module
|
|
|
|
* @description
|
|
|
|
* Entry point for all APIs of the compiler package.
|
|
|
|
*
|
|
|
|
* <div class="callout is-critical">
|
|
|
|
* <header>Unstable APIs</header>
|
|
|
|
* <p>
|
|
|
|
* All compiler apis are currently considered experimental and private!
|
|
|
|
* </p>
|
|
|
|
* <p>
|
|
|
|
* We expect the APIs in this package to keep on changing. Do not rely on them.
|
|
|
|
* </p>
|
|
|
|
* </div>
|
|
|
|
*/
|
2017-08-16 09:00:03 -07:00
|
|
|
|
|
|
|
import * as core from './core';
|
2018-10-24 16:02:25 -07:00
|
|
|
import {publishFacade} from './jit_compiler_facade';
|
|
|
|
import {global} from './util';
|
2017-08-16 09:00:03 -07:00
|
|
|
|
2019-08-16 16:45:33 -07:00
|
|
|
export {CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, SchemaMetadata} from './core';
|
2017-08-16 09:00:03 -07:00
|
|
|
export {core};
|
|
|
|
|
|
|
|
export * from './version';
|
2017-01-27 17:39:48 -08:00
|
|
|
export * from './template_parser/template_ast';
|
2017-07-28 15:58:28 +02:00
|
|
|
export {CompilerConfig, preserveWhitespacesDefault} from './config';
|
2017-01-27 17:39:48 -08:00
|
|
|
export * from './compile_metadata';
|
|
|
|
export * from './aot/compiler_factory';
|
|
|
|
export * from './aot/compiler';
|
2017-03-14 09:16:15 -07:00
|
|
|
export * from './aot/generated_file';
|
2017-02-18 21:28:27 -08:00
|
|
|
export * from './aot/compiler_options';
|
2017-01-27 17:39:48 -08:00
|
|
|
export * from './aot/compiler_host';
|
2017-11-14 17:49:47 -08:00
|
|
|
export * from './aot/formatted_error';
|
2017-11-20 10:21:17 -08:00
|
|
|
export * from './aot/partial_module';
|
2017-01-27 17:39:48 -08:00
|
|
|
export * from './aot/static_reflector';
|
|
|
|
export * from './aot/static_symbol';
|
|
|
|
export * from './aot/static_symbol_resolver';
|
|
|
|
export * from './aot/summary_resolver';
|
2017-10-23 17:51:19 -07:00
|
|
|
export {isLoweredSymbol, createLoweredSymbol} from './aot/util';
|
2017-10-20 09:46:41 -07:00
|
|
|
export {LazyRoute} from './aot/lazy_routes';
|
2017-05-09 16:16:50 -07:00
|
|
|
export * from './ast_path';
|
2017-01-27 17:39:48 -08:00
|
|
|
export * from './summary_resolver';
|
2017-08-16 09:00:03 -07:00
|
|
|
export {Identifiers} from './identifiers';
|
2017-01-27 17:39:48 -08:00
|
|
|
export {JitCompiler} from './jit/compiler';
|
2017-05-18 13:46:51 -07:00
|
|
|
export * from './compile_reflector';
|
2017-01-27 17:39:48 -08:00
|
|
|
export * from './url_resolver';
|
|
|
|
export * from './resource_loader';
|
2018-05-09 08:35:25 -07:00
|
|
|
export {ConstantPool} from './constant_pool';
|
2017-01-27 17:39:48 -08:00
|
|
|
export {DirectiveResolver} from './directive_resolver';
|
|
|
|
export {PipeResolver} from './pipe_resolver';
|
|
|
|
export {NgModuleResolver} from './ng_module_resolver';
|
|
|
|
export {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from './ml_parser/interpolation_config';
|
|
|
|
export * from './schema/element_schema_registry';
|
|
|
|
export * from './i18n/index';
|
|
|
|
export * from './directive_normalizer';
|
|
|
|
export * from './expression_parser/ast';
|
|
|
|
export * from './expression_parser/lexer';
|
|
|
|
export * from './expression_parser/parser';
|
|
|
|
export * from './metadata_resolver';
|
|
|
|
export * from './ml_parser/ast';
|
|
|
|
export * from './ml_parser/html_parser';
|
|
|
|
export * from './ml_parser/html_tags';
|
|
|
|
export * from './ml_parser/interpolation_config';
|
|
|
|
export * from './ml_parser/tags';
|
2019-02-08 22:10:21 +00:00
|
|
|
export {LexerRange} from './ml_parser/lexer';
|
2019-10-08 14:46:28 +01:00
|
|
|
export * from './ml_parser/xml_parser';
|
2017-01-27 17:39:48 -08:00
|
|
|
export {NgModuleCompiler} from './ng_module_compiler';
|
2020-09-27 01:45:38 +00:00
|
|
|
export {ArrayType, AssertNotNull, DYNAMIC_TYPE, BinaryOperator, BinaryOperatorExpr, BuiltinMethod, BuiltinType, BuiltinTypeName, BuiltinVar, CastExpr, ClassField, ClassMethod, ClassStmt, CommaExpr, ConditionalExpr, DeclareFunctionStmt, DeclareVarStmt, Expression, ExpressionStatement, ExpressionType, ExpressionVisitor, ExternalExpr, ExternalReference, literalMap, FunctionExpr, IfStmt, InstantiateExpr, InvokeFunctionExpr, InvokeMethodExpr, LiteralArrayExpr, LiteralExpr, LiteralMapExpr, MapType, NotExpr, NONE_TYPE, ReadKeyExpr, ReadPropExpr, ReadVarExpr, ReturnStatement, StatementVisitor, TaggedTemplateExpr, TemplateLiteral, TemplateLiteralElement, ThrowStmt, TryCatchStmt, Type, TypeVisitor, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, StmtModifier, Statement, STRING_TYPE, TypeofExpr, collectExternalReferences, jsDocComment, leadingComment, LeadingComment, JSDocComment, UnaryOperator, UnaryOperatorExpr, LocalizedString} from './output/output_ast';
|
2017-06-01 11:13:50 -06:00
|
|
|
export {EmitterVisitorContext} from './output/abstract_emitter';
|
2019-02-08 22:10:19 +00:00
|
|
|
export {JitEvaluator} from './output/output_jit';
|
2017-01-27 17:39:48 -08:00
|
|
|
export * from './output/ts_emitter';
|
|
|
|
export * from './parse_util';
|
|
|
|
export * from './schema/dom_element_schema_registry';
|
|
|
|
export * from './selector';
|
|
|
|
export * from './style_compiler';
|
|
|
|
export * from './template_parser/template_parser';
|
2019-10-04 09:38:51 +02:00
|
|
|
export {ViewCompiler} from './view_compiler/view_compiler';
|
2017-08-16 09:00:03 -07:00
|
|
|
export {getParseErrors, isSyntaxError, syntaxError, Version} from './util';
|
2017-12-16 11:35:47 -08:00
|
|
|
export {SourceMap} from './output/source_map';
|
2018-04-06 09:53:10 -07:00
|
|
|
export * from './injectable_compiler_2';
|
2020-12-03 23:07:24 +01:00
|
|
|
export * from './render3/partial/api';
|
2018-05-09 08:35:25 -07:00
|
|
|
export * from './render3/view/api';
|
2020-10-01 00:22:54 +02:00
|
|
|
export {BoundAttribute as TmplAstBoundAttribute, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, Element as TmplAstElement, Icu as TmplAstIcu, Node as TmplAstNode, RecursiveVisitor as TmplAstRecursiveVisitor, Reference as TmplAstReference, Template as TmplAstTemplate, Text as TmplAstText, TextAttribute as TmplAstTextAttribute, Variable as TmplAstVariable} from './render3/r3_ast';
|
2018-09-21 15:42:07 -07:00
|
|
|
export * from './render3/view/t2_api';
|
|
|
|
export * from './render3/view/t2_binder';
|
feat(ivy): detect cycles and use remote scoping of components if needed (#28169)
By its nature, Ivy alters the import graph of a TS program, adding imports
where template dependencies exist. For example, if ComponentA uses PipeB
in its template, Ivy will insert an import of PipeB into the file in which
ComponentA is declared.
Any insertion of an import into a program has the potential to introduce a
cycle into the import graph. If for some reason the file in which PipeB is
declared imports the file in which ComponentA is declared (maybe it makes
use of a service or utility function that happens to be in the same file as
ComponentA) then this could create an import cycle. This turns out to
happen quite regularly in larger Angular codebases.
TypeScript and the Ivy runtime have no issues with such cycles. However,
other tools are not so accepting. In particular the Closure Compiler is
very anti-cycle.
To mitigate this problem, it's necessary to detect when the insertion of
an import would create a cycle. ngtsc can then use a different strategy,
known as "remote scoping", instead of directly writing a reference from
one component to another. Under remote scoping, a function
'setComponentScope' is called after the declaration of the component's
module, which does not require the addition of new imports.
FW-647 #resolve
PR Close #28169
2019-01-15 12:32:10 -08:00
|
|
|
export {Identifiers as R3Identifiers} from './render3/r3_identifiers';
|
2019-10-03 21:54:49 +02:00
|
|
|
export {R3DependencyMetadata, R3ResolvedDependencyType, compileFactoryFunction, R3FactoryMetadata, R3FactoryTarget} from './render3/r3_factory';
|
2018-06-18 16:28:02 -07:00
|
|
|
export {compileInjector, compileNgModule, R3InjectorMetadata, R3NgModuleMetadata} from './render3/r3_module_compiler';
|
2018-06-26 10:43:06 -07:00
|
|
|
export {compilePipeFromMetadata, R3PipeMetadata} from './render3/r3_pipe_compiler';
|
2020-08-26 17:10:04 +01:00
|
|
|
export {makeBindingParser, ParsedTemplate, parseTemplate, ParseTemplateOptions} from './render3/view/template';
|
2021-03-10 15:24:11 +00:00
|
|
|
export {R3CompiledExpression, R3Reference, devOnlyGuardedExpression, getSafePropertyAccessString} from './render3/util';
|
2019-10-25 19:45:08 +02:00
|
|
|
export {compileComponentFromMetadata, compileDirectiveFromMetadata, parseHostBindings, ParsedHostBindings, verifyHostBindings} from './render3/view/compiler';
|
2020-11-16 18:24:37 +01:00
|
|
|
export {compileDeclareComponentFromMetadata} from './render3/partial/component';
|
2020-10-30 23:45:15 +01:00
|
|
|
export {compileDeclareDirectiveFromMetadata} from './render3/partial/directive';
|
2021-02-11 14:42:10 +00:00
|
|
|
export {compileDeclarePipeFromMetadata} from './render3/partial/pipe';
|
2018-10-24 16:02:25 -07:00
|
|
|
export {publishFacade} from './jit_compiler_facade';
|
2018-08-07 12:04:39 -07:00
|
|
|
// This file only reexports content of the `src` folder. Keep it that way.
|
2018-10-24 16:02:25 -07:00
|
|
|
|
|
|
|
// This function call has a global side effects and publishes the compiler into global namespace for
|
|
|
|
// the late binding of the Compiler to the @angular/core for jit compilation.
|
2019-08-12 09:26:20 +03:00
|
|
|
publishFacade(global);
|