@angular/core 19.1.0-next.1 → 19.1.0-next.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.
Files changed (33) hide show
  1. package/fesm2022/core.mjs +274 -96
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  4. package/fesm2022/primitives/signals.mjs +1 -1
  5. package/fesm2022/rxjs-interop.mjs +1 -1
  6. package/fesm2022/testing.mjs +10 -10
  7. package/fesm2022/testing.mjs.map +1 -1
  8. package/index.d.ts +174 -122
  9. package/package.json +1 -1
  10. package/primitives/event-dispatch/index.d.ts +1 -1
  11. package/primitives/signals/index.d.ts +1 -1
  12. package/rxjs-interop/index.d.ts +1 -1
  13. package/schematics/bundles/{checker-a00b735e.js → checker-228cb8a8.js} +143 -40
  14. package/schematics/bundles/{combine_units-4983dfd3.js → combine_units-5d6a7099.js} +3 -3
  15. package/schematics/bundles/{compiler_host-3e96c3f7.js → compiler_host-fc806dbe.js} +2 -2
  16. package/schematics/bundles/control-flow-migration.js +3 -3
  17. package/schematics/bundles/explicit-standalone-flag.js +5 -5
  18. package/schematics/bundles/{imports-44987700.js → imports-abe29092.js} +2 -2
  19. package/schematics/bundles/inject-migration.js +10 -10
  20. package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-d190b83b.js} +1 -1
  21. package/schematics/bundles/{migrate_ts_type_references-58326be5.js → migrate_ts_type_references-d02c6750.js} +9 -9
  22. package/schematics/bundles/{nodes-b12e919a.js → nodes-a9f0b985.js} +2 -2
  23. package/schematics/bundles/output-migration.js +5 -5
  24. package/schematics/bundles/pending-tasks.js +5 -5
  25. package/schematics/bundles/{program-37562cc3.js → program-1591ec8f.js} +31 -24
  26. package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-e9ccccbf.js} +1 -1
  27. package/schematics/bundles/provide-initializer.js +5 -5
  28. package/schematics/bundles/route-lazy-loading.js +4 -4
  29. package/schematics/bundles/signal-input-migration.js +8 -8
  30. package/schematics/bundles/signal-queries-migration.js +7 -7
  31. package/schematics/bundles/signals.js +7 -7
  32. package/schematics/bundles/standalone-migration.js +8 -8
  33. package/testing/index.d.ts +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "19.1.0-next.1",
3
+ "version": "19.1.0-next.3",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.1.0-next.1
2
+ * @license Angular v19.1.0-next.3
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.1.0-next.1
2
+ * @license Angular v19.1.0-next.3
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.1.0-next.1
2
+ * @license Angular v19.1.0-next.3
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.1.0-next.1
3
+ * @license Angular v19.1.0-next.3
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -2897,6 +2897,10 @@ class Identifiers {
2897
2897
  static declareLet = { name: 'ɵɵdeclareLet', moduleName: CORE };
2898
2898
  static storeLet = { name: 'ɵɵstoreLet', moduleName: CORE };
2899
2899
  static readContextLet = { name: 'ɵɵreadContextLet', moduleName: CORE };
2900
+ static attachSourceLocations = {
2901
+ name: 'ɵɵattachSourceLocations',
2902
+ moduleName: CORE,
2903
+ };
2900
2904
  static NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE };
2901
2905
  static InheritDefinitionFeature = {
2902
2906
  name: 'ɵɵInheritDefinitionFeature',
@@ -3776,7 +3780,7 @@ function convertFromMaybeForwardRefExpression({ expression, forwardRef, }) {
3776
3780
  /**
3777
3781
  * Generate an expression that has the given `expr` wrapped in the following form:
3778
3782
  *
3779
- * ```
3783
+ * ```ts
3780
3784
  * forwardRef(() => expr)
3781
3785
  * ```
3782
3786
  */
@@ -8507,6 +8511,10 @@ var OpKind;
8507
8511
  * A creation op that corresponds to i18n attributes on an element.
8508
8512
  */
8509
8513
  OpKind[OpKind["I18nAttributes"] = 49] = "I18nAttributes";
8514
+ /**
8515
+ * Creation op that attaches the location at which an element was defined in a template to it.
8516
+ */
8517
+ OpKind[OpKind["SourceLocation"] = 50] = "SourceLocation";
8510
8518
  })(OpKind || (OpKind = {}));
