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

[CLOSED] Promises upgrade #7861

Open
5 of 14 tasks
core-ai-bot opened this issue Aug 30, 2021 · 0 comments
Open
5 of 14 tasks

[CLOSED] Promises upgrade #7861

core-ai-bot opened this issue Aug 30, 2021 · 0 comments

Comments

@core-ai-bot
Copy link
Member

Issue by pthiess
Sunday Aug 17, 2014 at 21:10 GMT
Originally opened as adobe/brackets#8789


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
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

No branches or pull requests

1 participant