What is @firebase/performance-compat?
The @firebase/performance-compat package is a compatibility wrapper around the @firebase/performance package, designed to work with the Firebase Performance Monitoring service. This service helps developers gain insight into the performance characteristics of their web and mobile applications by automatically collecting performance metrics. The compat version ensures compatibility with older Firebase codebases that use the Firebase namespace (firebase.*) rather than modular imports.
What are @firebase/performance-compat's main functionalities?
Automatic Web Performance Monitoring
Automatically collects performance metrics of web applications, such as network request speeds and page load details, without requiring manual instrumentation.
import 'firebase/performance-compat';
// Initialize Firebase Performance Monitoring
const performance = firebase.performance();
Manual Custom Tracing
Allows developers to manually define custom traces to measure performance of specific parts of their application code, providing flexibility in performance analysis.
import 'firebase/performance-compat';
// Initialize Firebase Performance Monitoring
const performance = firebase.performance();
// Start a custom trace
const trace = performance.trace('customTraceName');
trace.start();
// Stop the trace
trace.stop();
Other packages similar to @firebase/performance-compat
@sentry/browser
Sentry's browser package provides real-time error tracking and performance monitoring. While it focuses more on error reporting, it also offers performance insights, making it a broader tool compared to @firebase/performance-compat which is specifically tailored for performance metrics.
newrelic
New Relic offers a comprehensive cloud-based observability platform that includes performance monitoring. It supports detailed application performance insights across various programming environments, which is more extensive in scope compared to the Firebase-specific integration of @firebase/performance-compat.
@firebase/performance-compat
This is the compat package that recreates the v8 APIs.
This package is not intended for direct usage, and should only be used via the officially supported firebase package.