Compare commits

..

5 Commits

Author SHA1 Message Date
David Baker
8c09da4294 more s/type/nodeName/ 2020-05-13 19:33:37 +01:00
David Baker
b447b0c62d Use nodeName which is specced 2020-05-13 18:44:06 +01:00
David Baker
cdef07ca2c Log details about the node that failed to be removed / inserted 2020-05-13 18:20:38 +01:00
David Baker
33f22ac483 typo 2020-05-13 17:00:02 +01:00
David Baker
a35d566551 Patch removeNode / insertBefore to fix React crash with Google translate
Hopefully all the info for this is in the comment.

Fixes https://github.com/vector-im/riot-web/issues/13557
2020-05-13 16:44:39 +01:00
9 changed files with 91 additions and 128 deletions

View File

@@ -1,87 +1,3 @@
Changes in [1.6.2](https://github.com/vector-im/riot-web/releases/tag/v1.6.2) (2020-05-22)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.6.1...v1.6.2)
* Upgrade to React SDK 2.6.1
Changes in [1.6.1](https://github.com/vector-im/riot-web/releases/tag/v1.6.1) (2020-05-19)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.6.1-rc.1...v1.6.1)
* Upgrade to React SDK 2.6.0 and JS SDK 6.1.0
Changes in [1.6.1-rc.1](https://github.com/vector-im/riot-web/releases/tag/v1.6.1-rc.1) (2020-05-14)
====================================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.6.0...v1.6.1-rc.1)
* Upgrade to React SDK 2.6.0-rc.1 and JS SDK 6.1.0-rc.1
* Update from Weblate
[\#13673](https://github.com/vector-im/riot-web/pull/13673)
* Add notranslate class to matrixchat to prevent translation by Google
Translate
[\#13669](https://github.com/vector-im/riot-web/pull/13669)
* Added Anchor Link to the development of matrix sdk
[\#13638](https://github.com/vector-im/riot-web/pull/13638)
* Prefetch the formatting button mask svg images
[\#13631](https://github.com/vector-im/riot-web/pull/13631)
* use a different image in previews
[\#13488](https://github.com/vector-im/riot-web/pull/13488)
* Update from Weblate
[\#13625](https://github.com/vector-im/riot-web/pull/13625)
* Remove electron_app as we now have riot-desktop repo
[\#13544](https://github.com/vector-im/riot-web/pull/13544)
* add new images for PWA icons
[\#13556](https://github.com/vector-im/riot-web/pull/13556)
* Remove unused feature flag from config
[\#13504](https://github.com/vector-im/riot-web/pull/13504)
* Update from Weblate
[\#13486](https://github.com/vector-im/riot-web/pull/13486)
* Developer tool: convert rageshake error locations back to sourcecode
locations
[\#13357](https://github.com/vector-im/riot-web/pull/13357)
* App load tweaks, improve error pages
[\#13329](https://github.com/vector-im/riot-web/pull/13329)
* Tweak default device name to be more compact
[\#13465](https://github.com/vector-im/riot-web/pull/13465)
* Tweak default device name on macOS
[\#13460](https://github.com/vector-im/riot-web/pull/13460)
* Update docs with custom theming changes
[\#13406](https://github.com/vector-im/riot-web/pull/13406)
* Update from Weblate
[\#13395](https://github.com/vector-im/riot-web/pull/13395)
* Remove docs and config for invite only padlocks
[\#13374](https://github.com/vector-im/riot-web/pull/13374)
* Revert "Add font scaling labs setting."
[\#13351](https://github.com/vector-im/riot-web/pull/13351)
* Expand feature flag docs to cover additional release channels
[\#13341](https://github.com/vector-im/riot-web/pull/13341)
* Optimized image assets by recompressing without affecting quality.
[\#13034](https://github.com/vector-im/riot-web/pull/13034)
* Add font scaling labs setting.
[\#13199](https://github.com/vector-im/riot-web/pull/13199)
* Remove encrypted message search feature flag
[\#13325](https://github.com/vector-im/riot-web/pull/13325)
* Fix `default_federate` settting description
[\#13312](https://github.com/vector-im/riot-web/pull/13312)
* Clarify that the .well-known method for Jitsi isn't available yet
[\#13314](https://github.com/vector-im/riot-web/pull/13314)
* add config option to tsc resolveJsonModule
[\#13296](https://github.com/vector-im/riot-web/pull/13296)
* Fix dispatcher import to be extension agnostic
[\#13297](https://github.com/vector-im/riot-web/pull/13297)
* Document more config options in config.md (fixes #13089)
[\#13260](https://github.com/vector-im/riot-web/pull/13260)
* Fix tests post-js-sdk-filters change
[\#13295](https://github.com/vector-im/riot-web/pull/13295)
* Make Jitsi download script a JS script
[\#13227](https://github.com/vector-im/riot-web/pull/13227)
* Use matrix-react-sdk type extensions as a base
[\#13271](https://github.com/vector-im/riot-web/pull/13271)
* Allow Riot Web to randomly pick welcome backgrounds
[\#13235](https://github.com/vector-im/riot-web/pull/13235)
* Update cross-signing feature docs and document fallback procedures
[\#13224](https://github.com/vector-im/riot-web/pull/13224)
Changes in [1.6.0](https://github.com/vector-im/riot-web/releases/tag/v1.6.0) (2020-05-05)
==========================================================================================
[Full Changelog](https://github.com/vector-im/riot-web/compare/v1.6.0-rc.6...v1.6.0)

View File

@@ -1,7 +1,7 @@
{
"name": "riot-web",
"productName": "Riot",
"version": "1.6.2",
"version": "1.6.0",
"description": "A feature-rich client for Matrix.org",
"author": "New Vector Ltd.",
"repository": {
@@ -61,8 +61,8 @@
"favico.js": "^0.3.10",
"gfm.css": "^1.1.2",
"highlight.js": "^9.13.1",
"matrix-js-sdk": "6.1.0",
"matrix-react-sdk": "2.6.1",
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#develop",
"matrix-react-sdk": "github:matrix-org/matrix-react-sdk#develop",
"olm": "https://packages.matrix.org/npm/olm/olm-3.1.4.tgz",
"postcss-easings": "^2.0.0",
"prop-types": "^15.7.2",

View File

@@ -45,8 +45,6 @@ do
fi
done
./node_modules/matrix-js-sdk/release.sh -u vector-im -z "$orig_args"
release="${1#v}"
tag="v${release}"
prerelease=0
@@ -56,6 +54,16 @@ prerelease=0
# with a hyphen is a prerelease.
echo $release | grep -q '-' && prerelease=1
# bump Electron's package.json first
echo "electron yarn version"
cd electron_app
yarn version --no-git-tag-version --new-version "$release"
git commit package.json -m "$tag"
cd ..
./node_modules/matrix-js-sdk/release.sh -u vector-im -z "$orig_args"
if [ $prerelease -eq 0 ]
then
# For a release, reset SDK deps back to the `develop` branch.

View File

@@ -21,19 +21,5 @@
"Create Account": "계정 만들기",
"Need help?": "도움이 필요합니까?",
"Explore rooms": "방 검색",
"Room Directory": "방 목록",
"Unable to load config file: please refresh the page to try again.": "설정 파일을 불러오는 데 실패: 페이지를 새로고침한 후에 다시 시도해 주십시오.",
"Open user settings": "사용자 설정 열기",
"Previous/next recently visited room or community": "최근에 방문한 이전/다음 방 또는 커뮤니티",
"Riot Desktop (%(platformName)s)": "Riot 데스크탑 (%(platformName)s)",
"Go to your browser to complete Sign In": "로그인을 완료하려면 브라우저로 이동해주세요",
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
"Unsupported browser": "지원되지 않는 브라우저",
"Your browser can't run Riot": "사용중이신 브라우저는 Riot을 실행할 수 없습니다",
"Riot uses advanced browser features which aren't supported by your current browser.": "Riot은 현재 사용중이신 브라우저에서는 지원하지 않는 고급 브라우저 기능을 사용합니다.",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "최상의 경험을 위해 <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, 또는 <safariLink>Safari</safariLink>를 설치해주세요.",
"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 Riot.im": "Riot.im으로 가기",
"Failed to start": "시작 실패"
"Room Directory": "방 목록"
}

View File

@@ -17,8 +17,8 @@
"Room Directory": "Gesprekscatalogus",
"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.",
"Your Riot is misconfigured": "Uw Riot is verkeerd geconfigureerd",
"Invalid configuration: no default server specified.": "Configuratiefout: geen standaardserver opgegeven.",
"Your Riot is misconfigured": "Uw Riot is onjuist geconfigureerd",
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Uw Riot-configuratie bevat ongeldige JSON. Corrigeer het probleem en herlaad de pagina.",
"The message from the parser is: %(message)s": "De ontleder meldt: %(message)s",
"Invalid JSON": "Ongeldige JSON",

View File

@@ -14,16 +14,5 @@
"Create Account": "Înregistare",
"Need help?": "Ai nevoie de ajutor?",
"Explore rooms": "Explorează camerele",
"Room Directory": "Lista de camere",
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Configuratie invalida: se poate specifica doar una dintre default_server_config, default_server_name, or default_hs_url.",
"Your Riot is misconfigured": "Aplicatia ta Riot e gresit configurata",
"Invalid JSON": "JSON invalid",
"Riot Desktop (%(platformName)s)": "Riot Desktop (%(platformName)s)",
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
"Unsupported browser": "Acest browser nu este suportat",
"Your browser can't run Riot": "Browserul tau nu poate rula Riot",
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Instalati va rog <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> pentru o experienta mai buna.",
"I understand the risks and wish to continue": "Inteleg riscul si doresc sa continui",
"Go to Riot.im": "Acceseaza Riot.im",
"Failed to start": "Nu reuseste sa porneasca"
"Room Directory": "Lista de camere"
}

View File

@@ -51,7 +51,7 @@
</head>
<body style="height: 100%; margin: 0;" data-vector-indexeddb-worker-script="<%= htmlWebpackPlugin.files.chunks['indexeddb-worker'].entry %>">
<noscript>Sorry, Riot requires JavaScript to be enabled.</noscript> <!-- TODO: Translate this? -->
<section id="matrixchat" style="height: 100%; overflow: auto;" class="notranslate"></section>
<section id="matrixchat" style="height: 100%; overflow: auto;"></section>
<script src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script>
<!-- Legacy supporting Prefetch images -->

View File

@@ -78,6 +78,70 @@ function checkBrowserFeatures() {
return featureComplete;
}
/**
* Monkey patch some browser methods to work around a fundamental
* incompatability between React and any browser extension or anything
* else that manipulates the DOM.
*
* React issue: https://github.com/facebook/react/issues/11538
* Chromium issue: https://bugs.chromium.org/p/chromium/issues/detail?id=872770
*
* The workaround here is inspired by the one in a comment on the React bug
* (https://github.com/facebook/react/issues/11538#issuecomment-417504600)
* except that we catch the exception rather than sanity checking every call,
* and we remove the child from whatever its parent actually is rather than
* doing nothing (the workaround in the comment leaves the element in the DOM,
* which in the case of https://github.com/vector-im/riot-web/issues/13557
* makes it fail by adding another submit button to the page every time you
* try to log in, which is also a fairly terrible failure mode).
*/
function monkeyPatchForReact() {
function findAncestorWithClass(node) {
let depth = 0;
while (node) {
if (node.className) return [node, depth];
node = node.parentNode;
++depth;
}
return [null, 0];
}
const originalRemoveChild = Node.prototype.removeChild;
Node.prototype.removeChild = function(...args) {
try {
return originalRemoveChild.apply(this, args);
} catch (e) {
const [ancestor, depth] = findAncestorWithClass(args[0]);
console.log(
"Caught exception from removeChild, removing node of type " +
args[0].nodeName + ". Closest ancestor with class is a " + ancestor.nodeName +
" with class " + ancestor.className + " " + depth + " levels above. " +
"See https://github.com/vector-im/riot-web/issues/13557", e,
);
return originalRemoveChild.apply(args[0].parentNode, args);
}
}
const originalInsertBefore = Node.prototype.insertBefore;
Node.prototype.insertBefore = function(...args) {
try {
return originalInsertBefore.apply(this, args);
} catch (e) {
const [ancestor, depth] = findAncestorWithClass(args[0]);
console.log(
"Caught exception from removeChild, removing " + args[0].nodeName +
". Closest ancestor with class is a " + ancestor.nodeName +
" with class " + ancestor.class + " " + depth + " levels above. " +
"See https://github.com/vector-im/riot-web/issues/13557", e,
);
// We could use appendChild instead, then the node would
// be in the DOM but not necessarily in the right place?
// For now, do nothing.
return args[0];
}
}
}
const supportedBrowser = checkBrowserFeatures();
// React depends on Map & Set which we check for using modernizr's es6collections
@@ -190,6 +254,8 @@ async function start() {
await loadThemePromise;
await loadLanguagePromise;
monkeyPatchForReact();
// Finally, load the app. All of the other react-sdk imports are in this file which causes the skinner to
// run on the components.
await loadApp(fragparts.params);

View File

@@ -6941,10 +6941,9 @@ 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@6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/matrix-js-sdk/-/matrix-js-sdk-6.1.0.tgz#c28ad67c113c4aa9c8bce409c7ba550170bdc2ee"
integrity sha512-N+vCgxWORvhh7AGyWZlU5Z2brojbbnHnWlMkBF6JjWe6a+pfpjmRKp5/jeQpOz6yfe56sIQvU7ikBZl3JjlMiw==
"matrix-js-sdk@github:matrix-org/matrix-js-sdk#develop":
version "6.0.0"
resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/f120533fadb309ac5dc8b2bcb6882e784ba93f18"
dependencies:
"@babel/runtime" "^7.8.3"
another-json "^0.2.0"
@@ -6964,10 +6963,9 @@ matrix-mock-request@^1.2.3:
bluebird "^3.5.0"
expect "^1.20.2"
matrix-react-sdk@2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/matrix-react-sdk/-/matrix-react-sdk-2.6.1.tgz#6e7f19282f336678043091b4d3b0a440ad218cfb"
integrity sha512-elLK3d8p99A/OPfHVa/MkuegXNnN4UgpLJw6343D8d7jsJ6GtoxS7vVCJSUdpyJ3fg/kVviZA5MejyzMTUsNSw==
"matrix-react-sdk@github:matrix-org/matrix-react-sdk#develop":
version "2.5.0"
resolved "https://codeload.github.com/matrix-org/matrix-react-sdk/tar.gz/aa0c6f1f71a6122579c74f3cba3a7925f35131ac"
dependencies:
"@babel/runtime" "^7.8.3"
blueimp-canvas-to-blob "^3.5.0"
@@ -6994,7 +6992,7 @@ matrix-react-sdk@2.6.1:
is-ip "^2.0.0"
linkifyjs "^2.1.6"
lodash "^4.17.14"
matrix-js-sdk "6.1.0"
matrix-js-sdk "github:matrix-org/matrix-js-sdk#develop"
minimist "^1.2.0"
pako "^1.0.5"
parse5 "^5.1.1"