Skip to content
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

fix(upgrade): compile downgraded components synchronously (if possible) #31840

Closed

Conversation

@gkalpak
Copy link
Member

commented Jul 25, 2019

AngularJS compilation is a synchronous operation (unless having to fetch a template, which is not supported for downgraded components). Previously, ngUpgrade tried to retain the synchronous nature of the compilation for downgraded components (when possible), by using a synchronous thenable implementation (ParentInjectorPromise). This was accidentally broken in #27217 by replacing a call to ParentInjectorPromise#then() (which can be synchronous) with a call to Promise.all() (which is asynchronous).

This PR fixes this by introducing a SyncPromise.all() static method; similar to Promise.all() but retaining the synchronous capabilities of SyncPromise (which ParentInjectorPromise inherits from).

Fixes #30330.

gkalpak added some commits Jul 25, 2019

fix(upgrade): compile downgraded components synchronously (if possible)
AngularJS compilation is a synchronous operation (unless having to fetch
a template, which is not supported for downgraded components).
Previously, ngUpgrade tried to retain the synchronous nature of the
compilation for downgraded components (when possible), by using a
synchronous thenable implementation (`ParentInjectorPromise`). This was
accidentally broken in #27217 by replacing a call to
`ParentInjectorPromise#then()` (which can be synchronous) with a call to
`Promise.all()` (which is asynchronous).

This commit fixes this by introducing a `SyncPromise.all()` static
method; similar to `Promise.all()` but retaining the synchronous
capabilities of `SyncPromise` (which `ParentInjectorPromise` inherits
from).

Fixes #30330
@mary-poppins

This comment has been minimized.

Copy link

commented Jul 25, 2019

@mhevery

This comment has been minimized.

@alxhub alxhub closed this in b3b5c66 Aug 1, 2019

alxhub added a commit that referenced this pull request Aug 1, 2019

fix(upgrade): compile downgraded components synchronously (if possibl…
…e) (#31840)

AngularJS compilation is a synchronous operation (unless having to fetch
a template, which is not supported for downgraded components).
Previously, ngUpgrade tried to retain the synchronous nature of the
compilation for downgraded components (when possible), by using a
synchronous thenable implementation (`ParentInjectorPromise`). This was
accidentally broken in #27217 by replacing a call to
`ParentInjectorPromise#then()` (which can be synchronous) with a call to
`Promise.all()` (which is asynchronous).

This commit fixes this by introducing a `SyncPromise.all()` static
method; similar to `Promise.all()` but retaining the synchronous
capabilities of `SyncPromise` (which `ParentInjectorPromise` inherits
from).

Fixes #30330

PR Close #31840

alxhub added a commit that referenced this pull request Aug 1, 2019

alxhub added a commit that referenced this pull request Aug 1, 2019

fix(upgrade): compile downgraded components synchronously (if possibl…
…e) (#31840)

AngularJS compilation is a synchronous operation (unless having to fetch
a template, which is not supported for downgraded components).
Previously, ngUpgrade tried to retain the synchronous nature of the
compilation for downgraded components (when possible), by using a
synchronous thenable implementation (`ParentInjectorPromise`). This was
accidentally broken in #27217 by replacing a call to
`ParentInjectorPromise#then()` (which can be synchronous) with a call to
`Promise.all()` (which is asynchronous).

This commit fixes this by introducing a `SyncPromise.all()` static
method; similar to `Promise.all()` but retaining the synchronous
capabilities of `SyncPromise` (which `ParentInjectorPromise` inherits
from).

Fixes #30330

PR Close #31840

@gkalpak gkalpak deleted the gkalpak:fix-upgrade-compile-downgraded-sync branch Aug 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.