Skip to content

Commit

Permalink
Revert "Attempt to fix tests some more"
Browse files Browse the repository at this point in the history
This reverts commit c76a5f2

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
t3chguy committed Oct 1, 2020
1 parent 1edbe36 commit cfee4c9
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 1,306 deletions.
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions res/sw.js
@@ -0,0 +1 @@
self.addEventListener('fetch', () => {});
1 change: 1 addition & 0 deletions scripts/copy-res.js
Expand Up @@ -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"],
Expand Down
10 changes: 10 additions & 0 deletions src/vector/index.html
Expand Up @@ -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" />
Expand Down
2 changes: 1 addition & 1 deletion src/vector/index.ts
Expand Up @@ -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>>) {
Expand Down
20 changes: 3 additions & 17 deletions webpack.config.js
Expand Up @@ -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';
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit cfee4c9

Please sign in to comment.