Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

refactor: remove unused performance response types (#1268)

Goldflag4d4e8b8c3053
diff --git a/client/src/api/analytics/hooks/performance/useGetPerformanceByDimension.ts b/client/src/api/analytics/hooks/performance/useGetPerformanceByDimension.ts
index e5767f07c..4ac15a75c 100644
--- a/client/src/api/analytics/hooks/performance/useGetPerformanceByDimension.ts
+++ b/client/src/api/analytics/hooks/performance/useGetPerformanceByDimension.ts
@@ -1,14 +1,9 @@
import { Filter } from "@rybbit/shared";
import { UseQueryResult } from "@tanstack/react-query";
import { usePerformanceStore } from "../../../../app/[site]/performance/performanceStore";
-import { PaginatedPerformanceResponse, PerformanceByDimensionItem } from "../../endpoints";
+import { PaginatedPerformanceResponse } from "../../endpoints";
import { useAnalyticsQuery } from "../../useAnalyticsQuery";
-// Keep the old type for backward compatibility
-export type PerformanceByPathItem = PerformanceByDimensionItem & {
- pathname: string;
-};
-
type UseGetPerformanceByDimensionOptions = {
site: number | string;
dimension: string;
diff --git a/server/src/api/analytics/types.ts b/server/src/api/analytics/types.ts
index e88020514..13e62033c 100644
--- a/server/src/api/analytics/types.ts
+++ b/server/src/api/analytics/types.ts
@@ -16,12 +16,3 @@ export type PerformanceTimeSeriesPoint = {
} & {
[K in WebVitalMetric as `${K}_${PercentileLevel}`]: number | null;
};
-
-export type PerformanceByPathItem = {
- pathname: string;
- event_count: number;
-} & {
- [K in WebVitalMetric as `${K}_avg`]: number | null;
-} & {
- [K in WebVitalMetric as `${K}_${PercentileLevel}`]: number | null;
-};
diff --git a/shared/src/performance.ts b/shared/src/performance.ts
index faf8ea679..1103ccfbb 100644
--- a/shared/src/performance.ts
+++ b/shared/src/performance.ts
@@ -1,37 +1,2 @@
export type WebVitalMetric = "lcp" | "cls" | "inp" | "fcp" | "ttfb";
export type PercentileLevel = "p50" | "p75" | "p90" | "p99";
-
-export interface PerformanceOverviewMetrics {
- lcp: number;
- fcp: number;
- cls: number;
- inp: number;
- ttfb: number;
-}
-
-export interface PerformanceTimeSeriesPoint {
- time: string;
- p50: number;
- p75: number;
- p90: number;
- p99: number;
-}
-
-export interface PerformanceByPathItem {
- path: string;
- page_title: string;
- sample_count: number;
- p50: number;
- p75: number;
- p90: number;
- p99: number;
-}
-
-export interface PerformanceByDimensionItem {
- dimension: string;
- page_count: number;
- p50: number;
- p75: number;
- p90: number;
- p99: number;
-}
\ No newline at end of file