Compare commits

...
Sign in to create a new pull request.

7 commits

Author SHA1 Message Date
Florian Duros
7073fb2faf
Merge pull request #27901 from element-hq/florianduros/ci/fix-build
Fix develop build
2024-08-05 17:22:40 +00:00
Florian Duros
6e8f0f6f6d
Fix develop build. Use console.warn instead of an undefined compilation object. 2024-08-05 19:10:34 +02:00
Michael Telatynski
627377229c
Merge pull request #27900 from element-hq/t3chguy/fix/27886
Update Element icons
2024-08-05 10:16:07 +00:00
Michael Telatynski
3153f8862a
Update Element icons
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2024-08-05 10:48:06 +01:00
Travis Ralston
6efd8a4642
Merge pull request #27891 from element-hq/travis/global-sw
Switch from `self` to `global` for service worker
2024-08-02 14:20:41 +00:00
Travis Ralston
3080c97007 Switch from self to global for service worker 2024-08-01 19:46:03 -06:00
Michael Telatynski
380ab17932
Upgrade target to es2022 (#27884) 2024-08-01 17:14:27 +01:00
31 changed files with 13 additions and 12 deletions

View file

@ -10,15 +10,15 @@ module.exports = {
"last 2 Safari versions",
"last 2 Edge versions",
],
include: ["@babel/plugin-transform-class-properties"],
},
],
"@babel/preset-typescript",
["@babel/preset-typescript", { allowDeclareFields: true }],
"@babel/preset-react",
],
plugins: [
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-transform-numeric-separator",
"@babel/plugin-transform-class-properties",
"@babel/plugin-transform-object-rest-spread",
"@babel/plugin-transform-optional-chaining",
"@babel/plugin-transform-nullish-coalescing-operator",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 629 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 803 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 B

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -25,13 +25,13 @@ const serverSupportMap: {
};
} = {};
self.addEventListener("install", (event) => {
global.addEventListener("install", (event) => {
// We skipWaiting() to update the service worker more frequently, particularly in development environments.
// @ts-expect-error - service worker types are not available. See 'fetch' event handler.
event.waitUntil(skipWaiting());
});
self.addEventListener("activate", (event) => {
global.addEventListener("activate", (event) => {
// We force all clients to be under our control, immediately. This could be old tabs.
// @ts-expect-error - service worker types are not available. See 'fetch' event handler.
event.waitUntil(clients.claim());
@ -40,7 +40,7 @@ self.addEventListener("activate", (event) => {
// @ts-expect-error - the service worker types conflict with the DOM types available through TypeScript. Many hours
// have been spent trying to convince the type system that there's no actual conflict, but it has yet to work. Instead
// of trying to make it do the thing, we force-cast to something close enough where we can (and ignore errors otherwise).
self.addEventListener("fetch", (event: FetchEvent) => {
global.addEventListener("fetch", (event: FetchEvent) => {
// This is the authenticated media (MSC3916) check, proxying what was unauthenticated to the authenticated variants.
if (event.request.method !== "GET") {
@ -72,7 +72,7 @@ self.addEventListener("fetch", (event: FetchEvent) => {
// Locate our access token, and populate the fetchConfig with the authentication header.
// @ts-expect-error - service worker types are not available. See 'fetch' event handler.
const client = await self.clients.get(event.clientId);
const client = await global.clients.get(event.clientId);
accessToken = await getAccessToken(client);
// Update or populate the server support map using a (usually) authenticated `/versions` call.
@ -166,9 +166,9 @@ async function askClientForUserIdParams(client: unknown): Promise<{ userId: stri
if (event.data?.responseKey !== responseKey) return; // not for us
clearTimeout(timeoutId); // do this as soon as possible, avoiding a race between resolve and reject.
resolve(event.data); // "unblock" the remainder of the thread, if that were such a thing in JavaScript.
self.removeEventListener("message", listener); // cleanup, since we're not going to do anything else.
global.removeEventListener("message", listener); // cleanup, since we're not going to do anything else.
};
self.addEventListener("message", listener);
global.addEventListener("message", listener);
// Ask the tab for the information we need. This is handled by WebPlatform.
(client as Window).postMessage({ responseKey, type: "userinfo" });

View file

@ -4,9 +4,10 @@
"emitDecoratorMetadata": false,
"resolveJsonModule": true,
"esModuleInterop": true,
"useDefineForClassFields": true,
"module": "es2022",
"moduleResolution": "node",
"target": "es2018",
"target": "es2022",
"noUnusedLocals": true,
"sourceMap": false,
"outDir": "./lib",

View file

@ -4,7 +4,7 @@
"jsx": "preserve",
"declaration": false,
"outDir": "./lib/module_system",
"lib": ["es2020"],
"lib": ["es2022"],
"types": ["node"]
},
"include": ["./module_system/**/*.ts"]

View file

@ -714,8 +714,8 @@ module.exports = (env, argv) => {
sourcemaps: {
paths: "./webapp/bundles/**",
},
errorHandler: (err, invokeErr, compilation) => {
compilation.warnings.push("Sentry CLI Plugin: " + err.message);
errorHandler: (err) => {
console.warn("Sentry CLI Plugin: " + err.message);
console.log(`::warning title=Sentry error::${err.message}`);
},
}),