angular/packages/core/src
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
..
animation refactor(core): prevent timeout from applying to non-event animation bindings (#63393) 2025-08-27 11:17:40 -07:00
application docs: Deprecate BootstrapOptions on bootstrapModule (#62690) 2025-08-06 11:19:45 +02:00
authoring docs: use correct closing quote in input and model import usage notes (#63237) 2025-08-19 12:33:24 +00:00
change_detection refactor(core): replace Optional/SkipSelf deps with inject() flags (#63386) 2025-08-28 08:43:17 -07:00
compiler build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
debug refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
defer fix(core): unable to retrieve defer blocks in tests when component injects ViewContainerRef (#62156) 2025-06-23 14:24:46 +02:00
di build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
hydration Revert "feat(platform-browser): Add IsolatedShadowDom encapsulation method (#62723)" (#63142) 2025-08-13 11:12:59 -07:00
i18n docs(core): correct standalone jsdocs (#62025) 2025-06-12 15:51:23 +02:00
interface build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
internal refactor(core): account for anonymous classes in internal utility (#58392) 2024-10-28 12:38:03 -07:00
linker feat(core): Add destroyed property to EnvironmentInjector (#61951) 2025-06-24 14:09:10 +00:00
metadata docs: update to new standalone default behavior (#63329) 2025-08-27 11:26:13 -07:00
platform refactor(core): Use promise.finally for task removal (#62674) 2025-07-18 07:19:49 -04:00
reflection build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
render docs: add link label & paragraph for correct display (#60708) 2025-04-30 08:18:07 -07:00
render3 fix(core): Fix cancellation of animation enter classes (#63442) 2025-08-28 14:11:06 +00:00
resource refactor(core): remove temporary resource setter function. (#63097) 2025-08-11 15:43:48 -07:00
sanitization refactor: add explicit types for exports relying on inferred call return type (#61312) 2025-05-13 22:45:18 +00:00
testability fix(core): cleanup testability subscriptions (#61261) 2025-05-21 12:06:23 +00:00
util build: rename defaults2.bzl to defaults.bzl (#63384) 2025-08-25 15:45:46 -07:00
view refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
zone docs: update API examples to modern angular (#61688) 2025-05-29 17:53:28 -04:00
authoring.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
cached_injector_service.ts refactor: add @__PURE__ next to @pureOrBreakMyCode for improved bundler compatibility (#58297) 2024-10-28 12:26:05 -07:00
change_detection.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
console.ts refactor: remove unnecessary TSLint rule flags (#59365) 2025-01-07 16:06:21 +00:00
core.externs.js refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
core.ts fix(core): fixes empty animations when recalculating styles (#63007) 2025-08-06 11:17:30 +02:00
core_private_export.ts fix(core): fixes empty animations when recalculating styles (#63007) 2025-08-06 11:17:30 +02:00
core_reactivity_export.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
core_reactivity_export_internal.ts refactor(core): convert scripts within packages/core/src to relative imports (#60227) 2025-03-25 10:58:00 -07:00
core_render3_private_export.ts refactor(compiler): Tree shake Element Registry (#62682) 2025-07-23 09:37:16 -04:00
di.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
document.ts feat(core): move DOCUMENT token into core (#60663) 2025-04-01 12:48:06 +00:00
error_details_base_url.ts docs: change xss doc url to angular new documentation (#59915) 2025-03-11 12:57:48 -07:00
error_handler.ts fix(core): avoid injecting ErrorHandler from a destroyed injector (#61886) 2025-06-24 14:13:34 +00:00
errors.ts fix(core): properly recognize failed fetch responses when loading external resources in JIT (#62992) 2025-08-05 10:10:56 +02:00
event_delegation_utils.ts fix(core): enable stashing only when withEventReplay() is invoked (#61077) 2025-05-14 10:35:57 -07:00
event_emitter.ts fix(core): async EventEmitter error should not prevent stability (#61028) 2025-04-29 22:14:15 -07:00
image_performance_warning.ts refactor(common): replace forEach with index loop for Domino compatibility (#62290) 2025-06-26 12:01:36 +00:00
linker.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
metadata.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
ng_reflect.ts refactor(core): stop producing ng-reflect attributes by default (#60973) 2025-04-24 10:07:35 -07:00
pending_tasks.ts docs(docs-infra): Add version of introduction for APIs (#60814) 2025-05-02 07:51:33 -07:00
profiler.ts docs: update comment (#62482) 2025-07-07 16:52:15 +00:00
r3_symbols.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
render.ts feat(core): add event listener options to renderer (#59092) 2024-12-10 13:39:47 -08:00
transfer_state.ts refactor(core): add a getTransferState for the devtools (#62722) 2025-07-21 17:00:27 -04:00
type_checking.ts refactor(core): expose function to assert type of variables (#62648) 2025-07-16 12:40:25 +02:00
version.ts refactor(core): mark VERSION as @__PURE__ for better tree-shaking (#63400) 2025-08-27 11:39:07 -07:00
zone.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00