You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jhades: I noticed that the uppercase and lowercase pipes work by adding changeDetection:ON_PUSH in your @Component.
However, it should still work with the default I believe.
@jhades@jessegood this was my fault sorry about that. I pushed up a PR with the correct fix #3189. The problem was that I was doing more work than I should by only transforming on reference change. This is why changeDetection: ON_PUSH would allow it to work since you're providing a new reference to the bindings which would correctly transform the value
FWIW, I don't think the issue was checking against the last input value, but the fact that in case of a match you would return the input value (not the transformed output).
Since these transforms are very cheap anyway, it's not worth having such an optimization in place anyway.
The problem was that I used ObservablePipe as code reference since it was the only real pipe at the time (and of course we have no real docs at the time). Then there was also an API changed to remove having to return NO_CHANGE reference when the transformation didn't need to happen (now changed to use WrappedValue). I was also doing smoke tests for these pipes in an app that optimized the change detection for reference checks (changeDetection: ON_PUSH) and the old pipe API.
change_detection/pipes/observable_pipe.ts ObservablePipe has to maintain reference of the Observable and has essentially 4 states in which the transform does something different that causes side effects: Observable without a subscription, Observable with a subscription, current value/returned value are the same, and current value/returned value are different. I only know this because I had to create an ObservablePipe that prevented a cycle from happening when a change returns a new Observable reference. So there's actually a potential bug where the first state should return the returned value and the returned value should be dereferenced during the onDestroy Pipe lifecycle rather than the Observable reference lifecycle. With all that said I should have went back to refactor the pipes so that's my bad
Looking at the commit that closed this issue (4dc6d74), I thought it was the fact that the untransformed value was returned after the initial invokation.
But I don't know much about pipes, so I probably misread that 😞
Sorry for the noise 😈
angular-automatic-lock-bot commented on Sep 6, 2019
Activity
jessegood commentedon Jul 21, 2015
@jhades: I noticed that the uppercase and lowercase pipes work by adding
changeDetection:ON_PUSHin your@Component.However, it should still work with the default I believe.
fix(lowercase,uppercase): make stateless pipes
PatrickJS commentedon Jul 22, 2015
@jhades @jessegood this was my fault sorry about that. I pushed up a PR with the correct fix #3189. The problem was that I was doing more work than I should by only transforming on reference change. This is why
changeDetection: ON_PUSHwould allow it to work since you're providing a new reference to the bindings which would correctly transform the valuegkalpak commentedon Aug 3, 2015
FWIW, I don't think the issue was checking against the last input value, but the fact that in case of a match you would return the input value (not the transformed output).
Since these transforms are very cheap anyway, it's not worth having such an optimization in place anyway.
PatrickJS commentedon Aug 3, 2015
The problem was that I used
ObservablePipeas code reference since it was the only real pipe at the time (and of course we have no real docs at the time). Then there was also an API changed to remove having to returnNO_CHANGEreference when the transformation didn't need to happen (now changed to useWrappedValue). I was also doing smoke tests for these pipes in an app that optimized the change detection for reference checks (changeDetection: ON_PUSH) and the old pipe API.change_detection/pipes/observable_pipe.ts
ObservablePipehas to maintain reference of the Observable and has essentially 4 states in which the transform does something different that causes side effects: Observable without a subscription, Observable with a subscription, current value/returned value are the same, and current value/returned value are different. I only know this because I had to create anObservablePipethat prevented a cycle from happening when a change returns a new Observable reference. So there's actually a potential bug where the first state should return the returned value and the returned value should be dereferenced during the onDestroy Pipe lifecycle rather than the Observable reference lifecycle. With all that said I should have went back to refactor the pipes so that's my badgkalpak commentedon Aug 3, 2015
Looking at the commit that closed this issue (4dc6d74), I thought it was the fact that the untransformed value was returned after the initial invokation.
But I don't know much about pipes, so I probably misread that 😞
Sorry for the noise 😈
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.