redux-user-timing is a Redux middleware designed to integrate Redux action dispatching with the browser's User Timing API, enabling performance profiling of Redux applications within tools like Chrome DevTools. The current stable version is `1.0.2`, released in January 2019. The package has seen no significant updates or active development since then, indicating a maintenance state. Its primary differentiator is its straightforward approach to leveraging a native browser API (`performance.mark()` and `performance.measure()`) for performance measurement, specifically marking Redux action lifecycles. It is explicitly intended for development environments only and does not provide advanced profiling features beyond basic action timing.
npm install redux-user-timingVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to configure a Redux store with `redux-user-timing` middleware, ensuring it's only active in non-production environments for performance profiling.
Wrap middleware application with `if (process.env.NODE_ENV !== 'production') { middlewares.push(userTiming); }` as shown in the quickstart.Thoroughly test with your specific Redux and React versions. Consider alternative, actively maintained performance profiling tools if encountering issues.
Ensure you are using `import userTiming from 'redux-user-timing';` for ESM or `const userTiming = require('redux-user-timing');` for CommonJS.This middleware is designed for browser environments. Ensure it runs in a modern browser context. If running in Node for server-side rendering, conditionally apply it only on the client or mock the performance API.