-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Expand file tree
/
Copy pathcompiler.ts
More file actions
283 lines (274 loc) Β· 9.27 KB
/
compiler.ts
File metadata and controls
283 lines (274 loc) Β· 9.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
//////////////////////////////////////
// THIS FILE HAS GLOBAL SIDE EFFECT //
// (see bottom of file) //
//////////////////////////////////////
/**
* @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>
*/
import * as core from './core';
import {publishFacade} from './jit_compiler_facade';
import * as outputAst from './output/output_ast';
import {global} from './util';
export {SECURITY_SCHEMA} from './schema/dom_security_schema';
export {CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, SchemaMetadata} from './core';
export {core};
export {CompilerConfig, preserveWhitespacesDefault} from './config';
export {ConstantPool} from './constant_pool';
export {
ChangeDetectionStrategy,
emitDistinctChangesOnlyDefaultValue,
ViewEncapsulation,
} from './core';
export * from './expression_parser/ast';
export * from './expression_parser/lexer';
export * from './expression_parser/parser';
export * from './i18n/index';
export * from './injectable_compiler_2';
export * from './service_compiler';
export {publishFacade} from './jit_compiler_facade';
export * from './ml_parser/ast';
export * from './ml_parser/html_parser';
export * from './ml_parser/html_tags';
export {
ClassPropertyMapping,
ClassPropertyName,
InputOrOutput,
BindingPropertyName,
} from './property_mapping';
export {MatchSource} from './render3/view/t2_api';
export {LexerRange} from './ml_parser/lexer';
export {ParseTreeResult, TreeError} from './ml_parser/parser';
export * from './ml_parser/tags';
export {TokenType as LexerTokenType} from './ml_parser/tokens';
export * from './ml_parser/xml_parser';
export {EmitterVisitorContext, AbstractEmitterVisitor} from './output/abstract_emitter';
export {
ArrayType,
ArrowFunctionExpr,
BinaryOperator,
BinaryOperatorExpr,
BuiltinType,
BuiltinTypeName,
CommaExpr,
ConditionalExpr,
DeclareFunctionStmt,
DeclareVarStmt,
DYNAMIC_TYPE,
DynamicImportExpr,
Expression,
ExpressionStatement,
ExpressionType,
ExpressionVisitor,
ExternalExpr,
ExternalReference,
FunctionExpr,
IfStmt,
InstantiateExpr,
InvokeFunctionExpr,
jsDocComment,
JSDocComment,
leadingComment,
LeadingComment,
literal,
LiteralArrayExpr,
LiteralExpr,
literalMap,
LiteralMapExpr,
LocalizedString,
MapType,
NONE_TYPE,
NotExpr,
ParenthesizedExpr,
ReadKeyExpr,
ReadPropExpr,
ReadVarExpr,
RegularExpressionLiteralExpr,
ReturnStatement,
Statement,
StatementVisitor,
StmtModifier,
STRING_TYPE,
TaggedTemplateLiteralExpr,
TemplateLiteralElementExpr,
TemplateLiteralExpr,
TransplantedType,
Type,
TypeModifier,
TypeofExpr,
TypeVisitor,
UnaryOperator,
UnaryOperatorExpr,
VoidExpr,
WrappedNodeExpr,
LiteralMapPropertyAssignment,
LiteralMapSpreadAssignment,
SpreadElementExpr,
} from './output/output_ast';
export {JitEvaluator} from './output/output_jit';
export {SourceMap} from './output/source_map';
export * from './parse_util';
export * from './render3/partial/api';
export {
compileComponentDeclareClassMetadata,
compileDeclareClassMetadata,
} from './render3/partial/class_metadata';
export {
compileDeclareComponentFromMetadata,
DeclareComponentTemplateInfo,
} from './render3/partial/component';
export {compileDeclareDirectiveFromMetadata} from './render3/partial/directive';
export {compileDeclareFactoryFunction} from './render3/partial/factory';
export {compileDeclareInjectableFromMetadata} from './render3/partial/injectable';
export {compileDeclareServiceFromMetadata} from './render3/partial/service';
export {compileDeclareInjectorFromMetadata} from './render3/partial/injector';
export {compileDeclareNgModuleFromMetadata} from './render3/partial/ng_module';
export {compileDeclarePipeFromMetadata} from './render3/partial/pipe';
export {
BlockNode as TmplAstBlockNode,
BoundAttribute as TmplAstBoundAttribute,
BoundDeferredTrigger as TmplAstBoundDeferredTrigger,
BoundEvent as TmplAstBoundEvent,
BoundText as TmplAstBoundText,
Content as TmplAstContent,
DeferredBlock as TmplAstDeferredBlock,
DeferredBlockError as TmplAstDeferredBlockError,
DeferredBlockLoading as TmplAstDeferredBlockLoading,
DeferredBlockPlaceholder as TmplAstDeferredBlockPlaceholder,
DeferredBlockTriggers as TmplAstDeferredBlockTriggers,
DeferredTrigger as TmplAstDeferredTrigger,
Element as TmplAstElement,
ForLoopBlock as TmplAstForLoopBlock,
ForLoopBlockEmpty as TmplAstForLoopBlockEmpty,
HoverDeferredTrigger as TmplAstHoverDeferredTrigger,
Icu as TmplAstIcu,
IdleDeferredTrigger as TmplAstIdleDeferredTrigger,
IfBlock as TmplAstIfBlock,
IfBlockBranch as TmplAstIfBlockBranch,
ImmediateDeferredTrigger as TmplAstImmediateDeferredTrigger,
InteractionDeferredTrigger as TmplAstInteractionDeferredTrigger,
LetDeclaration as TmplAstLetDeclaration,
NeverDeferredTrigger as TmplAstNeverDeferredTrigger,
Node as TmplAstNode,
RecursiveVisitor as TmplAstRecursiveVisitor,
Reference as TmplAstReference,
SwitchBlock as TmplAstSwitchBlock,
SwitchBlockCase as TmplAstSwitchBlockCase,
SwitchBlockCaseGroup as TmplAstSwitchBlockCaseGroup,
SwitchExhaustiveCheck as TmplAstSwitchExhaustiveCheck,
Template as TmplAstTemplate,
Text as TmplAstText,
TextAttribute as TmplAstTextAttribute,
TimerDeferredTrigger as TmplAstTimerDeferredTrigger,
UnknownBlock as TmplAstUnknownBlock,
Variable as TmplAstVariable,
ViewportDeferredTrigger as TmplAstViewportDeferredTrigger,
HostElement as TmplAstHostElement,
Component as TmplAstComponent,
Directive as TmplAstDirective,
visitAll as tmplAstVisitAll,
Visitor as TmplAstVisitor,
} from './render3/r3_ast';
export {compileClassDebugInfo, R3ClassDebugInfo} from './render3/r3_class_debug_info_compiler';
export {
compileClassMetadata,
CompileClassMetadataFn,
compileComponentClassMetadata,
compileOpaqueAsyncClassMetadata,
R3ClassMetadata,
} from './render3/r3_class_metadata_compiler';
export {
compileFactoryFunction,
R3DependencyMetadata,
R3FactoryMetadata,
} from './render3/r3_factory';
export {
compileHmrInitializer,
compileHmrUpdateCallback,
R3HmrMetadata,
R3HmrNamespaceDependency,
} from './render3/r3_hmr_compiler';
export {Identifiers as R3Identifiers} from './render3/r3_identifiers';
export {compileInjector, R3InjectorMetadata} from './render3/r3_injector_compiler';
export {
compileNgModule,
R3NgModuleMetadata,
R3NgModuleMetadataGlobal,
R3NgModuleMetadataKind,
R3SelectorScopeMode,
} from './render3/r3_module_compiler';
export {compilePipeFromMetadata, R3PipeMetadata} from './render3/r3_pipe_compiler';
export {
createMayBeForwardRefExpression,
devOnlyGuardedExpression,
ForwardRefHandling,
getSafePropertyAccessString,
MaybeForwardRefExpression,
R3CompiledExpression,
R3Reference,
} from './render3/util';
export * from './render3/view/api';
export {
compileComponentFromMetadata,
compileDeferResolverFunction,
compileDirectiveFromMetadata,
encapsulateStyle,
ParsedHostBindings,
parseHostBindings,
verifyHostBindings,
} from './render3/view/compiler';
export * from './render3/view/t2_api';
export * from './render3/view/t2_binder';
export {
makeBindingParser,
ParsedTemplate,
parseTemplate,
ParseTemplateOptions,
} from './render3/view/template';
export {CombinedRecursiveAstVisitor} from './combined_visitor';
// Note: BindingParser is intentionally exported as a type only, because it should
// be constructed through `makeBindingParser`, rather than its constructor.
export {type BindingParser} from './template_parser/binding_parser';
export {createCssSelectorFromNode} from './render3/view/util';
export * from './resource_loader';
export * from './schema/dom_element_schema_registry';
export * from './schema/element_schema_registry';
export * from './directive_matching';
export {Version, escapeRegExp} from './util';
export * from './version';
export {outputAst};
export {CompilerFacadeImpl} from './jit_compiler_facade';
export {FactoryTarget} from './compiler_facade_interface';
export {QueryFlags} from './render3/view/query_generation';
export {setEnableTemplateSourceLocations} from './render3/view/config';
export * from './typecheck/api';
export * from './typecheck/host_bindings';
export {CommentTriviaType, ExpressionIdentifier} from './typecheck/comments';
export {OutOfBandDiagnosticRecorder, OutOfBandDiagnosticCategory} from './typecheck/oob';
export {DomSchemaChecker} from './typecheck/schema';
export {generateTypeCheckBlock} from './typecheck/type_check_block';
export {TcbExpr} from './typecheck/ops/codegen';
export {TcbGenericContextBehavior} from './typecheck/ops/context';
export {LEGACY_OPTIONAL_CHAINING_DEFAULT} from './legacy_optional_chaining_default';
// This file only reexports content of the `src` folder. Keep it that way.
// 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.
publishFacade(global);