This is an automated email from the ASF dual-hosted git repository. jli pushed a commit to branch fix-oom-tsc in repository https://gitbox.apache.org/repos/asf/superset.git
commit cba539b91da20bb31d4a6ff7662c610d5ebd0965 Author: Joe Li <[email protected]> AuthorDate: Thu Oct 2 21:06:11 2025 -0700 fix(TimeTable): resolve TypeScript OOM by simplifying sparkline series type Fixes heap out of memory error during TypeScript compilation caused by complex SeriesProps generic type forcing exponential type resolution. Changed chartSeriesMap type annotation from explicit SeriesProps<AxisScale, AxisScale, object> to type inference with precise union constraint. Uses 'as const satisfies' pattern to validate structure without triggering expensive type resolution. - Remove SeriesProps and AxisScale imports (no longer needed) - Add SparklineSeriesComponent union type (typeof LineSeries | BarSeries | AreaSeries) - Replace explicit type annotation with inferred type + satisfies constraint - Preserves type safety while avoiding exponential type checking complexity - Follows "NO any types" modernization guideline 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --- .../TimeTable/components/SparklineCell/SparklineCell.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/superset-frontend/src/visualizations/TimeTable/components/SparklineCell/SparklineCell.tsx b/superset-frontend/src/visualizations/TimeTable/components/SparklineCell/SparklineCell.tsx index 0c8766b3a4..fc0b2915e0 100644 --- a/superset-frontend/src/visualizations/TimeTable/components/SparklineCell/SparklineCell.tsx +++ b/superset-frontend/src/visualizations/TimeTable/components/SparklineCell/SparklineCell.tsx @@ -28,8 +28,6 @@ import { Tooltip, XYChart, buildChartTheme, - type SeriesProps, - AxisScale, } from '@visx/xychart'; import { extendedDayjs } from '@superset-ui/core/utils/dates'; import { @@ -134,14 +132,16 @@ const SparklineCell = ({ const xAccessor = (d: { x: number; y: number }) => d.x; const yAccessor = (d: { x: number; y: number }) => d.y; - const chartSeriesMap: Record< - SparkType, - (props: SeriesProps<AxisScale, AxisScale, object>) => JSX.Element - > = { + type SparklineSeriesComponent = + | typeof LineSeries + | typeof BarSeries + | typeof AreaSeries; + + const chartSeriesMap = { line: LineSeries, bar: BarSeries, area: AreaSeries, - }; + } as const satisfies Record<SparkType, SparklineSeriesComponent>; const SeriesComponent = chartSeriesMap[sparkType] || LineSeries;
