New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case conversion pipes do not compose under strict TS checking #36259
Comments
Tracking as FW-2032 |
I can write a PR to fix it and possibly improve the typing of other pipes, but I will need some guidance regarding what should happen for What is the best way forward? Opening a PR and discussing this stuff on it? |
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259 BREAKING CHANGE: The case conversion pipes no longer let falsy values through. They now map both `null` and `undefined` to `null` and raise an exception on invalid input (`0`, `false`, `NaN`) just like most "common pipes". If your code required falsy values to pass through, you need to handle them explicitly.
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflcts the behaviour on `null` and `undefined`. Fixes angular#36259 BREAKING CHANGE: The case conversion pipes no longer let falsy values through. They now map both `null` and `undefined` to `null` and raise an exception on invalid input (`0`, `false`, `NaN`) just like most "common pipes". If your code required falsy values to pass through, you need to handle them explicitly.
…angular#36259) The old implementation of case conversion types can handle several values which are not strings, but the signature did not reflect this. The new one reports errors when falsy non-string inputs are given to the pipe (such as `false` or `0`) and has a new signature which instead reflects the behaviour on `null` and `undefined`. Fixes angular#36259 BREAKING CHANGE: The case conversion pipes no longer let falsy values through. They now map both `null` and `undefined` to `null` and raise an exception on invalid input (`0`, `false`, `NaN`) just like most "common pipes". If your code required falsy values to pass through, you need to handle them explicitly.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 bug report
Affected Package
@angular/common
The issue seems to be related to an incoherence between the implementation and signature of
LowerCasePipe
,TitleCasePipe
, andUpperCasePipe
.angular/packages/common/src/pipes/case_conversion_pipes.ts
Lines 32 to 38 in f8096d4
Is this a regression?
No, this works as intended when either
Long ago Angular performed very limited checking of the templates, so it was much harder to get to this issue.
Description
The
lowercase
(/titlecase
/uppercase
) pipe is implemented to handlenull
values (which might come from anasync
or adate
pipe), but its signature does not reflect this.🔬 Minimal Reproduction
https://github.com/ranma42/async-lowercase
🔥 Exception or Error
🌍 Your Environment
Angular Version:
The text was updated successfully, but these errors were encountered: