diff --git a/.babelrc b/.babelrc index a3c9597bb..67eaa6718 100644 --- a/.babelrc +++ b/.babelrc @@ -1,7 +1,8 @@ { "presets": ["es2015", "es2016"], "plugins": [ - "transform-class-properties", + "transform-class-properties", + // this transforms async functions into generator functions, which // are then made to use the regenerator module by babel's // transform-regnerator plugin (which is enabled by es2015). diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index df61d7678..4909aabde 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -22,3 +22,13 @@ steps: plugins: - docker#v3.0.1: image: "node:10" + + - wait + + - label: "🐴 Trigger matrix-react-sdk" + trigger: "matrix-react-sdk" + branches: "develop" + build: + branch: "develop" + message: "[js-sdk] ${BUILDKITE_MESSAGE}" + async: true diff --git a/.eslintrc.js b/.eslintrc.js index 4606ca6ae..9a752b14f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,6 +14,9 @@ module.exports = { es6: true, }, extends: ["eslint:recommended", "google"], + plugins: [ + "babel", + ], rules: { // rules we've always adhered to or now do "max-len": ["error", { @@ -50,6 +53,7 @@ module.exports = { // rules we do not want from the google styleguide "object-curly-spacing": ["off"], "spaced-comment": ["off"], + "guard-for-in": ["off"], // in principle we prefer single quotes, but life is too short quotes: ["off"], @@ -73,5 +77,10 @@ module.exports = { "asyncArrow": "always", }], "arrow-parens": "off", + + // eslint's built in no-invalid-this rule breaks with class properties + "no-invalid-this": "off", + // so we replace it with a version that is class property aware + "babel/no-invalid-this": "error", } } diff --git a/CHANGELOG.md b/CHANGELOG.md index cbc93629e..847b3d1be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,128 @@ +Changes in [2.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v2.0.0) (2019-05-31) +================================================================================================ +[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v1.2.0...v2.0.0) + +BREAKING CHANGES +---------------- + + * This package now publishes in ES6 / ES2015 syntax to NPM + * Saves access_token and user_id after login for all login types + [\#932](https://github.com/matrix-org/matrix-js-sdk/pull/932) + * Fix recovery key encoding for base-x 3.0.5 + [\#931](https://github.com/matrix-org/matrix-js-sdk/pull/931) + +Changes in [1.2.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v1.2.0) (2019-05-29) +================================================================================================ +[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v1.2.0-rc.1...v1.2.0) + + +Changes in [1.2.0-rc.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v1.2.0-rc.1) (2019-05-23) +========================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v1.1.0...v1.2.0-rc.1) + + * interactive-auth now handles requesting email tokens + [\#926](https://github.com/matrix-org/matrix-js-sdk/pull/926) + * allow access to unreplaced message content + [\#923](https://github.com/matrix-org/matrix-js-sdk/pull/923) + * Add method to retrieve replacing event + [\#922](https://github.com/matrix-org/matrix-js-sdk/pull/922) + * More logging when signature verification fails + [\#921](https://github.com/matrix-org/matrix-js-sdk/pull/921) + * Local echo for m.replace relations + [\#920](https://github.com/matrix-org/matrix-js-sdk/pull/920) + * Track relations as pending and remove when cancelled + [\#919](https://github.com/matrix-org/matrix-js-sdk/pull/919) + * Add stringify helper to summarise events when debugging + [\#916](https://github.com/matrix-org/matrix-js-sdk/pull/916) + * Message editing: filter out replacements for senders that are not the + original sender + [\#918](https://github.com/matrix-org/matrix-js-sdk/pull/918) + * Wait until decrypt before aggregating + [\#917](https://github.com/matrix-org/matrix-js-sdk/pull/917) + * Message editing: mark original event as replaced instead of replacing the + event object + [\#914](https://github.com/matrix-org/matrix-js-sdk/pull/914) + * Support for replacing message through m.replace relationship. + [\#913](https://github.com/matrix-org/matrix-js-sdk/pull/913) + * Use a short timeout for .well-known requests + [\#912](https://github.com/matrix-org/matrix-js-sdk/pull/912) + * Redaction and change events for relations + [\#911](https://github.com/matrix-org/matrix-js-sdk/pull/911) + * Add basic read path for relations + [\#910](https://github.com/matrix-org/matrix-js-sdk/pull/910) + * Add a concept of default push rules, using it for tombstone notifications + [\#860](https://github.com/matrix-org/matrix-js-sdk/pull/860) + * yarn upgrade + [\#907](https://github.com/matrix-org/matrix-js-sdk/pull/907) + +Changes in [1.1.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v1.1.0) (2019-05-07) +================================================================================================ +[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v1.1.0-rc.1...v1.1.0) + + * No Changes since rc.1 + +Changes in [1.1.0-rc.1](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v1.1.0-rc.1) (2019-04-30) +========================================================================================================== +[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v1.0.4...v1.1.0-rc.1) + + * use the release version of olm 3.1.0 + [\#903](https://github.com/matrix-org/matrix-js-sdk/pull/903) + * Use new Olm repo link in README + [\#901](https://github.com/matrix-org/matrix-js-sdk/pull/901) + * Support being fed a .well-known config object for validation + [\#897](https://github.com/matrix-org/matrix-js-sdk/pull/897) + * emit self-membership event at end of handling sync update + [\#900](https://github.com/matrix-org/matrix-js-sdk/pull/900) + * Use packages.matrix.org for Olm + [\#898](https://github.com/matrix-org/matrix-js-sdk/pull/898) + * Fix tests on develop + [\#899](https://github.com/matrix-org/matrix-js-sdk/pull/899) + * Stop syncing when the token is invalid + [\#895](https://github.com/matrix-org/matrix-js-sdk/pull/895) + * change event redact, POST request to PUT request + [\#887](https://github.com/matrix-org/matrix-js-sdk/pull/887) + * Expose better autodiscovery error messages + [\#894](https://github.com/matrix-org/matrix-js-sdk/pull/894) + * Explicitly guard store usage during sync startup + [\#892](https://github.com/matrix-org/matrix-js-sdk/pull/892) + * Flag v3 rooms as safe + [\#893](https://github.com/matrix-org/matrix-js-sdk/pull/893) + * Cache failed capabilities lookups for shorter amounts of time + [\#890](https://github.com/matrix-org/matrix-js-sdk/pull/890) + * Fix highlight notifications for unencrypted rooms + [\#891](https://github.com/matrix-org/matrix-js-sdk/pull/891) + * Document checking crypto state before using `hasUnverifiedDevices` + [\#889](https://github.com/matrix-org/matrix-js-sdk/pull/889) + * Add logging to sync startup path + [\#888](https://github.com/matrix-org/matrix-js-sdk/pull/888) + * Track e2e highlights better, particularly in 'Mentions Only' rooms + [\#886](https://github.com/matrix-org/matrix-js-sdk/pull/886) + * support both the incorrect and correct MAC methods + [\#882](https://github.com/matrix-org/matrix-js-sdk/pull/882) + * Refuse to set forwards pagination token on live timeline + [\#885](https://github.com/matrix-org/matrix-js-sdk/pull/885) + * Degrade `IndexedDBStore` back to memory only on failure + [\#884](https://github.com/matrix-org/matrix-js-sdk/pull/884) + * Refuse to link live timelines into the forwards/backwards position when + either is invalid + [\#877](https://github.com/matrix-org/matrix-js-sdk/pull/877) + * Key backup logging improvements + [\#883](https://github.com/matrix-org/matrix-js-sdk/pull/883) + * Don't assume aborts are always from txn.abort() + [\#880](https://github.com/matrix-org/matrix-js-sdk/pull/880) + * Add a bunch of logging + [\#878](https://github.com/matrix-org/matrix-js-sdk/pull/878) + * Refuse splicing the live timeline into a broken position + [\#873](https://github.com/matrix-org/matrix-js-sdk/pull/873) + * Add existence check to local storage based crypto store + [\#872](https://github.com/matrix-org/matrix-js-sdk/pull/872) + +Changes in [1.0.4](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v1.0.4) (2019-04-08) +================================================================================================ +[Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v1.0.3...v1.0.4) + + * Hotfix: more logging and potential fixes for timeline corruption issue, see ticket https://github.com/vector-im/riot-web/issues/8593. + Changes in [1.0.3](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v1.0.3) (2019-04-01) ================================================================================================ [Full Changelog](https://github.com/matrix-org/matrix-js-sdk/compare/v1.0.3-rc.1...v1.0.3) @@ -211,7 +336,7 @@ Changes in [0.14.0-rc.1](https://github.com/matrix-org/matrix-js-sdk/releases/ta BREAKING CHANGE ---------------- - + * js-sdk now uses Olm 3.0. Apps using Olm must update to 3.0 to continue using Olm with the js-sdk. The js-sdk will call Olm's init() method when the client is started. diff --git a/README.md b/README.md index e36ee1a2f..e5cd9051b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ Matrix Javascript SDK ===================== -[![Build Status](http://matrix.org/jenkins/buildStatus/icon?job=JavascriptSDK)](http://matrix.org/jenkins/job/JavascriptSDK/) -This is the [Matrix](https://matrix.org) Client-Server v1/v2 alpha SDK for +This is the [Matrix](https://matrix.org) Client-Server r0 SDK for JavaScript. This SDK can be run in a browser or in Node.js. Quickstart @@ -297,9 +296,9 @@ Then visit ``http://localhost:8005`` to see the API docs. End-to-end encryption support ============================= -The SDK supports end-to-end encryption via the Olm and Megolm protocols, using -[libolm](http://matrix.org/git/olm). It is left up to the application to make -libolm available, via the ``Olm`` global. +The SDK supports end-to-end encryption via the and Megolm protocols, using +[libolm](https://gitlab.matrix.org/matrix-org/olm). It is left up to the +application to make libolm available, via the ``Olm`` global. It is also necessry to call ``matrixClient.initCrypto()`` after creating a new ``MatrixClient`` (but **before** calling ``matrixClient.startClient()``) to @@ -318,18 +317,18 @@ specification. To provide the Olm library in a browser application: - * download the transpiled libolm (from https://matrix.org/packages/npm/olm/). + * download the transpiled libolm (from https://packages.matrix.org/npm/olm/). * load ``olm.js`` as a ``