@checkstack/healthcheck-frontend 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @checkstack/healthcheck-frontend
2
2
 
3
+ ## 0.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - e58e994: Fix runtime error in AutoChartGrid when mapping over values with undefined elements
8
+
9
+ The filter functions `getAllBooleanValuesWithTime` and `getAllStringValuesWithTime` incorrectly checked `v !== null` instead of `v !== undefined`, allowing undefined elements to pass through and crash when accessing `.value`.
10
+
11
+ ## 0.7.1
12
+
13
+ ### Patch Changes
14
+
15
+ - deec10c: Fix production crash when opening health check accordion and enable sourcemaps
16
+
17
+ - Fixed TypeError in `HealthCheckLatencyChart` where recharts Tooltip content function was returning `undefined` instead of `null`, causing "can't access property 'value', o is undefined" error
18
+ - Enabled production sourcemaps in Vite config for better debugging of production errors
19
+
3
20
  ## 0.7.0
4
21
 
5
22
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/healthcheck-frontend",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "main": "src/index.tsx",
6
6
  "scripts": {
@@ -1202,7 +1202,9 @@ function getAllBooleanValuesWithTime(
1202
1202
  timeLabel: format(new Date(run.timestamp), "MMM d, HH:mm:ss"),
1203
1203
  };
1204
1204
  })
1205
- .filter((v): v is { value: boolean; timeLabel: string } => v !== null);
1205
+ .filter(
1206
+ (v): v is { value: boolean; timeLabel: string } => v !== undefined,
1207
+ );
1206
1208
  }
1207
1209
  return context.buckets
1208
1210
  .map((bucket) => {
@@ -1219,7 +1221,7 @@ function getAllBooleanValuesWithTime(
1219
1221
  timeLabel: `${format(bucketStart, "MMM d, HH:mm")} - ${format(bucketEnd, "HH:mm")}`,
1220
1222
  };
1221
1223
  })
1222
- .filter((v): v is { value: boolean; timeLabel: string } => v !== null);
1224
+ .filter((v): v is { value: boolean; timeLabel: string } => v !== undefined);
1223
1225
  }
1224
1226
 
1225
1227
  /**
@@ -1242,7 +1244,9 @@ function getAllStringValuesWithTime(
1242
1244
  timeLabel: format(new Date(run.timestamp), "MMM d, HH:mm:ss"),
1243
1245
  };
1244
1246
  })
1245
- .filter((v): v is { value: string; timeLabel: string } => v !== null);
1247
+ .filter(
1248
+ (v): v is { value: string; timeLabel: string } => v !== undefined,
1249
+ );
1246
1250
  }
1247
1251
  return context.buckets
1248
1252
  .map((bucket) => {
@@ -1259,5 +1263,5 @@ function getAllStringValuesWithTime(
1259
1263
  timeLabel: `${format(bucketStart, "MMM d, HH:mm")} - ${format(bucketEnd, "HH:mm")}`,
1260
1264
  };
1261
1265
  })
1262
- .filter((v): v is { value: string; timeLabel: string } => v !== null);
1266
+ .filter((v): v is { value: string; timeLabel: string } => v !== undefined);
1263
1267
  }
@@ -89,7 +89,8 @@ export const HealthCheckLatencyChart: React.FC<
89
89
  />
90
90
  <Tooltip<number, "latencyMs">
91
91
  content={({ active, payload }) => {
92
- if (!active || !payload?.length) return;
92
+ // eslint-disable-next-line unicorn/no-null -- recharts requires null return, not undefined
93
+ if (!active || !payload?.length) return null;
93
94
  const data = payload[0].payload as (typeof chartData)[number];
94
95
  const startTime = format(
95
96
  new Date(data.timestamp),
@@ -197,7 +198,8 @@ export const HealthCheckLatencyChart: React.FC<
197
198
  />
198
199
  <Tooltip<number, "latencyMs">
199
200
  content={({ active, payload }) => {
200
- if (!active || !payload?.length) return;
201
+ // eslint-disable-next-line unicorn/no-null -- recharts requires null return, not undefined
202
+ if (!active || !payload?.length) return null;
201
203
  const data = payload[0].payload as (typeof chartData)[number];
202
204
  return (
203
205
  <div