Skip to content

Commit fe28e7c

Browse files
committed
refactor(browser): Rename bfcacheMetricsIntegration to bfcacheIntegration
Name the integration after what it observes, consistent with webVitalsIntegration and the rest of the integration exports. bfcache is the platform term, spelled lowercase as one word.
1 parent 1fb7211 commit fe28e7c

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Work in this release was contributed by @psh4607, @trinitiwowka, @nehaprasad-dev
1313
- `DenoMongoose` => `Mongoose`
1414
- `DenoMysql` => `Mysql`
1515
- `DenoPostgres` => `Postgres`
16-
- **feat(browser): Add `bfcacheMetricsIntegration` to track back/forward cache health**
16+
- **feat(browser): Add `bfcacheIntegration` to track back/forward cache health**
1717

18-
The new opt-in `bfcacheMetricsIntegration` emits metrics about browser back/forward cache (bfcache) navigations, so you can
18+
The new opt-in `bfcacheIntegration` emits metrics about browser back/forward cache (bfcache) navigations, so you can
1919
measure how often back-button navigation is instant and what's blocking it.
2020

2121
```js
2222
Sentry.init({
23-
integrations: [Sentry.bfcacheMetricsIntegration()],
23+
integrations: [Sentry.bfcacheIntegration()],
2424
});
2525
```
2626

‎dev-packages/e2e-tests/test-applications/browser-bfcache/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# browser-bfcache
22

3-
Exercises `bfcacheMetricsIntegration` against a **real** browser back/forward cache, covering hits,
3+
Exercises `bfcacheIntegration` against a **real** browser back/forward cache, covering hits,
44
misses, and the real `notRestoredReasons` the browser reports (Chromium-only, and this app is
55
Chromium). Deliberately bfcache-ineligible pages are produced via `?botch=<case>` (see `src/main.ts`).
66

‎dev-packages/e2e-tests/test-applications/browser-bfcache/src/main.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as Sentry from '@sentry/browser';
22

33
Sentry.init({
44
dsn: process.env.E2E_TEST_DSN,
5-
integrations: [Sentry.bfcacheMetricsIntegration()],
5+
integrations: [Sentry.bfcacheIntegration()],
66
release: 'e2e-test',
77
environment: 'qa',
88
tunnel: 'http://localhost:3031',

‎packages/browser/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export { spanStreamingIntegration } from './integrations/spanstreaming';
4949
export { fetchStreamPerformanceIntegration } from './integrations/fetchStreamPerformance';
5050
export { webVitalsIntegration } from './integrations/webVitals';
5151
export { userTimingIntegration } from './integrations/usertiming';
52-
export { bfcacheMetricsIntegration } from './integrations/bfcache';
52+
export { bfcacheIntegration } from './integrations/bfcache';
5353

5454
export type { RequestInstrumentationOptions } from './tracing/request';
5555
export {

‎packages/browser/src/integrations/bfcache.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { debug, defineIntegration, getCurrentScope, metrics } from '@sentry/core
44
import { DEBUG_BUILD } from '../debug-build';
55
import { WINDOW } from '../helpers';
66

7-
const INTEGRATION_NAME = 'BFCacheMetrics';
7+
const INTEGRATION_NAME = 'BFCache';
88

99
type BFCacheOutcome = 'hit' | 'miss';
1010

@@ -41,7 +41,7 @@ interface CollectedReason {
4141
/**
4242
* Captures bfcache hit/miss counters and Chromium notRestoredReasons when available.
4343
*/
44-
export const bfcacheMetricsIntegration = defineIntegration((options: Partial<BFCacheIntegrationOptions> = {}) => {
44+
export const bfcacheIntegration = defineIntegration((options: Partial<BFCacheIntegrationOptions> = {}) => {
4545
const maxReasons = _resolveMaxReasons(options.maxReasons);
4646

4747
return {

‎packages/browser/test/integrations/bfcache.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
22
import { debug } from '@sentry/core/browser';
33
import { _collectNotRestoredReasons, _resolveMaxReasons } from '../../src/integrations/bfcache';
44

5-
describe('bfcacheMetricsIntegration', () => {
5+
describe('bfcacheIntegration', () => {
66
describe('_resolveMaxReasons', () => {
77
afterEach(() => {
88
vi.restoreAllMocks();

0 commit comments

Comments
 (0)