{"id":21076556,"url":"https://github.com/monojack/immerx-devtools","last_synced_at":"2025-05-16T07:31:34.079Z","repository":{"id":42819125,"uuid":"267949295","full_name":"monojack/immerx-devtools","owner":"monojack","description":"DevTools middleware for Immer and Immerx","archived":false,"fork":false,"pushed_at":"2023-01-06T07:23:46.000Z","size":3660,"stargazers_count":5,"open_issues_count":15,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T04:45:45.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monojack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-29T20:30:54.000Z","updated_at":"2023-03-07T13:30:53.000Z","dependencies_parsed_at":"2023-02-05T15:15:27.770Z","dependency_job_id":null,"html_url":"https://github.com/monojack/immerx-devtools","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monojack%2Fimmerx-devtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monojack%2Fimmerx-devtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monojack%2Fimmerx-devtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monojack%2Fimmerx-devtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monojack","download_url":"https://codeload.github.com/monojack/immerx-devtools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254488238,"owners_count":22079387,"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":[],"created_at":"2024-11-19T19:29:04.326Z","updated_at":"2025-05-16T07:31:33.516Z","avatar_url":"https://github.com/monojack.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"images/immerx-devtools-logo.svg\" height=\"70px\"/\u003e\n\n**DevTools** middleware for [ImmerX](https://github.com/monojack/immerx)\n\n\u003cbr/\u003e\n\n\u003cimg src=\"images/extension-screenshot-0.png\" /\u003e\n\n### Install the Chrome DevTools Extension\n\nFrom the **[Chrome Web Store](https://chrome.google.com/webstore/detail/immerx-devtools/jchcefekimgnfceonnnekpgmphepengp)**\n\nOr **manually**:\n1. Download the `devtools-extension.zip` file from the [releases page](https://github.com/monojack/immer-devtools/releases) and unzip it anywhere you like\n2. Navigate to `chrome://extensions` or from the menu - `More Tools -\u003e Extensions`\n3. Enable `Developer mode` from the top-right corner\n4. Click on `Load unpacked` and select the unzipped folder\n\n**Note**: The panel will not show up in the developer tools until you've [set up](#setup) the middleware.\n\n### Middleware setup\n\nWe just create the middleware and add it to the middleware list when creating the **immerx** state.\n\n```js\nimport { create } from '@immerx/state'\nimport { createDevToolsMiddleware } from '@immerx/devtools'\n\nconst devToolsMiddleware = createDevToolsMiddleware()\ncreate(\n  {\n    todos: [{ label: 'Taste JavaScript', completed: false }],\n  },\n  [devToolsMiddleware], // \u003c-- here\n)\n```\n\n### Interface\n\nHere are the different views and elements of the **DevTools** interface.\n\n#### `Update List`\n\n\u003cimg src=\"images/update-list-screenshot-0.png\" height=\"250\" /\u003e\n\nNote that this is a list of updates, not patches. As a result of updating the state you may be replacing some value, remove other, or maybe even add some. Immer will generate a patch for each of these operations, so an update may contain 0 or more patches. If an update contains more than one patch, it will display all the performed operations and the common path for all of them.\n\nThe first entry - **`INIT`** - is not actually an update, but it represents the initial value of our state.\n\n\u003cbr/\u003e\n\n#### `Patches`\n\n\u003cimg src=\"images/patches-screenshot-0.png\" /\u003e\n\nBy switching to the **`Patches`** view we can see a list with all of the patches that were applied during the selected update.\n\n\u003cbr/\u003e\n\n#### `State`\n\n\u003cimg src=\"images/state-screenshot-1.png\"   /\u003e\n\nThis is where we have a view of the entire **`state`** tree. Whether it is the most recent value - when there's no selection _(left)_ - or the value relevant to the selected update _(right)_\n\n\u003cbr/\u003e\n\n#### `Diff`\n\n\u003cimg src=\"images/diff-screenshot-0.png\" /\u003e\n\nDiffing is done with [@immerx/patchdiff](https://github.com/monojack/immerx-patchdiff) and it's strictly based on immer patches, meaning that we'll see exactly what and how it changed rather than a deep diff. This is a lot more relevant and helps us spot and remediate irrelevant changes to leverage [structural sharing](https://egghead.io/lessons/react-profile-react-rendering-and-optimize-with-memo-to-leverage-structural-sharing).\n\n\u003cbr/\u003e\n\n### Demo\n\n[Todo MVC](https://monojack.github.io/immerx-todomvc/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonojack%2Fimmerx-devtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonojack%2Fimmerx-devtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonojack%2Fimmerx-devtools/lists"}