@angular/core 19.1.0-next.2 → 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 +186 -6
  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 +6 -6
  7. package/fesm2022/testing.mjs.map +1 -1
  8. package/index.d.ts +80 -21
  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-c58f97d2.js → checker-228cb8a8.js} +116 -13
  14. package/schematics/bundles/{combine_units-8b29b7f6.js → combine_units-5d6a7099.js} +3 -3
  15. package/schematics/bundles/{compiler_host-f5d588fe.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-31a38653.js → imports-abe29092.js} +1 -1
  19. package/schematics/bundles/inject-migration.js +6 -6
  20. package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-d190b83b.js} +1 -1
  21. package/schematics/bundles/{migrate_ts_type_references-a8676ec1.js → migrate_ts_type_references-d02c6750.js} +5 -5
  22. package/schematics/bundles/{nodes-88c2157f.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-30e02255.js → program-1591ec8f.js} +30 -23
  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 +7 -7
  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 +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.1.0-next.2
2
+ * @license Angular v19.1.0-next.3
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2962,6 +2962,31 @@ export declare class DebugNode {
2962
2962
  get providerTokens(): any[];
2963
2963
  }
2964
2964
 
2965
+ /**
2966
+ * A debug representation of the signal graph.
2967
+ */
2968
+ declare interface DebugSignalGraph {
2969
+ nodes: DebugSignalGraphNode[];
2970
+ edges: DebugSignalGraphEdge[];
2971
+ }
2972
+
2973
+ declare interface DebugSignalGraphEdge {
2974
+ /**
2975
+ * Index of a signal node in the `nodes` array that is a consumer of the signal produced by the producer node.
2976
+ */
2977
+ consumer: number;
2978
+ /**
2979
+ * Index of a signal node in the `nodes` array that is a producer of the signal consumed by the consumer node.
2980
+ */
2981
+ producer: number;
2982
+ }
2983
+
2984
+ declare interface DebugSignalGraphNode {
2985
+ kind: string;
2986
+ label?: string;
2987
+ value?: unknown;
2988
+ }
2989
+
2965
2990
  declare const DECLARATION_COMPONENT_VIEW = 15;
2966
2991
 
2967
2992
  declare const DECLARATION_LCONTAINER = 16;
@@ -4742,6 +4767,18 @@ export declare function getPlatform(): PlatformRef | null;
4742
4767
  */
4743
4768
  declare function getRootComponents(elementOrDir: Element | {}): {}[];
4744
4769
 
4770
+ /**
4771
+ * Returns a debug representation of the signal graph for the given injector.
4772
+ *
4773
+ * Currently only supports element injectors. Starts by discovering the consumer nodes
4774
+ * and then traverses their producer nodes to build the signal graph.
4775
+ *
4776
+ * @param injector The injector to get the signal graph for.
4777
+ * @returns A debug representation of the signal graph.
4778
+ * @throws If the injector is an environment injector.
4779
+ */
4780
+ declare function getSignalGraph(injector: Injector): DebugSignalGraph;
4781
+
4745
4782
  /**
4746
4783
  * Adapter interface for retrieving the `Testability` service associated for a
4747
4784
  * particular context.
@@ -4782,6 +4819,7 @@ declare const globalUtilsFunctions: {
4782
4819
  ɵgetInjectorResolutionPath: typeof getInjectorResolutionPath;
4783
4820
  ɵgetInjectorMetadata: typeof getInjectorMetadata;
4784
4821
  ɵsetProfiler: (profiler: ɵProfiler_2 | null) => void;
4822
+ ɵgetSignalGraph: typeof getSignalGraph;
4785
4823
  getDirectiveMetadata: typeof getDirectiveMetadata;
4786
4824
  getComponent: typeof getComponent;
4787
4825
  getContext: typeof getContext;
@@ -6845,6 +6883,16 @@ declare interface Listener {
6845
6883
  type: 'dom' | 'output';
6846
6884
  }
6847
6885
 
6886
+ /**
6887
+ * Options that can be used to configure an event listener.
6888
+ * @publicApi
6889
+ */
6890
+ export declare interface ListenerOptions {
6891
+ capture?: boolean;
6892
+ once?: boolean;
6893
+ passive?: boolean;
6894
+ }
6895
+
6848
6896
  /**
6849
6897
  * Provide this token to set the locale of your application.
6850
6898
  * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
@@ -8408,24 +8456,6 @@ export declare class PendingTasks {
8408
8456
  static ɵprov: unknown;
8409
8457
  }
8410
8458
 
8411
- /**
8412
- * Internal implementation of the pending tasks service.
8413
- */
8414
- declare class PendingTasksInternal implements OnDestroy {
8415
- private taskId;
8416
- private pendingTasks;
8417
- private get _hasPendingTasks();
8418
- hasPendingTasks: BehaviorSubject<boolean>;
8419
- add(): number;
8420
- has(taskId: number): boolean;
8421
- remove(taskId: number): void;
8422
- ngOnDestroy(): void;
8423
- /** @nocollapse */
8424
- static ɵprov: unknown;
8425
- }
8426
- export { PendingTasksInternal as ɵPendingTasks }
8427
- export { PendingTasksInternal as ɵPendingTasksInternal }
8428
-
8429
8459
  /**
8430
8460
  * Type of the Pipe metadata.
8431
8461
  *
@@ -9332,7 +9362,7 @@ declare interface Renderer {
9332
9362
  removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2): void;
9333
9363
  setProperty(el: RElement, name: string, value: any): void;
9334
9364
  setValue(node: RText | RComment, value: string): void;
9335
- listen(target: GlobalTargetName | RNode, eventName: string, callback: (event: any) => boolean | void): () => void;
9365
+ listen(target: GlobalTargetName | RNode, eventName: string, callback: (event: any) => boolean | void, options?: ListenerOptions): () => void;
9336
9366
  }
9337
9367
 
9338
9368
  /**
@@ -9504,9 +9534,10 @@ export declare abstract class Renderer2 {
9504
9534
  * DOM element.
9505
9535
  * @param eventName The event to listen for.
9506
9536
  * @param callback A handler function to invoke when the event occurs.
9537
+ * @param options Options that configure how the event listener is bound.
9507
9538
  * @returns An "unlisten" function for disposing of this handler.
9508
9539
  */
