@angular/core 18.0.0-rc.1 → 18.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/esm2022/primitives/event-dispatch/contract_binary.mjs +3 -3
  2. package/esm2022/primitives/event-dispatch/index.mjs +2 -2
  3. package/esm2022/primitives/event-dispatch/src/action_resolver.mjs +5 -18
  4. package/esm2022/primitives/event-dispatch/src/attribute.mjs +63 -65
  5. package/esm2022/primitives/event-dispatch/src/cache.mjs +10 -10
  6. package/esm2022/primitives/event-dispatch/src/dispatcher.mjs +50 -181
  7. package/esm2022/primitives/event-dispatch/src/earlyeventcontract.mjs +4 -4
  8. package/esm2022/primitives/event-dispatch/src/event_contract_defines.mjs +1 -6
  9. package/esm2022/primitives/event-dispatch/src/eventcontract.mjs +13 -30
  10. package/esm2022/primitives/event-dispatch/src/key_code.mjs +11 -13
  11. package/esm2022/primitives/event-dispatch/src/legacy_dispatcher.mjs +252 -2
  12. package/esm2022/primitives/event-dispatch/src/property.mjs +30 -27
  13. package/esm2022/primitives/event-dispatch/src/register_events.mjs +5 -25
  14. package/esm2022/primitives/event-dispatch/src/restriction.mjs +2 -2
  15. package/esm2022/src/application/create_application.mjs +11 -4
  16. package/esm2022/src/change_detection/scheduling/ng_zone_scheduling.mjs +4 -16
  17. package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +3 -1
  18. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +5 -2
  19. package/esm2022/src/core_reactivity_export_internal.mjs +1 -3
  20. package/esm2022/src/core_render3_private_export.mjs +1 -3
  21. package/esm2022/src/hydration/event_replay.mjs +51 -83
  22. package/esm2022/src/hydration/utils.mjs +1 -2
  23. package/esm2022/src/metadata/directives.mjs +1 -1
  24. package/esm2022/src/platform/platform_ref.mjs +9 -10
  25. package/esm2022/src/render3/component_ref.mjs +1 -1
  26. package/esm2022/src/render3/index.mjs +1 -3
  27. package/esm2022/src/render3/instructions/listener.mjs +3 -3
  28. package/esm2022/src/render3/interfaces/public_definitions.mjs +1 -1
  29. package/esm2022/src/version.mjs +1 -1
  30. package/esm2022/testing/src/component_fixture.mjs +2 -2
  31. package/esm2022/testing/src/logger.mjs +3 -3
  32. package/esm2022/testing/src/test_bed.mjs +1 -3
  33. package/esm2022/testing/src/test_bed_compiler.mjs +1 -3
  34. package/event-dispatch-contract.min.js +1 -1
  35. package/fesm2022/core.mjs +79 -117
  36. package/fesm2022/core.mjs.map +1 -1
  37. package/fesm2022/primitives/event-dispatch.mjs +246 -515
  38. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  39. package/fesm2022/primitives/signals.mjs +1 -1
  40. package/fesm2022/rxjs-interop.mjs +1 -1
  41. package/fesm2022/testing.mjs +2 -4
  42. package/fesm2022/testing.mjs.map +1 -1
  43. package/index.d.ts +3 -1
  44. package/package.json +1 -1
  45. package/primitives/event-dispatch/index.d.ts +83 -131
  46. package/primitives/signals/index.d.ts +1 -1
  47. package/rxjs-interop/index.d.ts +1 -1
  48. package/schematics/migrations/http-providers/bundle.js +46 -29
  49. package/schematics/migrations/http-providers/bundle.js.map +3 -3
  50. package/schematics/migrations/invalid-two-way-bindings/bundle.js +159 -159
  51. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +2 -2
  52. package/schematics/ng-generate/control-flow-migration/bundle.js +167 -167
  53. package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
  54. package/schematics/ng-generate/standalone-migration/bundle.js +443 -443
  55. package/schematics/ng-generate/standalone-migration/bundle.js.map +2 -2
  56. package/testing/index.d.ts +1 -1
  57. package/esm2022/primitives/event-dispatch/src/base_dispatcher.mjs +0 -94
  58. package/esm2022/primitives/event-dispatch/src/custom_events.mjs +0 -102
  59. package/esm2022/primitives/event-dispatch/src/replay.mjs +0 -389
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-rc.1
2
+ * @license Angular v18.0.0-rc.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1325,6 +1325,8 @@ export declare interface Component extends Directive {
1325
1325
  encapsulation?: ViewEncapsulation;
1326
1326
  /**
1327
1327
  * Overrides the default interpolation start and end delimiters (`{{` and `}}`).
1328
+ *
1329
+ * @deprecated use Angular's default interpolation delimiters instead.
1328
1330
  */
1329
1331
  interpolation?: [string, string];
1330
1332
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "18.0.0-rc.1",
3
+ "version": "18.0.0-rc.2",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Angular v18.0.0-rc.1
2
+ * @license Angular v18.0.0-rc.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
 
8
- declare namespace a11yClickLib {
8
+ declare namespace a11yClick {
9
9
  export {
10
10
  updateEventInfoForA11yClick,
11
11
  preventDefaultForA11yClick,
@@ -24,6 +24,54 @@ declare interface ActionInfo {
24
24
 
25
25
  declare type ActionInfoInternal = [name: string, element: Element];
26
26
 
27
+ /** Resolves actions for Events. */
28
+ declare class ActionResolver {
29
+ private a11yClickSupport;
30
+ private readonly syntheticMouseEventSupport;
31
+ private updateEventInfoForA11yClick?;
32
+ private preventDefaultForA11yClick?;
33
+ private populateClickOnlyAction?;
34
+ constructor({ syntheticMouseEventSupport, }?: {
35
+ syntheticMouseEventSupport?: boolean;
36
+ });
37
+ resolve(eventInfo: eventInfoLib.EventInfo): void;
38
+ /**
39
+ * Searches for a jsaction that the DOM event maps to and creates an
40
+ * object containing event information used for dispatching by
41
+ * jsaction.Dispatcher. This method populates the `action` and `actionElement`
42
+ * fields of the EventInfo object passed in by finding the first
43
+ * jsaction attribute above the target Node of the event, and below
44
+ * the container Node, that specifies a jsaction for the event
45
+ * type. If no such jsaction is found, then action is undefined.
46
+ *
47
+ * @param eventInfo `EventInfo` to set `action` and `actionElement` if an
48
+ * action is found on any `Element` in the path of the `Event`.
49
+ */
50
+ private populateAction;
51
+ /**
52
+ * Accesses the jsaction map on a node and retrieves the name of the
53
+ * action the given event is mapped to, if any. It parses the
54
+ * attribute value and stores it in a property on the node for
55
+ * subsequent retrieval without re-parsing and re-accessing the
56
+ * attribute.
57
+ *
58
+ * @param actionElement The DOM node to retrieve the jsaction map from.
59
+ * @param eventInfo `EventInfo` to set `action` and `actionElement` if an
60
+ * action is found on the `actionElement`.
61
+ */
62
+ private populateActionOnElement;
63
+ /**
64
+ * Parses and caches an element's jsaction element into a map.
65
+ *
66
+ * This is primarily for internal use.
67
+ *
68
+ * @param actionElement The DOM node to retrieve the jsaction map from.
69
+ * @return Map from event to qualified name of the jsaction bound to it.
70
+ */
71
+ private parseActions;
72
+ addA11yClickSupport(updateEventInfoForA11yClick: typeof a11yClick.updateEventInfoForA11yClick, preventDefaultForA11yClick: typeof a11yClick.preventDefaultForA11yClick, populateClickOnlyAction: typeof a11yClick.populateClickOnlyAction): void;
73
+ }
74
+
27
75
  /**
28
76
  * Provides a factory function for bootstrapping an event contract on a
29
77
  * specified object (by default, exposed on the `window`).
@@ -35,19 +83,7 @@ declare type ActionInfoInternal = [name: string, element: Element];
35
83
  * @param captureEventTypes An array of event names that should be listened to with capture.
36
84
  * @param earlyJsactionTracker The object that should receive the event contract.
37
85
  */
38
- export declare function bootstrapEarlyEventContract(field: string, container: HTMLElement, appId: string, eventTypes: string[], captureEventTypes: string[], earlyJsactionTracker?: EventContractTracker<EarlyJsactionDataContainer>): void;
39
-
40
- /**
41
- * Provides a factory function for bootstrapping an event contract on a
42
- * specified object (by default, exposed on the `window`).
43
- * @param field The property on the object that the event contract will be placed on.
44
- * @param container The container that listens to events
45
- * @param appId A given identifier for an application. If there are multiple apps on the page
46
- * then this is how contracts can be initialized for each one.
47
- * @param events An array of event names that should be listened to.
48
- * @param earlyJsactionTracker The object that should receive the event contract.
49
- */
50
- export declare function bootstrapEventContract(field: string, container: Element, appId: string, events: string[], earlyJsactionTracker?: EventContractTracker<EventContract>): void;
86
+ export declare function bootstrapEarlyEventContract(field: string, container: HTMLElement, appId: string, eventTypes?: string[], captureEventTypes?: string[], earlyJsactionTracker?: EventContractTracker<EarlyJsactionDataContainer>): void;
51
87
 
52
88
  /** Clones an `EventInfo` */
53
89
  declare function cloneEventInfo(eventInfo: EventInfo): EventInfo;
@@ -83,30 +119,23 @@ declare function createEventInfoFromParameters(eventType: string, event: Event,
83
119
  * jsaction.
84
120
  */
85
121
  export declare class Dispatcher {
86
- private readonly getHandler?;
87
- private readonly baseDispatcher;
88
- /** Whether to stop propagation for an `EventInfo`. */
89
- private readonly stopPropagation;
90
- /**
91
- * The actions that are registered for this Dispatcher instance.
92
- * This should be the primary one used once migration off of registerHandlers
93
- * is done.
94
- */
95
- private readonly actions;
96
- /** A map of global event handlers, where each key is an event type. */
97
- private readonly globalHandlers;
98
- /** The event replayer. */
122
+ private readonly dispatchDelegate;
123
+ private actionResolver?;
124
+ /** The replayer function to be called when there are queued events. */
99
125
  private eventReplayer?;
126
+ /** Whether the event replay is scheduled. */
127
+ private eventReplayScheduled;
128
+ /** The queue of events. */
129
+ private readonly replayEventInfoWrappers;
100
130
  /**
101
- * Receives a DOM event, determines the jsaction associated with the source
102
- * element of the DOM event, and invokes the handler associated with the
103
- * jsaction.
104
- *
105
- * @param getHandler A function that knows how to get the handler for a
106
- * given event info.
131
+ * Options are:
132
+ * 1. `eventReplayer`: When the event contract dispatches replay events
133
+ * to the Dispatcher, the Dispatcher collects them and in the next tick
134
+ * dispatches them to the `eventReplayer`.
135
+ * @param dispatchDelegate A function that should handle dispatching an `EventInfoWrapper` to handlers.
107
136
  */
108
- constructor(getHandler?: ((eventInfoWrapper: EventInfoWrapper) => EventInfoWrapperHandler | void) | undefined, { stopPropagation, eventReplayer, }?: {
109
- stopPropagation?: boolean;
137
+ constructor(dispatchDelegate: (eventInfoWrapper: EventInfoWrapper) => void, { actionResolver, eventReplayer, }?: {
138
+ actionResolver?: ActionResolver;
110
139
  eventReplayer?: Replayer;
111
140
  });
112
141
  /**
@@ -129,84 +158,13 @@ export declare class Dispatcher {
129
158
  * @param eventInfo The info for the event that triggered this call or the
130
159
  * queue of events from EventContract.
131
160
  */
132
- dispatch(eventInfo: EventInfo, isGlobalDispatch?: boolean): void;
133
- /**
134
- * Dispatches an `EventInfoWrapper`.
135
- */
136
- private dispatchToHandler;
137
- /**
138
- * Registers multiple methods all bound to the same object
139
- * instance. This is a common case: an application module binds
140
- * multiple of its methods under public names to the event contract of
141
- * the application. So we provide a shortcut for it.
142
- * Attempts to replay the queued events after registering the handlers.
143
- *
144
- * @param namespace The namespace of the jsaction name.
145
- *
146
- * @param instance The object to bind the methods to. If this is null, then
147
- * the functions are not bound, but directly added under the public names.
148
- *
149
- * @param methods A map from public name to functions that will be bound to
150
- * instance and registered as action under the public name. I.e. the
151
- * property names are the public names. The property values are the
152
- * methods of instance.
153
- */
154
- registerEventInfoHandlers<T>(namespace: string, instance: T | null, methods: {
155
- [key: string]: EventInfoWrapperHandler;
156
- }): void;
157
- /**
158
- * Unregisters an action. Provided as an easy way to reverse the effects of
159
- * registerHandlers.
160
- * @param namespace The namespace of the jsaction name.
161
- * @param name The action name to unbind.
162
- */
163
- unregisterHandler(namespace: string, name: string): void;
164
- /** Registers a global event handler. */
165
- registerGlobalHandler(eventType: string, handler: GlobalHandler): void;
166
- /** Unregisters a global event handler. */
167
- unregisterGlobalHandler(eventType: string, handler: GlobalHandler): void;
168
- /**
169
- * Checks whether there is an action registered under the given
170
- * name. This returns true if there is a namespace handler, even
171
- * if it can not yet handle the event.
172
- *
173
- * @param name Action name.
174
- * @return Whether the name is registered.
175
- * @see #canDispatch
176
- */
177
- hasAction(name: string): boolean;
178
- /**
179
- * Whether this dispatcher can dispatch the event. This can be used by
180
- * event replayer to check whether the dispatcher can replay an event.
181
- */
182
- canDispatch(eventInfoWrapper: EventInfoWrapper): boolean;
161
+ dispatch(eventInfo: EventInfo): void;
183
162
  /**
184
- * Sets the event replayer, enabling queued events to be replayed when actions
185
- * are bound. To replay events, you must register the dispatcher to the
186
- * contract after setting the `EventReplayer`. The event replayer takes as
187
- * parameters the queue of events and the dispatcher (used to check whether
188
- * actions have handlers registered and can be replayed). The event replayer
189
- * is also responsible for dequeuing events.
190
- *
191
- * Example: An event replayer that replays only the last event.
192
- *
193
- * const dispatcher = new Dispatcher();
194
- * // ...
195
- * dispatcher.setEventReplayer((queue, dispatcher) => {
196
- * const lastEventInfoWrapper = queue[queue.length -1];
197
- * if (dispatcher.canDispatch(lastEventInfoWrapper.getAction())) {
198
- * jsaction.replay.replayEvent(
199
- * lastEventInfoWrapper.getEvent(),
200
- * lastEventInfoWrapper.getTargetElement(),
201
- * lastEventInfoWrapper.getEventType(),
202
- * );
203
- * queue.length = 0;
204
- * }
205
- * });
206
- *
207
- * @param eventReplayer It allows elements to be replayed and dequeuing.
163
+ * Schedules an `EventInfoWrapper` for replay. The replaying will happen in its own
164
+ * stack once the current flow cedes control. This is done to mimic
165
+ * browser event handling.
208
166
  */
209
- setEventReplayer(eventReplayer: Replayer): void;
167
+ private scheduleEventInfoWrapperReplay;
210
168
  }
211
169
 
212
170
  /** A function that is called to handle events captured by the EventContract. */
@@ -216,14 +174,19 @@ declare type Dispatcher_2 = (eventInfo: eventInfoLib.EventInfo, globalDispatch?:
216
174
  * Defines the early jsaction data types.
217
175
  */
218
176
  declare interface EarlyJsactionData {
177
+ /** List used to keep track of the early JSAction event types. */
219
178
  et: string[];
179
+ /** List used to keep track of capture event types. */
220
180
  etc: string[];
181
+ /** List used to keep track of the JSAction events if using earlyeventcontract. */
221
182
  q: EventInfo[];
183
+ /** Early Jsaction handler. */
222
184
  h: (event: Event) => void;
185
+ /** Container for listening to events. */
223
186
  c: HTMLElement;
224
187
  }
225
188
 
226
- declare interface EarlyJsactionDataContainer {
189
+ export declare interface EarlyJsactionDataContainer {
227
190
  _ejsa?: EarlyJsactionData;
228
191
  }
229
192
 
@@ -242,11 +205,11 @@ declare interface EarlyJsactionDataContainer {
242
205
  * be delay loaded in a generic way.
243
206
  */
244
207
  export declare class EventContract implements UnrenamedEventContract {
245
- static CUSTOM_EVENT_SUPPORT: boolean;
208
+ private readonly useActionResolver;
246
209
  static A11Y_CLICK_SUPPORT: boolean;
247
210
  static MOUSE_SPECIAL_SUPPORT: boolean;
248
211
  private containerManager;
249
- private readonly actionResolver;
212
+ private readonly actionResolver?;
250
213
  /**
251
214
  * The DOM events which this contract covers. Used to prevent double
252
215
  * registration of event types. The value of the map is the
@@ -271,8 +234,8 @@ export declare class EventContract implements UnrenamedEventContract {
271
234
  private queuedEventInfos;
272
235
  /** Whether to add an a11y click listener. */
273
236
  private addA11yClickListener;
274
- ecaacs?: (updateEventInfoForA11yClick: typeof a11yClickLib.updateEventInfoForA11yClick, preventDefaultForA11yClick: typeof a11yClickLib.preventDefaultForA11yClick, populateClickOnlyAction: typeof a11yClickLib.populateClickOnlyAction) => void;
275
- constructor(containerManager: EventContractContainerManager);
237
+ ecaacs?: (updateEventInfoForA11yClick: typeof a11yClick.updateEventInfoForA11yClick, preventDefaultForA11yClick: typeof a11yClick.preventDefaultForA11yClick, populateClickOnlyAction: typeof a11yClick.populateClickOnlyAction) => void;
238
+ constructor(containerManager: EventContractContainerManager, useActionResolver?: boolean);
276
239
  private handleEvent;
277
240
  /**
278
241
  * Handle an `EventInfo`.
@@ -500,11 +463,6 @@ export declare class EventInfoWrapper {
500
463
  clone(): EventInfoWrapper;
501
464
  }
502
465
 
503
- /**
504
- * A handler is dispatched to during normal handling.
505
- */
506
- declare type EventInfoWrapperHandler = (eventInfoWrapper: EventInfoWrapper) => void;
507
-
508
466
  /** Added for readability when accessing stable property names. */
509
467
  declare function getA11yClickKey(eventInfo: EventInfo): boolean | undefined;
510
468
 
@@ -535,12 +493,6 @@ declare function getTargetElement(eventInfo: EventInfo): Element;
535
493
  /** Added for readability when accessing stable property names. */
536
494
  declare function getTimestamp(eventInfo: EventInfo): number;
537
495
 
538
- /**
539
- * A global handler is dispatched to before normal handler dispatch. Returning
540
- * false will `preventDefault` on the event.
541
- */
542
- declare type GlobalHandler = (event: Event) => boolean | void;
543
-
544
496
  /**
545
497
  * Sets the `action` to `clickonly` for a click event that is not an a11y click
546
498
  * and if there is not already a click action.
@@ -565,14 +517,14 @@ export declare function registerDispatcher(eventContract: UnrenamedEventContract
565
517
  * A replayer is a function that is called when there are queued events,
566
518
  * either from the `EventContract` or when there are no detected handlers.
567
519
  */
568
- declare type Replayer = (eventInfoWrappers: EventInfoWrapper[], dispatcher: Dispatcher) => void;
520
+ declare type Replayer = (eventInfoWrappers: EventInfoWrapper[]) => void;
569
521
 
570
522
 
571
523
  /**
572
524
  * @fileoverview An enum to control who can call certain jsaction APIs.
573
525
  */
574
526
  declare enum Restriction {
575
- I_AM_THE_JSACTION_FRAMEWORK = 1
527
+ I_AM_THE_JSACTION_FRAMEWORK = 0
576
528
  }
577
529
 
578
530
  /** Added for readability when accessing stable property names. */
@@ -604,7 +556,7 @@ declare function setTimestamp(eventInfo: EventInfo, timestamp: number): void;
604
556
  */
605
557
  declare interface UnrenamedEventContract {
606
558
  ecrd(dispatcher: Dispatcher_2, restriction: Restriction): void;
607
- ecaacs?: (updateEventInfoForA11yClick: typeof a11yClickLib.updateEventInfoForA11yClick, preventDefaultForA11yClick: typeof a11yClickLib.preventDefaultForA11yClick, populateClickOnlyAction: typeof a11yClickLib.populateClickOnlyAction) => void;
559
+ ecaacs?: (updateEventInfoForA11yClick: typeof a11yClick.updateEventInfoForA11yClick, preventDefaultForA11yClick: typeof a11yClick.preventDefaultForA11yClick, populateClickOnlyAction: typeof a11yClick.populateClickOnlyAction) => void;
608
560
  }
609
561
 
610
562
  /** Added for readability when accessing stable property names. */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-rc.1
2
+ * @license Angular v18.0.0-rc.2
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 v18.0.0-rc.1
2
+ * @license Angular v18.0.0-rc.2
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -60,7 +60,7 @@ var __async = (__this, __arguments, generator) => {
60
60
  });
61
61
  };
62
62
 
63
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/http-providers/index.mjs
63
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/http-providers/index.mjs
64
64
  var http_providers_exports = {};
65
65
  __export(http_providers_exports, {
66
66
  default: () => http_providers_default
@@ -69,7 +69,7 @@ module.exports = __toCommonJS(http_providers_exports);
69
69
  var import_schematics = require("@angular-devkit/schematics");
70
70
  var import_path3 = require("path");
71
71
 
72
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
72
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
73
73
  var import_core = require("@angular-devkit/core");
74
74
  function getProjectTsConfigPaths(tree) {
75
75
  return __async(this, null, function* () {
@@ -149,11 +149,11 @@ function getWorkspace(tree) {
149
149
  });
150
150
  }
151
151
 
152
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
152
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
153
153
  var import_path = require("path");
154
154
  var import_typescript2 = __toESM(require("typescript"), 1);
155
155
 
156
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
156
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
157
157
  var path = __toESM(require("path"), 1);
158
158
  var import_typescript = __toESM(require("typescript"), 1);
159
159
  function parseTsconfigFile(tsconfigPath, basePath) {
@@ -170,7 +170,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
170
170
  return import_typescript.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
171
171
  }
172
172
 
173
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
173
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
174
174
  function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
175
175
  const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
176
176
  return import_typescript2.default.createProgram(rootNames, options, host);
@@ -203,13 +203,13 @@ function canMigrateFile(basePath, sourceFile, program) {
203
203
  return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
204
204
  }
205
205
 
206
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/http-providers/utils.mjs
206
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/http-providers/utils.mjs
207
207
  var import_typescript7 = __toESM(require("typescript"), 1);
208
208
 
209
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
209
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
210
210
  var import_typescript4 = __toESM(require("typescript"), 1);
211
211
 
212
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
212
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
213
213
  var import_path2 = require("path");
214
214
  var import_typescript3 = __toESM(require("typescript"), 1);
215
215
  var ImportManager = class {
@@ -393,7 +393,7 @@ ${text}`;
393
393
  }
394
394
  };
395
395
 
396
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
396
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
397
397
  var ChangeTracker = class {
398
398
  constructor(_printer, _importRemapper) {
399
399
  __publicField(this, "_printer");
@@ -456,10 +456,10 @@ function normalizePath(path2) {
456
456
  return path2.replace(/\\/g, "/");
457
457
  }
458
458
 
459
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
459
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
460
460
  var import_typescript6 = __toESM(require("typescript"), 1);
461
461
 
462
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
462
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
463
463
  var import_typescript5 = __toESM(require("typescript"), 1);
464
464
  function getImportOfIdentifier(typeChecker, node) {
465
465
  const symbol = typeChecker.getSymbolAtLocation(node);
@@ -519,7 +519,7 @@ function findImportSpecifier(nodes, specifierName) {
519
519
  });
520
520
  }
521
521
 
522
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
522
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
523
523
  function getCallDecoratorImport(typeChecker, decorator) {
524
524
  if (!import_typescript6.default.isCallExpression(decorator.expression) || !import_typescript6.default.isIdentifier(decorator.expression.expression)) {
525
525
  return null;
@@ -528,7 +528,7 @@ function getCallDecoratorImport(typeChecker, decorator) {
528
528
  return getImportOfIdentifier(typeChecker, identifier);
529
529
  }
530
530
 
531
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/ng_decorators.mjs
531
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/ng_decorators.mjs
532
532
  function getAngularDecorators(typeChecker, decorators) {
533
533
  return decorators.map((node) => ({ node, importData: getCallDecoratorImport(typeChecker, node) })).filter(({ importData }) => importData && importData.importModule.startsWith("@angular/")).map(({ node, importData }) => ({
534
534
  node,
@@ -538,7 +538,7 @@ function getAngularDecorators(typeChecker, decorators) {
538
538
  }));
539
539
  }
540
540
 
541
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/http-providers/utils.mjs
541
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/http-providers/utils.mjs
542
542
  var HTTP_CLIENT_MODULE = "HttpClientModule";
543
543
  var HTTP_CLIENT_XSRF_MODULE = "HttpClientXsrfModule";
544
544
  var HTTP_CLIENT_JSONP_MODULE = "HttpClientJsonpModule";
@@ -571,7 +571,7 @@ function migrateFile(sourceFile, typeChecker, rewriteFn) {
571
571
  if (import_typescript7.default.isClassDeclaration(node)) {
572
572
  const decorators = getAngularDecorators(typeChecker, import_typescript7.default.getDecorators(node) || []);
573
573
  decorators.forEach((decorator) => {
574
- migrateDecorator(decorator, commonHttpIdentifiers, addedImports, changeTracker);
574
+ migrateDecorator(decorator, commonHttpIdentifiers, commonHttpTestingIdentifiers, addedImports, changeTracker);
575
575
  });
576
576
  }
577
577
  migrateTestingModuleImports(node, commonHttpIdentifiers, commonHttpTestingIdentifiers, addedImports, changeTracker);
@@ -610,7 +610,7 @@ function migrateFile(sourceFile, typeChecker, rewriteFn) {
610
610
  }
611
611
  }
612
612
  }
613
- function migrateDecorator(decorator, commonHttpIdentifiers, addedImports, changeTracker) {
613
+ function migrateDecorator(decorator, commonHttpIdentifiers, commonHttpTestingIdentifiers, addedImports, changeTracker) {
614
614
  var _a;
615
615
  if (decorator.name !== "NgModule" && decorator.name !== "Component" || decorator.node.expression.arguments.length < 1) {
616
616
  return;
@@ -623,13 +623,14 @@ function migrateDecorator(decorator, commonHttpIdentifiers, addedImports, change
623
623
  if (!moduleImports) {
624
624
  return;
625
625
  }
626
- const importedModules = getImportedHttpModules(moduleImports, commonHttpIdentifiers);
626
+ const importedModules = getImportedHttpModules(moduleImports, commonHttpIdentifiers, commonHttpTestingIdentifiers);
627
627
  if (!importedModules) {
628
628
  return;
629
629
  }
630
630
  const addedProviders = /* @__PURE__ */ new Set();
631
631
  const commonHttpAddedImports = addedImports.get(COMMON_HTTP);
632
- if (importedModules.client) {
632
+ commonHttpAddedImports == null ? void 0 : commonHttpAddedImports.add(PROVIDE_HTTP_CLIENT);
633
+ if (importedModules.client || importedModules.clientTesting) {
633
634
  commonHttpAddedImports == null ? void 0 : commonHttpAddedImports.add(WITH_INTERCEPTORS_FROM_DI);
634
635
  addedProviders.add(createCallExpression(WITH_INTERCEPTORS_FROM_DI));
635
636
  }
@@ -647,19 +648,28 @@ function migrateDecorator(decorator, commonHttpIdentifiers, addedImports, change
647
648
  }
648
649
  }
649
650
  const newImports = import_typescript7.default.factory.createArrayLiteralExpression([
650
- ...moduleImports.elements.filter((item) => item !== importedModules.client && item !== importedModules.clientJsonp && item !== importedModules.xsrf)
651
+ ...moduleImports.elements.filter((item) => item !== importedModules.client && item !== importedModules.clientJsonp && item !== importedModules.xsrf && item !== importedModules.clientTesting)
651
652
  ]);
652
- commonHttpAddedImports == null ? void 0 : commonHttpAddedImports.add(PROVIDE_HTTP_CLIENT);
653
653
  const providers = getProvidersFromLiteralExpr(metadata);
654
+ let provideHttpClientTestingExpr;
655
+ if (importedModules.clientTesting) {
656
+ const commonHttpTestingAddedImports = addedImports.get(COMMON_HTTP_TESTING);
657
+ commonHttpTestingAddedImports == null ? void 0 : commonHttpTestingAddedImports.add(PROVIDE_HTTP_CLIENT_TESTING);
658
+ provideHttpClientTestingExpr = createCallExpression(PROVIDE_HTTP_CLIENT_TESTING);
659
+ }
654
660
  const provideHttpExpr = createCallExpression(PROVIDE_HTTP_CLIENT, [...addedProviders]);
661
+ const providersToAppend = provideHttpClientTestingExpr ? [provideHttpExpr, provideHttpClientTestingExpr] : [provideHttpExpr];
655
662
  let newProviders;
656
663
  if (!providers) {
657
- newProviders = import_typescript7.default.factory.createArrayLiteralExpression([provideHttpExpr]);
664
+ newProviders = import_typescript7.default.factory.createArrayLiteralExpression(providersToAppend);
658
665
  } else {
659
- newProviders = import_typescript7.default.factory.updateArrayLiteralExpression(providers, import_typescript7.default.factory.createNodeArray([...providers.elements, provideHttpExpr], providers.elements.hasTrailingComma));
666
+ newProviders = import_typescript7.default.factory.updateArrayLiteralExpression(providers, import_typescript7.default.factory.createNodeArray([...providers.elements, ...providersToAppend], providers.elements.hasTrailingComma));
660
667
  }
661
668
  const newDecoratorArgs = import_typescript7.default.factory.createObjectLiteralExpression([
662
- ...metadata.properties.filter((p) => p.getText() === "imports"),
669
+ ...metadata.properties.filter((property) => {
670
+ var _a2, _b;
671
+ return ((_a2 = property.name) == null ? void 0 : _a2.getText()) !== "imports" && ((_b = property.name) == null ? void 0 : _b.getText()) !== "providers";
672
+ }),
663
673
  import_typescript7.default.factory.createPropertyAssignment("imports", newImports),
664
674
  import_typescript7.default.factory.createPropertyAssignment("providers", newProviders)
665
675
  ]);
@@ -753,15 +763,16 @@ function getProvidersFromLiteralExpr(literal) {
753
763
  }
754
764
  return null;
755
765
  }
756
- function getImportedHttpModules(imports, commonHttpIdentifiers) {
766
+ function getImportedHttpModules(imports, commonHttpIdentifiers, commonHttpTestingIdentifiers) {
757
767
  let client = null;
758
768
  let clientJsonp = null;
759
769
  let xsrf = null;
770
+ let clientTesting = null;
760
771
  let xsrfOptions = null;
761
772
  for (const item of imports.elements) {
762
773
  if (import_typescript7.default.isIdentifier(item)) {
763
774
  const moduleName = item.getText();
764
- if (!commonHttpIdentifiers.has(moduleName)) {
775
+ if (!commonHttpIdentifiers.has(moduleName) && !commonHttpTestingIdentifiers.has(moduleName)) {
765
776
  continue;
766
777
  }
767
778
  if (moduleName === HTTP_CLIENT_MODULE) {
@@ -770,6 +781,8 @@ function getImportedHttpModules(imports, commonHttpIdentifiers) {
770
781
  clientJsonp = item;
771
782
  } else if (moduleName === HTTP_CLIENT_XSRF_MODULE) {
772
783
  xsrf = item;
784
+ } else if (moduleName === HTTP_CLIENT_TESTING_MODULE) {
785
+ clientTesting = item;
773
786
  }
774
787
  } else if (import_typescript7.default.isCallExpression(item) && import_typescript7.default.isPropertyAccessExpression(item.expression)) {
775
788
  const moduleName = item.expression.expression.getText();
@@ -786,8 +799,8 @@ function getImportedHttpModules(imports, commonHttpIdentifiers) {
786
799
  }
787
800
  }
788
801
  }
789
- if (client !== null || clientJsonp !== null || xsrf !== null) {
790
- return { client, clientJsonp, xsrf, xsrfOptions };
802
+ if (client !== null || clientJsonp !== null || xsrf !== null || clientTesting !== null) {
803
+ return { client, clientJsonp, xsrf, xsrfOptions, clientTesting };
791
804
  }
792
805
  return null;
793
806
  }
@@ -796,19 +809,23 @@ function createCallExpression(functionName, args = []) {
796
809
  }
797
810
  function updateTestBedConfiguration(configureTestingModuleArgs, newImports, newProviders) {
798
811
  return import_typescript7.default.factory.updateObjectLiteralExpression(configureTestingModuleArgs, [
812
+ ...configureTestingModuleArgs.properties.filter((property) => {
813
+ var _a, _b;
814
+ return ((_a = property.name) == null ? void 0 : _a.getText()) !== "imports" && ((_b = property.name) == null ? void 0 : _b.getText()) !== "providers";
815
+ }),
799
816
  import_typescript7.default.factory.createPropertyAssignment("imports", newImports),
800
817
  import_typescript7.default.factory.createPropertyAssignment("providers", newProviders)
801
818
  ]);
802
819
  }
803
820
 
804
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/http-providers/index.mjs
821
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/migrations/http-providers/index.mjs
805
822
  function http_providers_default() {
806
823
  return (tree) => __async(this, null, function* () {
807
824
  const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);
808
825
  const basePath = process.cwd();
809
826
  const allPaths = [...buildPaths, ...testPaths];
810
827
  if (!allPaths.length) {
811
- throw new import_schematics.SchematicsException("Could not find any tsconfig file. Cannot run the transfer state migration.");
828
+ throw new import_schematics.SchematicsException("Could not find any tsconfig file. Cannot run the http providers migration.");
812
829
  }
813
830
  for (const tsconfigPath of allPaths) {
814
831
  runMigration(tree, tsconfigPath, basePath);