Skip to content

Commit ef7ca63

Browse files
committed
implement interop API for perf-exp
1 parent 21b25b0 commit ef7ca63

File tree

1 file changed

+4
-0
lines changed
  • packages-exp/performance-exp/src

1 file changed

+4
-0
lines changed

packages-exp/performance-exp/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
import { name, version } from '../package.json';
3939
import { Trace } from './resources/trace';
4040
import '@firebase/installations-exp';
41+
import { getModularInstance } from '@firebase/util';
4142

4243
const DEFAULT_ENTRY_NAME = '[DEFAULT]';
4344

@@ -47,6 +48,7 @@ const DEFAULT_ENTRY_NAME = '[DEFAULT]';
4748
* @public
4849
*/
4950
export function getPerformance(app: FirebaseApp): FirebasePerformance {
51+
app = getModularInstance(app);
5052
const provider = _getProvider(app, 'performance-exp');
5153
const perfInstance = provider.getImmediate() as PerformanceController;
5254
return perfInstance;
@@ -62,6 +64,7 @@ export function initializePerformance(
6264
app: FirebaseApp,
6365
settings?: PerformanceSettings
6466
): FirebasePerformance {
67+
app = getModularInstance(app);
6568
const provider = _getProvider(app, 'performance-exp');
6669

6770
// throw if an instance was already created.
@@ -86,6 +89,7 @@ export function trace(
8689
performance: FirebasePerformance,
8790
name: string
8891
): PerformanceTrace {
92+
performance = getModularInstance(performance);
8993
return new Trace(performance as PerformanceController, name);
9094
}
9195

0 commit comments

Comments
 (0)