From 69745bbd40069439b6765aff0e2219ac6566e455 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 4 Sep 2020 21:55:50 -0600 Subject: [PATCH 01/84] Switch to using the Widget API SDK for Jitsi widgets --- src/vector/jitsi/index.ts | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 081246c0a9..3ebbc7d3b4 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -18,7 +18,12 @@ limitations under the License. require("./index.scss"); import * as qs from 'querystring'; -import { Capability, WidgetApi } from "matrix-react-sdk/src/widgets/WidgetApi"; +import { + IWidgetApiRequest, + IWidgetApiRequestEmptyData, + VideoConferenceCapabilities, + WidgetApi +} from "matrix-widget-api"; // Dev note: we use raw JS without many dependencies to reduce bundle size. // We do not need all of React to render a Jitsi conference. @@ -56,11 +61,19 @@ let widgetApi: WidgetApi; const widgetId = qsParam('widgetId', true); // Set this up as early as possible because Element will be hitting it almost immediately. + let readyPromise: Promise<[void, void]>; if (parentUrl && widgetId) { - widgetApi = new WidgetApi(qsParam('parentUrl'), qsParam('widgetId'), [ - Capability.AlwaysOnScreen, + const parentOrigin = new URL(qsParam('parentUrl')).origin; + widgetApi = new WidgetApi(qsParam("widgetId"), parentOrigin); + widgetApi.requestCapabilities(VideoConferenceCapabilities); + readyPromise = Promise.all([ + widgetApi.waitFor>("im.vector.ready") + .then(ev => widgetApi.transport.reply(ev.detail, {})), + widgetApi.waitFor("ready"), ]); - widgetApi.expectingExplicitReady = true; + widgetApi.start(); + } else { + throw new Error("No parent URL or no widget ID"); } // Populate the Jitsi params now @@ -70,10 +83,8 @@ let widgetApi: WidgetApi; avatarUrl = qsParam('avatarUrl', true); // http not mxc userId = qsParam('userId'); - if (widgetApi) { - await widgetApi.waitReady(); - await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen - } + await readyPromise; + await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen // TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795) From 2fa8b0f8b2bfe616f6348ef88166a5e3c08e169a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 4 Sep 2020 22:02:18 -0600 Subject: [PATCH 02/84] Make the types happy --- src/vector/jitsi/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 3ebbc7d3b4..f31bf46baa 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -69,7 +69,7 @@ let widgetApi: WidgetApi; readyPromise = Promise.all([ widgetApi.waitFor>("im.vector.ready") .then(ev => widgetApi.transport.reply(ev.detail, {})), - widgetApi.waitFor("ready"), + widgetApi.waitFor("ready").then(), ]); widgetApi.start(); } else { From 737fa7dca5814a6ad6f8308bbbd23aada500e834 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 16 Sep 2020 14:39:40 -0600 Subject: [PATCH 03/84] Jitsi widget wrapper updates for hangup button See https://github.com/matrix-org/matrix-react-sdk/pull/5223 --- src/vector/jitsi/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 6e697fee2f..e376a34d66 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -40,6 +40,7 @@ let jitsiAuth: string; let roomId: string; let widgetApi: WidgetApi; +let meetApi: any; // JitsiMeetExternalAPI (async function() { try { @@ -88,7 +89,13 @@ let widgetApi: WidgetApi; } else { enableJoinButton(); } + // TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795) + + widgetApi.on('hangup', () => { + console.log("@@ HANGUP"); + if (meetApi) meetApi.executeCommand('hangup'); + }); } else { enableJoinButton(); } @@ -199,7 +206,7 @@ function joinConference() { // event handler bound in HTML jwt: jwt, }; - const meetApi = new JitsiMeetExternalAPI(jitsiDomain, options); + meetApi = new JitsiMeetExternalAPI(jitsiDomain, options); if (displayName) meetApi.executeCommand("displayName", displayName); if (avatarUrl) meetApi.executeCommand("avatarUrl", avatarUrl); if (userId) meetApi.executeCommand("email", userId); @@ -214,5 +221,6 @@ function joinConference() { // event handler bound in HTML } document.getElementById("jitsiContainer").innerHTML = ""; + meetApi = null; }); } From 05d5e3f68036757ab0732c530a41da10f8cc9456 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 17 Sep 2020 14:59:43 -0600 Subject: [PATCH 04/84] Remove debugging --- src/vector/jitsi/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index e376a34d66..ca32ea7540 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -93,7 +93,6 @@ let meetApi: any; // JitsiMeetExternalAPI // TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795) widgetApi.on('hangup', () => { - console.log("@@ HANGUP"); if (meetApi) meetApi.executeCommand('hangup'); }); } else { From c7617c2538c2273a82da7c02228ac7f72522b7e1 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 22 Sep 2020 09:01:55 -0600 Subject: [PATCH 05/84] Fix bad merge --- src/vector/jitsi/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 5d391c19ea..ad2eb5825e 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -18,7 +18,6 @@ limitations under the License. require("./index.scss"); import * as qs from 'querystring'; -import {Capability, WidgetApi} from 'matrix-react-sdk/src/widgets/WidgetApi'; import {KJUR} from 'jsrsasign'; import { IWidgetApiRequest, @@ -92,13 +91,14 @@ let widgetApi: WidgetApi; roomId = qsParam('roomId', true); if (widgetApi) { - await widgetApi.waitReady(); + await readyPromise; await widgetApi.setAlwaysOnScreen(false); // start off as detachable from the screen // See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { // Request credentials, give callback to continue when received - widgetApi.requestOpenIDCredentials(credentialsResponseCallback); + // TODO: Implement in widget API + //widgetApi.requestOpenIDCredentials(credentialsResponseCallback); } else { enableJoinButton(); } From 6223d0742d26bf68394748e19ef5cce8d3fe7220 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 23 Sep 2020 15:35:02 +0100 Subject: [PATCH 06/84] Upgrade matrix-js-sdk to 8.4.0-rc.1 --- package.json | 2 +- yarn.lock | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d2421e4524..cb098e8329 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", - "matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop", + "matrix-js-sdk": "8.4.0-rc.1", "matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", diff --git a/yarn.lock b/yarn.lock index 3bf87e05e1..62688d46f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7341,6 +7341,21 @@ mathml-tag-names@^2.1.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== +matrix-js-sdk@8.4.0-rc.1: + version "8.4.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.4.0-rc.1.tgz#9547e6d0088ec22fc6463c3144aee8c03266c215" + integrity sha512-u5I8OesrGePVj+NoZByXwV4QBujrMPb4BlKWII4VscvVitLoD/iuz9beNvic3esNF8U3ruWVDcOwA0XQIoumQQ== + dependencies: + "@babel/runtime" "^7.8.3" + another-json "^0.2.0" + browser-request "^0.3.3" + bs58 "^4.0.1" + content-type "^1.0.2" + loglevel "^1.6.4" + qs "^6.5.2" + request "^2.88.0" + unhomoglyph "^1.0.2" + "matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": version "8.3.0" resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/b9886d4f3479c041fc6d91ebc88c4a998e9d2e7c" From b0de2d9108bbc420bae670394f04e55e11d0b811 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 23 Sep 2020 15:35:23 +0100 Subject: [PATCH 07/84] Upgrade matrix-react-sdk to 3.5.0-rc.1 --- package.json | 2 +- yarn.lock | 40 ++++++---------------------------------- 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index cb098e8329..ba7a7cfe41 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", "matrix-js-sdk": "8.4.0-rc.1", - "matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop", + "matrix-react-sdk": "3.5.0-rc.1", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", "react": "^16.9.0", diff --git a/yarn.lock b/yarn.lock index 62688d46f3..75ae9dc8e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7356,20 +7356,6 @@ matrix-js-sdk@8.4.0-rc.1: request "^2.88.0" unhomoglyph "^1.0.2" -"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop": - version "8.3.0" - resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/b9886d4f3479c041fc6d91ebc88c4a998e9d2e7c" - dependencies: - "@babel/runtime" "^7.8.3" - another-json "^0.2.0" - browser-request "^0.3.3" - bs58 "^4.0.1" - content-type "^1.0.2" - loglevel "^1.6.4" - qs "^6.5.2" - request "^2.88.0" - unhomoglyph "^1.0.2" - matrix-mock-request@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/matrix-mock-request/-/matrix-mock-request-1.2.3.tgz#56b15d86e2601a9b48a854844396d18caab649c8" @@ -7378,9 +7364,10 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -"matrix-react-sdk@github:matrix-org/matrix-react-sdk#develop": - version "3.4.1" - resolved "https://codeload.github.com/matrix-org/matrix-react-sdk/tar.gz/747126950b14ded4e09b3c0c8cc6beb04b64b052" +matrix-react-sdk@3.5.0-rc.1: + version "3.5.0-rc.1" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.5.0-rc.1.tgz#215de18f11e40617f62f48eed2ddca0a5fdcb54c" + integrity sha512-MGQEnd+7yYPUYDcAM1Ye5RcUHuQYyJjMFwA1dFAjJrgO6aq75vVB3UNuoMz1bGxP0C+hmDJtrHxEMEN72XXJeg== dependencies: "@babel/runtime" "^7.10.5" await-lock "^2.0.1" @@ -7407,7 +7394,7 @@ matrix-mock-request@^1.2.3: is-ip "^2.0.0" linkifyjs "^2.1.9" lodash "^4.17.19" - matrix-js-sdk "github:matrix-org/matrix-js-sdk#develop" + matrix-js-sdk "8.4.0-rc.1" minimist "^1.2.5" pako "^1.0.11" parse5 "^5.1.1" @@ -7424,7 +7411,7 @@ matrix-mock-request@^1.2.3: react-transition-group "^4.4.1" resize-observer-polyfill "^1.5.1" rfc4648 "^1.4.0" - sanitize-html "^1.27.1" + sanitize-html "github:apostrophecms/sanitize-html#3c7f93f2058f696f5359e3e58d464161647226db" tar-js "^0.3.0" text-encoding-utf-8 "^1.0.2" url "^0.11.0" @@ -10471,16 +10458,6 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" -sanitize-html@^1.27.1: - version "1.27.1" - resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-1.27.1.tgz#ce147951aa3defba13448e2ca8a4e18d8f2e2cd7" - integrity sha512-C+N7E+7ikYaLHdb9lEkQaFOgmj+9ddZ311Ixs/QsBsoLD411/vdLweiFyGqrswUVgLqagOS5NCDxcEPH7trObQ== - dependencies: - htmlparser2 "^4.1.0" - lodash "^4.17.15" - postcss "^7.0.27" - srcset "^2.0.1" - "sanitize-html@github:apostrophecms/sanitize-html#3c7f93f2058f696f5359e3e58d464161647226db": version "2.0.0-rc.3" resolved "https://codeload.github.com/apostrophecms/sanitize-html/tar.gz/3c7f93f2058f696f5359e3e58d464161647226db" @@ -10959,11 +10936,6 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -srcset@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/srcset/-/srcset-2.0.1.tgz#8f842d357487eb797f413d9c309de7a5149df5ac" - integrity sha512-00kZI87TdRKwt+P8jj8UZxbfp7mK2ufxcIMWvhAOZNJTRROimpHeruWrGvCZneiuVDLqdyHefVp748ECTnyUBQ== - srcset@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/srcset/-/srcset-3.0.0.tgz#8afd8b971362dfc129ae9c1a99b3897301ce6441" From 3939a1dc1e143732b496baa7e539493659d574b4 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 23 Sep 2020 15:43:00 +0100 Subject: [PATCH 08/84] Add sanitize-html types --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index ba7a7cfe41..999d15f332 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,7 @@ "@types/node": "^12.12.41", "@types/react": "16.9", "@types/react-dom": "^16.9.4", + "@types/sanitize-html": "^1.23.3", "autoprefixer": "^9.7.3", "babel-eslint": "^10.0.3", "babel-jest": "^24.9.0", From 63a5156fa01993255a9943ff810f3d51deb9158f Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 23 Sep 2020 15:45:45 +0100 Subject: [PATCH 09/84] Prepare changelog for v1.7.8-rc.1 --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73aeb997f3..5f3e8fe095 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,29 @@ +Changes in [1.7.8-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.8-rc.1) (2020-09-23) +======================================================================================================= +[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.7...v1.7.8-rc.1) + + * Upgrade to React SDK 3.5.0-rc.1 and JS SDK 8.4.0-rc.1 + * Update from Weblate + [\#15262](https://github.com/vector-im/element-web/pull/15262) + * Upgrade sanitize-html + [\#15260](https://github.com/vector-im/element-web/pull/15260) + * Document config for preferring Secure Backup setup methods + [\#15251](https://github.com/vector-im/element-web/pull/15251) + * Add end-user documentation for UI features + [\#15190](https://github.com/vector-im/element-web/pull/15190) + * Update git checkout instructions + [\#15218](https://github.com/vector-im/element-web/pull/15218) + * If no bug_report_endpoint_url, hide rageshaking from the App + [\#15201](https://github.com/vector-im/element-web/pull/15201) + * Bump node-fetch from 2.6.0 to 2.6.1 + [\#15153](https://github.com/vector-im/element-web/pull/15153) + * Remove references to Travis CI + [\#15137](https://github.com/vector-im/element-web/pull/15137) + * Fix onNewScreen to use replace when going from roomId->roomAlias + [\#15127](https://github.com/vector-im/element-web/pull/15127) + * Enable Estonian in language menu + [\#15136](https://github.com/vector-im/element-web/pull/15136) + Changes in [1.7.7](https://github.com/vector-im/element-web/releases/tag/v1.7.7) (2020-09-14) ============================================================================================= [Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.6...v1.7.7) From 7f6c2bbe441d615543825aa05c3bca5c26d84d37 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Wed, 23 Sep 2020 15:45:46 +0100 Subject: [PATCH 10/84] v1.7.8-rc.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 999d15f332..29977050f3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "riot-web", "productName": "Riot", - "version": "1.7.7", + "version": "1.7.8-rc.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From c47532fe2a2f03c30a8de666e30cac49307ac4bc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 24 Sep 2020 13:01:34 +0100 Subject: [PATCH 11/84] Tidy up Service Worker, only run Workbox in production Moves ServiceWorker load into Platform so its not done by Electron Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/index.ts | 5 - src/vector/platform/WebPlatform.ts | 11 ++ webpack.config.js | 167 +++++++++++++++-------------- 3 files changed, 97 insertions(+), 86 deletions(-) diff --git a/src/vector/index.ts b/src/vector/index.ts index a9dd10ffec..e1919098f6 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -28,11 +28,6 @@ require('highlight.js/styles/github.css'); import {parseQsFromFragment} from "./url_utils"; import './modernizr'; -// load service worker if available on this platform -if ('serviceWorker' in navigator) { - navigator.serviceWorker.register('service-worker.js'); -} - async function settled(...promises: Array>) { for (const prom of promises) { try { diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index 2e739a2660..0a82b28e3c 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -34,6 +34,17 @@ const POKE_RATE_MS = 10 * 60 * 1000; // 10 min export default class WebPlatform extends VectorBasePlatform { private runningVersion: string = null; + constructor() { + super(); + + // load service worker if available on this platform + // Service worker is disabled in development: https://github.com/GoogleChrome/workbox/issues/1790 + if ('serviceWorker' in navigator && process.env.NODE_ENV === "production") { + navigator.serviceWorker.register('service-worker.js'); + } + } + + getHumanReadableName(): string { return 'Web Platform'; // no translation required: only used for analytics } diff --git a/webpack.config.js b/webpack.config.js index b58d35146f..1b59d87406 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,6 +31,84 @@ module.exports = (env, argv) => { const reactSdkSrcDir = path.resolve(require.resolve("matrix-react-sdk/package.json"), '..', 'src'); const jsSdkSrcDir = path.resolve(require.resolve("matrix-js-sdk/package.json"), '..', 'src'); + const plugins = [ + // This exports our CSS using the splitChunks and loaders above. + new MiniCssExtractPlugin({ + filename: 'bundles/[hash]/[name].css', + ignoreOrder: false, // Enable to remove warnings about conflicting order + }), + + // This is the app's main entry point. + new HtmlWebpackPlugin({ + template: './src/vector/index.html', + + // we inject the links ourselves via the template, because + // HtmlWebpackPlugin will screw up our formatting like the names + // of the themes and which chunks we actually care about. + inject: false, + excludeChunks: ['mobileguide', 'usercontent', 'jitsi'], + minify: argv.mode === 'production', + vars: { + og_image_url: og_image_url, + }, + }), + + // This is the jitsi widget wrapper (embedded, so isolated stack) + new HtmlWebpackPlugin({ + template: './src/vector/jitsi/index.html', + filename: 'jitsi.html', + minify: argv.mode === 'production', + chunks: ['jitsi'], + }), + + // This is the mobile guide's entry point (separate for faster mobile loading) + new HtmlWebpackPlugin({ + template: './src/vector/mobile_guide/index.html', + filename: 'mobile_guide/index.html', + minify: argv.mode === 'production', + chunks: ['mobileguide'], + }), + + // These are the static error pages for when the javascript env is *really unsupported* + new HtmlWebpackPlugin({ + template: './src/vector/static/unable-to-load.html', + filename: 'static/unable-to-load.html', + minify: argv.mode === 'production', + chunks: [], + }), + new HtmlWebpackPlugin({ + template: './src/vector/static/incompatible-browser.html', + filename: 'static/incompatible-browser.html', + minify: argv.mode === 'production', + chunks: [], + }), + + // This is the usercontent sandbox's entry point (separate for iframing) + new HtmlWebpackPlugin({ + template: './node_modules/matrix-react-sdk/src/usercontent/index.html', + filename: 'usercontent/index.html', + minify: argv.mode === 'production', + chunks: ['usercontent'], + }), + ]; + + if (argv.mode === "production") { + plugins.push(new WorkboxPlugin.GenerateSW({ + maximumFileSizeToCacheInBytes: 22000000, + runtimeCaching: [{ + urlPattern: /i18n\/.*\.json$/, + handler: 'CacheFirst', + + options: { + cacheName: 'i18n', + expiration: { + maxEntries: 2, + }, + }, + }], + })); + } + return { ...development, @@ -148,8 +226,8 @@ module.exports = (env, argv) => { }, loader: 'babel-loader', options: { - cacheDirectory: true - } + cacheDirectory: true, + }, }, { test: /\.css$/, @@ -160,7 +238,7 @@ module.exports = (env, argv) => { options: { importLoaders: 1, sourceMap: true, - } + }, }, { loader: 'postcss-loader', @@ -198,7 +276,7 @@ module.exports = (env, argv) => { "local-plugins": true, }, }, - ] + ], }, { test: /\.scss$/, @@ -209,7 +287,7 @@ module.exports = (env, argv) => { options: { importLoaders: 1, sourceMap: true, - } + }, }, { loader: 'postcss-loader', @@ -236,7 +314,7 @@ module.exports = (env, argv) => { "local-plugins": true, }, }, - ] + ], }, { test: /\.wasm$/, @@ -294,83 +372,10 @@ module.exports = (env, argv) => { }, ], }, - ] + ], }, - plugins: [ - // This exports our CSS using the splitChunks and loaders above. - new MiniCssExtractPlugin({ - filename: 'bundles/[hash]/[name].css', - ignoreOrder: false, // Enable to remove warnings about conflicting order - }), - - // This is the app's main entry point. - new HtmlWebpackPlugin({ - template: './src/vector/index.html', - - // we inject the links ourselves via the template, because - // HtmlWebpackPlugin will screw up our formatting like the names - // of the themes and which chunks we actually care about. - inject: false, - excludeChunks: ['mobileguide', 'usercontent', 'jitsi'], - minify: argv.mode === 'production', - vars: { - og_image_url: og_image_url, - }, - }), - - // This is the jitsi widget wrapper (embedded, so isolated stack) - new HtmlWebpackPlugin({ - template: './src/vector/jitsi/index.html', - filename: 'jitsi.html', - minify: argv.mode === 'production', - chunks: ['jitsi'], - }), - - // This is the mobile guide's entry point (separate for faster mobile loading) - new HtmlWebpackPlugin({ - template: './src/vector/mobile_guide/index.html', - filename: 'mobile_guide/index.html', - minify: argv.mode === 'production', - chunks: ['mobileguide'], - }), - - // These are the static error pages for when the javascript env is *really unsupported* - new HtmlWebpackPlugin({ - template: './src/vector/static/unable-to-load.html', - filename: 'static/unable-to-load.html', - minify: argv.mode === 'production', - chunks: [], - }), - new HtmlWebpackPlugin({ - template: './src/vector/static/incompatible-browser.html', - filename: 'static/incompatible-browser.html', - minify: argv.mode === 'production', - chunks: [], - }), - - // This is the usercontent sandbox's entry point (separate for iframing) - new HtmlWebpackPlugin({ - template: './node_modules/matrix-react-sdk/src/usercontent/index.html', - filename: 'usercontent/index.html', - minify: argv.mode === 'production', - chunks: ['usercontent'], - }), - - new WorkboxPlugin.GenerateSW({ - runtimeCaching: [{ - urlPattern: /i18n\/.*\.json$/, - handler: 'CacheFirst', - - options: { - cacheName: 'i18n', - expiration: { - maxEntries: 2, - }, - }, - }], - }), - ], + plugins, output: { path: path.join(__dirname, "webapp"), From 82749c3de39f18e905bb947c686fd103398b1ef5 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 24 Sep 2020 13:25:59 -0600 Subject: [PATCH 12/84] Fix Jitsi for new widget-api --- src/vector/jitsi/index.ts | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index ad2eb5825e..b60715344d 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -20,6 +20,7 @@ require("./index.scss"); import * as qs from 'querystring'; import {KJUR} from 'jsrsasign'; import { + IOpenIDCredentials, IWidgetApiRequest, IWidgetApiRequestEmptyData, VideoConferenceCapabilities, @@ -43,6 +44,7 @@ let avatarUrl: string; let userId: string; let jitsiAuth: string; let roomId: string; +let openIdToken: IOpenIDCredentials; let widgetApi: WidgetApi; @@ -72,9 +74,16 @@ let widgetApi: WidgetApi; widgetApi = new WidgetApi(qsParam("widgetId"), parentOrigin); widgetApi.requestCapabilities(VideoConferenceCapabilities); readyPromise = Promise.all([ - widgetApi.waitFor>("im.vector.ready") - .then(ev => widgetApi.transport.reply(ev.detail, {})), - widgetApi.waitFor("ready").then(), + new Promise(resolve => { + widgetApi.once>("action:im.vector.ready", ev => { + ev.preventDefault(); + widgetApi.transport.reply(ev.detail, {}); + resolve(); + }); + }), + new Promise(resolve => { + widgetApi.once("ready", () => resolve()); + }), ]); widgetApi.start(); } else { @@ -97,8 +106,9 @@ let widgetApi: WidgetApi; // See https://github.com/matrix-org/prosody-mod-auth-matrix-user-verification if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { // Request credentials, give callback to continue when received - // TODO: Implement in widget API - //widgetApi.requestOpenIDCredentials(credentialsResponseCallback); + openIdToken = await widgetApi.requestOpenIDConnectToken(); + console.log("Got OpenID Connect token"); + enableJoinButton(); } else { enableJoinButton(); } @@ -112,19 +122,6 @@ let widgetApi: WidgetApi; } })(); -/** - * Enable or show error depending on what the credentials response is. - */ -function credentialsResponseCallback() { - if (widgetApi.openIDCredentials) { - console.info('Successfully got OpenID credentials.'); - enableJoinButton(); - } else { - console.warn('OpenID credentials request was blocked by user.'); - document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; - } -} - function enableJoinButton() { document.getElementById("joinButton").onclick = () => joinConference(); } @@ -154,7 +151,7 @@ function createJWTToken() { room: "*", context: { matrix: { - token: widgetApi.openIDCredentials.accessToken, + token: openIdToken.access_token, room_id: roomId, }, user: { @@ -177,7 +174,7 @@ function createJWTToken() { function joinConference() { // event handler bound in HTML let jwt; if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { - if (!widgetApi.openIDCredentials || !widgetApi.openIDCredentials.accessToken) { + if (!openIdToken?.access_token) { // We've failing to get a token, don't try to init conference console.warn('Expected to have an OpenID credential, cannot initialize widget.'); document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; From 6c92e794f939f00a786169d30da578f57f40d118 Mon Sep 17 00:00:00 2001 From: linsui Date: Fri, 25 Sep 2020 04:58:04 +0000 Subject: [PATCH 13/84] Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (33 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/zh_Hans/ --- src/i18n/strings/zh_Hans.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/zh_Hans.json b/src/i18n/strings/zh_Hans.json index 89b796ab82..c5096b390e 100644 --- a/src/i18n/strings/zh_Hans.json +++ b/src/i18n/strings/zh_Hans.json @@ -32,5 +32,5 @@ "Open": "打开", "Your browser can't run %(brand)s": "浏览器无法运行%(brand)s", "%(brand)s uses advanced browser features which aren't supported by your current browser.": "当前浏览器不支持%(brand)s调用的高级浏览器特性。", - "Powered by Matrix": "Powered by Matrix" + "Powered by Matrix": "由 Matrix 驱动" } From 0f7a207c3e36df6fc894023ae5e4558041e1fb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0?= Date: Sat, 26 Sep 2020 15:00:11 +0000 Subject: [PATCH 14/84] Translated using Weblate (Catalan) Currently translated at 93.9% (31 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/ca/ --- src/i18n/strings/ca.json | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/i18n/strings/ca.json b/src/i18n/strings/ca.json index d4be8f45f3..1e186410e6 100644 --- a/src/i18n/strings/ca.json +++ b/src/i18n/strings/ca.json @@ -10,5 +10,26 @@ "Sign In": "Inicia la sessió", "Invalid configuration: no default server specified.": "Configuració no vàlida: no s'ha especificat cap servidor per defecte.", "Invalid JSON": "JSON no vàlid", - "Go to your browser to complete Sign In": "Aneu al vostre navegador per completar l'inici de sessió" + "Go to your browser to complete Sign In": "Aneu al vostre navegador per completar l'inici de sessió", + "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuració incorrecta: només podeu especificar una de les opcions default_server_config, default_server_name, o default_hs_url.", + "Your Element is misconfigured": "El vostre Element està mal configurat", + "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "El vostre Element conté un JSON incorrecte. Si us plau arregleu el problema i recarregueu la pàgina.", + "The message from the parser is: %(message)s": "El missatge de l'analitzador és: %(message)s", + "Unable to load config file: please refresh the page to try again.": "No he pogut carregar l'arxiu de configuració: si us plau recarregueu la pàgina per provar-ho de nou.", + "Unexpected error preparing the app. See console for details.": "Error inesperat preparant l'app. Vegeu la consola pels detalls.", + "Download Completed": "Descàrrega completada", + "Open": "Obre", + "Open user settings": "Obre configuració d'usuari", + "Previous/next recently visited room or community": "Anterior/Següent sala o comunitat visitada recentment", + "%(brand)s Desktop (%(platformName)s)": "%(brand)s d'escriptori (%(platformName)s)", + "%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)", + "Powered by Matrix": "En funcionament gràcies a Matrix", + "Unsupported browser": "Navegador no suportat", + "Your browser can't run %(brand)s": "El vostre navegador no pot executar %(brand)s", + "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s usa característiques avançades del navegador que el vostre navegador no suporta.", + "Please install Chrome, Firefox, or Safari for the best experience.": "Si us plau instal·leuChrome, Firefox, o Safari per una millor experiència.", + "You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "Podeu continuar usant el vostre navegador actual, però algunes o totes les característiques podrien no funcionar i l'aspepte de l'aplicació podria mostrar errors.", + "I understand the risks and wish to continue": "Entenc els riscos i voldria continuar", + "Go to element.io": "Vés a element.io", + "Failed to start": "Ha fallat en iniciar-se" } From 191fd2fb2ddd6f93db959c5cb8e9ec7712de80ea Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 28 Sep 2020 16:24:30 +0100 Subject: [PATCH 15/84] Upgrade matrix-js-sdk to 8.4.1 --- package.json | 2 +- yarn.lock | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 29977050f3..0f91c9a236 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "gfm.css": "^1.1.2", "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", - "matrix-js-sdk": "8.4.0-rc.1", + "matrix-js-sdk": "8.4.1", "matrix-react-sdk": "3.5.0-rc.1", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", diff --git a/yarn.lock b/yarn.lock index 75ae9dc8e7..2bde740f2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1333,6 +1333,13 @@ "@types/prop-types" "*" csstype "^2.2.0" +"@types/sanitize-html@^1.23.3": + version "1.27.0" + resolved "https://registry.yarnpkg.com/@types/sanitize-html/-/sanitize-html-1.27.0.tgz#77702dc856f16efecc005014c1d2e45b1f2cbc56" + integrity sha512-j7Vnh3P7W4ZcoRsHNO2HpwA2m1d0c2+l39xqSQqH0+WlfcvKypgZp45eCC7NJ75ZyXPxNb2PSbIL6LtZ6E0Qbw== + dependencies: + htmlparser2 "^4.1.0" + "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" @@ -7356,6 +7363,21 @@ matrix-js-sdk@8.4.0-rc.1: request "^2.88.0" unhomoglyph "^1.0.2" +matrix-js-sdk@8.4.1: + version "8.4.1" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.4.1.tgz#4e7e8bf8d5f6d8362aef68bed8e0d2f03f262194" + integrity sha512-AfA2y/dt10ysXKzngwqzajzxTL0Xq8lW5bBr0mq21JUKndBP1f1AOOiIkX5nLA9IZGzVoe0anKV+cU2aGWcdkw== + dependencies: + "@babel/runtime" "^7.8.3" + another-json "^0.2.0" + browser-request "^0.3.3" + bs58 "^4.0.1" + content-type "^1.0.2" + loglevel "^1.6.4" + qs "^6.5.2" + request "^2.88.0" + unhomoglyph "^1.0.2" + matrix-mock-request@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/matrix-mock-request/-/matrix-mock-request-1.2.3.tgz#56b15d86e2601a9b48a854844396d18caab649c8" From 4d84df11c42be35c647695368e9dee321f1e29ef Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 28 Sep 2020 16:25:04 +0100 Subject: [PATCH 16/84] Upgrade matrix-react-sdk to 3.5.0 --- package.json | 2 +- yarn.lock | 25 +++++-------------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 0f91c9a236..7a6c41a26b 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlight.js": "^9.13.1", "jsrsasign": "^9.1.5", "matrix-js-sdk": "8.4.1", - "matrix-react-sdk": "3.5.0-rc.1", + "matrix-react-sdk": "3.5.0", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", "react": "^16.9.0", diff --git a/yarn.lock b/yarn.lock index 2bde740f2f..446ca9e7ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7348,21 +7348,6 @@ mathml-tag-names@^2.1.1: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@8.4.0-rc.1: - version "8.4.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.4.0-rc.1.tgz#9547e6d0088ec22fc6463c3144aee8c03266c215" - integrity sha512-u5I8OesrGePVj+NoZByXwV4QBujrMPb4BlKWII4VscvVitLoD/iuz9beNvic3esNF8U3ruWVDcOwA0XQIoumQQ== - dependencies: - "@babel/runtime" "^7.8.3" - another-json "^0.2.0" - browser-request "^0.3.3" - bs58 "^4.0.1" - content-type "^1.0.2" - loglevel "^1.6.4" - qs "^6.5.2" - request "^2.88.0" - unhomoglyph "^1.0.2" - matrix-js-sdk@8.4.1: version "8.4.1" resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-8.4.1.tgz#4e7e8bf8d5f6d8362aef68bed8e0d2f03f262194" @@ -7386,10 +7371,10 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -matrix-react-sdk@3.5.0-rc.1: - version "3.5.0-rc.1" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.5.0-rc.1.tgz#215de18f11e40617f62f48eed2ddca0a5fdcb54c" - integrity sha512-MGQEnd+7yYPUYDcAM1Ye5RcUHuQYyJjMFwA1dFAjJrgO6aq75vVB3UNuoMz1bGxP0C+hmDJtrHxEMEN72XXJeg== +matrix-react-sdk@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.5.0.tgz#69421d447fd7d769abd01f43f03784da11d30ad4" + integrity sha512-ld+q4Ku+aCwWOFB6iVw02auI5/SIcUcu/m0XByw4TfBzSdAkMzqoKczdaWMt+HIWkyJDBhcPuH2N915gELQK0g== dependencies: "@babel/runtime" "^7.10.5" await-lock "^2.0.1" @@ -7416,7 +7401,7 @@ matrix-react-sdk@3.5.0-rc.1: is-ip "^2.0.0" linkifyjs "^2.1.9" lodash "^4.17.19" - matrix-js-sdk "8.4.0-rc.1" + matrix-js-sdk "8.4.1" minimist "^1.2.5" pako "^1.0.11" parse5 "^5.1.1" From a42eb0ce42ba7679848cfb98f7f55332789f9af3 Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 28 Sep 2020 16:28:04 +0100 Subject: [PATCH 17/84] Prepare changelog for v1.7.8 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f3e8fe095..93f39abc00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Changes in [1.7.8](https://github.com/vector-im/element-web/releases/tag/v1.7.8) (2020-09-28) +============================================================================================= +[Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.8-rc.1...v1.7.8) + + * Upgrade to React SDK 3.5.0 and JS SDK 8.4.1 + Changes in [1.7.8-rc.1](https://github.com/vector-im/element-web/releases/tag/v1.7.8-rc.1) (2020-09-23) ======================================================================================================= [Full Changelog](https://github.com/vector-im/element-web/compare/v1.7.7...v1.7.8-rc.1) From 802829f0ea581bd2b3b68791b8c321e46a3a117d Mon Sep 17 00:00:00 2001 From: RiotRobot Date: Mon, 28 Sep 2020 16:28:04 +0100 Subject: [PATCH 18/84] v1.7.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a6c41a26b..46bb1e20c1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "riot-web", "productName": "Riot", - "version": "1.7.8-rc.1", + "version": "1.7.8", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { From 6a89776404b26b26ba76efd2073a0709f9ecc1ef Mon Sep 17 00:00:00 2001 From: John Date: Sun, 27 Sep 2020 19:33:30 +0000 Subject: [PATCH 19/84] Translated using Weblate (Greek) Currently translated at 90.9% (30 of 33 strings) Translation: Element Web/element-web Translate-URL: https://translate.riot.im/projects/element-web/element-web/el/ --- src/i18n/strings/el.json | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/i18n/strings/el.json b/src/i18n/strings/el.json index fd08e4705a..af818ddd6d 100644 --- a/src/i18n/strings/el.json +++ b/src/i18n/strings/el.json @@ -14,7 +14,20 @@ "Invalid configuration: no default server specified.": "Μη έγκυρη ρύθμιση παραμέτρων: δεν έχει οριστεί προκαθορισμένος διακομιστής.", "Explore rooms": "Εξερευνήστε δωμάτια", "Open": "Άνοιγμα", - "Go to your browser to complete Sign In": "Επισκεφτείτε τον browser σας για να ολοκληρωθεί η είσοδος", - "Powered by Matrix": "Παρέχεται από το Matrix", - "Please install Chrome, Firefox, or Safari for the best experience.": "Παρακαλούμε εγκαταστήστε Chrome, Firefox, ή Safari για καλύτερη εμπειρία χρήσης." + "Go to your browser to complete Sign In": "Μεταβείτε στο πρόγραμμα περιήγησής σας για να ολοκληρώσετε τη σύνδεση", + "Powered by Matrix": "Με την υποστήριξη του Matrix", + "Please install Chrome, Firefox, or Safari for the best experience.": "Παρακαλούμε εγκαταστήστε Chrome, Firefox, ή Safari για καλύτερη εμπειρία χρήσης.", + "Your Element is misconfigured": "Το Element σας δεν εχει ρυθμιστεί σωστά", + "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Η ρύθμιση του Element περιέχει μη έγκυρο JSON. Διορθώστε το πρόβλημα και φορτώστε ξανά τη σελίδα.", + "Unable to load config file: please refresh the page to try again.": "Δεν είναι δυνατή η φόρτωση του αρχείου config: ανανεώστε τη σελίδα για να δοκιμάσετε ξανά.", + "Download Completed": "Η λήψη ολοκληρώθηκε", + "Open user settings": "Ανοίξτε τις ρυθμίσεις χρήστη", + "Previous/next recently visited room or community": "Προηγούμενο / επόμενο δωμάτιο ή κοινότητα που επισκεφτήκατε πρόσφατα", + "Unsupported browser": "Μη υποστηριζόμενο πρόγραμμα περιήγησης", + "Your browser can't run %(brand)s": "Το πρόγραμμα περιήγησής σας δεν μπορεί να εκτελέσει %(brand)s", + "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s χρησιμοποιεί προηγμένες δυνατότητες προγράμματος περιήγησης που δεν υποστηρίζονται από το τρέχον πρόγραμμα περιήγησής σας.", + "You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "Μπορείτε να συνεχίσετε να χρησιμοποιείτε το τρέχον πρόγραμμα περιήγησής σας, αλλά ορισμένες ή όλες οι λειτουργίες ενδέχεται να μην λειτουργούν και η εμφάνιση και η αίσθηση της εφαρμογής ενδέχεται να είναι λανθασμένη.", + "I understand the risks and wish to continue": "Κατανοώ τους κινδύνους και επιθυμώ να συνεχίσω", + "Go to element.io": "Πήγαινε στο element.io", + "Failed to start": "Αποτυχία έναρξης" } From a1e6b019d2cd6b9d07b1bb7666fca4af59ac4fa7 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 29 Sep 2020 11:01:26 -0600 Subject: [PATCH 20/84] Give the Jitsi widget an icon to help with discovery We think users will be expecting to follow a series of icons into their conference, so we'll remind them here of what is going on with a giant icon. This does not change depending on the call type because the jitsi widget doesn't understand the call type anyways - it's always a video conference. --- src/vector/jitsi/index.html | 2 +- src/vector/jitsi/index.scss | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/vector/jitsi/index.html b/src/vector/jitsi/index.html index 1259eb1c4a..38f6d31135 100644 --- a/src/vector/jitsi/index.html +++ b/src/vector/jitsi/index.html @@ -9,7 +9,7 @@
- +

