From 432c1d65e1ca8b15dbb1b8c52ca0f11b952d4ad1 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Mon, 13 Nov 2023 20:18:00 +0100 Subject: [PATCH] Squashed commit of the following: commit 069c1bc8331b460275caf492450436f5e127f767 Author: Johannes Marbach Date: Sat Nov 11 16:08:30 2023 +0100 Replace worker-loader with built-in Webpack 5 support for web workers --- package.json | 1 - webpack.config.js | 10 +--------- yarn.lock | 12 ++---------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 5029c764a5..026f1f7e87 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,6 @@ "webpack-bundle-analyzer": "^4.8.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", - "worker-loader": "^3.0.0", "yaml": "^2.3.3" }, "@casualbot/jest-sonar-reporter": { diff --git a/webpack.config.js b/webpack.config.js index 591b3f648b..a6ad10abb9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -293,15 +293,6 @@ module.exports = (env, argv) => { replace: getThemesImports(), }, }, - { - test: /\.worker\.ts$/, - loader: "worker-loader", - options: { - // Prevent bundling workers since CSP forbids loading them - // from another origin. - filename: "[hash].worker.js", - }, - }, { test: /\.(ts|js)x?$/, include: (f) => { @@ -740,6 +731,7 @@ module.exports = (env, argv) => { // Disable automatic public path as it doesn't appear to function with // worklets in Webpack 5 + // TODO: This appears to break workers though 🤦‍♂️ publicPath: "", }, diff --git a/yarn.lock b/yarn.lock index 0db6e0a656..b89afbb686 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8426,7 +8426,7 @@ matrix-react-sdk@3.84.1: "@matrix-org/analytics-events" "^0.8.0" "@matrix-org/emojibase-bindings" "^1.1.2" "@matrix-org/matrix-wysiwyg" "2.4.1" - "@matrix-org/react-sdk-module-api" "^2.2.0" + "@matrix-org/react-sdk-module-api" "^2.1.1" "@matrix-org/spec" "^1.7.0" "@sentry/browser" "^7.0.0" "@sentry/tracing" "^7.0.0" @@ -8471,7 +8471,7 @@ matrix-react-sdk@3.84.1: opus-recorder "^8.0.3" pako "^2.0.3" png-chunks-extract "^1.0.0" - posthog-js "1.87.2" + posthog-js "1.83.0" proposal-temporal "^0.9.0" qrcode "1.5.3" re-resizable "^6.9.0" @@ -12694,14 +12694,6 @@ wildcard@^2.0.0: resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== -worker-loader@^3.0.0: - version "3.0.8" - resolved "https://registry.yarnpkg.com/worker-loader/-/worker-loader-3.0.8.tgz#5fc5cda4a3d3163d9c274a4e3a811ce8b60dbb37" - integrity sha512-XQyQkIFeRVC7f7uRhFdNMe/iJOdO6zxAaR3EWbDp45v3mDhrTi+++oswKNxShUNjPC/1xUp5DB29YKLhFo129g== - dependencies: - loader-utils "^2.0.0" - schema-utils "^3.0.0" - "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"