React features to enhance using Rollbar.js in React Applications

Related tags

React rollbar-react
Overview

Rollbar React SDK

React features to enhance using Rollbar.js in React Applications.

This SDK provides a wrapper around the base Rollbar.js SDK in order to provide an SDK that matches the intention of how to build React Apps with a declarative API, features for the latest React API like hooks and ErrorBoundaries, as well as simplify using Rollbar within a React SPA.

In Beta

It is currently in a public Beta release right now as we push towards a 1.0 release that will have all of the features we want to provide full capability for using React SDK in your production apps. We expect a 1.0 release to come in the next month.

Setup Instructions

Prerequisites

These instructions provide an addendum to the Rollbar.js Setup Instructions.

After following those 2 steps, you will be ready.

Install Rollbar React SDK

To install with npm:

npm install @rollbar/react

To install with yarn:

yarn add @rollbar/react

To install by adding to package.json, add the following to your project's package.json file:

"dependencies": {
    "@rollbar/react": "^0.8.0",
    
  }
  …

then run either using npm or yarn (or other package manager):

npm install
# OR
yarn install

Usage and Reference

The React SDK is very new and has not been given the full documentation treatment we expect to get from Rollbar Docs, but that will be coming shortly and a direct link will be put here for your reference.

In the meantime, the basic usage reference is available below.

Simplest Usage Possible

To get you started quickly, here is an example that will get you started right away by providing the easiest and simplest usage possible:

import React from 'react';
import { Provider, ErrorBoundary } from '@rollbar/react'; // <-- Provider imports 'rollbar' for us

// same configuration you would create for the Rollbar.js SDK
const rollbarConfig = {
  accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN',
  environment: 'production',
};

export default function App() {
  return (
    {/* Provider instantiates Rollbar client instance handling any uncaught errors or unhandled promises in the browser */}
    <Provider config={rollbarConfig}>
      {/* ErrorBoundary catches all React errors in the tree below and logs them to Rollbar */}
      <ErrorBoundary>
        // all other app providers and components - Rollbar will just work
        
      </ErrorBoundary>
    </Provider>
  );
};

Components

The following components are available as named imports from @rollbar/react.

Provider Component

The Provider component is used to wrap your React App so an instance of Rollbar will be made available within your React tree.

This is a common pattern in React using a custom React Context that is available to the Components and hooks from this SDK library.

Configuration Only Usage

The simplest way to use the Provider is to provide a configuration as the config prop which will instantiate an instance of Rollbar for you and provide that to its child tree:

import React from 'react';
import { Provider } from '@rollbar/react';

// same configuration you would create for the Rollbar.js SDK
const rollbarConfig = {
  accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN',
  environment: 'production',
};

export function App(props) {
  return (
    <Provider config={rollbarConfig}></Provider>
  );
}

Instance Usage

Sometimes you may need to instantiate an instance of Rollbar before adding it to your App tree. In that case use the instance prop to pass it to the Provider like this:

import React from 'react';
import Rollbar from 'rollbar';
import { Provider } from '@rollbar/react';

// same configuration you would create for the Rollbar.js SDK
const rollbarConfig = {
  accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN',
  environment: 'production',
};

const rollbar = new Rollbar(rollbarConfig);

export function App(props) {
  return (
    <Provider instance={rollbar}></Provider>
  );
}

This method will also work with the global Rollbar instance when using the Rollbar.init(…) method.

React Native Usage

Rollbar provides a React Native SDK which also wraps the Rollbar.js to provide React Native capabilities based on that specific environment.

To use the Rollbar React SDK with the React Native SDK, pass the instance that it generates to the Provider's instance prop, like this:

import React from 'react';
import { Client } from 'rollbar-react-native';
import { Provider } from '@rollbar/react';

const rollbarClient = new Client('POST_CLIENT_ITEM_ACCESS_TOKEN');

export function App(props) {
  return (
    <Provider instance={rollbarClient.rollbar}></Provider>
  );
}

ErrorBoundary Component

Rollbar's React SDK provides a new ErrorBoundary component which implements the interface for React's Error Boundaries introduced in React 16.

The ErrorBoundary is used to wrap any tree or subtree in your React App to catch React Errors and log them to Rollbar automatically.

The ErrorBoundary relies on the Provider above for the instance of Rollbar, so it will utilize whatever configuration has been provided.

Simple Usage

You can add an ErrorBoundary component to the top of your tree right after the Provider with no additional props and it will just work:

import React from 'react';
import { Provider, ErrorBoundary } from '@rollbar/react';

// same configuration you would create for the Rollbar.js SDK
const rollbarConfig = {
  accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN',
  environment: 'production',
};

