open-source-labs / Reactime

Developer tool for time travel debugging and performance monitoring in React applications.
https://www.reacti.me
MIT License
2.17k stars 201 forks source link
devtools-extension gatsby nextjs performance react-devtools react-fiber reactjs renderer rendering time-travel why-did-you-update




React Performance Tool
Nominated for React Open Source Awards 2020

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


🇷🇺   РУССКАЯ ВЕРСИЯ   •   🇫🇷   VERSION FRANÇAISE   •   DEVELOPER README


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. The accessibility tab visualizes an app's accessibility tree per state change. 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

What's New!

Reactime 25.0 includes a new prop visualization feature and heatmap bar for developers!

We also addressed the previously reported freezing issues on start and brought up the Jest Library in much better condition as it was before; from 20% of the tests working to more than 85% now working correctly.

Some of the UI was rearranged to be more aesthetically pleasing and render the main window bigger for the diplay of the component tree in the process.

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

Installation

To get started, install the Reactime [extension](https://chrome.google.com/webstore/detail/reactime/cgibknllccemdnfhfpmjhffpjfeidjga) 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](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en) 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](src/DEVELOPER_README.md) 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 is found? Reactime initially runs using the dev tools global hook from the Chrome API. It takes time for Chrome to load this. Try refreshing your application a couple of times until you see Reactime running. ### ❓ 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](src/DEVELOPER_README.md), 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 - [Relaunching Reactime: Updates and a New Accessibility Feature!](https://medium.com/@evaury/relaunching-reactime-updates-and-a-new-accessibility-feature-1f0fd3a5bd8c) ## Authors - **Haider Ali** - [@hali03](https://github.com/hali03) - **Jose Luis Sanchez** - [@JoseSanchez1996](https://github.com/JoseSanchez1996) - **Logan Nelsen** - [@ljn16](https://github.com/ljn16) - **Mel Koppens** - [@MelKoppens](https://github.com/MelKoppens) - **Amy Yang** - [@ay7991](https://github.com/ay7991) - **Eva Ury** - [@evaSUry](https://github.com/evaSUry) - **Jesse Guerrero** - [@jguerrero35](https://github.com/jguerrero35) - **Oliver Cho** - [@Oliver-Cho](https://github.com/Oliver-Cho) - **Ben Margolius** - [@benmarg](https://github.com/benmarg) - **Eric Yun** - [@ericsngyun](https://github.com/ericsngyun) - **James Nghiem** - [@jemzir](https://github.com/jemzir) - **Wilton Lee** - [@wiltonlee948](https://github.com/wiltonlee948) - **Louis Lam** - [@llam722](https://github.com/llam722) - **Samuel Tran** - [@leumastr](https://github.com/leumastr) - **Brian Yang** - [@yangbrian310](https://github.com/yangbrian310) - **Emin Tahirov** - [@eminthrv](https://github.com/eminthrv) - **Peng Dong** - [@d28601581](https://github.com/d28601581) - **Ozair Ghulam** - [@ozairgh](https://github.com/ozairgh) - **Christina Or** - [@christinaor](https://github.com/christinaor) - **Khanh Bui** - [@AndyB909](https://github.com/AndyB909) - **David Kim** - [@codejunkie7](https://github.com/codejunkie7) - **Robby Tipton** - [@RobbyTipton](https://github.com/RobbyTipton) - **Kevin HoEun Lee** - [@khobread](https://github.com/khobread) - **Christopher LeBrett** - [@fscgolden](https://github.com/fscgolden) - **Joseph Park** - [@joeepark](https://github.com/joeepark) - **Kris Sorensen** - [@kris-sorensen](https://github.com/kris-sorensen) - **Daljit Gill** - [@dgill05](https://github.com/dgill05) - **Ben Michareune** - [@bmichare](https://github.com/bmichare) - **Dane Corpion** - [@danecorpion](https://github.com/danecorpion) - **Harry Fox** - [@StackOverFlowWhereArtThou](https://github.com/StackOverFlowWhereArtThou) - **Nathan Richardson** - [@BagelEnthusiast](https://github.com/BagelEnthusiast) - **David Bernstein** - [@dangitbobbeh](https://github.com/dangitbobbeh) - **Joseph Stern** - [@josephiswhere](https://github.com/josephiswhere) - **Dennis Lopez** - [@DennisLpz](https://github.com/DennisLpz) - **Cole Styron** - [@colestyron](https://github.com/C-STYR) - **Ali Rahman** - [@CourageWolf](https://github.com/CourageWolf) - **Caner Demir** - [@demircaner](https://github.com/demircaner) - **Kevin Ngo** - [@kev-ngo](https://github.com/kev-ngo) - **Becca Viner** - [@rtviner](https://github.com/rtviner) - **Caitlin Chan** - [@caitlinchan23](https://github.com/caitlinchan23) - **Kim Mai Nguyen** - [@Nkmai](https://github.com/Nkmai) - **Tania Lind** - [@lind-tania](https://github.com/lind-tania) - **Alex Landeros** - [@AlexanderLanderos](https://github.com/AlexanderLanderos) - **Chris Guizzetti** - [@guizzettic](https://github.com/guizzettic) - **Jason Victor** - [@theqwertypusher](https://github.com/Theqwertypusher) - **Sanjay Lavingia** - [@sanjaylavingia](https://github.com/sanjaylavingia) - **Vincent Nguyen** - [@VNguyenCode](https://github.com/VNguyenCode) - **Haejin Jo** - [@haejinjo](https://github.com/haejinjo) - **Hien Nguyen** - [@hienqn](https://github.com/hienqn) - **Jack Crish** - [@JackC27](https://github.com/JackC27) - **Kevin Fey** - [@kevinfey](https://github.com/kevinfey) - **Carlos Perez** - [@crperezt](https://github.com/crperezt) - **Edwin Menendez** - [@edwinjmenendez](https://github.com/edwinjmenendez) - **Gabriela Jardim Aquino** - [@aquinojardim](https://github.com/aquinojardim) - **Greg Panciera** - [@gpanciera](https://github.com/gpanciera) - **Nathanael Wa Mwenze** - [@nmwenz90](https://github.com/nmwenz90) - **Ryan Dang** - [@rydang](https://github.com/rydang) - **Bryan Lee** - [@mylee1995](https://github.com/mylee1995) - **Josh Kim** - [@joshua0308](https://github.com/joshua0308) - **Sierra Swaby** - [@starkspark](https://github.com/starkspark) - **Ruth Anam** - [@nusanam](https://github.com/nusanam) - **David Chai** - [@davidchaidev](https://github.com/davidchai717) - **Yujin Kang** - [@yujinkay](https://github.com/yujinkay) - **Andy Wong** - [@andynullwong](https://github.com/andynullwong) - **Chris Flannery** - [@chriswillsflannery](https://github.com/chriswillsflannery) - **Rajeeb Banstola** - [@rajeebthegreat](https://github.com/rajeebthegreat) - **Prasanna Malla** - [@prasmalla](https://github.com/prasmalla) - **Rocky Lin** - [@rocky9413](https://github.com/rocky9413) - **Abaas Khorrami** - [@dubalol](https://github.com/dubalol) - **Ergi Shehu** - [@Ergi516](https://github.com/ergi516) - **Raymond Kwan** - [@rkwn](https://github.com/rkwn) - **Joshua Howard** - [@Joshua-Howard](https://github.com/joshua-howard) - **Lina Shin** - [@rxlina](https://github.com/rxlina) - **Andy Tsou** - [@andytsou19](https://github.com/andytsou19) - **Feiyi Wu** - [@FreyaWu](https://github.com/FreyaWu) - **Viet Nguyen** - [@vnguyen95](https://github.com/vnguyen95) - **Alex Gomez** - [@alexgomez9](https://github.com/alexgomez9) - **Edar Liu** - [@liuedar](https://github.com/liuedar) - **Kristina Wallen** - [@kristinawallen](https://github.com/kristinawallen) - **Quan Le** - [@blachfog](https://github.com/Blachfog) - **Robert Maeda** - [@robmaeda](https://github.com/robmaeda) - **Lance Ziegler** - [@lanceziegler](https://github.com/lanceziegler) - **Ngoc Zwolinski** - [@ngoczwolinski](https://github.com/ngoczwolinski) - **Peter Lam** - [@dev-plam](https://github.com/dev-plam) - **Zachary Freeman** - [@zacharydfreeman](https://github.com/zacharydfreeman/) - **Jackie Yuan** - [@yuanjackie1](https://github.com/yuanjackie1) - **Jasmine Noor** - [@jasnoo](https://github.com/jasnoo) - **Minzo Kim** - [@minzo-kim](https://github.com/minzo-kim) - **Mark Teets** - [@MarkTeets](https://github.com/MarkTeets) - **Nick Huemmer** - [@NickHuemmer](https://github.com/ElDuke717) - **James McCollough** - [@j-mccoll](https://github.com/j-mccoll) - **Mike Bednarz** - [@mikebednarz](https://github.com/mikebednarz) - **Sergei Liubchenko** - [@sergeylvq](https://github.com/sergeylvq) - **Yididia Ketema** - [@yididiaketema](https://github.com/yididiaketema) - **Morah Geist** - [@morahgeist](https://github.com/morahgeist) - **Eivind Del Fierro** - [@EivindDelFierro](https://github.com/EivindDelFierro) - **Kyle Bell** - [@KyEBell](https://github.com/KyEBell) - **Sean Kelly** - [@brok3turtl3](https://github.com/brok3turtl3) - **Christopher Stamper** - [@ctstamper](https://github.com/ctstamper) - **Jimmy Phy** - [@jimmally](https://github.com/jimmally) - **Andrew Byun** - [@AndrewByun](https://github.com/AndrewByun) - **Kelvin Mirhan** - [@kelvinmirhan](https://github.com/kelvinmirhan) - **Jesse Rosengrant** - [@jrosengrant](https://github.com/jrosengrant) - **Liam Donaher** - [@leebology](https://github.com/leebology) - **David Moore** - [@Solodt55](https://github.com/Solodt55) - **John Banks** - [@Jbanks123](https://github.com/Jbanks123) ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.