@@ -4,7 +4,6 @@ import { onCLS } from './web-vitals/getCLS';
44import { onINP } from './web-vitals/getINP' ;
55import { onLCP } from './web-vitals/getLCP' ;
66import { observe } from './web-vitals/lib/observe' ;
7- import { onFCP } from './web-vitals/onFCP' ;
87import { onTTFB } from './web-vitals/onTTFB' ;
98
109type InstrumentHandlerTypePerformanceObserver =
@@ -17,7 +16,7 @@ type InstrumentHandlerTypePerformanceObserver =
1716 // fist-input is still needed for INP
1817 | 'first-input' ;
1918
20- type InstrumentHandlerTypeMetric = 'cls' | 'lcp' | 'ttfb' | 'inp' | 'fcp' ;
19+ type InstrumentHandlerTypeMetric = 'cls' | 'lcp' | 'ttfb' | 'inp' ;
2120
2221// We provide this here manually instead of relying on a global, as this is not available in non-browser environements
2322// And we do not want to expose such types
@@ -115,8 +114,6 @@ let _previousCls: Metric | undefined;
115114let _previousLcp : Metric | undefined ;
116115let _previousTtfb : Metric | undefined ;
117116let _previousInp : Metric | undefined ;
118- let _previousFcp : Metric | undefined ;
119-
120117/**
121118 * Add a callback that will be triggered when a CLS metric is available.
122119 * Returns a cleanup callback which can be called to remove the instrumentation handler.
@@ -166,14 +163,6 @@ export function addInpInstrumentationHandler(callback: InstrumentationHandlerCal
166163 return addMetricObserver ( 'inp' , callback , instrumentInp , _previousInp ) ;
167164}
168165
169- /**
170- * Add a callback that will be triggered when a FCP metric is available.
171- * Returns a cleanup callback which can be called to remove the instrumentation handler.
172- */
173- export function addFcpInstrumentationHandler ( callback : ( data : { metric : Metric } ) => void ) : CleanupHandlerCallback {
174- return addMetricObserver ( 'fcp' , callback , instrumentFcp , _previousFcp ) ;
175- }
176-
177166export function addPerformanceInstrumentationHandler (
178167 type : 'event' ,
179168 callback : ( data : { entries : ( ( PerformanceEntry & { target ?: unknown | null } ) | PerformanceEventTiming ) [ ] } ) => void ,
@@ -269,15 +258,6 @@ function instrumentInp(): void {
269258 } ) ;
270259}
271260
272- function instrumentFcp ( ) : StopListening {
273- return onFCP ( metric => {
274- triggerHandlers ( 'fcp' , {
275- metric,
276- } ) ;
277- _previousFcp = metric ;
278- } ) ;
279- }
280-
281261function addMetricObserver (
282262 type : InstrumentHandlerTypeMetric ,
283263 callback : InstrumentHandlerCallback ,
0 commit comments