@angular/compiler-cli 20.3.1 → 20.3.2

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.
@@ -10983,7 +10983,7 @@ var CompletionEngine = class {
10983
10983
  // packages/compiler-cli/src/ngtsc/typecheck/src/context.js
10984
10984
  import { ParseSourceFile as ParseSourceFile2 } from "@angular/compiler";
10985
10985
 
10986
- // node_modules/.aspect_rules_js/magic-string@0.30.18/node_modules/magic-string/dist/magic-string.es.mjs
10986
+ // node_modules/.aspect_rules_js/magic-string@0.30.19/node_modules/magic-string/dist/magic-string.es.mjs
10987
10987
  import { encode } from "@jridgewell/sourcemap-codec";
10988
10988
  var BitSet = class _BitSet {
10989
10989
  constructor(arg) {
@@ -11433,6 +11433,9 @@ var MagicString = class _MagicString {
11433
11433
  if (chunk.outro.length)
11434
11434
  mappings.advance(chunk.outro);
11435
11435
  });
11436
+ if (this.outro) {
11437
+ mappings.advance(this.outro);
11438
+ }
11436
11439
  return {
11437
11440
  file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
11438
11441
  sources: [
@@ -11995,7 +11998,12 @@ var MagicString = class _MagicString {
11995
11998
  const { original } = this;
11996
11999
  const index = original.indexOf(string);
11997
12000
  if (index !== -1) {
11998
- this.overwrite(index, index + string.length, replacement);
12001
+ if (typeof replacement === "function") {
12002
+ replacement = replacement(string, index, original);
12003
+ }
12004
+ if (string !== replacement) {
12005
+ this.overwrite(index, index + string.length, replacement);
12006
+ }
11999
12007
  }
12000
12008
  return this;
12001
12009
  }
@@ -12010,8 +12018,12 @@ var MagicString = class _MagicString {
12010
12018
  const stringLength = string.length;
12011
12019
  for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
12012
12020
  const previous = original.slice(index, index + stringLength);
12013
- if (previous !== replacement)
12014
- this.overwrite(index, index + stringLength, replacement);
12021
+ let _replacement = replacement;
12022
+ if (typeof replacement === "function") {
12023
+ _replacement = replacement(previous, index, original);
12024
+ }
12025
+ if (previous !== _replacement)
12026
+ this.overwrite(index, index + stringLength, _replacement);
12015
12027
  }
12016
12028
  return this;
12017
12029
  }
@@ -21071,11 +21083,12 @@ var ComponentDecoratorHandler = class {
21071
21083
  for (const [_, deps] of resolution.deferPerBlockDependencies) {
21072
21084
  for (const deferBlockDep of deps) {
21073
21085
  const node = deferBlockDep.declaration.node;
21074
- const importDecl = resolution.deferrableDeclToImportDecl.get(node) ?? null;
21075
- if (importDecl !== null && this.deferredSymbolTracker.canDefer(importDecl)) {
21086
+ const importInfo = resolution.deferrableDeclToImportDecl.get(node) ?? null;
21087
+ if (importInfo !== null && this.deferredSymbolTracker.canDefer(importInfo.node)) {
21076
21088
  deferBlockDep.isDeferrable = true;
21077
- deferBlockDep.importPath = importDecl.moduleSpecifier.text;
21078
- deferBlockDep.isDefaultImport = isDefaultImport(importDecl);
21089
+ deferBlockDep.symbolName = importInfo.name;
21090
+ deferBlockDep.importPath = importInfo.from;
21091
+ deferBlockDep.isDefaultImport = isDefaultImport(importInfo.node);
21079
21092
  if (!seenDeps.has(node)) {
21080
21093
  seenDeps.add(node);
21081
21094
  deferrableTypes.push(deferBlockDep);
@@ -21218,7 +21231,7 @@ var ComponentDecoratorHandler = class {
21218
21231
  if (dirMeta === null && pipeMeta === null) {
21219
21232
  return;
21220
21233
  }
21221
- resolutionData.deferrableDeclToImportDecl.set(decl.node, imp.node);
21234
+ resolutionData.deferrableDeclToImportDecl.set(decl.node, imp);
21222
21235
  this.deferredSymbolTracker.markAsDeferrableCandidate(node, imp.node, componentClassDecl, isDeferredImport);
21223
21236
  }
21224
21237
  compileDeferBlocks(resolution) {
@@ -16,7 +16,7 @@ import {
16
16
  tryParseSignalInputMapping,
17
17
  tryParseSignalModelMapping,
18
18
  tryParseSignalQueryFromInitializer
19
- } from "./chunk-HQSSDNAP.js";
19
+ } from "./chunk-2JGGVEXA.js";
20
20
 
21
21
  // packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.js
22
22
  import ts from "typescript";
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "./chunk-LBDATQBA.js";
7
+ } from "./chunk-5YTDMIWM.js";
8
8
  import {
9
9
  AbsoluteModuleStrategy,
10
10
  ActivePerfRecorder,
@@ -92,7 +92,7 @@ import {
92
92
  toUnredirectedSourceFile,
93
93
  tryParseInitializerApi,
94
94
  untagAllTsFiles
95
- } from "./chunk-HQSSDNAP.js";
95
+ } from "./chunk-2JGGVEXA.js";
96
96
  import {
97
97
  LogicalFileSystem,
98
98
  absoluteFrom,
@@ -3146,14 +3146,23 @@ var factory6 = {
3146
3146
  };
3147
3147
 
3148
3148
  // packages/compiler-cli/src/ngtsc/typecheck/extended/checks/optional_chain_not_nullable/index.js
3149
- import { SafeCall, SafeKeyedRead, SafePropertyRead } from "@angular/compiler";
3149
+ import { KeyedRead, SafeCall, SafeKeyedRead, SafePropertyRead } from "@angular/compiler";
3150
3150
  import ts20 from "typescript";
3151
3151
  var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
3152
+ noUncheckedIndexedAccess;
3152
3153
  canVisitStructuralAttributes = false;
3153
3154
  code = ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE;
3155
+ constructor(noUncheckedIndexedAccess) {
3156
+ super();
3157
+ this.noUncheckedIndexedAccess = noUncheckedIndexedAccess;
3158
+ }
3154
3159
  visitNode(ctx, component, node) {
3155
- if (!(node instanceof SafeCall) && !(node instanceof SafePropertyRead) && !(node instanceof SafeKeyedRead))
3160
+ if (!(node instanceof SafeCall) && !(node instanceof SafePropertyRead) && !(node instanceof SafeKeyedRead)) {
3156
3161
  return [];
3162
+ }
3163
+ if (node.receiver instanceof KeyedRead && !this.noUncheckedIndexedAccess) {
3164
+ return [];
3165
+ }
3157
3166
  const symbolLeft = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
3158
3167
  if (symbolLeft === null || symbolLeft.kind !== SymbolKind.Expression) {
3159
3168
  return [];
@@ -3185,7 +3194,8 @@ var factory7 = {
3185
3194
  if (!strictNullChecks) {
3186
3195
  return null;
3187
3196
  }
3188
- return new OptionalChainNotNullableCheck();
3197
+ const noUncheckedIndexedAccess = !!options.noUncheckedIndexedAccess;
3198
+ return new OptionalChainNotNullableCheck(noUncheckedIndexedAccess);
3189
3199
  }
3190
3200
  };
3191
3201
 
@@ -12,7 +12,7 @@ import {
12
12
  formatDiagnostics,
13
13
  performCompilation,
14
14
  readConfiguration
15
- } from "./chunk-EWP5PK2E.js";
15
+ } from "./chunk-6MT4TMWB.js";
16
16
 
17
17
  // packages/compiler-cli/src/main.js
18
18
  import ts2 from "typescript";
@@ -455,7 +455,7 @@ import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSo
455
455
  // packages/compiler-cli/linker/src/file_linker/partial_linkers/util.js
456
456
  import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
457
457
  import semver from "semver";
458
- var PLACEHOLDER_VERSION = "20.3.1";
458
+ var PLACEHOLDER_VERSION = "20.3.2";
459
459
  function wrapReference(wrapped) {
460
460
  return { value: wrapped, type: wrapped };
461
461
  }
package/bundles/index.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  isTsDiagnostic,
29
29
  performCompilation,
30
30
  readConfiguration
31
- } from "./chunk-EWP5PK2E.js";
31
+ } from "./chunk-6MT4TMWB.js";
32
32
  import {
33
33
  ConsoleLogger,
34
34
  LogLevel
@@ -37,7 +37,7 @@ import {
37
37
  angularJitApplicationTransform,
38
38
  getDownlevelDecoratorsTransform,
39
39
  getInitializerApiJitTransform
40
- } from "./chunk-LBDATQBA.js";
40
+ } from "./chunk-5YTDMIWM.js";
41
41
  import {
42
42
  ActivePerfRecorder,
43
43
  ErrorCode,
@@ -46,7 +46,7 @@ import {
46
46
  TsCreateProgramDriver,
47
47
  isLocalCompilationDiagnostics,
48
48
  ngErrorCode
49
- } from "./chunk-HQSSDNAP.js";
49
+ } from "./chunk-2JGGVEXA.js";
50
50
  import "./chunk-I2BHWRAU.js";
51
51
  import {
52
52
  InvalidFileSystem,
@@ -77,7 +77,7 @@ import "./chunk-G7GFT6BU.js";
77
77
 
78
78
  // packages/compiler-cli/src/version.js
79
79
  import { Version } from "@angular/compiler";
80
- var VERSION = new Version("20.3.1");
80
+ var VERSION = new Version("20.3.2");
81
81
 
82
82
  // packages/compiler-cli/private/tooling.js
83
83
  var GLOBAL_DEFS_FOR_TERSER = {
@@ -13,7 +13,7 @@ import {
13
13
  TypeScriptReflectionHost,
14
14
  createForwardRefResolver,
15
15
  reflectObjectLiteral
16
- } from "../chunk-HQSSDNAP.js";
16
+ } from "../chunk-2JGGVEXA.js";
17
17
  import "../chunk-I2BHWRAU.js";
18
18
  import "../chunk-GWZQLAGK.js";
19
19
  import "../chunk-XYYEESKY.js";
@@ -4,8 +4,8 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "../chunk-LBDATQBA.js";
8
- import "../chunk-HQSSDNAP.js";
7
+ } from "../chunk-5YTDMIWM.js";
8
+ import "../chunk-2JGGVEXA.js";
9
9
  import "../chunk-I2BHWRAU.js";
10
10
  import "../chunk-GWZQLAGK.js";
11
11
  import "../chunk-XYYEESKY.js";
@@ -6,12 +6,12 @@
6
6
  import {
7
7
  main,
8
8
  readCommandLineAndConfiguration
9
- } from "../../chunk-WIZYXMS6.js";
9
+ } from "../../chunk-BIXQTG65.js";
10
10
  import {
11
11
  EmitFlags
12
- } from "../../chunk-EWP5PK2E.js";
13
- import "../../chunk-LBDATQBA.js";
14
- import "../../chunk-HQSSDNAP.js";
12
+ } from "../../chunk-6MT4TMWB.js";
13
+ import "../../chunk-5YTDMIWM.js";
14
+ import "../../chunk-2JGGVEXA.js";
15
15
  import "../../chunk-I2BHWRAU.js";
16
16
  import {
17
17
  setFileSystem
@@ -5,10 +5,10 @@
5
5
 
6
6
  import {
7
7
  main
8
- } from "../../chunk-WIZYXMS6.js";
9
- import "../../chunk-EWP5PK2E.js";
10
- import "../../chunk-LBDATQBA.js";
11
- import "../../chunk-HQSSDNAP.js";
8
+ } from "../../chunk-BIXQTG65.js";
9
+ import "../../chunk-6MT4TMWB.js";
10
+ import "../../chunk-5YTDMIWM.js";
11
+ import "../../chunk-2JGGVEXA.js";
12
12
  import "../../chunk-I2BHWRAU.js";
13
13
  import {
14
14
  setFileSystem
@@ -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 = "20.3.1";
10
+ export declare const PLACEHOLDER_VERSION = "20.3.2";
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": "20.3.1",
3
+ "version": "20.3.2",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -48,7 +48,7 @@
48
48
  "yargs": "^18.0.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@angular/compiler": "20.3.1",
51
+ "@angular/compiler": "20.3.2",
52
52
  "typescript": ">=5.8 <6.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
@@ -9,7 +9,7 @@ import { LegacyAnimationTriggerNames, DeclarationListEmitMode, DeferBlockDepsEmi
9
9
  import ts from 'typescript';
10
10
  import { Reference } from '../../../imports';
11
11
  import { ClassPropertyMapping, DirectiveResources, DirectiveTypeCheckMeta, HostDirectiveMeta, InputMapping } from '../../../metadata';
12
- import { ClassDeclaration } from '../../../reflection';
12
+ import { ClassDeclaration, Import } from '../../../reflection';
13
13
  import { SubsetOfKeys } from '../../../util/src/typescript';
14
14
  import { ParsedTemplateWithSource, StyleUrlMeta } from './resources';
15
15
  import { HostBindingNodes } from '../../directive';
@@ -84,10 +84,11 @@ export interface ComponentResolutionData {
84
84
  declarationListEmitMode: DeclarationListEmitMode;
85
85
  /**
86
86
  * Map of all types that can be defer loaded (ts.ClassDeclaration) ->
87
- * corresponding import declaration (ts.ImportDeclaration) within
88
- * the current source file.
87
+ * corresponding import information (reflection `Import`) within
88
+ * the current source file. The `Import` preserves the exported name
89
+ * as seen by the importing module so aliasing is handled correctly.
89
90
  */
90
- deferrableDeclToImportDecl: Map<ClassDeclaration, ts.ImportDeclaration>;
91
+ deferrableDeclToImportDecl: Map<ClassDeclaration, Import>;
91
92
  /**
92
93
  * Map of `@defer` blocks -> their corresponding dependencies.
93
94
  * Required to compile the defer resolver function in `PerBlock` mode.