export function App(props) {
  return (
    <Provider config={rollbarConfig}>
      <ErrorBoundary></ErrorBoundary>
    </Provider>
  );
}

Pass props to control behavior

The ErrorBoundary provides several props that allow customizing the behavior of how it will report errors to Rollbar.

These props take either a value or a function that will be invoked with the error and info from the Error Boundaries API's componentDidCatch method (i.e. signature is (error, info)).

import React from 'react';
import { Provider, ErrorBoundary, LEVEL_WARN } from '@rollbar/react';

// same configuration you would create for the Rollbar.js SDK
const rollbarConfig = {
  accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN',
  environment: 'production',
};

export function App(props) {
  return (
    <Provider config={rollbarConfig}>
      <ErrorBoundary level={LEVEL_WARN} errorMessage="Error in React render" extra={(error, info) => info.componentStack.includes('Experimental') ? { experiment: true } : {} }></ErrorBoundary>
    </Provider>
  );
}

Pass a Fallback UI

You may also include a Fallback UI to render when the error occurs so that the User does not experience a broken/blank UI caused during the render cycle of React.

Like the other props it can accept a value that is a React Component or a function that returns a React Component with the same signature (error, info).

import React from 'react';
import { Provider, ErrorBoundary, LEVEL_WARN } from '@rollbar/react';

// same configuration you would create for the Rollbar.js SDK
const rollbarConfig = {
  accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN',
  environment: 'production',
};

const ErrorDisplay = ({ error, resetError }) => ( // <-- props passed to fallbackUI component
  <div></div>
);

export function App(props) {
  return (
    <Provider config={rollbarConfig}>
      <ErrorBoundary level={LEVEL_WARN} fallbackUI={ErrorDisplay}></ErrorBoundary>
    </Provider>
  );
}

RollbarContext Component

Use the RollbarContext component to declaratively set the context value used by Rollbar.js when it's sending any messages to Rollbar.

This works for your ErrorBoundary from above or any other log or message sent to Rollbar while the RollbarContext is mounted on the tree.

Like ErrorBoundary above, RollbarContext relies on a Provider for an instance of a Rollbar.js client.

Basic Usage

To use the RollbarContext you must provide the context prop, a String that is used to set the context used by Rollbar.js to the value while mounted.

import React from 'react';
import { RollbarContext } from '@rollbar/react';

function HomePage() {
  return (
    <RollbarContext context="home"></RollbarContext>
  )
}

Using with React Router

It's useful to set the context in Rollbar associated with areas of your application. On the server it's usually set when a specific page is requested. For SPAs like React Apps, using RollbarContext with your Router is one way to achieve the same result.

Here is an example of using RollbarContext with [React Router] if you have a top level set of routes:

import React from 'react';
import { Router, Switch, Route } from 'react-router-dom';
import { RollbarContext } from '@rollbar/react';
import { About, ContactDetails, ContactsList } from './pages';

const Routes = () => (
  <Router>
    <Switch>
      <Route path="/about">
        <RollbarContext context="/about">
          <About />
        </RollbarContext>
      </Route>
      <Route path="/contacts/:id">
        <RollbarContext context="contacts/details">
          <ContactDetails />
        </RollbarContext>
      </Route>
      <Route path="/contacts">
        <RollbarContext context="contacts">
          <ContactsList />
        </RollbarContext>
      </Route>
    </Switch>
  </Router>
)

export default Routes;

Here's another example of using RollbarContext within a component that manages its own route:

import React from 'react';
import { Route } from 'react-router-dom';
import { RollbarContext } from '@rollbar/react';

export default function About(props) {
  return (
    <Route path="/about">
      <RollbarContext context="/about"></RollbarContext>
    </Route>
  )
}

Functions

The following functions are available as named imports from @rollbar/react.

historyContext to create history.listener

A lot of SPAs and React Apps will use the history package to handle browser history. The historyContext function is a helper that creates a valid listener function to receive history changes and use those to change the Rollbar.js context.

historyContext is a factory function used to create a proper history.listen callback that will work for v4 and v5 of the history package.

Basic historyContext usage

The historyContext factory function requires an instance of Rollbar.js to wrap in order to create the listener callback function.

By default, if no options (see below) are provided, all history updates will update the context for Rollbar using the location.pathname as the value.

import Rollbar from 'rollbar';
import { createBrowserHistory } from 'history';
import { Provider } from '@rollbar/react';

// same configuration you would create for the Rollbar.js SDK
const rollbarConfig = {
  accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN',
  environment: 'production',
};

const rollbar = new Rollbar(rollbarConfig);

