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

Add support for async/await, using Babel, and convert some (applicable) code to make use of it #9944

Closed
wants to merge 7 commits into from

Commits on Aug 12, 2018

  1. Add support for async/await using Babel

    For proof-of-concept, this patch converts a couple of `Promise` returning methods to use `async` instead.
    Please note that the `generic` build, based on this patch, has been successfully testing in IE11 (i.e. the viewer loads and nothing is obviously broken).
    
    Being able to use modern JavaScript features like `async`/`await` is a huge plus, but there's one (obvious) side-effect: The size of the built files will increase slightly (unless `SKIP_BABEL == true`). That's unavoidable, but seems like a small price to pay in the grand scheme of things.
    
    Finally, note that the `chromium` build target was changed to no longer skip Babel translation, since the Chrome extension still supports version `49` of the browser (where native `async` support isn't available).
    Snuffleupagus committed Aug 12, 2018
    Configuration menu
    Copy the full SHA
    3f8606d View commit details
    Browse the repository at this point in the history
  2. Refactor the IL10n implementations to utilize async methods rathe…

    …r than manually returning `Promise`s
    
    This changes the methods signatures of `GenericL10n`, `MozL10n`, and `NullL10n`.
    Snuffleupagus committed Aug 12, 2018
    Configuration menu
    Copy the full SHA
    dd9c1d5 View commit details
    Browse the repository at this point in the history
  3. Refactor the OverlayManager to utilize async methods rather than …

    …manually returning `Promise`s
    Snuffleupagus committed Aug 12, 2018
    Configuration menu
    Copy the full SHA
    42f8eae View commit details
    Browse the repository at this point in the history
  4. Refactor the Preferences classes to utilize async methods rather …

    …than manually returning `Promise`s
    Snuffleupagus committed Aug 12, 2018
    Configuration menu
    Copy the full SHA
    6800820 View commit details
    Browse the repository at this point in the history
  5. Refactor the ViewHistory to utilize async methods rather than man…

    …ually returning `Promise`s
    Snuffleupagus committed Aug 12, 2018
    Configuration menu
    Copy the full SHA
    aeee250 View commit details
    Browse the repository at this point in the history
  6. Refactor a number of methods in PDFViewerApplication to be async

    …rather than manually returning `Promise`s
    
    *Ignoring whitespace changes is probably necessary, in order for the diff to be readable.*
    Snuffleupagus committed Aug 12, 2018
    Configuration menu
    Copy the full SHA
    75ca488 View commit details
    Browse the repository at this point in the history
  7. Utilize async/await in PDFViewerApplication.load to reduce the …

    …number of Promises and temporary variables necessary when setting the initial document location
    Snuffleupagus committed Aug 12, 2018
    Configuration menu
    Copy the full SHA
    6a52baa View commit details
    Browse the repository at this point in the history