@angular/compiler-cli 22.0.0-next.2 → 22.0.0-next.4
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-M42SPZWZ.js → chunk-33PKOB6H.js} +5 -4
- package/bundles/chunk-33PKOB6H.js.map +6 -0
- package/bundles/{chunk-RA2TLETR.js → chunk-6IEU2J75.js} +38 -7
- package/bundles/chunk-6IEU2J75.js.map +6 -0
- package/bundles/{chunk-FLWAEX6T.js → chunk-AI2LKYE3.js} +4 -3
- package/bundles/chunk-AI2LKYE3.js.map +6 -0
- package/bundles/{chunk-OBSXELUC.js → chunk-ARNGIZEA.js} +48 -50
- package/bundles/chunk-ARNGIZEA.js.map +6 -0
- package/bundles/{chunk-2KXHLD7K.js → chunk-BCQGTZBZ.js} +128 -92
- package/bundles/chunk-BCQGTZBZ.js.map +6 -0
- package/bundles/{chunk-G7GFT6BU.js → chunk-IEBNHER4.js} +1 -0
- package/bundles/chunk-IEBNHER4.js.map +6 -0
- package/bundles/{chunk-XYYEESKY.js → chunk-KWAGEHJJ.js} +2 -1
- package/bundles/chunk-KWAGEHJJ.js.map +6 -0
- package/bundles/{chunk-CSUVPNMK.js → chunk-L35AQF75.js} +84 -36
- package/bundles/chunk-L35AQF75.js.map +6 -0
- package/bundles/{chunk-6HOSNZU5.js → chunk-SEJGUMO2.js} +1 -0
- package/bundles/chunk-SEJGUMO2.js.map +6 -0
- package/bundles/{chunk-NUARCIAS.js → chunk-TXJNNYJ4.js} +2 -1
- package/bundles/chunk-TXJNNYJ4.js.map +6 -0
- package/bundles/{chunk-CEBE44Q5.js → chunk-UTWH365F.js} +1 -0
- package/bundles/chunk-UTWH365F.js.map +6 -0
- package/bundles/{chunk-HYJ2H3FU.js → chunk-Y5V7YWTG.js} +1 -0
- package/bundles/chunk-Y5V7YWTG.js.map +6 -0
- package/bundles/index.js +11 -10
- package/bundles/index.js.map +6 -0
- package/bundles/linker/babel/index.js +74 -16
- package/bundles/linker/babel/index.js.map +6 -0
- package/bundles/linker/index.js +5 -4
- package/bundles/linker/index.js.map +6 -0
- package/bundles/private/hybrid_analysis.js +6 -5
- package/bundles/private/hybrid_analysis.js.map +6 -0
- package/bundles/private/localize.js +6 -5
- package/bundles/private/localize.js.map +6 -0
- package/bundles/private/migrations.js +8 -7
- package/bundles/private/migrations.js.map +6 -0
- package/bundles/private/testing.js +42 -14
- package/bundles/private/testing.js.map +6 -0
- package/bundles/private/tooling.js +7 -6
- package/bundles/private/tooling.js.map +6 -0
- package/bundles/src/bin/ng_xi18n.js +10 -9
- package/bundles/src/bin/ng_xi18n.js.map +6 -0
- package/bundles/src/bin/ngc.js +10 -9
- package/bundles/src/bin/ngc.js.map +6 -0
- package/linker/babel/src/ast/babel_ast_factory.d.ts +15 -8
- package/linker/src/file_linker/emit_scopes/emit_scope.d.ts +3 -3
- package/linker/src/file_linker/emit_scopes/local_emit_scope.d.ts +1 -1
- package/linker/src/file_linker/file_linker.d.ts +2 -2
- package/linker/src/file_linker/linker_environment.d.ts +4 -4
- package/linker/src/file_linker/partial_linkers/partial_linker_selector.d.ts +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/linker/src/file_linker/translator.d.ts +2 -2
- package/linker/src/linker_import_generator.d.ts +2 -2
- package/package.json +2 -2
- package/src/ngtsc/file_system/testing/index.d.ts +1 -1
- package/src/ngtsc/file_system/testing/src/test_helper.d.ts +1 -0
- package/src/ngtsc/translator/src/api/ast_factory.d.ts +38 -6
- package/src/ngtsc/translator/src/translator.d.ts +8 -2
- package/src/ngtsc/translator/src/typescript_ast_factory.d.ts +12 -6
- package/src/ngtsc/typecheck/api/api.d.ts +2 -1
- package/src/ngtsc/typecheck/src/tcb_adapter.d.ts +2 -1
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +1 -2
|
@@ -122,13 +122,13 @@ import {
|
|
|
122
122
|
validateHostDirectives,
|
|
123
123
|
wrapFunctionExpressionsInParens,
|
|
124
124
|
wrapTypeReference
|
|
125
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-BCQGTZBZ.js";
|
|
126
126
|
import {
|
|
127
127
|
absoluteFrom,
|
|
128
128
|
absoluteFromSourceFile,
|
|
129
129
|
getSourceFileOrError,
|
|
130
130
|
relative
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-UTWH365F.js";
|
|
132
132
|
|
|
133
133
|
// packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.js
|
|
134
134
|
import ts from "typescript";
|
|
@@ -5134,8 +5134,9 @@ import ts18 from "typescript";
|
|
|
5134
5134
|
// packages/compiler-cli/src/ngtsc/typecheck/src/tcb_adapter.js
|
|
5135
5135
|
import { AbsoluteSourceSpan, ExternalExpr as ExternalExpr4, TransplantedType, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
5136
5136
|
import ts15 from "typescript";
|
|
5137
|
-
function adaptTypeCheckBlockMetadata(ref, meta, env) {
|
|
5137
|
+
function adaptTypeCheckBlockMetadata(ref, meta, env, genericContextBehavior) {
|
|
5138
5138
|
const refCache = /* @__PURE__ */ new Map();
|
|
5139
|
+
const dirCache = /* @__PURE__ */ new Map();
|
|
5139
5140
|
const extractRef = (ref2) => {
|
|
5140
5141
|
if (refCache.has(ref2)) {
|
|
5141
5142
|
return refCache.get(ref2);
|
|
@@ -5144,7 +5145,6 @@ function adaptTypeCheckBlockMetadata(ref, meta, env) {
|
|
|
5144
5145
|
refCache.set(ref2, result);
|
|
5145
5146
|
return result;
|
|
5146
5147
|
};
|
|
5147
|
-
const dirCache = /* @__PURE__ */ new Map();
|
|
5148
5148
|
const convertDir = (dir) => {
|
|
5149
5149
|
if (dirCache.has(dir))
|
|
5150
5150
|
return dirCache.get(dir);
|
|
@@ -5185,36 +5185,21 @@ function adaptTypeCheckBlockMetadata(ref, meta, env) {
|
|
|
5185
5185
|
publicMethods: dir.publicMethods,
|
|
5186
5186
|
ref: extractRef(dir.ref),
|
|
5187
5187
|
isGeneric: dir.isGeneric,
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
if (!node.typeParameters) {
|
|
5191
|
-
return null;
|
|
5192
|
-
}
|
|
5193
|
-
const emitter = new TypeParameterEmitter(node.typeParameters, env.reflector);
|
|
5194
|
-
let emitted;
|
|
5195
|
-
if (!emitter.canEmit((ref2) => env.canReferenceType(ref2))) {
|
|
5196
|
-
emitted = [...node.typeParameters];
|
|
5197
|
-
} else {
|
|
5198
|
-
emitted = emitter.emit((ref2) => env.referenceType(ref2));
|
|
5199
|
-
}
|
|
5200
|
-
return generateTcbTypeParameters(emitted || [], env.contextFile);
|
|
5201
|
-
})(),
|
|
5202
|
-
hasRequiresInlineTypeCtor: requiresInlineTypeCtor(dir.ref.node, env.reflector, env)
|
|
5188
|
+
requiresInlineTypeCtor: requiresInlineTypeCtor(dir.ref.node, env.reflector, env),
|
|
5189
|
+
...adaptGenerics(dir.ref.node, env, TcbGenericContextBehavior.UseEmitter)
|
|
5203
5190
|
};
|
|
5204
5191
|
dirCache.set(dir, tcbDir);
|
|
5205
5192
|
return tcbDir;
|
|
5206
5193
|
};
|
|
5194
|
+
const originalBoundTarget = meta.boundTarget.target;
|
|
5207
5195
|
const adaptedBoundTarget = {
|
|
5208
|
-
target:
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
} : void 0
|
|
5216
|
-
};
|
|
5217
|
-
})(),
|
|
5196
|
+
target: {
|
|
5197
|
+
template: originalBoundTarget.template,
|
|
5198
|
+
host: originalBoundTarget.host ? {
|
|
5199
|
+
node: originalBoundTarget.host.node,
|
|
5200
|
+
directives: originalBoundTarget.host.directives.map(convertDir)
|
|
5201
|
+
} : void 0
|
|
5202
|
+
},
|
|
5218
5203
|
getUsedDirectives: () => meta.boundTarget.getUsedDirectives().map(convertDir),
|
|
5219
5204
|
getEagerlyUsedDirectives: () => meta.boundTarget.getEagerlyUsedDirectives().map(convertDir),
|
|
5220
5205
|
getUsedPipes: () => meta.boundTarget.getUsedPipes(),
|
|
@@ -5272,25 +5257,37 @@ function adaptTypeCheckBlockMetadata(ref, meta, env) {
|
|
|
5272
5257
|
isStandalone: meta.isStandalone,
|
|
5273
5258
|
preserveWhitespaces: meta.preserveWhitespaces
|
|
5274
5259
|
},
|
|
5275
|
-
component:
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
if (!ref.node.typeParameters)
|
|
5280
|
-
return null;
|
|
5281
|
-
const emitter = new TypeParameterEmitter(ref.node.typeParameters, env.reflector);
|
|
5282
|
-
let emitted;
|
|
5283
|
-
if (!emitter.canEmit((r) => env.canReferenceType(r))) {
|
|
5284
|
-
emitted = [...ref.node.typeParameters];
|
|
5285
|
-
} else {
|
|
5286
|
-
emitted = emitter.emit((r) => env.referenceType(r));
|
|
5287
|
-
}
|
|
5288
|
-
return generateTcbTypeParameters(emitted || [], env.contextFile);
|
|
5289
|
-
})()
|
|
5290
|
-
};
|
|
5291
|
-
})()
|
|
5260
|
+
component: {
|
|
5261
|
+
ref: extractRef(ref),
|
|
5262
|
+
...adaptGenerics(ref.node, env, env.config.useContextGenericType ? genericContextBehavior : TcbGenericContextBehavior.FallbackToAny)
|
|
5263
|
+
}
|
|
5292
5264
|
};
|
|
5293
5265
|
}
|
|
5266
|
+
function adaptGenerics(node, env, genericContextBehavior) {
|
|
5267
|
+
let typeParameters;
|
|
5268
|
+
let typeArguments;
|
|
5269
|
+
if (node.typeParameters !== void 0 && node.typeParameters.length > 0) {
|
|
5270
|
+
switch (genericContextBehavior) {
|
|
5271
|
+
case TcbGenericContextBehavior.UseEmitter:
|
|
5272
|
+
const emitter = new TypeParameterEmitter(node.typeParameters, env.reflector);
|
|
5273
|
+
const emittedParams = emitter.canEmit((r) => env.canReferenceType(r)) ? emitter.emit((typeRef) => env.referenceType(typeRef)) : void 0;
|
|
5274
|
+
typeParameters = generateTcbTypeParameters(emittedParams || node.typeParameters, env.contextFile);
|
|
5275
|
+
typeArguments = typeParameters.map((param) => param.name);
|
|
5276
|
+
break;
|
|
5277
|
+
case TcbGenericContextBehavior.CopyClassNodes:
|
|
5278
|
+
typeParameters = generateTcbTypeParameters(node.typeParameters, env.contextFile);
|
|
5279
|
+
typeArguments = typeParameters.map((param) => param.name);
|
|
5280
|
+
break;
|
|
5281
|
+
case TcbGenericContextBehavior.FallbackToAny:
|
|
5282
|
+
typeParameters = generateTcbTypeParameters(node.typeParameters, env.contextFile);
|
|
5283
|
+
typeArguments = new Array(node.typeParameters.length).fill("any");
|
|
5284
|
+
break;
|
|
5285
|
+
}
|
|
5286
|
+
} else {
|
|
5287
|
+
typeParameters = typeArguments = null;
|
|
5288
|
+
}
|
|
5289
|
+
return { typeParameters, typeArguments };
|
|
5290
|
+
}
|
|
5294
5291
|
function extractReferenceMetadata(ref, env) {
|
|
5295
5292
|
let name = ref.debugName || ref.node.name.text;
|
|
5296
5293
|
let moduleName = ref.ownedByModuleGuess;
|
|
@@ -5371,8 +5368,8 @@ var TypeCheckFile = class extends Environment {
|
|
|
5371
5368
|
}
|
|
5372
5369
|
addTypeCheckBlock(ref, meta, domSchemaChecker, oobRecorder, genericContextBehavior) {
|
|
5373
5370
|
const fnId = `_tcb${this.nextTcbId++}`;
|
|
5374
|
-
const { tcbMeta, component } = adaptTypeCheckBlockMetadata(ref, meta, this);
|
|
5375
|
-
const fn = generateTypeCheckBlock(this, component, fnId, tcbMeta, domSchemaChecker, oobRecorder
|
|
5371
|
+
const { tcbMeta, component } = adaptTypeCheckBlockMetadata(ref, meta, this, genericContextBehavior);
|
|
5372
|
+
const fn = generateTypeCheckBlock(this, component, fnId, tcbMeta, domSchemaChecker, oobRecorder);
|
|
5376
5373
|
this.tcbStatements.push(fn);
|
|
5377
5374
|
}
|
|
5378
5375
|
render() {
|
|
@@ -5699,8 +5696,8 @@ var InlineTcbOp = class {
|
|
|
5699
5696
|
execute(im, sf, refEmitter) {
|
|
5700
5697
|
const env = new Environment(this.config, im, refEmitter, this.reflector, sf);
|
|
5701
5698
|
const fnName = `_tcb_${this.ref.node.pos}`;
|
|
5702
|
-
const { tcbMeta, component } = adaptTypeCheckBlockMetadata(this.ref, this.meta, env);
|
|
5703
|
-
const fn = generateTypeCheckBlock(env, component, fnName, tcbMeta, this.domSchemaChecker, this.oobRecorder
|
|
5699
|
+
const { tcbMeta, component } = adaptTypeCheckBlockMetadata(this.ref, this.meta, env, TcbGenericContextBehavior.CopyClassNodes);
|
|
5700
|
+
const fn = generateTypeCheckBlock(env, component, fnName, tcbMeta, this.domSchemaChecker, this.oobRecorder);
|
|
5704
5701
|
return fn;
|
|
5705
5702
|
}
|
|
5706
5703
|
};
|
|
@@ -11369,3 +11366,4 @@ export {
|
|
|
11369
11366
|
* Use of this source code is governed by an MIT-style license that can be
|
|
11370
11367
|
* found in the LICENSE file at https://angular.dev/license
|
|
11371
11368
|
*/
|
|
11369
|
+
//# sourceMappingURL=chunk-ARNGIZEA.js.map
|