const history = createBrowserHistory();

history.listen(historyContext(rollbar));

Controlling historyContext behavior with options

The historyContext factory function accepts options as a 2nd argument that allow you to control the behavior of how and when the context will be set for the Rollbar.js client.

Use the formatter option to provide a function that will receive the history change event and return a String that you would like to be set as the context for Rollbar.

The signature is formatter(location, action): String where location is history.location and action is history.action.

The other option is filter which you can provide to tell the historyContext listener you create to control which history updates will change the context for Rollbar. All truthy values will tell the listener to make the change. Any falsy values will skip the update.

The signature is filter(location, action): Boolean where location is history.location and action is history.action.

Here's an example of using both:

import Rollbar from 'rollbar';
import { createBrowserHistory } from 'history';
import { Provider } from '@rollbar/react';

// same configuration you would create for the Rollbar.js SDK
const rollbarConfig = {
  accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN',
  environment: 'production',
};

const rollbar = new Rollbar(rollbarConfig);

const ROUTE_PARAMS_RE = /\/\d+/g;

const historyListener = historyContext(rollbar, {
  // optional: default uses location.pathname
  formatter: (location, action) => location.pathname.replace(ROUTE_PARAMS_RE, ''),
  // optional: true return sets Rollbar context
  filter: (location, action) => !location.pathname.includes('admin'),
});
const unlisten = history.listen(historyListener);

Hooks

The following hooks are available as named imports from @rollbar/react for use in Functional Components making use of the React Hooks API introduced in React 16.8.

Reliance on Provider

All of these hooks below require there to be a Provider in the React Tree as an ancestor to the component using the hook.

useRollbar hook

To consume the Rollbar.js instance directly from the Provider in your React Tree and make use of the client API within your [Functional Component], use the useRollbar hook which will return the instance from the currently scoped React Context.

Here is a basic example:

import { useRollbar } from '@rollbar/react';

function ContactDetails({ contactId }) {
  const rollbar = useRollbar(); // <-- must have parent Provider
  const [contact, setContact] = useState();

  useEffect(async () => {
    try {
      const { data } = await getContactFromApi(contactId);
      setContact(data.contact);
    } catch (error) {
      rollbar.error('Error fetching contact', error, { contactId });
    }
  }, [contactId]);

  return (
    <div></div>
  );
}

useRollbarContext hook

As an alternative to the RollbarContext component, you can use the useRollbarContext hook in your [Functional Component] to set the context in the Rollbar.js client provided by the Provider above in the React Tree.

Here's an example of using it in several components:

// src/pages/HomePage.js
import { useRollbarContext } from '@rollbar/react';

function HomePage(props) {
  useRollbarContext('home#index');

  return (
    <div></div>
  );
}

// src/pages/UsersPage.js
import { useRollbarContext } from '@rollbar/react';
import UserTable from '../components/users/UserTable';

function UsersPage(props) {
  useRollbarContext('users#list');

  return (
    <UserTable data={props.users} />
  );
}

// src/pages/UserDetailsPage.js
import { useRollbarContext } from '@rollbar/react';
import UserDetails from '../components/users/UserDetails';

function UserDetailsPage(props) {
  useRollbarContext('users#details');

  return (
    <UserDetails user={props.user} />
  );
}

useRollbarPerson hook

It's very usefull in Rollbar to log the identity of a person or user using your App for 2 major reasons:

  1. It allows you to know exactly who has been affected by an item or error in your App
  2. It allows Rollbar to tell you the impact a given item or error is having on your users

To make it convenient and easy to set the identity of a person in your React App, the @rollbar/react package has the userRollbarPerson hook.

To use it, simply pass an Object that has keys and values used to identify an individual user of your App, and for any future events or messages logged to Rollbar will include that person data attached to the log.

Here is a simple example of using it once the current user has been determined:

import { useState } from 'react';
import { useRollbarPerson } from '@rollbar/react';
import LoggedInHome  from './LoggedInHome';
import LoggedOutHome from './LoggedOutHome';

function Home() {
  const [currentUser, setCurrentUser] = useState();

  useEffect(async () => {
    const user = await Auth.getCurrentUser();
    if (user) {
      useRollbarPerson(user);
    }
    setCurrentUser(user);
  });

  if (currentUser != null) {
    return <LoggedInHome />;
  }

  return <LoggedOutHome />;
}

useRollbarCaptureEvent hook

Rollbar.js already provides automated Telemetry with the default configuration autoInstrument: true in the client which will capture useful telemetry events and data for you.

To provide more breadcrumbs useful for identifying the cause of an item or error, you can add your own capture events that will be included in the Telemetry of an item in Rollbar with the useRollbarCaptureEvent hook.