Jitsi Video Conference

diff --git a/src/vector/jitsi/index.scss b/src/vector/jitsi/index.scss index fc33c9d8d0..9b5f4b5b92 100644 --- a/src/vector/jitsi/index.scss +++ b/src/vector/jitsi/index.scss @@ -23,10 +23,11 @@ limitations under the License. src: url('~matrix-react-sdk/res/fonts/Nunito/Nunito-Regular.ttf') format('truetype'); } +$fg-color: #edf3ff; body { font-family: Nunito, Arial, Helvetica, sans-serif; background-color: #181b21; - color: #edf3ff; + color: $fg-color; } body, html { @@ -73,3 +74,22 @@ body, html { background-color: #03b381; border: 0; } + +.icon { + $icon-size: 42px; + margin-top: -$icon-size; // to visually center the form + + &::before { + content: ''; + background-size: contain; + background-color: $fg-color; + mask-repeat: no-repeat; + mask-position: center; + mask-image: url("~matrix-react-sdk/res/img/element-icons/call/video-call.svg"); + mask-size: $icon-size; + display: block; + width: $icon-size; + height: $icon-size; + margin: 0 auto; // center + } +} From 7ef0702df4e8e498b3cd6f1d2856e02866ca2114 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 29 Sep 2020 11:04:08 -0600 Subject: [PATCH 21/84] re-todo --- src/vector/jitsi/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vector/jitsi/index.html b/src/vector/jitsi/index.html index 38f6d31135..1a05c60277 100644 --- a/src/vector/jitsi/index.html +++ b/src/vector/jitsi/index.html @@ -10,6 +10,7 @@
+

