diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d492d03054..ad8481517be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,64 @@ +Changes in [1.9.1](https://github.com/vector-im/element-desktop/releases/tag/v1.9.1) (2021-10-11) +================================================================================================= + +## ✨ Features + * Decrease profile button touch target ([\#6900](https://github.com/matrix-org/matrix-react-sdk/pull/6900)). Contributed by [ColonisationCaptain](https://github.com/ColonisationCaptain). + * Don't let click events propagate out of context menus ([\#6892](https://github.com/matrix-org/matrix-react-sdk/pull/6892)). + * Allow closing Dropdown via its chevron ([\#6885](https://github.com/matrix-org/matrix-react-sdk/pull/6885)). Fixes #19030 and #19030. + * Improve AUX panel behaviour ([\#6699](https://github.com/matrix-org/matrix-react-sdk/pull/6699)). Fixes #18787 and #18787. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * A nicer opening animation for the Image View ([\#6454](https://github.com/matrix-org/matrix-react-sdk/pull/6454)). Fixes #18186 and #18186. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + +## 🐛 Bug Fixes + * [Release] Fix space hierarchy pagination ([\#6910](https://github.com/matrix-org/matrix-react-sdk/pull/6910)). + * Fix leaving space via other client leaving you in undefined-land ([\#6891](https://github.com/matrix-org/matrix-react-sdk/pull/6891)). Fixes #18455 and #18455. + * Handle newer voice message encrypted event format for chat export ([\#6893](https://github.com/matrix-org/matrix-react-sdk/pull/6893)). Contributed by [jaiwanth-v](https://github.com/jaiwanth-v). + * Fix pagination when filtering space hierarchy ([\#6876](https://github.com/matrix-org/matrix-react-sdk/pull/6876)). Fixes #19235 and #19235. + * Fix spaces null-guard breaking the dispatcher settings watching ([\#6886](https://github.com/matrix-org/matrix-react-sdk/pull/6886)). Fixes #19223 and #19223. + * Fix space children without specific `order` being sorted after those with one ([\#6878](https://github.com/matrix-org/matrix-react-sdk/pull/6878)). Fixes #19192 and #19192. + * Ensure that sub-spaces aren't considered for notification badges ([\#6881](https://github.com/matrix-org/matrix-react-sdk/pull/6881)). Fixes #18975 and #18975. + * Fix timeline autoscroll with non-standard DPI settings. ([\#6880](https://github.com/matrix-org/matrix-react-sdk/pull/6880)). Fixes #18984 and #18984. + * Pluck out JoinRuleSettings styles so they apply in space settings too ([\#6879](https://github.com/matrix-org/matrix-react-sdk/pull/6879)). Fixes #19164 and #19164. + * Null guard around the matrixClient in SpaceStore ([\#6874](https://github.com/matrix-org/matrix-react-sdk/pull/6874)). + * Fix issue (https ([\#6871](https://github.com/matrix-org/matrix-react-sdk/pull/6871)). Fixes #19138 and #19138. Contributed by [psrpinto](https://github.com/psrpinto). + * Fix pills being cut off in message bubble layout ([\#6865](https://github.com/matrix-org/matrix-react-sdk/pull/6865)). Fixes #18627 and #18627. Contributed by [robintown](https://github.com/robintown). + * Fix space admin check false positive on multiple admins ([\#6824](https://github.com/matrix-org/matrix-react-sdk/pull/6824)). + * Fix the User View ([\#6860](https://github.com/matrix-org/matrix-react-sdk/pull/6860)). Fixes #19158 and #19158. + * Fix spacing for message composer buttons ([\#6852](https://github.com/matrix-org/matrix-react-sdk/pull/6852)). Fixes #18999 and #18999. + * Always show root event of a thread in room's timeline ([\#6842](https://github.com/matrix-org/matrix-react-sdk/pull/6842)). Fixes #19016 and #19016. + +Changes in [1.9.1-rc.2](https://github.com/vector-im/element-desktop/releases/tag/v1.9.1-rc.2) (2021-10-08) +=========================================================================================================== + +## 🐛 Bug Fixes + * [Release] Fix space hierarchy pagination ([\#6910](https://github.com/matrix-org/matrix-react-sdk/pull/6910)). + +Changes in [1.9.1-rc.1](https://github.com/vector-im/element-desktop/releases/tag/v1.9.1-rc.1) (2021-10-04) +=========================================================================================================== + +## ✨ Features + * Decrease profile button touch target ([\#6900](https://github.com/matrix-org/matrix-react-sdk/pull/6900)). Contributed by [ColonisationCaptain](https://github.com/ColonisationCaptain). + * Don't let click events propagate out of context menus ([\#6892](https://github.com/matrix-org/matrix-react-sdk/pull/6892)). + * Allow closing Dropdown via its chevron ([\#6885](https://github.com/matrix-org/matrix-react-sdk/pull/6885)). Fixes #19030 and #19030. + * Improve AUX panel behaviour ([\#6699](https://github.com/matrix-org/matrix-react-sdk/pull/6699)). Fixes #18787 and #18787. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + * A nicer opening animation for the Image View ([\#6454](https://github.com/matrix-org/matrix-react-sdk/pull/6454)). Fixes #18186 and #18186. Contributed by [SimonBrandner](https://github.com/SimonBrandner). + +## 🐛 Bug Fixes + * Fix leaving space via other client leaving you in undefined-land ([\#6891](https://github.com/matrix-org/matrix-react-sdk/pull/6891)). Fixes #18455 and #18455. + * Handle newer voice message encrypted event format for chat export ([\#6893](https://github.com/matrix-org/matrix-react-sdk/pull/6893)). Contributed by [jaiwanth-v](https://github.com/jaiwanth-v). + * Fix pagination when filtering space hierarchy ([\#6876](https://github.com/matrix-org/matrix-react-sdk/pull/6876)). Fixes #19235 and #19235. + * Fix spaces null-guard breaking the dispatcher settings watching ([\#6886](https://github.com/matrix-org/matrix-react-sdk/pull/6886)). Fixes #19223 and #19223. + * Fix space children without specific `order` being sorted after those with one ([\#6878](https://github.com/matrix-org/matrix-react-sdk/pull/6878)). Fixes #19192 and #19192. + * Ensure that sub-spaces aren't considered for notification badges ([\#6881](https://github.com/matrix-org/matrix-react-sdk/pull/6881)). Fixes #18975 and #18975. + * Fix timeline autoscroll with non-standard DPI settings. ([\#6880](https://github.com/matrix-org/matrix-react-sdk/pull/6880)). Fixes #18984 and #18984. + * Pluck out JoinRuleSettings styles so they apply in space settings too ([\#6879](https://github.com/matrix-org/matrix-react-sdk/pull/6879)). Fixes #19164 and #19164. + * Null guard around the matrixClient in SpaceStore ([\#6874](https://github.com/matrix-org/matrix-react-sdk/pull/6874)). + * Fix issue (https ([\#6871](https://github.com/matrix-org/matrix-react-sdk/pull/6871)). Fixes #19138 and #19138. Contributed by [psrpinto](https://github.com/psrpinto). + * Fix pills being cut off in message bubble layout ([\#6865](https://github.com/matrix-org/matrix-react-sdk/pull/6865)). Fixes #18627 and #18627. Contributed by [robintown](https://github.com/robintown). + * Fix space admin check false positive on multiple admins ([\#6824](https://github.com/matrix-org/matrix-react-sdk/pull/6824)). + * Fix the User View ([\#6860](https://github.com/matrix-org/matrix-react-sdk/pull/6860)). Fixes #19158 and #19158. + * Fix spacing for message composer buttons ([\#6852](https://github.com/matrix-org/matrix-react-sdk/pull/6852)). Fixes #18999 and #18999. + * Always show root event of a thread in room's timeline ([\#6842](https://github.com/matrix-org/matrix-react-sdk/pull/6842)). Fixes #19016 and #19016. + Changes in [1.9.0](https://github.com/vector-im/element-desktop/releases/tag/v1.9.0) (2021-09-27) ================================================================================================= diff --git a/Dockerfile b/Dockerfile index e62b867d38c..601f2cdbbb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,5 +33,8 @@ COPY --from=builder /src/webapp /app # Insert wasm type into Nginx mime.types file so they load correctly. RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types +# Override default nginx config +COPY /nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf + RUN rm -rf /usr/share/nginx/html \ && ln -s /app /usr/share/nginx/html diff --git a/README.md b/README.md index 2a2d7904c0b..38f8caeecbc 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,11 @@ Element requires the following URLs not to be cached, when/if you are serving El /index.html ``` +We also recommend that you force browsers to re-validate any cached copy of Element on page load by configuring your +webserver to return `Cache-Control: no-cache` for `/`. This ensures the browser will fetch a new version of Element on +the next page load after it's been deployed. Note that this is already configured for you in the nginx config of our +Dockerfile. + Development =========== diff --git a/docs/jitsi.md b/docs/jitsi.md index 57d9f064cb5..116f31306d4 100644 --- a/docs/jitsi.md +++ b/docs/jitsi.md @@ -64,10 +64,3 @@ The domain used is the one specified by the `/.well-known/matrix/client` endpoin For active Jitsi widgets in the room, a native Jitsi widget UI is created and points to the instance specified in the `domain` key of the widget content data. Element Android manages allowed native widgets permissions a bit differently than web widgets (as the data shared are different and never shared with the widget URL). For Jitsi widgets, permissions are requested only once per domain (consent saved in account data). - -## Element iOS - -Currently the Element mobile apps do not support custom Jitsi servers and will instead -use the default `jitsi.riot.im` server. When users on the mobile apps join the call, -they will be joining a different conference which has the same name, but not the same -participants. This is a known bug and which needs to be fixed. diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf new file mode 100644 index 00000000000..04b1e8ac6aa --- /dev/null +++ b/nginx/conf.d/default.conf @@ -0,0 +1,18 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + # Set no-cache for the index.html only so that browsers always check for a new copy of Element Web. + location = /index.html { + add_header Cache-Control "no-cache"; + } + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; +} + diff --git a/package.json b/package.json index 35ef5399d8a..f456a2b2fa0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "element-web", - "version": "1.9.0", + "version": "1.9.1", "description": "A feature-rich client for Matrix.org", "author": "New Vector Ltd.", "repository": { @@ -61,8 +61,8 @@ "highlight.js": "^10.5.0", "jsrsasign": "^10.2.0", "katex": "^0.12.0", - "matrix-js-sdk": "13.0.0", - "matrix-react-sdk": "3.31.0", + "matrix-js-sdk": "14.0.0", + "matrix-react-sdk": "3.32.0", "matrix-widget-api": "^0.1.0-beta.16", "prop-types": "^15.7.2", "react": "17.0.2", @@ -91,6 +91,7 @@ "@pmmmwh/react-refresh-webpack-plugin": "^0.4.3", "@principalstudio/html-webpack-inject-preload": "^1.2.7", "@types/flux": "^3.1.9", + "@types/jest": "^27.0.2", "@types/modernizr": "^3.5.3", "@types/node": "^14.14.22", "@types/react": "17.0.14", @@ -119,6 +120,7 @@ "html-webpack-plugin": "^4.5.2", "jest": "^26.6.3", "jest-environment-jsdom-sixteen": "^1.0.3", + "jest-raw-loader": "^1.0.1", "json-loader": "^0.5.7", "loader-utils": "^1.4.0", "matrix-mock-request": "^1.2.3", @@ -141,6 +143,7 @@ "postcss-scss": "^2.1.1", "postcss-simple-vars": "^5.0.2", "postcss-strip-inline-comments": "^0.1.5", + "raw-loader": "^4.0.2", "react-refresh": "^0.10.0", "rimraf": "^3.0.2", "shell-escape": "^0.2.0", @@ -164,7 +167,7 @@ "jest": { "testEnvironment": "jest-environment-jsdom-sixteen", "testMatch": [ - "/test/**/*-test.[tj]s" + "/test/**/*-test.[tj]s?(x)" ], "setupFilesAfterEnv": [ "/node_modules/matrix-react-sdk/test/setupTests.js" @@ -184,6 +187,7 @@ "context-filter-polyfill": "/node_modules/matrix-react-sdk/__mocks__/empty.js", "FontManager.ts": "/node_modules/matrix-react-sdk/__mocks__/FontManager.js", "workers/(.+)\\.worker\\.ts": "/node_modules/matrix-react-sdk/__mocks__/workerMock.js", + "^!!raw-loader!.*": "jest-raw-loader", "RecorderWorklet": "/node_modules/matrix-react-sdk/__mocks__/empty.js" }, "transformIgnorePatterns": [ diff --git a/src/@types/raw-loader.d.ts b/src/@types/raw-loader.d.ts new file mode 100644 index 00000000000..ea3df880f67 --- /dev/null +++ b/src/@types/raw-loader.d.ts @@ -0,0 +1,4 @@ +declare module '!!raw-loader!*' { + const contents: string; + export default contents; +} diff --git a/src/i18n/strings/bn_IN.json b/src/i18n/strings/bn_IN.json index 0967ef424bc..19a9d205267 100644 --- a/src/i18n/strings/bn_IN.json +++ b/src/i18n/strings/bn_IN.json @@ -1 +1,5 @@ -{} +{ + "Your Element is misconfigured": "আপনার এলিমেন্ট টি ভুল ভাবে কনফিগার করা হয়েছে", + "Invalid configuration: no default server specified.": "ভুল কনফিগারেশনঃ কোনো মূল সার্ভার উল্লেখ করা হয়নি।", + "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "ভুল কনফিগারেশনঃ এদের মধ্যে কেবলমাত্র একটাই উল্লেখ করা যেতে পারেঃ default_server_config, default_server_name অথবা default_hs_url." +} diff --git a/src/i18n/strings/id.json b/src/i18n/strings/id.json index 71dab68afc3..cdfd278c177 100644 --- a/src/i18n/strings/id.json +++ b/src/i18n/strings/id.json @@ -1,7 +1,7 @@ { "Dismiss": "Abaikan", "powered by Matrix": "didukung oleh Matrix", - "Unknown device": "Perangkat Tidak Diketahui", + "Unknown device": "Perangkat tidak diketahui", "You need to be using HTTPS to place a screen-sharing call.": "Anda perlu menggunakan HTTPS untuk melakukan panggilan berbagi-layar.", "Welcome to Element": "Selamat datang di Element", "Decentralised, encrypted chat & collaboration powered by [matrix]": "Obrolan terenkripsi, terdesentralisasi & kolaborasi didukung oleh [matrix]", diff --git a/src/i18n/strings/ko.json b/src/i18n/strings/ko.json index 6d2d7106115..0decc6387ea 100644 --- a/src/i18n/strings/ko.json +++ b/src/i18n/strings/ko.json @@ -24,5 +24,14 @@ "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": "시작 실패" + "Failed to start": "시작 실패", + "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s 는 당신의 브라우저에서 지원되지 않는 고급 기능을 사용합니다.", + "Your browser can't run %(brand)s": "당신의 브라우저는 %(brand)s 를 작동할 수 없습니다", + "Use %(brand)s on mobile": "모바일에서 %(brand)s 사용", + "Powered by Matrix": "Matrix로 지원됨", + "Switch to space by number": "숫자로 스페이스 전환하기", + "Open": "열기", + "Download Completed": "다운로드 완료", + "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "당신의 Element 설정은 유효하지 않은 JSON을 포함합니다. 이 문제를 해결하고 페이지를 새로고침해주세요.", + "Your Element is misconfigured": "당신의 Element가 잘못 설정되었습니다" } diff --git a/src/i18n/strings/lv.json b/src/i18n/strings/lv.json index b3afc2caf9a..92ec83c424b 100644 --- a/src/i18n/strings/lv.json +++ b/src/i18n/strings/lv.json @@ -1,5 +1,5 @@ { - "Dismiss": "Aizvērt/atcelt", + "Dismiss": "Aizvērt", "powered by Matrix": "Tiek darbināta ar Matrix", "Unknown device": "Nezināma ierīce", "You need to be using HTTPS to place a screen-sharing call.": "Ekrāna kopīgošanai nepieciešams izmantot HTTPS savienojumu.", @@ -7,7 +7,7 @@ "Decentralised, encrypted chat & collaboration powered by [matrix]": "Decentralizēta, šifrēta tērziņu & kopdarbības vide uz [matrix] bāzes", "Sign In": "Ierakstīties", "Create Account": "Izveidot kontu", - "Explore rooms": "Pārlūkot telpas", + "Explore rooms": "Pārlūkot istabas", "Unexpected error preparing the app. See console for details.": "Negaidīta kļūda, sagatavojot lietotni. Sīkāku informāciju skatiet konsolē.", "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Kļūdaina konfigurācija: var norādīt tikai vienu no parametriem default_server_config, default_server_name, vai default_hs_url.", "Invalid configuration: no default server specified.": "Kļūdaina konfigurācija: nav norādīts noklusējuma serveris.", @@ -23,7 +23,7 @@ "Go to element.io": "Doties uz element.io", "Failed to start": "Neizdevās palaist", "Powered by Matrix": "Griežas uz Matrix tehnoloģijas", - "Previous/next recently visited room or community": "Iepriekšējā/nākošā nesen apmeklētā telpa vai kopiena", + "Previous/next recently visited room or community": "Iepriekšējā/nākošā nesen apmeklētā istaba vai kopiena", "%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s izmanto pārlūku papildfunkcijas, kuras netiek atbalstītas šajā pārlūkā.", "Your browser can't run %(brand)s": "Jūsu pārlūks nevar palaist %(brand)s", "Missing indexeddb worker script!": "Trūkst indexeddb worker skripta!", diff --git a/src/i18n/strings/nl.json b/src/i18n/strings/nl.json index 2ff894c6b2c..8376ab5e2b0 100644 --- a/src/i18n/strings/nl.json +++ b/src/i18n/strings/nl.json @@ -7,7 +7,7 @@ "Decentralised, encrypted chat & collaboration powered by [matrix]": "Gedecentraliseerd en versleuteld chatten & samenwerken dankzij [matrix]", "Sign In": "Inloggen", "Create Account": "Registreren", - "Explore rooms": "Ontdek kamers", + "Explore rooms": "Kamers ontdekken", "Unexpected error preparing the app. See console for details.": "Er is een onverwachte fout opgetreden bij het voorbereiden van de app. Zie de console voor details.", "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuratiefout: kan slechts één van default_server_config, default_server_name, of default_hs_url opgeven.", "Invalid configuration: no default server specified.": "Configuratie ongeldig: geen standaardserver opgegeven.", diff --git a/src/vector/index.ts b/src/vector/index.ts index de68bf0a436..e23fc4b35ac 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -33,6 +33,7 @@ require('katex/dist/katex.css'); * On production build it's going to be an empty module, so don't worry about that. */ require('./devcss'); +require('./localstorage-fix'); // These are things that can run before the skin loads - be careful not to reference the react-sdk though. import { parseQsFromFragment } from "./url_utils"; import './modernizr'; diff --git a/src/vector/localstorage-fix.ts b/src/vector/localstorage-fix.ts new file mode 100644 index 00000000000..d0ca05174ff --- /dev/null +++ b/src/vector/localstorage-fix.ts @@ -0,0 +1,12 @@ +/** + * Because we've been saving a lot of additional logger data in the localStorage for no particular reason + * we need to, hopefully, unbrick user's devices by geting rid of unnecessary data. + * */ + +if (window.localStorage) { + Object.keys(window.localStorage).forEach(key => { + if (key.indexOf('loglevel:') === 0) { + window.localStorage.removeItem(key); + } + }); +} diff --git a/test/app-tests/joining-test.js b/test/app-tests/joining-test.tsx similarity index 97% rename from test/app-tests/joining-test.js rename to test/app-tests/joining-test.tsx index 744037325ce..b5601875b91 100644 --- a/test/app-tests/joining-test.js +++ b/test/app-tests/joining-test.tsx @@ -31,12 +31,12 @@ import {sleep} from "../test-utils"; import * as test_utils from "../test-utils"; import MockHttpBackend from "matrix-mock-request"; import "fake-indexeddb/auto"; +import { RoomView as RoomViewClass } from 'matrix-react-sdk/src/components/structures/RoomView'; const MatrixChat = sdk.getComponent('structures.MatrixChat'); const RoomDirectory = sdk.getComponent('structures.RoomDirectory'); const RoomPreviewBar = sdk.getComponent('rooms.RoomPreviewBar'); -const RoomView = sdk.getComponent('structures.RoomView'); const HS_URL='http://localhost'; const IS_URL='http://localhost'; @@ -50,7 +50,6 @@ describe('joining a room', function() { let matrixChat; beforeEach(function() { - test_utils.beforeEach(this); httpBackend = new MockHttpBackend(); jssdk.request(httpBackend.requestFn); parentDiv = document.createElement('div'); @@ -148,7 +147,7 @@ describe('joining a room', function() { // enter an alias in the input, and simulate enter const input = ReactTestUtils.findRenderedDOMComponentWithTag( - roomDir, 'input'); + roomDir, 'input') as HTMLInputElement; input.value = ROOM_ALIAS; ReactTestUtils.Simulate.change(input); ReactTestUtils.Simulate.keyUp(input, {key: 'Enter'}); @@ -165,7 +164,7 @@ describe('joining a room', function() { // we should now have a roomview roomView = ReactTestUtils.findRenderedComponentWithType( - matrixChat, RoomView); + matrixChat, RoomViewClass); // the preview bar may take a tick to be displayed return sleep(1); @@ -228,7 +227,7 @@ describe('joining a room', function() { return httpBackend.flush(); }).then(() => { // now the room should have loaded - expect(roomView.state.room).toExist(); + expect(roomView.state.room).toBeTruthy(); }); }); }); diff --git a/test/app-tests/loading-test.js b/test/app-tests/loading-test.tsx similarity index 97% rename from test/app-tests/loading-test.js rename to test/app-tests/loading-test.tsx index f08cb957f51..d2c7697c7bf 100644 --- a/test/app-tests/loading-test.js +++ b/test/app-tests/loading-test.tsx @@ -39,6 +39,8 @@ import {sleep} from "../test-utils"; import "fake-indexeddb/auto"; import {cleanLocalstorage} from "../test-utils"; import {IndexedDBCryptoStore} from "matrix-js-sdk/src/crypto/store/indexeddb-crypto-store"; +import { RoomView as RoomViewClass } from 'matrix-react-sdk/src/components/structures/RoomView'; +import LoginComponent from 'matrix-react-sdk/src/components/structures/auth/Login'; const DEFAULT_HS_URL='http://my_server'; const DEFAULT_IS_URL='http://my_is'; @@ -94,7 +96,7 @@ describe('loading:', function() { * TODO: it would be nice to factor some of this stuff out of index.js so * that we can test it rather than our own implementation of it. */ - function loadApp(opts) { + function loadApp(opts?) { opts = opts || {}; const queryString = opts.queryString || ""; const uriFragment = opts.uriFragment || ""; @@ -164,7 +166,7 @@ describe('loading:', function() { // http requests until we do. // // returns a promise resolving to the received request - async function expectAndAwaitSync(opts) { + async function expectAndAwaitSync(opts?) { let syncRequest = null; const isGuest = opts && opts.isGuest; if (!isGuest) { @@ -633,7 +635,7 @@ describe('loading:', function() { async function completeLogin(matrixChat) { // we expect a single component const login = ReactTestUtils.findRenderedComponentWithType( - matrixChat, sdk.getComponent('structures.auth.Login')); + matrixChat, LoginComponent); // When we switch to the login component, it'll hit the login endpoint // for proof of life and to get flows. We'll only give it one option. @@ -673,7 +675,7 @@ describe('loading:', function() { // assert that we are on the loading page function assertAtLoadingSpinner(matrixChat) { - const domComponent = ReactDOM.findDOMNode(matrixChat); + const domComponent = ReactDOM.findDOMNode(matrixChat) as Element; expect(domComponent.className).toEqual("mx_MatrixChat_splash"); // just the spinner @@ -691,14 +693,14 @@ function awaitLoggedIn(matrixChat) { } console.log(Date.now() + ": Received on_logged_in action"); dis.unregister(dispatcherRef); - resolve(); + resolve(undefined); }; const dispatcherRef = dis.register(onAction); console.log(Date.now() + ": Waiting for on_logged_in action"); }); } -function awaitRoomView(matrixChat, retryLimit, retryCount) { +function awaitRoomView(matrixChat, retryLimit?, retryCount?) { if (retryLimit === undefined) { retryLimit = 5; } @@ -721,17 +723,17 @@ function awaitRoomView(matrixChat, retryLimit, retryCount) { // state looks good, check the rendered output ReactTestUtils.findRenderedComponentWithType( - matrixChat, sdk.getComponent('structures.RoomView')); + matrixChat, RoomViewClass); return Promise.resolve(); } -function awaitLoginComponent(matrixChat, attempts) { +function awaitLoginComponent(matrixChat, attempts?) { return MatrixReactTestUtils.waitForRenderedComponentWithType( matrixChat, sdk.getComponent('structures.auth.Login'), attempts, ); } -function awaitWelcomeComponent(matrixChat, attempts) { +function awaitWelcomeComponent(matrixChat, attempts?) { return MatrixReactTestUtils.waitForRenderedComponentWithType( matrixChat, sdk.getComponent('auth.Welcome'), attempts, ); diff --git a/webpack.config.js b/webpack.config.js index 484fe700336..444dfcb2eea 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -90,7 +90,7 @@ module.exports = (env, argv) => { "bundle": "./src/vector/index.ts", "mobileguide": "./src/vector/mobile_guide/index.ts", "jitsi": "./src/vector/jitsi/index.ts", - "usercontent": "./node_modules/matrix-react-sdk/src/usercontent/index.js", + "usercontent": "./node_modules/matrix-react-sdk/src/usercontent/index.ts", ...(useHMR ? {} : cssThemes), }, diff --git a/yarn.lock b/yarn.lock index d837ad4890d..24eb149826f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1293,6 +1293,17 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" +"@jest/types@^27.2.4": + version "27.2.4" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" + integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@matrix-org/olm@https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz": version "3.2.3" resolved "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz#cc332fdd25c08ef0e40f4d33fc3f822a0f98b6f4" @@ -1652,6 +1663,14 @@ dependencies: "@types/istanbul-lib-report" "*" +"@types/jest@^27.0.2": + version "27.0.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.2.tgz#ac383c4d4aaddd29bbf2b916d8d105c304a5fcd7" + integrity sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA== + dependencies: + jest-diff "^27.0.0" + pretty-format "^27.0.0" + "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.7", "@types/json-schema@^7.0.8": version "7.0.9" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" @@ -1822,6 +1841,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yargs@^16.0.0": + version "16.0.4" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" + integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== + dependencies: + "@types/yargs-parser" "*" + "@typescript-eslint/eslint-plugin@^4.17.0": version "4.31.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.1.tgz#e938603a136f01dcabeece069da5fb2e331d4498" @@ -2193,7 +2219,7 @@ ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== -ansi-regex@^5.0.0: +ansi-regex@^5.0.0, ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== @@ -2217,6 +2243,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: dependencies: color-convert "^2.0.1" +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" @@ -4115,6 +4146,11 @@ diff-sequences@^26.6.2: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-26.6.2.tgz#48ba99157de1923412eed41db6b6d4aa9ca7c0b1" integrity sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q== +diff-sequences@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" + integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -6052,6 +6088,11 @@ ignore@^5.1.4, ignore@^5.1.8: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps= + immutable@^3.7.4: version "3.8.2" resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3" @@ -6867,6 +6908,16 @@ jest-diff@^26.6.2: jest-get-type "^26.3.0" pretty-format "^26.6.2" +jest-diff@^27.0.0: + version "27.2.4" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" + integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== + dependencies: + chalk "^4.0.0" + diff-sequences "^27.0.6" + jest-get-type "^27.0.6" + pretty-format "^27.2.4" + jest-docblock@^26.0.0: version "26.0.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-26.0.0.tgz#3e2fa20899fc928cb13bd0ff68bd3711a36889b5" @@ -6925,6 +6976,11 @@ jest-get-type@^26.3.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== +jest-get-type@^27.0.6: + version "27.0.6" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" + integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== + jest-haste-map@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-26.6.2.tgz#dd7e60fe7dc0e9f911a23d79c5ff7fb5c2cafeaa" @@ -7037,6 +7093,11 @@ jest-pnp-resolver@^1.2.2: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== +jest-raw-loader@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/jest-raw-loader/-/jest-raw-loader-1.0.1.tgz#ce9f56d54650f157c4a7d16d224ba5d613bcd626" + integrity sha1-zp9W1UZQ8VfEp9FtIkul1hO81iY= + jest-regex-util@^26.0.0: version "26.0.0" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" @@ -7390,6 +7451,16 @@ jsrsasign@^10.2.0: array-includes "^3.1.2" object.assign "^4.1.2" +jszip@^3.7.0: + version "3.7.1" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.7.1.tgz#bd63401221c15625a1228c556ca8a68da6fda3d9" + integrity sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg== + dependencies: + lie "~3.3.0" + pako "~1.0.2" + readable-stream "~2.3.6" + set-immediate-shim "~1.0.1" + katex@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/katex/-/katex-0.12.0.tgz#2fb1c665dbd2b043edcf8a1f5c555f46beaa0cb9" @@ -7477,6 +7548,13 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lie@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a" + integrity sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ== + dependencies: + immediate "~3.0.5" + lines-and-columns@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" @@ -7687,10 +7765,10 @@ mathml-tag-names@^2.1.3: resolved "https://registry.yarnpkg.com/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz#4ddadd67308e780cf16a47685878ee27b736a0a3" integrity sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg== -matrix-js-sdk@13.0.0: - version "13.0.0" - resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-13.0.0.tgz#a57a4b73892e98fcd5eb0081e4745fac567211dd" - integrity sha512-VkZhQBd6jlRNjsqjLIoHV3fnjOSljPDuJklKsF4l6yffkra7llxQctyMsrCnoiosdAQWigbLZsKSb+HbSFmcnw== +matrix-js-sdk@14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-14.0.0.tgz#e04bca71a3dc3e3256171e184ac7614973e00db2" + integrity sha512-7OOSYpGUW7iRyNQrl/gdRxFRmbpW/C7L0gEdMbZwbOPqpbcvp6DVgl0eO+ibHoX0C8t0+rGAl/hMdOST9agGWg== dependencies: "@babel/runtime" "^7.12.5" another-json "^0.2.0" @@ -7711,10 +7789,10 @@ matrix-mock-request@^1.2.3: bluebird "^3.5.0" expect "^1.20.2" -matrix-react-sdk@3.31.0: - version "3.31.0" - resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.31.0.tgz#5b7bc5705919524aee5224a9f6757777c9eced32" - integrity sha512-Uf9RZQbpVWA+l8WU9TjuqqqLg0JHJmRP9zjxInwApsajLyjCELz7HobLzNn4Ti39yVdsSfgRXoPUY8aDH9WUIg== +matrix-react-sdk@3.32.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-3.32.0.tgz#e4c95cc943dcf984fd8bde3ba375bee93b14912d" + integrity sha512-wS1CnGOljr21XNwNvqJsOBG6Xba61qoZ+R8xIiNEJ1tejFQcNTCjOga9/Rt46eG/ju1bQxGkXdELZY2ZteWblg== dependencies: "@babel/runtime" "^7.12.5" "@sentry/browser" "^6.11.0" @@ -7741,10 +7819,11 @@ matrix-react-sdk@3.31.0: highlight.js "^10.5.0" html-entities "^1.4.0" is-ip "^3.1.0" + jszip "^3.7.0" katex "^0.12.0" linkifyjs "^2.1.9" lodash "^4.17.20" - matrix-js-sdk "13.0.0" + matrix-js-sdk "14.0.0" matrix-widget-api "^0.1.0-beta.16" minimist "^1.2.5" opus-recorder "^8.0.3" @@ -8689,7 +8768,7 @@ pako@^2.0.3: resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.4.tgz#6cebc4bbb0b6c73b0d5b8d7e8476e2b2fbea576d" integrity sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg== -pako@~1.0.5: +pako@~1.0.2, pako@~1.0.5: version "1.0.11" resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== @@ -9777,6 +9856,16 @@ pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" +pretty-format@^27.0.0, pretty-format@^27.2.4: + version "27.2.4" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" + integrity sha512-NUjw22WJHldzxyps2YjLZkUj6q1HvjqFezkB9Y2cklN8NtVZN/kZEXGZdFw4uny3oENzV5EEMESrkI0YDUH8vg== + dependencies: + "@jest/types" "^27.2.4" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -10008,6 +10097,14 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" +raw-loader@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.2.tgz#1aac6b7d1ad1501e66efdac1522c73e59a584eb6" + integrity sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA== + dependencies: + loader-utils "^2.0.0" + schema-utils "^3.0.0" + re-resizable@^6.9.0: version "6.9.1" resolved "https://registry.yarnpkg.com/re-resizable/-/re-resizable-6.9.1.tgz#6be082b55d02364ca4bfee139e04feebdf52441c" @@ -10740,6 +10837,11 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= +set-immediate-shim@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E= + set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"