Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add documentation about browser extension #2115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions 72 website/docs/BrowserExtension.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Devtools

Inspecting immutable collections in browser's Dev Tools is awkward. You only
see the internal data structure, not the logical contents. For example, when
inspecting the contents of an Immutable List, you'd really like to see the
items in the list.

Chrome (v47+) and Firefox (116+) has support for custom "formatters". A
formatter tells browser's Dev Tools how to display values in the Console,
Scope list, etc. This means we can display Lists, Maps and other collections,
in a much better way.

Essentially, it turns this:

![Before Devtools](/before.png)

into:

![After Devtools](/after.png)

## Installation

Install the following extension in your browser:

<ul className="devtoolsLinks">
<li>
<a
href="https://chromewebstore.google.com/detail/immutablejs-object-format/lfdmhpmheemfkgjpifhenbkgcaaopckp"
target="_blank"
rel="noopener"
>
<figure>
<img src="/store-logo-chrome.svg" alt="Chrome Store Logo" />
<figcaption>Chrome or Chromium based browser extension</figcaption>
</figure>
</a>
</li>
<li>
<a
href="https://addons.mozilla.org/fr/firefox/addon/immutable-js-devtool-extension/"
target="_blank"
rel="noopener"
>
<figure>
<img src="/store-logo-firefox.svg" alt="Firefox Logo" />
<figcaption>Firefox Extension</figcaption>
</figure>
</a>
</li>
</ul>

### Alternative

If you don't want to install an extension, you can install the devtools as a
dependency in your project.

To do that, install the following package using your package manager:

```sh
npm install --save-dev @jdeniau/immutable-devtools
```

and enable it with:

```js
import * as Immutable from 'immutable';
import installDevTools from '@jdeniau/immutable-devtools';

installDevTools(Immutable);
```

See more details in the [github repository](https://github.com/immutable-js/immutable-devtools).
Binary file added BIN +24.5 KB website/public/after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added BIN +89.1 KB website/public/before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions 1 website/public/store-logo-chrome.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 140 additions & 0 deletions 140 website/public/store-logo-firefox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions 1 website/src/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export function HeaderLinks({
<div className="links">
<DocsDropdown versions={versions} currentVersion={currentVersion} />
<Link href="/play">Playground</Link>
<Link href="/browser-extension">Browser extension</Link>
<a
href="https://stackoverflow.com/questions/tagged/immutable.js?sort=votes"
target="_blank"
Expand Down
21 changes: 21 additions & 0 deletions 21 website/src/app/browser-extension/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { DocHeader } from '../../DocHeader';
import { ImmutableConsole } from '../../ImmutableConsole';
import { getVersions } from '../../static/getVersions';

export default function VersionLayout({
children,
}: {
children: React.ReactNode;
}) {
const versions = getVersions();

return (
<div>
<ImmutableConsole version={versions[0]} />
<DocHeader versions={versions} currentVersion={versions[0]} />
<div className="pageBody">
<div className="contents">{children}</div>
</div>
</div>
);
}
24 changes: 24 additions & 0 deletions 24 website/src/app/browser-extension/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Metadata } from 'next';
import { DocSearch } from '../../DocSearch';
import { SideBar } from '../../Sidebar';

export async function generateMetadata(): Promise<Metadata> {
return {
title: `Devtools — Immutable.js`,
};
}

export default async function BrowserExtensionPage() {
const { default: MdxContent } = await import(`@/docs/BrowserExtension.mdx`);

return (
<>
<SideBar />
<div key="Overview" className="docContents">
<DocSearch />

<MdxContent />
</div>
</>
);
}
2 changes: 0 additions & 2 deletions 2 website/src/app/docs/v5/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export async function generateMetadata(): Promise<Metadata> {
export default async function OverviewDocPage() {
const { default: MdxContent } = await import(`@/docs/Intro.mdx`);

console.log('MdxContent', MdxContent);

return (
<>
<div key="Overview" className="docContents">
Expand Down
25 changes: 25 additions & 0 deletions 25 website/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -616,3 +616,28 @@ p:last-child {
.memberLabel:hover .anchorLink {
display: inline;
}

.devtoolsLinks {
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: center;
margin-top: 0.5rem;
list-style-type: none;
padding: 0;
}

@media only screen and (max-width: 680px) {
.devtoolsLinks {
flex-direction: column;
}
}

.devtoolsLinks > li {
flex: 1;
text-align: center;
}

.devtoolsLinks img {
max-width: min(150px, 100%);
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.