9509
- abstract listen(target: 'window' | 'document' | 'body' | any, eventName: string, callback: (event: any) => boolean | void): () => void;
9540
+ abstract listen(target: 'window' | 'document' | 'body' | any, eventName: string, callback: (event: any) => boolean | void, options?: ListenerOptions): () => void;
9510
9541
  }
9511
9542
 
9512
9543
  declare interface RendererFactory {
@@ -14110,6 +14141,22 @@ export declare const enum ɵNotificationSource {
14110
14141
  */
14111
14142
  export declare function ɵpatchComponentDefWithScope<C>(componentDef: ɵComponentDef<C>, transitiveScopes: ɵNgModuleTransitiveScopes): void;
14112
14143
 
14144
+ /**
14145
+ * Internal implementation of the pending tasks service.
14146
+ */
14147
+ export declare class ɵPendingTasksInternal implements OnDestroy {
14148
+ private taskId;
14149
+ private pendingTasks;
14150
+ private get _hasPendingTasks();
14151
+ hasPendingTasks: BehaviorSubject<boolean>;
14152
+ add(): number;
14153
+ has(taskId: number): boolean;
14154
+ remove(taskId: number): void;
14155
+ ngOnDestroy(): void;
14156
+ /** @nocollapse */
14157
+ static ɵprov: unknown;
14158
+ }
14159
+
14113
14160
 
14114
14161
  export declare const ɵPERFORMANCE_MARK_PREFIX = "\uD83C\uDD70\uFE0F";
14115
14162
 
@@ -15128,6 +15175,18 @@ export declare const ɵZONELESS_ENABLED: InjectionToken<boolean>;
15128
15175
  */
15129
15176
  export declare function ɵɵadvance(delta?: number): void;
15130
15177
 
15178
+ /**
15179
+ * Sets the location within the source template at which
15180
+ * each element in the current view was defined.
15181
+ *
15182
+ * @param index Index at which the DOM node was created.
15183
+ * @param templatePath Path to the template at which the node was defined.
15184
+ * @param locations Element locations to which to attach the source location.
15185
+ *
15186
+ * @codeGenApi
15187
+ */
15188
+ export declare function ɵɵattachSourceLocations(templatePath: string, locations: [index: number, offset: number, line: number, column: number][]): void;
15189
+
15131
15190
  /**
15132
15191
  * Updates the value of or removes a bound attribute on an Element.
15133
15192
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "19.1.0-next.2",
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.2
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.2
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.2
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.2
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',
@@ -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
  }
@@ -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);
@@ -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.2');
30413
+ new Version('19.1.0-next.3');
30325
30414
 
30326
30415
  const _I18N_ATTR = 'i18n';
30327
30416
  const _I18N_ATTR_PREFIX = 'i18n-';
@@ -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-c58f97d2.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.
@@ -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.2
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-c58f97d2.js');
14
- var program = require('./program-30e02255.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.2
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-c58f97d2.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.2
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-f5d588fe.js');
14
- var checker = require('./checker-c58f97d2.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.2
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-f5d588fe.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-31a38653.js');
16
+ var imports = require('./imports-abe29092.js');
17
17
  require('@angular-devkit/core');
18
- require('./checker-c58f97d2.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.2
3
+ * @license Angular v19.1.0-next.3
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.1.0-next.2
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 compiler_host = require('./compiler_host-f5d588fe.js');
13
+ var compiler_host = require('./compiler_host-fc806dbe.js');
14
14
  var ts = require('typescript');
15
- var nodes = require('./nodes-88c2157f.js');
16
- var imports = require('./imports-31a38653.js');
17
- var leading_space = require('./leading_space-6e7a8ec6.js');
18
- require('./checker-c58f97d2.js');
15
+ var nodes = require('./nodes-a9f0b985.js');
16
+ var imports = require('./imports-abe29092.js');
17
+ var leading_space = require('./leading_space-d190b83b.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.2
3
+ * @license Angular v19.1.0-next.3
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.1.0-next.2
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
- var checker = require('./checker-c58f97d2.js');
9
+ var checker = require('./checker-228cb8a8.js');
10
10
  var ts = require('typescript');
11
11
  require('os');
12
12
  var assert = require('assert');
13
- var combine_units = require('./combine_units-8b29b7f6.js');
14
- var leading_space = require('./leading_space-6e7a8ec6.js');
15
- require('./program-30e02255.js');
13
+ var combine_units = require('./combine_units-5d6a7099.js');
14
+ var leading_space = require('./leading_space-d190b83b.js');
15
+ require('./program-1591ec8f.js');
16
16
  require('path');
17
17
 
18
18
  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.2
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 imports = require('./imports-31a38653.js');
10
+ var imports = require('./imports-abe29092.js');
11
11
 
12
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
13