8511
8519
  /**
8512
8520
  * Distinguishes different kinds of IR expressions.
@@ -10048,6 +10056,7 @@ function transformExpressionsInOp(op, transform, flags) {
10048
10056
  case OpKind.I18nAttributes:
10049
10057
  case OpKind.IcuPlaceholder:
10050
10058
  case OpKind.DeclareLet:
10059
+ case OpKind.SourceLocation:
10051
10060
  // These operations contain no expressions.
10052
10061
  break;
10053
10062
  default:
@@ -10835,6 +10844,15 @@ function createI18nAttributesOp(xref, handle, target) {
10835
10844
  ...TRAIT_CONSUMES_SLOT,
10836
10845
  };
10837
10846
  }
10847
+ /** Create a `SourceLocationOp`. */
10848
+ function createSourceLocationOp(templatePath, locations) {
10849
+ return {
10850
+ kind: OpKind.SourceLocation,
10851
+ templatePath,
10852
+ locations,
10853
+ ...NEW_OP,
10854
+ };
10855
+ }
10838
10856
 
10839
10857
  function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, securityContext, sourceSpan) {
10840
10858
  return {
@@ -10897,12 +10915,16 @@ class ComponentCompilationJob extends CompilationJob {
10897
10915
  i18nUseExternalIds;
10898
10916
  deferMeta;
10899
10917
  allDeferrableDepsFn;
10900
- constructor(componentName, pool, compatibility, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn) {
10918
+ relativeTemplatePath;
10919
+ enableDebugLocations;
10920
+ constructor(componentName, pool, compatibility, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
10901
10921
  super(componentName, pool, compatibility);
10902
10922
  this.relativeContextFilePath = relativeContextFilePath;
10903
10923
  this.i18nUseExternalIds = i18nUseExternalIds;
10904
10924
  this.deferMeta = deferMeta;
10905
10925
  this.allDeferrableDepsFn = allDeferrableDepsFn;
10926
+ this.relativeTemplatePath = relativeTemplatePath;
10927
+ this.enableDebugLocations = enableDebugLocations;
10906
10928
  this.root = new ViewCompilationUnit(this, this.allocateXrefId(), null);
10907
10929
  this.views.set(this.root.xref, this.root);
10908
10930
  }
@@ -11447,14 +11469,14 @@ const MAX_CHAIN_LENGTH = 256;
11447
11469
  *
11448
11470
  * For example, two `elementStart` operations in sequence:
11449
11471
  *
11450
- * ```typescript
11472
+ * ```ts
11451
11473
  * elementStart(0, 'div');
11452
11474
  * elementStart(1, 'span');
11453
11475
  * ```
11454
11476
  *
11455
11477
  * Can be called as a chain instead:
11456
11478
  *
11457
- * ```typescript
11479
+ * ```ts
11458
11480
  * elementStart(0, 'div')(1, 'span');
11459
11481
  * ```
11460
11482
  */
@@ -20484,7 +20506,7 @@ const GOOG_GET_MSG = 'goog.getMsg';
20484
20506
  *
20485
20507
  * Generates:
20486
20508
  *
20487
- * ```typescript
20509
+ * ```ts
20488
20510
  * const MSG_FOO = goog.getMsg(
20489
20511
  * // Message template.
20490
20512
  * 'Sent from {$interpolation} to {$startTagSpan}{$interpolation_1}{$closeTagSpan}.',
@@ -20928,7 +20950,7 @@ function addSubMessageParams(messageOp, subMessagePlaceholders) {
20928
20950
  /**
20929
20951
  * Generate statements that define a given translation message.
20930
20952
  *
20931
- * ```
20953
+ * ```ts
20932
20954
  * var I18N_1;
20933
20955
  * if (typeof ngI18nClosureMode !== undefined && ngI18nClosureMode) {
20934
20956
  * var MSG_EXTERNAL_XXX = goog.getMsg(
@@ -20967,7 +20989,7 @@ function getTranslationDeclStmts(message, variable, closureVar, params, transfor
20967
20989
  * Create the expression that will be used to guard the closure mode block
20968
20990
  * It is equivalent to:
20969
20991
  *
20970
- * ```
20992
+ * ```ts
20971
20993
  * typeof ngI18nClosureMode !== undefined && ngI18nClosureMode
20972
20994
  * ```
20973
20995
  */
@@ -22393,6 +22415,9 @@ function syntheticHostProperty(name, expression, sourceSpan) {
22393
22415
  function pureFunction(varOffset, fn, args) {
22394
22416
  return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG, [literal$1(varOffset), fn], args, [], null);
22395
22417
  }
22418
+ function attachSourceLocation(templatePath, locations) {
22419
+ return call(Identifiers.attachSourceLocations, [literal$1(templatePath), locations], null);
22420
+ }
22396
22421
  /**
22397
22422
  * Collates the string an expression arguments for an interpolation instruction.
22398
22423
  */
@@ -22807,6 +22832,20 @@ function reifyCreateOperations(unit, ops) {
22807
22832
  }
22808
22833
  OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.emptyTag, op.emptyAttributes, op.wholeSourceSpan));
22809
22834
  break;
22835
+ case OpKind.SourceLocation:
22836
+ const locationsLiteral = literalArr(op.locations.map(({ targetSlot, offset, line, column }) => {
22837
+ if (targetSlot.slot === null) {
22838
+ throw new Error('No slot was assigned for source location');
22839
+ }
22840
+ return literalArr([
22841
+ literal$1(targetSlot.slot),
22842
+ literal$1(offset),
22843
+ literal$1(line),
22844
+ literal$1(column),
22845
+ ]);
22846
+ }));
22847
+ OpList.replace(op, attachSourceLocation(op.templatePath, locationsLiteral));
22848
+ break;
22810
22849
  case OpKind.Statement:
22811
22850
  // Pass statement operations directly through.
22812
22851
  break;
@@ -24766,6 +24805,33 @@ function generateLocalLetReferences(job) {
24766
24805
  }
24767
24806
  }
24768
24807
 
24808
+ /**
24809
+ * Locates all of the elements defined in a creation block and outputs an op
24810
+ * that will expose their definition location in the DOM.
24811
+ */
24812
+ function attachSourceLocations(job) {
24813
+ if (!job.enableDebugLocations || job.relativeTemplatePath === null) {
24814
+ return;
24815
+ }
24816
+ for (const unit of job.units) {
24817
+ const locations = [];
24818
+ for (const op of unit.create) {
24819
+ if (op.kind === OpKind.ElementStart || op.kind === OpKind.Element) {
24820
+ const start = op.startSourceSpan.start;
24821
+ locations.push({
24822
+ targetSlot: op.handle,
24823
+ offset: start.offset,
24824
+ line: start.line,
24825
+ column: start.col,
24826
+ });
24827
+ }
24828
+ }
24829
+ if (locations.length > 0) {
24830
+ unit.create.push(createSourceLocationOp(job.relativeTemplatePath, locations));
24831
+ }
24832
+ }
24833
+ }
24834
+
24769
24835
  /**
24770
24836
  *
24771
24837
  * @license
@@ -24835,6 +24901,7 @@ const phases = [
24835
24901
  { kind: CompilationJobKind.Tmpl, fn: mergeNextContextExpressions },
24836
24902
  { kind: CompilationJobKind.Tmpl, fn: generateNgContainerOps },
24837
24903
  { kind: CompilationJobKind.Tmpl, fn: collapseEmptyInstructions },
24904
+ { kind: CompilationJobKind.Tmpl, fn: attachSourceLocations },
24838
24905
  { kind: CompilationJobKind.Tmpl, fn: disableBindings$1 },
24839
24906
  { kind: CompilationJobKind.Both, fn: extractPureFunctions },
24840
24907
  { kind: CompilationJobKind.Both, fn: reify },
@@ -24953,8 +25020,8 @@ function isSingleI18nIcu(meta) {
24953
25020
  * representation.
24954
25021
  * TODO: Refactor more of the ingestion code into phases.
24955
25022
  */
24956
- function ingestComponent(componentName, template, constantPool, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn) {
24957
- const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn);
25023
+ function ingestComponent(componentName, template, constantPool, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) {
25024
+ const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations);
24958
25025
  ingestNodes(job.root, template);
24959
25026
  return job;
24960
25027
  }
@@ -25978,6 +26045,26 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
25978
26045
  return null;
25979
26046
  }
25980
26047
 
26048
+ /*!
26049
+ * @license
26050
+ * Copyright Google LLC All Rights Reserved.
26051
+ *
26052
+ * Use of this source code is governed by an MIT-style license that can be
26053
+ * found in the LICENSE file at https://angular.dev/license
26054
+ */
26055
+ /**
26056
+ * Whether to produce instructions that will attach the source location to each DOM node.
26057
+ *
26058
+ * !!!Important!!! at the time of writing this flag isn't exposed externally, but internal debug
26059
+ * tools enable it via a local change. Any modifications to this flag need to update the
26060
+ * internal tooling as well.
26061
+ */
26062
+ let ENABLE_TEMPLATE_SOURCE_LOCATIONS = false;
26063
+ /** Gets whether template source locations are enabled. */
26064
+ function getTemplateSourceLocationsEnabled() {
26065
+ return ENABLE_TEMPLATE_SOURCE_LOCATIONS;
26066
+ }
26067
+
25981
26068
  // if (rf & flags) { .. }
25982
26069
  function renderFlagCheckIfStmt(flags, statements) {
25983
26070
  return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal$1(flags), null, false), statements);
