/jesseReadMeUpdate

Developer tool for time travel debugging and performance monitoring in React applications.

Primary LanguageTypeScriptMIT LicenseMIT

Reactime is an open-source Chrome developer tool for time travel debugging and performance monitoring in React applications. Reactime enables developers to record snapshots of application state, jump between and inspect state snapshots, and monitor performance metrics such as component render time and render frequency.


GitHub LintPrefs


Website

Features

🔹 Viewing

You can view your application's file structure and click on a snapshot to view your app's state. State can be visualized in a Component Graph, JSON Tree, or Performance Graph. Snapshot history can be visualized in the History tab. The Web Metrics tab provides some useful metrics for site performance. Snapshots can be compared with the previous snapshot, which can be viewed in Diff mode.


🔹 Recording

Whenever the state is changed (whenever setState, useState is called), this extension will create a snapshot of the current state tree and record it. Each snapshot will be displayed in Chrome DevTools under the Reactime panel.

🔹 Snapshot Series and Action Comparison

You can save a series of state snapshots and use it to analyze changes in component render performance between the current and the previous series of snapshots. You can also name specific snapshots and compare all snapshots with the same name.

🔹 Components Comparison

When toggled to a specific snapshot, a visualization of the individual components of the snapshot will be displayed. This can be done under the same Performance tab where the snapshots are rendered. You will also find details of each component upon hovering.

🔹 Download/Upload Snapshots

Download the recorded snapshots as a JSON file and upload them to access state trees across different sessions.


🔹 Reconnect and Status

If Reactime loses its connection to the tab you're monitoring, simply click the "reconnect" button to resume your work. You'll notice a circle located to the right of the button, which will appear as either red (indicating disconnection) or green (signifying a successful reconnection).

🔹 Re-render Optimization

One of the most common issues that affects performance in React is unnecessary render cycles. This problem can be fixed by checking your renders in the Performance tab in Chrome DevTools under the Reactime panel.

🔹 Jumping

Using the actions sidebar, a user can jump to any previously recorded snapshots. Hitting the jump button on any snapshot will allow a user to view state data at any point in the history of the target application.

🔹 Gatsby

Reactime offers full support for Gatsby applications. You would be able to identify unnecessary renders, duration of each rendering, travel-debugging features and visual representation of the tree components.

🔹 Next.js

Reactime offers debugging and performance tools for Next.js apps: time-traveling debugging, preventing unnecessary component re-renders and making your application faster.

🔹 Remix

Reactime offers debugging and performance tools for Remix apps (in beta). Support still needs to be added for multi-route time traveling. Every other feature works.

🔹 TypeScript Support

Reactime offers support for TypeScript applications using stateful class components and functional components. Further testing and development is required for custom hooks and Concurrent Mode.

🔹 Documentation

After cloning this repository, developers can simply run npm run docs at the root level and serve the dynamically generated /docs/index.html file on a browser. Doing so will provide a readable, extensible, and interactive GUI view of the structure and interfaces of the codebase.

Additional Features

  • In-app tab-specific tutorial walkthroughs
  • Hover over a component to view tooltip details on state visualizations
  • Double-click to collapse child components
  • Click to focus on a portion of the component map
  • A dropdown to support the development of projects on multiple tabs
  • Intuitive navigation between state snapshots
  • Locked/unlocked feature allowing temporary pause of state monitoring

What's New!

Reaectime 24.0 adds a new accessibility feature, revamping the snapshot functionality to render a stateful view of the Chrome Accessibility tree. Reactime v24.0 also brings additional bug fixes and improves stability of the application.

Accessibility Tree

Using the Chrome Debugger API, Reactime is now able to render a complete view of the native Chrome Accessibility tree and integrates seamlessly with the Snapshot features already present in Reactime. To get started, navigate to the accessibility tab within Reactime, read the Note to Developers and click "Enable" when ready. Reactime takes advantage of Chrome's Debugger API, which notifies the user through a pop-up

If you would like to read more about previous releases, click here!

Installation

To get started, install the Reactime extension from Chrome Web Store.

After installing Reactime, you can test its functionalities with your React application in development mode.

Please note, the time jumping feature will ONLY work when your application is running in development mode. In production mode, you are able to view your application’s component map but no additional features.

NOTE: The React Developer Tools extension is also required for Reactime to run, if you do not already have it installed on your browser.

Manual Installation

Go to Chrome Extensions (make sure Chrome Extension is in Developer Mode) for manual installation in (https://developer.chrome.com/extensions/faq#faq-dev-01) and click on Load Unpacked. Use src/extension/build/ to load this extension. Turn on 'Allow access to file URLs' in the extension details page if testing locally.

Looking to contribute to Reactime?

Please refer to Developer Install for a detailed guide:

Refer to the DEVELOPER README for more info on the project, and instructions on building from source.

How to Use

After installing the Chrome extension, just open up your project in the browser.

Then right click on your application and choose the 'Reactime' context menu item to open up a Reactime panel.

Alternatively, you can open up your Chrome DevTools and navigate to the Reactime panel.

Troubleshooting

Why is Reactime telling me that no React application/no Target is found?

Reactime initially runs using the dev tools global hook from the Chrome API. It takes time for Chrome to load this. The current workaround is to navigate to your Chrome Extensions and refresh Reactime. Then, navigate back to your application, refresh the page, and then within the Reactime Dev Tool, right-click and hit "Reload Frame".

Why do I need to have React Dev Tools enabled?

Reactime works in tandem with the React Developer Tools to access a React application's Fiber tree; under the hood, Reactime traverses the Fiber tree through the React Developer Tool's global hook, pulling all relevant information needed to display to the developer.

There is a black screen instead of the Reactime extension

Try refreshing the application you want to test and refresh the DevTools by clicking the right mouse button “Reload frame”.

I found a bug in Reactime

Reactime is an open-source project, and we'd love to hear from you about improving the user experience. Please read DEVELOPER README, and create a pull request (or issue) to propose and collaborate on changes to Reactime.

Node version compatibility

With the release of Node v18.12.1(LTS) on 11/4/22, the script has been updated to 'npm run dev' | 'npm run build' for backwards compatibility.
For version Node v16.16.0, please use script 'npm run devlegacy' | 'npm run buildlegacy'

Read More

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.