Compare commits

..

4 Commits

Author SHA1 Message Date
Vinícius Lourenço
d044a809c8 Merge remote-tracking branch 'origin/main' into chore/frontend-vite-8 2026-11-26 15:22:47 -03:00
Vinícius Lourenço
0072135229 chore(frontend): require node 22.12 for vite 8 2026-11-26 15:18:35 -03:00
Vinícius Lourenço
c1007a331b perf(frontend): keep the entry's static graph in one chunk on Vite 8 2026-11-23 15:06:26 -03:00
Vinícius Lourenço
ecb413de71 chore(frontend): upgrade vite to 8 2026-11-23 15:06:25 -03:00
12 changed files with 331 additions and 324 deletions

View File

@@ -90,7 +90,7 @@ const config: StorybookConfig = {
build: {
...viteConfig.build,
// `vite.config.ts` sets this for the app; Storybook's builder replaces
// `build` wholesale, which leaves rolldown-vite on its default
// `build` wholesale, which leaves Vite on its default
// lightningcss. That one rejects `:global()` in a plain stylesheet, which
// the app has, and the static build dies in CSS minification.
cssMinify: 'esbuild',

View File

@@ -15,6 +15,8 @@
content="frame-src 'self' blob: data:"
/>
<link rel="stylesheet" href="css/uPlot.min.css" />
<script>
// i18n's language detector would pick the browser locale (e.g. `en-US`), which
// /public/locales does not ship; pin it to the bundled language instead.

View File

@@ -22,7 +22,6 @@ import i18n from '../src/ReactI18';
// to its loader default and pulls Monaco from cdn.jsdelivr.net, which msw does
// not report because the requests look like static assets.
import '../src/lib/monaco/loader';
import '../src/lib/uPlotStylesheet';
import '../src/styles.scss';

View File

@@ -157,6 +157,7 @@
})(document, 'script');
}
</script>
<link rel="stylesheet" href="css/uPlot.min.css" />
<script type="module" src="./src/index.tsx"></script>
</body>
</html>

View File