@@ -26048,7 +26135,7 @@ const queryAdvancePlaceholder = Symbol('queryAdvancePlaceholder');
26048
26135
  *
26049
26136
  * --> will turn into
26050
26137
  *
26051
- * ```
26138
+ * ```ts
26052
26139
  * bla();
26053
26140
  * queryAdvance(2);
26054
26141
  * bla();
@@ -28412,7 +28499,7 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
28412
28499
  allDeferrableDepsFn = variable(fnName);
28413
28500
  }
28414
28501
  // First the template is ingested into IR:
28415
- const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.defer, allDeferrableDepsFn);
28502
+ const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.defer, allDeferrableDepsFn, meta.relativeTemplatePath, getTemplateSourceLocationsEnabled());
28416
28503
  // Then the IR is transformed to prepare it for cod egeneration.
28417
28504
  transform(tpl, CompilationJobKind.Tmpl);
28418
28505
  // Finally we emit the template function:
@@ -29791,6 +29878,7 @@ class CompilerFacadeImpl {
29791
29878
  viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) : null,
29792
29879
  relativeContextFilePath: '',
29793
29880
  i18nUseExternalIds: true,
29881
+ relativeTemplatePath: null,
29794
29882
  };
29795
29883
  const jitExpressionSourceMap = `ng:///${facade.name}.js`;