The useRollbarCaptureEvent hook is designed to capture a new event in your [Functional Component] any time the metadata or level you provide to the hook changes. On rerenders, no event is captured if there is not a change to the references provided to those 2 arguments (utilizing the dependencies array arg underneath within the call to the built-in React useEffect hook).

Here is an example of using useRollbarCaptureEvent in the render cycle of a [Functional Component] to send a telemetry event related to the data that will be rendered in the component

import { useEffect, useState } from 'react';
import { useRollbar, useRollbarCaptureEvent, LEVEL_INFO } from '@rollbar/react';

function BookDetails({ bookId }) {
  const rollbar = useRollbar(); // <-- must have ancestor Provider, same with useRollbarCaptureEvent
  const [book, setBook] = useState();

  useEffect(async () => {
    try {
      const { data } = await getBook(bookId);
      setBook(data.book);
    } catch (error) {
      rollbar.error('Error fetching book', error, { bookId }); // <-- use rollbar to log errors as normal
    }
  }, [bookId]);

  useRollbarCaptureEvent(book, LEVEL_INFO); // <-- only fires when book changes

  return (
    <div></div>
  )
}
Comments
  • App Crashing whenever attempting simple usage of `RollbarContext`

    App Crashing whenever attempting simple usage of `RollbarContext`

    Hello all,

    I am working on my initial rollbar integration, so I apologise if this is just a silly misunderstanding or if this is the incorrect forum.

    I was looking to give my rollbar errors more context by route in my react app. I started adding RollbarContext wrappers with simple context strings in them to the routes, but I was getting an error whenever I navigated to these routes.

    Below, I have an example of the simplest possible usage of this with our react app. It is in the root component, wrapping all of the routes, inside a correctly initialized Provider. ( I am 100% sure that the provider is initialized correctly) It gives the error from the following screenshot now whenever I open the app.


    Screen Shot 2021-11-11 at 2 41 49 PM Screen Shot 2021-11-11 at 2 44 21 PM

    Anybody here have any insight as to what I may be doing incorrectly here?

    Thank you so much for your help!

    bug 
    opened by JackCurrie 7
  • React Hook

    React Hook "useRollbarPerson" cannot be called inside a callback

    Hi, I am trying to utilize the useRollbarPerson following the example provided in the documentation. I run into the following build error (the project uses Next.js with TypeScript), though:

    Error: React Hook "useRollbarPerson" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.  react-hooks/rules-of-hooks
    

    I assume this is a combination of the function name starting with use and it not being used in the function component itself. I am trying to use the function, as the example in the documentation here does, within a useEffect hook.

    Is there maybe a proposed way around this issue? Or should this function possibly be renamed (e.g., setRollbarPerson)?

    opened by ErikCoup 6
  • fix: bugs related to fallbackUI

    fix: bugs related to fallbackUI

    Description of the change

    This PR fixes some bugs related to fallbackUI

    1. It was possible to pass a rendered element like this:
    <ErrorBoundary level={LEVEL_WARN} fallbackUI={<FallbackComponent />}>
    

    which would cause an error ( issue #19 ) caused by this line of code: https://github.com/rollbar/rollbar-react/blob/main/src/error-boundary.js#L66 I think there was a misunderstanding of React.isValidElement(). It checks if a thing passed to it is an element (a result of rendering a component) not a component (function or a class with render method). <FallbackComponent /> passes React.isValidElement() but the line mentioned above tries to render it again, hence the error. What is more react doesn't like lowercase names for components, also used in line 66. I think an option of passing already rendered element doesn't bring any benefit over passing a functional component. Such an option wasn't also mentioned in the docs.

    1. It was not possible to properly pass a regular react component as fallbackUI as the docs suggested.
    • a functional react component which takes an object with props as its keys: const FallbackComponent = ({error, resetError}) => <div>error</div>
    • a class component also wouldn't work properly The problem was that both those things are of a type function and would go through this line: https://github.com/rollbar/rollbar-react/blob/main/src/error-boundary.js#L70 It would pass the props as positional arguments, not as a props object, resulting with a component with a regular signature ({error, resetError}) destructuring both the props as undefined. The generator function also mentioned in the docs worked, but that's practically the same as a functional component. The difference is that a component takes params in an object ({error, resetError}) when a generator mentioned in the docs skips the object part (error, resetError). After the changes users will also be able to use class components as fallbackUI. WARNING: Dropping the option of passing a generator function is a breaking change.

    Type of change

    • [ ] Bug fix (non-breaking change that fixes an issue)
    • [ ] New feature (non-breaking change that adds functionality)
    • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] Maintenance
    • [ ] New release

    Related issues

    • Fix #19

    Checklists

    Development

    • [ ] Lint rules pass locally
    • [ ] The code changed/added as part of this pull request has been covered with tests
    • [ ] All tests related to the changed code pass in development

    Code review

    • [ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
    • [ ] "Ready for review" label attached to the PR and reviewers assigned
    • [ ] Issue from task tracker has a link to this pull request
    • [ ] Changes have been reviewed by at least one other engineer
    opened by EmEsA 5
  • Add children to the props for @types/react@18

    Add children to the props for @types/react@18

    In relation to React props should not do anything special with children and DefinitelyTyped have updated the react types to v18

    https://github.com/DefinitelyTyped/DefinitelyTyped/issues/59802

    opened by ChromeQ 4
  • Failed to compile

    Failed to compile

    Hello, While compiling there is a error message :

    Failed to compile.
    ./node_modules/@rollbar/react/dist/index.js
    Module not found: Can't resolve 'rollbar' in 'blablabla/node_modules/@rollbar/react/dist'
    
    opened by maximefontanille 4
  • Buggy behavior in Next.js app when hostSafeList is set in rollbar config

    Buggy behavior in Next.js app when hostSafeList is set in rollbar config

    We discovered a weird behavior happening when using the ErrorBoundary component in a next.js app with the hostSafeList property set in the rollbar config.

    we have a simple app set up as follows:

    // _app.tsx
    <RollbarProvider instance={rollbar}>
      <ErrorBoundary>
      // other providers and app components
        <Component {...pageProps} />
      </ErrorBoundary>
     </RollbarProvider>
    

    This doesn’t seem to be working the way we expect (at least we suspect that). If we call rollbar.error explicitly from our application we see the error making it all the way to rollbar as expected. However, if we go into a component in our component tree and throw an exception, we do not see that being sent to rollbar. This is how we are throwing the error in said component:

    // in a component down in the tree
     useEffect(() => {
        // rollbar.error('testing rollbar') this works
        throw new Error('testing rollbar uncaught') // this doesn't work
      })
    

    This is what our instance config looks like:

    {
      accessToken: process.env.NEXT_PUBLIC_ROLLBAR_TOKEN,
      hostSafeList: [
        'mydomain.com',
        'subdomain.mydomain.com'
      ],
      captureUncaught: true,
      captureUnhandledRejections: true,
      environment: process.env.NEXT_PUBLIC_APP_ENV,
      payload: {
        environment: process.env.NEXT_PUBLIC_APP_ENV,
        client: {
          javascript: {
            source_map_enabled: true,
            code_version: process.env.NEXT_PUBLIC_CIRCLE_SHA1,
            guess_uncaught_frames: true
          }
        }
      },
      scrubFields: [
        'first_name',
        'last_name',
        'full_name',
        'phone',
        'email',
        'firstName',
        'lastName',
        'fullName',
        'address',
        'street_address',
        'streetAddress'
      ]
    }
    

    We expected to see those thrown errors sent to rollbar but that is not happening. As soon as you remove the hostSafeList property from the config it works as expected. Not sure why this might be happening, will continue to investigate and report here if we find what the issue is.

    opened by DanielPe05 3
  • Errors not reported in some circumstances

    Errors not reported in some circumstances

    Description

    When using the ErrorBoundary there are errors reported to the console which do not seem to be reported to Rollbar properly.

    Steps to recreate

    1. Create a new app using create react app
    2. install @rollbar/react and rollbar
    3. Update the app.js file to the following
    import { Provider as RollbarProvider, ErrorBoundary } from "@rollbar/react";
    
    import "./App.css";
    
    const rollbarConfig = {
      accessToken:  <Put a project key in here>,
      captureUncaught: true,
      captureUnhandledRejections: true,
      payload: {
        environment: `dev`,
      },
    };
    
    function ErrorFallback() {
      return <div>Oops</div>;
    }
    
    function App() {
      return (
        <RollbarProvider config={rollbarConfig}>
          <ErrorBoundary fallbackUI={ErrorFallback}>{undefined}</ErrorBoundary>
        </RollbarProvider>
      );
    }
    
    export default App;
    
    1. Start the app up

    Note now that the error caused by trying to render undefined appears in the console, but does not appear in the rollbar project

    bug 
    opened by mudetroit 3
  • feat: Add basic TypeScript types

    feat: Add basic TypeScript types

    Description of the change

    I do not expect these to be completely accurate. However, they should be a decent starting point for further discussion!

    Type of change

    • [ ] Bug fix (non-breaking change that fixes an issue)
    • [x] New feature (non-breaking change that adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] Maintenance
    • [ ] New release

    Related issues

    Shortcut stories and GitHub issues (delete irrelevant)

    • #7

    Checklists

    Development

    • [ ] Lint rules pass locally
    • [ ] The code changed/added as part of this pull request has been covered with tests
    • [ ] All tests related to the changed code pass in development

    Code review

    • [ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
    • [ ] "Ready for review" label attached to the PR and reviewers assigned
    • [ ] Issue from task tracker has a link to this pull request
    • [ ] Changes have been reviewed by at least one other engineer
    opened by quinnturner 3
  • Typescript Types not available in npm package

    Typescript Types not available in npm package

    Looks like some types were included in v0.9.0 but when I install via npm install @rollbar/react then the correct version is installed but types are still missing.

    I think the index.d.ts is not included in the package: image

    So the types are not available in the code:

    error TS7016: Could not find a declaration file for module '@rollbar/react'. '.../node_modules/@rollbar/react/lib/index.js' implicitly has an 'any' type.
      Try `npm i --save-dev @types/rollbar__react` if it exists or add a new declaration (.d.ts) file containing `declare module '@rollbar/react';`
    
    8 import { Provider as RollbarProvider, ErrorBoundary as RollbarErrorBoundary } from '@rollbar/react';
    
    opened by ChromeQ 2
  • Release v0.9.0

    Release v0.9.0

    Description of the change

    Release v0.9.0 version update.

    Type of change

    • [ ] Bug fix (non-breaking change that fixes an issue)
    • [ ] New feature (non-breaking change that adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] Maintenance
    • [x] New release

    Development

    • [ ] Lint rules pass locally
    • [ ] The code changed/added as part of this pull request has been covered with tests
    • [ ] All tests related to the changed code pass in development

    Code review

    • [ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
    • [ ] "Ready for review" label attached to the PR and reviewers assigned
    • [ ] Issue from task tracker has a link to this pull request
    • [ ] Changes have been reviewed by at least one other engineer
    opened by waltjones 2
  • fix: Add typings to Provider

    fix: Add typings to Provider

    Description of the change

    Adds TypeScript types to Provider

    Type of change

    • [x] Bug fix (non-breaking change that fixes an issue)
    • [ ] New feature (non-breaking change that adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [ ] Maintenance
    • [ ] New release

    Related issues

    Related: https://github.com/rollbar/rollbar-react/pull/26#issuecomment-1021555470

    opened by quinnturner 2
  • build(deps): bump json5 from 2.2.0 to 2.2.3

    build(deps): bump json5 from 2.2.0 to 2.2.3

    Bumps json5 from 2.2.0 to 2.2.3.

    Release notes

    Sourced from json5's releases.

    v2.2.3

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)
    Changelog

    Sourced from json5's changelog.

    v2.2.3 [code, diff]

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1 [code, diff]

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)
    Commits
    • c3a7524 2.2.3
    • 94fd06d docs: update CHANGELOG for v2.2.3
    • 3b8cebf docs(security): use GitHub security advisories
    • f0fd9e1 docs: publish a security policy
    • 6a91a05 docs(template): bug -> bug report
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • build(deps): bump json5 and react-scripts in /examples/typescript

    build(deps): bump json5 and react-scripts in /examples/typescript

    Bumps json5 to 2.2.3 and updates ancestor dependency react-scripts. These dependencies need to be updated together.

    Updates json5 from 1.0.1 to 2.2.3

    Release notes

    Sourced from json5's releases.

    v2.2.3

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

    v2.1.3 [code, diff]

    • Fix: An out of memory bug when parsing numbers has been fixed. (#228, #229)

    v2.1.2

    • Fix: Bump minimist to v1.2.5. (#222)

    v2.1.1

    • New: package.json and package.json5 include a module property so bundlers like webpack, rollup and parcel can take advantage of the ES Module build. (#208)
    • Fix: stringify outputs \0 as \\x00 when followed by a digit. (#210)
    • Fix: Spelling mistakes have been fixed. (#196)

    v2.1.0

    • New: The index.mjs and index.min.mjs browser builds in the dist directory support ES6 modules. (#187)

    v2.0.1

    • Fix: The browser builds in the dist directory support ES5. (#182)

    v2.0.0

    • Major: JSON5 officially supports Node.js v6 and later. Support for Node.js v4 has been dropped. Since Node.js v6 supports ES5 features, the code has been rewritten in native ES5, and the dependence on Babel has been eliminated.

    • New: Support for Unicode 10 has been added.

    • New: The test framework has been migrated from Mocha to Tap.

    • New: The browser build at dist/index.js is no longer minified by default. A minified version is available at dist/index.min.js. (#181)

    • Fix: The warning has been made clearer when line and paragraph separators are

    ... (truncated)

    Changelog

    Sourced from json5's changelog.

    v2.2.3 [code, diff]

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).

    v2.2.1 [code, diff]

    • Fix: Removed dependence on minimist to patch CVE-2021-44906. (#266)

    v2.2.0 [code, diff]

    • New: Accurate and documented TypeScript declarations are now included. There is no need to install @types/json5. (#236, #244)

    v2.1.3 [code, diff]

    • Fix: An out of memory bug when parsing numbers has been fixed. (#228, #229)

    v2.1.2 [code, diff]

    • Fix: Bump minimist to v1.2.5. (#222)

    v2.1.1 [code, [diff][d2.1.1]]

    ... (truncated)

    Commits
    • c3a7524 2.2.3
    • 94fd06d docs: update CHANGELOG for v2.2.3
    • 3b8cebf docs(security): use GitHub security advisories
    • f0fd9e1 docs: publish a security policy
    • 6a91a05 docs(template): bug -> bug report
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • Additional commits viewable in compare view

    Updates react-scripts from 4.0.3 to 5.0.1

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Add keywords and more detailed description to package.json

    Add keywords and more detailed description to package.json

    Description of the change

    Improve search ranking

    Type of change

    • [ ] Bug fix (non-breaking change that fixes an issue)
    • [ ] New feature (non-breaking change that adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • [x] Maintenance
    • [ ] New release

    Development

    • [ ] Lint rules pass locally
    • [ ] The code changed/added as part of this pull request has been covered with tests
    • [ ] All tests related to the changed code pass in development

    Code review

    • [ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
    • [ ] "Ready for review" label attached to the PR and reviewers assigned
    • [ ] Issue from task tracker has a link to this pull request
    • [ ] Changes have been reviewed by at least one other engineer
    opened by paulserraino 0
  • build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 in /examples/typescript

    build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 in /examples/typescript

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 in /examples/create-react-app

    build(deps): bump decode-uri-component from 0.2.0 to 0.2.2 in /examples/create-react-app

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • build(deps): bump decode-uri-component from 0.2.0 to 0.2.2

    build(deps): bump decode-uri-component from 0.2.0 to 0.2.2

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(v0.11.1)
  • v0.11.1(Jun 6, 2022)

    Highlights

    • React 18 compatibility
    • Typescript type fixes

    Pull requests

    • Update peer react version range, https://github.com/rollbar/rollbar-react/pull/64
    • Fix for ErrorBoundary extra prop type definition, https://github.com/rollbar/rollbar-react/pull/60
    • Add children to the props for @types/react@18, https://github.com/rollbar/rollbar-react/pull/55
    • Fix declaration of unique symbols, https://github.com/rollbar/rollbar-react/pull/52
    • ErrorBoundary.fallbackUI can't be a node, https://github.com/rollbar/rollbar-react/pull/46
    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(Mar 3, 2022)

    • Allow rollbar instance from alternate import/require, https://github.com/rollbar/rollbar-react/pull/37
    • Export provider context for class components to use, https://github.com/rollbar/rollbar-react/pull/38
    Source code(tar.gz)
    Source code(zip)
  • v0.10.0(Feb 17, 2022)

    Highlights

    • ErrorBoundary FallbackUI now accepts function and class components
    • Typescript declarations (index.d.ts) are now published
    • Typescript declaration fixes

    Pull Requests

    • import hooks from react, https://github.com/rollbar/rollbar-react/pull/34
    • publish index.d.ts in npm package, https://github.com/rollbar/rollbar-react/pull/32
    • Provider declaration typos, https://github.com/rollbar/rollbar-react/pull/33
    • bugs related to fallbackUI, https://github.com/rollbar/rollbar-react/pull/29
    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Jan 27, 2022)

    Initial Typescript types

    • https://github.com/rollbar/rollbar-react/pull/26
    • https://github.com/rollbar/rollbar-react/pull/27

    Allow Provider to init with Rollbar instance, not config

    • https://github.com/rollbar/rollbar-react/pull/10
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Apr 19, 2021)

    Package is still in public beta now moving package to NPM for easier public access than Github Packages which requires an auth token to install even when public.

    Source code(tar.gz)
    Source code(zip)
  • v0.7.2(Apr 16, 2021)

  • v0.7.1(Apr 16, 2021)

  • v0.7.0(Apr 15, 2021)

    Based on the talk from React Summit 2021

    This release is featured in a Lightning Talk from React Summit 2021, this is still a Beta Release but available for public consumption and feedback.

    Source code(tar.gz)
    Source code(zip)
Owner
Rollbar
Rollbar
Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.

Recoil · Recoil is an experimental set of utilities for state management with React. Please see the website: https://recoiljs.org Installation The Rec

Facebook Experimental 18.2k Jan 8, 2023
a more intuitive way of defining private, public and common routes for react applications using react-router-dom v6

auth-react-router is a wrapper over react-router-dom v6 that provides a simple API for configuring public, private and common routes (React suspense r

Pasecinic Nichita 12 Dec 3, 2022
👉 Built my first React JS project "ToDo" webapp using some Features and Icons from Material UI.

# Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). ## Avai

Vansh Chitlangia 2 Dec 15, 2021
A frontend Framework for building B2B applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Material Design

react-admin A frontend Framework for building data-driven applications running in the browser on top of REST/GraphQL APIs, using ES6, React and Materi

marmelab 21.2k Dec 30, 2022
React-Mini-Projects - Simple React mini-applications

React Mini Projects A Fully Responsive React Application contain these mini apps : Todo App Movie App Budget App Flash Card App Factor App This app wa

Morteza Rezaienia 1 Jan 1, 2022
React components and hooks for creating VR/AR applications with @react-three/fiber

@react-three/xr React components and hooks for creating VR/AR applications with @react-three/fiber npm install @react-three/xr These demos are real,

Poimandres 1.4k Jan 4, 2023
Further split the React Native code based on Metro build to improve performance, providing `Dll` and `Dynamic Imports` features

React-Native Code Splitting Further split the React Native code based on Metro build to improve performance, providing Dll and Dynamic Imports feature

Wuba 126 Dec 29, 2022
Windows notepad in web with additional features! Made with typescript and react.

Notepad Windows notepad in web with additional features! ?? Table of Contents ?? About Why I created ? Helpful for ? Who can contribute ? ?? Getting S

Muhammed Rahif 22 Jan 3, 2023
Material-UI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

Material-UI Quickly build beautiful React apps. Material-UI is a simple and customizable component library to build faster, beautiful, and more access

Material-UI 83.6k Dec 30, 2022
⚡️ Simple, Modular & Accessible UI Components for your React Applications

Build Accessible React Apps with Speed ⚡️ Chakra UI provides a set of accessible, reusable, and composable React components that make it super easy to

Chakra UI 30.5k Jan 4, 2023
The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

Module SonarCloud Status ag-grid-community ag-grid-enterprise AG Grid AG Grid is a fully-featured and highly customizable JavaScript data grid. It del

AG Grid 9.5k Dec 30, 2022
Shows how React components and Redux to build a friendly user experience with instant visual updates and scaleable code in ecommerce applications

This simple shopping cart prototype shows how React components and Redux can be used to build a friendly user experience with instant visual updates and scaleable code in ecommerce applications.

Alan Vieyra 4 Feb 1, 2022
A react component helps bring Figma's Cursor Chat to your web applications in less than 3 minutes, making real-time collaboration anywhere

@yomo/react-cursor-chat ?? Introduction A react component helps bring Figma's Cursor Chat to your web applications in less than 3 minutes, making real

YoMo 84 Nov 17, 2022
POST stories. GET features.

User Story Introduction The goal of User Story is to design and present a scalable backend infrastructure that delivers a web interface allowing users

EOS UI/UX Solutions 38 Jan 5, 2023
This a todo list project that uses webpack. In this project you will find features like adding tasks, deleting tasks, maintaining localstorage, marking tasks completed and clearing all completed tasks.

webpack-Todo list This a todo list project that uses webpack. In this project you will find features like adding tasks, deleting tasks, maintaining lo

Natnael Demelash 2 Jun 15, 2022
✨ Create server-rendered universal JavaScript applications with no configuration

Universal JavaScript applications are tough to setup. Either you buy into a framework like Next.js or Nuxt, fork a boilerplate, or set things up yours

Jared Palmer 11k Jan 7, 2023
Web UI to create powerful voice applications with Fonoster's API.

Fonoster — Web UI Web UI to create powerful voice applications with Fonoster's API Technical details Environment Deployed version Link Development v0.

Fonoster 13 Dec 28, 2022
Bugsnag integration for Ember applications.

Ember Bugsnag Bugsnag integration for Ember applications.

Bagaar 1 Apr 28, 2022
Gnome Shell extension to provide a flexible applications dock (WIP).

Flexi Dock (WIP) Gnome Shell extension to provide a flexible applications dock. Installation The easiest way to install this extension is via the offi

Hardpixel 3 Aug 29, 2022