Compare commits

...

4 Commits

Author SHA1 Message Date
Hugh Nimmo-Smith
c4b9824d4c . 2024-12-18 13:59:23 +00:00
Hugh Nimmo-Smith
1d08edd7bf Inject sentry release information at runtime not build time
See https://github.com/element-hq/element-call/issues/2871 for context of impact.
2024-12-18 13:48:29 +00:00
Hugh Nimmo-Smith
7783c7290d Only set sentry release name 2024-12-18 13:33:37 +00:00
Hugh Nimmo-Smith
99c5a1a250 Use .ts files for vite config for type safety 2024-12-18 13:32:19 +00:00
5 changed files with 35 additions and 7 deletions

View File

@@ -1,4 +1,13 @@
export default {
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
import type { UserConfig } from "i18next-parser";
const config: UserConfig = {
keySeparator: ".",
namespaceSeparator: false,
contextSeparator: "|",
@@ -26,3 +35,5 @@ export default {
input: ["src/**/*.{ts,tsx}"],
sort: true,
};
export default config;

View File

@@ -220,6 +220,7 @@ export class Initializer {
Sentry.reactRouterV5BrowserTracingIntegration({ history }),
],
tracesSampleRate: 1.0,
release: import.meta.env.VITE_APP_VERSION,
});
}
// Sentry is now 'loadeed' (even if we actually skipped starting

View File

@@ -18,6 +18,7 @@
// Workaround for https://github.com/microsoft/TypeScript/issues/55132
"useDefineForClassFields": false,
"allowImportingTsExtensions": true,
"skipLibCheck": true,
"paths": {
// These imports within @livekit/components-core and
// @livekit/components-react are broken under the "bundler" module
@@ -50,6 +51,7 @@
"include": [
"./node_modules/matrix-js-sdk/src/@types/*.d.ts",
"./src/**/*.ts",
"./src/**/*.tsx"
"./src/**/*.tsx",
"*.ts"
]
}

View File

@@ -28,7 +28,8 @@ export default defineConfig(({ mode }) => {
ref: true,
},
}),
htmlTemplate.default({
// types workaround for https://github.com/IndexXuan/vite-plugin-html-template/issues/37
(htmlTemplate as unknown as { default: typeof htmlTemplate }).default({
data: {
title: env.VITE_PRODUCT_NAME || "Element Call",
},
@@ -53,8 +54,13 @@ export default defineConfig(({ mode }) => {
) {
plugins.push(
sentryVitePlugin({
include: "./dist",
release: process.env.VITE_APP_VERSION,
release: {
name: process.env.VITE_APP_VERSION,
// We don't inject the release info at build time because it has a side effect of
// changing the asset hashes each time meaning that it breaks browser caching.
// Instead we pass it in at runtime via Sentry.init().
inject: false,
},
}),
);
}
@@ -67,7 +73,7 @@ export default defineConfig(({ mode }) => {
sourcemap: true,
rollupOptions: {
output: {
assetFileNames: ({ originalFileNames }) => {
assetFileNames: ({ originalFileNames }): string => {
if (originalFileNames) {
for (const name of originalFileNames) {
// Custom asset name for locales to include the locale code in the filename

View File

@@ -1,5 +1,13 @@
/*
Copyright 2024 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
import { defineConfig, mergeConfig } from "vitest/config";
import viteConfig from "./vite.config.js";
import viteConfig from "./vite.config";
export default defineConfig((configEnv) =>
mergeConfig(