Jitsi Video Conference

From c56368cdbbd28164b8f2a206f367382bc0abf8d0 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 29 Sep 2020 13:20:16 -0600 Subject: [PATCH 22/84] Fix hangup button handler --- src/vector/jitsi/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index cf7b02373b..acfad9afab 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -116,8 +116,9 @@ let meetApi: any; // JitsiMeetExternalAPI // TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795) - widgetApi.on('hangup', () => { + widgetApi.addEventListener('hangup', (ev: CustomEvent) => { if (meetApi) meetApi.executeCommand('hangup'); + widgetApi.transport.reply(ev.detail, {}); // ack }); } else { enableJoinButton(); From 9be700afa45c26d7e9e7d466c7919a8ba9533074 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 10:53:03 +0000 Subject: [PATCH 23/84] Riot -> Element Web in issue templates --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index a2042975e1..f710b9c949 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -38,7 +38,7 @@ For the web app: - **Browser**: Chrome, Safari, Firefox? which version? - **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? -- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web? +- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of Element Web? For the desktop app: From 050b7ad9619e48df653d02b5f48efe6a1c167fbb Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 10:53:41 +0000 Subject: [PATCH 24/84] Update bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5f472303dd..3c114b2a23 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -48,7 +48,7 @@ For the web app: - **Browser**: Chrome, Safari, Firefox? which version? - **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? -- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web? +- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of Element Web? For the desktop app: From 79ba7ab67ec308ef835f727605779716702a95b1 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 10:54:24 +0000 Subject: [PATCH 25/84] Fix links --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index f710b9c949..06c01615a1 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -38,7 +38,7 @@ For the web app: - **Browser**: Chrome, Safari, Firefox? which version? - **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? -- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of Element Web? +- **URL**: develop.riot.im / app.element.io / somewhere else? If a private server, what version of Element Web? For the desktop app: From a1ec01cd08f1331fdf02db32230335b18d097bf0 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 10:54:37 +0000 Subject: [PATCH 26/84] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 06c01615a1..7715a49e85 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -38,7 +38,7 @@ For the web app: - **Browser**: Chrome, Safari, Firefox? which version? - **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? -- **URL**: develop.riot.im / app.element.io / somewhere else? If a private server, what version of Element Web? +- **URL**: develop.element.im / app.element.io / somewhere else? If a private server, what version of Element Web? For the desktop app: From 6295ca2b1243e9a7a303f0713243e45ae296251b Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 10:54:51 +0000 Subject: [PATCH 27/84] Oh my god --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 7715a49e85..944c1298f9 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -38,7 +38,7 @@ For the web app: - **Browser**: Chrome, Safari, Firefox? which version? - **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? -- **URL**: develop.element.im / app.element.io / somewhere else? If a private server, what version of Element Web? +- **URL**: develop.element.io / app.element.io / somewhere else? If a private server, what version of Element Web? For the desktop app: From 2d58f74c02b830da2d2651289b164243e3466400 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 10:55:37 +0000 Subject: [PATCH 28/84] Fix linkies OwO --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3c114b2a23..ffeaf9ad43 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -48,7 +48,7 @@ For the web app: - **Browser**: Chrome, Safari, Firefox? which version? - **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? -- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of Element Web? +- **URL**: develop.element.io / app.element.io / somewhere else? If a private server, what version of Element Web? For the desktop app: From 64a0d5eca15f466266b201ea648d59bb2dd7040b Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 10:56:19 +0000 Subject: [PATCH 29/84] Update user-interface-or-usability-bug-report.md --- .../ISSUE_TEMPLATE/user-interface-or-usability-bug-report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/user-interface-or-usability-bug-report.md b/.github/ISSUE_TEMPLATE/user-interface-or-usability-bug-report.md index b3e68ccec9..4e090d130b 100644 --- a/.github/ISSUE_TEMPLATE/user-interface-or-usability-bug-report.md +++ b/.github/ISSUE_TEMPLATE/user-interface-or-usability-bug-report.md @@ -50,7 +50,7 @@ For the web app: - **Browser**: Chrome, Safari, Firefox? which version? - **OS**: Windows, macOS, Ubuntu, Arch Linux, etc? -- **URL**: riot.im/develop / riot.im/app / somewhere else? If a private server, what version of riot-web? +- **URL**: develop.element.io / app.element.io / somewhere else? If a private server, what version of Element Web? For the desktop app: From 407777539fc0a4f87c23d835fcfd8d38473b4652 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:00:02 +0000 Subject: [PATCH 30/84] Moar Element 'n' Stuff Gotta fix that up :-) Man this is how I spend my free time --- docs/feature-flags.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/feature-flags.md b/docs/feature-flags.md index 5fb5545fdf..effd3b30f3 100644 --- a/docs/feature-flags.md +++ b/docs/feature-flags.md @@ -49,7 +49,7 @@ When starting work on a feature, we should create a matching feature flag: ```js SettingsStore.getValue("feature_cats") ``` -3. Document the feature in the [labs documentation](https://github.com/vector-im/riot-web/blob/develop/docs/labs.md) +3. Document the feature in the [labs documentation](https://github.com/vector-im/element-web/blob/develop/docs/labs.md) With these steps completed, the feature is disabled by default, but can be enabled on develop and nightly by interested users for testing. @@ -60,9 +60,9 @@ The following lists a few common options. ## Enabling by default on develop and nightly Set the feature to `true` in the -[develop](https://github.com/vector-im/riot-web/blob/develop/riot.im/develop/config.json) +[develop](https://github.com/vector-im/element-web/blob/develop/element.io/develop/config.json) and -[nightly](https://github.com/vector-im/riot-desktop/blob/develop/riot.im/nightly/config.json) +[nightly](https://github.com/vector-im/element-web/blob/develop/element.io/nightly/config.json) configs: ```json @@ -74,9 +74,9 @@ configs: ## Enabling by default on staging, app, and release Set the feature to `true` in the -[staging / app](https://github.com/vector-im/riot-web/blob/develop/riot.im/app/config.json) +[staging / app](https://github.com/vector-im/element-web/blob/develop/element.io/app/config.json) and -[release](https://github.com/vector-im/riot-desktop/blob/develop/riot.im/release/config.json) +[release](https://github.com/vector-im/element-web/blob/develop/element.io/release/config.json) configs. **Note:** The above will only enable the feature for https://app.element.io and official Element @@ -90,18 +90,18 @@ Once we're confident that a feature is working well, we should remove or convert If the feature is meant to be turned off/on by the user: 1. Remove `isFeature` from the [setting](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.ts) 2. Change the `default` to `true` (if desired). -3. Remove the feature from the [labs documentation](https://github.com/vector-im/riot-web/blob/develop/docs/labs.md) +3. Remove the feature from the [labs documentation](https://github.com/vector-im/element-web/blob/develop/docs/labs.md) 4. Celebrate! 🥳 If the feature is meant to be forced on (non-configurable): 1. Remove the [setting](https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/settings/Settings.ts) 2. Remove all `getValue` lines that test for the feature. -3. Remove the feature from the [labs documentation](https://github.com/vector-im/riot-web/blob/develop/docs/labs.md) +3. Remove the feature from the [labs documentation](https://github.com/vector-im/element-web/blob/develop/docs/labs.md) 4. If applicable, remove the feature state from - [develop](https://github.com/vector-im/riot-web/blob/develop/riot.im/develop/config.json), - [nightly](https://github.com/vector-im/riot-desktop/blob/develop/riot.im/nightly/config.json), - [staging / app](https://github.com/vector-im/riot-web/blob/develop/riot.im/app/config.json), + [develop](https://github.com/vector-im/element-web/blob/develop/element.io/develop/config.json), + [nightly](https://github.com/vector-im/element-desktop/blob/develop/element.io/nightly/config.json), + [staging / app](https://github.com/vector-im/element-web/blob/develop/element.io/app/config.json), and - [release](https://github.com/vector-im/riot-desktop/blob/develop/riot.im/release/config.json) + [release](https://github.com/vector-im/element-desktop/blob/develop/element.io/release/config.json) configs 5. Celebrate! 🥳 From 9f6a9e101c2473c0ae646248edcc474b414bf0bb Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:00:47 +0000 Subject: [PATCH 31/84] Riot -> Element in contribute.json --- contribute.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contribute.json b/contribute.json index 0f9ceed38c..78f4900d3d 100644 --- a/contribute.json +++ b/contribute.json @@ -2,12 +2,12 @@ "name": "Riot", "description": "A glossy Matrix collaboration client for the web.", "repository": { - "url": "https://github.com/vector-im/riot-web", + "url": "https://github.com/vector-im/element-web", "license": "Apache License 2.0" }, "bugs": { - "list": "https://github.com/vector-im/riot-web/issues", - "report": "https://github.com/vector-im/riot-web/issues/new/choose" + "list": "https://github.com/vector-im/element-web/issues", + "report": "https://github.com/vector-im/element-web/issues/new/choose" }, "keywords": [ "chat", From 513c7075ab0e81c7640df7aa218e0099ca79c0a7 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:02:37 +0000 Subject: [PATCH 32/84] Riot -> Element in element.io/README.md --- element.io/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/element.io/README b/element.io/README index ee3f1cda8a..140a3fc0c8 100644 --- a/element.io/README +++ b/element.io/README @@ -6,7 +6,7 @@ official element.io distribution, but these files may be useful if you want to inspect the configuration used there. Element Desktop uses a separate config (see -https://github.com/vector-im/riot-desktop/tree/develop/element.io). +https://github.com/vector-im/element-desktop/tree/develop/element.io). Deployment scripts (such as app/deploy.py) are meant to be run on the web server hosting the Element installation. From b440a263bd5c65da176fe505a325acdb91403300 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:03:37 +0000 Subject: [PATCH 33/84] Riot -> Element in VectorAuthFooter I'm so sorry :-) --- src/components/views/auth/VectorAuthFooter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/auth/VectorAuthFooter.js b/src/components/views/auth/VectorAuthFooter.js index 21bba868d6..31a994b3f8 100644 --- a/src/components/views/auth/VectorAuthFooter.js +++ b/src/components/views/auth/VectorAuthFooter.js @@ -24,7 +24,7 @@ const VectorAuthFooter = () => { let links = [ {"text": "Blog", "url": "https://element.io/blog"}, {"text": "Twitter", "url": "https://twitter.com/element_hq"}, - {"text": "GitHub", "url": "https://github.com/vector-im/riot-web"}, + {"text": "GitHub", "url": "https://github.com/vector-im/element-web"}, ]; if (brandingConfig && brandingConfig.authFooterLinks) { From d5d3bcfac30c4e79a6545913cf1e3cdca5e62e2d Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:04:28 +0000 Subject: [PATCH 34/84] Riot -> Element in VectorEmbeddedPage --- src/components/structures/VectorEmbeddedPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/VectorEmbeddedPage.js b/src/components/structures/VectorEmbeddedPage.js index bf3e727590..747b91e481 100644 --- a/src/components/structures/VectorEmbeddedPage.js +++ b/src/components/structures/VectorEmbeddedPage.js @@ -28,7 +28,7 @@ export default class VectorEmbeddedPage extends EmbeddedPage { // we're overriding the base component here, for Element-specific tweaks translate(s) { s = sanitizeHtml(_t(s)); - // ugly fix for https://github.com/vector-im/riot-web/issues/4243 + // ugly fix for https://github.com/vector-im/element-web/issues/4243 // eslint-disable-next-line max-len s = s.replace(/\[matrix\]/, 'Matrix'); return s; From 21329f17c97004727ae0068597f289d2781b84b7 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:05:19 +0000 Subject: [PATCH 35/84] Update Riot -> Element in docs/review.md --- docs/review.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/review.md b/docs/review.md index cf3af42b53..16d6c24048 100644 --- a/docs/review.md +++ b/docs/review.md @@ -76,7 +76,7 @@ As it can be difficult to review design work from looking at just the changed files in a PR, authors should be prepared for Design and / or Product teams to request a link to an ad-hoc build of Element (hosted anywhere) that can be used for the review. In the future, we [hope to automate -this](https://github.com/vector-im/riot-web/issues/12624) for every PR. +this](https://github.com/vector-im/element-web/issues/12624) for every PR. Before starting work on a feature, it's best to ensure your plan aligns well with our vision for Element. Please chat with the team in From 831c81fcd5d49a72d817fdf86a2f98a6065db0f9 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:07:51 +0000 Subject: [PATCH 36/84] Update Riot -> Element in welcome.html --- res/welcome.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/welcome.html b/res/welcome.html index bca3c66a30..bb3f84fe64 100644 --- a/res/welcome.html +++ b/res/welcome.html @@ -169,7 +169,7 @@ we don't have an account and should hide them. No account == no guest account ei
- +

