@angular/compiler-cli 21.2.2 → 21.2.3
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-RJ3Y43GR.js → chunk-6JHVJEKD.js} +5 -5
- package/bundles/chunk-FLWAEX6T.js +1 -1
- package/bundles/{chunk-SPPRVX7S.js → chunk-KJC7YNMY.js} +2 -2
- package/bundles/{chunk-OECV6WLT.js → chunk-L3PEIUBN.js} +723 -440
- package/bundles/{chunk-32EO3D75.js → chunk-NU2SXS64.js} +1 -1
- package/bundles/index.js +4 -4
- package/bundles/private/migrations.js +2 -2
- package/bundles/private/testing.js +1 -1
- package/bundles/private/tooling.js +1 -1
- package/bundles/src/bin/ng_xi18n.js +4 -4
- package/bundles/src/bin/ngc.js +4 -4
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/common/src/diagnostics.d.ts +7 -7
- package/src/ngtsc/core/api/src/adapter.d.ts +1 -1
- package/src/ngtsc/incremental/src/incremental.d.ts +1 -1
- package/src/ngtsc/typecheck/api/api.d.ts +80 -4
- package/src/ngtsc/typecheck/src/checker.d.ts +1 -1
- package/src/ngtsc/typecheck/src/context.d.ts +1 -1
- package/src/ngtsc/typecheck/src/environment.d.ts +4 -3
- package/src/ngtsc/typecheck/src/oob.d.ts +5 -4
- package/src/ngtsc/typecheck/src/ops/bindings.d.ts +3 -5
- package/src/ngtsc/typecheck/src/ops/context.d.ts +4 -5
- package/src/ngtsc/typecheck/src/ops/directive_constructor.d.ts +3 -3
- package/src/ngtsc/typecheck/src/ops/directive_type.d.ts +3 -3
- package/src/ngtsc/typecheck/src/ops/events.d.ts +2 -2
- package/src/ngtsc/typecheck/src/ops/inputs.d.ts +2 -2
- package/src/ngtsc/typecheck/src/ops/references.d.ts +2 -2
- package/src/ngtsc/typecheck/src/ops/scope.d.ts +2 -2
- package/src/ngtsc/typecheck/src/ops/signal_forms.d.ts +6 -6
- package/src/ngtsc/typecheck/src/reference_emit_environment.d.ts +18 -1
- package/src/ngtsc/typecheck/src/tcb_adapter.d.ts +20 -0
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +2 -1
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +2 -4
- package/src/ngtsc/typecheck/src/type_check_file.d.ts +1 -0
- package/src/ngtsc/typecheck/src/type_constructor.d.ts +2 -2
|
@@ -10,6 +10,7 @@ import ts from 'typescript';
|
|
|
10
10
|
import { ImportFlags, Reference, ReferenceEmitter } from '../../imports';
|
|
11
11
|
import { ReflectionHost } from '../../reflection';
|
|
12
12
|
import { ImportManager } from '../../translator';
|
|
13
|
+
import { TcbReferenceMetadata } from '../api';
|
|
13
14
|
import { TcbExpr } from './ops/codegen';
|
|
14
15
|
/**
|
|
15
16
|
* An environment for a given source file that can be used to emit references.
|
|
@@ -19,7 +20,7 @@ import { TcbExpr } from './ops/codegen';
|
|
|
19
20
|
*/
|
|
20
21
|
export declare class ReferenceEmitEnvironment {
|
|
21
22
|
readonly importManager: ImportManager;
|
|
22
|
-
|
|
23
|
+
refEmitter: ReferenceEmitter;
|
|
23
24
|
readonly reflector: ReflectionHost;
|
|
24
25
|
contextFile: ts.SourceFile;
|
|
25
26
|
constructor(importManager: ImportManager, refEmitter: ReferenceEmitter, reflector: ReflectionHost, contextFile: ts.SourceFile);
|
|
@@ -30,6 +31,22 @@ export declare class ReferenceEmitEnvironment {
|
|
|
30
31
|
* This may involve importing the node into the file if it's not declared there already.
|
|
31
32
|
*/
|
|
32
33
|
referenceType(ref: Reference, flags?: ImportFlags): ts.TypeNode;
|
|
34
|
+
/**
|
|
35
|
+
* Generates a `ts.TypeNode` from a `TcbReferenceMetadata` object.
|
|
36
|
+
* This is used by the TCB operations which do not hold on to the original `ts.Declaration`.
|
|
37
|
+
*
|
|
38
|
+
* Note: It's important that we do not try to evaluate the `typeParameters` here and pad them
|
|
39
|
+
* out with `any` type arguments. If we supply `any` to a generic pipe (e.g. `var _pipe1: MyPipe<any>;`),
|
|
40
|
+
* it destroys the generic constraints and degrades the `transform` signature. When they are omitted
|
|
41
|
+
* entirely, TypeScript implicitly flags an error, which the Angular compiler filters out, and
|
|
42
|
+
* crucially recovers by falling back to constraint inference (e.g. `var _pipe1: MyPipe;` infers
|
|
43
|
+
* bounds safely).
|
|
44
|
+
*/
|
|
45
|
+
referenceTcbType(ref: TcbReferenceMetadata): ts.TypeNode;
|
|
46
|
+
/**
|
|
47
|
+
* Generates a `TcbExpr` from a `TcbReferenceMetadata` object.
|
|
48
|
+
*/
|
|
49
|
+
referenceTcbValue(ref: TcbReferenceMetadata): TcbExpr;
|
|
33
50
|
referenceExternalSymbol(moduleName: string, name: string): TcbExpr;
|
|
34
51
|
/**
|
|
35
52
|
* Generate a `ts.TypeNode` that references a given type from the provided module.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { TypeCheckBlockMetadata, TcbTypeCheckBlockMetadata, TcbComponentMetadata } from '../api';
|
|
9
|
+
import { Environment } from './environment';
|
|
10
|
+
import { Reference } from '../../imports';
|
|
11
|
+
import { ClassDeclaration } from '../../reflection';
|
|
12
|
+
import ts from 'typescript';
|
|
13
|
+
/**
|
|
14
|
+
* Adapts the compiler's `TypeCheckBlockMetadata` (which includes full TS AST nodes)
|
|
15
|
+
* into a purely detached `TcbTypeCheckBlockMetadata` that can be mapped to JSON.
|
|
16
|
+
*/
|
|
17
|
+
export declare function adaptTypeCheckBlockMetadata(ref: Reference<ClassDeclaration<ts.ClassDeclaration>>, meta: TypeCheckBlockMetadata, env: Environment): {
|
|
18
|
+
tcbMeta: TcbTypeCheckBlockMetadata;
|
|
19
|
+
component: TcbComponentMetadata;
|
|
20
|
+
};
|
|
@@ -9,7 +9,7 @@ import { AbsoluteSourceSpan, ParseSourceSpan } from '@angular/compiler';
|
|
|
9
9
|
import ts from 'typescript';
|
|
10
10
|
import { ClassDeclaration, ReflectionHost } from '../../../../src/ngtsc/reflection';
|
|
11
11
|
import { Reference } from '../../imports';
|
|
12
|
-
import { FullSourceMapping, SourceLocation, TypeCheckId, SourceMapping } from '../api';
|
|
12
|
+
import { FullSourceMapping, SourceLocation, TypeCheckId, SourceMapping, TcbTypeParameter } from '../api';
|
|
13
13
|
import { ReferenceEmitEnvironment } from './reference_emit_environment';
|
|
14
14
|
/**
|
|
15
15
|
* Adapter interface which allows the directive type-checking diagnostics code to interpret offsets
|
|
@@ -78,3 +78,4 @@ export declare function ensureTypeCheckFilePreparationImports(env: ReferenceEmit
|
|
|
78
78
|
export declare function checkIfGenericTypeBoundsCanBeEmitted(node: ClassDeclaration<ts.ClassDeclaration>, reflector: ReflectionHost, env: ReferenceEmitEnvironment): boolean;
|
|
79
79
|
export declare function findNodeInFile<T extends ts.Node>(file: ts.SourceFile, predicate: (node: ts.Node) => node is T): T | null;
|
|
80
80
|
export declare function findNodeInFile(file: ts.SourceFile, predicate: (node: ts.Node) => boolean): ts.Node | null;
|
|
81
|
+
export declare function generateTcbTypeParameters(typeParameters: ReadonlyArray<ts.TypeParameterDeclaration>, sourceFile: ts.SourceFile): TcbTypeParameter[];
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
|
-
import {
|
|
10
|
-
import { ClassDeclaration } from '../../reflection';
|
|
11
|
-
import { TypeCheckBlockMetadata } from '../api';
|
|
9
|
+
import { TcbComponentMetadata, TcbTypeCheckBlockMetadata } from '../api';
|
|
12
10
|
import { DomSchemaChecker } from './dom';
|
|
13
11
|
import { Environment } from './environment';
|
|
14
12
|
import { OutOfBandDiagnosticRecorder } from './oob';
|
|
@@ -37,4 +35,4 @@ import { TcbGenericContextBehavior } from './ops/context';
|
|
|
37
35
|
* @param genericContextBehavior controls how generic parameters (especially parameters with generic
|
|
38
36
|
* bounds) will be referenced from the generated TCB code.
|
|
39
37
|
*/
|
|
40
|
-
export declare function generateTypeCheckBlock(env: Environment,
|
|
38
|
+
export declare function generateTypeCheckBlock(env: Environment, component: TcbComponentMetadata, name: ts.Identifier, meta: TcbTypeCheckBlockMetadata, domSchemaChecker: DomSchemaChecker, oobRecorder: OutOfBandDiagnosticRecorder, genericContextBehavior: TcbGenericContextBehavior): string;
|
|
@@ -25,6 +25,7 @@ import { TcbExpr } from './ops/codegen';
|
|
|
25
25
|
*/
|
|
26
26
|
export declare class TypeCheckFile extends Environment {
|
|
27
27
|
readonly fileName: AbsoluteFsPath;
|
|
28
|
+
readonly isTypeCheckFile = true;
|
|
28
29
|
private nextTcbId;
|
|
29
30
|
private tcbStatements;
|
|
30
31
|
constructor(fileName: AbsoluteFsPath, config: TypeCheckingConfig, refEmitter: ReferenceEmitter, reflector: ReflectionHost, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
9
|
import { ClassDeclaration, ReflectionHost } from '../../reflection';
|
|
10
|
-
import { TypeCtorMetadata } from '../api';
|
|
10
|
+
import { TypeCtorMetadata, TcbTypeParameter } from '../api';
|
|
11
11
|
import { ReferenceEmitEnvironment } from './reference_emit_environment';
|
|
12
12
|
import { TcbExpr } from './ops/codegen';
|
|
13
|
-
export declare function generateTypeCtorDeclarationFn(env: ReferenceEmitEnvironment, meta: TypeCtorMetadata, nodeTypeRef: ts.EntityName, typeParams:
|
|
13
|
+
export declare function generateTypeCtorDeclarationFn(env: ReferenceEmitEnvironment, meta: TypeCtorMetadata, nodeTypeRef: ts.EntityName, typeParams: TcbTypeParameter[] | undefined): TcbExpr;
|
|
14
14
|
/**
|
|
15
15
|
* Generate an inline type constructor for the given class and metadata.
|
|
16
16
|
*
|