Skip to content

fix(common): weaken AsyncPipe transform signature #22169

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

Closed
wants to merge 1 commit into from

Conversation

chuckjaz
Copy link
Contributor

The AsyncPipe type signature was changed to allow
deferred creation of promises and observalbes that
is supported by the implementation by allowing
Promise<T>|null|undefined and by allowing
Observable<T>|null|undefined.

PR Type

What kind of change does this PR introduce?

[x] Bugfix

What is the current behavior?

Issue Number: #22100

The type signature of AsyncPipe is too strict and causes fullTemplateTypeCheck to report an error if the pipe is an optional property such as address?: Observable<Address> which is supported by the class.

What is the new behavior?

The type signature of the transform method now supports Observable<T>|null|undefined and Promise<T>|null|undefined.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

This is not a breaking change even though it is an API change as the type signature is weaker than the prior signature and it will accept all programs that the previous signature accepted.

The AsyncPipe type signature was changed to allow
deferred creation of promises and observalbes that
is supported by the implementation by allowing
`Promise<T>|null|undefined` and by allowing
`Observable<T>|null|undefined`.
@chuckjaz chuckjaz added the target: patch This PR is targeted for the next patch release label Feb 12, 2018
@mary-poppins
Copy link

You can preview f8d7710 at https://pr22169-f8d7710.ngbuilds.io/.

@chuckjaz chuckjaz added the action: merge The PR is ready for merge by the caretaker label Feb 12, 2018
mhevery pushed a commit that referenced this pull request Feb 12, 2018
The AsyncPipe type signature was changed to allow
deferred creation of promises and observalbes that
is supported by the implementation by allowing
`Promise<T>|null|undefined` and by allowing
`Observable<T>|null|undefined`.

PR Close #22169
@mhevery mhevery closed this in be59c3a Feb 12, 2018
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants