@angular/compiler-cli 13.0.0-rc.1 → 13.0.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/index.js +49 -49
- package/bundles/index.js.map +2 -2
- package/bundles/linker/babel/index.js +12 -12
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +12 -12
- package/bundles/linker/index.js.map +1 -1
- package/bundles/ngcc/index.js +124 -127
- package/bundles/ngcc/index.js.map +2 -2
- package/bundles/ngcc/main-ngcc.js +124 -127
- package/bundles/ngcc/main-ngcc.js.map +2 -2
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +28 -44
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +2 -2
- package/bundles/private/migrations.js +8 -6
- package/bundles/private/migrations.js.map +2 -2
- package/bundles/src/bin/ng_xi18n.js +48 -48
- package/bundles/src/bin/ng_xi18n.js.map +2 -2
- package/bundles/src/bin/ngc.js +48 -48
- package/bundles/src/bin/ngc.js.map +2 -2
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +2 -2
- package/linker/src/file_linker/translator.d.ts +1 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/ngcc/src/packages/entry_point.d.ts +5 -0
- package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/src/ng_module.d.ts +1 -2
- package/src/ngtsc/diagnostics/index.d.ts +4 -2
- package/src/ngtsc/diagnostics/src/docs.d.ts +14 -0
- package/src/ngtsc/diagnostics/src/error_details_base_url.d.ts +16 -0
- package/src/ngtsc/diagnostics/src/util.d.ts +2 -0
- package/src/ngtsc/typecheck/api/checker.d.ts +1 -1
- package/src/ngtsc/typecheck/src/tcb_util.d.ts +1 -1
|
@@ -556,9 +556,6 @@ import {
|
|
|
556
556
|
import { isSyntaxError as isSyntaxError2 } from "@angular/compiler";
|
|
557
557
|
import ts86 from "typescript";
|
|
558
558
|
|
|
559
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
560
|
-
import ts2 from "typescript";
|
|
561
|
-
|
|
562
559
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.mjs
|
|
563
560
|
var ErrorCode;
|
|
564
561
|
(function(ErrorCode2) {
|
|
@@ -609,6 +606,8 @@ var ErrorCode;
|
|
|
609
606
|
ErrorCode2[ErrorCode2["SUGGEST_STRICT_TEMPLATES"] = 10001] = "SUGGEST_STRICT_TEMPLATES";
|
|
610
607
|
ErrorCode2[ErrorCode2["SUGGEST_SUBOPTIMAL_TYPE_INFERENCE"] = 10002] = "SUGGEST_SUBOPTIMAL_TYPE_INFERENCE";
|
|
611
608
|
})(ErrorCode || (ErrorCode = {}));
|
|
609
|
+
|
|
610
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/docs.mjs
|
|
612
611
|
var COMPILER_ERRORS_WITH_GUIDES = new Set([
|
|
613
612
|
ErrorCode.DECORATOR_ARG_NOT_LITERAL,
|
|
614
613
|
ErrorCode.IMPORT_CYCLE_DETECTED,
|
|
@@ -618,6 +617,15 @@ var COMPILER_ERRORS_WITH_GUIDES = new Set([
|
|
|
618
617
|
ErrorCode.MISSING_REFERENCE_TARGET,
|
|
619
618
|
ErrorCode.COMPONENT_INVALID_SHADOW_DOM_SELECTOR
|
|
620
619
|
]);
|
|
620
|
+
|
|
621
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
|
|
622
|
+
import ts2 from "typescript";
|
|
623
|
+
|
|
624
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/util.mjs
|
|
625
|
+
var ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
|
|
626
|
+
function replaceTsWithNgInErrors(errors) {
|
|
627
|
+
return errors.replace(ERROR_CODE_MATCHER, "$1NG$2");
|
|
628
|
+
}
|
|
621
629
|
function ngErrorCode(code) {
|
|
622
630
|
return parseInt("-99" + code);
|
|
623
631
|
}
|
|
@@ -662,12 +670,6 @@ function isFatalDiagnosticError(err) {
|
|
|
662
670
|
return err._isFatalDiagnosticError === true;
|
|
663
671
|
}
|
|
664
672
|
|
|
665
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/util.mjs
|
|
666
|
-
var ERROR_CODE_MATCHER = /(\u001b\[\d+m ?)TS-99(\d+: ?\u001b\[\d+m)/g;
|
|
667
|
-
function replaceTsWithNgInErrors(errors) {
|
|
668
|
-
return errors.replace(ERROR_CODE_MATCHER, "$1NG$2");
|
|
669
|
-
}
|
|
670
|
-
|
|
671
673
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
672
674
|
var UNKNOWN_ERROR_CODE = 500;
|
|
673
675
|
var EmitFlags;
|
|
@@ -5191,7 +5193,7 @@ function getInheritedUndecoratedCtorDiagnostic(node, baseClass, reader) {
|
|
|
5191
5193
|
}
|
|
5192
5194
|
|
|
5193
5195
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/directive.mjs
|
|
5194
|
-
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr5, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
5196
|
+
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr5, FactoryTarget, getSafePropertyAccessString, makeBindingParser, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
5195
5197
|
import ts37 from "typescript";
|
|
5196
5198
|
|
|
5197
5199
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/factory.mjs
|
|
@@ -5601,17 +5603,17 @@ function extractDirectiveMetadata(clazz, decorator, reflector, evaluator, isCore
|
|
|
5601
5603
|
};
|
|
5602
5604
|
}
|
|
5603
5605
|
function extractQueryMetadata(exprNode, name, args, propertyName, reflector, evaluator) {
|
|
5604
|
-
var _a;
|
|
5605
5606
|
if (args.length === 0) {
|
|
5606
5607
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, exprNode, `@${name} must have arguments`);
|
|
5607
5608
|
}
|
|
5608
5609
|
const first = name === "ViewChild" || name === "ContentChild";
|
|
5609
|
-
const
|
|
5610
|
+
const forwardReferenceTarget = tryUnwrapForwardRef(args[0], reflector);
|
|
5611
|
+
const node = forwardReferenceTarget != null ? forwardReferenceTarget : args[0];
|
|
5610
5612
|
const arg = evaluator.evaluate(node);
|
|
5611
5613
|
let isStatic = false;
|
|
5612
5614
|
let predicate = null;
|
|
5613
5615
|
if (arg instanceof Reference || arg instanceof DynamicValue) {
|
|
5614
|
-
predicate = new WrappedNodeExpr4(node);
|
|
5616
|
+
predicate = createMayBeForwardRefExpression(new WrappedNodeExpr4(node), forwardReferenceTarget !== null ? 2 : 0);
|
|
5615
5617
|
} else if (typeof arg === "string") {
|
|
5616
5618
|
predicate = [arg];
|
|
5617
5619
|
} else if (isStringArrayOrDie(arg, `@${name} predicate`, node)) {
|
|
@@ -5856,7 +5858,7 @@ var QUERY_TYPES = new Set([
|
|
|
5856
5858
|
]);
|
|
5857
5859
|
|
|
5858
5860
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/ng_module.mjs
|
|
5859
|
-
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, CUSTOM_ELEMENTS_SCHEMA, ExternalExpr as ExternalExpr6, FactoryTarget as FactoryTarget2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2,
|
|
5861
|
+
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, CUSTOM_ELEMENTS_SCHEMA, ExternalExpr as ExternalExpr6, FactoryTarget as FactoryTarget2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, NO_ERRORS_SCHEMA, R3Identifiers, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
5860
5862
|
import ts38 from "typescript";
|
|
5861
5863
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
5862
5864
|
constructor() {
|
|
@@ -5903,7 +5905,7 @@ var NgModuleSymbol = class extends SemanticSymbol {
|
|
|
5903
5905
|
}
|
|
5904
5906
|
};
|
|
5905
5907
|
var NgModuleDecoratorHandler = class {
|
|
5906
|
-
constructor(reflector, evaluator, metaReader, metaRegistry, scopeRegistry, referencesRegistry, isCore, refEmitter, factoryTracker, annotateForClosureCompiler, injectableRegistry, perf
|
|
5908
|
+
constructor(reflector, evaluator, metaReader, metaRegistry, scopeRegistry, referencesRegistry, isCore, refEmitter, factoryTracker, annotateForClosureCompiler, injectableRegistry, perf) {
|
|
5907
5909
|
this.reflector = reflector;
|
|
5908
5910
|
this.evaluator = evaluator;
|
|
5909
5911
|
this.metaReader = metaReader;
|
|
@@ -5916,7 +5918,6 @@ var NgModuleDecoratorHandler = class {
|
|
|
5916
5918
|
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
5917
5919
|
this.injectableRegistry = injectableRegistry;
|
|
5918
5920
|
this.perf = perf;
|
|
5919
|
-
this.localeId = localeId;
|
|
5920
5921
|
this.precedence = HandlerPrecedence.PRIMARY;
|
|
5921
5922
|
this.name = NgModuleDecoratorHandler.name;
|
|
5922
5923
|
}
|
|
@@ -6202,14 +6203,6 @@ var NgModuleDecoratorHandler = class {
|
|
|
6202
6203
|
type: injectorDef.type
|
|
6203
6204
|
}
|
|
6204
6205
|
];
|
|
6205
|
-
if (this.localeId) {
|
|
6206
|
-
res.push({
|
|
6207
|
-
name: "\u0275loc",
|
|
6208
|
-
initializer: new LiteralExpr3(this.localeId),
|
|
6209
|
-
statements: [],
|
|
6210
|
-
type: STRING_TYPE
|
|
6211
|
-
});
|
|
6212
|
-
}
|
|
6213
6206
|
return res;
|
|
6214
6207
|
}
|
|
6215
6208
|
_toR3Reference(valueRef, valueContext, typeContext) {
|
|
@@ -7183,7 +7176,7 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
7183
7176
|
}
|
|
7184
7177
|
|
|
7185
7178
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
7186
|
-
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable,
|
|
7179
|
+
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
7187
7180
|
import ts40 from "typescript";
|
|
7188
7181
|
var InjectableDecoratorHandler = class {
|
|
7189
7182
|
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
@@ -7271,7 +7264,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
7271
7264
|
type,
|
|
7272
7265
|
typeArgumentCount,
|
|
7273
7266
|
internalType,
|
|
7274
|
-
providedIn:
|
|
7267
|
+
providedIn: createMayBeForwardRefExpression2(new LiteralExpr3(null), 0)
|
|
7275
7268
|
};
|
|
7276
7269
|
} else if (decorator.args.length === 1) {
|
|
7277
7270
|
const metaNode = decorator.args[0];
|
|
@@ -7279,7 +7272,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
7279
7272
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
7280
7273
|
}
|
|
7281
7274
|
const meta = reflectObjectLiteral(metaNode);
|
|
7282
|
-
const providedIn = meta.has("providedIn") ? getProviderExpression(meta.get("providedIn"), reflector) :
|
|
7275
|
+
const providedIn = meta.has("providedIn") ? getProviderExpression(meta.get("providedIn"), reflector) : createMayBeForwardRefExpression2(new LiteralExpr3(null), 0);
|
|
7283
7276
|
let deps = void 0;
|
|
7284
7277
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
7285
7278
|
const depsExpr = meta.get("deps");
|
|
@@ -7307,7 +7300,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
7307
7300
|
}
|
|
7308
7301
|
function getProviderExpression(expression, reflector) {
|
|
7309
7302
|
const forwardRefValue = tryUnwrapForwardRef(expression, reflector);
|
|
7310
|
-
return
|
|
7303
|
+
return createMayBeForwardRefExpression2(new WrappedNodeExpr7(forwardRefValue != null ? forwardRefValue : expression), forwardRefValue !== null ? 2 : 0);
|
|
7311
7304
|
}
|
|
7312
7305
|
function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, strictCtorDeps) {
|
|
7313
7306
|
if (decorator.args === null) {
|
|
@@ -13402,11 +13395,11 @@ var UmdRenderingFormatter = class extends Esm5RenderingFormatter {
|
|
|
13402
13395
|
if (!umdModule) {
|
|
13403
13396
|
return;
|
|
13404
13397
|
}
|
|
13405
|
-
const
|
|
13406
|
-
renderCommonJsDependencies(output,
|
|
13407
|
-
renderAmdDependencies(output,
|
|
13408
|
-
renderGlobalDependencies(output,
|
|
13409
|
-
renderFactoryParameters(output,
|
|
13398
|
+
const { wrapperFn, factoryFn } = umdModule;
|
|
13399
|
+
renderCommonJsDependencies(output, wrapperFn, imports);
|
|
13400
|
+
renderAmdDependencies(output, wrapperFn, imports);
|
|
13401
|
+
renderGlobalDependencies(output, wrapperFn, imports);
|
|
13402
|
+
renderFactoryParameters(output, factoryFn, imports);
|
|
13410
13403
|
}
|
|
13411
13404
|
addExports(output, entryPointBasePath, exports, importManager, file) {
|
|
13412
13405
|
const umdModule = this.umdHost.getUmdModule(file);
|
|
@@ -13492,16 +13485,7 @@ function renderGlobalDependencies(output, wrapperFunction, imports) {
|
|
|
13492
13485
|
const importString = imports.map((i) => `global.${getGlobalIdentifier(i)}`).join(",");
|
|
13493
13486
|
output.appendLeft(injectionPoint, importString + (globalFactoryCall.arguments.length > 0 ? "," : ""));
|
|
13494
13487
|
}
|
|
13495
|
-
function renderFactoryParameters(output,
|
|
13496
|
-
const wrapperCall = wrapperFunction.parent;
|
|
13497
|
-
const secondArgument = wrapperCall.arguments[1];
|
|
13498
|
-
if (!secondArgument) {
|
|
13499
|
-
return;
|
|
13500
|
-
}
|
|
13501
|
-
const factoryFunction = ts107.isParenthesizedExpression(secondArgument) ? secondArgument.expression : secondArgument;
|
|
13502
|
-
if (!ts107.isFunctionExpression(factoryFunction)) {
|
|
13503
|
-
return;
|
|
13504
|
-
}
|
|
13488
|
+
function renderFactoryParameters(output, factoryFunction, imports) {
|
|
13505
13489
|
const parameters = factoryFunction.parameters;
|
|
13506
13490
|
const parameterString = imports.map((i) => i.qualifier.text).join(",");
|
|
13507
13491
|
if (parameters.length > 0) {
|
|
@@ -13667,7 +13651,7 @@ function getCreateCompileFn(fileSystem, logger, fileWriter, enableI18nLegacyMess
|
|
|
13667
13651
|
onTaskCompleted(task, 1, `property \`${formatProperty}\` pointing to a missing or empty file: ${formatPath}`);
|
|
13668
13652
|
return;
|
|
13669
13653
|
}
|
|
13670
|
-
logger.info(
|
|
13654
|
+
logger.info(`- ${entryPoint.name} [${formatProperty}/${format}] (${entryPoint.repositoryUrl})`);
|
|
13671
13655
|
const bundle = makeEntryPointBundle(fileSystem, entryPoint, sharedFileCache, moduleResolutionCache, formatPath, isCore, format, processDts, pathMappings, true, enableI18nLegacyMessageIdFormat);
|
|
13672
13656
|
const result = transformer.transform(bundle);
|
|
13673
13657
|
if (result.success) {
|