29796
29884
  return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta);
@@ -30046,6 +30134,7 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
30046
30134
  declarationListEmitMode: 2 /* DeclarationListEmitMode.ClosureResolved */,
30047
30135
  relativeContextFilePath: '',
30048
30136
  i18nUseExternalIds: true,
30137
+ relativeTemplatePath: null,
30049
30138
  };
30050
30139
  }
30051
30140
  function convertDeclarationFacadeToMetadata(declaration) {
@@ -30321,7 +30410,7 @@ function publishFacade(global) {
30321
30410
  * @description
30322
30411
  * Entry point for all public APIs of the compiler package.
30323
30412
  */
30324
- new Version('19.1.0-next.1');
30413
+ new Version('19.1.0-next.3');
30325
30414
 
30326
30415
  const _I18N_ATTR = 'i18n';
30327
30416
  const _I18N_ATTR_PREFIX = 'i18n-';
@@ -31056,7 +31145,7 @@ exports.ErrorCode = void 0;
31056
31145
  * The tracking expression of a `for` loop block is accessing a variable that is unavailable,
31057
31146
  * for example:
31058
31147
  *
31059
- * ```
31148
+ * ```angular-html
31060
31149
  * <ng-template let-ref>
31061
31150
  * @for (item of items; track ref) {}
31062
31151
  * </ng-template>
@@ -31067,7 +31156,7 @@ exports.ErrorCode = void 0;
31067
31156
  * The trigger of a `defer` block cannot access its trigger element,
31068
31157
  * either because it doesn't exist or it's in a different view.
31069
31158
  *
31070
- * ```
31159
+ * ```angular-html
31071
31160
  * @defer (on interaction(trigger)) {...}
31072
31161
  *
31073
31162
  * <ng-template>
@@ -31080,7 +31169,7 @@ exports.ErrorCode = void 0;
31080
31169
  * A control flow node is projected at the root of a component and is preventing its direct
31081
31170
  * descendants from being projected, because it has more than one root node.
31082
31171
  *
31083
- * ```
31172
+ * ```angular-html
31084
31173
  * <comp>
31085
31174
  * @if (expr) {
31086
31175
  * <div projectsIntoSlot></div>
@@ -31115,7 +31204,7 @@ exports.ErrorCode = void 0;
31115
31204
  * A two way binding in a template has an incorrect syntax,
31116
31205
  * parentheses outside brackets. For example:
31117
31206
  *
31118
- * ```
31207
+ * ```html
31119
31208
  * <div ([foo])="bar" />
31120
31209
  * ```
31121
31210
  */
@@ -31123,7 +31212,7 @@ exports.ErrorCode = void 0;
31123
31212
  /**
31124
31213
  * The left side of a nullish coalescing operation is not nullable.
31125
31214
  *
31126
- * ```
31215
+ * ```html
31127
31216
  * {{ foo ?? bar }}
31128
31217
  * ```
31129
31218
  * When the type of foo doesn't include `null` or `undefined`.
@@ -31138,7 +31227,7 @@ exports.ErrorCode = void 0;
31138
31227
  * A text attribute is not interpreted as a binding but likely intended to be.
31139
31228
  *
31140
31229
  * For example:
31141
- * ```
31230
+ * ```html
31142
31231
  * <div
31143
31232
  * attr.x="value"
31144
31233
  * class.blue="true"
@@ -31155,7 +31244,7 @@ exports.ErrorCode = void 0;
31155
31244
  * in their statement.
31156
31245
  *
31157
31246
  * For example:
31158
- * ```
31247
+ * ```html
31159
31248
  * <ul><li *ngFor="item of items">{{item["name"]}};</li></ul>
31160
31249
  * ```
31161
31250
  */
@@ -31174,7 +31263,7 @@ exports.ErrorCode = void 0;
31174
31263
  /**
31175
31264
  * The left side of an optional chain operation is not nullable.
31176
31265
  *
31177
- * ```
31266
+ * ```html
31178
31267
  * {{ foo?.bar }}
31179
31268
  * {{ foo?.['bar'] }}
31180
31269
  * {{ foo?.() }}
@@ -31186,7 +31275,7 @@ exports.ErrorCode = void 0;
31186
31275
  * `ngSkipHydration` should not be a binding (it should be a static attribute).
31187
31276
  *
31188
31277
  * For example:
31189
- * ```
31278
+ * ```html
31190
31279
  * <my-cmp [ngSkipHydration]="someTruthyVar" />
31191
31280
  * ```
31192
31281
  *
@@ -31198,7 +31287,7 @@ exports.ErrorCode = void 0;
31198
31287
  * Signal functions should be invoked when interpolated in templates.
31199
31288
  *
31200
31289
  * For example:
31201
- * ```
31290
+ * ```html
31202
31291
  * {{ mySignal() }}
31203
31292
  * ```
31204
31293
  */
@@ -31206,7 +31295,7 @@ exports.ErrorCode = void 0;
31206
31295
  /**
31207
31296
  * Initializer-based APIs can only be invoked from inside of an initializer.
31208
31297
  *
31209
- * ```
31298
+ * ```ts
31210
31299
  * // Allowed
31211
31300
  * myInput = input();
31212
31301
  *
@@ -31221,7 +31310,7 @@ exports.ErrorCode = void 0;
31221
31310
  * A function in an event binding is not called.
31222
31311
  *
31223
31312
  * For example:
31224
- * ```
31313
+ * ```html
31225
31314
  * <button (click)="myFunc"></button>
31226
31315
  * ```
31227
31316
  *
@@ -31233,7 +31322,7 @@ exports.ErrorCode = void 0;
31233
31322
  * A `@let` declaration in a template isn't used.
31234
31323
  *
31235
31324
  * For example:
31236
- * ```
31325
+ * ```angular-html
31237
31326
  * @let used = 1; <!-- Not an error -->
31238
31327
  * @let notUsed = 2; <!-- Error -->
31239
31328
  *
@@ -31729,7 +31818,7 @@ class NodeJSPathManipulation {
31729
31818
  // G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
31730
31819
  // CommonJS/ESM interop for determining the current file name and containing dir.
31731
31820
  const isCommonJS = typeof __filename !== 'undefined';
31732
- 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-a00b735e.js', document.baseURI).href));
31821
+ 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-228cb8a8.js', document.baseURI).href));
31733
31822
  const currentFileName = isCommonJS ? __filename : url.fileURLToPath(currentFileUrl);
31734
31823
  /**
31735
31824
  * A wrapper around the Node.js file-system that supports readonly operations and path manipulation.
@@ -36539,7 +36628,7 @@ function canEmitType(type, canEmit) {
36539
36628
  *
36540
36629
  * For example, consider the following code:
36541
36630
  *
36542
- * ```
36631
+ * ```ts
36543
36632
  * import {NgIterable} from '@angular/core';
36544
36633
  *
36545
36634
  * class NgForOf<T, U extends NgIterable<T>> {}
@@ -36551,7 +36640,7 @@ function canEmitType(type, canEmit) {
36551
36640
  * `NgIterable` type reference to a type reference that is valid in the context in which it is
36552
36641
  * emitted, for example:
36553
36642
  *
36554
- * ```
36643
+ * ```ts
36555
36644
  * import * as i0 from '@angular/core';
36556
36645
  * import * as i1 from '@angular/common';
36557
36646
  *
@@ -40241,7 +40330,7 @@ function requiresInlineTypeCtor(node, host, env) {
40241
40330
  * fails. This can happen when inferring a complex type from 'any'. For example, if `NgFor`'s
40242
40331
  * inference is done with the TCB code:
40243
40332
  *
40244
- * ```
40333
+ * ```ts
40245
40334
  * class NgFor<T> {
40246
40335
  * ngForOf: T[];
40247
40336
  * }
@@ -40252,14 +40341,14 @@ function requiresInlineTypeCtor(node, host, env) {
40252
40341
  *
40253
40342
  * An invocation looks like:
40254
40343
  *
40255
- * ```
40344
+ * ```ts
40256
40345
  * var _t1 = ctor({ngForOf: [1, 2], ngForTrackBy: null as any, ngForTemplate: null as any});
40257
40346
  * ```
40258
40347
  *
40259
40348
  * This correctly infers the type `NgFor<number>` for `_t1`, since `T` is inferred from the
40260
40349
  * assignment of type `number[]` to `ngForOf`'s type `T[]`. However, if `any` is passed instead:
40261
40350
  *
40262
- * ```
40351
+ * ```ts
40263
40352
  * var _t2 = ctor({ngForOf: [1, 2] as any, ngForTrackBy: null as any, ngForTemplate: null as
40264
40353
  * any});
40265
40354
  * ```
@@ -40270,7 +40359,7 @@ function requiresInlineTypeCtor(node, host, env) {
40270
40359
  * Adding a default type to the generic declaration in the constructor solves this problem, as
40271
40360
  * the default type will be used in the event that inference fails.
40272
40361
  *
40273
- * ```
40362
+ * ```ts
40274
40363
  * declare function ctor<T = any>(o: Pick<NgFor<T>, 'ngForOf'>): NgFor<T>;
40275
40364
  *
40276
40365
  * var _t3 = ctor({ngForOf: [1, 2] as any});
@@ -41660,7 +41749,7 @@ class TcbGenericDirectiveTypeWithAnyParamsOp extends TcbDirectiveTypeOpBase {
41660
41749
  * The initializer for the variable is the variable expression for the directive, template, or
41661
41750
  * element the ref refers to. When the reference is used in the template, those TCB statements will
41662
41751
  * access this variable as well. For example:
41663
- * ```
41752
+ * ```ts
41664
41753
  * var _t1 = document.createElement('div');
41665
41754
  * var _t2 = _t1;
41666
41755
  * _t2.value
@@ -42255,7 +42344,7 @@ class TcbDirectiveOutputsOp extends TcbOp {
42255
42344
  }
42256
42345
  if (this.tcb.env.config.checkTypeOfOutputEvents && output.name.endsWith('Change')) {
42257
42346
  const inputName = output.name.slice(0, -6);
42258
- isSplitTwoWayBinding(inputName, output, this.node.inputs, this.tcb);
42347
+ checkSplitTwoWayBinding(inputName, output, this.node.inputs, this.tcb);
42259
42348
  }
42260
42349
  // TODO(alxhub): consider supporting multiple fields with the same property name for outputs.
42261
42350
  const field = outputs.getByBindingPropertyName(output.name)[0].classPropertyName;
@@ -42323,7 +42412,7 @@ class TcbUnclaimedOutputsOp extends TcbOp {
42323
42412
  }
42324
42413
  if (this.tcb.env.config.checkTypeOfOutputEvents && output.name.endsWith('Change')) {
42325
42414
  const inputName = output.name.slice(0, -6);
42326
- if (isSplitTwoWayBinding(inputName, output, this.element.inputs, this.tcb)) {
42415
+ if (checkSplitTwoWayBinding(inputName, output, this.element.inputs, this.tcb)) {
42327
42416
  // Skip this event handler as the error was already handled.
42328
42417
  continue;
42329
42418
  }
@@ -43611,6 +43700,20 @@ const EVENT_PARAMETER = '$event';
43611
43700
  */
43612
43701
  function tcbCreateEventHandler(event, tcb, scope, eventType) {
43613
43702
  const handler = tcbEventHandlerExpression(event.handler, tcb, scope);
43703
+ const statements = [];
43704
+ // TODO(crisbeto): remove the `checkTwoWayBoundEvents` check in v20.
43705
+ if (event.type === exports.ParsedEventType.TwoWay && tcb.env.config.checkTwoWayBoundEvents) {
43706
+ // If we're dealing with a two-way event, we create a variable initialized to the unwrapped
43707
+ // signal value of the expression and then we assign `$event` to it. Note that in most cases
43708
+ // this will already be covered by the corresponding input binding, however it allows us to
43709
+ // handle the case where the input has a wider type than the output (see #58971).
43710
+ const target = tcb.allocateId();
43711
+ const assignment = ts__default["default"].factory.createBinaryExpression(target, ts__default["default"].SyntaxKind.EqualsToken, ts__default["default"].factory.createIdentifier(EVENT_PARAMETER));
43712
+ statements.push(tsCreateVariable(target, tcb.env.config.allowSignalsInTwoWayBindings ? unwrapWritableSignal(handler, tcb) : handler), ts__default["default"].factory.createExpressionStatement(assignment));
43713
+ }
43714
+ else {
43715
+ statements.push(ts__default["default"].factory.createExpressionStatement(handler));
43716
+ }
43614
43717
  let eventParamType;
43615
43718
  if (eventType === 0 /* EventParamType.Infer */) {
43616
43719
  eventParamType = undefined;
@@ -43624,10 +43727,10 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
43624
43727
  // Obtain all guards that have been applied to the scope and its parents, as they have to be
43625
43728
  // repeated within the handler function for their narrowing to be in effect within the handler.
43626
43729
  const guards = scope.guards();
43627
- let body = ts__default["default"].factory.createExpressionStatement(handler);
43730
+ let body = ts__default["default"].factory.createBlock(statements);
43628
43731
  if (guards !== null) {
43629
43732
  // Wrap the body in an `if` statement containing all guards that have to be applied.
43630
- body = ts__default["default"].factory.createIfStatement(guards, body);
43733
+ body = ts__default["default"].factory.createBlock([ts__default["default"].factory.createIfStatement(guards, body)]);
43631
43734
  }
43632
43735
  const eventParam = ts__default["default"].factory.createParameterDeclaration(
43633
43736
  /* modifiers */ undefined,
@@ -43643,7 +43746,7 @@ function tcbCreateEventHandler(event, tcb, scope, eventType) {
43643
43746
  /* parameters */ [eventParam],
43644
43747
  /* type */ ts__default["default"].factory.createKeywordTypeNode(ts__default["default"].SyntaxKind.AnyKeyword),
43645
43748
  /* equalsGreaterThanToken */ undefined,
43646
- /* body */ ts__default["default"].factory.createBlock([body]));
43749
+ /* body */ body);
43647
43750
  }
43648
43751
  /**
43649
43752
  * Similar to `tcbExpression`, this function converts the provided `AST` expression into a
@@ -43654,7 +43757,7 @@ function tcbEventHandlerExpression(ast, tcb, scope) {
43654
43757
  const translator = new TcbEventHandlerTranslator(tcb, scope);
43655
43758
  return translator.translate(ast);
43656
43759
  }
43657
- function isSplitTwoWayBinding(inputName, output, inputs, tcb) {
43760
+ function checkSplitTwoWayBinding(inputName, output, inputs, tcb) {
43658
43761
  const input = inputs.find((input) => input.name === inputName);
43659
43762
  if (input === undefined || input.sourceSpan !== output.sourceSpan) {
43660
43763
  return false;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.1.0-next.1
3
+ * @license Angular v19.1.0-next.3
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-a00b735e.js');
14
- var program = require('./program-37562cc3.js');
13
+ var checker = require('./checker-228cb8a8.js');
14
+ var program = require('./program-1591ec8f.js');
15
15
  require('path');
16
16
 
17
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.1.0-next.1
3
+ * @license Angular v19.1.0-next.3
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-a00b735e.js');
10
+ var checker = require('./checker-228cb8a8.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.0-next.1
3
+ * @license Angular v19.1.0-next.3
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-3e96c3f7.js');
14
- var checker = require('./checker-a00b735e.js');
13
+ var compiler_host = require('./compiler_host-fc806dbe.js');
14
+ var checker = require('./checker-228cb8a8.js');
15
15
  var ts = require('typescript');
16
16
  require('os');
17
17
  require('fs');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.1.0-next.1
3
+ * @license Angular v19.1.0-next.3
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -10,12 +10,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
10
10
 
11
11
  var schematics = require('@angular-devkit/schematics');
12
12
  var p = require('path');
13
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
14
- var compiler_host = require('./compiler_host-3e96c3f7.js');
13
+ var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
14
+ var compiler_host = require('./compiler_host-fc806dbe.js');
15
15
  var ts = require('typescript');
16
- var imports = require('./imports-44987700.js');
16
+ var imports = require('./imports-abe29092.js');
17
17
  require('@angular-devkit/core');
18
- require('./checker-a00b735e.js');
18
+ require('./checker-228cb8a8.js');
19
19
  require('os');
20
20
  require('fs');
21
21
  require('module');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.1.0-next.1
3
+ * @license Angular v19.1.0-next.3
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -37,7 +37,7 @@ function getImportOfIdentifier(typeChecker, node) {
37
37
  * Gets a top-level import specifier with a specific name that is imported from a particular module.
38
38
  * E.g. given a file that looks like:
39
39
  *
40
- * ```
40
+ * ```ts
41
41
  * import { Component, Directive } from '@angular/core';
42
42
  * import { Foo } from './foo';
43
43
  * ```