Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chakrihacker/babel-plugin-wrap-profiler

Babel Plugin that wraps profiler to each component in your code base
https://github.com/chakrihacker/babel-plugin-wrap-profiler

Last synced: 3 months ago
JSON representation

Babel Plugin that wraps profiler to each component in your code base

Awesome Lists containing this project

README

        

# babel-plugin-wrap-profiler

A Babel plugin that wraps components with [Profiler](https://reactjs.org/docs/profiler.html).

# Usage

## Install

For Yarn

```bash
yarn add -D babel-plugin-wrap-profiler
```

For npm

```bash
npm install --save-dev babel-plugin-wrap-profiler
```

## Configure Babel

```js
// In your .babelrc
{
"plugins": [
"babel-plugin-wrap-profiler"
]
}
```

## Log Profiler Results

```js
// In your code
import React from 'react';
import { logComponents } from "babel-plugin-wrap-profiler/lib/profiler-utils";

const Component = () => {
return (

Log Components

);
};
```

# Credits

- Thanks to [CoinBase](https://blog.coinbase.com/optimizing-react-native-7e7bf7ac3a34) for the inspiration.
- Jamie for [Babel plugin](https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/plugin-handbook.md) handbook