@angular/compiler-cli 18.1.0-next.0 → 18.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/chunk-4HWDU6FJ.js +4610 -0
- package/bundles/chunk-4HWDU6FJ.js.map +6 -0
- package/bundles/{chunk-EU3OILAK.js → chunk-54G5EVKM.js} +7 -7
- package/bundles/{chunk-5ZVL2ETT.js → chunk-CK5W7X4H.js} +13 -13
- package/bundles/{chunk-IJ3MFF2U.js → chunk-CWU65S2B.js} +6558 -296
- package/bundles/chunk-CWU65S2B.js.map +6 -0
- package/bundles/{chunk-AQFTVE7F.js → chunk-JZQHA4E7.js} +5 -5
- package/bundles/{chunk-SBDNBITT.js → chunk-LYJKWJUC.js} +3 -3
- package/bundles/{chunk-KZJWSJUK.js → chunk-MLEQATX2.js} +5 -5
- package/bundles/{chunk-WR7TUJ7M.js → chunk-QYV344EV.js} +7 -7
- package/bundles/{chunk-COIAXMXY.js → chunk-YPERM5UE.js} +46 -43
- package/bundles/chunk-YPERM5UE.js.map +6 -0
- package/bundles/{chunk-PRZ3KEOO.js → chunk-Z34L7JZH.js} +31 -31
- package/bundles/index.js +15 -16
- package/bundles/index.js.map +1 -1
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +1 -1
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- package/bundles/private/migrations.js +6 -8
- package/bundles/private/tooling.js +5 -5
- package/bundles/src/bin/ng_xi18n.js +9 -10
- package/bundles/src/bin/ng_xi18n.js.map +1 -1
- package/bundles/src/bin/ngc.js +7 -8
- package/bundles/src/bin/ngc.js.map +1 -1
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +3 -3
- package/src/ngtsc/annotations/component/src/handler.d.ts +2 -1
- package/src/ngtsc/annotations/component/src/resources.d.ts +1 -0
- package/src/ngtsc/core/src/compiler.d.ts +1 -0
- package/src/ngtsc/diagnostics/src/error_code.d.ts +6 -0
- package/src/ngtsc/indexer/src/api.d.ts +8 -3
- package/src/ngtsc/typecheck/api/checker.d.ts +2 -2
- package/src/ngtsc/typecheck/api/completion.d.ts +15 -4
- package/src/ngtsc/typecheck/api/symbols.d.ts +28 -3
- package/src/ngtsc/typecheck/index.d.ts +1 -1
- package/src/ngtsc/typecheck/src/checker.d.ts +2 -2
- package/src/ngtsc/typecheck/src/context.d.ts +1 -1
- package/src/ngtsc/typecheck/src/oob.d.ts +16 -1
- package/src/ngtsc/typecheck/src/template_symbol_builder.d.ts +4 -3
- package/src/ngtsc/typecheck/src/ts_util.d.ts +1 -1
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +13 -2
- package/bundles/chunk-6AZ42I2O.js +0 -62
- package/bundles/chunk-6AZ42I2O.js.map +0 -6
- package/bundles/chunk-A2WCUOS3.js +0 -10679
- package/bundles/chunk-A2WCUOS3.js.map +0 -6
- package/bundles/chunk-COIAXMXY.js.map +0 -6
- package/bundles/chunk-IJ3MFF2U.js.map +0 -6
- /package/bundles/{chunk-EU3OILAK.js.map → chunk-54G5EVKM.js.map} +0 -0
- /package/bundles/{chunk-5ZVL2ETT.js.map → chunk-CK5W7X4H.js.map} +0 -0
- /package/bundles/{chunk-AQFTVE7F.js.map → chunk-JZQHA4E7.js.map} +0 -0
- /package/bundles/{chunk-SBDNBITT.js.map → chunk-LYJKWJUC.js.map} +0 -0
- /package/bundles/{chunk-KZJWSJUK.js.map → chunk-MLEQATX2.js.map} +0 -0
- /package/bundles/{chunk-WR7TUJ7M.js.map → chunk-QYV344EV.js.map} +0 -0
- /package/bundles/{chunk-PRZ3KEOO.js.map → chunk-Z34L7JZH.js.map} +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
|
|
9
9
|
import { AstObject, AstValue } from '../../ast/ast_value';
|
|
10
|
-
export declare const PLACEHOLDER_VERSION = "18.1.0-next.
|
|
10
|
+
export declare const PLACEHOLDER_VERSION = "18.1.0-next.1";
|
|
11
11
|
export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
|
|
12
12
|
/**
|
|
13
13
|
* Parses the value of an enum from the AST value's symbol name.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler-cli",
|
|
3
|
-
"version": "18.1.0-next.
|
|
3
|
+
"version": "18.1.0-next.1",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"yargs": "^17.2.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@angular/compiler": "18.1.0-next.
|
|
56
|
+
"@angular/compiler": "18.1.0-next.1",
|
|
57
57
|
"typescript": ">=5.4 <5.6"
|
|
58
58
|
},
|
|
59
59
|
"repository": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
],
|
|
68
68
|
"license": "MIT",
|
|
69
69
|
"engines": {
|
|
70
|
-
"node": "^18.
|
|
70
|
+
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
|
|
71
71
|
},
|
|
72
72
|
"bugs": {
|
|
73
73
|
"url": "https://github.com/angular/angular/issues"
|
|
@@ -64,8 +64,9 @@ export declare class ComponentDecoratorHandler implements DecoratorHandler<Decor
|
|
|
64
64
|
private readonly deferredSymbolTracker;
|
|
65
65
|
private readonly forbidOrphanRendering;
|
|
66
66
|
private readonly enableBlockSyntax;
|
|
67
|
+
private readonly enableLetSyntax;
|
|
67
68
|
private readonly localCompilationExtraImportsTracker;
|
|
68
|
-
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, dtsScopeReader: DtsModuleScopeResolver, scopeRegistry: LocalModuleScopeRegistry, typeCheckScopeRegistry: TypeCheckScopeRegistry, resourceRegistry: ResourceRegistry, isCore: boolean, strictCtorDeps: boolean, resourceLoader: ResourceLoader, rootDirs: ReadonlyArray<string>, defaultPreserveWhitespaces: boolean, i18nUseExternalIds: boolean, enableI18nLegacyMessageIdFormat: boolean, usePoisonedData: boolean, i18nNormalizeLineEndingsInICUs: boolean, moduleResolver: ModuleResolver, cycleAnalyzer: CycleAnalyzer, cycleHandlingStrategy: CycleHandlingStrategy, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, hostDirectivesResolver: HostDirectivesResolver, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, compilationMode: CompilationMode, deferredSymbolTracker: DeferredSymbolTracker, forbidOrphanRendering: boolean, enableBlockSyntax: boolean, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null);
|
|
69
|
+
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, dtsScopeReader: DtsModuleScopeResolver, scopeRegistry: LocalModuleScopeRegistry, typeCheckScopeRegistry: TypeCheckScopeRegistry, resourceRegistry: ResourceRegistry, isCore: boolean, strictCtorDeps: boolean, resourceLoader: ResourceLoader, rootDirs: ReadonlyArray<string>, defaultPreserveWhitespaces: boolean, i18nUseExternalIds: boolean, enableI18nLegacyMessageIdFormat: boolean, usePoisonedData: boolean, i18nNormalizeLineEndingsInICUs: boolean, moduleResolver: ModuleResolver, cycleAnalyzer: CycleAnalyzer, cycleHandlingStrategy: CycleHandlingStrategy, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, hostDirectivesResolver: HostDirectivesResolver, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, compilationMode: CompilationMode, deferredSymbolTracker: DeferredSymbolTracker, forbidOrphanRendering: boolean, enableBlockSyntax: boolean, enableLetSyntax: boolean, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null);
|
|
69
70
|
private literalCache;
|
|
70
71
|
private elementSchemaRegistry;
|
|
71
72
|
/**
|
|
@@ -100,6 +100,7 @@ export interface ExtractTemplateOptions {
|
|
|
100
100
|
enableI18nLegacyMessageIdFormat: boolean;
|
|
101
101
|
i18nNormalizeLineEndingsInICUs: boolean;
|
|
102
102
|
enableBlockSyntax: boolean;
|
|
103
|
+
enableLetSyntax: boolean;
|
|
103
104
|
}
|
|
104
105
|
export declare function extractTemplate(node: ClassDeclaration, template: TemplateDeclaration, evaluator: PartialEvaluator, depTracker: DependencyTracker | null, resourceLoader: ResourceLoader, options: ExtractTemplateOptions, compilationMode: CompilationMode): ParsedTemplateWithSource;
|
|
105
106
|
export declare function parseTemplateDeclaration(node: ClassDeclaration, decorator: Decorator, component: Map<string, ts.Expression>, containingFile: string, evaluator: PartialEvaluator, depTracker: DependencyTracker | null, resourceLoader: ResourceLoader, defaultPreserveWhitespaces: boolean): TemplateDeclaration;
|
|
@@ -131,6 +131,7 @@ export declare class NgCompiler {
|
|
|
131
131
|
readonly ignoreForEmit: Set<ts.SourceFile>;
|
|
132
132
|
readonly enableTemplateTypeChecker: boolean;
|
|
133
133
|
private readonly enableBlockSyntax;
|
|
134
|
+
private readonly enableLetSyntax;
|
|
134
135
|
private readonly angularCoreVersion;
|
|
135
136
|
/**
|
|
136
137
|
* `NgCompiler` can be reused for multiple compilations (for resource-only changes), and each
|
|
@@ -300,6 +300,12 @@ export declare enum ErrorCode {
|
|
|
300
300
|
* also included into the `@Component.imports` list.
|
|
301
301
|
*/
|
|
302
302
|
DEFERRED_DEPENDENCY_IMPORTED_EAGERLY = 8014,
|
|
303
|
+
/** An expression is trying to write to an `@let` declaration. */
|
|
304
|
+
ILLEGAL_LET_WRITE = 8015,
|
|
305
|
+
/** An expression is trying to read an `@let` before it has been defined. */
|
|
306
|
+
LET_USED_BEFORE_DEFINITION = 8016,
|
|
307
|
+
/** Multiple `@let` declarations were defined with the same name within a scope. */
|
|
308
|
+
DUPLICATE_LET_DECLARATION = 8017,
|
|
303
309
|
/**
|
|
304
310
|
* A two way binding in a template has an incorrect syntax,
|
|
305
311
|
* parentheses outside brackets. For example:
|
|
@@ -17,7 +17,8 @@ export declare enum IdentifierKind {
|
|
|
17
17
|
Template = 3,
|
|
18
18
|
Attribute = 4,
|
|
19
19
|
Reference = 5,
|
|
20
|
-
Variable = 6
|
|
20
|
+
Variable = 6,
|
|
21
|
+
LetDeclaration = 7
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* Describes a semantically-interesting identifier in a template, such as an interpolated variable
|
|
@@ -34,7 +35,7 @@ interface ExpressionIdentifier extends TemplateIdentifier {
|
|
|
34
35
|
* ReferenceIdentifier or VariableIdentifier in the template that this identifier targets, if
|
|
35
36
|
* any. If the target is `null`, it points to a declaration on the component class.
|
|
36
37
|
* */
|
|
37
|
-
target: ReferenceIdentifier | VariableIdentifier | null;
|
|
38
|
+
target: ReferenceIdentifier | VariableIdentifier | LetDeclarationIdentifier | null;
|
|
38
39
|
}
|
|
39
40
|
/** Describes a property accessed in a template. */
|
|
40
41
|
export interface PropertyIdentifier extends ExpressionIdentifier {
|
|
@@ -93,11 +94,15 @@ export interface ReferenceIdentifier extends TemplateIdentifier {
|
|
|
93
94
|
export interface VariableIdentifier extends TemplateIdentifier {
|
|
94
95
|
kind: IdentifierKind.Variable;
|
|
95
96
|
}
|
|
97
|
+
/** Describes a `@let` declaration in a template. */
|
|
98
|
+
export interface LetDeclarationIdentifier extends TemplateIdentifier {
|
|
99
|
+
kind: IdentifierKind.LetDeclaration;
|
|
100
|
+
}
|
|
96
101
|
/**
|
|
97
102
|
* Identifiers recorded at the top level of the template, without any context about the HTML nodes
|
|
98
103
|
* they were discovered in.
|
|
99
104
|
*/
|
|
100
|
-
export type TopLevelIdentifier = PropertyIdentifier | ElementIdentifier | TemplateNodeIdentifier | ReferenceIdentifier | VariableIdentifier | MethodIdentifier;
|
|
105
|
+
export type TopLevelIdentifier = PropertyIdentifier | ElementIdentifier | TemplateNodeIdentifier | ReferenceIdentifier | VariableIdentifier | MethodIdentifier | LetDeclarationIdentifier;
|
|
101
106
|
/**
|
|
102
107
|
* Describes the absolute byte offsets of a text anchor in a source code.
|
|
103
108
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { AST, LiteralPrimitive, ParseSourceSpan, PropertyRead, SafePropertyRead, TmplAstElement, TmplAstNode,
|
|
8
|
+
import { AST, LiteralPrimitive, ParseSourceSpan, PropertyRead, SafePropertyRead, TemplateEntity, TmplAstElement, TmplAstNode, TmplAstTemplate, TmplAstTextAttribute } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
|
|
11
11
|
import { ErrorCode } from '../../diagnostics';
|
|
@@ -183,7 +183,7 @@ export interface TemplateTypeChecker {
|
|
|
183
183
|
* Gets the target of a template expression, if possible.
|
|
184
184
|
* See `BoundTarget.getExpressionTarget` for more information.
|
|
185
185
|
*/
|
|
186
|
-
getExpressionTarget(expression: AST, clazz: ts.ClassDeclaration):
|
|
186
|
+
getExpressionTarget(expression: AST, clazz: ts.ClassDeclaration): TemplateEntity | null;
|
|
187
187
|
/**
|
|
188
188
|
* Constructs a `ts.Diagnostic` for a given `ParseSourceSpan` within a template.
|
|
189
189
|
*/
|
|
@@ -5,18 +5,19 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { TmplAstReference, TmplAstVariable } from '@angular/compiler';
|
|
8
|
+
import { TmplAstLetDeclaration, TmplAstReference, TmplAstVariable } from '@angular/compiler';
|
|
9
9
|
import { TcbLocation } from './symbols';
|
|
10
10
|
/**
|
|
11
11
|
* An autocompletion source of any kind.
|
|
12
12
|
*/
|
|
13
|
-
export type Completion = ReferenceCompletion | VariableCompletion;
|
|
13
|
+
export type Completion = ReferenceCompletion | VariableCompletion | LetDeclarationCompletion;
|
|
14
14
|
/**
|
|
15
15
|
* Discriminant of an autocompletion source (a `Completion`).
|
|
16
16
|
*/
|
|
17
17
|
export declare enum CompletionKind {
|
|
18
18
|
Reference = 0,
|
|
19
|
-
Variable = 1
|
|
19
|
+
Variable = 1,
|
|
20
|
+
LetDeclaration = 2
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* An autocompletion result representing a local reference declared in the template.
|
|
@@ -38,6 +39,16 @@ export interface VariableCompletion {
|
|
|
38
39
|
*/
|
|
39
40
|
node: TmplAstVariable;
|
|
40
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* An autocompletion result representing an `@let` declaration in the template.
|
|
44
|
+
*/
|
|
45
|
+
export interface LetDeclarationCompletion {
|
|
46
|
+
kind: CompletionKind.LetDeclaration;
|
|
47
|
+
/**
|
|
48
|
+
* The `TmplAstLetDeclaration` from the template which should be available as a completion.
|
|
49
|
+
*/
|
|
50
|
+
node: TmplAstLetDeclaration;
|
|
51
|
+
}
|
|
41
52
|
/**
|
|
42
53
|
* Autocompletion data for an expression in the global scope.
|
|
43
54
|
*
|
|
@@ -59,7 +70,7 @@ export interface GlobalCompletion {
|
|
|
59
70
|
* accounted for in the preparation of `templateContext`. Entries here shadow component members of
|
|
60
71
|
* the same name (from the `componentContext` completions).
|
|
61
72
|
*/
|
|
62
|
-
templateContext: Map<string, ReferenceCompletion | VariableCompletion>;
|
|
73
|
+
templateContext: Map<string, ReferenceCompletion | VariableCompletion | LetDeclarationCompletion>;
|
|
63
74
|
/**
|
|
64
75
|
* A location within the type-checking shim where TypeScript's completion APIs can be used to
|
|
65
76
|
* access completions for the AST node of the cursor position (primitive constants).
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { TmplAstElement, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
8
|
+
import { TmplAstElement, TmplAstLetDeclaration, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { AbsoluteFsPath } from '../../file_system';
|
|
11
11
|
import { SymbolWithValueDeclaration } from '../../util/src/typescript';
|
|
@@ -21,12 +21,13 @@ export declare enum SymbolKind {
|
|
|
21
21
|
Template = 7,
|
|
22
22
|
Expression = 8,
|
|
23
23
|
DomBinding = 9,
|
|
24
|
-
Pipe = 10
|
|
24
|
+
Pipe = 10,
|
|
25
|
+
LetDeclaration = 11
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
28
|
* A representation of an entity in the `TemplateAst`.
|
|
28
29
|
*/
|
|
29
|
-
export type Symbol = InputBindingSymbol | OutputBindingSymbol | ElementSymbol | ReferenceSymbol | VariableSymbol | ExpressionSymbol | DirectiveSymbol | TemplateSymbol | DomBindingSymbol | PipeSymbol;
|
|
30
|
+
export type Symbol = InputBindingSymbol | OutputBindingSymbol | ElementSymbol | ReferenceSymbol | VariableSymbol | ExpressionSymbol | DirectiveSymbol | TemplateSymbol | DomBindingSymbol | PipeSymbol | LetDeclarationSymbol;
|
|
30
31
|
/**
|
|
31
32
|
* A `Symbol` which declares a new named entity in the template scope.
|
|
32
33
|
*/
|
|
@@ -188,6 +189,30 @@ export interface VariableSymbol {
|
|
|
188
189
|
*/
|
|
189
190
|
initializerLocation: TcbLocation;
|
|
190
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* A representation of an `@let` declaration in a component template.
|
|
194
|
+
*/
|
|
195
|
+
export interface LetDeclarationSymbol {
|
|
196
|
+
kind: SymbolKind.LetDeclaration;
|
|
197
|
+
/** The `ts.Type` of the entity. */
|
|
198
|
+
tsType: ts.Type;
|
|
199
|
+
/**
|
|
200
|
+
* The `ts.Symbol` for the declaration.
|
|
201
|
+
*
|
|
202
|
+
* This will be `null` if the symbol could not be resolved using the type checker.
|
|
203
|
+
*/
|
|
204
|
+
tsSymbol: ts.Symbol | null;
|
|
205
|
+
/** The node in the `TemplateAst` where the `@let` is declared. */
|
|
206
|
+
declaration: TmplAstLetDeclaration;
|
|
207
|
+
/**
|
|
208
|
+
* The location in the shim file for the identifier of the `@let` declaration.
|
|
209
|
+
*/
|
|
210
|
+
localVarLocation: TcbLocation;
|
|
211
|
+
/**
|
|
212
|
+
* The location in the shim file of the `@let` declaration's initializer expression.
|
|
213
|
+
*/
|
|
214
|
+
initializerLocation: TcbLocation;
|
|
215
|
+
}
|
|
191
216
|
/**
|
|
192
217
|
* A representation of an element in a component template.
|
|
193
218
|
*/
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
export { FileTypeCheckingData, TemplateTypeCheckerImpl } from './src/checker';
|
|
9
|
-
export { TypeCheckContextImpl } from './src/context';
|
|
9
|
+
export { TypeCheckContextImpl, getTemplateDiagnostics } from './src/context';
|
|
10
10
|
export { TypeCheckShimGenerator } from './src/shim';
|
|
11
11
|
export { typeCheckFilePath } from './src/type_check_file';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { AST, LiteralPrimitive, ParseSourceSpan, PropertyRead, SafePropertyRead, TmplAstElement, TmplAstNode,
|
|
8
|
+
import { AST, LiteralPrimitive, ParseSourceSpan, PropertyRead, SafePropertyRead, TemplateEntity, TmplAstElement, TmplAstNode, TmplAstTemplate, TmplAstTextAttribute } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { ErrorCode } from '../../diagnostics';
|
|
11
11
|
import { AbsoluteFsPath } from '../../file_system';
|
|
@@ -95,7 +95,7 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
|
|
|
95
95
|
getExpressionCompletionLocation(ast: PropertyRead | SafePropertyRead, component: ts.ClassDeclaration): TcbLocation | null;
|
|
96
96
|
getLiteralCompletionLocation(node: LiteralPrimitive | TmplAstTextAttribute, component: ts.ClassDeclaration): TcbLocation | null;
|
|
97
97
|
invalidateClass(clazz: ts.ClassDeclaration): void;
|
|
98
|
-
getExpressionTarget(expression: AST, clazz: ts.ClassDeclaration):
|
|
98
|
+
getExpressionTarget(expression: AST, clazz: ts.ClassDeclaration): TemplateEntity | null;
|
|
99
99
|
makeTemplateDiagnostic<T extends ErrorCode>(clazz: ts.ClassDeclaration, sourceSpan: ParseSourceSpan, category: ts.DiagnosticCategory, errorCode: T, message: string, relatedInformation?: {
|
|
100
100
|
text: string;
|
|
101
101
|
start: number;
|
|
@@ -183,5 +183,5 @@ export declare class TypeCheckContextImpl implements TypeCheckContext {
|
|
|
183
183
|
private addInlineTypeCheckBlock;
|
|
184
184
|
private pendingShimForComponent;
|
|
185
185
|
private dataForFile;
|
|
186
|
-
private getTemplateDiagnostics;
|
|
187
186
|
}
|
|
187
|
+
export declare function getTemplateDiagnostics(parseErrors: ParseError[], templateId: TemplateId, sourceMapping: TemplateSourceMapping): TemplateDiagnostic[];
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { BindingPipe, PropertyRead, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstElement, TmplAstForLoopBlock, TmplAstForLoopBlockEmpty, TmplAstHoverDeferredTrigger, TmplAstIfBlockBranch, TmplAstInteractionDeferredTrigger, TmplAstReference, TmplAstSwitchBlockCase, TmplAstTemplate, TmplAstVariable, TmplAstViewportDeferredTrigger } from '@angular/compiler';
|
|
8
|
+
import { BindingPipe, PropertyRead, PropertyWrite, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstElement, TmplAstForLoopBlock, TmplAstForLoopBlockEmpty, TmplAstHoverDeferredTrigger, TmplAstIfBlockBranch, TmplAstInteractionDeferredTrigger, TmplAstLetDeclaration, TmplAstReference, TmplAstSwitchBlockCase, TmplAstTemplate, TmplAstVariable, TmplAstViewportDeferredTrigger } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { ClassDeclaration } from '../../reflection';
|
|
11
11
|
import { TemplateDiagnostic, TemplateId } from '../api';
|
|
@@ -91,6 +91,18 @@ export interface OutOfBandDiagnosticRecorder {
|
|
|
91
91
|
* Reports cases where control flow nodes prevent content projection.
|
|
92
92
|
*/
|
|
93
93
|
controlFlowPreventingContentProjection(templateId: TemplateId, category: ts.DiagnosticCategory, projectionNode: TmplAstElement | TmplAstTemplate, componentName: string, slotSelector: string, controlFlowNode: TmplAstIfBlockBranch | TmplAstSwitchBlockCase | TmplAstForLoopBlock | TmplAstForLoopBlockEmpty, preservesWhitespaces: boolean): void;
|
|
94
|
+
/** Reports cases where users are writing to `@let` declarations. */
|
|
95
|
+
illegalWriteToLetDeclaration(templateId: TemplateId, node: PropertyWrite, target: TmplAstLetDeclaration): void;
|
|
96
|
+
/** Reports cases where users are accessing an `@let` before it is defined.. */
|
|
97
|
+
letUsedBeforeDefinition(templateId: TemplateId, node: PropertyRead, target: TmplAstLetDeclaration): void;
|
|
98
|
+
/**
|
|
99
|
+
* Reports a duplicate `@let` declaration within the same scope.
|
|
100
|
+
*
|
|
101
|
+
* @param templateId the template type-checking ID of the template which contains the duplicate
|
|
102
|
+
* declaration.
|
|
103
|
+
* @param current the `TmplAstLetDeclaration` which duplicates a previous declaration.
|
|
104
|
+
*/
|
|
105
|
+
duplicateLetDeclaration(templateId: TemplateId, current: TmplAstLetDeclaration): void;
|
|
94
106
|
}
|
|
95
107
|
export declare class OutOfBandDiagnosticRecorderImpl implements OutOfBandDiagnosticRecorder {
|
|
96
108
|
private resolver;
|
|
@@ -115,4 +127,7 @@ export declare class OutOfBandDiagnosticRecorderImpl implements OutOfBandDiagnos
|
|
|
115
127
|
illegalForLoopTrackAccess(templateId: TemplateId, block: TmplAstForLoopBlock, access: PropertyRead): void;
|
|
116
128
|
inaccessibleDeferredTriggerElement(templateId: TemplateId, trigger: TmplAstHoverDeferredTrigger | TmplAstInteractionDeferredTrigger | TmplAstViewportDeferredTrigger): void;
|
|
117
129
|
controlFlowPreventingContentProjection(templateId: TemplateId, category: ts.DiagnosticCategory, projectionNode: TmplAstElement | TmplAstTemplate, componentName: string, slotSelector: string, controlFlowNode: TmplAstIfBlockBranch | TmplAstSwitchBlockCase | TmplAstForLoopBlock | TmplAstForLoopBlockEmpty, preservesWhitespaces: boolean): void;
|
|
130
|
+
illegalWriteToLetDeclaration(templateId: TemplateId, node: PropertyWrite, target: TmplAstLetDeclaration): void;
|
|
131
|
+
letUsedBeforeDefinition(templateId: TemplateId, node: PropertyRead, target: TmplAstLetDeclaration): void;
|
|
132
|
+
duplicateLetDeclaration(templateId: TemplateId, current: TmplAstLetDeclaration): void;
|
|
118
133
|
}
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { AST, TmplAstElement, TmplAstNode, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
8
|
+
import { AST, TmplAstElement, TmplAstLetDeclaration, TmplAstNode, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { AbsoluteFsPath } from '../../file_system';
|
|
11
11
|
import { ComponentScopeReader } from '../../scope';
|
|
12
|
-
import { ElementSymbol, ReferenceSymbol, Symbol, TemplateSymbol, VariableSymbol } from '../api';
|
|
12
|
+
import { ElementSymbol, LetDeclarationSymbol, ReferenceSymbol, Symbol, TemplateSymbol, VariableSymbol } from '../api';
|
|
13
13
|
import { TemplateData } from './context';
|
|
14
14
|
/**
|
|
15
15
|
* Generates and caches `Symbol`s for various template structures for a given component.
|
|
@@ -27,7 +27,7 @@ export declare class SymbolBuilder {
|
|
|
27
27
|
private symbolCache;
|
|
28
28
|
constructor(tcbPath: AbsoluteFsPath, tcbIsShim: boolean, typeCheckBlock: ts.Node, templateData: TemplateData, componentScopeReader: ComponentScopeReader, getTypeChecker: () => ts.TypeChecker);
|
|
29
29
|
getSymbol(node: TmplAstTemplate | TmplAstElement): TemplateSymbol | ElementSymbol | null;
|
|
30
|
-
getSymbol(node: TmplAstReference | TmplAstVariable): ReferenceSymbol | VariableSymbol | null;
|
|
30
|
+
getSymbol(node: TmplAstReference | TmplAstVariable | TmplAstLetDeclaration): ReferenceSymbol | VariableSymbol | LetDeclarationSymbol | null;
|
|
31
31
|
getSymbol(node: AST | TmplAstNode): Symbol | null;
|
|
32
32
|
private getSymbolOfAstTemplate;
|
|
33
33
|
private getSymbolOfElement;
|
|
@@ -40,6 +40,7 @@ export declare class SymbolBuilder {
|
|
|
40
40
|
private getDirectiveSymbolForAccessExpression;
|
|
41
41
|
private getSymbolOfVariable;
|
|
42
42
|
private getSymbolOfReference;
|
|
43
|
+
private getSymbolOfLetDeclaration;
|
|
43
44
|
private getSymbolOfPipe;
|
|
44
45
|
private getSymbolOfTemplateExpression;
|
|
45
46
|
private getSymbolOfTsNode;
|
|
@@ -38,7 +38,7 @@ export declare function tsCreateTypeQueryForCoercedInput(typeName: ts.EntityName
|
|
|
38
38
|
* Unlike with `tsDeclareVariable`, the type of the variable is inferred from the initializer
|
|
39
39
|
* expression.
|
|
40
40
|
*/
|
|
41
|
-
export declare function tsCreateVariable(id: ts.Identifier, initializer: ts.Expression): ts.VariableStatement;
|
|
41
|
+
export declare function tsCreateVariable(id: ts.Identifier, initializer: ts.Expression, flags?: ts.NodeFlags | null): ts.VariableStatement;
|
|
42
42
|
/**
|
|
43
43
|
* Construct a `ts.CallExpression` that calls a method on a receiver.
|
|
44
44
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
import { BoundTarget, SchemaMetadata, TmplAstElement, TmplAstForLoopBlock, TmplAstIfBlockBranch, TmplAstNode, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
8
|
+
import { BoundTarget, SchemaMetadata, TmplAstElement, TmplAstForLoopBlock, TmplAstIfBlockBranch, TmplAstLetDeclaration, TmplAstNode, TmplAstReference, TmplAstTemplate, TmplAstVariable } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { Reference } from '../../imports';
|
|
11
11
|
import { PipeMeta } from '../../metadata';
|
|
@@ -64,6 +64,8 @@ export declare enum TcbGenericContextBehavior {
|
|
|
64
64
|
* bounds) will be referenced from the generated TCB code.
|
|
65
65
|
*/
|
|
66
66
|
export declare function generateTypeCheckBlock(env: Environment, ref: Reference<ClassDeclaration<ts.ClassDeclaration>>, name: ts.Identifier, meta: TypeCheckBlockMetadata, domSchemaChecker: DomSchemaChecker, oobRecorder: OutOfBandDiagnosticRecorder, genericContextBehavior: TcbGenericContextBehavior): ts.FunctionDeclaration;
|
|
67
|
+
/** Types that can referenced locally in a template. */
|
|
68
|
+
type LocalSymbol = TmplAstElement | TmplAstTemplate | TmplAstVariable | TmplAstLetDeclaration | TmplAstReference;
|
|
67
69
|
/**
|
|
68
70
|
* A code generation operation that's involved in the construction of a Type Check Block.
|
|
69
71
|
*
|
|
@@ -197,6 +199,12 @@ declare class Scope {
|
|
|
197
199
|
* pre-resolved variable identifiers.
|
|
198
200
|
*/
|
|
199
201
|
private varMap;
|
|
202
|
+
/**
|
|
203
|
+
* A map of the names of `TmplAstLetDeclaration`s to the index of their op in the `opQueue`.
|
|
204
|
+
*
|
|
205
|
+
* Assumes that there won't be duplicated `@let` declarations within the same scope.
|
|
206
|
+
*/
|
|
207
|
+
private letDeclOpMap;
|
|
200
208
|
/**
|
|
201
209
|
* Statements for this template.
|
|
202
210
|
*
|
|
@@ -235,12 +243,13 @@ declare class Scope {
|
|
|
235
243
|
* * `TmplAstElement` - retrieve the expression for the element DOM node
|
|
236
244
|
* * `TmplAstTemplate` - retrieve the template context variable
|
|
237
245
|
* * `TmplAstVariable` - retrieve a template let- variable
|
|
246
|
+
* * `TmplAstLetDeclaration` - retrieve a template `@let` declaration
|
|
238
247
|
* * `TmplAstReference` - retrieve variable created for the local ref
|
|
239
248
|
*
|
|
240
249
|
* @param directive if present, a directive type on a `TmplAstElement` or `TmplAstTemplate` to
|
|
241
250
|
* look up instead of the default for an element or template node.
|
|
242
251
|
*/
|
|
243
|
-
resolve(node:
|
|
252
|
+
resolve(node: LocalSymbol, directive?: TypeCheckableDirectiveMeta): ts.Identifier | ts.NonNullExpression;
|
|
244
253
|
/**
|
|
245
254
|
* Add a statement to this scope.
|
|
246
255
|
*/
|
|
@@ -254,6 +263,8 @@ declare class Scope {
|
|
|
254
263
|
* parent scopes. If no guards have been applied, null is returned.
|
|
255
264
|
*/
|
|
256
265
|
guards(): ts.Expression | null;
|
|
266
|
+
/** Returns whether a template symbol is defined locally within the current scope. */
|
|
267
|
+
isLocal(node: TmplAstVariable | TmplAstLetDeclaration | TmplAstReference): boolean;
|
|
257
268
|
private resolveLocal;
|
|
258
269
|
/**
|
|
259
270
|
* Like `executeOp`, but assert that the operation actually returned `ts.Expression`.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import {createRequire as __cjsCompatRequire} from 'module';
|
|
3
|
-
const require = __cjsCompatRequire(import.meta.url);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/checker.mjs
|
|
7
|
-
var OptimizeFor;
|
|
8
|
-
(function(OptimizeFor2) {
|
|
9
|
-
OptimizeFor2[OptimizeFor2["SingleFile"] = 0] = "SingleFile";
|
|
10
|
-
OptimizeFor2[OptimizeFor2["WholeProgram"] = 1] = "WholeProgram";
|
|
11
|
-
})(OptimizeFor || (OptimizeFor = {}));
|
|
12
|
-
|
|
13
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/scope.mjs
|
|
14
|
-
var PotentialImportKind;
|
|
15
|
-
(function(PotentialImportKind2) {
|
|
16
|
-
PotentialImportKind2[PotentialImportKind2["NgModule"] = 0] = "NgModule";
|
|
17
|
-
PotentialImportKind2[PotentialImportKind2["Standalone"] = 1] = "Standalone";
|
|
18
|
-
})(PotentialImportKind || (PotentialImportKind = {}));
|
|
19
|
-
var PotentialImportMode;
|
|
20
|
-
(function(PotentialImportMode2) {
|
|
21
|
-
PotentialImportMode2[PotentialImportMode2["Normal"] = 0] = "Normal";
|
|
22
|
-
PotentialImportMode2[PotentialImportMode2["ForceDirect"] = 1] = "ForceDirect";
|
|
23
|
-
})(PotentialImportMode || (PotentialImportMode = {}));
|
|
24
|
-
|
|
25
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/completion.mjs
|
|
26
|
-
var CompletionKind;
|
|
27
|
-
(function(CompletionKind2) {
|
|
28
|
-
CompletionKind2[CompletionKind2["Reference"] = 0] = "Reference";
|
|
29
|
-
CompletionKind2[CompletionKind2["Variable"] = 1] = "Variable";
|
|
30
|
-
})(CompletionKind || (CompletionKind = {}));
|
|
31
|
-
|
|
32
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/api/symbols.mjs
|
|
33
|
-
var SymbolKind;
|
|
34
|
-
(function(SymbolKind2) {
|
|
35
|
-
SymbolKind2[SymbolKind2["Input"] = 0] = "Input";
|
|
36
|
-
SymbolKind2[SymbolKind2["Output"] = 1] = "Output";
|
|
37
|
-
SymbolKind2[SymbolKind2["Binding"] = 2] = "Binding";
|
|
38
|
-
SymbolKind2[SymbolKind2["Reference"] = 3] = "Reference";
|
|
39
|
-
SymbolKind2[SymbolKind2["Variable"] = 4] = "Variable";
|
|
40
|
-
SymbolKind2[SymbolKind2["Directive"] = 5] = "Directive";
|
|
41
|
-
SymbolKind2[SymbolKind2["Element"] = 6] = "Element";
|
|
42
|
-
SymbolKind2[SymbolKind2["Template"] = 7] = "Template";
|
|
43
|
-
SymbolKind2[SymbolKind2["Expression"] = 8] = "Expression";
|
|
44
|
-
SymbolKind2[SymbolKind2["DomBinding"] = 9] = "DomBinding";
|
|
45
|
-
SymbolKind2[SymbolKind2["Pipe"] = 10] = "Pipe";
|
|
46
|
-
})(SymbolKind || (SymbolKind = {}));
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
OptimizeFor,
|
|
50
|
-
CompletionKind,
|
|
51
|
-
PotentialImportKind,
|
|
52
|
-
PotentialImportMode,
|
|
53
|
-
SymbolKind
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* @license
|
|
57
|
-
* Copyright Google LLC All Rights Reserved.
|
|
58
|
-
*
|
|
59
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
60
|
-
* found in the LICENSE file at https://angular.io/license
|
|
61
|
-
*/
|
|
62
|
-
//# sourceMappingURL=chunk-6AZ42I2O.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../packages/compiler-cli/src/ngtsc/typecheck/api/checker.ts", "../../../../../../packages/compiler-cli/src/ngtsc/typecheck/api/scope.ts", "../../../../../../packages/compiler-cli/src/ngtsc/typecheck/api/completion.ts", "../../../../../../packages/compiler-cli/src/ngtsc/typecheck/api/symbols.ts"],
|
|
4
|
-
"mappings": ";;;;;;AAuQA,IAAY;CAAZ,SAAYA,cAAW;AAQrB,EAAAA,aAAAA,aAAA,gBAAA,KAAA;AAUA,EAAAA,aAAAA,aAAA,kBAAA,KAAA;AACF,GAnBY,gBAAA,cAAW,CAAA,EAAA;;;AC1OvB,IAAY;CAAZ,SAAYC,sBAAmB;AAC7B,EAAAA,qBAAAA,qBAAA,cAAA,KAAA;AACA,EAAAA,qBAAAA,qBAAA,gBAAA,KAAA;AACF,GAHY,wBAAA,sBAAmB,CAAA,EAAA;AAmE/B,IAAY;CAAZ,SAAYC,sBAAmB;AAE7B,EAAAA,qBAAAA,qBAAA,YAAA,KAAA;AAOA,EAAAA,qBAAAA,qBAAA,iBAAA,KAAA;AACF,GAVY,wBAAA,sBAAmB,CAAA,EAAA;;;AC3E/B,IAAY;CAAZ,SAAYC,iBAAc;AACxB,EAAAA,gBAAAA,gBAAA,eAAA,KAAA;AACA,EAAAA,gBAAAA,gBAAA,cAAA,KAAA;AACF,GAHY,mBAAA,iBAAc,CAAA,EAAA;;;ACA1B,IAAY;CAAZ,SAAYC,aAAU;AACpB,EAAAA,YAAAA,YAAA,WAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,YAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,aAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,eAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,cAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,eAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,aAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,cAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,gBAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,gBAAA,KAAA;AACA,EAAAA,YAAAA,YAAA,UAAA,MAAA;AACF,GAZY,eAAA,aAAU,CAAA,EAAA;",
|
|
5
|
-
"names": ["OptimizeFor", "PotentialImportKind", "PotentialImportMode", "CompletionKind", "SymbolKind"]
|
|
6
|
-
}
|