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

Switch riot-web to bluebird #4565

Merged
merged 8 commits into from
Jul 13, 2017
Merged

Switch riot-web to bluebird #4565

merged 8 commits into from
Jul 13, 2017

Commits on Jul 12, 2017

  1. replace imports of q with bluebird

    update `package.json`
    
    ```
    find src test -name '*.js' |
        xargs perl -i -pe 'if (/require\(.[qQ].\)/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'
    
    find src test -name '*.js' |
        xargs perl -i -pe 'if (/import [qQ] /) { $_ = "import Promise from '\''bluebird'\'';\n"; }'
    ```
    richvdh committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    10decf9 View commit details
    Browse the repository at this point in the history
  2. q(...) -> Promise.resolve

    ```
    find src test -name '*.js' | xargs perl -i -pe 's/\b[qQ]\(/Promise.resolve(/'
    ```
    richvdh committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    b29b4a9 View commit details
    Browse the repository at this point in the history
  3. replace q method calls with bluebird ones

    ```
    find src test -name '*.js' |
        xargs perl -i -pe 's/q\.(all|defer|reject|delay|try|isFulfilled)\(/Promise.$1(/'
    ```
    richvdh committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    d5b550f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4c5b5ca View commit details
    Browse the repository at this point in the history
  5. Replace q.allSettled()

    Bluebird doesn't have an `allSettled` method, so instead catch the exceptions and
    use `all`.
    richvdh committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    1d2d086 View commit details
    Browse the repository at this point in the history
  6. Fix a broken test

    turns out that you could call defer.resolve on q defers as an unbound function,
    whereas that doesn't work with bluebird promises.
    richvdh committed Jul 12, 2017
    Configuration menu
    Copy the full SHA
    69eb1a4 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2017

  1. Fix overlooked q

    richvdh committed Jul 13, 2017
    Configuration menu
    Copy the full SHA
    7238c4d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    76181f4 View commit details
    Browse the repository at this point in the history