@@ -38,6 +38,7 @@ import {
38
38
import { name , version } from '../package.json' ;
39
39
import { Trace } from './resources/trace' ;
40
40
import '@firebase/installations-exp' ;
41
+ import { getModularInstance } from '@firebase/util' ;
41
42
42
43
const DEFAULT_ENTRY_NAME = '[DEFAULT]' ;
43
44
@@ -47,6 +48,7 @@ const DEFAULT_ENTRY_NAME = '[DEFAULT]';
47
48
* @public
48
49
*/
49
50
export function getPerformance ( app : FirebaseApp ) : FirebasePerformance {
51
+ app = getModularInstance ( app ) ;
50
52
const provider = _getProvider ( app , 'performance-exp' ) ;
51
53
const perfInstance = provider . getImmediate ( ) as PerformanceController ;
52
54
return perfInstance ;
@@ -62,6 +64,7 @@ export function initializePerformance(
62
64
app : FirebaseApp ,
63
65
settings ?: PerformanceSettings
64
66
) : FirebasePerformance {
67
+ app = getModularInstance ( app ) ;
65
68
const provider = _getProvider ( app , 'performance-exp' ) ;
66
69
67
70
// throw if an instance was already created.
@@ -86,6 +89,7 @@ export function trace(
86
89
performance : FirebasePerformance ,
87
90
name : string
88
91
) : PerformanceTrace {
92
+ performance = getModularInstance ( performance ) ;
89
93
return new Trace ( performance as PerformanceController , name ) ;
90
94
}
91
95
0 commit comments