Skip to content

Commit f07e8a3

Browse files
lkuangPRlkuangAlt
andauthored
feat: deprecate endPaint, remove start and end apis (#248)
Co-authored-by: Lawrence Kuang <lawrence.kuang@coinbase.com>
1 parent a3b171a commit f07e8a3

File tree

3 files changed

+4
-36
lines changed

3 files changed

+4
-36
lines changed

Diff for: __tests__/steps/markStep.spec.ts

+1-15
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as log from '../../src/log';
77
import { metrics } from '../../src/metrics';
88
import * as observe from '../../src/observe';
99
import { visibility } from '../../src/onVisibilityChange';
10-
import { clear, end, endPaint, start } from '../../src/steps/markStep';
10+
import { clear, end, start } from '../../src/steps/markStep';
1111
import mock from './../_mock';
1212

1313
describe('Perfume', () => {
@@ -81,20 +81,6 @@ describe('Perfume', () => {
8181
});
8282
});
8383

84-
// TODO Fix this test or just deprecate by deprecating end()
85-
//describe('endPaint()', () => {
86-
// beforeEach(() => {
87-
// jest.useFakeTimers();
88-
// });
89-
//
90-
// it('should call end() after the first setTimeout', () => {
91-
// spy = jest.spyOn(perfume, 'end');
92-
// endPaint('test');
93-
// jest.runAllTimers();
94-
// expect(spy.mock.calls.length).toEqual(1);
95-
// });
96-
//});
97-
9884
describe('clear()', () => {
9985
beforeEach(() => {
10086
jest.useFakeTimers();

Diff for: src/perfume.ts

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
import { initPerfume } from './initPerfume';
22

3-
import { clear, end, endPaint, markStep, start } from './steps/markStep';
3+
import { clear, markStep } from './steps/markStep';
44
import { markStepOnce } from './steps/markStepOnce';
55
import { trackUJNavigation } from './steps/navigationSteps';
66

7-
export {
8-
clear,
9-
end,
10-
endPaint,
11-
initPerfume,
12-
markStep,
13-
markStepOnce,
14-
trackUJNavigation,
15-
start,
16-
};
7+
export { clear, initPerfume, markStep, markStepOnce, trackUJNavigation };

Diff for: src/steps/markStep.ts

+1-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const markStep = (mark: string) => {
2424
};
2525

2626
// --------------------- TMP Location Before Deprecation -----------------
27-
// For start(), end(), endPaint(), clear()
27+
// For start(), end(), clear()
2828

2929
/**
3030
* Start performance measurement
@@ -54,15 +54,6 @@ export const start = (markName: string): void => {
5454
}
5555
}
5656

57-
/**
58-
* End performance measurement after first paint from the beging of it
59-
*/
60-
export const endPaint = (markName: string, customProperties?: object): void => {
61-
setTimeout(() => {
62-
end(markName, customProperties);
63-
});
64-
}
65-
6657
/**
6758
* Removes the named mark from the browser's performance entry buffer.
6859
*/

0 commit comments

Comments
 (0)