mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
An `EventEmitter` is a construct owned by Angular that should be used for outputs as of right now. As we are introducing the new `OutputRef` interface for the new output function APIs, we also think `EventEmitter` should implement `OutputRef`— ensuring all "known" outputs follow the same contract. This commit ensures `EventEmitter` implements an `OutputRef` Note: An output ref captures the destroy ref from the current injection context for clean-up purposes. This is also done for `EventEmitter` in a backwards compatible way: - not requiring an injection context. EventEmitter may be used elsewhere. - not cleaning up subscriptions/completing the emitter when the directive/component is destroyed. This would be a change in behavior. Note 2: The dependency on `DestroyRef` causes it to be retained in all bundling examples because ironically `NgZone` uses `EventEmitter`- not for outputs. The code is pretty minimal though, so that should be acceptable. `EventEmitter` will now always retain `NgZone. This increases the payload size slightly around 800b for AIO. Note that the other increases were coming from previous changes. This commit just pushed it over the threshold. PR Close #54650
22 lines
393 B
JSON
Executable file
22 lines
393 B
JSON
Executable file
{
|
|
"aio": {
|
|
"uncompressed": {
|
|
"runtime": 4252,
|
|
"main": 525680,
|
|
"polyfills": 33862,
|
|
"styles": 60209,
|
|
"light-theme": 31691,
|
|
"dark-theme": 31875
|
|
}
|
|
},
|
|
"aio-local": {
|
|
"uncompressed": {
|
|
"runtime": 4252,
|
|
"main": 531485,
|
|
"polyfills": 33862,
|
|
"styles": 60209,
|
|
"light-theme": 31691,
|
|
"dark-theme": 31875
|
|
}
|
|
}
|
|
}
|