@angular/core 19.1.5 → 19.1.7
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/fesm2022/core.mjs +648 -638
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +4 -4
- package/index.d.ts +24 -36
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/{apply_import_manager-57619f3c.js → apply_import_manager-3220dafc.js} +3 -3
- package/schematics/bundles/{checker-ce908760.js → checker-2bdbb582.js} +101 -63
- package/schematics/bundles/cleanup-unused-imports.js +6 -6
- package/schematics/bundles/{compiler_host-33b24174.js → compiler_host-833d3812.js} +2 -2
- package/schematics/bundles/control-flow-migration.js +10 -3
- package/schematics/bundles/explicit-standalone-flag.js +5 -5
- package/schematics/bundles/{imports-31a38653.js → imports-abe29092.js} +1 -1
- package/schematics/bundles/{index-59a1204f.js → index-4978a91a.js} +4 -4
- package/schematics/bundles/{index-d6e51169.js → index-be586082.js} +4 -4
- package/schematics/bundles/inject-migration.js +6 -6
- package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-d190b83b.js} +1 -1
- package/schematics/bundles/{migrate_ts_type_references-2c37e645.js → migrate_ts_type_references-d2b2e8f1.js} +6 -6
- package/schematics/bundles/{nodes-88c2157f.js → nodes-a9f0b985.js} +2 -2
- package/schematics/bundles/output-migration.js +6 -6
- package/schematics/bundles/pending-tasks.js +5 -5
- package/schematics/bundles/{program-5512058c.js → program-f43dcb10.js} +35 -21
- package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-e9ccccbf.js} +1 -1
- package/schematics/bundles/provide-initializer.js +5 -5
- package/schematics/bundles/route-lazy-loading.js +4 -4
- package/schematics/bundles/signal-input-migration.js +8 -8
- package/schematics/bundles/signal-queries-migration.js +8 -8
- package/schematics/bundles/signals.js +8 -8
- package/schematics/bundles/standalone-migration.js +8 -8
- package/testing/index.d.ts +1 -1
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.1.
|
|
2
|
+
* @license Angular v19.1.7
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -175,10 +175,10 @@ class TestBedApplicationErrorHandler {
|
|
|
175
175
|
throw e;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.
|
|
179
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.
|
|
178
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: TestBedApplicationErrorHandler, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
179
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: TestBedApplicationErrorHandler });
|
|
180
180
|
}
|
|
181
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: TestBedApplicationErrorHandler, decorators: [{
|
|
182
182
|
type: Injectable
|
|
183
183
|
}] });
|
|
184
184
|
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.1.
|
|
2
|
+
* @license Angular v19.1.7
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -5583,6 +5583,13 @@ declare const ID = 19;
|
|
|
5583
5583
|
*/
|
|
5584
5584
|
export declare type ImportedNgModuleProviders = EnvironmentProviders;
|
|
5585
5585
|
|
|
5586
|
+
/** Represents `import.meta` plus some information that's not in the built-in types. */
|
|
5587
|
+
declare type ImportMetaExtended = ImportMeta & {
|
|
5588
|
+
hot?: {
|
|
5589
|
+
send?: (name: string, payload: unknown) => void;
|
|
5590
|
+
};
|
|
5591
|
+
};
|
|
5592
|
+
|
|
5586
5593
|
/**
|
|
5587
5594
|
* Collects providers from all NgModules and standalone components, including transitively imported
|
|
5588
5595
|
* ones.
|
|
@@ -5640,9 +5647,8 @@ export declare type ImportProvidersSource = Type<unknown> | ModuleWithProviders<
|
|
|
5640
5647
|
*
|
|
5641
5648
|
* Within each sub-array:
|
|
5642
5649
|
*
|
|
5643
|
-
* i+0:
|
|
5644
|
-
* i+1:
|
|
5645
|
-
* i+2: initial value
|
|
5650
|
+
* i+0: public name
|
|
5651
|
+
* i+1: initial value
|
|
5646
5652
|
*
|
|
5647
5653
|
* If a directive on a node does not have any input properties
|
|
5648
5654
|
* that should be set from attributes, its index is set to null
|
|
@@ -5663,7 +5669,7 @@ declare type InitialInputData = (InitialInputs | null)[];
|
|
|
5663
5669
|
*
|
|
5664
5670
|
* e.g. ['role-min', 'minified-input', 'button']
|
|
5665
5671
|
*/
|
|
5666
|
-
declare type InitialInputs =
|
|
5672
|
+
declare type InitialInputs = string[];
|
|
5667
5673
|
|
|
5668
5674
|
/**
|
|
5669
5675
|
* Type of the Inject metadata.
|
|
@@ -8108,16 +8114,15 @@ export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
|
|
|
8108
8114
|
*
|
|
8109
8115
|
* i+0: directive instance index
|
|
8110
8116
|
* i+1: privateName
|
|
8111
|
-
* i+2: input flags
|
|
8112
8117
|
*
|
|
8113
8118
|
* e.g.
|
|
8114
8119
|
* ```
|
|
8115
8120
|
* {
|
|
8116
|
-
* "publicName": [0, 'change-minified'
|
|
8121
|
+
* "publicName": [0, 'change-minified']
|
|
8117
8122
|
* }
|
|
8118
8123
|
* ```
|
|
8119
8124
|
*/
|
|
8120
|
-
declare type NodeInputBindings = Record<string, (number | string
|
|
8125
|
+
declare type NodeInputBindings = Record<string, (number | string)[]>;
|
|
8121
8126
|
|
|
8122
8127
|
/**
|
|
8123
8128
|
* Store the runtime output names for all the directives.
|
|
@@ -13375,20 +13380,11 @@ export declare interface ɵDirectiveDef<T> {
|
|
|
13375
13380
|
* A dictionary mapping the inputs' public name to their minified property names
|
|
13376
13381
|
* (along with flags if there are any).
|
|
13377
13382
|
*/
|
|
13378
|
-
readonly inputs:
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
* Note: the private names are used for the keys, rather than the public ones, because public
|
|
13384
|
-
* names can be re-aliased in host directives which would invalidate the lookup.
|
|
13385
|
-
*
|
|
13386
|
-
* Note: Signal inputs will not have transforms captured here. This is because their
|
|
13387
|
-
* transform function is already integrated into the `InputSignal`.
|
|
13388
|
-
*/
|
|
13389
|
-
readonly inputTransforms: {
|
|
13390
|
-
[classPropertyName: string]: InputTransformFunction;
|
|
13391
|
-
} | null;
|
|
13383
|
+
readonly inputs: Record<string, [
|
|
13384
|
+
minifiedName: string,
|
|
13385
|
+
flags: InputFlags,
|
|
13386
|
+
transform: InputTransformFunction | null
|
|
13387
|
+
]>;
|
|
13392
13388
|
/**
|
|
13393
13389
|
* Contains the raw input information produced by the compiler. Can be
|
|
13394
13390
|
* used to do further processing after the `inputs` have been inverted.
|
|
@@ -13406,9 +13402,7 @@ export declare interface ɵDirectiveDef<T> {
|
|
|
13406
13402
|
* are their aliases if any, or their original unminified property names
|
|
13407
13403
|
* (as in `@Output('alias') propertyName: any;`).
|
|
13408
13404
|
*/
|
|
13409
|
-
readonly outputs:
|
|
13410
|
-
[P in keyof T]?: string;
|
|
13411
|
-
};
|
|
13405
|
+
readonly outputs: Record<string, string>;
|
|
13412
13406
|
/**
|
|
13413
13407
|
* Function to create and refresh content queries associated with a given directive.
|
|
13414
13408
|
*/
|
|
@@ -16799,16 +16793,6 @@ export declare interface ɵɵInjectorDef<T> {
|
|
|
16799
16793
|
imports: (InjectorType<any> | InjectorTypeWithProviders<any>)[];
|
|
16800
16794
|
}
|
|
16801
16795
|
|
|
16802
|
-
/**
|
|
16803
|
-
* Decorates the directive definition with support for input transform functions.
|
|
16804
|
-
*
|
|
16805
|
-
* If the directive uses inheritance, the feature should be included before the
|
|
16806
|
-
* `InheritDefinitionFeature` to ensure that the `inputTransforms` field is populated.
|
|
16807
|
-
*
|
|
16808
|
-
* @codeGenApi
|
|
16809
|
-
*/
|
|
16810
|
-
export declare function ɵɵInputTransformsFeature<T>(definition: ɵDirectiveDef<T>): void;
|
|
16811
|
-
|
|
16812
16796
|
/**
|
|
16813
16797
|
* Throws an error indicating that a factory function could not be generated by the compiler for a
|
|
16814
16798
|
* particular class.
|
|
@@ -17867,9 +17851,13 @@ export declare function ɵɵrepeaterTrackByIndex(index: number): number;
|
|
|
17867
17851
|
* @param applyMetadata Callback that will apply a new set of metadata on the `type` when invoked.
|
|
17868
17852
|
* @param environment Syntehtic namespace imports that need to be passed along to the callback.
|
|
17869
17853
|
* @param locals Local symbols from the source location that have to be exposed to the callback.
|
|
17854
|
+
* @param importMeta `import.meta` from the call site of the replacement function. Optional since
|
|
17855
|
+
* it isn't used internally.
|
|
17856
|
+
* @param id ID to the class being replaced. **Not** the same as the component definition ID.
|
|
17857
|
+
* Optional since the ID might not be available internally.
|
|
17870
17858
|
* @codeGenApi
|
|
17871
17859
|
*/
|
|
17872
|
-
export declare function ɵɵreplaceMetadata(type: Type<unknown>, applyMetadata: (...args: [Type<unknown>, unknown[], ...unknown[]]) => void, namespaces: unknown[], locals: unknown[]): void;
|
|
17860
|
+
export declare function ɵɵreplaceMetadata(type: Type<unknown>, applyMetadata: (...args: [Type<unknown>, unknown[], ...unknown[]]) => void, namespaces: unknown[], locals: unknown[], importMeta?: ImportMetaExtended | null, id?: string | null): void;
|
|
17873
17861
|
|
|
17874
17862
|
/**
|
|
17875
17863
|
* Clears the view set in `ɵɵrestoreView` from memory. Returns the passed in
|
package/package.json
CHANGED
package/rxjs-interop/index.d.ts
CHANGED
package/schematics/bundles/{apply_import_manager-57619f3c.js → apply_import_manager-3220dafc.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.1.
|
|
3
|
+
* @license Angular v19.1.7
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,8 +10,8 @@ var core = require('@angular-devkit/core');
|
|
|
10
10
|
var posixPath = require('node:path/posix');
|
|
11
11
|
var os = require('os');
|
|
12
12
|
var ts = require('typescript');
|
|
13
|
-
var checker = require('./checker-
|
|
14
|
-
var program = require('./program-
|
|
13
|
+
var checker = require('./checker-2bdbb582.js');
|
|
14
|
+
var program = require('./program-f43dcb10.js');
|
|
15
15
|
require('path');
|
|
16
16
|
|
|
17
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.1.
|
|
3
|
+
* @license Angular v19.1.7
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -2915,10 +2915,6 @@ class Identifiers {
|
|
|
2915
2915
|
name: 'ɵɵHostDirectivesFeature',
|
|
2916
2916
|
moduleName: CORE,
|
|
2917
2917
|
};
|
|
2918
|
-
static InputTransformsFeatureFeature = {
|
|
2919
|
-
name: 'ɵɵInputTransformsFeature',
|
|
2920
|
-
moduleName: CORE,
|
|
2921
|
-
};
|
|
2922
2918
|
static ExternalStylesFeature = {
|
|
2923
2919
|
name: 'ɵɵExternalStylesFeature',
|
|
2924
2920
|
moduleName: CORE,
|
|
@@ -10030,7 +10026,14 @@ function transformExpressionsInOp(op, transform, flags) {
|
|
|
10030
10026
|
op.trustedValueFn && transformExpressionsInExpression(op.trustedValueFn, transform, flags);
|
|
10031
10027
|
break;
|
|
10032
10028
|
case OpKind.RepeaterCreate:
|
|
10033
|
-
|
|
10029
|
+
if (op.trackByOps === null) {
|
|
10030
|
+
op.track = transformExpressionsInExpression(op.track, transform, flags);
|
|
10031
|
+
}
|
|
10032
|
+
else {
|
|
10033
|
+
for (const innerOp of op.trackByOps) {
|
|
10034
|
+
transformExpressionsInOp(innerOp, transform, flags | VisitorContextFlag.InChildOperation);
|
|
10035
|
+
}
|
|
10036
|
+
}
|
|
10034
10037
|
if (op.trackByFn !== null) {
|
|
10035
10038
|
op.trackByFn = transformExpressionsInExpression(op.trackByFn, transform, flags);
|
|
10036
10039
|
}
|
|
@@ -10554,6 +10557,7 @@ function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, em
|
|
|
10554
10557
|
emptyView,
|
|
10555
10558
|
track,
|
|
10556
10559
|
trackByFn: null,
|
|
10560
|
+
trackByOps: null,
|
|
10557
10561
|
tag,
|
|
10558
10562
|
emptyTag,
|
|
10559
10563
|
emptyAttributes: null,
|
|
@@ -11054,6 +11058,11 @@ class CompilationUnit {
|
|
|
11054
11058
|
yield listenerOp;
|
|
11055
11059
|
}
|
|
11056
11060
|
}
|
|
11061
|
+
else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
|
|
11062
|
+
for (const trackOp of op.trackByOps) {
|
|
11063
|
+
yield trackOp;
|
|
11064
|
+
}
|
|
11065
|
+
}
|
|
11057
11066
|
}
|
|
11058
11067
|
for (const op of this.update) {
|
|
11059
11068
|
yield op;
|
|
@@ -12781,6 +12790,9 @@ function recursivelyProcessView(view, parentScope) {
|
|
|
12781
12790
|
if (op.emptyView) {
|
|
12782
12791
|
recursivelyProcessView(view.job.views.get(op.emptyView), scope);
|
|
12783
12792
|
}
|
|
12793
|
+
if (op.trackByOps !== null) {
|
|
12794
|
+
op.trackByOps.prepend(generateVariablesInScopeForView(view, scope, false));
|
|
12795
|
+
}
|
|
12784
12796
|
break;
|
|
12785
12797
|
case OpKind.Listener:
|
|
12786
12798
|
case OpKind.TwoWayListener:
|
|
@@ -22863,7 +22875,7 @@ function reifyCreateOperations(unit, ops) {
|
|
|
22863
22875
|
emptyDecls = emptyView.decls;
|
|
22864
22876
|
emptyVars = emptyView.vars;
|
|
22865
22877
|
}
|
|
22866
|
-
OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, op
|
|
22878
|
+
OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, reifyTrackBy(unit, op), op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.emptyTag, op.emptyAttributes, op.wholeSourceSpan));
|
|
22867
22879
|
break;
|
|
22868
22880
|
case OpKind.SourceLocation:
|
|
22869
22881
|
const locationsLiteral = literalArr(op.locations.map(({ targetSlot, offset, line, column }) => {
|
|
@@ -23044,6 +23056,8 @@ function reifyIrExpression(expr) {
|
|
|
23044
23056
|
return readContextLet(expr.targetSlot.slot);
|
|
23045
23057
|
case ExpressionKind.StoreLet:
|
|
23046
23058
|
return storeLet(expr.value, expr.sourceSpan);
|
|
23059
|
+
case ExpressionKind.TrackContext:
|
|
23060
|
+
return variable('this');
|
|
23047
23061
|
default:
|
|
23048
23062
|
throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`);
|
|
23049
23063
|
}
|
|
@@ -23072,6 +23086,42 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
|
|
|
23072
23086
|
}
|
|
23073
23087
|
return fn(params, handlerStmts, undefined, undefined, name);
|
|
23074
23088
|
}
|
|
23089
|
+
/** Reifies the tracking expression of a `RepeaterCreateOp`. */
|
|
23090
|
+
function reifyTrackBy(unit, op) {
|
|
23091
|
+
// If the tracking function was created already, there's nothing left to do.
|
|
23092
|
+
if (op.trackByFn !== null) {
|
|
23093
|
+
return op.trackByFn;
|
|
23094
|
+
}
|
|
23095
|
+
const params = [new FnParam('$index'), new FnParam('$item')];
|
|
23096
|
+
let fn$1;
|
|
23097
|
+
if (op.trackByOps === null) {
|
|
23098
|
+
// If there are no additional ops related to the tracking function, we just need
|
|
23099
|
+
// to turn it into a function that returns the result of the expression.
|
|
23100
|
+
fn$1 = op.usesComponentInstance
|
|
23101
|
+
? fn(params, [new ReturnStatement(op.track)])
|
|
23102
|
+
: arrowFn(params, op.track);
|
|
23103
|
+
}
|
|
23104
|
+
else {
|
|
23105
|
+
// Otherwise first we need to reify the track-related ops.
|
|
23106
|
+
reifyUpdateOperations(unit, op.trackByOps);
|
|
23107
|
+
const statements = [];
|
|
23108
|
+
for (const trackOp of op.trackByOps) {
|
|
23109
|
+
if (trackOp.kind !== OpKind.Statement) {
|
|
23110
|
+
throw new Error(`AssertionError: expected reified statements, but found op ${OpKind[trackOp.kind]}`);
|
|
23111
|
+
}
|
|
23112
|
+
statements.push(trackOp.statement);
|
|
23113
|
+
}
|
|
23114
|
+
// Afterwards we can create the function from those ops.
|
|
23115
|
+
fn$1 =
|
|
23116
|
+
op.usesComponentInstance ||
|
|
23117
|
+
statements.length !== 1 ||
|
|
23118
|
+
!(statements[0] instanceof ReturnStatement)
|
|
23119
|
+
? fn(params, statements)
|
|
23120
|
+
: arrowFn(params, statements[0].value);
|
|
23121
|
+
}
|
|
23122
|
+
op.trackByFn = unit.job.pool.getSharedFunctionReference(fn$1, '_forTrack');
|
|
23123
|
+
return op.trackByFn;
|
|
23124
|
+
}
|
|
23075
23125
|
|
|
23076
23126
|
/**
|
|
23077
23127
|
* Binding with no content can be safely deleted.
|
|
@@ -23170,6 +23220,11 @@ function processLexicalScope$1(view, ops) {
|
|
|
23170
23220
|
case OpKind.TwoWayListener:
|
|
23171
23221
|
processLexicalScope$1(view, op.handlerOps);
|
|
23172
23222
|
break;
|
|
23223
|
+
case OpKind.RepeaterCreate:
|
|
23224
|
+
if (op.trackByOps !== null) {
|
|
23225
|
+
processLexicalScope$1(view, op.trackByOps);
|
|
23226
|
+
}
|
|
23227
|
+
break;
|
|
23173
23228
|
}
|
|
23174
23229
|
}
|
|
23175
23230
|
if (view === view.job.root) {
|
|
@@ -23602,6 +23657,11 @@ function processLexicalScope(unit, ops, savedView) {
|
|
|
23602
23657
|
// lexical scope.
|
|
23603
23658
|
processLexicalScope(unit, op.handlerOps, savedView);
|
|
23604
23659
|
break;
|
|
23660
|
+
case OpKind.RepeaterCreate:
|
|
23661
|
+
if (op.trackByOps !== null) {
|
|
23662
|
+
processLexicalScope(unit, op.trackByOps, savedView);
|
|
23663
|
+
}
|
|
23664
|
+
break;
|
|
23605
23665
|
}
|
|
23606
23666
|
}
|
|
23607
23667
|
// Next, use the `scope` mapping to match `ir.LexicalReadExpr` with defined names in the lexical
|
|
@@ -24002,6 +24062,9 @@ function generateTemporaries(ops) {
|
|
|
24002
24062
|
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
24003
24063
|
op.handlerOps.prepend(generateTemporaries(op.handlerOps));
|
|
24004
24064
|
}
|
|
24065
|
+
else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
|
|
24066
|
+
op.trackByOps.prepend(generateTemporaries(op.trackByOps));
|
|
24067
|
+
}
|
|
24005
24068
|
}
|
|
24006
24069
|
return generatedStatements;
|
|
24007
24070
|
}
|
|
@@ -24016,49 +24079,6 @@ function assignName(names, expr) {
|
|
|
24016
24079
|
expr.name = name;
|
|
24017
24080
|
}
|
|
24018
24081
|
|
|
24019
|
-
/**
|
|
24020
|
-
* Generate track functions that need to be extracted to the constant pool. This entails wrapping
|
|
24021
|
-
* them in an arrow (or traditional) function, replacing context reads with `this.`, and storing
|
|
24022
|
-
* them in the constant pool.
|
|
24023
|
-
*
|
|
24024
|
-
* Note that, if a track function was previously optimized, it will not need to be extracted, and
|
|
24025
|
-
* this phase is a no-op.
|
|
24026
|
-
*/
|
|
24027
|
-
function generateTrackFns(job) {
|
|
24028
|
-
for (const unit of job.units) {
|
|
24029
|
-
for (const op of unit.create) {
|
|
24030
|
-
if (op.kind !== OpKind.RepeaterCreate) {
|
|
24031
|
-
continue;
|
|
24032
|
-
}
|
|
24033
|
-
if (op.trackByFn !== null) {
|
|
24034
|
-
// The final track function was already set, probably because it was optimized.
|
|
24035
|
-
continue;
|
|
24036
|
-
}
|
|
24037
|
-
// Find all component context reads.
|
|
24038
|
-
let usesComponentContext = false;
|
|
24039
|
-
op.track = transformExpressionsInExpression(op.track, (expr) => {
|
|
24040
|
-
if (expr instanceof PipeBindingExpr || expr instanceof PipeBindingVariadicExpr) {
|
|
24041
|
-
throw new Error(`Illegal State: Pipes are not allowed in this context`);
|
|
24042
|
-
}
|
|
24043
|
-
if (expr instanceof TrackContextExpr) {
|
|
24044
|
-
usesComponentContext = true;
|
|
24045
|
-
return variable('this');
|
|
24046
|
-
}
|
|
24047
|
-
return expr;
|
|
24048
|
-
}, VisitorContextFlag.None);
|
|
24049
|
-
let fn;
|
|
24050
|
-
const fnParams = [new FnParam('$index'), new FnParam('$item')];
|
|
24051
|
-
if (usesComponentContext) {
|
|
24052
|
-
fn = new FunctionExpr(fnParams, [new ReturnStatement(op.track)]);
|
|
24053
|
-
}
|
|
24054
|
-
else {
|
|
24055
|
-
fn = arrowFn(fnParams, op.track);
|
|
24056
|
-
}
|
|
24057
|
-
op.trackByFn = job.pool.getSharedFunctionReference(fn, '_forTrack');
|
|
24058
|
-
}
|
|
24059
|
-
}
|
|
24060
|
-
}
|
|
24061
|
-
|
|
24062
24082
|
/**
|
|
24063
24083
|
* `track` functions in `for` repeaters can sometimes be "optimized," i.e. transformed into inline
|
|
24064
24084
|
* expressions, in lieu of an external function call. For example, tracking by `$index` can be be
|
|
@@ -24105,12 +24125,20 @@ function optimizeTrackFns(job) {
|
|
|
24105
24125
|
// Replace context reads with a special IR expression, since context reads in a track
|
|
24106
24126
|
// function are emitted specially.
|
|
24107
24127
|
op.track = transformExpressionsInExpression(op.track, (expr) => {
|
|
24108
|
-
if (expr instanceof
|
|
24128
|
+
if (expr instanceof PipeBindingExpr || expr instanceof PipeBindingVariadicExpr) {
|
|
24129
|
+
throw new Error(`Illegal State: Pipes are not allowed in this context`);
|
|
24130
|
+
}
|
|
24131
|
+
else if (expr instanceof ContextExpr) {
|
|
24109
24132
|
op.usesComponentInstance = true;
|
|
24110
24133
|
return new TrackContextExpr(expr.view);
|
|
24111
24134
|
}
|
|
24112
24135
|
return expr;
|
|
24113
24136
|
}, VisitorContextFlag.None);
|
|
24137
|
+
// Also create an OpList for the tracking expression since it may need
|
|
24138
|
+
// additional ops when generating the final code (e.g. temporary variables).
|
|
24139
|
+
const trackOpList = new OpList();
|
|
24140
|
+
trackOpList.push(createStatementOp(new ReturnStatement(op.track, op.track.sourceSpan)));
|
|
24141
|
+
op.trackByOps = trackOpList;
|
|
24114
24142
|
}
|
|
24115
24143
|
}
|
|
24116
24144
|
}
|
|
@@ -24335,6 +24363,9 @@ function optimizeVariables(job) {
|
|
|
24335
24363
|
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
24336
24364
|
inlineAlwaysInlineVariables(op.handlerOps);
|
|
24337
24365
|
}
|
|
24366
|
+
else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
|
|
24367
|
+
inlineAlwaysInlineVariables(op.trackByOps);
|
|
24368
|
+
}
|
|
24338
24369
|
}
|
|
24339
24370
|
optimizeVariablesInOpList(unit.create, job.compatibility);
|
|
24340
24371
|
optimizeVariablesInOpList(unit.update, job.compatibility);
|
|
@@ -24342,6 +24373,9 @@ function optimizeVariables(job) {
|
|
|
24342
24373
|
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
24343
24374
|
optimizeVariablesInOpList(op.handlerOps, job.compatibility);
|
|
24344
24375
|
}
|
|
24376
|
+
else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) {
|
|
24377
|
+
optimizeVariablesInOpList(op.trackByOps, job.compatibility);
|
|
24378
|
+
}
|
|
24345
24379
|
}
|
|
24346
24380
|
}
|
|
24347
24381
|
}
|
|
@@ -24922,7 +24956,6 @@ const phases = [
|
|
|
24922
24956
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
|
|
24923
24957
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
|
|
24924
24958
|
{ kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
|
|
24925
|
-
{ kind: CompilationJobKind.Tmpl, fn: generateTrackFns },
|
|
24926
24959
|
{ kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
|
|
24927
24960
|
{ kind: CompilationJobKind.Tmpl, fn: collectConstExpressions },
|
|
24928
24961
|
{ kind: CompilationJobKind.Both, fn: collectElementConsts },
|
|
@@ -28465,7 +28498,6 @@ function addFeatures(definitionMap, meta) {
|
|
|
28465
28498
|
const features = [];
|
|
28466
28499
|
const providers = meta.providers;
|
|
28467
28500
|
const viewProviders = meta.viewProviders;
|
|
28468
|
-
const inputKeys = Object.keys(meta.inputs);
|
|
28469
28501
|
if (providers || viewProviders) {
|
|
28470
28502
|
const args = [providers || new LiteralArrayExpr([])];
|
|
28471
28503
|
if (viewProviders) {
|
|
@@ -28473,12 +28505,6 @@ function addFeatures(definitionMap, meta) {
|
|
|
28473
28505
|
}
|
|
28474
28506
|
features.push(importExpr(Identifiers.ProvidersFeature).callFn(args));
|
|
28475
28507
|
}
|
|
28476
|
-
for (const key of inputKeys) {
|
|
28477
|
-
if (meta.inputs[key].transformFunction !== null) {
|
|
28478
|
-
features.push(importExpr(Identifiers.InputTransformsFeatureFeature));
|
|
28479
|
-
break;
|
|
28480
|
-
}
|
|
28481
|
-
}
|
|
28482
28508
|
// Note: host directives feature needs to be inserted before the
|
|
28483
28509
|
// inheritance feature to ensure the correct execution order.
|
|
28484
28510
|
if (meta.hostDirectives?.length) {
|
|
@@ -30451,7 +30477,7 @@ function publishFacade(global) {
|
|
|
30451
30477
|
* @description
|
|
30452
30478
|
* Entry point for all public APIs of the compiler package.
|
|
30453
30479
|
*/
|
|
30454
|
-
new Version('19.1.
|
|
30480
|
+
new Version('19.1.7');
|
|
30455
30481
|
|
|
30456
30482
|
const _I18N_ATTR = 'i18n';
|
|
30457
30483
|
const _I18N_ATTR_PREFIX = 'i18n-';
|
|
@@ -31859,7 +31885,7 @@ class NodeJSPathManipulation {
|
|
|
31859
31885
|
// G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
|
|
31860
31886
|
// CommonJS/ESM interop for determining the current file name and containing dir.
|
|
31861
31887
|
const isCommonJS = typeof __filename !== 'undefined';
|
|
31862
|
-
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || new URL('checker-
|
|
31888
|
+
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || new URL('checker-2bdbb582.js', document.baseURI).href));
|
|
31863
31889
|
const currentFileName = isCommonJS ? __filename : url.fileURLToPath(currentFileUrl);
|
|
31864
31890
|
/**
|
|
31865
31891
|
* A wrapper around the Node.js file-system that supports readonly operations and path manipulation.
|
|
@@ -32489,6 +32515,11 @@ const patchedReferencedAliasesSymbol = Symbol('patchedReferencedAliases');
|
|
|
32489
32515
|
* that have been referenced in a value-position by the transform, such the installed patch can
|
|
32490
32516
|
* ensure that those import declarations are not elided.
|
|
32491
32517
|
*
|
|
32518
|
+
* If `null` is returned then the transform operates in an isolated context, i.e. using the
|
|
32519
|
+
* `ts.transform` API. In such scenario there is no information whether an alias declaration
|
|
32520
|
+
* is referenced, so all alias declarations are naturally preserved and explicitly registering
|
|
32521
|
+
* an alias declaration as used isn't necessary.
|
|
32522
|
+
*
|
|
32492
32523
|
* See below. Note that this uses sourcegraph as the TypeScript checker file doesn't display on
|
|
32493
32524
|
* Github.
|
|
32494
32525
|
* https://sourcegraph.com/github.com/microsoft/TypeScript@3eaa7c65f6f076a08a5f7f1946fd0df7c7430259/-/blob/src/compiler/checker.ts#L31219-31257
|
|
@@ -32500,6 +32531,11 @@ function loadIsReferencedAliasDeclarationPatch(context) {
|
|
|
32500
32531
|
throwIncompatibleTransformationContextError();
|
|
32501
32532
|
}
|
|
32502
32533
|
const emitResolver = context.getEmitResolver();
|
|
32534
|
+
if (emitResolver === undefined) {
|
|
32535
|
+
// In isolated `ts.transform` operations no emit resolver is present, return null as `isReferencedAliasDeclaration`
|
|
32536
|
+
// will never be invoked.
|
|
32537
|
+
return null;
|
|
32538
|
+
}
|
|
32503
32539
|
// The emit resolver may have been patched already, in which case we return the set of referenced
|
|
32504
32540
|
// aliases that was created when the patch was first applied.
|
|
32505
32541
|
// See https://github.com/angular/angular/issues/40276.
|
|
@@ -32625,7 +32661,7 @@ class DefaultImportTracker {
|
|
|
32625
32661
|
if (clausesToPreserve === null) {
|
|
32626
32662
|
clausesToPreserve = loadIsReferencedAliasDeclarationPatch(context);
|
|
32627
32663
|
}
|
|
32628
|
-
clausesToPreserve
|
|
32664
|
+
clausesToPreserve?.add(clause);
|
|
32629
32665
|
}
|
|
32630
32666
|
}
|
|
32631
32667
|
return sourceFile;
|
|
@@ -35822,7 +35858,9 @@ function createTsTransformForImportManager(manager, extraStatementsForFiles) {
|
|
|
35822
35858
|
// doesn't drop these thinking they are unused.
|
|
35823
35859
|
if (reusedOriginalAliasDeclarations.size > 0) {
|
|
35824
35860
|
const referencedAliasDeclarations = loadIsReferencedAliasDeclarationPatch(ctx);
|
|
35825
|
-
|
|
35861
|
+
if (referencedAliasDeclarations !== null) {
|
|
35862
|
+
reusedOriginalAliasDeclarations.forEach((aliasDecl) => referencedAliasDeclarations.add(aliasDecl));
|
|
35863
|
+
}
|
|
35826
35864
|
}
|
|
35827
35865
|
// Update the set of affected files to include files that need extra statements to be inserted.
|
|
35828
35866
|
if (extraStatementsForFiles !== undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.1.
|
|
3
|
+
* @license Angular v19.1.7
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-
|
|
13
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
12
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
|
|
13
|
+
var apply_import_manager = require('./apply_import_manager-3220dafc.js');
|
|
14
14
|
require('os');
|
|
15
15
|
var ts = require('typescript');
|
|
16
|
-
var checker = require('./checker-
|
|
17
|
-
var program = require('./program-
|
|
16
|
+
var checker = require('./checker-2bdbb582.js');
|
|
17
|
+
var program = require('./program-f43dcb10.js');
|
|
18
18
|
require('path');
|
|
19
|
-
require('./index-
|
|
19
|
+
require('./index-4978a91a.js');
|
|
20
20
|
require('@angular-devkit/core');
|
|
21
21
|
require('node:path/posix');
|
|
22
22
|
require('fs');
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.1.
|
|
3
|
+
* @license Angular v19.1.7
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
|
-
var checker = require('./checker-
|
|
10
|
+
var checker = require('./checker-2bdbb582.js');
|
|
11
11
|
require('os');
|
|
12
12
|
var p = require('path');
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.1.
|
|
3
|
+
* @license Angular v19.1.7
|
|
4
4
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -10,8 +10,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
|
|
11
11
|
var schematics = require('@angular-devkit/schematics');
|
|
12
12
|
var p = require('path');
|
|
13
|
-
var compiler_host = require('./compiler_host-
|
|
14
|
-
var checker = require('./checker-
|
|
13
|
+
var compiler_host = require('./compiler_host-833d3812.js');
|
|
14
|
+
var checker = require('./checker-2bdbb582.js');
|
|
15
15
|
var ts = require('typescript');
|
|
16
16
|
require('os');
|
|
17
17
|
require('fs');
|
|
@@ -297,12 +297,19 @@ class CommonCollector extends checker.RecursiveVisitor {
|
|
|
297
297
|
this.count++;
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
|
+
super.visitBlock(ast, null);
|
|
300
301
|
}
|
|
301
302
|
visitText(ast) {
|
|
302
303
|
if (this.hasPipes(ast.value)) {
|
|
303
304
|
this.count++;
|
|
304
305
|
}
|
|
305
306
|
}
|
|
307
|
+
visitLetDeclaration(decl) {
|
|
308
|
+
if (this.hasPipes(decl.value)) {
|
|
309
|
+
this.count++;
|
|
310
|
+
}
|
|
311
|
+
super.visitLetDeclaration(decl, null);
|
|
312
|
+
}
|
|
306
313
|
hasDirectives(input) {
|
|
307
314
|
return commonModuleDirectives.has(input);
|
|
308
315
|
}
|