Merge branch 'develop' into matthew/dharma

This commit is contained in:
Bruno Windels 2018-10-11 09:56:07 +02:00
commit eed9c56c51
11 changed files with 4848 additions and 2474 deletions

View File

@ -1,3 +1,23 @@
Changes in [0.16.5](https://github.com/vector-im/riot-web/releases/tag/v0.16.5) (2018-10-01)
============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.16.5-rc.1...v0.16.5)
* Don't show mobile guide if deep linking
[\#7415](https://github.com/vector-im/riot-web/pull/7415)
* Don't show custom server bit on matrix.org
[\#7408](https://github.com/vector-im/riot-web/pull/7408)
Changes in [0.16.5-rc.1](https://github.com/vector-im/riot-web/releases/tag/v0.16.5-rc.1) (2018-09-27)
======================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.16.4...v0.16.5-rc.1)
* Update from Weblate.
[\#7395](https://github.com/vector-im/riot-web/pull/7395)
* Reduce the number of terminals required to build riot-web to 1
[\#7355](https://github.com/vector-im/riot-web/pull/7355)
* Small typo in release notes v0.16.3
[\#7274](https://github.com/vector-im/riot-web/pull/7274)
Changes in [0.16.4](https://github.com/vector-im/riot-web/releases/tag/v0.16.4) (2018-09-10) Changes in [0.16.4](https://github.com/vector-im/riot-web/releases/tag/v0.16.4) (2018-09-10)
============================================================================================ ============================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v0.16.4-rc.1...v0.16.4) [Full Changelog](https://github.com/vector-im/riot-web/compare/v0.16.4-rc.1...v0.16.4)

View File

@ -134,7 +134,9 @@ For a good example, see https://riot.im/develop/config.json
1. `integrations_rest_url`: URL to the REST interface for the integrations server. 1. `integrations_rest_url`: URL to the REST interface for the integrations server.
1. `integrations_widgets_urls`: list of URLs to the REST interface for the widget integrations server. 1. `integrations_widgets_urls`: list of URLs to the REST interface for the widget integrations server.
1. `bug_report_endpoint_url`: endpoint to send bug reports to (must be running a 1. `bug_report_endpoint_url`: endpoint to send bug reports to (must be running a
https://github.com/matrix-org/rageshake server) https://github.com/matrix-org/rageshake server). Bug reports are sent when a user clicks
"Send Logs" within the application. Bug reports can be disabled by leaving the
`bug_report_endpoint_url` out of your config file.
1. `roomDirectory`: config for the public room directory. This section is optional. 1. `roomDirectory`: config for the public room directory. This section is optional.
1. `roomDirectory.servers`: List of other homeservers' directories to include in the drop 1. `roomDirectory.servers`: List of other homeservers' directories to include in the drop
down list. Optional. down list. Optional.
@ -147,11 +149,13 @@ For a good example, see https://riot.im/develop/config.json
anything else since it is used to isolate the privileges of file attachments to this anything else since it is used to isolate the privileges of file attachments to this
domain. Default: `https://usercontent.riot.im/v1.html`. This needs to contain v1.html from domain. Default: `https://usercontent.riot.im/v1.html`. This needs to contain v1.html from
https://github.com/matrix-org/usercontent/blob/master/v1.html https://github.com/matrix-org/usercontent/blob/master/v1.html
1. `piwik`: an object containing the following properties: 1. `piwik`: Analytics can be disabled by setting `piwik: false` or by leaving the piwik config
1. `url`: The URL of the Piwik instance to use for collecting Analytics option out of your config file. If you want to enable analytics, set `piwik` to be an object
1. `whitelistedHSUrls`: a list of HS URLs to not redact from the Analytics containing the following properties:
1. `whitelistedISUrls`: a list of IS URLs to not redact from the Analytics 1. `url`: The URL of the Piwik instance to use for collecting analytics
1. `siteId`: The Piwik Site ID to use when sending Analytics to the Piwik server configured above 1. `whitelistedHSUrls`: a list of HS URLs to not redact from the analytics
1. `whitelistedISUrls`: a list of IS URLs to not redact from the analytics
1. `siteId`: The Piwik Site ID to use when sending analytics to the Piwik server configured above
1. `teamServerConfig`, `teamTokenMap`, `referralBaseUrl`: an obsolete precursor to communities 1. `teamServerConfig`, `teamTokenMap`, `referralBaseUrl`: an obsolete precursor to communities
with referral tracking; please ignore it. with referral tracking; please ignore it.
1. `welcomeUserId`: the user ID of a bot to invite whenever users register that can give them a tour 1. `welcomeUserId`: the user ID of a bot to invite whenever users register that can give them a tour
@ -270,7 +274,7 @@ Then similarly with `matrix-react-sdk`:
Finally, build and start Riot itself: Finally, build and start Riot itself:
1. `git clone git@github.com:vector-im/riot-web.git` 1. `git clone https://github.com/vector-im/riot-web.git`
1. `cd riot-web` 1. `cd riot-web`
1. `git checkout develop` 1. `git checkout develop`
1. `npm install` 1. `npm install`

View File

@ -2,7 +2,7 @@
"name": "riot-web", "name": "riot-web",
"productName": "Riot", "productName": "Riot",
"main": "src/electron-main.js", "main": "src/electron-main.js",
"version": "0.16.4", "version": "0.16.5",
"description": "A feature-rich client for Matrix.org", "description": "A feature-rich client for Matrix.org",
"author": "Vector Creations Ltd.", "author": "Vector Creations Ltd.",
"dependencies": { "dependencies": {

7036
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
"name": "riot-web", "name": "riot-web",
"productName": "Riot", "productName": "Riot",
"main": "electron_app/src/electron-main.js", "main": "electron_app/src/electron-main.js",
"version": "0.16.4", "version": "0.16.5",
"description": "A feature-rich client for Matrix.org", "description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.", "author": "New Vector Ltd.",
"repository": { "repository": {
@ -36,7 +36,7 @@
"build:bundle": "cross-env NODE_ENV=production webpack-cli -p --progress --bail --mode production", "build:bundle": "cross-env NODE_ENV=production webpack-cli -p --progress --bail --mode production",
"build:bundle:dev": "webpack-cli --progress --bail --mode development", "build:bundle:dev": "webpack-cli --progress --bail --mode development",
"build:electron": "npm run clean && npm run build && npm run install:electron && build -wml --ia32 --x64", "build:electron": "npm run clean && npm run build && npm run install:electron && build -wml --ia32 --x64",
"build:react-sdk": "node scripts/npm-sub.js matrix-react-sdk run start:init", "build:react-sdk": "node scripts/npm-sub.js matrix-react-sdk run build",
"build:js-sdk": "node scripts/npm-sub.js matrix-js-sdk run start:init", "build:js-sdk": "node scripts/npm-sub.js matrix-js-sdk run start:init",
"build": "npm run build:js-sdk && npm run build:react-sdk && npm run reskindex && npm run build:res && npm run build:bundle", "build": "npm run build:js-sdk && npm run build:react-sdk && npm run reskindex && npm run build:res && npm run build:bundle",
"build:dev": "npm run build:js-sdk && npm run build:react-sdk && npm run reskindex && npm run build:res && npm run build:bundle:dev", "build:dev": "npm run build:js-sdk && npm run build:react-sdk && npm run reskindex && npm run build:res && npm run build:bundle:dev",
@ -62,22 +62,22 @@
"dependencies": { "dependencies": {
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"babel-runtime": "^6.26.0", "babel-runtime": "^6.26.0",
"bluebird": "^3.5.0", "bluebird": "^3.5.2",
"browser-request": "^0.3.3", "browser-request": "^0.3.3",
"draft-js": "^0.11.0-alpha", "draft-js": "^0.11.0-alpha",
"extract-text-webpack-plugin": "^4.0.0-beta.0", "extract-text-webpack-plugin": "^4.0.0-beta.0",
"favico.js": "^0.3.10", "favico.js": "^0.3.10",
"gemini-scrollbar": "matrix-org/gemini-scrollbar#b302279", "gemini-scrollbar": "github:matrix-org/gemini-scrollbar#b302279",
"gfm.css": "^1.1.1", "gfm.css": "^1.1.2",
"highlight.js": "^9.0.0", "highlight.js": "^9.0.0",
"matrix-js-sdk": "0.11.0", "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
"matrix-react-sdk": "0.13.4", "matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop",
"modernizr": "^3.1.0", "modernizr": "^3.6.0",
"prop-types": "^15.5.10", "prop-types": "^15.6.2",
"react": "^15.6.0", "react": "^15.6.0",
"react-dom": "^15.6.0", "react-dom": "^15.6.0",
"sanitize-html": "^1.18.4", "sanitize-html": "^1.18.4",
"ua-parser-js": "^0.7.10", "ua-parser-js": "^0.7.18",
"url": "^0.11.0" "url": "^0.11.0"
}, },
"devDependencies": { "devDependencies": {
@ -102,13 +102,13 @@
"cross-env": "^4.0.0", "cross-env": "^4.0.0",
"electron-builder": "^11.2.4", "electron-builder": "^11.2.4",
"electron-builder-squirrel-windows": "^11.2.1", "electron-builder-squirrel-windows": "^11.2.1",
"electron-devtools-installer": "^2.2.0", "electron-devtools-installer": "^2.2.4",
"emojione": "^2.2.7", "emojione": "^2.2.7",
"eslint": "^3.14.0", "eslint": "^5.6.0",
"eslint-config-google": "^0.7.1", "eslint-config-google": "^0.7.1",
"eslint-plugin-babel": "^4.1.2", "eslint-plugin-babel": "^4.1.2",
"eslint-plugin-flowtype": "^2.30.0", "eslint-plugin-flowtype": "^2.50.3",
"eslint-plugin-react": "^7.4.0", "eslint-plugin-react": "^7.11.1",
"expect": "^1.16.0", "expect": "^1.16.0",
"fs-extra": "^0.30.0", "fs-extra": "^0.30.0",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
@ -116,7 +116,7 @@
"karma": "^3.0.0", "karma": "^3.0.0",
"karma-chrome-launcher": "^0.2.3", "karma-chrome-launcher": "^0.2.3",
"karma-cli": "^1.0.1", "karma-cli": "^1.0.1",
"karma-junit-reporter": "^0.4.2", "karma-junit-reporter": "^2.0.0",
"karma-logcapture-reporter": "0.0.1", "karma-logcapture-reporter": "0.0.1",
"karma-mocha": "^1.3.0", "karma-mocha": "^1.3.0",
"karma-sourcemap-loader": "^0.3.7", "karma-sourcemap-loader": "^0.3.7",
@ -127,7 +127,7 @@
"matrix-react-test-utils": "^0.2.0", "matrix-react-test-utils": "^0.2.0",
"minimist": "^1.2.0", "minimist": "^1.2.0",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"mocha": "^2.4.5", "mocha": "^5.2.0",
"postcss-extend": "^1.0.5", "postcss-extend": "^1.0.5",
"postcss-import": "^11.1.0", "postcss-import": "^11.1.0",
"postcss-loader": "^2.1.6", "postcss-loader": "^2.1.6",
@ -140,7 +140,7 @@
"react-addons-perf": "^15.4.0", "react-addons-perf": "^15.4.0",
"react-addons-test-utils": "^15.6.0", "react-addons-test-utils": "^15.6.0",
"rimraf": "^2.4.3", "rimraf": "^2.4.3",
"source-map-loader": "^0.2.3", "source-map-loader": "^0.2.4",
"webpack": "^4.20.2", "webpack": "^4.20.2",
"webpack-cli": "^3.1.1", "webpack-cli": "^3.1.1",
"webpack-dev-server": "^3.1.9" "webpack-dev-server": "^3.1.9"

View File

@ -42,7 +42,7 @@ echo "electron npm version"
cd electron_app cd electron_app
npm version --no-git-tag-version "$release" npm version --no-git-tag-version "$release"
git commit package.json -m "$tag" git commit package.json package-lock.json -m "$tag"
cd .. cd ..

View File

@ -33,8 +33,7 @@ export async function getVectorConfig(relativeLocation) {
} }
function getConfig(configJsonFilename) { function getConfig(configJsonFilename) {
let deferred = Promise.defer(); return new Promise(function(resolve, reject) {
request( request(
{ method: "GET", url: configJsonFilename }, { method: "GET", url: configJsonFilename },
(err, response, body) => { (err, response, body) => {
@ -48,10 +47,10 @@ function getConfig(configJsonFilename) {
// from a file:// URI. // from a file:// URI.
if (response) { if (response) {
if (response.status == 404 || (response.status == 0 && body == '')) { if (response.status == 404 || (response.status == 0 && body == '')) {
deferred.resolve({}); resolve({});
} }
} }
deferred.reject({err: err, response: response}); reject({err: err, response: response});
return; return;
} }
@ -59,9 +58,8 @@ function getConfig(configJsonFilename) {
// parameter, since this throws a parse error on empty // parameter, since this throws a parse error on empty
// which breaks if there's no config.json and we're // which breaks if there's no config.json and we're
// loading from the filesystem (see above). // loading from the filesystem (see above).
deferred.resolve(JSON.parse(body)); resolve(JSON.parse(body));
} },
); );
});
return deferred.promise;
} }

View File

@ -81,6 +81,6 @@
</audio> </audio>
<audio id="remoteAudio"></audio> <audio id="remoteAudio"></audio>
<!-- let CSS themes pass constants to the app --> <!-- let CSS themes pass constants to the app -->
<div id="mx_theme_accentColor"></div><div id="mx_theme_secondaryAccentColor"/></div><div id="mx_theme_tertiaryAccentColor"/></div> <div id="mx_theme_accentColor"></div><div id="mx_theme_secondaryAccentColor"></div><div id="mx_theme_tertiaryAccentColor"></div>
</body> </body>
</html> </html>

View File

@ -62,6 +62,10 @@ import {getVectorConfig} from './getconfig';
let lastLocationHashSet = null; let lastLocationHashSet = null;
// Disable warnings for now: we use deprecated bluebird functions
// and need to migrate, but they spam the console with warnings.
Promise.config({warnings: false});
function initRageshake() { function initRageshake() {
rageshake.init().then(() => { rageshake.init().then(() => {
console.log("Initialised rageshake: See https://bugs.chromium.org/p/chromium/issues/detail?id=583193 to fix line numbers on Chrome."); console.log("Initialised rageshake: See https://bugs.chromium.org/p/chromium/issues/detail?id=583193 to fix line numbers on Chrome.");
@ -175,8 +179,7 @@ function makeRegistrationUrl(params) {
} }
function getConfig(configJsonFilename) { function getConfig(configJsonFilename) {
let deferred = Promise.defer(); return new Promise(function(resolve, reject) {
request( request(
{ method: "GET", url: configJsonFilename }, { method: "GET", url: configJsonFilename },
(err, response, body) => { (err, response, body) => {
@ -190,10 +193,10 @@ function getConfig(configJsonFilename) {
// from a file:// URI. // from a file:// URI.
if (response) { if (response) {
if (response.status == 404 || (response.status == 0 && body == '')) { if (response.status == 404 || (response.status == 0 && body == '')) {
deferred.resolve({}); resolve({});
} }
} }
deferred.reject({err: err, response: response}); reject({err: err, response: response});
return; return;
} }
@ -201,11 +204,10 @@ function getConfig(configJsonFilename) {
// parameter, since this throws a parse error on empty // parameter, since this throws a parse error on empty
// which breaks if there's no config.json and we're // which breaks if there's no config.json and we're
// loading from the filesystem (see above). // loading from the filesystem (see above).
deferred.resolve(JSON.parse(body)); resolve(JSON.parse(body));
} },
); );
});
return deferred.promise;
} }
function onTokenLoginCompleted() { function onTokenLoginCompleted() {

View File

@ -68,11 +68,11 @@ export default class WebPlatform extends VectorBasePlatform {
// annoyingly, the latest spec says this returns a // annoyingly, the latest spec says this returns a
// promise, but this is only supported in Chrome 46 // promise, but this is only supported in Chrome 46
// and Firefox 47, so adapt the callback API. // and Firefox 47, so adapt the callback API.
const defer = Promise.defer(); return new Promise(function(resolve, reject) {
global.Notification.requestPermission((result) => { global.Notification.requestPermission((result) => {
defer.resolve(result); resolve(result);
});
}); });
return defer.promise;
} }
displayNotification(title: string, msg: string, avatarUrl: string, room: Object) { displayNotification(title: string, msg: string, avatarUrl: string, room: Object) {
@ -103,13 +103,13 @@ export default class WebPlatform extends VectorBasePlatform {
} }
_getVersion(): Promise<string> { _getVersion(): Promise<string> {
const deferred = Promise.defer();
// We add a cachebuster to the request to make sure that we know about // We add a cachebuster to the request to make sure that we know about
// the most recent version on the origin server. That might not // the most recent version on the origin server. That might not
// actually be the version we'd get on a reload (particularly in the // actually be the version we'd get on a reload (particularly in the
// presence of intermediate caching proxies), but still: we're trying // presence of intermediate caching proxies), but still: we're trying
// to tell the user that there is a new version. // to tell the user that there is a new version.
return new Promise(function(resolve, reject) {
request( request(
{ {
method: "GET", method: "GET",
@ -119,15 +119,15 @@ export default class WebPlatform extends VectorBasePlatform {
(err, response, body) => { (err, response, body) => {
if (err || response.status < 200 || response.status >= 300) { if (err || response.status < 200 || response.status >= 300) {
if (err === null) err = { status: response.status }; if (err === null) err = { status: response.status };
deferred.reject(err); reject(err);
return; return;
} }
const ver = body.trim(); const ver = body.trim();
deferred.resolve(ver); resolve(ver);
}, },
); );
return deferred.promise; });
} }
getAppVersion(): Promise<string> { getAppVersion(): Promise<string> {

View File

@ -164,6 +164,12 @@ module.exports = {
// don't fill the console up with a mahoosive list of modules // don't fill the console up with a mahoosive list of modules
chunks: false, chunks: false,
}, },
// hot mdule replacement doesn't work (I think we'd need react-hot-reload?)
// so webpack-dev-server reloads the page on every update which is quite
// tedious in Riot since that can take a while.
hot: false,
inline: false,
}, },
}; };