@angular/core 19.0.0-next.9 → 19.0.0-rc.1

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 (42) hide show
  1. package/fesm2022/core.mjs +21183 -19410
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/event-dispatch.mjs +71 -47
  4. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  5. package/fesm2022/primitives/signals.mjs +8 -6
  6. package/fesm2022/primitives/signals.mjs.map +1 -1
  7. package/fesm2022/rxjs-interop.mjs +90 -10
  8. package/fesm2022/rxjs-interop.mjs.map +1 -1
  9. package/fesm2022/testing.mjs +174 -113
  10. package/fesm2022/testing.mjs.map +1 -1
  11. package/index.d.ts +524 -92
  12. package/package.json +1 -1
  13. package/primitives/event-dispatch/index.d.ts +7 -4
  14. package/primitives/signals/index.d.ts +3 -1
  15. package/rxjs-interop/index.d.ts +35 -4
  16. package/schematics/bundles/{checker-3b2ea20f.js → checker-9ca42e51.js} +2303 -1006
  17. package/schematics/bundles/combine_units-a16385aa.js +1634 -0
  18. package/schematics/bundles/{compiler_host-b4ba5a28.js → compiler_host-31afa4ed.js} +8 -5
  19. package/schematics/bundles/control-flow-migration.js +3 -3
  20. package/schematics/bundles/explicit-standalone-flag.js +29 -9
  21. package/schematics/bundles/imports-4ac08251.js +1 -1
  22. package/schematics/bundles/inject-migration.js +222 -54
  23. package/schematics/bundles/leading_space-d190b83b.js +1 -1
  24. package/schematics/bundles/migrate_ts_type_references-b2a28742.js +1463 -0
  25. package/schematics/bundles/nodes-0e7d45ca.js +1 -1
  26. package/schematics/bundles/output-migration.js +575 -0
  27. package/schematics/bundles/pending-tasks.js +3 -3
  28. package/schematics/bundles/{program-6534a30a.js → program-71beec0b.js} +1385 -460
  29. package/schematics/bundles/project_tsconfig_paths-e9ccccbf.js +1 -1
  30. package/schematics/bundles/provide-initializer.js +179 -0
  31. package/schematics/bundles/route-lazy-loading.js +9 -4
  32. package/schematics/bundles/signal-input-migration.js +183 -311
  33. package/schematics/bundles/signal-queries-migration.js +404 -146
  34. package/schematics/bundles/signals.js +54 -0
  35. package/schematics/bundles/standalone-migration.js +29 -12
  36. package/schematics/collection.json +11 -0
  37. package/schematics/migrations.json +7 -1
  38. package/schematics/ng-generate/output-migration/schema.json +19 -0
  39. package/schematics/ng-generate/signal-queries-migration/schema.json +11 -0
  40. package/schematics/ng-generate/signals/schema.json +65 -0
  41. package/testing/index.d.ts +1 -1
  42. package/schematics/bundles/group_replacements-e1b5cbf8.js +0 -31571
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.0.0-next.9
2
+ * @license Angular v19.0.0-rc.1
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -455,9 +455,11 @@ function getBrowserEventType(eventType) {
455
455
  * @param element The element.
456
456
  * @param eventType The event type.
457
457
  * @param handler The handler function to install.
458
+ * @param passive A boolean value that, if `true`, indicates that the function
459
+ * specified by `handler` will never call `preventDefault()`.
458
460
  * @return Information needed to uninstall the event handler eventually.
459
461
  */
460
- function addEventListener(element, eventType, handler) {
462
+ function addEventListener(element, eventType, handler, passive) {
461
463
  // All event handlers are registered in the bubbling
462
464
  // phase.
463
465
  //
@@ -476,8 +478,9 @@ function addEventListener(element, eventType, handler) {
476
478
  if (isCaptureEventType(eventType)) {
477
479
  capture = true;
478
480
  }
479
- element.addEventListener(eventType, handler, capture);
480
- return { eventType, handler, capture };
481
+ const options = typeof passive === 'boolean' ? { capture, passive } : capture;
482
+ element.addEventListener(eventType, handler, options);
483
+ return { eventType, handler, capture, passive };
481
484
  }
482
485
  /**
483
486
  * Removes the event handler for the given event from the element.
@@ -489,7 +492,11 @@ function addEventListener(element, eventType, handler) {
489
492
  */
490
493
  function removeEventListener(element, info) {
491
494
  if (element.removeEventListener) {
492
- element.removeEventListener(info.eventType, info.handler, info.capture);
495
+ // It's worth noting that some browser releases have been inconsistent on this, and unless
496
+ // you have specific reasons otherwise, it's probably wise to use the same values used for
497
+ // the call to addEventListener() when calling removeEventListener().
498
+ const options = typeof info.passive === 'boolean' ? { capture: info.capture } : info.capture;
499
+ element.removeEventListener(info.eventType, info.handler, options);
493
500
  // `detachEvent` is an old DOM API.
494
501
  // tslint:disable-next-line:no-any
495
502
  }
@@ -1059,24 +1066,25 @@ const isIos = typeof navigator !== 'undefined' && /iPhone|iPad|iPod/.test(naviga
1059
1066
  * container is removed from the contract.
1060
1067
  */
1061
1068
  class EventContractContainer {
1069
+ element;
1070
+ /**
1071
+ * Array of event handlers and their corresponding event types that are
1072
+ * installed on this container.
1073
+ *
1074
+ */
1075
+ handlerInfos = [];
1062
1076
  /**
1063
1077
  * @param element The container Element.
1064
1078
  */
1065
1079
  constructor(element) {
1066
1080
  this.element = element;
1067
- /**
1068
- * Array of event handlers and their corresponding event types that are
1069
- * installed on this container.
1070
- *
1071
- */
1072
- this.handlerInfos = [];
1073
1081
  }
1074
1082
  /**
1075
1083
  * Installs the provided installer on the element owned by this container,
1076
1084
  * and maintains a reference to resulting handler in order to remove it
1077
1085
  * later if desired.
1078
1086
  */
1079
- addEventListener(eventType, getHandler) {
1087
+ addEventListener(eventType, getHandler, passive) {
1080
1088
  // In iOS, event bubbling doesn't happen automatically in any DOM element,
1081
1089
  // unless it has an onclick attribute or DOM event handler attached to it.
1082
1090
  // This breaks JsAction in some cases. See "Making Elements Clickable"
@@ -1091,7 +1099,7 @@ class EventContractContainer {
1091
1099
  if (isIos) {
1092
1100
  this.element.style.cursor = 'pointer';
1093
1101
  }
1094
- this.handlerInfos.push(addEventListener(this.element, eventType, getHandler(this.element)));
1102
+ this.handlerInfos.push(addEventListener(this.element, eventType, getHandler(this.element), passive));
1095
1103
  }
1096
1104
  /**
1097
1105
  * Removes all the handlers installed on this container.
@@ -1258,6 +1266,7 @@ function createEventInfo({ eventType, event, targetElement, container, timestamp
1258
1266
  * size.
1259
1267
  */
1260
1268
  class EventInfoWrapper {
1269
+ eventInfo;
1261
1270
  constructor(eventInfo) {
1262
1271
  this.eventInfo = eventInfo;
1263
1272
  }
@@ -1337,12 +1346,13 @@ const REGEXP_SEMICOLON = /\s*;\s*/;
1337
1346
  const DEFAULT_EVENT_TYPE = EventType.CLICK;
1338
1347
  /** Resolves actions for Events. */
1339
1348
  class ActionResolver {
1349
+ a11yClickSupport = false;
1350
+ clickModSupport = true;
1351
+ syntheticMouseEventSupport;
1352
+ updateEventInfoForA11yClick = undefined;
1353
+ preventDefaultForA11yClick = undefined;
1354
+ populateClickOnlyAction = undefined;
1340
1355
  constructor({ syntheticMouseEventSupport = false, clickModSupport = true, } = {}) {
1341
- this.a11yClickSupport = false;
1342
- this.clickModSupport = true;
1343
- this.updateEventInfoForA11yClick = undefined;
1344
- this.preventDefaultForA11yClick = undefined;
1345
- this.populateClickOnlyAction = undefined;
1346
1356
  this.syntheticMouseEventSupport = syntheticMouseEventSupport;
1347
1357
  this.clickModSupport = clickModSupport;
1348
1358
  }
@@ -1568,6 +1578,15 @@ var Restriction;
1568
1578
  * jsaction.
1569
1579
  */
1570
1580
  class Dispatcher {
1581
+ dispatchDelegate;
1582
+ // The ActionResolver to use to resolve actions.
1583
+ actionResolver;
1584
+ /** The replayer function to be called when there are queued events. */
1585
+ eventReplayer;
1586
+ /** Whether the event replay is scheduled. */
1587
+ eventReplayScheduled = false;
1588
+ /** The queue of events. */
1589
+ replayEventInfoWrappers = [];
1571
1590
  /**
1572
1591
  * Options are:
1573
1592
  * - `eventReplayer`: When the event contract dispatches replay events
@@ -1577,10 +1596,6 @@ class Dispatcher {
1577
1596
  */
1578
1597
  constructor(dispatchDelegate, { actionResolver, eventReplayer, } = {}) {
1579
1598
  this.dispatchDelegate = dispatchDelegate;
1580
- /** Whether the event replay is scheduled. */
1581
- this.eventReplayScheduled = false;
1582
- /** The queue of events. */
1583
- this.replayEventInfoWrappers = [];
1584
1599
  this.actionResolver = actionResolver;
1585
1600
  this.eventReplayer = eventReplayer;
1586
1601
  }
@@ -1688,6 +1703,10 @@ const COMPOSED_PATH_ERROR_MESSAGE = `\`composedPath\` called during event replay
1688
1703
  * `currentTarget`, etc.
1689
1704
  */
1690
1705
  class EventDispatcher {
1706
+ dispatchDelegate;
1707
+ clickModSupport;
1708
+ actionResolver;
1709
+ dispatcher;
1691
1710
  constructor(dispatchDelegate, clickModSupport = true) {
1692
1711
  this.dispatchDelegate = dispatchDelegate;
1693
1712
  this.clickModSupport = clickModSupport;
@@ -1803,6 +1822,7 @@ function registerDispatcher$1(eventContract, dispatcher) {
1803
1822
  * late-loaded EventContract.
1804
1823
  */
1805
1824
  class EarlyEventContract {
1825
+ dataContainer;
1806
1826
  constructor(dataContainer = window, container = window.document.documentElement) {
1807
1827
  this.dataContainer = dataContainer;
1808
1828
  dataContainer._ejsa = createEarlyJsactionData(container);
@@ -1910,30 +1930,31 @@ const MOUSE_SPECIAL_SUPPORT = false;
1910
1930
  * be delay loaded in a generic way.
1911
1931
  */
1912
1932
  class EventContract {
1913
- static { this.MOUSE_SPECIAL_SUPPORT = MOUSE_SPECIAL_SUPPORT; }
1933
+ static MOUSE_SPECIAL_SUPPORT = MOUSE_SPECIAL_SUPPORT;
1934
+ containerManager;
1935
+ /**
1936
+ * The DOM events which this contract covers. Used to prevent double
1937
+ * registration of event types. The value of the map is the
1938
+ * internally created DOM event handler function that handles the
1939
+ * DOM events. See addEvent().
1940
+ *
1941
+ */
1942
+ eventHandlers = {};
1943
+ browserEventTypeToExtraEventTypes = {};
1944
+ /**
1945
+ * The dispatcher function. Events are passed to this function for
1946
+ * handling once it was set using the registerDispatcher() method. This is
1947
+ * done because the function is passed from another jsbinary, so passing the
1948
+ * instance and invoking the method here would require to leave the method
1949
+ * unobfuscated.
1950
+ */
1951
+ dispatcher = null;
1952
+ /**
1953
+ * The list of suspended `EventInfo` that will be dispatched
1954
+ * as soon as the `Dispatcher` is registered.
1955
+ */
1956
+ queuedEventInfos = [];
1914
1957
  constructor(containerManager) {
1915
- /**
1916
- * The DOM events which this contract covers. Used to prevent double
1917
- * registration of event types. The value of the map is the
1918
- * internally created DOM event handler function that handles the
1919
- * DOM events. See addEvent().
1920
- *
1921
- */
1922
- this.eventHandlers = {};
1923
- this.browserEventTypeToExtraEventTypes = {};
1924
- /**
1925
- * The dispatcher function. Events are passed to this function for
1926
- * handling once it was set using the registerDispatcher() method. This is
1927
- * done because the function is passed from another jsbinary, so passing the
1928
- * instance and invoking the method here would require to leave the method
1929
- * unobfuscated.
1930
- */
1931
- this.dispatcher = null;
1932
- /**
1933
- * The list of suspended `EventInfo` that will be dispatched
1934
- * as soon as the `Dispatcher` is registered.
1935
- */
1936
- this.queuedEventInfos = [];
1937
1958
  this.containerManager = containerManager;
1938
1959
  }
1939
1960
  handleEvent(eventType, event, container) {
@@ -1969,8 +1990,11 @@ class EventContract {
1969
1990
  * to subscribe to jsaction="transitionEnd:foo" while the underlying
1970
1991
  * event is webkitTransitionEnd in one browser and mozTransitionEnd
1971
1992
  * in another.
1993
+ *
1994
+ * @param passive A boolean value that, if `true`, indicates that the event
1995
+ * handler will never call `preventDefault()`.
1972
1996
  */
1973
- addEvent(eventType, prefixedEventType) {
1997
+ addEvent(eventType, prefixedEventType, passive) {
1974
1998
  if (eventType in this.eventHandlers || !this.containerManager) {
1975
1999
  return;
1976
2000
  }
@@ -1992,7 +2016,7 @@ class EventContract {
1992
2016
  return (event) => {
1993
2017
  eventHandler(eventType, event, element);
1994
2018
  };
1995
- });
2019
+ }, passive);
1996
2020
  }
1997
2021
  /**
1998
2022
  * Gets the queued early events and replay them using the appropriate handler