Socket
Book a DemoInstallSign in
Socket

react-query-rewind

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-query-rewind

React Query Rewind is a library that helps developers debug applications that use React Query (ie TanStack Query) by letting them time travel through state changes directly in their chrome dev tools

latest
Source
npmnpm
Version
2.1.14
Version published
Weekly downloads
448
-23.16%
Maintainers
4
Weekly downloads
 
Created
Source

Logo

Technologies

JavaScript TypeScript React HTML5 Webpack D3 ESLint Material UI Jest Babel

Overview

React Query Rewind introduces a powerful DevTool extension designed to work in conjunction with React Query's built-in DevTools in order to optimize time-traveling through state changes in an application. This open-source extension is tailored to enhance the debugging experience for React Query users, allowing them to explore state changes and component relationships with ease.

Getting Started

Prerequisites

  • React Query installed and in use in your application.

  • Install RQRewind Chrome Extension.

Installation

  • Download npm package into your application.

    npm i -D react-query-rewind
    
  • Import the ReactQueryRewind component into the root of your applicaiton.

    import ReactQueryRewind from "react-query-rewind";
    

    Note: Some older versions of NextJS default to the commonJS version of the package, causing apps to error If you encounter this error, import the component with:

    import ReactQueryRewind from "../../node_modules/react-query-rewind/dist/esm/index.js";
    

    OR

    import dynamic from 'next/dynamic'
    const ReactQueryRewind = dynamic(
      () => import('react-query-rewind').then((mod) => mod.default),
      { ssr: false }
    )
    
  • Place ReactQueryRewind next to the root of your application inside the QueryClientProvider component.

    ReactDOM.createRoot(document.getElementById('root')!).render(
      <QueryClientProvider client={queryClient}>
        <App />
        <ReactQueryRewind />
      </QueryClientProvider>
    );
    
  • Open the Chrome DevTool Extension and start coding!

    Component Placement

Features

  • Query States: Upon opening RQRewind in Chrome Dev Tools, you will see the Queries tab open with a drop down menu listing the query keys of all the incoming queries. Select the queries that you want to monitor, make changes on the web app, and the changes of query states will be logged as reflected by the growing number above the play bar. Use the play bar to navigate to a particular state snapshot that you would like to inspect.

  • State Diff: Toggle on the Diff button to see state changes between each snapshot highlighted. Turn on the switch on top of the page to show only parts of the state that are changed.

  • Live UI Change: As you review the state change history, there is also the option to turn on the time travel mode by clicking on the clock icon button. Under time travel mode, when visiting a logged state snapshot on RQRewindl, the UI of the app will change accordingly. Turn off time travel mode for RQRewind to continue logging future state changes.

  • Component Tree: Click on the Component Tree tab and turn on the Start Profiling switch. Click on any component on the app, and view the component tree that is rendered on the dev tools panel.

Contributing

React Query Rewind values the strength of community involvement. If you're enthusiastic about React Query, time-traveling state, or improving debugging experiences, your contributions are highly appreciated. Whether it's code enhancements, documentation improvements, or innovative feature suggestions, your engagement can play a pivotal role in shaping the future of React Query Rewind. If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  • Fork the Project
  • Create your Feature Branch (git checkout -b feature/AmazingFeature)
  • Commit your Changes (git commit -m 'Add some AmazingFeature')
  • Push to the Branch (git push origin feature/AmazingFeature)
  • Open a Pull Request

Contact Information

Austin Cavanagh - GitHub - LinkedIn - austin.cavanagh.cs@gmail.com

Emma Teering - GitHub - LinkedIn - teeringe@gmail.com

John Dunn - GitHub - LinkedIn - johnwdunn20@gmail.com

Rui Fan - GitHub - LinkedIn - rfan1986@gmail.com

Medium LinkedIn

Project Link: React Query Rewind

Website: reactqueryrewind.com

License

MIT

(back to top)

Keywords

react

FAQs

Package last updated on 20 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts