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] Convert imports and exports to ES6 #1121

Closed
wants to merge 14 commits into from

Commits on Dec 16, 2019

  1. Convert imports and exports to ES6

    The old `module.exports` syntax doesn't work downstream in the react-sdk or riot-web layers anymore, so this brings it up to 2019 standards. 
    
    We do not use default exports anymore because they are discouraged by the ES6 community. It's not an official recommendation, but it's certainly commonplace. 
    
    This also changes browser-index.js and index.js to use the `src` tree instead of `lib`. This is primarily to have IDEs autocomplete the package more easily, and because we're compiling this all in the riot-web layer it doesn't really matter. We still export `lib` and `dist/browser-matrix.js` for backwards compatibility (ie: everyone who has imported from `matrix-js-sdk/lib/whatever` or uses `<script>` tags). In a future version/PR we could drop these if we feel like it.
    
    This commit does not address the test failures that are almost certainly caused by this change. While we're here, the ancient `"use strict";` flags have been removed as well.
    
    Some files were not as easily converted. Most were simple keyword changes though there are a couple instances where the file structure is redone to accommodate ES6 exports.
    turt2live committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    073d060 View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2019

  1. Configuration menu
    Copy the full SHA
    11a3bdd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c5b8ffc View commit details
    Browse the repository at this point in the history
  3. Fix imports in MatrixClient

    turt2live committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    3cdddf8 View commit details
    Browse the repository at this point in the history
  4. Convert tests to ES6

    turt2live committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    c34568e View commit details
    Browse the repository at this point in the history
  5. Remove unused dependency

    turt2live committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    b69865b View commit details
    Browse the repository at this point in the history
  6. Drop node requirement

    turt2live committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    c5d0eb1 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f8b8d9a View commit details
    Browse the repository at this point in the history
  8. Appease the linter

    turt2live committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    1b4e79f View commit details
    Browse the repository at this point in the history
  9. Optimize imports

    turt2live committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    1b1fed6 View commit details
    Browse the repository at this point in the history
  10. Appease the linter again

    turt2live committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    b0e8271 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a59befc View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9e28251 View commit details
    Browse the repository at this point in the history
  13. Move browser stuff back to dist

    Dist is where you Distribute things.
    turt2live committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    735281f View commit details
    Browse the repository at this point in the history