{"id":13809336,"url":"https://github.com/jchiatt/react-chaos","last_synced_at":"2025-04-04T16:08:26.348Z","repository":{"id":34892973,"uuid":"187712566","full_name":"jchiatt/react-chaos","owner":"jchiatt","description":"Chaos Engineering for your React apps.","archived":false,"fork":false,"pushed_at":"2023-01-07T05:49:07.000Z","size":1952,"stargazers_count":592,"open_issues_count":34,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T15:03:29.016Z","etag":null,"topics":["chaos-engineering","chaos-theory","react","ui-testing","ux-testing"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jchiatt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-20T21:00:06.000Z","updated_at":"2025-03-26T10:16:50.000Z","dependencies_parsed_at":"2023-01-15T10:15:24.309Z","dependency_job_id":null,"html_url":"https://github.com/jchiatt/react-chaos","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchiatt%2Freact-chaos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchiatt%2Freact-chaos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchiatt%2Freact-chaos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchiatt%2Freact-chaos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchiatt","download_url":"https://codeload.github.com/jchiatt/react-chaos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208143,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chaos-engineering","chaos-theory","react","ui-testing","ux-testing"],"created_at":"2024-08-04T01:02:19.433Z","updated_at":"2025-04-04T16:08:26.302Z","avatar_url":"https://github.com/jchiatt.png","language":"TypeScript","funding_links":[],"categories":["Notable Tools","TypeScript","3. Fault Injection"],"sub_categories":["Languages"],"readme":"# 🔥🐒💥 React Chaos\n\nChaos Engineering for your React applications.\n\n## What It Does\n\nReact Chaos is currently a higher order component that will randomly throw `Error`s in the component it wraps. The likelihood for the error to throw is based on a `level` you set when you wrap a component.\n\nBlog post: [Announcing React Chaos](https://jchiatt.com/announcing-react-chaos/)\nDemo: [https://react-chaos.netlify.com/](https://react-chaos.netlify.com/)\n\n## 🛑 Pre-Installation Notes\n\n- This is currently WIP and a proof-of-concept.\n- There is nothing in place to help ensure good performance practices. Use at your own risk.\n\n## Installation\n\n```js\nnpm i --save-dev react-chaos\n```\n\n## Usage\n\nFirst, import the Chaos:\n\n```js\nimport withChaos from 'react-chaos';\n```\n\nWrap any component with the Chaos:\n\n```js\nconst ComponentToWrap = () =\u003e \u003cp\u003eI may have chaos.\u003c/p\u003e;\n\nconst ComponentWithChaos = withChaos(ComponentToWrap);\n```\n\nYou can optionally set a Chaos level between 1 and 10 (the higher the number, the more Chaos 😈) as well as a custom error message:\n\n```js\nconst ComponentWithChaos = withChaos(ComponentToWrap);\n\nconst ComponentWithChaos = withChaos(\n  ComponentToWrap,\n  10,\n  'This error message will almost certainly be shown since we are at Chaos level 10.'\n);\n```\n\nNote: The default Chaos level is 5.\n\n## Chaos in Production\n\nBy default, React Chaos _will not_ run in production. If you want to override this by passing in `true` as a 4th parameter like this:\n\n```js\nconst ComponentWithChaos2 = withChaos(\n  ComponentWillHaveChaos2,\n  3,\n  'a custom error message, level 3',\n  true\n);\n```\n\n## Why\n\n- Because simple UI errors shouldn't bring down your app.\n- This library can help expose areas of your component tree that don't handle errors very gracefully. Used in conjunction with [Error Boundaries](https://reactjs.org/docs/error-boundaries.html), this can be a powerful tool to improve the resiliency of your UI components.\n\n## What is Chaos Engineering?\n\nChaos Engineering is the practice of experimenting with entropy on a software system to test its resiliency. You can [read more about it here](https://en.wikipedia.org/wiki/Chaos_engineering).\n\n## Inspiration\n\n- [Brandon Dail's post on React Error Boundaries and Fault Tolerance](https://aweary.dev/fault-tolerance-react/)\n- [Brian Holt's talk on Chaos Engineering in the Browser](https://www.youtube.com/watch?v=A4_rRj-4Mv0)\n- Also inspired by watching Jurassic Park the night before writing this\n\n## Other Notes\n\nThis project uses TSDX.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchiatt%2Freact-chaos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchiatt%2Freact-chaos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchiatt%2Freact-chaos/lists"}