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

[WIP] Explore replacing $q with bluebird #13674

Closed

Conversation

stacey-gammon
Copy link
Contributor

If this worked, we could stop passing Promise classes everywhere, esp to our business logic classes, and just use the bluebird Promise directly.

Ideally we'd use native promises instead of bluebird but it was easier to swap with bluebird since we still use Promise.defer, and bluebird has the setScheduler functionality.

@stacey-gammon stacey-gammon force-pushed the explore-bluebird-promises branch 3 times, most recently from 664619e to bb7fa25 Compare August 29, 2017 00:06
@stacey-gammon
Copy link
Contributor Author

My main concern with this approach is how it would work if react code grabbed the bluebird promise that was hooked up globally to the angular digest loops. Would it end up hanging, waiting for a digest loop, like it does in our test suite without the no_digest_loop special handling?

That would have to be investigated. If it was the case, this is probably a no go, since it'd be too difficult to keep globally turning on and off the setScheduler and expect it to work correctly in this mixed angular & react environment.

Another approach is to create a clear separation of business logic from angular code, so angular code can wrap native promises with their own q implementation. That might be difficult given how intertwined our code it right now.

…om Promise classes everywhere

This test used bluebird specifically, so it assumed it didn't need to
add the special 'no_digest_promises'. This is no longer the case since
bluebird and $q act the same, and it will hang waiting for the digest
loop.
@stacey-gammon
Copy link
Contributor Author

Closing in favor of a different approach outlined here: #13855

@stacey-gammon stacey-gammon deleted the explore-bluebird-promises branch October 24, 2017 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant