angular/packages/core/src/change_detection
arturovt 1e3999ec36 refactor(core): replace Optional/SkipSelf deps with inject() flags (#63386)
This commit updates provider definitions that relied on the `deps` array
with `new Optional()` and `new SkipSelf()` to instead use the modern
`inject(..., { optional: true, skipSelf: true })` API.

Previously:
  deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]

Now:
  const parent = inject(KeyValueDiffers, { optional: true, skipSelf: true });

**Bundle size reduction**: `Optional` and `SkipSelf` are runtime values
created by `makeParamDecorator()`. Even in production builds, esbuild
and other bundlers must keep their factory code because they are
referenced with `new Optional()` / `new SkipSelf()`. With `inject()`,
those classes are no longer referenced, allowing them and the
`makeParamDecorator` scaffolding to be tree-shaken when unused.

As a result, production bundles can drop both `Optional`, `SkipSelf`, and
their supporting factory code when not used elsewhere, reducing code size
while keeping the same behavior.

PR Close #63386
2025-08-28 08:43:17 -07:00
..
differs refactor(core): replace Optional/SkipSelf deps with inject() flags (#63386) 2025-08-28 08:43:17 -07:00
scheduling feat(core): Promote zoneless to stable (#62699) 2025-08-05 10:03:31 +02:00
change_detection.ts feat(core): move provideExperimentalCheckNoChangesForDebug to provideCheckNoChangesConfig (#60906) 2025-04-24 13:04:27 -07:00
change_detector_ref.ts refactor(core): replace internal usages of InjectFlags (#60318) 2025-03-11 11:33:09 -07:00
constants.ts docs: fix all brokens links on the API pages (#59162) 2025-03-04 20:07:23 +00:00
pipe_transform.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
provide_check_no_changes_config.ts docs(docs-infra): Add version of introduction for APIs (#60814) 2025-05-02 07:51:33 -07:00
use_exhaustive_check_no_changes.ts feat(core): move provideExperimentalCheckNoChangesForDebug to provideCheckNoChangesConfig (#60906) 2025-04-24 13:04:27 -07:00