@@ -34,7 +34,7 @@
"build:geo-outlines": "node scripts/geo-outlines/build.mjs"
},
"engines": {
"node": ">=22.0.0",
"node": ">=22.12.0",
"pnpm": ">=10.0.0 <11.0.0"
},
"author": "",
@@ -67,7 +67,7 @@
"@visx/hierarchy": "3.12.0",
"@visx/shape": "3.5.0",
"@visx/tooltip": "3.3.0",
"@vitejs/plugin-react": "5.1.4",
"@vitejs/plugin-react": "6.3.0",
"ansi-to-html": "0.7.2",
"antd": "5.11.0",
"antd-table-saveas-excel": "2.2.1",
@@ -137,7 +137,7 @@
"typescript": "5.9.3",
"uplot": "1.6.31",
"uuid": "14.0.1",
"vite": "npm:rolldown-vite@7.3.1",
"vite": "8.3.8",
"zod": "4.6.7",
"zustand": "5.0.11"
},
@@ -194,6 +194,7 @@
"@types/topojson-client": "3.1.5",
"@types/topojson-specification": "1.0.5",
"@typescript/native-preview": "7.0.0-dev.20260430.1",
"esbuild": "0.28.1",
"eslint-plugin-sonarjs": "4.0.2",
"husky": "^9.1.7",
"jest-environment-jsdom": "29.7.0",
@@ -221,8 +222,7 @@
"use-sync-external-store": "1.6.0",
"vite-plugin-checker": "0.12.0",
"vite-plugin-compression": "0.5.1",
"vite-plugin-image-optimizer": "2.0.3",
"vite-tsconfig-paths": "6.1.1"
"vite-plugin-image-optimizer": "2.0.3"
},
"lint-staged": {
"*.(js|jsx|ts|tsx)": [

597
frontend/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -40,9 +40,9 @@ overrides:
# remove: blocked. The direct dep is already on 3.4.17, but @grafana/data
# (latest 13.1.0) and monaco-editor (latest 0.55.1) still pin vulnerable versions
dompurify@<=3.4.16: '>=3.4.17 <4'
# via: rolldown-vite@7.3.1 (esbuild ^0.27.0); ts-jest@29.4.9 (~0.27.4)
# remove: blocked on rolldown-vite (7.3.1 is latest, still ^0.27.0);
# orval >=8.20.0 and ts-jest >=29.4.11 already fixed on their side
# via: ts-jest@29.4.9 (~0.27.4)
# remove: blocked on ts-jest; orval >=8.20.0 and ts-jest >=29.4.11 already
# fixed on their side
esbuild@>=0.27.3 <0.28.1: '>=0.28.1 <0.29.0'
# via: @commitlint/cli > @commitlint/config-validator > ajv@8 (fast-uri ^3.0.1)
# remove: blocked — ajv@8 caps fast-uri at ^3, and only 3.1.9 carries the fix

1
frontend/public/css/uPlot.min.css vendored Normal file
View File

@@ -0,0 +1 @@
.uplot, .uplot *, .uplot *::before, .uplot *::after {box-sizing: border-box;}.uplot {font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";line-height: 1.5;width: min-content;}.u-title {text-align: center;font-size: 18px;font-weight: bold;}.u-wrap {position: relative;user-select: none;}.u-over, .u-under {position: absolute;}.u-under {overflow: hidden;}.uplot canvas {display: block;position: relative;width: 100%;height: 100%;}.u-axis {position: absolute;}.u-legend {font-size: 14px;margin: auto;text-align: center;}.u-inline {display: block;}.u-inline * {display: inline-block;}.u-inline tr {margin-right: 16px;}.u-legend th {font-weight: 600;}.u-legend th > * {vertical-align: middle;display: inline-block;}.u-legend .u-marker {width: 1em;height: 1em;margin-right: 4px;background-clip: padding-box !important;}.u-inline.u-live th::after {content: ":";vertical-align: middle;}.u-inline:not(.u-live) .u-value {display: none;}.u-series > * {padding: 4px;}.u-series th {cursor: pointer;}.u-legend .u-off > * {opacity: 0.3;}.u-select {background: rgba(0,0,0,0.07);position: absolute;pointer-events: none;}.u-cursor-x, .u-cursor-y {position: absolute;left: 0;top: 0;pointer-events: none;will-change: transform;}.u-hz .u-cursor-x, .u-vt .u-cursor-y {height: 100%;border-right: 1px dashed #607D8B;}.u-hz .u-cursor-y, .u-vt .u-cursor-x {width: 100%;border-bottom: 1px dashed #607D8B;}.u-cursor-pt {position: absolute;top: 0;left: 0;border-radius: 50%;border: 0 solid;pointer-events: none;will-change: transform;/*this has to be !important since we set inline "background" shorthand */background-clip: padding-box !important;}.u-axis.u-off, .u-select.u-off, .u-cursor-x.u-off, .u-cursor-y.u-off, .u-cursor-pt.u-off {display: none;}

View File

@@ -14,6 +14,7 @@ import uPlot from 'uplot';
import tooltipPlugin from './tooltipPlugin';
import 'uplot/dist/uPlot.min.css';
import './AnomalyAlertEvaluationView.styles.scss';
const { Search } = Input;

View File

@@ -18,7 +18,6 @@ import 'lib/monaco/loader';
import './ReactI18';
import 'styles.scss';
import 'lib/uPlotStylesheet';
installTranslationResilience();
configureOverlayScrollbars();

View File

@@ -1,7 +0,0 @@
import href from 'uplot/dist/uPlot.min.css?url';
// Appended to the end of <body> so uPlot's rules win ties over the app's stylesheets.
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = href;
document.body.appendChild(link);

View File

@@ -7,7 +7,6 @@ import { defineConfig, loadEnv } from 'vite';
import vitePluginChecker from 'vite-plugin-checker';
import viteCompression from 'vite-plugin-compression';
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
import tsconfigPaths from 'vite-tsconfig-paths';
import type {
Appcues,
Posthog,
@@ -82,7 +81,6 @@ export default defineConfig(({ mode }): UserConfig => {
const basePath = env.VITE_BASE_PATH || '/';
const plugins = [
tsconfigPaths(),
rawMarkdownPlugin(),
devBasePathPlugin(basePath),
devBootDataPlugin(env),
@@ -142,6 +140,7 @@ export default defineConfig(({ mode }): UserConfig => {
return {
plugins,
resolve: {
tsconfigPaths: true,
alias: {
// @grafana/data imports bare CJS `lodash`, whose UMD footer checks for an
// AMD loader before assigning module.exports. Any third-party script that
@@ -149,13 +148,13 @@ export default defineConfig(({ mode }): UserConfig => {
// every lodash method reached through it is undefined at runtime. lodash-es
// is the same version, real ESM, and tree-shakes.
lodash: 'lodash-es',
'@': resolve(__dirname, './src'),
utils: resolve(__dirname, './src/utils'),
types: resolve(__dirname, './src/types'),
constants: resolve(__dirname, './src/constants'),
parser: resolve(__dirname, './src/parser'),
providers: resolve(__dirname, './src/providers'),
lib: resolve(__dirname, './src/lib'),
'@': resolve(import.meta.dirname, './src'),
utils: resolve(import.meta.dirname, './src/utils'),
types: resolve(import.meta.dirname, './src/types'),
constants: resolve(import.meta.dirname, './src/constants'),
parser: resolve(import.meta.dirname, './src/parser'),
providers: resolve(import.meta.dirname, './src/providers'),
lib: resolve(import.meta.dirname, './src/lib'),
},
},
css: {
@@ -188,6 +187,15 @@ export default defineConfig(({ mode }): UserConfig => {
sourcemap: true,
outDir: 'build',
cssMinify: 'esbuild',
rolldownOptions: {
output: {
// Without this group Rolldown splits the entry's static graph into ~300
// chunks, 324 requests on first load.
codeSplitting: {
groups: [{ name: 'initial', tags: ['$initial'] }],
},
},
},
},
server: {
open: true,