Browse Source

Revert "Attempt to fix tests some more"

This reverts commit c76a5f2c

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/15352/head
Michael Telatynski 2 years ago
parent
commit
cfee4c925a
  1. 3
      package.json
  2. 1
      res/sw.js
  3. 1
      scripts/copy-res.js
  4. 10
      src/vector/index.html
  5. 2
      src/vector/index.ts
  6. 20
      webpack.config.js
  7. 1336
      yarn.lock

3
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",

1
res/sw.js

@ -0,0 +1 @@
self.addEventListener('fetch', () => {});

1
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"],

10
src/vector/index.html

@ -55,6 +55,16 @@
<section id="matrixchat" style="height: 100%; overflow: auto;" class="notranslate"></section>
<script src="<%= htmlWebpackPlugin.files.chunks['bundle'].entry %>"></script>
<!-- Legacy supporting Prefetch images -->
<img src="<%= require('matrix-react-sdk/res/img/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/e2e/warning.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/feather-customised/warning-triangle.svg') %>" width="24" height="23" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/bold.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/code.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/italics.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/quote.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<img src="<%= require('matrix-react-sdk/res/img/format/strikethrough.svg') %>" width="25" height="22" style="visibility: hidden; position: absolute; top: 0px; left: 0px;"/>
<audio id="messageAudio">
<source src="media/message.ogg" type="audio/ogg" />
<source src="media/message.mp3" type="audio/mpeg" />

2
src/vector/index.ts

@ -30,7 +30,7 @@ import './modernizr';
// load service worker if available on this platform
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js');
navigator.serviceWorker.register('sw.js');
}
async function settled(...promises: Array<Promise<any>>) {

20
webpack.config.js

@ -3,7 +3,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
const webpack = require("webpack");
let og_image_url = process.env.RIOT_OG_IMAGE_URL;
if (!og_image_url) og_image_url = 'https://app.element.io/themes/element/img/logos/opengraph.png';
@ -248,9 +248,9 @@ module.exports = (env, argv) => {
},
},
{
// cache-bust i18n .json files placed in
// cache-bust languages.json file placed in
// riot-web/webapp/i18n during build by copy-res.js
test: /i18n\/.*\.json$/,
test: /\.*languages.json$/,
type: "javascript/auto",
loader: 'file-loader',
options: {
@ -356,20 +356,6 @@ module.exports = (env, argv) => {
minify: argv.mode === 'production',
chunks: ['usercontent'],
}),
new WorkboxPlugin.GenerateSW({
runtimeCaching: [{
urlPattern: /i18n\/.*\.json$/,
handler: 'CacheFirst',
options: {
cacheName: 'i18n',
expiration: {
maxEntries: 2,
},
},
}],
}),
],
output: {

1336
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save