_t("Welcome to Element")

@@ -185,7 +185,7 @@ we don't have an account and should hide them. No account == no guest account ei
From a3eaa9d7faaf8a86da2c3630fb524ac8e6c9fe66 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:08:55 +0000 Subject: [PATCH 37/84] Update Riot -> Element in issues-burndown.pl --- scripts/issues-burndown.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/issues-burndown.pl b/scripts/issues-burndown.pl index 03af5ed7cc..f7cc413e78 100755 --- a/scripts/issues-burndown.pl +++ b/scripts/issues-burndown.pl @@ -18,7 +18,7 @@ my $gh = Net::GitHub->new( login => 'ara4n', pass => read_password("github password: "), ); -$gh->set_default_user_repo('vector-im', 'riot-web'); +$gh->set_default_user_repo('vector-im', 'element-web'); #my @issues = $gh->issue->repos_issues({ state => 'all', milestone => 3 }); my @issues = $gh->issue->repos_issues({ state => 'all' }); From 92382e11ef9da80f8612578cd65af4a038a93de7 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:09:47 +0000 Subject: [PATCH 38/84] Update Riot -> Element in redeploy.py --- scripts/redeploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/redeploy.py b/scripts/redeploy.py index 064bbfaa29..325c28abc3 100755 --- a/scripts/redeploy.py +++ b/scripts/redeploy.py @@ -191,7 +191,7 @@ def deploy_tarball(artifact, build_dir): # Download the tarball here as buildkite needs auth to do this # we don't pgp-sign buildkite artifacts, relying on HTTPS and buildkite - # not being evil. If that's not good enough for you, don't use riot.im/develop. + # not being evil. If that's not good enough for you, don't use develop.element.io. resp = requests.get(artifact['download_url'], stream=True, headers=req_headers()) resp.raise_for_status() with open(artifact['filename'], 'wb') as ofp: From 10d6fbaef737675c1292684724ef8fc8182be365 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:10:35 +0000 Subject: [PATCH 39/84] Update Riot -> Element in index.ts --- src/vector/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vector/index.ts b/src/vector/index.ts index e1919098f6..14e656f4ba 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -80,7 +80,7 @@ const supportedBrowser = checkBrowserFeatures(); // try in react but fallback to an `alert` // We start loading stuff but don't block on it until as late as possible to allow // the browser to use as much parallelism as it can. -// Load parallelism is based on research in https://github.com/vector-im/riot-web/issues/12253 +// Load parallelism is based on research in https://github.com/vector-im/element-web/issues/12253 async function start() { // load init.ts async so that its code is not executed immediately and we can catch any exceptions const { @@ -109,7 +109,7 @@ async function start() { // don't try to redirect to the native apps if we're // verifying a 3pid (but after we've loaded the config) // or if the user is following a deep link - // (https://github.com/vector-im/riot-web/issues/7378) + // (https://github.com/vector-im/element-web/issues/7378) const preventRedirect = fragparts.params.client_secret || fragparts.location.length > 0; if (!preventRedirect) { From 7e404ace8cec1034aa50452fcf0853e425161d6f Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 30 Sep 2020 12:29:45 +0100 Subject: [PATCH 40/84] Update contribute.json --- contribute.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contribute.json b/contribute.json index 78f4900d3d..0ac40ea378 100644 --- a/contribute.json +++ b/contribute.json @@ -1,5 +1,5 @@ { - "name": "Riot", + "name": "Element", "description": "A glossy Matrix collaboration client for the web.", "repository": { "url": "https://github.com/vector-im/element-web", From 48f71f26e7b5c2da3822a1549d321c5842861be4 Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 11:58:44 +0000 Subject: [PATCH 41/84] Apply suggestions from code review Co-authored-by: J. Ryan Stinnett --- docs/feature-flags.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/feature-flags.md b/docs/feature-flags.md index effd3b30f3..dbd9707f06 100644 --- a/docs/feature-flags.md +++ b/docs/feature-flags.md @@ -62,7 +62,7 @@ The following lists a few common options. Set the feature to `true` in the [develop](https://github.com/vector-im/element-web/blob/develop/element.io/develop/config.json) and -[nightly](https://github.com/vector-im/element-web/blob/develop/element.io/nightly/config.json) +[nightly](https://github.com/vector-im/element-desktop/blob/develop/element.io/nightly/config.json) configs: ```json @@ -76,7 +76,7 @@ configs: Set the feature to `true` in the [staging / app](https://github.com/vector-im/element-web/blob/develop/element.io/app/config.json) and -[release](https://github.com/vector-im/element-web/blob/develop/element.io/release/config.json) +[release](https://github.com/vector-im/element-desktop/blob/develop/element.io/release/config.json) configs. **Note:** The above will only enable the feature for https://app.element.io and official Element From 1d06496bd1262a29989c28c2439e22e82166de3d Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 12:00:52 +0000 Subject: [PATCH 42/84] Update Riot -> Element in redeploy.py --- scripts/redeploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/redeploy.py b/scripts/redeploy.py index 325c28abc3..e5f2cff6be 100755 --- a/scripts/redeploy.py +++ b/scripts/redeploy.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# auto-deploy script for https://riot.im/develop +# auto-deploy script for https://develop.element.io # # Listens for buildkite webhook pokes (https://buildkite.com/docs/apis/webhooks) # When it gets one, downloads the artifact from buildkite From db08128954d145742db60616cd613d7892ffebff Mon Sep 17 00:00:00 2001 From: Qt Resynth Date: Wed, 30 Sep 2020 12:04:01 +0000 Subject: [PATCH 43/84] Riot -> Element --- docs/feature-flags.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature-flags.md b/docs/feature-flags.md index dbd9707f06..1e7e5cce37 100644 --- a/docs/feature-flags.md +++ b/docs/feature-flags.md @@ -8,7 +8,7 @@ For example, flags make the following things possible: * Extended testing of a feature via labs on develop * Enabling features when ready instead of the first moment the code is released * Testing a feature with a specific set of users (by enabling only on a specific - Riot instance) + Element instance) The size of the feature controlled by a feature flag may vary widely: it could be a large project like reactions or a smaller change to an existing algorithm. From 11e676cee0611d1d710a7c573c70184c9babc182 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 30 Sep 2020 17:35:12 +0100 Subject: [PATCH 44/84] Disable workbox when running in webpack dev server, not in dev mode Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/WebPlatform.ts | 15 +++++++++++---- webpack.config.js | 6 +++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index 0a82b28e3c..3f93ad712e 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -38,13 +38,20 @@ export default class WebPlatform extends VectorBasePlatform { super(); // load service worker if available on this platform - // Service worker is disabled in development: https://github.com/GoogleChrome/workbox/issues/1790 - if ('serviceWorker' in navigator && process.env.NODE_ENV === "production") { - navigator.serviceWorker.register('service-worker.js'); + if ('serviceWorker' in navigator) { + // clean up old dummy sw.js + navigator.serviceWorker.getRegistration('sw.js').then(reg => reg.unregister()); + + // Service worker is disabled in webpack-dev-server: https://github.com/GoogleChrome/workbox/issues/1790 + if (!process.env.WEBPACK_DEV_SERVER) { + navigator.serviceWorker.register('service-worker.js'); + } else { + // we no longer run workbox when in webpack-dev-server, clean it up + navigator.serviceWorker.getRegistration('service-worker.js').then(reg => reg.unregister()); + } } } - getHumanReadableName(): string { return 'Web Platform'; // no translation required: only used for analytics } diff --git a/webpack.config.js b/webpack.config.js index 1b59d87406..a3a8af31c5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ const path = require('path'); +const {EnvironmentPlugin} = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const TerserPlugin = require('terser-webpack-plugin'); @@ -32,6 +33,8 @@ module.exports = (env, argv) => { const jsSdkSrcDir = path.resolve(require.resolve("matrix-js-sdk/package.json"), '..', 'src'); const plugins = [ + new EnvironmentPlugin(["WEBPACK_DEV_SERVER"]), // pass this as it is used for conditionally loading workbox + // This exports our CSS using the splitChunks and loaders above. new MiniCssExtractPlugin({ filename: 'bundles/[hash]/[name].css', @@ -92,7 +95,8 @@ module.exports = (env, argv) => { }), ]; - if (argv.mode === "production") { + const isDevServer = process.env.WEBPACK_DEV_SERVER; + if (!isDevServer) { plugins.push(new WorkboxPlugin.GenerateSW({ maximumFileSizeToCacheInBytes: 22000000, runtimeCaching: [{ From aa2f3918cc5ef62ca21a6d18c9fae11eec4879da Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 30 Sep 2020 17:36:57 +0100 Subject: [PATCH 45/84] consolidate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/WebPlatform.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index 3f93ad712e..d91bb2593e 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -39,15 +39,12 @@ export default class WebPlatform extends VectorBasePlatform { // load service worker if available on this platform if ('serviceWorker' in navigator) { - // clean up old dummy sw.js - navigator.serviceWorker.getRegistration('sw.js').then(reg => reg.unregister()); - // Service worker is disabled in webpack-dev-server: https://github.com/GoogleChrome/workbox/issues/1790 if (!process.env.WEBPACK_DEV_SERVER) { navigator.serviceWorker.register('service-worker.js'); } else { // we no longer run workbox when in webpack-dev-server, clean it up - navigator.serviceWorker.getRegistration('service-worker.js').then(reg => reg.unregister()); + navigator.serviceWorker.getRegistration().then(reg => reg && reg.unregister()); } } } From 7b93c56bd0861f28b9b181710ba4baa0f9d76372 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 30 Sep 2020 20:09:42 -0600 Subject: [PATCH 46/84] Fix custom hangup button --- src/vector/jitsi/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index acfad9afab..83691f7b59 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -22,10 +22,10 @@ import {KJUR} from 'jsrsasign'; import { IOpenIDCredentials, IWidgetApiRequest, - IWidgetApiRequestEmptyData, VideoConferenceCapabilities, - WidgetApi + WidgetApi, } from "matrix-widget-api"; +import { ElementWidgetActions } from "matrix-react-sdk/src/stores/widgets/ElementWidgetActions"; const JITSI_OPENIDTOKEN_JWT_AUTH = 'openidtoken-jwt'; @@ -76,7 +76,7 @@ let meetApi: any; // JitsiMeetExternalAPI widgetApi.requestCapabilities(VideoConferenceCapabilities); readyPromise = Promise.all([ new Promise(resolve => { - widgetApi.once>("action:im.vector.ready", ev => { + widgetApi.once>(`action:${ElementWidgetActions.ClientReady}`, ev => { ev.preventDefault(); widgetApi.transport.reply(ev.detail, {}); resolve(); @@ -116,7 +116,7 @@ let meetApi: any; // JitsiMeetExternalAPI // TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795) - widgetApi.addEventListener('hangup', (ev: CustomEvent) => { + widgetApi.addEventListener(`action:${ElementWidgetActions.HangupCall}`, (ev: CustomEvent) => { if (meetApi) meetApi.executeCommand('hangup'); widgetApi.transport.reply(ev.detail, {}); // ack }); From 408766366c740d67968521b55f37f80e214c9786 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 30 Sep 2020 20:43:21 -0600 Subject: [PATCH 47/84] Use the beta release of the widget-api --- package.json | 1 + yarn.lock | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/package.json b/package.json index 59d998d90f..1754ba41d3 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "jsrsasign": "^9.1.5", "matrix-js-sdk": "8.4.1", "matrix-react-sdk": "3.5.0", + "matrix-widget-api": "^0.1.0-beta.2", "olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz", "prop-types": "^15.7.2", "react": "^16.9.0", diff --git a/yarn.lock b/yarn.lock index 0596214793..e8c1213666 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8373,6 +8373,11 @@ matrix-react-test-utils@^0.2.2: resolved "https://registry.yarnpkg.com/matrix-react-test-utils/-/matrix-react-test-utils-0.2.2.tgz#c87144d3b910c7edc544a6699d13c7c2bf02f853" integrity sha512-49+7gfV6smvBIVbeloql+37IeWMTD+fiywalwCqk8Dnz53zAFjKSltB3rmWHso1uecLtQEcPtCijfhzcLXAxTQ== +matrix-widget-api@^0.1.0-beta.2: + version "0.1.0-beta.2" + resolved "https://registry.yarnpkg.com/matrix-widget-api/-/matrix-widget-api-0.1.0-beta.2.tgz#367da1ccd26b711f73fc5b6e02edf55ac2ea2692" + integrity sha512-q5g5RZN+RRjM4HmcJ+LYoQAYrB1wzyERmoQ+LvKbTV/+9Ov36Kp0QEP8CleSXEd5WLp6bkRlt60axDaY6pWGmg== + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" From cdf9547220dec41ff855ff153eaa2939bf95cab1 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 30 Sep 2020 20:51:31 -0600 Subject: [PATCH 48/84] Appease the linter --- src/vector/jitsi/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 83691f7b59..69f858a0d7 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -116,10 +116,12 @@ let meetApi: any; // JitsiMeetExternalAPI // TODO: register widgetApi listeners for PTT controls (https://github.com/vector-im/riot-web/issues/12795) - widgetApi.addEventListener(`action:${ElementWidgetActions.HangupCall}`, (ev: CustomEvent) => { - if (meetApi) meetApi.executeCommand('hangup'); - widgetApi.transport.reply(ev.detail, {}); // ack - }); + widgetApi.addEventListener(`action:${ElementWidgetActions.HangupCall}`, + (ev: CustomEvent) => { + if (meetApi) meetApi.executeCommand('hangup'); + widgetApi.transport.reply(ev.detail, {}); // ack + }, + ); } else { enableJoinButton(); } @@ -181,7 +183,7 @@ function createJWTToken() { function joinConference() { // event handler bound in HTML let jwt; if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { - if (!openIdToken?.access_token) { + if (!openIdToken?.access_token) { // eslint-disable-line camelcase // We've failing to get a token, don't try to init conference console.warn('Expected to have an OpenID credential, cannot initialize widget.'); document.getElementById("widgetActionContainer").innerText = "Failed to load Jitsi widget"; From daa755017e5a4f0ed5e444cd2c0d68cb4e9c9813 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Oct 2020 14:04:11 +0100 Subject: [PATCH 49/84] Revert "consolidate" This reverts commit aa2f3918 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/WebPlatform.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index d91bb2593e..3f93ad712e 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -39,12 +39,15 @@ export default class WebPlatform extends VectorBasePlatform { // load service worker if available on this platform if ('serviceWorker' in navigator) { + // clean up old dummy sw.js + navigator.serviceWorker.getRegistration('sw.js').then(reg => reg.unregister()); + // Service worker is disabled in webpack-dev-server: https://github.com/GoogleChrome/workbox/issues/1790 if (!process.env.WEBPACK_DEV_SERVER) { navigator.serviceWorker.register('service-worker.js'); } else { // we no longer run workbox when in webpack-dev-server, clean it up - navigator.serviceWorker.getRegistration().then(reg => reg && reg.unregister()); + navigator.serviceWorker.getRegistration('service-worker.js').then(reg => reg.unregister()); } } } From 87c42934ea8c434aba4dd5e68e060c32bf34fd2b Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Oct 2020 14:04:21 +0100 Subject: [PATCH 50/84] Revert "Disable workbox when running in webpack dev server, not in dev mode" This reverts commit 11e676ce Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/WebPlatform.ts | 15 ++++----------- webpack.config.js | 6 +----- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index 3f93ad712e..0a82b28e3c 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -38,20 +38,13 @@ export default class WebPlatform extends VectorBasePlatform { super(); // load service worker if available on this platform - if ('serviceWorker' in navigator) { - // clean up old dummy sw.js - navigator.serviceWorker.getRegistration('sw.js').then(reg => reg.unregister()); - - // Service worker is disabled in webpack-dev-server: https://github.com/GoogleChrome/workbox/issues/1790 - if (!process.env.WEBPACK_DEV_SERVER) { - navigator.serviceWorker.register('service-worker.js'); - } else { - // we no longer run workbox when in webpack-dev-server, clean it up - navigator.serviceWorker.getRegistration('service-worker.js').then(reg => reg.unregister()); - } + // Service worker is disabled in development: https://github.com/GoogleChrome/workbox/issues/1790 + if ('serviceWorker' in navigator && process.env.NODE_ENV === "production") { + navigator.serviceWorker.register('service-worker.js'); } } + getHumanReadableName(): string { return 'Web Platform'; // no translation required: only used for analytics } diff --git a/webpack.config.js b/webpack.config.js index a3a8af31c5..1b59d87406 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,4 @@ const path = require('path'); -const {EnvironmentPlugin} = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const TerserPlugin = require('terser-webpack-plugin'); @@ -33,8 +32,6 @@ module.exports = (env, argv) => { const jsSdkSrcDir = path.resolve(require.resolve("matrix-js-sdk/package.json"), '..', 'src'); const plugins = [ - new EnvironmentPlugin(["WEBPACK_DEV_SERVER"]), // pass this as it is used for conditionally loading workbox - // This exports our CSS using the splitChunks and loaders above. new MiniCssExtractPlugin({ filename: 'bundles/[hash]/[name].css', @@ -95,8 +92,7 @@ module.exports = (env, argv) => { }), ]; - const isDevServer = process.env.WEBPACK_DEV_SERVER; - if (!isDevServer) { + if (argv.mode === "production") { plugins.push(new WorkboxPlugin.GenerateSW({ maximumFileSizeToCacheInBytes: 22000000, runtimeCaching: [{ From 1edbe36547a20a60a1f9ae0d377487d7ee99ae50 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Oct 2020 14:04:32 +0100 Subject: [PATCH 51/84] Revert "Tidy up Service Worker, only run Workbox in production" This reverts commit c47532fe Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/index.ts | 5 + src/vector/platform/WebPlatform.ts | 11 -- webpack.config.js | 167 ++++++++++++++--------------- 3 files changed, 86 insertions(+), 97 deletions(-) diff --git a/src/vector/index.ts b/src/vector/index.ts index 14e656f4ba..374055fbaa 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -28,6 +28,11 @@ require('highlight.js/styles/github.css'); import {parseQsFromFragment} from "./url_utils"; import './modernizr'; +// load service worker if available on this platform +if ('serviceWorker' in navigator) { + navigator.serviceWorker.register('service-worker.js'); +} + async function settled(...promises: Array>) { for (const prom of promises) { try { diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index 0a82b28e3c..2e739a2660 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -34,17 +34,6 @@ const POKE_RATE_MS = 10 * 60 * 1000; // 10 min export default class WebPlatform extends VectorBasePlatform { private runningVersion: string = null; - constructor() { - super(); - - // load service worker if available on this platform - // Service worker is disabled in development: https://github.com/GoogleChrome/workbox/issues/1790 - if ('serviceWorker' in navigator && process.env.NODE_ENV === "production") { - navigator.serviceWorker.register('service-worker.js'); - } - } - - getHumanReadableName(): string { return 'Web Platform'; // no translation required: only used for analytics } diff --git a/webpack.config.js b/webpack.config.js index 1b59d87406..b58d35146f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -31,84 +31,6 @@ module.exports = (env, argv) => { const reactSdkSrcDir = path.resolve(require.resolve("matrix-react-sdk/package.json"), '..', 'src'); const jsSdkSrcDir = path.resolve(require.resolve("matrix-js-sdk/package.json"), '..', 'src'); - const plugins = [ - // This exports our CSS using the splitChunks and loaders above. - new MiniCssExtractPlugin({ - filename: 'bundles/[hash]/[name].css', - ignoreOrder: false, // Enable to remove warnings about conflicting order - }), - - // This is the app's main entry point. - new HtmlWebpackPlugin({ - template: './src/vector/index.html', - - // we inject the links ourselves via the template, because - // HtmlWebpackPlugin will screw up our formatting like the names - // of the themes and which chunks we actually care about. - inject: false, - excludeChunks: ['mobileguide', 'usercontent', 'jitsi'], - minify: argv.mode === 'production', - vars: { - og_image_url: og_image_url, - }, - }), - - // This is the jitsi widget wrapper (embedded, so isolated stack) - new HtmlWebpackPlugin({ - template: './src/vector/jitsi/index.html', - filename: 'jitsi.html', - minify: argv.mode === 'production', - chunks: ['jitsi'], - }), - - // This is the mobile guide's entry point (separate for faster mobile loading) - new HtmlWebpackPlugin({ - template: './src/vector/mobile_guide/index.html', - filename: 'mobile_guide/index.html', - minify: argv.mode === 'production', - chunks: ['mobileguide'], - }), - - // These are the static error pages for when the javascript env is *really unsupported* - new HtmlWebpackPlugin({ - template: './src/vector/static/unable-to-load.html', - filename: 'static/unable-to-load.html', - minify: argv.mode === 'production', - chunks: [], - }), - new HtmlWebpackPlugin({ - template: './src/vector/static/incompatible-browser.html', - filename: 'static/incompatible-browser.html', - minify: argv.mode === 'production', - chunks: [], - }), - - // This is the usercontent sandbox's entry point (separate for iframing) - new HtmlWebpackPlugin({ - template: './node_modules/matrix-react-sdk/src/usercontent/index.html', - filename: 'usercontent/index.html', - minify: argv.mode === 'production', - chunks: ['usercontent'], - }), - ]; - - if (argv.mode === "production") { - plugins.push(new WorkboxPlugin.GenerateSW({ - maximumFileSizeToCacheInBytes: 22000000, - runtimeCaching: [{ - urlPattern: /i18n\/.*\.json$/, - handler: 'CacheFirst', - - options: { - cacheName: 'i18n', - expiration: { - maxEntries: 2, - }, - }, - }], - })); - } - return { ...development, @@ -226,8 +148,8 @@ module.exports = (env, argv) => { }, loader: 'babel-loader', options: { - cacheDirectory: true, - }, + cacheDirectory: true + } }, { test: /\.css$/, @@ -238,7 +160,7 @@ module.exports = (env, argv) => { options: { importLoaders: 1, sourceMap: true, - }, + } }, { loader: 'postcss-loader', @@ -276,7 +198,7 @@ module.exports = (env, argv) => { "local-plugins": true, }, }, - ], + ] }, { test: /\.scss$/, @@ -287,7 +209,7 @@ module.exports = (env, argv) => { options: { importLoaders: 1, sourceMap: true, - }, + } }, { loader: 'postcss-loader', @@ -314,7 +236,7 @@ module.exports = (env, argv) => { "local-plugins": true, }, }, - ], + ] }, { test: /\.wasm$/, @@ -372,10 +294,83 @@ module.exports = (env, argv) => { }, ], }, - ], + ] }, - plugins, + plugins: [ + // This exports our CSS using the splitChunks and loaders above. + new MiniCssExtractPlugin({ + filename: 'bundles/[hash]/[name].css', + ignoreOrder: false, // Enable to remove warnings about conflicting order + }), + + // This is the app's main entry point. + new HtmlWebpackPlugin({ + template: './src/vector/index.html', + + // we inject the links ourselves via the template, because + // HtmlWebpackPlugin will screw up our formatting like the names + // of the themes and which chunks we actually care about. + inject: false, + excludeChunks: ['mobileguide', 'usercontent', 'jitsi'], + minify: argv.mode === 'production', + vars: { + og_image_url: og_image_url, + }, + }), + + // This is the jitsi widget wrapper (embedded, so isolated stack) + new HtmlWebpackPlugin({ + template: './src/vector/jitsi/index.html', + filename: 'jitsi.html', + minify: argv.mode === 'production', + chunks: ['jitsi'], + }), + + // This is the mobile guide's entry point (separate for faster mobile loading) + new HtmlWebpackPlugin({ + template: './src/vector/mobile_guide/index.html', + filename: 'mobile_guide/index.html', + minify: argv.mode === 'production', + chunks: ['mobileguide'], + }), + + // These are the static error pages for when the javascript env is *really unsupported* + new HtmlWebpackPlugin({ + template: './src/vector/static/unable-to-load.html', + filename: 'static/unable-to-load.html', + minify: argv.mode === 'production', + chunks: [], + }), + new HtmlWebpackPlugin({ + template: './src/vector/static/incompatible-browser.html', + filename: 'static/incompatible-browser.html', + minify: argv.mode === 'production', + chunks: [], + }), + + // This is the usercontent sandbox's entry point (separate for iframing) + new HtmlWebpackPlugin({ + template: './node_modules/matrix-react-sdk/src/usercontent/index.html', + filename: 'usercontent/index.html', + minify: argv.mode === 'production', + chunks: ['usercontent'], + }), + + new WorkboxPlugin.GenerateSW({ + runtimeCaching: [{ + urlPattern: /i18n\/.*\.json$/, + handler: 'CacheFirst', + + options: { + cacheName: 'i18n', + expiration: { + maxEntries: 2, + }, + }, + }], + }), + ], output: { path: path.join(__dirname, "webapp"), From cfee4c925a43a5792ac5854235e0410fa9cea060 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Oct 2020 14:05:07 +0100 Subject: [PATCH 52/84] Revert "Attempt to fix tests some more" This reverts commit c76a5f2c Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- package.json | 3 +- res/sw.js | 1 + scripts/copy-res.js | 1 + src/vector/index.html | 10 + src/vector/index.ts | 2 +- webpack.config.js | 20 +- yarn.lock | 1336 ++--------------------------------------- 7 files changed, 67 insertions(+), 1306 deletions(-) create mode 100644 res/sw.js diff --git a/package.json b/package.json index 59d998d90f..936116180c 100644 --- a/package.json +++ b/package.json @@ -143,8 +143,7 @@ "typescript": "^3.7.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10", - "webpack-dev-server": "^3.9.0", - "workbox-webpack-plugin": "^5.1.4" + "webpack-dev-server": "^3.9.0" }, "jest": { "testEnvironment": "jest-environment-jsdom-fourteen", diff --git a/res/sw.js b/res/sw.js new file mode 100644 index 0000000000..dfe665a16f --- /dev/null +++ b/res/sw.js @@ -0,0 +1 @@ +self.addEventListener('fetch', () => {}); diff --git a/scripts/copy-res.js b/scripts/copy-res.js index 6c55f3d5dd..ebe1c625ea 100755 --- a/scripts/copy-res.js +++ b/scripts/copy-res.js @@ -61,6 +61,7 @@ const INCLUDE_LANGS = [ // "dest/b/...". const COPY_LIST = [ ["res/manifest.json", "webapp"], + ["res/sw.js", "webapp"], ["res/welcome.html", "webapp"], ["res/welcome/**", "webapp/welcome"], ["res/themes/**", "webapp/themes"], diff --git a/src/vector/index.html b/src/vector/index.html index 3ddc8482fb..4cda4b37a5 100644 --- a/src/vector/index.html +++ b/src/vector/index.html @@ -55,6 +55,16 @@
+ + + + + + + + + +