Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Promises upgrade #8789

Closed
5 of 14 tasks
pthiess opened this issue Aug 17, 2014 · 2 comments
Closed
5 of 14 tasks

Promises upgrade #8789

pthiess opened this issue Aug 17, 2014 · 2 comments
Assignees
Labels

Comments

@pthiess
Copy link
Contributor

pthiess commented Aug 17, 2014

Though we'll ultimately want to use a more full-featured promises implementation, both Q and Bluebird use a done method with a different meaning than the one offered by jQuery. To make the transition easier, we can stick with es6 promises and choose a library with more features once we're ready to remove the deprecated wrapping.

Note that extensions can still use jQuery promises if they wish because extensions don't send promises into core code (as far as I know).

  • Use the es6-promise shim until we've updated to a Chromium version that includes the native Promise object
  • Augment or wrap promises so that they include done and fail that issue deprecation warnings but otherwise behave like jQuery promises (returning the same promise).
  • Add unit test for Promise shim. Update tests in utils/Async to use new promises.
  • Replace all instances of new $.Deferred and $.Deferred with a use of standard promises
  • Test popular extensions to make sure they still work and display expected deprecation warnings
  • Exceptions currently get sent to window.onerror and can be caught by the debugger. We need to ensure that the new solution doesn't just swallow them.

Note: after discussion we want to stick with standard promises and use utility functions rather than using extended promise objects as libraries like Bluebird give us.

Tasks

  • Add es6-promise shim
  • Add unit tests for Promise shim
  • Augment promises (prototype) to include done, fail and always
  • Update tests in Async-tests to use new promises.
  • Replace all instances of new $.Deferred with a use of standard promises in brackets\src\ folder (except extensions & thirdparty)
  • Fix bugs in brackets\src\
  • Replace all instances of new $.Deferred with a use of standard promises in brackets\test\ folder
  • Fix unit tests (some of which rely on synchronous promise resolution)
  • Replace all instances of new $.Deferred with a use of standard promises in brackets\src\extensions folder
  • Test popular extensions
  • Scrub all fail->catch handler conversions and make sure they allow the possibility where they get an unexpected exception as their argument, rather than a normal expected error code.
  • When replacing fail with catch, look for a way to consistently handle the new case where an exception could happen
  • Wrap promises coming from extensions for new behavior with deprecation warning as well
  • Provide a utility function for always
@redmunds redmunds removed this from the Brackets 1.0 (#0.44) milestone Sep 4, 2014
@pthiess pthiess added STORY and removed MEDIUM labels Sep 23, 2014
@peterflynn
Copy link
Member

Closed temporarily since the card has gone back to the Backlog - https://trello.com/c/qJ0TgoVu/1361-m-promises-upgrade

@MiguelCastillo
Copy link
Contributor

Use mine :D https://github.com/MiguelCastillo/spromise

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants