Compare commits

...

248 Commits

Author SHA1 Message Date
github-actions[bot]
1c5df1ee32
Version Packages (#1851)
* Version Packages

* Bump extension version number

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-04-03 00:36:05 +00:00
renovate[bot]
3fc48a226b
fix(deps): update dependency @babel/runtime to v7.26.10 [security] (#1850)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-02 18:56:21 +00:00
Mark Erikson
17b55ef99f
Handle api.provided state changes in RTKQ 2.6.2 (#1848)
* Handle api.provided state changes in RTKQ 2.6.2

* Create little-melons-grow.md

---------

Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-04-02 18:46:52 +00:00
renovate[bot]
73a01cc5a7
chore(deps): update dependency @storybook/addon-webpack5-compiler-swc to v3 (#1849)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-02 18:38:41 +00:00
renovate[bot]
07e8f2c3ad
chore(deps): update dependency babel-loader to v10 (#1845)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-05 17:23:47 -05:00
renovate[bot]
8c563d71bb
chore(deps): update dependency typescript to ~5.8.2 (#1844)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-05 22:10:41 +00:00
renovate[bot]
d730ea185f
fix(deps): update dependency immutable to v5 (#1799)
* fix(deps): update dependency immutable to v5

* Updates

* Updates

* Updates

* Fix lint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-03-05 22:00:27 +00:00
renovate[bot]
6df66b7320
fix(deps): update dependency msw to ^2.7.3 (#1841)
* fix(deps): update dependency msw to ^2.7.3

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-03-05 20:40:41 +00:00
renovate[bot]
3c90662cfa
chore(deps): lock file maintenance (#1842)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-05 14:49:14 -05:00
renovate[bot]
763bf937a4
fix(deps): update all non-major dependencies (#1840)
* fix(deps): update all non-major dependencies

* Dedupe

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-03-05 19:15:25 +00:00
github-actions[bot]
8ec2b303ee
Version Packages (#1838)
* Version Packages

* Trigger build

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-03-01 16:37:28 -05:00
Nathan Bierema
91f21b2ffc
Fix compatibility of createDevTools with React 19 types (#1837)
* Fix compatibility of createDevTools with React 19 types

* Create fluffy-keys-doubt.md
2025-03-01 20:09:01 +00:00
github-actions[bot]
ff60266836
Version Packages (#1836)
* Version Packages

* Fix version numbers

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-03-01 12:09:02 -05:00
Nathan Bierema
6830118951
Add React 19 to peer deps (#1835)
* Add React 19 to peer deps

* Create moody-crabs-kick.md

* Update moody-crabs-kick.md
2025-03-01 11:44:15 -05:00
renovate[bot]
cc7ec13fb9
chore(deps): lock file maintenance (#1834)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-27 21:53:49 +00:00
renovate[bot]
e46bbcaef3
fix(deps): update all non-major dependencies (#1833)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-27 16:40:12 -05:00
renovate[bot]
4a8fbc675a
chore(deps): lock file maintenance (#1830)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-10 16:06:50 -05:00
renovate[bot]
c9bed44e0e
fix(deps): update all non-major dependencies (#1826)
* fix(deps): update all non-major dependencies

* Format

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-02-10 20:46:53 +00:00
renovate[bot]
750046c4d9
chore(deps): update dependency stylelint-config-standard to v37 (#1824)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 20:59:43 +00:00
renovate[bot]
f42403c579
chore(deps): update dependency eslint-config-prettier to v10 (#1822)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-01-29 19:57:40 +00:00
renovate[bot]
519ec090c6
chore(deps): lock file maintenance (#1823)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-29 19:46:48 +00:00
renovate[bot]
4e71048997
fix(deps): update all non-major dependencies (#1814)
* fix(deps): update all non-major dependencies

* Dedupe

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-01-29 19:31:18 +00:00
renovate[bot]
5b33056bc5
chore(deps): update dependency webpack-cli to v6 (#1812)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-09 15:18:55 +00:00
renovate[bot]
da0051706e
chore(deps): lock file maintenance (#1813)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-09 10:11:21 -05:00
renovate[bot]
6ea51af67c
fix(deps): update all non-major dependencies (#1810)
* fix(deps): update all non-major dependencies

* Dedupe

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2025-01-09 14:45:25 +00:00
renovate[bot]
9a46407254
fix(deps): update dependency msw to ^2.7.0 (#1800)
* fix(deps): update dependency msw to ^2.7.0

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-12-30 13:24:34 -05:00
renovate[bot]
07bd4476b2
chore(deps): update dependency @storybook/addon-webpack5-compiler-swc to v2 (#1807)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-30 17:13:48 +00:00
renovate[bot]
b9993eb5f7
chore(deps): lock file maintenance (#1808)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-30 12:03:27 -05:00
renovate[bot]
5228d46328
fix(deps): update all non-major dependencies (#1794)
* fix(deps): update all non-major dependencies

* Downgrade Ubuntu

Possibly related:

- https://github.com/electron/electron/issues/41066
- https://github.com/SeleniumHQ/selenium/issues/14609

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-12-30 10:48:57 -05:00
Nathan Bierema
2002a81071 Publish @redux-devtools/rtk-query-monitor 2024-12-16 12:43:15 -05:00
renovate[bot]
c065b03caa
chore(deps): update eslint monorepo to v9 (#1670)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-12-07 00:03:15 +00:00
renovate[bot]
81a9ee33cc
chore(deps): update dependency @types/color to v4 (#1795)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-12-06 23:45:59 +00:00
renovate[bot]
3c47910110
chore(deps): update dependency @chromatic-com/storybook to v3 (#1787)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-12-06 23:34:12 +00:00
renovate[bot]
1c6f45fb47
chore(deps): update dependency typescript to ~5.7.2 (#1757)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-06 23:25:49 +00:00
renovate[bot]
054b27a9f8
chore(deps): update dependency @types/node to v22 (#1796)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-06 23:14:52 +00:00
renovate[bot]
415257cd41
fix(deps): update dependency msw to ^2.6.7 (#1763)
* fix(deps): update dependency msw to ^2.6.7

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-12-06 23:03:53 +00:00
renovate[bot]
14201108e7
chore(deps): lock file maintenance (#1773)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-06 22:53:43 +00:00
renovate[bot]
90737b7e26
fix(deps): update all non-major dependencies (#1780)
* fix(deps): update all non-major dependencies

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-12-06 22:39:17 +00:00
Nathan Bierema
54c6f26c81 Publish @redux-devtools/utils
This hasn't been published since the upgrade to Redux 5
2024-12-05 15:57:27 -05:00
takanuva15
6e400f68b3
feat(docs): add reference to new intellij redux devtools plugin (#1788) 2024-11-19 20:57:04 -05:00
renovate[bot]
2c65192b4f
fix(deps): update all non-major dependencies (#1778)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-14 18:54:50 +00:00
renovate[bot]
88a02a8332
chore(deps): update all non-major dependencies (#1764)
* chore(deps): update all non-major dependencies

* Combine @types/lodash

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-10-14 08:51:59 -04:00
github-actions[bot]
04858cd514
Version Packages (#1772)
* Version Packages

* Bump version

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-09-21 15:31:15 +00:00
Nathan Bierema
b25bf1304b
Send state from background when monitor connects (#1771)
* Send state from background on connection

* Create green-hats-kick.md
2024-09-21 15:17:43 +00:00
Nathan Bierema
41fae27637
Use pnpm for running scripts instead of nx (#1770)
* Use pnpm for running scripts instead of nx

* Fix typos
2024-09-20 03:06:32 +00:00
Nathan Bierema
fdce076757
Enable linting for extension (#1769)
* Enable linting for extension

* Update lock file
2024-09-20 02:51:22 +00:00
github-actions[bot]
b934e80d23
Version Packages (#1768)
* Version Packages

* Update

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-09-20 01:23:20 +00:00
Nathan Bierema
50d7682776
Fix DevTools from losing connection (#1767)
* Fix DevTools from losing connection

* Create kind-seals-arrive.md
2024-09-20 01:07:52 +00:00
renovate[bot]
344387c9c6
chore(deps): lock file maintenance (#1745)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-16 20:48:34 -04:00
renovate[bot]
80c570d6d0
fix(deps): update dependency msw to ^2.4.7 (#1762)
* fix(deps): update dependency msw to ^2.4.7

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-09-17 00:19:53 +00:00
renovate[bot]
aca0cd09a1
chore(deps): update dependency @chromatic-com/storybook to v2 (#1756)
* chore(deps): update dependency @chromatic-com/storybook to v2

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-09-16 23:44:52 +00:00
renovate[bot]
75dbf74963
chore(deps): update all non-major dependencies (#1746)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-16 19:24:11 -04:00
github-actions[bot]
997f7b636d
Version Packages (#1761)
* Version Packages

* Bump

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-09-16 02:57:02 +00:00
Nathan Bierema
eb3ac09b03
Add logging to background service worker (#1760)
* Add logging in background service worker

* Create ninety-sheep-end.md
2024-09-16 02:19:01 +00:00
renovate[bot]
3c39eb49f2
fix(deps): update dependency msw to ^2.4.4 (#1750)
* fix(deps): update dependency msw to ^2.4.4

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-09-09 16:49:21 -04:00
github-actions[bot]
61c09e1cc3
Version Packages (#1749)
* Version Packages

* Bump

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-09-04 02:07:20 +00:00
Nathan Bierema
f1d61580a8
Fix mocking Chrome API for Electron (#1748)
* Fix mocking Chrome API for Electron

* Create chilled-feet-marry.md
2024-09-04 01:47:16 +00:00
renovate[bot]
c5aef77b85
chore(deps): lock file maintenance (#1744)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 14:02:40 +00:00
renovate[bot]
908e1c11bd
chore(deps): update pnpm to v9 (#1679)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 09:41:09 -04:00
renovate[bot]
d591c18fc8
fix(deps): update dependency msw to ^2.4.1 (#1733)
* fix(deps): update dependency msw to ^2.4.1

* Update msw

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-09-01 13:24:59 +00:00
renovate[bot]
bc4b0755c3
chore(deps): lock file maintenance (#1728)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 12:57:20 +00:00
renovate[bot]
2c8f0a0544
chore(deps): update dependency @types/node to ^20.16.3 (#1743)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 12:43:37 +00:00
renovate[bot]
68d4440e38
chore(deps): update all non-major dependencies (#1729)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-01 08:30:09 -04:00
Nathan Bierema
c52962d532
Use workspace protocol (#1742) 2024-09-01 04:12:24 +00:00
Nathan Bierema
18b86498e2
Remove workspaces from package.json (#1741) 2024-08-31 22:26:53 -04:00
Nathan Bierema
01ee4e99be
Update pnpm setup GitHub Action (#1740) 2024-08-31 21:55:32 +00:00
github-actions[bot]
c133d59461
Version Packages (#1738)
* Version Packages

* Update

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-08-31 21:23:43 +00:00
Nathan Bierema
fd9f9504f0
Fix monitoring on opening panel (#1739)
* Fix monitoring on opening panel

* Create polite-foxes-rest.md

* Further cleanup

* Fix

* Simplify

* ===
2024-08-31 21:10:34 +00:00
Nathan Bierema
e49708d831
Fix manifest.json for Edge (#1737)
* Fix manifest.json for Edge

* Create unlucky-dots-hammer.md
2024-08-31 13:22:13 +00:00
github-actions[bot]
f64cbda982
Version Packages (#1736)
* Version Packages

* Bump

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-08-31 03:38:12 +00:00
Nathan Bierema
abd03a70c7
Fix: only send data to extension if DevTools are open (#1735)
* Fix: only send data to extension if DevTools are open

* Create odd-apples-argue.md
2024-08-30 23:26:39 -04:00
Nathan Bierema
b3e8f209fd
Remove more unnecessary use of lodash (#1734) 2024-08-30 19:07:05 -04:00
renovate[bot]
238a38fb21
fix(deps): update dependency @rjsf/core to v5 (#1409)
* fix(deps): update dependency @rjsf/core to v5

* redux-devtools-ui

* Update

* Update

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-08-26 03:16:10 +00:00
renovate[bot]
76183cfa43
chore(deps): lock file maintenance (#1715)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-26 02:11:43 +00:00
renovate[bot]
9fa9a6ff79
fix(deps): update all non-major dependencies (#1713)
* fix(deps): update all non-major dependencies

* weird

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-08-26 01:53:07 +00:00
github-actions[bot]
2a93de46a1
Version Packages (#1720)
* Version Packages

* Bump version numbers

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-08-17 19:25:57 +00:00
Nathan Bierema
83b2c19a11
Upgrade to Manifest V3 (#1714)
* Update Chrome manifest.json

* Remove use of window in background

* Test devpanel

* Inject pageScript using new API

* Keep connection from devpanel to background alive

* Keep connection from content script to background alive

* Replace page action with action

* Cleanup syncOptions

* Update options to not rely on background page access

* Start work on updating popup

* Updates

* Remove window

* Get opening in a separate window working

* Remove pageScriptWrap

* Add socket to panelStore

* Fix tests

* Try to use MV3 for Firefox

* Fix path

* Fix Chrome E2E tests

* Revert unintentional change

* Skip Electron tests for now

Looks like they're still working through stuff in https://github.com/electron/electron/issues/41613

* Better image centering

The Firefox popup did not like the old CSS. This is still not perfect, but it's better than it was.

* Create shaggy-taxis-cross.md
2024-08-17 19:11:46 +00:00
Nathan Bierema
61ec00f505
Remove unnecessary lodash usage from bundles (#1718)
* Use lodash-es instead of lodash in extension

Produces (slightly) smaller bundles

* Use lodash-es instead of lodash in instrument

* Use lodash-es instead of lodash in utils

* Use lodash-es instead of lodash in redux-devtools

* Remove lodash from instrument

* Remove lodash from redux-devtools

* Remove lodash from utils

* Remove unnecessary mapValues from extension
2024-08-13 23:42:16 -04:00
github-actions[bot]
7f41fcf0fc
Version Packages (#1717)
* Version Packages

* Trigger build

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-08-14 02:38:19 +00:00
Nathan Bierema
73688e117a
Fix releasing Firefox extension (#1716)
* Fix releasing Firefox extension

The lowest supported "strict_min_version" is 58.0.

* Create shiny-chicken-hammer.md

* Revert "Fix releasing Firefox extension"

This reverts commit 92881382b2.

* Keep the id
2024-08-14 02:25:26 +00:00
Nathan Bierema
4164b6279e
Use flat config for ESLint (#1712)
* d3tooltip

* map2tree

* d3-state-visualizer

* react-base16-styling

* react-dock

* Cleanup

* Update

* react-json-tree

* redux-devtools

* redux-devtools-app

* redux-devtools-app-core

* redux-devtools-cli

* Fix

* redux-devtools-dock-monitor

* redux-devtools-extension

* redux-devtools-inspector-monitor

* redux-devtools-inspector-monitor-test-tab

* redux-devtools-inspector-monitor-trace-tab

* redux-devtools-instrument

* Simplify

* redux-devtools-log-monitor

* redux-devtools-remote

* redux-devtools-rtk-query-monitor

* redux-devtools-serialize

* redux-devtools-slider-monitor

* redux-devtools-utils

* Format
2024-08-08 23:47:07 -04:00
renovate[bot]
9b2f8720c9
chore(deps): lock file maintenance (#1702)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-06 03:46:44 +00:00
renovate[bot]
0bd66c7388
fix(deps): update all non-major dependencies (#1701)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-06 03:27:22 +00:00
Nathan Bierema
8682d05b0b
Update Redux packages (#1583)
* Update Redux packages

* Fix instrument build

* Fix some test type errors

* Fix redux-devtools build

* Fix rtk-query-monitor build

* Fix redux-devtools-app build

* Fix redux-devtools-extension build

* Fix redux-devtools-remote build

* Fix extension build

* slider-monitor-example

* test-tab-demo

* inspector-monitor-demo

* rtk-query-monitor-demo

* counter-example

* todomvc-example

* Fix lint

* Fix instrument test types

* Fix core tests

* Fix rtk-query-monitor tests

* Updates
2024-08-05 23:11:13 -04:00
renovate[bot]
bd463b19ec
chore(deps): update typescript-eslint monorepo to v8 (major) (#1710)
* chore(deps): update typescript-eslint monorepo to v8

* instrument

* react-base16-styling

* Disable react/prop-types

* react-json-tree

* redux-devtools-ui

* inspector-monitor

* react-dock

* log-monitor

* map2tree

* d3-state-visualizer

* test-tab

* rtk-query-monitor

* slider-monitor

* trace-tab

* chart-monitor

* app-core

* utils

* test-tab-demo

* inspector-monitor-demo

* redux-devtools-counter-demo

* redux-devtools-todomvc-demo

* remote

* cli

* react-dock-demo

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-08-05 00:38:28 +00:00
renovate[bot]
0462470dca
fix(deps): update dependency msw to ^2.3.5 (#1709)
* fix(deps): update dependency msw to ^2.3.5

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-08-04 21:51:57 +00:00
Nathan Bierema
9a78f414ae Update extension version number 2024-08-04 15:33:29 -04:00
github-actions[bot]
652bcfa7f8
Version Packages (#1708)
* Version Packages

* Trigger build

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-08-04 15:31:41 -04:00
Nathan Bierema
2163bc3f09
Split large messages sent from background page to devpanel (#1706)
* Split messages sent to devpanel

* Types

* Create ninety-files-obey.md
2024-08-04 15:05:37 -04:00
renovate[bot]
6cf528b4a0
chore(deps): lock file maintenance (#1700)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-20 13:51:46 +00:00
renovate[bot]
ae3f4e59f5
fix(deps): update dependency msw to ^2.3.2 (#1699)
* fix(deps): update dependency msw to ^2.3.2

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-07-20 13:33:49 +00:00
renovate[bot]
fce9074175
chore(deps): update all non-major dependencies (#1698)
* chore(deps): update all non-major dependencies

* Update snapshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-07-20 09:17:14 -04:00
Nathan Bierema
3184647fa9
Remove deprecated packages (#1697) 2024-07-16 13:56:20 -04:00
renovate[bot]
4c73661e78
chore(deps): lock file maintenance (#1696)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-16 16:27:25 +00:00
renovate[bot]
23f1c47224
chore(deps): update dependency rimraf to v6 (#1695)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-07-16 15:35:07 +00:00
renovate[bot]
2c1a74cdff
chore(deps): update dependency @types/uuid to v10 (#1691)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-07-16 13:53:15 +00:00
renovate[bot]
baed7ccd07
fix(deps): update all non-major dependencies (#1694)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-16 13:40:53 +00:00
renovate[bot]
443b993f6a
chore(deps): update all non-major dependencies (#1689)
* chore(deps): update all non-major dependencies

* Format

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-07-16 13:24:47 +00:00
renovate[bot]
65126657cb
chore(deps): update dependency typescript to ~5.5.2 (#1690)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-20 16:56:57 -04:00
Nathan Bierema
42e11518f3 Add content script notes 2024-06-14 17:51:14 -04:00
Nathan Bierema
5e81525818 Add initial architecture notes 2024-06-12 23:30:55 -04:00
renovate[bot]
1735536bd6
chore(deps): lock file maintenance (#1686)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-12 16:26:41 +00:00
renovate[bot]
51e46328a5
chore(deps): update all non-major dependencies (#1669)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-12 15:57:19 +00:00
renovate[bot]
b55cdf0aea
chore(deps): update dependency typescript to ~5.4.5 (#1685)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-12 15:43:31 +00:00
renovate[bot]
cacf7cf182
fix(deps): update dependency electron to v31 (#1682)
* fix(deps): update dependency electron to v31

* chore(deps): update dependency chromedriver to v126

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-12 15:26:21 +00:00
Nathan Bierema
a1fe1a4018 Fix redux-devtools-app prepublish script 2024-06-12 10:05:37 -04:00
github-actions[bot]
08336c06ca
Version Packages (#1683)
* Version Packages

* Updates

* Updates

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-12 13:57:30 +00:00
Nathan Bierema
76711b7ee1
Fix pnpm-lock.yaml (#1684) 2024-06-12 13:42:09 +00:00
Matt Oakes
96ac1f291a
Move the logic from @redux-devtools/app into @redux-devtools/app-core (#1655)
This change splits out the main logic from the Redux Devtools App into a new
core package but keeps the socket connection management in @redux-devtools/app.
The aim is to allow for easier reuse of the rest of the app in other envioronments
with their own transport methods, such as React Native or Electron.
2024-06-12 09:18:46 -04:00
renovate[bot]
a4382ecb9c
fix(deps): update dependency electron to v30 (#1676)
* fix(deps): update dependency electron to v30

* Test installing chromedriver

* Test

* Revert "Test"

This reverts commit 473f872a77.

* Test

* Update

* Typo? :fingers-crossed:

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-09 22:48:52 -04:00
renovate[bot]
d9cdc25cb2
chore(deps): update testing-library monorepo (major) (#1675)
* chore(deps): update testing-library monorepo

* Add deps

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-10 01:14:22 +00:00
renovate[bot]
819000df9b
fix(deps): update dependency uuid to v10 (#1677)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-10 01:02:15 +00:00
renovate[bot]
35fb9b12f4
chore(deps): update dependency supertest to v7 (#1674)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-10 00:49:13 +00:00
renovate[bot]
d5bbd78c52
chore(deps): update dependency style-loader to v4 (#1673)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-10 00:36:47 +00:00
renovate[bot]
25aeba0bd8
chore(deps): update dependency nx to v19 (#1672)
* chore(deps): update dependency nx to v19

* chore(deps): update dependency @nrwl/nx-cloud to v19

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-10 00:26:05 +00:00
renovate[bot]
846ded1c74
chore(deps): update dependency eslint-plugin-jest to v28 (#1671)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-10 00:13:51 +00:00
renovate[bot]
04d141932d
chore(deps): update dependency typescript to ~5.4.5 (#1628)
* chore(deps): update dependency typescript to ~5.4.5

* Fix

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-09 23:15:11 +00:00
renovate[bot]
1fc9f76e50
chore(deps): lock file maintenance (#1667)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-09 23:01:48 +00:00
renovate[bot]
249b3a030b
chore(deps): update dependency css-loader to v7 (#1666)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-09 22:49:11 +00:00
Nathan Bierema
612a23488d
Revert "chore(deps): update pnpm to v9 (#1664)" (#1668)
This reverts commit 367fce39e6.
2024-06-09 22:34:00 +00:00
renovate[bot]
367fce39e6
chore(deps): update pnpm to v9 (#1664)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-07 02:47:09 +00:00
renovate[bot]
57755f6f7d
chore(deps): update dependency pug to ^3.0.3 (#1663)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-07 02:35:26 +00:00
renovate[bot]
9c1b1b84b8
fix(deps): update dependency msw to ^2.3.1 (#1656)
* fix(deps): update dependency msw to ^2.3.1

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-07 02:21:49 +00:00
renovate[bot]
6842c895d5
chore(deps): lock file maintenance (#1662)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-06 22:00:30 -04:00
renovate[bot]
911b063fba
fix(deps): update all non-major dependencies (#1637)
* fix(deps): update all non-major dependencies

* Fix

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-06-07 01:21:49 +00:00
github-actions[bot]
c8cf847681
Version Packages (#1651)
* Version Packages

* Update lock file

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-04-07 21:19:20 +00:00
Nathan Bierema
af486b01e9 Make releases minors for 0.x 2024-04-07 17:08:00 -04:00
Nathan Bierema
bbb1a40395
Convert React packages to ESM (#1650)
* react-base16-styling

* Use inline react-base16-styling themes

* Fix

* Format

* Fix

* Fixes

* Transform more

* react-json-tree

* Update lock

* Remove unnecessary

* react-dock

* Move to dep

* Lock

* Fix

* Fix

* Create tame-eagles-relax.md
2024-04-07 21:04:45 +00:00
github-actions[bot]
18cde73771
Version Packages (#1649)
* Version Packages

* Force rebuild

* Update

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-04-07 00:05:15 -04:00
Nathan Bierema
191d419773
Convert d3 packages to ESM (#1648)
* d3tooltip

* Add back type-check

* Remove dependency

* map2tree

* Use lodash-es

* Update jest invocation

* Transform lodash-es

* d3-state-visualizer

* Use module: node16

* Update

* Create chilly-fans-hunt.md
2024-04-07 03:44:14 +00:00
Nathan Bierema
629419bd1b
Upgrade to Storybook 7 (#1647)
* Remove storybook

* Install storybook

* Fix

* Format

* Update

* Disable background
2024-04-01 20:48:58 +00:00
github-actions[bot]
b56a3aa0dc
Version Packages (#1646)
* Version Packages

* Trigger build

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-04-01 20:31:36 +00:00
Nathan Bierema
f3878541c2
Revert "Add polyfill for Symbol.asyncIterator (#1642)" (#1645)
* Revert "Add polyfill for Symbol.asyncIterator (#1642)"

This reverts commit 138f4f37b6.

* Create silly-windows-flow.md
2024-04-01 20:19:53 +00:00
github-actions[bot]
075e9f6099
Version Packages (#1643)
* Version Packages

* Trigger build

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-03-28 16:43:54 +00:00
Nathan Bierema
138f4f37b6
Add polyfill for Symbol.asyncIterator (#1642)
* Add polyfill for Symbol.asyncIterator

* Create tame-dancers-fail.md

* Format
2024-03-28 16:20:08 +00:00
renovate[bot]
8f166edc73
chore(deps): update dependency @types/copy-webpack-plugin to v10 (#1639)
* chore(deps): update dependency @types/copy-webpack-plugin to v10

* Remove unnecessary (?) type packages

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-03-26 17:50:57 -04:00
renovate[bot]
9545a46c5d
chore(deps): lock file maintenance (#1638)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-26 17:24:52 -04:00
renovate[bot]
cb4772fa2c
fix(deps): update all non-major dependencies (#1633)
* fix(deps): update all non-major dependencies

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-03-26 21:01:02 +00:00
Chris deWolf
ab7df4cdd6
updated documentation link that was resolving to a 404 (#1635) 2024-03-15 01:50:19 +00:00
renovate[bot]
2eddfd60a8
chore(deps): lock file maintenance (#1631)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-07 23:03:36 -05:00
renovate[bot]
dc6b584ad0
fix(deps): update all non-major dependencies (#1627)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-07 22:38:44 -05:00
renovate[bot]
5c6aa8aa0a
chore(deps): update typescript-eslint monorepo to v7 (#1630)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-08 03:25:24 +00:00
renovate[bot]
4c6add7aa2
chore(deps): update dependency webpack-dev-server to v5 (#1629)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-07 22:13:07 -05:00
renovate[bot]
f282e26a59
fix(deps): update dependency msw to ^2.2.3 (#1606)
* fix(deps): update dependency msw to ^2.2.3

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-03-08 02:57:43 +00:00
renovate[bot]
d0b89ca577
chore(deps): update dependency nx to v18 (#1615)
* chore(deps): update dependency nx to v18

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-03-08 02:19:40 +00:00
renovate[bot]
d76df9985f
chore(deps): update dependency @nrwl/nx-cloud to v18 (#1611)
* chore(deps): update dependency @nrwl/nx-cloud to v18

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-03-08 02:02:15 +00:00
renovate[bot]
3b7bca2dbb
chore(deps): lock file maintenance (#1616)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-23 21:31:30 -05:00
renovate[bot]
6b80162ca9
chore(deps): update all non-major dependencies (#1613)
* chore(deps): update all non-major dependencies

* Fix

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-02-23 23:18:02 +00:00
renovate[bot]
3c44f223f5
chore(deps): lock file maintenance (#1607)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-08 23:18:19 +00:00
renovate[bot]
fe9a3674e0
chore(deps): update all non-major dependencies (#1605)
* chore(deps): update all non-major dependencies

* Format

* Temporarily downgrade @types/redux-logger

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-02-08 18:01:24 -05:00
renovate[bot]
eba12e74f0
chore(deps): update nrwl monorepo (major) (#1511)
* chore(deps): update nrwl monorepo

* Add .nx/cache to gitignore

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-24 03:15:48 +00:00
renovate[bot]
8257f616f5
fix(deps): update dependency msw to ^2.1.4 (#1599)
* fix(deps): update dependency msw to ^2.1.4

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-24 03:00:09 +00:00
renovate[bot]
9e4e054f8b
fix(deps): update dependency jsondiffpatch to ^0.6.0 (#1586)
* fix(deps): update dependency jsondiffpatch to ^0.6.0

* Cleanup renovate.json

* Code updates

* Update test config

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-23 21:48:11 -05:00
Nathan Bierema
31aabfa82c
Use moduleResolution bundler (#1571) 2024-01-24 02:14:03 +00:00
renovate[bot]
7b90e75e03
fix(deps): update dependency react-icons to v5 (#1604)
* fix(deps): update dependency react-icons to v5

* Update snapshot

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-24 02:03:00 +00:00
renovate[bot]
8f3b306a66
fix(deps): update dependency framer-motion to v11 (#1603)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-24 01:42:21 +00:00
renovate[bot]
57af776834
chore(deps): update dependency html-loader to v5 (#1602)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-24 01:27:44 +00:00
renovate[bot]
c3497c1b17
chore(deps): update dependency copy-webpack-plugin to v12 (#1601)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-23 20:16:53 -05:00
renovate[bot]
eff9410828
chore(deps): lock file maintenance (#1600)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-08 21:29:55 -05:00
renovate[bot]
264f076252
fix(deps): update all non-major dependencies (#1598)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-08 21:09:49 -05:00
renovate[bot]
a0db02b31e
chore(deps): update dependency typescript to ~5.3.3 (#1581)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-07 23:08:46 +00:00
renovate[bot]
eff9bee92d
fix(deps): update dependency msw to ^2.0.12 (#1597)
* fix(deps): update dependency msw to ^2.0.12

* Update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-07 17:57:05 -05:00
github-actions[bot]
baf484adbc
Version Packages (#1593)
* Version Packages

* Trigger build

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-01 21:49:58 +00:00
renovate[bot]
c9f2491d7e
chore(deps): lock file maintenance (#1595)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-01 21:35:51 +00:00
renovate[bot]
a3a6eb4cb3
chore(deps): update all non-major dependencies (#1585)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-01 21:18:59 +00:00
renovate[bot]
4dd0dd2d19
fix(deps): update dependency open to v10 (#1592)
* fix(deps): update dependency open to v10

* Update package.json

* Create seven-squids-hammer.md

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-01 21:08:50 +00:00
renovate[bot]
8aa37659b3
chore(deps): update socketcluster to v19 (#1591)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-01 20:54:58 +00:00
renovate[bot]
28a08cde92
chore(deps): update dependency stylelint-config-standard to v36 (#1590)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-01 20:44:26 +00:00
renovate[bot]
1f1d188601
chore(deps): update dependency stylelint to v16 (#1589)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-01 20:31:39 +00:00
renovate[bot]
81e3efd070
chore(deps): update dependency @types/supertest to v6 (#1588)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2024-01-01 20:16:38 +00:00
renovate[bot]
91dd5df25b
chore(deps): update actions/upload-artifact action to v4 (#1587)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-01 15:06:02 -05:00
Nathan Bierema
1b4c36c46a Fix Renovate group name 2024-01-01 11:13:53 -05:00
Nathan Bierema
32d1ee0894 Update Renovate groups 2024-01-01 11:08:45 -05:00
Nathan Bierema
e2e65dbeab Update Renovate groups 2024-01-01 11:05:04 -05:00
renovate[bot]
c42e33437e
chore(deps): lock file maintenance (#1582)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-25 04:40:37 +00:00
renovate[bot]
d4adb601da
fix(deps): update all non-major dependencies (#1555)
* fix(deps): update all non-major dependencies

* Downgrade jsondiffpatch

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-12-24 23:24:56 -05:00
Nathan Bierema
fa7af18888
Upgrade msw (#1580) 2023-12-19 10:06:33 -05:00
Nathan Bierema
00664dcd3e
Downgrade typescript (#1579)
* Downgrade typescript

For msw

* Fix version
2023-12-19 14:13:40 +00:00
Nathan Bierema
b79b2c3bbc
Fix some unbound-method ESLint errors (#1576)
* Fix some unbound-method ESLint errors

* Keep that one
2023-12-17 22:03:02 -05:00
github-actions[bot]
e9afa8fb27
Version Packages (#1577)
* Version Packages

* Update lock file

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-12-18 02:32:58 +00:00
Nathan Bierema
5cfe3e5522
Update min required React version to 16.8.4 (#1578)
* Update min required React version to 16.8.4

* Create breezy-emus-tie.md

* Update lock file
2023-12-18 02:13:35 +00:00
Nathan Bierema
decc035570
Remove support for legacy context (#1575)
* Remove support for legacy context

* Create chatty-walls-burn.md
2023-12-17 20:48:45 -05:00
github-actions[bot]
6f9ef2e941
Version Packages (#1574)
* Version Packages

* Trigger build

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-12-16 17:21:24 +00:00
Nathan Bierema
3205269f8c
[inspector-monitor] Add explicit return types (#1573)
* Cleanup

* Explicitly define return type

* Create violet-hotels-appear.md

* Strip out module augmentation

* Update violet-hotels-appear.md
2023-12-16 17:10:27 +00:00
Nathan Bierema
d165cc7bd9 Bump extension version number 2023-12-13 20:20:26 -05:00
github-actions[bot]
c03264c54d
Version Packages (#1562)
* Version Packages

* Update lock file

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-12-14 01:00:31 +00:00
Nathan Bierema
6954eb9580
[rtk-query-monitor] Replace jss with Emotion (#1568)
* Add Emotion to RTK Query monitor

* Add other Emotion setup

* Start transition

* Convert more styling to Emotion

* Convert more styling to Emotion

* Finish convert styling to Emotion

* import type

* Fix test

* Remove unused styling

* Remove more unused styling

* Remove more unused styling

* Remove jss

* Cleanup

* Create perfect-otters-help.md

* Update perfect-otters-help.md
2023-12-14 00:45:53 +00:00
renovate[bot]
178002de65
chore(deps): update dependency typescript to ~5.3.3 (#1564)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-12 20:54:11 -05:00
Nathan Bierema
ae1bc3aaae
Fix RTK Query demo (#1563)
* Update mockServiceWorker.js

* Separate Renovate group
2023-12-13 00:13:32 +00:00
Nathan Bierema
158ba2ce12
[inspector-monitor] Replace jss with Emotion (#1560)
* Setup Emotion

* Fix setup

* Start conversion

* actionList

* actionListHeader

* actionListRows

* actionListHeaderSelector

* actionListItem

* actionListItemTime

* actionListItemSelector

* actionListItemName

* actionListHeaderSearch

* actionListHeaderWrapper

* actionPreview

* Remaining css

* Format

* Propagate Emotion dependencies

* Fix tests

* Remove styling prop

* Remove jss

* Remove themeState

* Use color map as Emotion theme

* Rework theme resolution

* Inline CSS

* Remove usage of className

* Fix warning

* Create large-spoons-yell.md
2023-12-12 04:02:35 +00:00
Nathan Bierema
b54bc75cbb
Remove prop-types (#1557) 2023-12-10 00:50:15 -05:00
renovate[bot]
37fee5574a
chore(deps): lock file maintenance (#1556)
* chore(deps): lock file maintenance

* Downgrade csstype

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-12-09 23:08:31 -05:00
renovate[bot]
57d97026f3
chore(deps): update all non-major dependencies (#1544)
* chore(deps): update all non-major dependencies

* Downgrade csstype

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-12-10 03:44:13 +00:00
github-actions[bot]
2e4929b3b7
Version Packages (#1552)
* Version Packages

* Trigger build

* Update pnpm-lock.yaml

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-12-09 05:05:25 +00:00
Nathan Bierema
d95a5ff5ca
Fix peer dependency versioning (#1554) 2023-12-09 04:42:26 +00:00
Nathan Bierema
7f5bddbdc2
Widen peer dependencies (#1553)
* Widen peer dependencies

* Create lucky-lobsters-tickle.md

* Update pnpm-lock.yaml
2023-12-09 04:14:28 +00:00
Nathan Bierema
6fc18ed74e
Add new Redux version to peer dependencies (#1551)
* Add new Redux version to peer dependencies

* Create orange-ravens-train.md
2023-12-08 22:41:20 -05:00
github-actions[bot]
8e99d35749
Version Packages (#1550)
* Version Packages

* Trigger build

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-12-08 05:23:56 +00:00
Nathan Bierema
a3f86a42df
Add Redux 5 to peerDependency range of extension package (#1549) 2023-12-08 05:10:33 +00:00
Nathan Bierema
a7d612fbdc
Fix chromedriver issues (#1548)
* Test removing chromedriver

* Remove port

* Try removing it altogether

* Alright, try that

* Attempt to run xvfb directly

* Halfway happy?
2023-12-08 00:15:18 +00:00
renovate[bot]
8979004b53
chore(deps): lock file maintenance (#1543)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-13 23:18:31 +00:00
renovate[bot]
3f5719ec1f
chore(deps): update all non-major dependencies (#1542)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-13 23:00:35 +00:00
renovate[bot]
c723e4a3c8
chore(deps): update all non-major dependencies (#1538)
* chore(deps): update all non-major dependencies

* Format

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-11-13 17:41:31 -05:00
renovate[bot]
057b5e6de7
fix(deps): update dnd-kit monorepo (#1537)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-09 02:23:02 +00:00
renovate[bot]
ba56d5b96d
fix(deps): update dependency nanoid to v5 (#1485)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-11-09 02:05:45 +00:00
renovate[bot]
e8da9f0945
chore(deps): lock file maintenance (#1536)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-09 01:41:25 +00:00
renovate[bot]
487775b206
fix(deps): update all non-major dependencies (#1523)
* fix(deps): update all non-major dependencies

* Update snapshots

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-11-09 01:22:50 +00:00
github-actions[bot]
2ab5bd833e
Version Packages (#1531)
* Version Packages

* Trigger build

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-11-05 14:12:55 +00:00
Nathan Bierema
262ea85ce1
Remove unnecessary exported functions from instrument (#1530)
* Remove unnecessary exported functions from instrument

This avoids importing CombinedState so that the types are compatible with Redux 5

* Create bright-pumpkins-move.md
2023-11-05 13:52:55 +00:00
github-actions[bot]
d57d015de9
Version Packages (#1529)
* Version Packages

* Update lock

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-11-05 04:05:38 +00:00
Nathan Bierema
42531c503e
Bump packages (#1528)
* Random change in instrument

* Create few-crabs-bathe.md

* Revert "Random change in instrument"

This reverts commit 72bdbce860.
2023-11-04 22:29:31 +00:00
github-actions[bot]
11be87f31a
Version Packages (#1527)
* Version Packages

* Update lock file

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-11-04 21:26:10 +00:00
Nathan Bierema
65205f9078
Replace Action<unknown> with Action<string> (#1525)
* Replace Action<unknown> with Action<string>

In anticipation of Redux 5 type changes

* Fix lint errors

* Create yellow-steaks-marry.md
2023-11-04 21:04:23 +00:00
renovate[bot]
963f1963e7
chore(deps): lock file maintenance (#1521)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-28 04:08:29 +00:00
renovate[bot]
e7e43f16b0
fix(deps): update all non-major dependencies (#1519)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-27 23:45:50 -04:00
renovate[bot]
27da2edc1a
fix(deps): update dependency knex to v3 (#1515)
* fix(deps): update dependency knex to v3

* Consolidate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-10-24 21:58:55 +00:00
renovate[bot]
46911b13dd
chore(deps): update dependency rollup to v4 (#1510)
* chore(deps): update dependency rollup to v4

* Consolidate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-10-24 21:37:13 +00:00
renovate[bot]
c781ac0624
chore(deps): update dependency @types/node to v20 (#1513)
* chore(deps): update dependency @types/node to v20

* Consolidate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-10-24 21:15:35 +00:00
renovate[bot]
b649e13f5b
chore(deps): update dependency fork-ts-checker-webpack-plugin to v9 (#1504)
* chore(deps): update dependency fork-ts-checker-webpack-plugin to v9

* Consolidate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-10-24 20:44:53 +00:00
renovate[bot]
c6464ef371
chore(deps): update actions/setup-node action to v4 (#1512)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-10-24 20:20:18 +00:00
renovate[bot]
669c87b9f4
chore(deps): lock file maintenance (#1514)
* chore(deps): lock file maintenance

* Consolidate

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-10-24 19:59:14 +00:00
renovate[bot]
8a216f531e
fix(deps): update all non-major dependencies (#1503)
* fix(deps): update all non-major dependencies

* Combine

* Update to Chrome 118

* Update snapshot

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-10-24 15:18:38 -04:00
renovate[bot]
986acf4e73
chore(deps): lock file maintenance (#1484)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-27 09:52:17 -04:00
renovate[bot]
508506fe90
fix(deps): update dependency electron to ^26.2.2 (#1502)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-09-27 13:25:18 +00:00
dependabot[bot]
cacd101481
Bump graphql from 16.8.0 to 16.8.1 (#1500)
Bumps [graphql](https://github.com/graphql/graphql-js) from 16.8.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](https://github.com/graphql/graphql-js/compare/v16.8.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-09-27 13:06:01 +00:00
dependabot[bot]
c280ec5988
Bump electron from 26.1.0 to 26.2.1 (#1498)
Bumps [electron](https://github.com/electron/electron) from 26.1.0 to 26.2.1.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](https://github.com/electron/electron/compare/v26.1.0...v26.2.1)

---
updated-dependencies:
- dependency-name: electron
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-27 08:51:57 -04:00
renovate[bot]
20024cfb5b
chore(deps): update all non-major dependencies (#1478)
* chore(deps): update all non-major dependencies

* Fix tests

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-09-27 08:23:14 -04:00
Nick McCurdy
9695e499f2
Replace deprecated action (#1487)
* Use default Node version in CI

GitHub's default Node version doesn't require additional downloads or installations. Currently the LTS and default version are similar, but I think it would be best to stay consistent with the other repositories.

* Replace deprecated action

* Revert "Use default Node version in CI"

This reverts commit b6a1ffd4b5.
2023-09-22 08:57:28 -04:00
github-actions[bot]
840aa45c19
Version Packages (#1495)
* Version Packages

* Update lock

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-09-17 02:27:10 +00:00
Nathan Bierema
7e6d04380b
Transform for await...of syntax for @redux-devtools/remote (#1496)
* Transform for await...of for @redux-devtools/remote

* Create green-bulldogs-serve.md
2023-09-17 02:09:13 +00:00
Nathan Bierema
e57bcb3933
Build @redux-devtools/app UMD using esbuild (#1494)
* Build @redux-devtools/app UMDs using esbuild

* Fix variable being exported

* Remove module.hot

* Include CSS

* Cleanup

* Cleanup

* Create slow-paws-beg.md
2023-09-17 00:13:50 +00:00
github-actions[bot]
f523d06499
Version Packages (#1492)
* Version Packages

* Bump extension versions

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-09-15 01:02:38 +00:00
Nathan Bierema
bca760097b
Fix missing CSS for code editor (#1491)
* Import bundled css files

* Create smart-files-swim.md
2023-09-15 00:42:20 +00:00
github-actions[bot]
ee64102c1d
Version Packages (#1488)
* Version Packages

* Bump version numbers

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-09-13 02:31:31 +00:00
Nathan Bierema
64ed81b09a
Fix extension in Firefox and Chrome Incognito (#1486)
* Fix extension in incognito mode

* Create shy-rings-smile.md

* Update shy-rings-smile.md
2023-09-13 01:55:08 +00:00
renovate[bot]
50f84218cd
chore(deps): update actions/checkout action to v4 (#1479)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-10 22:02:00 +00:00
renovate[bot]
801e1a4cba
chore(deps): lock file maintenance (#1464)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-09-04 15:19:58 +00:00
dependabot[bot]
02e211463b
Bump @apollo/server from 4.9.2 to 4.9.3 (#1475)
Bumps [@apollo/server](https://github.com/apollographql/apollo-server/tree/HEAD/packages/server) from 4.9.2 to 4.9.3.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Changelog](https://github.com/apollographql/apollo-server/blob/main/packages/server/CHANGELOG.md)
- [Commits](https://github.com/apollographql/apollo-server/commits/@apollo/server@4.9.3/packages/server)

---
updated-dependencies:
- dependency-name: "@apollo/server"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-04 11:04:07 -04:00
renovate[bot]
2ca07f5c37
chore(deps): update dependency typescript to ~5.2.2 (#1472)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-04 03:36:52 +00:00
renovate[bot]
92f0e217d4
chore(deps): update all non-major dependencies (#1473)
* chore(deps): update all non-major dependencies

* Use Storybook alpha

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-09-04 03:16:14 +00:00
renovate[bot]
c50bdc02e8
chore(deps): update typescript-eslint monorepo to v6 (major) (#1436)
* chore(deps): update typescript-eslint monorepo to v6

* Fix msw

* Initial updates

* Disable new lint rules

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-09-03 22:56:58 -04:00
Nathan Bierema
4e0620c131
Build extension with esbuild (#1476)
* window.bundle.js seems to work

* minify

* Use API instead of CLI

* Add remote bundle

* Perform code-splitting

* Add background and stop code-splitting

* Add other entrypoints

* Flesh out some more

* Keep going

* Copy to browser directories

* Ignore import type error

* Strip out webpack stuff

* Remove todos

* Remove pug imports

* Fix
2023-08-30 20:59:38 -04:00
renovate[bot]
546c98d406
fix(deps): update dependency electron to v26 (#1455)
* fix(deps): update dependency electron to v26

* Revert chromedriver divergence

* Fix lock file

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-08-30 02:06:16 +00:00
renovate[bot]
391ab8b565
fix(deps): update all non-major dependencies (#1466)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-28 02:49:22 +00:00
github-actions[bot]
ffbf132174
Version Packages (#1469)
* Version Packages

* Update

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nathan Bierema <nbierema@gmail.com>
2023-08-28 02:24:11 +00:00
Nathan Bierema
57751ff933
Add react-dom peerDependency and bump react peerDependency (#1471)
* Add react-dom peerDependency and bump react peerDependency

* Create odd-planets-return.md
2023-08-28 01:49:10 +00:00
Nathan Bierema
b9459ec7ae
Fix copying dist to browser folders (#1470) 2023-08-28 01:27:13 +00:00
Nathan Bierema
d18525b5c7
Increase min-width for popup (#1468)
* Increase min-width for popup

* Create short-lamps-cross.md
2023-08-27 21:09:02 -04:00
604 changed files with 23606 additions and 24914 deletions

View File

@ -6,5 +6,8 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}

15
.gitattributes vendored
View File

@ -1,14 +1 @@
*.js text eol=lf
*.jsx text eol=lf
*.ts text eol=lf
*.tsx text eol=lf
*.json text eol=lf
*.css text eol=lf
*.html text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.graphql text eol=lf
.eslintrc text eol=lf
.prettierrc text eol=lf
.babelrc text eol=lf
.stylelintrc text eol=lf
* text=auto eol=lf

View File

@ -8,15 +8,12 @@ on:
jobs:
build:
runs-on: ubuntu-latest
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
@ -29,6 +26,6 @@ jobs:
- name: Lint
run: pnpm run lint:all
- name: Test
uses: GabrielBB/xvfb-action@v1
uses: coactions/setup-xvfb@v1
with:
run: pnpm run test:all

View File

@ -10,18 +10,18 @@ permissions: write-all
jobs:
release:
name: Release
runs-on: ubuntu-latest
runs-on: 'ubuntu-22.04'
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
@ -40,19 +40,19 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Archive Chrome Extension
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: chrome
path: extension/chrome/dist
- name: Archive Edge Extension
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: edge
path: extension/edge/dist
- name: Archive Firefox Extension
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: firefox
path: extension/firefox/dist

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ coverage
.idea
.eslintcache
!packages/redux-devtools-slider-monitor/examples/todomvc/dist/index.html
.nx

View File

@ -24,7 +24,7 @@ It can be used as a browser extension (for [Chrome](https://chrome.google.com/we
## Development
This is a monorepo powered by [pnpm](https://pnpm.io/) and [Nx](https://nx.dev/). [Install pnpm](https://pnpm.io/installation) and run `pnpm install` to get started. Each package's dependencies need to be built before the package itself can be built. You can either build all the packages (i.e., `pnpm run build:all`) or use Nx commands to build only the packages necessary for the packages you're working on (i.e., `pnpm nx build remotedev-redux-devtools-extension`).
This is a monorepo powered by [pnpm](https://pnpm.io/). [Install pnpm](https://pnpm.io/installation) and run `pnpm install` to get started. Each package's dependencies need to be built before the package itself can be built. You can either build all the packages (i.e., `pnpm run build:all`) or use pnpm workspace commands to build only the packages necessary for the packages you're working on (i.e., `pnpm --filter "remotedev-redux-devtools-extension" build`).
## Backers

View File

@ -0,0 +1,4 @@
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
export default [eslint.configs.recommended, eslintConfigPrettier];

View File

@ -0,0 +1,43 @@
import eslint from '@eslint/js';
import react from 'eslint-plugin-react';
import { fixupPluginRules } from '@eslint/compat';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import jest from 'eslint-plugin-jest';
import eslintConfigPrettier from 'eslint-config-prettier';
export default [
{
files: ['test/**/*.js', 'test/**/*.jsx'],
...eslint.configs.recommended,
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
...react.configs.flat.recommended,
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
plugins: {
'react-hooks': fixupPluginRules(eslintPluginReactHooks),
},
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
...jest.configs['flat/recommended'],
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
...jest.configs['jest/style'],
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
...eslintConfigPrettier,
},
];

55
eslint.ts.config.base.mjs Normal file
View File

@ -0,0 +1,55 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
export default (tsconfigRootDir, files = ['**/*.ts'], project = true) => [
{
files,
...eslint.configs.recommended,
},
...tseslint.configs.recommendedTypeChecked.map((config) => ({
files,
...config,
})),
...tseslint.configs.stylisticTypeChecked.map((config) => ({
files,
...config,
})),
{
files,
languageOptions: {
parserOptions: {
project,
tsconfigRootDir,
},
},
},
{
files,
...eslintConfigPrettier,
},
{
files,
rules: {
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/class-literal-property-style': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/no-duplicate-type-constituents': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/prefer-function-type': 'off',
},
},
];

View File

@ -0,0 +1,64 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import jest from 'eslint-plugin-jest';
import eslintConfigPrettier from 'eslint-config-prettier';
export default (tsconfigRootDir) => [
{
files: ['test/**/*.ts'],
...eslint.configs.recommended,
},
...tseslint.configs.recommendedTypeChecked.map((config) => ({
files: ['test/**/*.ts'],
...config,
})),
...tseslint.configs.stylisticTypeChecked.map((config) => ({
files: ['test/**/*.ts'],
...config,
})),
{
files: ['test/**/*.ts'],
languageOptions: {
parserOptions: {
project: ['./tsconfig.test.json'],
tsconfigRootDir,
},
},
},
{
files: ['test/**/*.ts'],
...jest.configs['flat/recommended'],
},
{
files: ['test/**/*.ts'],
...jest.configs['jest/style'],
},
{
files: ['test/**/*.ts'],
...eslintConfigPrettier,
},
{
files: ['test/**/*.ts'],
rules: {
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/class-literal-property-style': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/no-duplicate-type-constituents': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/prefer-function-type': 'off',
},
},
];

View File

@ -0,0 +1,89 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import { fixupPluginRules } from '@eslint/compat';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import eslintConfigPrettier from 'eslint-config-prettier';
export default (
tsconfigRootDir,
files = ['**/*.ts', '**/*.tsx'],
project = true,
) => [
{
files,
...eslint.configs.recommended,
},
...tseslint.configs.recommendedTypeChecked.map((config) => ({
files,
...config,
})),
...tseslint.configs.stylisticTypeChecked.map((config) => ({
files,
...config,
})),
{
files,
languageOptions: {
parserOptions: {
project,
tsconfigRootDir,
},
},
},
{
files,
...react.configs.flat.recommended,
},
{
files,
settings: {
react: {
version: 'detect',
},
},
},
{
files,
plugins: {
'react-hooks': fixupPluginRules(eslintPluginReactHooks),
},
},
{
files,
...eslintConfigPrettier,
},
{
files,
rules: {
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: {
attributes: false,
},
},
],
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/class-literal-property-style': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/no-duplicate-type-constituents': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/prefer-function-type': 'off',
'react/prop-types': 'off',
},
},
];

View File

@ -0,0 +1,85 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import { fixupPluginRules } from '@eslint/compat';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import jest from 'eslint-plugin-jest';
import eslintConfigPrettier from 'eslint-config-prettier';
export default (tsconfigRootDir) => [
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
...eslint.configs.recommended,
},
...tseslint.configs.recommendedTypeChecked.map((config) => ({
files: ['test/**/*.ts', 'test/**/*.tsx'],
...config,
})),
...tseslint.configs.stylisticTypeChecked.map((config) => ({
files: ['test/**/*.ts', 'test/**/*.tsx'],
...config,
})),
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
languageOptions: {
parserOptions: {
project: ['./tsconfig.test.json'],
tsconfigRootDir,
},
},
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
...react.configs.flat.recommended,
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
plugins: {
'react-hooks': fixupPluginRules(eslintPluginReactHooks),
},
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
...jest.configs['flat/recommended'],
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
...jest.configs['jest/style'],
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
...eslintConfigPrettier,
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
rules: {
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/consistent-indexed-object-style': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/class-literal-property-style': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/no-duplicate-type-constituents': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/prefer-function-type': 'off',
},
},
];

View File

@ -1,3 +0,0 @@
{
"parser": "@babel/eslint-parser"
}

View File

@ -1,17 +0,0 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier"
],
"rules": {
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off"
}
}

View File

@ -1,18 +0,0 @@
{
"plugins": ["jest"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:jest/recommended",
"plugin:jest/style",
"prettier"
],
"rules": {
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off"
}
}

View File

@ -1,37 +0,0 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["@typescript-eslint", "react"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"prettier"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": {
"attributes": false
}
}
]
}
}

View File

@ -1,20 +0,0 @@
{
"plugins": ["jest"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jest/recommended",
"plugin:jest/style",
"prettier"
],
"rules": {
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off"
}
}

View File

@ -1,3 +0,0 @@
node_modules
dist
examples

View File

@ -1,31 +0,0 @@
{
"root": true,
"extends": "eslint-config-airbnb",
"globals": {
"chrome": true,
"__DEVELOPMENT__": true
},
"env": {
"browser": true,
"node": true
},
"rules": {
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/react-in-jsx-scope": 2,
"react/jsx-quotes": 0,
"block-scoped-var": 0,
"padded-blocks": 0,
"quotes": [1, "single"],
"comma-style": [2, "last"],
"no-use-before-define": [0, "nofunc"],
"func-names": 0,
"prefer-const": 0,
"comma-dangle": 0,
"id-length": 0,
"indent": [2, 2, { "SwitchCase": 1 }],
"new-cap": [2, { "capIsNewExceptions": ["Test"] }],
"default-case": 0
},
"plugins": ["react"]
}

View File

@ -1,5 +1,159 @@
# remotedev-redux-devtools-extension
## 3.2.10
### Patch Changes
- @redux-devtools/app@6.2.2
## 3.2.9
### Patch Changes
- Updated dependencies [91f21b2]
- @redux-devtools/core@4.1.1
- @redux-devtools/slider-monitor@5.1.1
- @redux-devtools/utils@3.1.1
- @redux-devtools/app@6.2.1
## 3.2.8
### Patch Changes
- Updated dependencies [6830118]
- react-json-tree@0.20.0
- @redux-devtools/app@6.2.0
- @redux-devtools/slider-monitor@6.0.0
- @redux-devtools/ui@1.4.0
- @redux-devtools/core@4.1.0
- @redux-devtools/utils@4.0.0
## 3.2.7
### Patch Changes
- b25bf13: Send state from background when monitor connects
## 3.2.6
### Patch Changes
- 50d7682: Fix DevTools from losing connection
## 3.2.5
### Patch Changes
- eb3ac09: Add logging to background service worker
## 3.2.4
### Patch Changes
- f1d6158: Fix mocking Chrome API for Electron
## 3.2.3
### Patch Changes
- fd9f950: Fix monitoring on opening panel
- e49708d: Fix manifest.json for Edge
## 3.2.1
### Patch Changes
- abd03a7: Fix: only send data to extension if DevTools are open
## 3.2.0
### Minor Changes
- 83b2c19: Upgrade to Manifest V3
## 3.1.11
### Patch Changes
- 73688e1: Fix releasing Firefox extension
## 3.1.10
### Patch Changes
- 2163bc3: Split large messages sent from background page to devpanel
## 3.1.9
### Patch Changes
- Updated dependencies [bbb1a40]
- react-json-tree@0.19.0
- @redux-devtools/slider-monitor@5.0.1
- @redux-devtools/ui@1.3.2
## 3.1.8
### Patch Changes
- 191d419: Convert d3 packages to ESM
- Updated dependencies [191d419]
- @redux-devtools/app@6.0.1
## 3.1.7
### Patch Changes
- Updated dependencies [5cfe3e5]
- Updated dependencies [decc035]
- @redux-devtools/app@6.0.0
- @redux-devtools/slider-monitor@5.0.0
- @redux-devtools/core@4.0.0
- @redux-devtools/utils@3.0.0
## 3.1.6
### Patch Changes
- Updated dependencies [158ba2c]
- @redux-devtools/app@5.0.0
## 3.1.5
### Patch Changes
- 65205f90: Replace Action<unknown> with Action<string>
- Updated dependencies [65205f90]
- @redux-devtools/app@4.0.1
- @redux-devtools/core@3.13.2
## 3.1.4
### Patch Changes
- Updated dependencies [e57bcb39]
- @redux-devtools/app@4.0.0
## 3.1.3
### Patch Changes
- bca76009: Fix missing CSS for code editor
## 3.1.2
### Patch Changes
- 64ed81b0: Fix extension in Firefox and Chrome Incognito
## 3.1.1
### Patch Changes
- d18525b5: Increase min-width of popup
- Updated dependencies [57751ff9]
- @redux-devtools/app@3.0.0
## 3.1.0
### Minor Changes

View File

@ -13,8 +13,8 @@
- from [Chrome Web Store](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd);
- or download `extension.zip` from [last releases](https://github.com/zalmoxisus/redux-devtools-extension/releases), unzip, open `chrome://extensions` url and turn on developer mode from top left and then click; on `Load Unpacked` and select the extracted folder for use
- or build it with `npm i && npm run build:extension` and [load the extension's folder](https://developer.chrome.com/extensions/getstarted#unpacked) `./build/extension`;
- or run it in dev mode with `npm i && npm start` and [load the extension's folder](https://developer.chrome.com/extensions/getstarted#unpacked) `./dev`.
- or build it with `npm i && npm run build:extension` and [load the extension's folder](https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world#load-unpacked) `./build/extension`;
- or run it in dev mode with `npm i && npm start` and [load the extension's folder](https://developer.chrome.com/docs/extensions/get-started/tutorial/hello-world#load-unpacked) `./dev`.
### 2. For Firefox

55
extension/build.mjs Normal file
View File

@ -0,0 +1,55 @@
import * as fs from 'node:fs';
import * as esbuild from 'esbuild';
import pug from 'pug';
const args = process.argv.slice(2);
const prod = !args.includes('--dev');
await esbuild.build({
bundle: true,
logLevel: 'info',
outdir: 'dist',
minify: prod,
sourcemap: !prod,
define: {
'process.env.NODE_ENV': prod ? '"production"' : '"development"',
'process.env.BABEL_ENV': prod ? '"production"' : '"development"',
},
entryPoints: [
{ out: 'background.bundle', in: 'src/background/index.ts' },
{ out: 'options.bundle', in: 'src/options/index.tsx' },
{ out: 'remote.bundle', in: 'src/remote/index.tsx' },
{ out: 'devpanel.bundle', in: 'src/devpanel/index.tsx' },
{ out: 'devtools.bundle', in: 'src/devtools/index.ts' },
{ out: 'content.bundle', in: 'src/contentScript/index.ts' },
{ out: 'page.bundle', in: 'src/pageScript/index.ts' },
],
loader: {
'.woff2': 'file',
},
});
console.log();
console.log('Creating HTML files...');
const htmlFiles = ['devpanel', 'devtools', 'options', 'remote'];
for (const htmlFile of htmlFiles) {
fs.writeFileSync(
`dist/${htmlFile}.html`,
pug.renderFile(`src/${htmlFile}/${htmlFile}.pug`),
);
}
console.log('Copying manifest.json...');
fs.copyFileSync('chrome/manifest.json', 'dist/manifest.json');
console.log('Copying assets...');
fs.cpSync('src/assets', 'dist', { recursive: true });
console.log('Copying dist for each browser...');
fs.cpSync('dist', 'chrome/dist', { recursive: true });
fs.copyFileSync('chrome/manifest.json', 'chrome/dist/manifest.json');
fs.cpSync('dist', 'edge/dist', { recursive: true });
fs.copyFileSync('edge/manifest.json', 'edge/dist/manifest.json');
fs.cpSync('dist', 'firefox/dist', { recursive: true });
fs.copyFileSync('firefox/manifest.json', 'firefox/dist/manifest.json');

View File

@ -1,28 +1,22 @@
{
"version": "3.1.0",
"version": "3.2.10",
"name": "Redux DevTools",
"description": "Redux DevTools for debugging application's state changes.",
"homepage_url": "https://github.com/reduxjs/redux-devtools",
"manifest_version": 2,
"page_action": {
"manifest_version": 3,
"action": {
"default_icon": "img/logo/gray.png",
"default_title": "Redux DevTools",
"default_popup": "window.html#popup"
"default_popup": "devpanel.html#popup"
},
"commands": {
"devtools-left": {
"description": "DevTools window to left"
},
"devtools-right": {
"description": "DevTools window to right"
},
"devtools-bottom": {
"description": "DevTools window to bottom"
"devtools-window": {
"description": "DevTools window"
},
"devtools-remote": {
"description": "Remote DevTools"
},
"_execute_page_action": {
"_execute_action": {
"suggested_key": {
"default": "Ctrl+Shift+E"
}
@ -34,36 +28,37 @@
"128": "img/logo/128x128.png"
},
"options_ui": {
"page": "options.html",
"chrome_style": true
"page": "options.html"
},
"background": {
"scripts": ["background.bundle.js"],
"persistent": false
"service_worker": "background.bundle.js"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"exclude_globs": ["https://www.google*"],
"js": ["content.bundle.js", "pagewrap.bundle.js"],
"js": ["content.bundle.js"],
"run_at": "document_start",
"all_frames": true
},
{
"matches": ["<all_urls>"],
"exclude_globs": ["https://www.google*"],
"js": ["page.bundle.js"],
"run_at": "document_start",
"all_frames": true,
"world": "MAIN"
}
],
"devtools_page": "devtools.html",
"web_accessible_resources": ["page.bundle.js"],
"externally_connectable": {
"ids": ["*"]
},
"permissions": [
"notifications",
"contextMenus",
"storage",
"file:///*",
"http://*/*",
"https://*/*"
],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'; style-src * 'unsafe-inline'; img-src 'self' data:;",
"permissions": ["notifications", "contextMenus", "storage"],
"host_permissions": ["file:///*", "http://*/*", "https://*/*"],
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'; style-src * 'unsafe-inline'; img-src 'self' data:;"
},
"update_url": "https://clients2.google.com/service/update2/crx",
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsdJEPwY92xUACA9CcDBDBmbdbp8Ap3cKQ0DJTUuVQvqb4FQAv8RtKY3iUjGvdwuAcSJQIZwHXcP2aNDH3TiFik/NhRK2GRW8X3OZyTdkuDueABGP2KEX8q1WQDgjX/rPIinGYztUrvoICw/UerMPwNW62jwGoVU3YhAGf+15CgX2Y6a4tppnf/+1mPedKPidh0RsM+aJY98rX+r1SPAHPcGzMjocLkqcT75DZBXer8VQN14tOOzRCd6T6oy7qm7eWru8lJwcY66qMQvhk0osqEod2G3nA7aTWpmqPFS66VEiecP9PgZlp8gQdgZ3dFhA62exydlD55JuRhiMIR63yQIDAQAB"
}

View File

@ -0,0 +1,37 @@
# Architecture Notes
This document exists to keep track of how the different parts of the Redux DevTools interact, since it's easy to forget how it all works together. This is intended for internal purposes and is just a collection of notes to myself.
## Entry Points
### Window
This is the default view that is shown in the Redux DevTools popup, the Chrome DevTools tab (if direct access to the background page is available), and new popup windows that are created. It has direct access to the background page via `chrome.runtime.getBackgroundPage`.
### DevPanel
This is the view that is shown in the Chrome DevTools tab if direct access to the background page is not available.
Initially this was the view that was always used for the Chrome DevTools tab, but when support to directly access the background page from the DevTools tab was added, [the Window View became the preferred view](https://github.com/zalmoxisus/redux-devtools-extension/pull/580).
### Remote
This does not interact with the other parts of the extension at all, it just renders the `App` component from `@redux-devtools/app`.
It can be triggered by hitting the "Remote" button in any of the other views, which calls `chrome.windows.create` and creates a new window.
### DevTools
This is the script that adds the Redux panel in the Chrome DevTools using `chrome.devtools.panels.create`.
It creates a Window View if it has direct access to the background page, otherwise it creates a DevPanel View.
Note that this used to always show the DevPanel View, but [started using the Window View by default](https://github.com/zalmoxisus/redux-devtools-extension/pull/580) once direct access to the background page was added to Chrome DevTools tabs.
### Content Script
Passes messages between the injected page script and the background page.
It listens for messages from the injected page script using `window.addEventListener('message', ...)`. It knows the message is from the injected page script if `message.source` is `'@devtools-page'`. See the Chrome DevTools docs where this approach [is documented](https://developer.chrome.com/docs/extensions/how-to/devtools/extend-devtools#evaluated-scripts-to-devtools).
It creates a connection to the background page using `chrome.runtime.connect` with the name `'tab'` when it receives the first message from the injected page script.

View File

@ -1,28 +1,22 @@
{
"version": "3.1.0",
"version": "3.2.10",
"name": "Redux DevTools",
"description": "Redux DevTools for debugging application's state changes.",
"homepage_url": "https://github.com/reduxjs/redux-devtools",
"manifest_version": 2,
"page_action": {
"manifest_version": 3,
"action": {
"default_icon": "img/logo/gray.png",
"default_title": "Redux DevTools",
"default_popup": "window.html#popup"
"default_popup": "devpanel.html#popup"
},
"commands": {
"devtools-left": {
"description": "DevTools window to left"
},
"devtools-right": {
"description": "DevTools window to right"
},
"devtools-bottom": {
"description": "DevTools window to bottom"
"devtools-window": {
"description": "DevTools window"
},
"devtools-remote": {
"description": "Remote DevTools"
},
"_execute_page_action": {
"_execute_action": {
"suggested_key": {
"default": "Ctrl+Shift+E"
}
@ -34,34 +28,35 @@
"128": "img/logo/128x128.png"
},
"options_ui": {
"page": "options.html",
"chrome_style": true
"page": "options.html"
},
"background": {
"scripts": ["background.bundle.js"],
"persistent": false
"service_worker": "background.bundle.js"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"exclude_globs": ["https://www.google*"],
"js": ["content.bundle.js", "pagewrap.bundle.js"],
"js": ["content.bundle.js"],
"run_at": "document_start",
"all_frames": true
},
{
"matches": ["<all_urls>"],
"exclude_globs": ["https://www.google*"],
"js": ["page.bundle.js"],
"run_at": "document_start",
"all_frames": true,
"world": "MAIN"
}
],
"devtools_page": "devtools.html",
"web_accessible_resources": ["page.bundle.js"],
"externally_connectable": {
"ids": ["*"]
},
"permissions": [
"notifications",
"contextMenus",
"storage",
"file:///*",
"http://*/*",
"https://*/*"
],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'; style-src * 'unsafe-inline'; img-src 'self' data:;"
"permissions": ["notifications", "contextMenus", "storage"],
"host_permissions": ["file:///*", "http://*/*", "https://*/*"],
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'; style-src * 'unsafe-inline'; img-src 'self' data:;"
}
}

View File

@ -0,0 +1,38 @@
import globals from 'globals';
import eslintJs from '../eslint.js.config.base.mjs';
import eslintTsReact from '../eslint.ts.react.config.base.mjs';
import eslintJsReactJest from '../eslint.js.react.jest.config.base.mjs';
export default [
...eslintJs,
...eslintTsReact(import.meta.dirname),
...eslintJsReactJest,
{
ignores: [
'chrome',
'dist',
'edge',
'examples',
'firefox',
'test/electron/fixture/dist',
],
},
{
files: ['build.mjs'],
languageOptions: {
globals: {
...globals.nodeBuiltin,
},
},
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
EUI: true,
},
},
},
];

View File

@ -1,29 +1,22 @@
{
"version": "3.1.0",
"version": "3.2.10",
"name": "Redux DevTools",
"manifest_version": 2,
"manifest_version": 3,
"description": "Redux Developer Tools for debugging application state changes.",
"homepage_url": "https://github.com/reduxjs/redux-devtools",
"applications": {
"browser_specific_settings": {
"gecko": {
"id": "extension@redux.devtools",
"strict_min_version": "54.0"
"id": "extension@redux.devtools"
}
},
"page_action": {
"action": {
"default_icon": "img/logo/38x38.png",
"default_title": "Redux DevTools",
"default_popup": "window.html#popup"
"default_popup": "devpanel.html#popup"
},
"commands": {
"devtools-left": {
"description": "DevTools window to left"
},
"devtools-right": {
"description": "DevTools window to right"
},
"devtools-bottom": {
"description": "DevTools window to bottom"
"devtools-window": {
"description": "DevTools window"
},
"devtools-remote": {
"description": "Remote DevTools"
@ -43,21 +36,22 @@
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.bundle.js", "pagewrap.bundle.js"],
"js": ["content.bundle.js"],
"run_at": "document_start",
"all_frames": true
},
{
"matches": ["<all_urls>"],
"js": ["page.bundle.js"],
"run_at": "document_start",
"all_frames": true,
"world": "MAIN"
}
],
"devtools_page": "devtools.html",
"web_accessible_resources": ["page.bundle.js"],
"permissions": [
"notifications",
"contextMenus",
"tabs",
"storage",
"file:///*",
"http://*/*",
"https://*/*"
],
"content_security_policy": "script-src 'self'; object-src 'self'; img-src 'self' data:;"
"permissions": ["notifications", "contextMenus", "tabs", "storage"],
"host_permissions": ["file:///*", "http://*/*", "https://*/*"],
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'; img-src 'self' data:;"
}
}

View File

@ -3,9 +3,9 @@ module.exports = {
testPathIgnorePatterns: ['<rootDir>/examples'],
testEnvironment: 'jsdom',
moduleNameMapper: {
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
'\\.css$': '<rootDir>/test/__mocks__/styleMock.js',
},
transformIgnorePatterns: [
'node_modules/(?!.pnpm|@babel/code-frame|@babel/highlight|@babel/helper-validator-identifier|d3|dateformat|delaunator|internmap|nanoid|robust-predicates|uuid)',
'node_modules/(?!.pnpm|@babel/code-frame|@babel/highlight|@babel/helper-validator-identifier|chalk|d3|dateformat|delaunator|internmap|jsondiffpatch|lodash-es|nanoid|robust-predicates|uuid)',
],
};

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "remotedev-redux-devtools-extension",
"version": "3.1.0",
"version": "3.2.10",
"description": "Redux Developer Tools for debugging application state changes.",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/extension",
"license": "MIT",
@ -11,87 +11,71 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"start": "webpack --env development --watch",
"build": "pnpm run build:extension && pnpm run build:chrome && pnpm run build:edge && pnpm run build:firefox",
"build:extension": "webpack --env production && webpack --config wrap.webpack.config.js",
"build:chrome": "cpy . ../chrome/dist --cwd dist && cpy manifest.json dist --cwd chrome",
"build:edge": "cpy . ../edge/dist --cwd dist && cpy manifest.json dist --cwd edge",
"build:firefox": "cpy . ../firefox/dist --cwd dist && cpy manifest.json dist --cwd firefox",
"build": "pnpm run build:extension && pnpm run type-check",
"build:extension": "node build.mjs",
"build:examples": "babel-node examples/buildAll.js",
"clean": "rimraf dist && rimraf chrome/dist && rimraf edge/dist && rimraf firefox/dist",
"test:app": "cross-env BABEL_ENV=test jest test/app",
"test:chrome": "jest test/chrome",
"build:test:electron:fixture": "webpack --config test/electron/fixture/webpack.config.js",
"test:electron": "pnpm run build:test:electron:fixture && jest test/electron",
"test": "pnpm run test:app && pnpm run test:chrome && pnpm run test:electron",
"build:test:electron:fixture": "webpack --config test/electron/fixture/webpack.config.js",
"lint": "eslint .",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@babel/polyfill": "^7.12.1",
"@redux-devtools/app": "^2.2.2",
"@redux-devtools/core": "^3.13.0",
"@redux-devtools/instrument": "^2.1.0",
"@redux-devtools/serialize": "^0.4.1",
"@redux-devtools/slider-monitor": "^4.0.0",
"@redux-devtools/ui": "^1.3.0",
"@redux-devtools/utils": "^2.0.0",
"@types/jsan": "^3.1.2",
"@emotion/react": "^11.14.0",
"@redux-devtools/app": "workspace:^",
"@redux-devtools/core": "workspace:^",
"@redux-devtools/instrument": "workspace:^",
"@redux-devtools/serialize": "workspace:^",
"@redux-devtools/slider-monitor": "workspace:^",
"@redux-devtools/ui": "workspace:^",
"@redux-devtools/utils": "workspace:^",
"@reduxjs/toolkit": "^2.6.0",
"@types/jsan": "^3.1.5",
"jsan": "^3.1.14",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"react-is": "^18.2.0",
"react-json-tree": "^0.18.0",
"react-redux": "^8.1.2",
"redux": "^4.2.1",
"lodash-es": "^4.17.21",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.5.0",
"react-is": "^18.3.1",
"react-json-tree": "workspace:^",
"react-redux": "^9.2.0",
"redux": "^5.0.1",
"redux-persist": "^6.0.0",
"styled-components": "^5.3.11"
},
"devDependencies": {
"@babel/core": "^7.22.10",
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@babel/register": "^7.22.5",
"@testing-library/jest-dom": "^6.0.1",
"@testing-library/react": "^14.0.0",
"@types/chrome": "^0.0.243",
"@types/lodash": "^4.14.197",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/styled-components": "^5.1.26",
"babel-loader": "^9.1.3",
"chromedriver114": "npm:chromedriver@^114.0.3",
"chromedriver115": "npm:chromedriver@^115.0.1",
"copy-webpack-plugin": "^11.0.0",
"cpy-cli": "^5.0.0",
"@babel/core": "^7.26.9",
"@babel/preset-env": "^7.26.9",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@babel/register": "^7.25.9",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@types/chrome": "^0.0.308",
"@types/lodash-es": "^4.17.12",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@types/styled-components": "^5.1.34",
"chromedriver": "^126.0.5",
"cross-env": "^7.0.3",
"css-loader": "^6.8.1",
"electron": "^25.6.0",
"eslint": "^8.47.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"immutable": "^4.3.2",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"pug-html-loader": "^1.1.5",
"raw-loader": "^4.0.2",
"react-transform-catch-errors": "^1.0.2",
"react-transform-hmr": "^1.0.4",
"rimraf": "^5.0.1",
"selenium-webdriver": "^4.11.1",
"electron": "^31.7.7",
"esbuild": "^0.25.0",
"globals": "^15.15.0",
"immutable": "^5.0.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"pug": "^3.0.3",
"rimraf": "^6.0.1",
"selenium-webdriver": "^4.29.0",
"sinon-chrome": "^3.0.1",
"style-loader": "^3.3.3",
"ts-jest": "^29.1.1",
"typescript": "~5.1.6",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
"ts-jest": "^29.2.6",
"typescript": "~5.8.2",
"webpack": "^5.98.0",
"webpack-cli": "^6.0.1"
}
}

View File

@ -18,7 +18,7 @@ import {
TopButtons,
} from '@redux-devtools/app';
import { GoBroadcast } from 'react-icons/go';
import { MdBorderBottom, MdBorderLeft, MdBorderRight } from 'react-icons/md';
import { MdOutlineWindow } from 'react-icons/md';
import type { Position } from '../pageScript/api/openWindow';
import type { SingleMessage } from '../background/store/apiMiddleware';
@ -29,25 +29,21 @@ interface OwnProps {
}
type Props = StateProps & DispatchProps & OwnProps;
declare global {
interface Window {
isElectron?: boolean;
}
}
const isElectron = navigator.userAgent.includes('Electron');
function sendMessage(message: SingleMessage) {
chrome.runtime.sendMessage(message);
async function sendMessage(message: SingleMessage) {
await chrome.runtime.sendMessage(message);
}
class Actions extends Component<Props> {
openWindow = (position: Position) => {
sendMessage({ type: 'OPEN', position });
openWindow = async (position: Position) => {
await sendMessage({ type: 'OPEN', position });
};
openOptionsPage = () => {
if (navigator.userAgent.indexOf('Firefox') !== -1) {
sendMessage({ type: 'OPEN_OPTIONS' });
openOptionsPage = async () => {
if (navigator.userAgent.includes('Firefox')) {
await sendMessage({ type: 'OPEN_OPTIONS' });
} else {
chrome.runtime.openOptionsPage();
await chrome.runtime.openOptionsPage();
}
};
@ -89,7 +85,7 @@ class Actions extends Component<Props> {
{features.import && <ImportButton />}
{position &&
(position !== '#popup' ||
navigator.userAgent.indexOf('Firefox') !== -1) && <PrintButton />}
navigator.userAgent.includes('Firefox')) && <PrintButton />}
<Divider />
<MonitorSelector />
<Divider />
@ -98,37 +94,19 @@ class Actions extends Component<Props> {
<DispatcherButton dispatcherIsOpen={this.props.dispatcherIsOpen} />
)}
<Divider />
{!window.isElectron && position !== '#left' && (
{!isElectron && (
<Button
onClick={() => {
this.openWindow('left');
onClick={async () => {
await this.openWindow('window');
}}
>
<MdBorderLeft />
<MdOutlineWindow />
</Button>
)}
{!window.isElectron && position !== '#right' && (
{!isElectron && (
<Button
onClick={() => {
this.openWindow('right');
}}
>
<MdBorderRight />
</Button>
)}
{!window.isElectron && position !== '#bottom' && (
<Button
onClick={() => {
this.openWindow('bottom');
}}
>
<MdBorderBottom />
</Button>
)}
{!window.isElectron && (
<Button
onClick={() => {
this.openWindow('remote');
onClick={async () => {
await this.openWindow('remote');
}}
>
<GoBroadcast />

View File

@ -27,6 +27,7 @@ class App extends Component<Props> {
<a
href="https://github.com/zalmoxisus/redux-devtools-extension#usage"
target="_blank"
rel="noreferrer"
>
the instructions
</a>

View File

@ -2,34 +2,28 @@ import openDevToolsWindow, { DevToolsPosition } from './openWindow';
export function createMenu() {
const menus = [
{ id: 'devtools-left', title: 'To left' },
{ id: 'devtools-right', title: 'To right' },
{ id: 'devtools-bottom', title: 'To bottom' },
{
id: 'devtools-panel',
title: 'Open in a panel (enable in browser settings)',
},
{ id: 'devtools-window', title: 'Open in a window' },
{ id: 'devtools-remote', title: 'Open Remote DevTools' },
];
let shortcuts: { [commandName: string]: string | undefined } = {};
const shortcuts: { [commandName: string]: string | undefined } = {};
chrome.commands.getAll((commands) => {
commands.forEach(({ name, shortcut }) => {
for (const { name, shortcut } of commands) {
shortcuts[name!] = shortcut;
});
}
menus.forEach(({ id, title }) => {
for (const { id, title } of menus) {
chrome.contextMenus.create({
id: id,
title: title + (shortcuts[id] ? ' (' + shortcuts[id] + ')' : ''),
contexts: ['all'],
});
});
}
});
}
export function removeMenu() {
chrome.contextMenus.removeAll();
export async function removeMenu() {
await chrome.contextMenus.removeAll();
}
chrome.contextMenus.onClicked.addListener(({ menuItemId }) => {

View File

@ -1,28 +1,23 @@
import { Store } from 'redux';
import configureStore, { BackgroundAction } from './store/backgroundStore';
import '../chromeApiMock';
import configureStore from './store/backgroundStore';
import openDevToolsWindow, { DevToolsPosition } from './openWindow';
import { createMenu, removeMenu } from './contextMenus';
import syncOptions from '../options/syncOptions';
import { BackgroundState } from './store/backgroundReducer';
declare global {
interface Window {
store: Store<BackgroundState, BackgroundAction>;
}
}
import { getOptions } from '../options/syncOptions';
// Expose the extension's store globally to access it from the windows
// via chrome.runtime.getBackgroundPage
window.store = configureStore();
export const store = configureStore();
// Listen for keyboard shortcuts
chrome.commands.onCommand.addListener((shortcut) => {
openDevToolsWindow(shortcut as DevToolsPosition);
});
// Create the context menu when installed
// Disable the action by default and create the context menu when installed
chrome.runtime.onInstalled.addListener(() => {
syncOptions().get((option) => {
void chrome.action.disable();
getOptions((option) => {
if (option.showContextMenus) createMenu();
});
});
@ -31,6 +26,13 @@ chrome.runtime.onInstalled.addListener(() => {
chrome.storage.onChanged.addListener((changes) => {
if (changes.showContextMenus) {
if (changes.showContextMenus.newValue) createMenu();
else removeMenu();
else void removeMenu();
}
});
// https://developer.chrome.com/docs/extensions/develop/migrate/to-service-workers#keep_a_service_worker_alive_continuously
setInterval(
() =>
void chrome.storage.local.set({ 'last-heartbeat': new Date().getTime() }),
20000,
);

View File

@ -1,4 +1,5 @@
import { LIFTED_ACTION } from '@redux-devtools/app';
import { store } from './index';
export function getReport(
reportId: string,
@ -24,7 +25,7 @@ export function getReport(
.then((json) => {
const { payload, preloadedState } = json;
if (!payload) return;
window.store.dispatch({
store.dispatch({
type: LIFTED_ACTION,
message: 'IMPORT',
state: JSON.stringify({ payload, preloadedState }),

View File

@ -1,83 +1,34 @@
export type DevToolsPosition =
| 'devtools-left'
| 'devtools-right'
| 'devtools-bottom'
| 'devtools-panel'
| 'devtools-remote';
export type DevToolsPosition = 'devtools-window' | 'devtools-remote';
let windows: { [K in DevToolsPosition]?: number } = {};
let lastPosition: DevToolsPosition | null = null;
const windows: { [K in DevToolsPosition]?: number } = {};
export default function openDevToolsWindow(position: DevToolsPosition) {
function popWindow(
action: string,
url: string,
customOptions: chrome.windows.CreateData & chrome.windows.UpdateInfo,
) {
function focusIfExist(callback: () => void) {
if (!windows[position]) {
callback();
lastPosition = position;
} else {
let params = { focused: true };
if (lastPosition !== position && position !== 'devtools-panel') {
params = { ...params, ...customOptions };
}
chrome.windows.update(windows[position]!, params, () => {
lastPosition = null;
if (chrome.runtime.lastError) callback();
});
}
}
focusIfExist(() => {
let options: chrome.windows.CreateData = {
type: 'popup',
...customOptions,
};
if (action === 'open') {
options.url = chrome.extension.getURL(
url + '#' + position.substr(position.indexOf('-') + 1),
);
chrome.windows.create(options, (win) => {
windows[position] = win!.id;
if (navigator.userAgent.indexOf('Firefox') !== -1) {
chrome.windows.update(win!.id!, {
focused: true,
...customOptions,
});
}
});
}
if (!windows[position]) {
createWindow(position);
} else {
chrome.windows.update(windows[position], { focused: true }, () => {
if (chrome.runtime.lastError) createWindow(position);
});
}
let params: chrome.windows.CreateData & chrome.windows.UpdateInfo = {
left: 0,
top: 0,
width: 380,
height: window.screen.availHeight,
};
let url = 'window.html';
switch (position) {
case 'devtools-right':
params.left =
(window.screen as unknown as { availLeft: number }).availLeft +
window.screen.availWidth -
params.width!;
break;
case 'devtools-bottom':
params.height = 420;
params.top = window.screen.height - params.height;
params.width = window.screen.availWidth;
break;
case 'devtools-panel':
params.type = 'panel';
break;
case 'devtools-remote':
params = { width: 850, height: 600 };
url = 'remote.html';
break;
}
popWindow('open', url, params);
}
function createWindow(position: DevToolsPosition) {
const url = chrome.runtime.getURL(getPath(position));
chrome.windows.create({ type: 'popup', url }, (win) => {
windows[position] = win!.id;
if (navigator.userAgent.includes('Firefox')) {
void chrome.windows.update(win!.id!, { focused: true });
}
});
}
function getPath(position: DevToolsPosition) {
switch (position) {
case 'devtools-window':
return 'devpanel.html';
case 'devtools-remote':
return 'remote.html';
default:
throw new Error('Unrecognized position');
}
}

View File

@ -11,14 +11,10 @@ import {
TOGGLE_PERSIST,
UPDATE_STATE,
} from '@redux-devtools/app';
import syncOptions, {
Options,
OptionsMessage,
SyncOptions,
} from '../../options/syncOptions';
import type { Options, OptionsMessage } from '../../options/syncOptions';
import openDevToolsWindow, { DevToolsPosition } from '../openWindow';
import { getReport } from '../logging';
import { Action, Dispatch, MiddlewareAPI } from 'redux';
import { Action, Dispatch, Middleware } from 'redux';
import type {
ContentScriptToBackgroundMessage,
SplitMessage,
@ -32,6 +28,7 @@ import { LiftedState } from '@redux-devtools/instrument';
import type { BackgroundAction, LiftedActionAction } from './backgroundStore';
import type { Position } from '../../pageScript/api/openWindow';
import type { BackgroundState } from './backgroundReducer';
import { store } from '../index';
interface TabMessageBase {
readonly type: string;
@ -51,6 +48,11 @@ interface StopAction extends TabMessageBase {
readonly id?: never;
}
interface OptionsAction {
readonly type: 'OPTIONS';
readonly options: Options;
}
interface DispatchAction extends TabMessageBase {
readonly type: 'DISPATCH';
readonly action: AppDispatchAction;
@ -84,7 +86,7 @@ export interface NAAction {
readonly id: string | number;
}
interface InitMessage<S, A extends Action<unknown>> {
interface InitMessage<S, A extends Action<string>> {
readonly type: 'INIT';
readonly payload: string;
instanceId: string;
@ -137,7 +139,7 @@ interface SerializedActionMessage {
readonly nextActionId: number;
}
interface SerializedStateMessage<S, A extends Action<unknown>> {
interface SerializedStateMessage<S, A extends Action<string>> {
readonly type: 'STATE';
readonly payload: Omit<
LiftedState<S, A, unknown>,
@ -151,7 +153,7 @@ interface SerializedStateMessage<S, A extends Action<unknown>> {
readonly committedState: boolean;
}
type UpdateStateRequest<S, A extends Action<unknown>> =
export type UpdateStateRequest<S, A extends Action<string>> =
| InitMessage<S, A>
| LiftedMessage
| SerializedPartialStateMessage
@ -159,91 +161,149 @@ type UpdateStateRequest<S, A extends Action<unknown>> =
| SerializedActionMessage
| SerializedStateMessage<S, A>;
export interface EmptyUpdateStateAction {
readonly type: typeof UPDATE_STATE;
}
interface UpdateStateAction<S, A extends Action<unknown>> {
interface UpdateStateAction<S, A extends Action<string>> {
readonly type: typeof UPDATE_STATE;
request: UpdateStateRequest<S, A>;
readonly id: string | number;
}
type SplitUpdateStateRequestStart<S, A extends Action<string>> = {
split: 'start';
} & Partial<UpdateStateRequest<S, A>>;
interface SplitUpdateStateRequestChunk {
readonly split: 'chunk';
readonly chunk: [string, string];
}
interface SplitUpdateStateRequestEnd {
readonly split: 'end';
}
export type SplitUpdateStateRequest<S, A extends Action<string>> =
| SplitUpdateStateRequestStart<S, A>
| SplitUpdateStateRequestChunk
| SplitUpdateStateRequestEnd;
interface SplitUpdateStateAction<S, A extends Action<string>> {
readonly type: typeof UPDATE_STATE;
request: SplitUpdateStateRequest<S, A>;
readonly id: string | number;
}
export type TabMessage =
| StartAction
| StopAction
| OptionsMessage
| OptionsAction
| DispatchAction
| ImportAction
| ActionAction
| ExportAction;
export type PanelMessage<S, A extends Action<unknown>> =
| NAAction
export type PanelMessageWithoutNA<S, A extends Action<string>> =
| ErrorMessage
| UpdateStateAction<S, A>
| SetPersistAction;
export type MonitorMessage =
| NAAction
| ErrorMessage
| EmptyUpdateStateAction
| SetPersistAction;
export type PanelMessage<S, A extends Action<string>> =
| PanelMessageWithoutNA<S, A>
| NAAction;
export type PanelMessageWithSplitAction<S, A extends Action<string>> =
| PanelMessage<S, A>
| SplitUpdateStateAction<S, A>;
type TabPort = Omit<chrome.runtime.Port, 'postMessage'> & {
postMessage: (message: TabMessage) => void;
};
type PanelPort = Omit<chrome.runtime.Port, 'postMessage'> & {
postMessage: <S, A extends Action<unknown>>(
message: PanelMessage<S, A>,
postMessage: <S, A extends Action<string>>(
message: PanelMessageWithSplitAction<S, A>,
) => void;
};
type MonitorPort = Omit<chrome.runtime.Port, 'postMessage'> & {
postMessage: (message: MonitorMessage) => void;
};
export const CONNECTED = 'socket/CONNECTED';
export const DISCONNECTED = 'socket/DISCONNECTED';
const connections: {
readonly tab: { [K in number | string]: TabPort };
readonly panel: { [K in number | string]: PanelPort };
readonly monitor: { [K in number | string]: MonitorPort };
} = {
tab: {},
panel: {},
monitor: {},
};
const chunks: {
[instanceId: string]: PageScriptToContentScriptMessageForwardedToMonitors<
unknown,
Action<unknown>
Action<string>
>;
} = {};
let monitors = 0;
let isMonitored = false;
const getId = (sender: chrome.runtime.MessageSender, name?: string) =>
sender.tab ? sender.tab.id! : name || sender.id!;
type MonitorAction<S, A extends Action<unknown>> =
type MonitorAction<S, A extends Action<string>> =
| NAAction
| ErrorMessage
| UpdateStateAction<S, A>
| SetPersistAction;
function toMonitors<S, A extends Action<unknown>>(
action: MonitorAction<S, A>,
tabId?: string | number,
verbose?: boolean,
) {
Object.keys(connections.monitor).forEach((id) => {
connections.monitor[id].postMessage(
verbose || action.type === 'ERROR' || action.type === SET_PERSIST
? action
: { type: UPDATE_STATE },
);
});
Object.keys(connections.panel).forEach((id) => {
connections.panel[id].postMessage(action);
});
// Chrome message limit is 64 MB, but we're using 32 MB to include other object's parts
const maxChromeMsgSize = 32 * 1024 * 1024;
function toMonitors<S, A extends Action<string>>(action: MonitorAction<S, A>) {
console.log(`Message to monitors: ${action.type}`);
for (const port of Object.values(connections.panel)) {
try {
port.postMessage(action);
} catch (err) {
if (
action.type !== UPDATE_STATE ||
err == null ||
(err as Error).message !==
'Message length exceeded maximum allowed length.'
) {
throw err;
}
const splitMessageStart: SplitUpdateStateRequestStart<S, A> = {
split: 'start',
};
const toSplit: [string, string][] = [];
let size = 0;
for (const [key, value] of Object.entries(
action.request as unknown as Record<string, unknown>,
)) {
if (typeof value === 'string') {
size += value.length;
if (size > maxChromeMsgSize) {
toSplit.push([key, value]);
continue;
}
}
(splitMessageStart as any)[key as keyof typeof splitMessageStart] =
value;
}
port.postMessage({ ...action, request: splitMessageStart });
for (let i = 0; i < toSplit.length; i++) {
for (let j = 0; j < toSplit[i][1].length; j += maxChromeMsgSize) {
port.postMessage({
...action,
request: {
split: 'chunk',
chunk: [
toSplit[i][0],
toSplit[i][1].substring(j, j + maxChromeMsgSize),
],
},
});
}
}
port.postMessage({ ...action, request: { split: 'end' } });
}
}
}
interface ImportMessage {
@ -257,19 +317,15 @@ interface ImportMessage {
type ToContentScriptMessage = ImportMessage | LiftedActionAction;
function toContentScript(messageBody: ToContentScriptMessage) {
console.log(`Message to tab ${messageBody.id}: ${messageBody.message}`);
if (messageBody.message === 'DISPATCH') {
const { message, action, id, instanceId, state } = messageBody;
connections.tab[id!].postMessage({
type: message,
action,
state: nonReduxDispatch(
window.store,
message,
instanceId,
action as AppDispatchAction,
state,
),
id: instanceId.toString().replace(/^[^\/]+\//, ''),
state: nonReduxDispatch(store, message, instanceId, action, state),
id: instanceId.toString().replace(/^[^/]+\//, ''),
});
} else if (messageBody.message === 'IMPORT') {
const { message, action, id, instanceId, state } = messageBody;
@ -277,13 +333,13 @@ function toContentScript(messageBody: ToContentScriptMessage) {
type: message,
action,
state: nonReduxDispatch(
window.store,
store,
message,
instanceId,
action as unknown as AppDispatchAction,
state,
),
id: instanceId.toString().replace(/^[^\/]+\//, ''),
id: instanceId.toString().replace(/^[^/]+\//, ''),
});
} else if (messageBody.message === 'ACTION') {
const { message, action, id, instanceId, state } = messageBody;
@ -291,13 +347,13 @@ function toContentScript(messageBody: ToContentScriptMessage) {
type: message,
action,
state: nonReduxDispatch(
window.store,
store,
message,
instanceId,
action as unknown as AppDispatchAction,
state,
),
id: instanceId.toString().replace(/^[^\/]+\//, ''),
id: instanceId.toString().replace(/^[^/]+\//, ''),
});
} else if (messageBody.message === 'EXPORT') {
const { message, action, id, instanceId, state } = messageBody;
@ -305,53 +361,41 @@ function toContentScript(messageBody: ToContentScriptMessage) {
type: message,
action,
state: nonReduxDispatch(
window.store,
store,
message,
instanceId,
action as unknown as AppDispatchAction,
state,
),
id: instanceId.toString().replace(/^[^\/]+\//, ''),
id: instanceId.toString().replace(/^[^/]+\//, ''),
});
} else {
const { message, action, id, instanceId, state } = messageBody;
connections.tab[id!].postMessage({
connections.tab[id].postMessage({
type: message,
action,
state: nonReduxDispatch(
window.store,
store,
message,
instanceId,
action as AppDispatchAction,
state,
),
id: (instanceId as number).toString().replace(/^[^\/]+\//, ''),
id: (instanceId as number).toString().replace(/^[^/]+\//, ''),
});
}
}
function toAllTabs(msg: TabMessage) {
const tabs = connections.tab;
Object.keys(tabs).forEach((id) => {
tabs[id].postMessage(msg);
});
}
console.log(`Message to all tabs: ${msg.type}`);
function monitorInstances(shouldMonitor: boolean, id?: string) {
if (!id && isMonitored === shouldMonitor) return;
const action = {
type: shouldMonitor ? ('START' as const) : ('STOP' as const),
};
if (id) {
if (connections.tab[id]) connections.tab[id].postMessage(action);
} else {
toAllTabs(action);
for (const tabPort of Object.values(connections.tab)) {
tabPort.postMessage(msg);
}
isMonitored = shouldMonitor;
}
function getReducerError() {
const instancesState = window.store.getState().instances;
const instancesState = store.getState().instances;
const payload = instancesState.states[instancesState.current];
const computedState = payload.computedStates[payload.currentStateIndex];
if (!computedState) return false;
@ -359,13 +403,13 @@ function getReducerError() {
}
function togglePersist() {
const state = window.store.getState();
const state = store.getState();
if (state.instances.persisted) {
Object.keys(state.instances.connections).forEach((id) => {
for (const id of Object.keys(state.instances.connections)) {
if (connections.tab[id]) return;
window.store.dispatch({ type: REMOVE_INSTANCE, id });
store.dispatch({ type: REMOVE_INSTANCE, id });
toMonitors({ type: 'NA', id });
});
}
}
}
@ -378,45 +422,35 @@ interface OpenOptionsMessage {
readonly type: 'OPEN_OPTIONS';
}
interface GetOptionsMessage {
readonly type: 'GET_OPTIONS';
}
export type SingleMessage = OpenMessage | OpenOptionsMessage | OptionsMessage;
export type SingleMessage =
| OpenMessage
| OpenOptionsMessage
| GetOptionsMessage;
type BackgroundStoreMessage<S, A extends Action<unknown>> =
type BackgroundStoreMessage<S, A extends Action<string>> =
| PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance<S, A>
| SplitMessage
| SingleMessage;
type BackgroundStoreResponse = { readonly options: Options };
// Receive messages from content scripts
function messaging<S, A extends Action<unknown>>(
function messaging<S, A extends Action<string>>(
request: BackgroundStoreMessage<S, A>,
sender: chrome.runtime.MessageSender,
sendResponse?: (response?: BackgroundStoreResponse) => void,
) {
let tabId = getId(sender);
console.log(`Message from tab ${tabId}: ${request.type ?? request.split}`);
if (!tabId) return;
if (sender.frameId) tabId = `${tabId}-${sender.frameId}`;
if (request.type === 'STOP') {
if (!Object.keys(window.store.getState().instances.connections).length) {
window.store.dispatch({ type: DISCONNECTED });
if (!Object.keys(store.getState().instances.connections).length) {
store.dispatch({ type: DISCONNECTED });
}
return;
}
if (request.type === 'OPEN_OPTIONS') {
chrome.runtime.openOptionsPage();
void chrome.runtime.openOptionsPage();
return;
}
if (request.type === 'GET_OPTIONS') {
window.syncOptions.get((options) => {
sendResponse!({ options });
});
if (request.type === 'OPTIONS') {
toAllTabs({ type: 'OPTIONS', options: request.options });
return;
}
if (request.type === 'GET_REPORT') {
@ -424,12 +458,8 @@ function messaging<S, A extends Action<unknown>>(
return;
}
if (request.type === 'OPEN') {
let position: DevToolsPosition = 'devtools-left';
if (
['remote', 'panel', 'left', 'right', 'bottom'].indexOf(
request.position,
) !== -1
) {
let position: DevToolsPosition = 'devtools-window';
if (['remote', 'window'].includes(request.position)) {
position = ('devtools-' + request.position) as DevToolsPosition;
}
openDevToolsWindow(position);
@ -437,7 +467,7 @@ function messaging<S, A extends Action<unknown>>(
}
if (request.type === 'ERROR') {
if (request.payload) {
toMonitors(request, tabId);
toMonitors(request);
return;
}
if (!request.message) return;
@ -477,56 +507,56 @@ function messaging<S, A extends Action<unknown>>(
if (request.instanceId) {
action.request.instanceId = instanceId;
}
window.store.dispatch(action);
store.dispatch(action);
if (request.type === 'EXPORT') {
toMonitors(action, tabId, true);
} else {
toMonitors(action, tabId);
}
toMonitors(action);
}
function disconnect(
type: 'tab' | 'monitor' | 'panel',
type: 'tab' | 'panel',
id: number | string,
listener?: (message: any, port: chrome.runtime.Port) => void,
listener: (message: any, port: chrome.runtime.Port) => void,
) {
return function disconnectListener() {
console.log(`Disconnected from ${type} ${id}`);
const p = connections[type][id];
if (listener && p) p.onMessage.removeListener(listener);
if (p) p.onDisconnect.removeListener(disconnectListener);
delete connections[type][id];
if (type === 'tab') {
if (!window.store.getState().instances.persisted) {
window.store.dispatch({ type: REMOVE_INSTANCE, id });
if (!store.getState().instances.persisted) {
store.dispatch({ type: REMOVE_INSTANCE, id });
toMonitors({ type: 'NA', id });
}
} else {
monitors--;
if (!monitors) monitorInstances(false);
if (monitors === 0) toAllTabs({ type: 'STOP' });
}
};
}
function onConnect<S, A extends Action<unknown>>(port: chrome.runtime.Port) {
function onConnect<S, A extends Action<string>>(port: chrome.runtime.Port) {
let id: number | string;
let listener;
window.store.dispatch({ type: CONNECTED, port });
store.dispatch({ type: CONNECTED, port });
if (port.name === 'tab') {
id = getId(port.sender!);
console.log(`Connected to tab ${id}`);
if (port.sender!.frameId) id = `${id}-${port.sender!.frameId}`;
connections.tab[id] = port;
listener = (msg: ContentScriptToBackgroundMessage<S, A>) => {
console.log(`Message from tab ${id}: ${msg.name}`);
if (msg.name === 'INIT_INSTANCE') {
if (typeof id === 'number') {
chrome.pageAction.show(id);
chrome.pageAction.setIcon({ tabId: id, path: 'img/logo/38x38.png' });
void chrome.action.enable(id);
void chrome.action.setIcon({ tabId: id, path: 'img/logo/38x38.png' });
}
if (isMonitored) port.postMessage({ type: 'START' });
if (monitors > 0) port.postMessage({ type: 'START' });
const state = window.store.getState();
const state = store.getState();
if (state.instances.persisted) {
const instanceId = `${id}/${msg.instanceId}`;
const persistedState = state.instances.states[instanceId];
@ -550,22 +580,45 @@ function onConnect<S, A extends Action<unknown>>(port: chrome.runtime.Port) {
port.onMessage.addListener(listener);
port.onDisconnect.addListener(disconnect('tab', id, listener));
} else if (port.name && port.name.indexOf('monitor') === 0) {
id = getId(port.sender!, port.name);
connections.monitor[id] = port;
monitorInstances(true);
monitors++;
port.onDisconnect.addListener(disconnect('monitor', id));
} else {
// devpanel
id = port.name || port.sender!.frameId!;
id = getId(port.sender!, port.name);
console.log(`Connected to monitor ${id}`);
connections.panel[id] = port;
monitorInstances(true, port.name);
monitors++;
toAllTabs({ type: 'START' });
listener = (msg: BackgroundAction) => {
window.store.dispatch(msg);
console.log(`Message from monitor ${id}: ${msg.type}`);
store.dispatch(msg);
};
port.onMessage.addListener(listener);
port.onDisconnect.addListener(disconnect('panel', id, listener));
const { current } = store.getState().instances;
if (current !== 'default') {
const connectionId = Object.entries(
store.getState().instances.connections,
).find(([, instanceIds]) => instanceIds.includes(current))?.[0];
const options = store.getState().instances.options[current];
const state = store.getState().instances.states[current];
const { actionsById, computedStates, committedState, ...rest } = state;
toMonitors({
type: UPDATE_STATE,
request: {
type: 'STATE',
payload: rest as Omit<
LiftedState<S, A, unknown>,
'actionsById' | 'computedStates' | 'committedState'
>,
source: '@devtools-page',
instanceId:
typeof current === 'number' ? current.toString() : current,
actionsById: stringifyJSON(actionsById, options.serialize),
computedStates: stringifyJSON(computedStates, options.serialize),
committedState: typeof committedState !== 'undefined',
},
id: connectionId ?? current,
});
}
}
}
@ -576,21 +629,14 @@ chrome.runtime.onMessageExternal.addListener(messaging);
chrome.notifications.onClicked.addListener((id) => {
chrome.notifications.clear(id);
openDevToolsWindow('devtools-right');
openDevToolsWindow('devtools-window');
});
declare global {
interface Window {
syncOptions: SyncOptions;
}
}
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
const api: Middleware<{}, BackgroundState, Dispatch<BackgroundAction>> =
(store) => (next) => (untypedAction) => {
const action = untypedAction as BackgroundAction;
window.syncOptions = syncOptions(toAllTabs); // Expose to the options page
export default function api(
store: MiddlewareAPI<Dispatch<BackgroundAction>, BackgroundState>,
) {
return (next: Dispatch<BackgroundAction>) => (action: BackgroundAction) => {
if (action.type === LIFTED_ACTION) toContentScript(action);
else if (action.type === TOGGLE_PERSIST) {
togglePersist();
@ -601,4 +647,5 @@ export default function api(
}
return next(action);
};
}
export default api;

View File

@ -1,14 +1,17 @@
import { combineReducers, Reducer } from 'redux';
import { instances, InstancesState } from '@redux-devtools/app';
import type { BackgroundAction } from './backgroundStore';
import { BackgroundAction } from './backgroundStore';
export interface BackgroundState {
readonly instances: InstancesState;
}
const rootReducer: Reducer<BackgroundState, BackgroundAction> =
combineReducers<BackgroundState>({
instances,
});
const rootReducer: Reducer<
BackgroundState,
BackgroundAction,
Partial<BackgroundState>
> = combineReducers({
instances,
}) as any;
export default rootReducer;

View File

@ -1,4 +1,4 @@
import { createStore, applyMiddleware, PreloadedState } from 'redux';
import { createStore, applyMiddleware } from 'redux';
import {
CustomAction,
DispatchAction,
@ -60,7 +60,7 @@ export type BackgroundAction =
| DisconnectedAction;
export default function configureStore(
preloadedState?: PreloadedState<BackgroundState>,
preloadedState?: Partial<BackgroundState>,
) {
return createStore(rootReducer, preloadedState, applyMiddleware(api));
/*

View File

@ -1,34 +1,50 @@
// Mock not supported chrome.* API for Firefox and Electron
window.isElectron =
window.navigator && window.navigator.userAgent.indexOf('Electron') !== -1;
const isFirefox = navigator.userAgent.indexOf('Firefox') !== -1;
const isElectron = navigator.userAgent.includes('Electron');
const isFirefox = navigator.userAgent.includes('Firefox');
// Background page only
if (
(window.isElectron &&
location.pathname === '/_generated_background_page.html') ||
(isElectron && location.pathname === '/background.bundle.js') ||
isFirefox
) {
(chrome.runtime as any).onConnectExternal = {
addListener() {},
addListener() {
// do nothing.
},
};
(chrome.runtime as any).onMessageExternal = {
addListener() {},
addListener() {
// do nothing.
},
};
if (window.isElectron) {
if (isElectron) {
(chrome.notifications as any) = {
onClicked: {
addListener() {},
addListener() {
// do nothing.
},
},
create() {
// do nothing.
},
clear() {
// do nothing.
},
create() {},
clear() {},
};
(chrome.contextMenus as any) = {
onClicked: {
addListener() {},
addListener() {
// do nothing.
},
},
};
(chrome.commands as any) = {
onCommand: {
addListener() {
// do nothing.
},
},
};
} else {
@ -39,34 +55,39 @@ if (
}
}
if (window.isElectron) {
if (isElectron) {
if (!chrome.storage.local || !chrome.storage.local.remove) {
(chrome.storage as any).local = {
set(obj: any, callback: any) {
Object.keys(obj).forEach((key) => {
localStorage.setItem(key, obj[key]);
});
set(items: { [key: string]: string }, callback: () => void) {
for (const [key, value] of Object.entries(items)) {
localStorage.setItem(key, value);
}
if (callback) {
callback();
}
},
get(obj: any, callback: any) {
const result: any = {};
Object.keys(obj).forEach((key) => {
result[key] = localStorage.getItem(key) || obj[key];
});
get(
keys: { [key: string]: any },
callback: (items: { [key: string]: any }) => void,
) {
const result = Object.fromEntries(
Object.entries(keys).map(([key, value]) => [
key,
localStorage.getItem(key) ?? value,
]),
);
if (callback) {
callback(result);
}
},
// Electron ~ 1.4.6
remove(items: any, callback: any) {
if (Array.isArray(items)) {
items.forEach((name) => {
localStorage.removeItem(name);
});
remove(keys: string | string[], callback: () => void) {
if (Array.isArray(keys)) {
for (const key of keys) {
localStorage.removeItem(key);
}
} else {
localStorage.removeItem(items);
localStorage.removeItem(keys);
}
if (callback) {
callback();
@ -76,17 +97,17 @@ if (window.isElectron) {
}
// Avoid error: chrome.runtime.sendMessage is not supported responseCallback
const originSendMessage = (chrome.runtime as any).sendMessage;
chrome.runtime.sendMessage = function () {
(chrome.runtime as any).sendMessage = function (...args: unknown[]) {
if (process.env.NODE_ENV === 'development') {
return originSendMessage(...arguments);
return originSendMessage(...args);
}
if (typeof arguments[arguments.length - 1] === 'function') {
Array.prototype.pop.call(arguments);
if (typeof args[arguments.length - 1] === 'function') {
Array.prototype.pop.call(args);
}
return originSendMessage(...arguments);
return originSendMessage(...args);
};
}
if (isFirefox || window.isElectron) {
if (isFirefox || isElectron) {
(chrome.storage as any).sync = chrome.storage.local;
}

View File

@ -1,7 +1,10 @@
import '../chromeApiMock';
import {
injectOptions,
getOptionsFromBg,
getOptions,
isAllowed,
Options,
prefetchOptions,
prepareOptionsForPage,
} from '../options/syncOptions';
import type { TabMessage } from '../background/store/apiMiddleware';
import type {
@ -15,6 +18,7 @@ import {
DispatchAction as AppDispatchAction,
} from '@redux-devtools/app';
import { LiftedState } from '@redux-devtools/instrument';
const source = '@devtools-extension';
const pageSource = '@devtools-page';
// Chrome message limit is 64 MB, but we're using 32 MB to include other object's parts
@ -82,6 +86,13 @@ interface UpdateAction {
readonly source: typeof source;
}
interface OptionsAction {
readonly type: 'OPTIONS';
readonly options: Options;
readonly id: undefined;
readonly source: typeof source;
}
export type ContentScriptToPageScriptMessage =
| StartAction
| StopAction
@ -89,20 +100,21 @@ export type ContentScriptToPageScriptMessage =
| ImportAction
| ActionAction
| ExportAction
| UpdateAction;
| UpdateAction
| OptionsAction;
interface ImportStatePayload<S, A extends Action<unknown>> {
interface ImportStatePayload<S, A extends Action<string>> {
readonly type: 'IMPORT_STATE';
readonly nextLiftedState: LiftedState<S, A, unknown> | readonly A[];
readonly preloadedState?: S;
}
interface ImportStateDispatchAction<S, A extends Action<unknown>> {
interface ImportStateDispatchAction<S, A extends Action<string>> {
readonly type: 'DISPATCH';
readonly payload: ImportStatePayload<S, A>;
}
export type ListenerMessage<S, A extends Action<unknown>> =
export type ListenerMessage<S, A extends Action<string>> =
| StartAction
| StopAction
| DispatchAction
@ -110,6 +122,7 @@ export type ListenerMessage<S, A extends Action<unknown>> =
| ActionAction
| ExportAction
| UpdateAction
| OptionsAction
| ImportStateDispatchAction<S, A>;
function postToPageScript(message: ContentScriptToPageScriptMessage) {
@ -154,8 +167,13 @@ function connect() {
source,
});
}
} else if ('options' in message) {
injectOptions(message.options);
} else if (message.type === 'OPTIONS') {
postToPageScript({
type: message.type,
options: prepareOptionsForPage(message.options),
id: undefined,
source,
});
} else {
postToPageScript({
type: message.type,
@ -203,7 +221,7 @@ export type SplitMessage =
| SplitMessageChunk
| SplitMessageEnd;
function tryCatch<S, A extends Action<unknown>>(
function tryCatch<S, A extends Action<string>>(
fn: (
args:
| PageScriptToContentScriptMessageWithoutDisconnect<S, A>
@ -236,7 +254,7 @@ function tryCatch<S, A extends Action<unknown>>(
}
newArgs[key as keyof typeof newArgs] = arg;
});
fn(newArgs as any);
fn(newArgs as SplitMessage);
for (let i = 0; i < toSplit.length; i++) {
for (let j = 0; j < toSplit[i][1].length; j += maxChromeMsgSize) {
fn({
@ -263,31 +281,38 @@ interface InitInstanceContentScriptToBackgroundMessage {
readonly instanceId: number;
}
interface RelayMessage<S, A extends Action<unknown>> {
interface RelayMessage<S, A extends Action<string>> {
readonly name: 'RELAY';
readonly message:
| PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance<S, A>
| SplitMessage;
}
export type ContentScriptToBackgroundMessage<S, A extends Action<unknown>> =
export type ContentScriptToBackgroundMessage<S, A extends Action<string>> =
| InitInstanceContentScriptToBackgroundMessage
| RelayMessage<S, A>;
function postToBackground<S, A extends Action<unknown>>(
function postToBackground<S, A extends Action<string>>(
message: ContentScriptToBackgroundMessage<S, A>,
) {
bg!.postMessage(message);
}
function send<S, A extends Action<unknown>>(
function send<S, A extends Action<string>>(
message:
| PageScriptToContentScriptMessageWithoutDisconnect<S, A>
| SplitMessage,
) {
if (!connected) connect();
if (message.type === 'INIT_INSTANCE') {
getOptionsFromBg();
getOptions((options) => {
postToPageScript({
type: 'OPTIONS',
options: prepareOptionsForPage(options),
id: undefined,
source,
});
});
postToBackground({ name: 'INIT_INSTANCE', instanceId: message.instanceId });
} else {
postToBackground({ name: 'RELAY', message });
@ -295,7 +320,7 @@ function send<S, A extends Action<unknown>>(
}
// Resend messages from the page to the background script
function handleMessages<S, A extends Action<unknown>>(
function handleMessages<S, A extends Action<string>>(
event: MessageEvent<PageScriptToContentScriptMessage<S, A>>,
) {
if (!isAllowed()) return;
@ -315,4 +340,6 @@ function handleMessages<S, A extends Action<unknown>>(
tryCatch(send, message);
}
prefetchOptions();
window.addEventListener('message', handleMessages, false);

View File

@ -5,11 +5,13 @@ html
meta(charset='UTF-8')
title Redux DevTools
include ../style.pug
style.
body {
min-height: 100px;
}
body
#root
div(style='display: flex; justify-content: center; align-items: center')
img(
src='/img/loading.svg',
height=300, width=350,
)
link(href='/devpanel.bundle.css', rel='stylesheet')
script(src='/devpanel.bundle.js')

View File

@ -1,32 +1,42 @@
import '../chromeApiMock';
import React, { CSSProperties, ReactNode } from 'react';
import { createRoot, Root } from 'react-dom/client';
import { Provider } from 'react-redux';
import { Persistor } from 'redux-persist';
import { REMOVE_INSTANCE, StoreAction } from '@redux-devtools/app';
import {
REMOVE_INSTANCE,
StoreAction,
StoreState,
UPDATE_STATE,
} from '@redux-devtools/app';
import App from '../app/App';
import configureStore from './store/panelStore';
import './devpanel.pug';
import { Action, Store } from 'redux';
import type { PanelMessage } from '../background/store/apiMiddleware';
import type { StoreStateWithoutSocket } from './store/panelReducer';
import {
PanelMessageWithoutNA,
PanelMessageWithSplitAction,
SplitUpdateStateRequest,
UpdateStateRequest,
} from '../background/store/apiMiddleware';
import { PersistGate } from 'redux-persist/integration/react';
const position = location.hash;
const messageStyle: CSSProperties = {
padding: '20px',
paddingTop: '20px',
width: '100%',
textAlign: 'center',
boxSizing: 'border-box',
};
let rendered: boolean | undefined;
let currentRoot: Root | undefined;
let store: Store<StoreStateWithoutSocket, StoreAction> | undefined;
let store: Store<StoreState, StoreAction> | undefined;
let persistor: Persistor | undefined;
let bgConnection: chrome.runtime.Port;
let naTimeout: NodeJS.Timeout;
const isChrome = navigator.userAgent.indexOf('Firefox') === -1;
const isChrome = !navigator.userAgent.includes('Firefox');
function renderNodeAtRoot(node: ReactNode) {
if (currentRoot) currentRoot.unmount();
@ -57,13 +67,19 @@ function renderNA() {
<a
href="https://github.com/zalmoxisus/redux-devtools-extension#usage"
target="_blank"
rel="noreferrer"
>
the instructions
</a>
.
</div>
);
if (isChrome) {
if (
isChrome &&
chrome &&
chrome.devtools &&
chrome.devtools.inspectedWindow
) {
chrome.devtools.inspectedWindow.getResources((resources) => {
if (resources[0].url.substr(0, 4) === 'file') {
message = (
@ -72,6 +88,7 @@ function renderNA() {
<a
href="https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/Troubleshooting.md#access-file-url-file"
target="_blank"
rel="noreferrer"
>
See details
</a>
@ -90,22 +107,76 @@ function renderNA() {
}, 3500);
}
function init(id: number) {
let splitMessage: SplitUpdateStateRequest<unknown, Action<string>>;
function init() {
renderNA();
bgConnection = chrome.runtime.connect({
name: id ? id.toString() : undefined,
});
let name = 'monitor';
if (chrome && chrome.devtools && chrome.devtools.inspectedWindow) {
name += chrome.devtools.inspectedWindow.tabId;
}
bgConnection = chrome.runtime.connect({ name });
bgConnection.onMessage.addListener(
<S, A extends Action<unknown>>(message: PanelMessage<S, A>) => {
<S, A extends Action<string>>(
message: PanelMessageWithSplitAction<S, A>,
) => {
if (message.type === 'NA') {
if (message.id === id) renderNA();
// TODO Double-check this now that the name is different
if (message.id === name) renderNA();
else store!.dispatch({ type: REMOVE_INSTANCE, id: message.id });
} else {
if (!rendered) renderDevTools();
store!.dispatch(message);
if (
message.type === UPDATE_STATE &&
(message.request as SplitUpdateStateRequest<S, A>).split
) {
const request = message.request as SplitUpdateStateRequest<S, A>;
if (request.split === 'start') {
splitMessage = request;
return;
}
if (request.split === 'chunk') {
if (
(splitMessage as unknown as Record<string, string>)[
request.chunk[0]
]
) {
(splitMessage as unknown as Record<string, string>)[
request.chunk[0]
] += request.chunk[1];
} else {
(splitMessage as unknown as Record<string, string>)[
request.chunk[0]
] = request.chunk[1];
}
return;
}
if (request.split === 'end') {
store!.dispatch({
...message,
request: splitMessage as UpdateStateRequest<S, A>,
});
return;
}
throw new Error(
`Unable to process split message with type: ${(request as any).split}`,
);
} else {
store!.dispatch(message as PanelMessageWithoutNA<S, A>);
}
}
},
);
}
init(chrome.devtools.inspectedWindow.tabId);
if (position === '#popup') document.body.style.minWidth = '760px';
if (position !== '#popup') document.body.style.minHeight = '100%';
init();

View File

@ -1,41 +1,32 @@
import { combineReducers, Reducer } from 'redux';
import {
connection,
ConnectionState,
instances,
InstancesState,
monitor,
MonitorState,
notification,
NotificationState,
reports,
ReportsState,
section,
SectionState,
socket,
stateTreeSettings,
StoreAction,
StoreState,
theme,
ThemeState,
} from '@redux-devtools/app';
export interface StoreStateWithoutSocket {
readonly section: SectionState;
readonly theme: ThemeState;
readonly connection: ConnectionState;
readonly monitor: MonitorState;
readonly instances: InstancesState;
readonly reports: ReportsState;
readonly notification: NotificationState;
}
const rootReducer: Reducer<StoreStateWithoutSocket, StoreAction> =
combineReducers<StoreStateWithoutSocket>({
instances,
monitor,
reports,
notification,
section,
theme,
connection,
});
const rootReducer: Reducer<
StoreState,
StoreAction,
Partial<StoreState>
> = combineReducers({
instances,
monitor,
reports,
notification,
section,
socket,
theme,
connection,
stateTreeSettings,
}) as any;
export default rootReducer;

View File

@ -1,9 +1,13 @@
import { createStore, applyMiddleware, Reducer } from 'redux';
import { createStore, applyMiddleware, Reducer, Store } from 'redux';
import localForage from 'localforage';
import { persistReducer, persistStore } from 'redux-persist';
import { exportStateMiddleware, StoreAction } from '@redux-devtools/app';
import {
exportStateMiddleware,
StoreAction,
StoreState,
} from '@redux-devtools/app';
import panelDispatcher from './panelSyncMiddleware';
import rootReducer, { StoreStateWithoutSocket } from './panelReducer';
import rootReducer from './panelReducer';
const persistConfig = {
key: 'redux-devtools',
@ -11,8 +15,10 @@ const persistConfig = {
storage: localForage,
};
const persistedReducer: Reducer<StoreStateWithoutSocket, StoreAction> =
persistReducer(persistConfig, rootReducer) as any;
const persistedReducer: Reducer<StoreState, StoreAction> = persistReducer(
persistConfig,
rootReducer,
) as any;
export default function configureStore(
position: string,
@ -23,6 +29,6 @@ export default function configureStore(
panelDispatcher(bgConnection),
);
const store = createStore(persistedReducer, enhancer);
const persistor = persistStore(store);
const persistor = persistStore(store as Store);
return { store, persistor };
}

View File

@ -7,31 +7,62 @@ import {
TOGGLE_PERSIST,
UPDATE_STATE,
} from '@redux-devtools/app';
import { Dispatch, MiddlewareAPI } from 'redux';
import { Dispatch, Middleware, MiddlewareAPI } from 'redux';
function panelDispatcher(bgConnection: chrome.runtime.Port) {
function selectInstance(
tabId: number,
store: MiddlewareAPI<Dispatch<StoreAction>, StoreState>,
next: (action: unknown) => unknown,
) {
const instances = store.getState().instances;
if (instances.current === 'default') return;
const connections = instances.connections[tabId];
if (connections && connections.length === 1) {
next({ type: SELECT_INSTANCE, selected: connections[0] });
}
}
function getCurrentTabId(next: (tabId: number) => void) {
chrome.tabs.query(
{
active: true,
lastFocusedWindow: true,
},
(tabs) => {
const tab = tabs[0];
if (!tab) return;
next(tab.id!);
},
);
}
function panelDispatcher(
bgConnection: chrome.runtime.Port,
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
): Middleware<{}, StoreState, Dispatch<StoreAction>> {
let autoselected = false;
const tabId = chrome.devtools.inspectedWindow.tabId;
return (store: MiddlewareAPI<Dispatch<StoreAction>, StoreState>) =>
(next: Dispatch<StoreAction>) =>
(action: StoreAction) => {
const result = next(action);
if (!autoselected && action.type === UPDATE_STATE && tabId) {
autoselected = true;
const connections = store.getState().instances.connections[tabId];
if (connections && connections.length === 1) {
next({ type: SELECT_INSTANCE, selected: connections[0] });
}
return (store) => (next) => (untypedAction) => {
const action = untypedAction as StoreAction;
const result = next(action);
if (!autoselected && action.type === UPDATE_STATE) {
autoselected = true;
if (chrome.devtools && chrome.devtools.inspectedWindow) {
selectInstance(chrome.devtools.inspectedWindow.tabId, store, next);
} else {
getCurrentTabId((tabId) => selectInstance(tabId, store, next));
}
if (action.type === LIFTED_ACTION || action.type === TOGGLE_PERSIST) {
const instances = store.getState().instances;
const instanceId = getActiveInstance(instances);
const id = instances.options[instanceId].connectionId;
bgConnection.postMessage({ ...action, instanceId, id });
}
return result;
};
}
if (action.type === LIFTED_ACTION || action.type === TOGGLE_PERSIST) {
const instances = store.getState().instances;
const instanceId = getActiveInstance(instances);
const id = instances.options[instanceId].connectionId;
bgConnection.postMessage({ ...action, instanceId, id });
}
return result;
};
}
export default panelDispatcher;

View File

@ -1,19 +1,8 @@
import './devtools.pug';
function createPanel(url: string) {
chrome.devtools.panels.create(
'Redux',
'img/logo/scalable.png',
url,
function () {},
);
}
if (chrome.runtime.getBackgroundPage) {
// Check if the background page's object is accessible (not in incognito)
chrome.runtime.getBackgroundPage((background) => {
createPanel(background ? 'window.html' : 'devpanel.html');
});
} else {
createPanel('devpanel.html');
}
chrome.devtools.panels.create(
'Redux',
'img/logo/scalable.png',
'devpanel.html',
() => {
// do nothing.
},
);

View File

@ -1,7 +1,7 @@
import React from 'react';
import { OptionsProps } from './Options';
export default ({ options, saveOption }: OptionsProps) => {
export default function AllowToRunGroup({ options, saveOption }: OptionsProps) {
const AllowToRunState = {
EVERYWHERE: true,
ON_SPECIFIC_URLS: false,
@ -50,4 +50,4 @@ export default ({ options, saveOption }: OptionsProps) => {
</div>
</fieldset>
);
};
}

View File

@ -1,7 +1,10 @@
import React from 'react';
import { OptionsProps } from './Options';
export default ({ options, saveOption }: OptionsProps) => {
export default function ContextMenuGroup({
options,
saveOption,
}: OptionsProps) {
return (
<fieldset className="option-group">
<legend className="option-group__title">Context Menu</legend>
@ -23,4 +26,4 @@ export default ({ options, saveOption }: OptionsProps) => {
</div>
</fieldset>
);
};
}

View File

@ -1,7 +1,7 @@
import React from 'react';
import { OptionsProps } from './Options';
export default ({ options, saveOption }: OptionsProps) => {
export default function EditorGroup({ options, saveOption }: OptionsProps) {
const EditorState = {
BROWSER: 0,
EXTERNAL: 1,
@ -21,7 +21,7 @@ export default ({ options, saveOption }: OptionsProps) => {
onChange={() => saveOption('useEditor', EditorState.BROWSER)}
/>
<label className="option__label" htmlFor="editor-browser">
{navigator.userAgent.indexOf('Firefox') !== -1
{navigator.userAgent.includes('Firefox')
? "Don't open in external editor"
: "Use browser's debugger (from browser devpanel only)"}
</label>
@ -80,4 +80,4 @@ export default ({ options, saveOption }: OptionsProps) => {
</div>
</fieldset>
);
};
}

View File

@ -2,7 +2,7 @@ import React from 'react';
import { FilterState } from '../pageScript/api/filters';
import { OptionsProps } from './Options';
export default ({ options, saveOption }: OptionsProps) => {
export default function FilterGroup({ options, saveOption }: OptionsProps) {
return (
<fieldset className="option-group">
<legend className="option-group__title">
@ -68,4 +68,4 @@ export default ({ options, saveOption }: OptionsProps) => {
</div>
</fieldset>
);
};
}

View File

@ -1,7 +1,10 @@
import React from 'react';
import { OptionsProps } from './Options';
export default ({ options, saveOption }: OptionsProps) => {
export default function MiscellaneousGroup({
options,
saveOption,
}: OptionsProps) {
return (
<fieldset className="option-group">
<legend className="option-group__title">Miscellaneous</legend>
@ -47,4 +50,4 @@ export default ({ options, saveOption }: OptionsProps) => {
</div>
</fieldset>
);
};
}

View File

@ -14,34 +14,38 @@ export interface OptionsProps {
) => void;
}
export default (props: OptionsProps) => (
<div>
<EditorGroup {...props} />
<FilterGroup {...props} />
<AllowToRunGroup {...props} />
<MiscellaneousGroup {...props} />
<ContextMenuGroup {...props} />
<div style={{ color: 'red' }}>
<br />
<hr />
Setting options here is discouraged, and will not be possible in the next
major release. Please{' '}
<a
href="https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md"
target="_blank"
style={{ color: 'red' }}
>
specify them as parameters
</a>
. See{' '}
<a
href="https://github.com/zalmoxisus/redux-devtools-extension/issues/296"
target="_blank"
style={{ color: 'red' }}
>
the issue
</a>{' '}
for more details.
export default function OptionsComponent(props: OptionsProps) {
return (
<div>
<EditorGroup {...props} />
<FilterGroup {...props} />
<AllowToRunGroup {...props} />
<MiscellaneousGroup {...props} />
<ContextMenuGroup {...props} />
<div style={{ color: 'red' }}>
<br />
<hr />
Setting options here is discouraged, and will not be possible in the
next major release. Please{' '}
<a
href="https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md"
target="_blank"
rel="noreferrer"
style={{ color: 'red' }}
>
specify them as parameters
</a>
. See{' '}
<a
href="https://github.com/zalmoxisus/redux-devtools-extension/issues/296"
target="_blank"
rel="noreferrer"
style={{ color: 'red' }}
>
the issue
</a>{' '}
for more details.
</div>
</div>
</div>
);
);
}

View File

@ -1,24 +1,26 @@
import '../chromeApiMock';
import React from 'react';
import { createRoot } from 'react-dom/client';
import OptionsComponent from './Options';
import { Options } from './syncOptions';
import {
getOptions,
Options,
OptionsMessage,
saveOption,
subscribeToOptions,
} from './syncOptions';
import './options.pug';
chrome.runtime.getBackgroundPage((background) => {
const syncOptions = background!.syncOptions;
const saveOption = <K extends keyof Options>(name: K, value: Options[K]) => {
syncOptions.save(name, value);
};
const renderOptions = (options: Options) => {
const root = createRoot(document.getElementById('root')!);
root.render(<OptionsComponent options={options} saveOption={saveOption} />);
};
syncOptions.subscribe(renderOptions);
syncOptions.get((options) => {
renderOptions(options);
});
subscribeToOptions((options) => {
const message: OptionsMessage = { type: 'OPTIONS', options };
void chrome.runtime.sendMessage(message);
});
const renderOptions = (options: Options) => {
const root = createRoot(document.getElementById('root')!);
root.render(<OptionsComponent options={options} saveOption={saveOption} />);
};
subscribeToOptions(renderOptions);
getOptions((options) => {
renderOptions(options);
});

View File

@ -38,21 +38,22 @@ let options: Options | undefined;
let subscribers: ((options: Options) => void)[] = [];
export interface OptionsMessage {
readonly type: 'OPTIONS';
readonly options: Options;
}
type ToAllTabs = (msg: OptionsMessage) => void;
const save =
(toAllTabs: ToAllTabs | undefined) =>
<K extends keyof Options>(key: K, value: Options[K]) => {
let obj: { [K1 in keyof Options]?: Options[K1] } = {};
obj[key] = value;
chrome.storage.sync.set(obj);
options![key] = value;
toAllTabs!({ options: options! });
subscribers.forEach((s) => s(options!));
};
export const saveOption = <K extends keyof Options>(
key: K,
value: Options[K],
) => {
const obj: { [K1 in keyof Options]?: Options[K1] } = {};
obj[key] = value;
void chrome.storage.sync.set(obj);
options![key] = value;
for (const subscriber of subscribers) {
subscriber(options!);
}
};
const migrateOldOptions = (oldOptions: OldOrNewOptions): Options => ({
...oldOptions,
@ -62,16 +63,16 @@ const migrateOldOptions = (oldOptions: OldOrNewOptions): Options => ({
? oldOptions.filter && oldOptions.whitelist.length > 0
? FilterState.ALLOWLIST_SPECIFIC
: oldOptions.filter
? FilterState.DENYLIST_SPECIFIC
: FilterState.DO_NOT_FILTER
? FilterState.DENYLIST_SPECIFIC
: FilterState.DO_NOT_FILTER
: oldOptions.filter === 'WHITELIST_SPECIFIC'
? FilterState.ALLOWLIST_SPECIFIC
: oldOptions.filter === 'BLACKLIST_SPECIFIC'
? FilterState.DENYLIST_SPECIFIC
: oldOptions.filter,
? FilterState.ALLOWLIST_SPECIFIC
: oldOptions.filter === 'BLACKLIST_SPECIFIC'
? FilterState.DENYLIST_SPECIFIC
: oldOptions.filter,
});
const get = (callback: (options: Options) => void) => {
export const getOptions = (callback: (options: Options) => void) => {
if (options) callback(options);
else {
chrome.storage.sync.get(
@ -98,67 +99,32 @@ const get = (callback: (options: Options) => void) => {
}
};
const subscribe = (callback: (options: Options) => void) => {
export const prefetchOptions = () =>
getOptions(() => {
// do nothing.
});
export const subscribeToOptions = (callback: (options: Options) => void) => {
subscribers = subscribers.concat(callback);
};
const toReg = (str: string) =>
str !== '' ? str.split('\n').filter(Boolean).join('|') : null;
export const injectOptions = (newOptions: Options) => {
if (!newOptions) return;
options = {
...newOptions,
allowlist:
newOptions.filter !== FilterState.DO_NOT_FILTER
? toReg(newOptions.allowlist)!
: newOptions.allowlist,
denylist:
newOptions.filter !== FilterState.DO_NOT_FILTER
? toReg(newOptions.denylist)!
: newOptions.denylist,
};
let s = document.createElement('script');
s.type = 'text/javascript';
s.appendChild(
document.createTextNode(
'window.devToolsOptions = Object.assign(window.devToolsOptions||{},' +
JSON.stringify(options) +
');',
),
);
(document.head || document.documentElement).appendChild(s);
s.parentNode!.removeChild(s);
};
export const getOptionsFromBg = () => {
/* chrome.runtime.sendMessage({ type: 'GET_OPTIONS' }, response => {
if (response && response.options) injectOptions(response.options);
});
*/
get((newOptions) => {
injectOptions(newOptions);
}); // Legacy
};
export const prepareOptionsForPage = (options: Options): Options => ({
...options,
allowlist:
options.filter !== FilterState.DO_NOT_FILTER
? toReg(options.allowlist)!
: options.allowlist,
denylist:
options.filter !== FilterState.DO_NOT_FILTER
? toReg(options.denylist)!
: options.denylist,
});
export const isAllowed = (localOptions = options) =>
!localOptions ||
localOptions.inject ||
!localOptions.urls ||
location.href.match(toReg(localOptions.urls)!);
export interface SyncOptions {
readonly save: <K extends keyof Options>(key: K, value: Options[K]) => void;
readonly get: (callback: (options: Options) => void) => void;
readonly subscribe: (callback: (options: Options) => void) => void;
}
export default function syncOptions(toAllTabs?: ToAllTabs): SyncOptions {
if (toAllTabs && !options) get(() => {}); // Initialize
return {
save: save(toAllTabs),
get: get,
subscribe: subscribe,
};
}

View File

@ -8,7 +8,7 @@ declare global {
}
}
export default class Monitor<S, A extends Action<unknown>> {
export default class Monitor<S, A extends Action<string>> {
update: (
liftedState?: LiftedState<S, A, unknown> | undefined,
libConfig?: LibConfig,

View File

@ -1,4 +1,3 @@
import mapValues from 'lodash/mapValues';
import { Action } from 'redux';
import { LiftedState, PerformAction } from '@redux-devtools/instrument';
import { LocalFilter } from '@redux-devtools/utils';
@ -21,14 +20,13 @@ export const noFiltersApplied = (localFilter: LocalFilter | undefined) =>
!window.devToolsOptions.filter ||
window.devToolsOptions.filter === FilterState.DO_NOT_FILTER);
export function isFiltered<A extends Action<unknown>>(
export function isFiltered<A extends Action<string>>(
action: A | string,
localFilter: LocalFilter | undefined,
) {
if (
noFiltersApplied(localFilter) ||
(typeof action !== 'string' &&
typeof (action.type as string).match !== 'function')
(typeof action !== 'string' && typeof action.type.match !== 'function')
) {
return false;
}
@ -41,15 +39,20 @@ export function isFiltered<A extends Action<unknown>>(
);
}
function filterActions<A extends Action<unknown>>(
function filterActions<A extends Action<string>>(
actionsById: { [p: number]: PerformAction<A> },
actionSanitizer: ((action: A, id: number) => A) | undefined,
): { [p: number]: PerformAction<A> } {
if (!actionSanitizer) return actionsById;
return mapValues(actionsById, (action, id) => ({
...action,
action: actionSanitizer(action.action, id as unknown as number),
}));
return Object.fromEntries(
Object.entries(actionsById).map(([actionId, action]) => [
actionId,
{
...action,
action: actionSanitizer(action.action, actionId as unknown as number),
},
]),
);
}
function filterStates<S>(
@ -63,7 +66,7 @@ function filterStates<S>(
}));
}
export function filterState<S, A extends Action<unknown>>(
export function filterState<S, A extends Action<string>>(
state: LiftedState<S, A, unknown>,
localFilter: LocalFilter | undefined,
stateSanitizer: ((state: S, index: number) => S) | undefined,
@ -120,7 +123,7 @@ export function filterState<S, A extends Action<unknown>>(
};
}
export interface PartialLiftedState<S, A extends Action<unknown>> {
export interface PartialLiftedState<S, A extends Action<string>> {
readonly actionsById: { [actionId: number]: PerformAction<A> };
readonly computedStates: { state: S; error?: string }[];
readonly stagedActionIds: readonly number[];
@ -129,16 +132,16 @@ export interface PartialLiftedState<S, A extends Action<unknown>> {
readonly committedState?: S;
}
export function startingFrom<S, A extends Action<unknown>>(
export function startingFrom<S, A extends Action<string>>(
sendingActionId: number,
state: LiftedState<S, A, unknown>,
localFilter: LocalFilter | undefined,
stateSanitizer: (<S>(state: S, index: number) => S) | undefined,
actionSanitizer:
| (<A extends Action<unknown>>(action: A, id: number) => A)
| (<A extends Action<string>>(action: A, id: number) => A)
| undefined,
predicate:
| (<S, A extends Action<unknown>>(state: S, action: A) => boolean)
| (<S, A extends Action<string>>(state: S, action: A) => boolean)
| undefined,
): LiftedState<S, A, unknown> | PartialLiftedState<S, A> | undefined {
const stagedActionIds = state.stagedActionIds;

View File

@ -30,7 +30,7 @@ interface ParsedSerializedLiftedState {
readonly preloadedState?: string;
}
export default function importState<S, A extends Action<unknown>>(
export default function importState<S, A extends Action<string>>(
state: string | undefined,
{ serialize }: Config,
) {
@ -58,7 +58,7 @@ export default function importState<S, A extends Action<unknown>>(
| LiftedState<S, A, unknown> = parse(state) as
| ParsedSerializedLiftedState
| LiftedState<S, A, unknown>;
let preloadedState =
const preloadedState =
'payload' in parsedSerializedLiftedState &&
parsedSerializedLiftedState.preloadedState
? (parse(parsedSerializedLiftedState.preloadedState) as S)

View File

@ -1,5 +1,5 @@
import jsan, { Options } from 'jsan';
import throttle from 'lodash/throttle';
import { throttle } from 'lodash-es';
import { immutableSerialize } from '@redux-devtools/serialize';
import { getActionsArray, getLocalFilter } from '@redux-devtools/utils';
import { isFiltered, PartialLiftedState } from './filters';
@ -115,7 +115,7 @@ interface DisconnectMessage {
readonly source: typeof source;
}
interface InitMessage<S, A extends Action<unknown>> {
interface InitMessage<S, A extends Action<string>> {
readonly type: 'INIT';
readonly payload: string;
readonly instanceId: number;
@ -161,7 +161,7 @@ interface SerializedActionMessage {
readonly nextActionId?: number;
}
interface SerializedStateMessage<S, A extends Action<unknown>> {
interface SerializedStateMessage<S, A extends Action<string>> {
readonly type: 'STATE';
readonly payload: Omit<
LiftedState<S, A, unknown>,
@ -183,7 +183,7 @@ interface OpenMessage {
export type PageScriptToContentScriptMessageForwardedToMonitors<
S,
A extends Action<unknown>,
A extends Action<string>,
> =
| InitMessage<S, A>
| LiftedMessage
@ -194,7 +194,7 @@ export type PageScriptToContentScriptMessageForwardedToMonitors<
export type PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance<
S,
A extends Action<unknown>,
A extends Action<string>,
> =
| PageScriptToContentScriptMessageForwardedToMonitors<S, A>
| ErrorMessage
@ -204,17 +204,17 @@ export type PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance<
export type PageScriptToContentScriptMessageWithoutDisconnect<
S,
A extends Action<unknown>,
A extends Action<string>,
> =
| PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance<S, A>
| InitInstancePageScriptToContentScriptMessage
| InitInstanceMessage;
export type PageScriptToContentScriptMessage<S, A extends Action<unknown>> =
export type PageScriptToContentScriptMessage<S, A extends Action<string>> =
| PageScriptToContentScriptMessageWithoutDisconnect<S, A>
| DisconnectMessage;
function post<S, A extends Action<unknown>>(
function post<S, A extends Action<string>>(
message: PageScriptToContentScriptMessage<S, A>,
) {
window.postMessage(message, '*');
@ -222,6 +222,7 @@ function post<S, A extends Action<unknown>>(
function getStackTrace(
config: Config,
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
toExcludeFromTrace: Function | undefined,
) {
if (!config.trace) return undefined;
@ -248,6 +249,7 @@ function getStackTrace(
typeof Error.stackTraceLimit !== 'number' ||
Error.stackTraceLimit > traceLimit!
) {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
const frames = stack!.split('\n');
if (frames.length > traceLimit!) {
stack = frames
@ -258,17 +260,18 @@ function getStackTrace(
return stack;
}
function amendActionType<A extends Action<unknown>>(
function amendActionType<A extends Action<string>>(
action:
| A
| StructuralPerformAction<A>
| StructuralPerformAction<A>[]
| string,
config: Config,
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
toExcludeFromTrace: Function | undefined,
): StructuralPerformAction<A> {
let timestamp = Date.now();
let stack = getStackTrace(config, toExcludeFromTrace);
const timestamp = Date.now();
const stack = getStackTrace(config, toExcludeFromTrace);
if (typeof action === 'string') {
return { action: { type: action } as A, timestamp, stack };
}
@ -288,7 +291,7 @@ interface LiftedMessage {
readonly source: typeof source;
}
interface PartialStateMessage<S, A extends Action<unknown>> {
interface PartialStateMessage<S, A extends Action<string>> {
readonly type: 'PARTIAL_STATE';
readonly payload: PartialLiftedState<S, A>;
readonly source: typeof source;
@ -296,7 +299,7 @@ interface PartialStateMessage<S, A extends Action<unknown>> {
readonly maxAge: number;
}
interface ExportMessage<S, A extends Action<unknown>> {
interface ExportMessage<S, A extends Action<string>> {
readonly type: 'EXPORT';
readonly payload: readonly A[];
readonly committedState: S;
@ -304,21 +307,21 @@ interface ExportMessage<S, A extends Action<unknown>> {
readonly instanceId: number;
}
export interface StructuralPerformAction<A extends Action<unknown>> {
export interface StructuralPerformAction<A extends Action<string>> {
readonly action: A;
readonly timestamp?: number;
readonly stack?: string;
}
type SingleUserAction<A extends Action<unknown>> =
type SingleUserAction<A extends Action<string>> =
| PerformAction<A>
| StructuralPerformAction<A>
| A;
type UserAction<A extends Action<unknown>> =
type UserAction<A extends Action<string>> =
| SingleUserAction<A>
| readonly SingleUserAction<A>[];
interface ActionMessage<S, A extends Action<unknown>> {
interface ActionMessage<S, A extends Action<string>> {
readonly type: 'ACTION';
readonly payload: S;
readonly source: typeof source;
@ -329,7 +332,7 @@ interface ActionMessage<S, A extends Action<unknown>> {
readonly name?: string;
}
interface StateMessage<S, A extends Action<unknown>> {
interface StateMessage<S, A extends Action<string>> {
readonly type: 'STATE';
readonly payload: LiftedState<S, A, unknown>;
readonly source: typeof source;
@ -369,7 +372,7 @@ interface StopMessage {
readonly instanceId: number;
}
type ToContentScriptMessage<S, A extends Action<unknown>> =
type ToContentScriptMessage<S, A extends Action<string>> =
| LiftedMessage
| PartialStateMessage<S, A>
| ExportMessage<S, A>
@ -380,7 +383,7 @@ type ToContentScriptMessage<S, A extends Action<unknown>> =
| GetReportMessage
| StopMessage;
export function toContentScript<S, A extends Action<unknown>>(
export function toContentScript<S, A extends Action<string>>(
message: ToContentScriptMessage<S, A>,
serializeState?: Serialize | undefined,
serializeAction?: Serialize | undefined,
@ -425,7 +428,7 @@ export function toContentScript<S, A extends Action<unknown>>(
}
}
export function sendMessage<S, A extends Action<unknown>>(
export function sendMessage<S, A extends Action<string>>(
action: StructuralPerformAction<A> | StructuralPerformAction<A>[],
state: LiftedState<S, A, unknown>,
config: Config,
@ -496,7 +499,7 @@ export function setListener(
}
const liftListener =
<S, A extends Action<unknown>>(
<S, A extends Action<string>>(
listener: (message: ListenerMessage<S, A>) => void,
config: Config,
) =>
@ -520,15 +523,15 @@ export function disconnect() {
}
export interface ConnectResponse {
init: <S, A extends Action<unknown>>(
init: <S, A extends Action<string>>(
state: S,
liftedData?: LiftedState<S, A, unknown>,
) => void;
subscribe: <S, A extends Action<unknown>>(
subscribe: <S, A extends Action<string>>(
listener: (message: ListenerMessage<S, A>) => void,
) => (() => void) | undefined;
unsubscribe: () => void;
send: <S, A extends Action<unknown>>(
send: <S, A extends Action<string>>(
action: A,
state: LiftedState<S, A, unknown>,
) => void;
@ -550,8 +553,8 @@ export function connect(preConfig: Config): ConnectResponse {
const localFilter = getLocalFilter(config);
const autoPause = config.autoPause;
let isPaused = autoPause;
let delayedActions: StructuralPerformAction<Action<unknown>>[] = [];
let delayedStates: LiftedState<unknown, Action<unknown>, unknown>[] = [];
let delayedActions: StructuralPerformAction<Action<string>>[] = [];
let delayedStates: LiftedState<unknown, Action<string>, unknown>[] = [];
const rootListener = (action: ContentScriptToPageScriptMessage) => {
if (autoPause) {
@ -574,7 +577,7 @@ export function connect(preConfig: Config): ConnectResponse {
listeners[id] = [rootListener];
const subscribe = <S, A extends Action<unknown>>(
const subscribe = <S, A extends Action<string>>(
listener: (message: ListenerMessage<S, A>) => void,
) => {
if (!listener) return undefined;
@ -595,12 +598,16 @@ export function connect(preConfig: Config): ConnectResponse {
};
const sendDelayed = throttle(() => {
sendMessage(delayedActions, delayedStates as any, config);
sendMessage(
delayedActions,
delayedStates as unknown as LiftedState<unknown, Action<string>, unknown>,
config,
);
delayedActions = [];
delayedStates = [];
}, latency);
const send = <S, A extends Action<unknown>>(
const send = <S, A extends Action<string>>(
action: A,
state: LiftedState<S, A, unknown>,
) => {
@ -643,7 +650,7 @@ export function connect(preConfig: Config): ConnectResponse {
);
};
const init = <S, A extends Action<unknown>>(
const init = <S, A extends Action<string>>(
state: S,
liftedData?: LiftedState<S, A, unknown>,
) => {

View File

@ -10,7 +10,7 @@ function createExpBackoffTimer(step: number) {
return 0;
}
// Calculate next timeout
let timeout = Math.pow(2, count - 1);
const timeout = Math.pow(2, count - 1);
if (count < 5) count += 1;
return timeout * step;
};

View File

@ -1,9 +1,9 @@
import { Action } from 'redux';
import type { PageScriptToContentScriptMessage } from './index';
export type Position = 'left' | 'right' | 'bottom' | 'panel' | 'remote';
export type Position = 'window' | 'remote';
function post<S, A extends Action<unknown>>(
function post<S, A extends Action<string>>(
message: PageScriptToContentScriptMessage<S, A>,
) {
window.postMessage(message, '*');
@ -13,6 +13,6 @@ export default function openWindow(position?: Position) {
post({
source: '@devtools-page',
type: 'OPEN',
position: position || 'right',
position: position ?? 'window',
});
}

View File

@ -4,8 +4,8 @@ import { persistState } from '@redux-devtools/core';
import type { ConfigWithExpandedMaxAge } from './index';
export function getUrlParam(key: string) {
const matches = window.location.href.match(
new RegExp(`[?&]${key}=([^&#]+)\\b`),
const matches = new RegExp(`[?&]${key}=([^&#]+)\\b`).exec(
window.location.href,
);
return matches && matches.length > 0 ? matches[1] : null;
}
@ -18,9 +18,9 @@ declare global {
export default function configureStore<
S,
A extends Action<unknown>,
A extends Action<string>,
MonitorState,
MonitorAction extends Action<unknown>,
MonitorAction extends Action<string>,
>(
next: StoreEnhancerStoreCreator,
monitorReducer: Reducer<MonitorState, MonitorAction>,

View File

@ -4,16 +4,8 @@ import {
getActionsArray,
getLocalFilter,
} from '@redux-devtools/utils';
import throttle from 'lodash/throttle';
import {
Action,
ActionCreator,
Dispatch,
PreloadedState,
Reducer,
StoreEnhancer,
StoreEnhancerStoreCreator,
} from 'redux';
import { throttle } from 'lodash-es';
import { Action, ActionCreator, Dispatch, Reducer, StoreEnhancer } from 'redux';
import Immutable from 'immutable';
import {
EnhancedStore,
@ -56,15 +48,15 @@ import type { ContentScriptToPageScriptMessage } from '../contentScript';
type EnhancedStoreWithInitialDispatch<
S,
A extends Action<unknown>,
A extends Action<string>,
MonitorState,
> = EnhancedStore<S, A, MonitorState> & { initialDispatch: Dispatch<A> };
const source = '@devtools-page';
let stores: {
const stores: {
[K in string | number]: EnhancedStoreWithInitialDispatch<
unknown,
Action<unknown>,
Action<string>,
unknown
>;
} = {};
@ -97,18 +89,18 @@ export interface ConfigWithExpandedMaxAge {
readonly actionsAllowlist?: string | readonly string[];
serialize?: boolean | SerializeWithImmutable;
readonly stateSanitizer?: <S>(state: S, index?: number) => S;
readonly actionSanitizer?: <A extends Action<unknown>>(
readonly actionSanitizer?: <A extends Action<string>>(
action: A,
id?: number,
) => A;
readonly predicate?: <S, A extends Action<unknown>>(
readonly predicate?: <S, A extends Action<string>>(
state: S,
action: A,
) => boolean;
readonly latency?: number;
readonly maxAge?:
| number
| (<S, A extends Action<unknown>>(
| (<S, A extends Action<string>>(
currentLiftedAction: LiftedAction<S, A, unknown>,
previousLiftedState: LiftedState<S, A, unknown> | undefined,
) => number);
@ -123,9 +115,9 @@ export interface ConfigWithExpandedMaxAge {
readonly autoPause?: boolean;
readonly features?: Features;
readonly type?: string;
readonly getActionType?: <A extends Action<unknown>>(action: A) => A;
readonly getActionType?: <A extends Action<string>>(action: A) => A;
readonly actionCreators?: {
readonly [key: string]: ActionCreator<Action<unknown>>;
readonly [key: string]: ActionCreator<Action<string>>;
};
}
@ -137,7 +129,7 @@ interface ReduxDevtoolsExtension {
(config?: Config): StoreEnhancer;
open: (position?: Position) => void;
notifyErrors: (onError?: () => boolean) => void;
send: <S, A extends Action<unknown>>(
send: <S, A extends Action<string>>(
action: StructuralPerformAction<A> | StructuralPerformAction<A>[],
state: LiftedState<S, A, unknown>,
config: Config,
@ -158,7 +150,7 @@ declare global {
}
}
function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<unknown>>(
function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<string>>(
config?: Config,
): StoreEnhancer {
/* eslint-disable no-param-reassign */
@ -175,7 +167,7 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<unknown>>(
const localFilter = getLocalFilter(config);
const serializeState = getSerializeParameter(config);
const serializeAction = getSerializeParameter(config);
let { stateSanitizer, actionSanitizer, predicate, latency = 500 } = config;
const { stateSanitizer, actionSanitizer, predicate, latency = 500 } = config;
// Deprecate actionsWhitelist and actionsBlacklist
if (config.actionsWhitelist) {
@ -440,6 +432,13 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<unknown>>(
serializeAction,
);
}
return;
case 'OPTIONS':
window.devToolsOptions = Object.assign(
window.devToolsOptions || {},
message.options,
);
return;
}
}
@ -448,7 +447,7 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<unknown>>(
liftedAction?: LiftedAction<S, A, unknown>,
liftedState?: LiftedState<S, A, unknown> | undefined,
) => {
let m = (config && config.maxAge) || window.devToolsOptions.maxAge || 50;
const m = (config && config.maxAge) || window.devToolsOptions.maxAge || 50;
if (
!liftedAction ||
noFiltersApplied(localFilter) ||
@ -465,10 +464,7 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<unknown>>(
if (filteredActionIds.length >= m) {
const stagedActionIds = liftedState!.stagedActionIds;
let i = 1;
while (
maxAge > m &&
filteredActionIds.indexOf(stagedActionIds[i]) === -1
) {
while (maxAge > m && !filteredActionIds.includes(stagedActionIds[i])) {
maxAge--;
i++;
}
@ -526,34 +522,28 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<unknown>>(
relayState(liftedState);
}
const enhance =
(): StoreEnhancer =>
<NextExt, NextStateExt>(
next: StoreEnhancerStoreCreator<NextExt, NextStateExt>,
): any => {
return <S2 extends S, A2 extends A>(
reducer_: Reducer<S2, A2>,
initialState_?: PreloadedState<S2>,
) => {
if (!isAllowed(window.devToolsOptions)) {
return next(reducer_, initialState_);
}
const enhance = (): StoreEnhancer => (next) => {
return <S2, A2 extends Action<string>, PreloadedState>(
reducer_: Reducer<S2, A2, PreloadedState>,
initialState_?: PreloadedState | undefined,
) => {
if (!isAllowed(window.devToolsOptions)) {
return next(reducer_, initialState_);
}
store = stores[instanceId] = configureStore(
next as StoreEnhancerStoreCreator,
monitor.reducer,
{
...config,
maxAge: getMaxAge as any,
},
)(reducer_, initialState_) as any;
store = stores[instanceId] = (
configureStore(next, monitor.reducer, {
...config,
maxAge: getMaxAge as any,
}) as any
)(reducer_, initialState_);
if (isInIframe()) setTimeout(init, 3000);
else init();
if (isInIframe()) setTimeout(init, 3000);
else init();
return store;
};
return store as any;
};
};
return enhance();
}
@ -598,18 +588,18 @@ export type InferComposedStoreExt<StoreEnhancers> = StoreEnhancers extends [
? HeadStoreEnhancer extends StoreEnhancer<infer StoreExt>
? StoreExt & InferComposedStoreExt<RestStoreEnhancers>
: never
: unknown;
: // eslint-disable-next-line @typescript-eslint/no-empty-object-type
{};
const extensionCompose =
(config: Config) =>
<StoreEnhancers extends readonly StoreEnhancer<unknown>[]>(
<StoreEnhancers extends readonly StoreEnhancer[]>(
...funcs: StoreEnhancers
): StoreEnhancer<InferComposedStoreExt<StoreEnhancers>> => {
// @ts-ignore FIXME
// @ts-expect-error FIXME
return (...args) => {
const instanceId = generateId(config.instanceId);
return [preEnhancer(instanceId), ...funcs].reduceRight(
// @ts-ignore FIXME
(composed, f) => f(composed),
__REDUX_DEVTOOLS_EXTENSION__({ ...config, instanceId })(...args),
);
@ -619,10 +609,10 @@ const extensionCompose =
interface ReduxDevtoolsExtensionCompose {
(
config: Config,
): <StoreEnhancers extends readonly StoreEnhancer<unknown>[]>(
): <StoreEnhancers extends readonly StoreEnhancer[]>(
...funcs: StoreEnhancers
) => StoreEnhancer<InferComposedStoreExt<StoreEnhancers>>;
<StoreEnhancers extends readonly StoreEnhancer<unknown>[]>(
<StoreEnhancers extends readonly StoreEnhancer[]>(
...funcs: StoreEnhancers
): StoreEnhancer<InferComposedStoreExt<StoreEnhancers>>;
}
@ -635,24 +625,22 @@ declare global {
function reduxDevtoolsExtensionCompose(
config: Config,
): <StoreEnhancers extends readonly StoreEnhancer<unknown>[]>(
): <StoreEnhancers extends readonly StoreEnhancer[]>(
...funcs: StoreEnhancers
) => StoreEnhancer<InferComposedStoreExt<StoreEnhancers>>;
function reduxDevtoolsExtensionCompose<
StoreEnhancers extends readonly StoreEnhancer<unknown>[],
StoreEnhancers extends readonly StoreEnhancer[],
>(
...funcs: StoreEnhancers
): StoreEnhancer<InferComposedStoreExt<StoreEnhancers>>;
function reduxDevtoolsExtensionCompose(
...funcs: [Config] | StoreEnhancer<unknown>[]
) {
function reduxDevtoolsExtensionCompose(...funcs: [Config] | StoreEnhancer[]) {
if (funcs.length === 0) {
return __REDUX_DEVTOOLS_EXTENSION__();
}
if (funcs.length === 1 && typeof funcs[0] === 'object') {
return extensionCompose(funcs[0]);
}
return extensionCompose({})(...(funcs as StoreEnhancer<unknown>[]));
return extensionCompose({})(...(funcs as StoreEnhancer[]));
}
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ = reduxDevtoolsExtensionCompose;

View File

@ -1,17 +0,0 @@
let s = document.createElement('script');
s.type = 'text/javascript';
if (process.env.NODE_ENV === 'production') {
const { default: script } = require('raw-loader!../dist/page.bundle.js');
s.appendChild(document.createTextNode(script));
(document.head || document.documentElement).appendChild(s);
s.parentNode!.removeChild(s);
} else {
s.src = chrome.extension.getURL('page.bundle.js');
s.onload = function () {
(this as HTMLScriptElement).parentNode!.removeChild(
this as HTMLScriptElement,
);
};
(document.head || document.documentElement).appendChild(s);
}

View File

@ -2,8 +2,6 @@ import React from 'react';
import { createRoot } from 'react-dom/client';
import { Root } from '@redux-devtools/app';
import './remote.pug';
chrome.storage.local.get(
{
'select-monitor': 'InspectorMonitor',

View File

@ -8,4 +8,5 @@ html
body
#root
link(href='/remote.bundle.css', rel='stylesheet')
script(src='/remote.bundle.js')

View File

@ -1,38 +0,0 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import { UPDATE_STATE } from '@redux-devtools/app';
import App from '../app/App';
import configureStore from './store/windowStore';
import type { MonitorMessage } from '../background/store/apiMiddleware';
import './window.pug';
const position = location.hash;
chrome.runtime.getBackgroundPage((window) => {
const { store } = window!;
const { store: localStore, persistor } = configureStore(store, position);
let name = 'monitor';
if (chrome && chrome.devtools && chrome.devtools.inspectedWindow) {
name += chrome.devtools.inspectedWindow.tabId;
}
const bg = chrome.runtime.connect({ name });
const update = (action?: MonitorMessage) => {
localStore.dispatch(action || { type: UPDATE_STATE });
};
bg.onMessage.addListener(update);
update();
const root = createRoot(document.getElementById('root')!);
root.render(
<Provider store={localStore}>
<PersistGate loading={null} persistor={persistor}>
<App position={position} />
</PersistGate>
</Provider>,
);
});
if (position !== '#popup') document.body.style.minHeight = '100%';

View File

@ -1,50 +0,0 @@
import { Dispatch, MiddlewareAPI } from 'redux';
import {
SELECT_INSTANCE,
StoreAction,
StoreState,
UPDATE_STATE,
} from '@redux-devtools/app';
function selectInstance(
tabId: number,
store: MiddlewareAPI<Dispatch<StoreAction>, StoreState>,
next: Dispatch<StoreAction>,
) {
const instances = store.getState().instances;
if (instances.current === 'default') return;
const connections = instances.connections[tabId];
if (connections && connections.length === 1) {
next({ type: SELECT_INSTANCE, selected: connections[0] });
}
}
function getCurrentTabId(next: (tabId: number) => void) {
chrome.tabs.query(
{
active: true,
lastFocusedWindow: true,
},
(tabs) => {
const tab = tabs[0];
if (!tab) return;
next(tab.id!);
},
);
}
export default function popupSelector(
store: MiddlewareAPI<Dispatch<StoreAction>, StoreState>,
) {
return (next: Dispatch<StoreAction>) => (action: StoreAction) => {
const result = next(action);
if (action.type === UPDATE_STATE) {
if (chrome.devtools && chrome.devtools.inspectedWindow) {
selectInstance(chrome.devtools.inspectedWindow.tabId, store, next);
} else {
getCurrentTabId((tabId) => selectInstance(tabId, store, next));
}
}
return result;
};
}

View File

@ -1,34 +0,0 @@
import {
instancesInitialState,
dispatchAction,
UPDATE_STATE,
SELECT_INSTANCE,
LIFTED_ACTION,
SET_PERSIST,
} from '@redux-devtools/app';
import type {
ExpandedUpdateStateAction,
WindowStoreAction,
} from './windowStore';
export default function instances(
state = instancesInitialState,
action: WindowStoreAction,
) {
switch (action.type) {
case UPDATE_STATE:
return {
...(action as ExpandedUpdateStateAction).instances,
selected: state.selected,
};
case LIFTED_ACTION:
if (action.message === 'DISPATCH') return dispatchAction(state, action);
return state;
case SELECT_INSTANCE:
return { ...state, selected: action.selected };
case SET_PERSIST:
return { ...state, persisted: action.payload };
default:
return state;
}
}

View File

@ -1,29 +0,0 @@
import { combineReducers, Reducer } from 'redux';
import {
connection,
monitor,
notification,
reports,
section,
socket,
theme,
stateTreeSettings,
StoreState,
} from '@redux-devtools/app';
import instances from './instancesReducer';
import type { WindowStoreAction } from './windowStore';
const rootReducer: Reducer<StoreState, WindowStoreAction> =
combineReducers<StoreState>({
instances,
monitor,
socket,
reports,
notification,
section,
theme,
connection,
stateTreeSettings,
});
export default rootReducer;

View File

@ -1,81 +0,0 @@
import {
createStore,
compose,
applyMiddleware,
Store,
StoreEnhancer,
Reducer,
} from 'redux';
import localForage from 'localforage';
import { persistReducer, persistStore } from 'redux-persist';
import {
api,
CONNECT_REQUEST,
exportStateMiddleware,
InstancesState,
StoreActionWithoutUpdateState,
StoreState,
UpdateStateAction,
} from '@redux-devtools/app';
import syncStores from './windowSyncMiddleware';
import instanceSelector from './instanceSelectorMiddleware';
import rootReducer from './windowReducer';
import type { BackgroundState } from '../../background/store/backgroundReducer';
import type { BackgroundAction } from '../../background/store/backgroundStore';
import type {
EmptyUpdateStateAction,
NAAction,
} from '../../background/store/apiMiddleware';
export interface ExpandedUpdateStateAction extends UpdateStateAction {
readonly instances: InstancesState;
}
export type WindowStoreAction =
| StoreActionWithoutUpdateState
| ExpandedUpdateStateAction
| NAAction
| EmptyUpdateStateAction;
const persistConfig = {
key: 'redux-devtools',
blacklist: ['instances', 'socket'],
storage: localForage,
};
const persistedReducer: Reducer<StoreState, WindowStoreAction> = persistReducer(
persistConfig,
rootReducer,
) as any;
export default function configureStore(
baseStore: Store<BackgroundState, BackgroundAction>,
position: string,
) {
let enhancer: StoreEnhancer;
const middlewares = [exportStateMiddleware, api, syncStores(baseStore)];
if (!position || position === '#popup') {
// select current tab instance for devPanel and pageAction
middlewares.push(instanceSelector);
}
if (process.env.NODE_ENV === 'production') {
enhancer = applyMiddleware(...middlewares);
} else {
enhancer = compose(
applyMiddleware(...middlewares),
window.__REDUX_DEVTOOLS_EXTENSION__
? window.__REDUX_DEVTOOLS_EXTENSION__()
: (noop: unknown) => noop,
);
}
const store = createStore(persistedReducer, enhancer);
const persistor = persistStore(store, null, () => {
if (store.getState().connection.type !== 'disabled') {
store.dispatch({
type: CONNECT_REQUEST,
});
}
});
return { store, persistor };
}

View File

@ -1,34 +0,0 @@
import {
getActiveInstance,
LIFTED_ACTION,
StoreAction,
StoreState,
TOGGLE_PERSIST,
UPDATE_STATE,
} from '@redux-devtools/app';
import { Dispatch, MiddlewareAPI, Store } from 'redux';
import type { BackgroundState } from '../../background/store/backgroundReducer';
import type { WindowStoreAction } from './windowStore';
import type { BackgroundAction } from '../../background/store/backgroundStore';
const syncStores =
(baseStore: Store<BackgroundState, BackgroundAction>) =>
(store: MiddlewareAPI<Dispatch<StoreAction>, StoreState>) =>
(next: Dispatch<WindowStoreAction>) =>
(action: StoreAction) => {
if (action.type === UPDATE_STATE) {
return next({
...action,
instances: baseStore.getState().instances,
});
}
if (action.type === LIFTED_ACTION || action.type === TOGGLE_PERSIST) {
const instances = store.getState().instances;
const instanceId = getActiveInstance(instances);
const id = instances.options[instanceId].connectionId;
baseStore.dispatch({ ...action, instanceId, id } as any);
}
return next(action);
};
export default syncStores;

View File

@ -1,17 +0,0 @@
doctype html
html
head
meta(charset='UTF-8')
title Redux DevTools
include ../style.pug
body
#root
div(style='position: relative')
img(
src='/img/loading.svg',
height=300, width=350,
style='position: absolute; top: 50%; left: 50%; margin-top: -175px; margin-left: -175px;'
)
script(src='/window.bundle.js')

View File

@ -0,0 +1 @@
module.exports = {};

View File

@ -1,7 +1,7 @@
import React from 'react';
import { render, screen, within } from '@testing-library/react';
import { Provider } from 'react-redux';
import configureStore from '../../../src/window/store/windowStore';
import configureStore from '../../../src/devpanel/store/panelStore';
import App from '../../../src/app/App';
Object.defineProperty(window, 'matchMedia', {

View File

@ -20,16 +20,7 @@ describe('API', () => {
expect(message).toEqual({
source: '@devtools-page',
type: 'OPEN',
position: 'right',
});
message = await listenMessage(() => {
window.__REDUX_DEVTOOLS_EXTENSION__.open('left');
});
expect(message).toEqual({
source: '@devtools-page',
type: 'OPEN',
position: 'left',
position: 'window',
});
});

View File

@ -1,4 +1,3 @@
import '@babel/polyfill';
import { createStore, compose } from 'redux';
import { insertScript, listenMessage } from '../../utils/inject';
import '../../../src/pageScript';

View File

@ -1,10 +1,8 @@
import { resolve } from 'path';
import webdriver from 'selenium-webdriver';
import chrome from 'selenium-webdriver/chrome';
import chromedriver from 'chromedriver115';
import { switchMonitorTests, delay } from '../utils/e2e';
const port = 9515;
const path = resolve(__dirname, '..', '..', 'dist');
const extensionId = 'lmhkpmbekcpmknklioeibfkpmmfibljd';
const actionsPattern =
@ -14,12 +12,11 @@ describe('Chrome extension', function () {
let driver;
beforeAll(async () => {
chromedriver.start();
await delay(2000);
driver = new webdriver.Builder()
.usingServer(`http://localhost:${port}`)
.setChromeOptions(
new chrome.Options().addArguments(`load-extension=${path}`),
new chrome.Options()
.setBrowserVersion('stable')
.addArguments(`load-extension=${path}`),
)
.forBrowser('chrome')
.build();
@ -27,13 +24,12 @@ describe('Chrome extension', function () {
afterAll(async () => {
await driver.quit();
chromedriver.stop();
});
it("should open extension's window", async () => {
await driver.get(`chrome-extension://${extensionId}/window.html#left`);
await driver.get(`chrome-extension://${extensionId}/devpanel.html`);
const url = await driver.getCurrentUrl();
expect(url).toBe(`chrome-extension://${extensionId}/window.html#left`);
expect(url).toBe(`chrome-extension://${extensionId}/devpanel.html`);
});
it('should match document title', async () => {
@ -41,29 +37,8 @@ describe('Chrome extension', function () {
expect(title).toBe('Redux DevTools');
});
it("should contain inspector monitor's component", async () => {
await delay(1000);
const val = await driver
.findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]'))
.getText();
expect(val).toBeDefined();
});
it('should contain an empty actions list', async () => {
const val = await driver
.findElement(
webdriver.By.xpath('//div[contains(@class, "actionListRows-")]'),
)
.getText();
expect(val).toBe('');
});
Object.keys(switchMonitorTests).forEach((description) =>
it(description, () => switchMonitorTests[description](driver)),
);
it('should get actions list', async () => {
const url = 'http://zalmoxisus.github.io/examples/router/';
const url = 'https://zalmoxisus.github.io/examples/router/';
await driver.executeScript(`window.open('${url}')`);
await delay(2000);
@ -74,11 +49,10 @@ describe('Chrome extension', function () {
await driver.switchTo().window(tabs[0]);
await delay(1000);
const result = await driver.wait(
driver
.findElement(
webdriver.By.xpath('//div[contains(@class, "actionListRows-")]'),
)
.findElement(webdriver.By.xpath('//div[@data-testid="actionListRows"]'))
.getText()
.then((val) => {
return actionsPattern.test(val);
@ -88,4 +62,16 @@ describe('Chrome extension', function () {
);
expect(result).toBeTruthy();
});
it("should contain inspector monitor's component", async () => {
const val = await driver
.findElement(webdriver.By.xpath('//div[@data-testid="inspector"]'))
.getText();
expect(val).toBeDefined();
});
Object.keys(switchMonitorTests).forEach((description) =>
// eslint-disable-next-line jest/expect-expect,jest/valid-title
it(description, () => switchMonitorTests[description](driver)),
);
});

View File

@ -2,12 +2,11 @@ import { join } from 'path';
import webdriver from 'selenium-webdriver';
import chrome from 'selenium-webdriver/chrome';
import electronPath from 'electron';
import chromedriver from 'chromedriver114';
import chromedriver from 'chromedriver';
import { switchMonitorTests, delay } from '../utils/e2e';
const port = 9515;
const devPanelPath =
'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/window.html';
'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/devpanel.html';
describe('DevTools panel for Electron', function () {
let driver;
@ -16,7 +15,7 @@ describe('DevTools panel for Electron', function () {
chromedriver.start();
await delay(1000);
driver = new webdriver.Builder()
.usingServer(`http://localhost:${port}`)
.usingServer('http://localhost:9515')
.setChromeOptions(
new chrome.Options()
.setChromeBinaryPath(electronPath)
@ -53,13 +52,14 @@ describe('DevTools panel for Electron', function () {
if (attempts === 0) {
return callback('Redux panel not found');
}
if (UI.inspectorView) {
const tabs = UI.inspectorView.tabbedPane.tabs;
if (EUI.InspectorView) {
const instance = EUI.InspectorView.InspectorView.instance();
const tabs = instance.tabbedPane.tabs;
const idList = tabs.map((tab) => tab.id);
const reduxPanelId =
'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljdRedux';
if (idList.indexOf(reduxPanelId) !== -1) {
UI.inspectorView.showPanel(reduxPanelId);
instance.showPanel(reduxPanelId);
return callback(reduxPanelId);
}
}
@ -76,6 +76,7 @@ describe('DevTools panel for Electron', function () {
expect(className).not.toMatch(/hidden/); // not hidden
});
// eslint-disable-next-line jest/expect-expect
it('should have Redux DevTools UI on current tab', async () => {
await driver
.switchTo()
@ -90,7 +91,7 @@ describe('DevTools panel for Electron', function () {
it('should contain INIT action', async () => {
const element = await driver.wait(
webdriver.until.elementLocated(
webdriver.By.xpath('//div[contains(@class, "actionListRows-")]'),
webdriver.By.xpath('//div[@data-testid="actionListRows"]'),
),
5000,
'Element not found',
@ -101,15 +102,17 @@ describe('DevTools panel for Electron', function () {
it("should contain Inspector monitor's component", async () => {
const val = await driver
.findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]'))
.findElement(webdriver.By.xpath('//div[@data-testid="inspector"]'))
.getText();
expect(val).toBeDefined();
});
Object.keys(switchMonitorTests).forEach((description) =>
// eslint-disable-next-line jest/expect-expect,jest/valid-title
it(description, () => switchMonitorTests[description](driver)),
);
// eslint-disable-next-line jest/no-commented-out-tests
/* it('should be no logs in console of main window', async () => {
const handles = await driver.getAllWindowHandles();
await driver.switchTo().window(handles[1]); // Change to main window

View File

@ -1,4 +1,3 @@
import '@babel/polyfill';
import { bigArray, bigString, circularData } from './data';
import { listenMessage } from '../utils/inject';
import '../../src/browser/extension/inject/pageScript';

View File

@ -1,4 +1,3 @@
require('@babel/polyfill');
global.chrome = require('sinon-chrome');
require('@testing-library/jest-dom');

View File

@ -1,81 +0,0 @@
const path = require('path');
const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = function (env) {
return {
mode: env.production ? 'production' : 'development',
devtool: env.production ? undefined : 'eval-source-map',
entry: {
background: [
path.resolve(__dirname, 'src/chromeApiMock'),
path.resolve(__dirname, 'src/background/index'),
],
options: [
path.resolve(__dirname, 'src/chromeApiMock'),
path.resolve(__dirname, 'src/options/index'),
],
window: [path.resolve(__dirname, 'src/window/index')],
remote: [path.resolve(__dirname, 'src/remote/index')],
devpanel: [
path.resolve(__dirname, 'src/chromeApiMock'),
path.resolve(__dirname, 'src/devpanel/index'),
],
devtools: path.resolve(__dirname, 'src/devtools/index'),
content: [
path.resolve(__dirname, 'src/chromeApiMock'),
path.resolve(__dirname, 'src/contentScript/index'),
],
page: path.join(__dirname, 'src/pageScript'),
...(env.production
? {}
: { pagewrap: path.resolve(__dirname, 'src/pageScriptWrap') }),
},
output: {
filename: '[name].bundle.js',
},
plugins: [
new webpack.DefinePlugin({
'process.env.BABEL_ENV': JSON.stringify(process.env.NODE_ENV),
}),
new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: 'tsconfig.json',
},
}),
new CopyPlugin({
patterns: [
{
from: path.join(__dirname, 'chrome/manifest.json'),
to: path.join(__dirname, 'dist/manifest.json'),
},
{
from: path.join(__dirname, 'src/assets'),
to: path.join(__dirname, 'dist'),
},
],
}),
],
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
module: {
rules: [
{
test: /\.(js|ts)x?$/,
use: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.css?$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.pug$/,
use: ['file-loader?name=[name].html', 'pug-html-loader'],
},
],
},
};
};

View File

@ -1,31 +0,0 @@
const path = require('path');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
module.exports = {
mode: 'production',
entry: {
pagewrap: path.resolve(__dirname, 'src/pageScriptWrap'),
},
output: {
filename: '[name].bundle.js',
},
plugins: [
new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: 'tsconfig.json',
},
}),
],
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
module: {
rules: [
{
test: /\.(js|ts)x?$/,
use: 'babel-loader',
exclude: /(node_modules|dist\/page\.bundle)/,
},
],
},
};

40
nx.json
View File

@ -1,40 +0,0 @@
{
"extends": "nx/presets/npm.json",
"npmScope": "undetermined",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "test", "lint", "package", "prepare"]
}
}
},
"targetDependencies": {
"build": [
{
"target": "build",
"projects": "dependencies"
}
],
"prepare": [
{
"target": "prepare",
"projects": "dependencies"
}
],
"package": [
{
"target": "package",
"projects": "dependencies"
}
]
},
"affected": {
"defaultBase": "main"
},
"pluginsConfig": {
"@nrwl/js": {
"analyzeSourceFiles": false
}
}
}

View File

@ -1,43 +1,28 @@
{
"private": true,
"devDependencies": {
"@babel/core": "^7.22.10",
"@babel/eslint-parser": "^7.22.10",
"@changesets/cli": "^2.26.2",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.6.2",
"prettier": "3.0.2",
"typescript": "~5.1.6",
"nx": "^16.7.2",
"@nrwl/nx-cloud": "^16.3.0"
"@babel/core": "^7.26.9",
"@changesets/cli": "^2.28.1",
"@eslint/compat": "^1.2.7",
"@eslint/js": "^9.21.0",
"eslint": "^9.21.0",
"eslint-config-prettier": "^10.0.2",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^4.6.2",
"jest": "^29.7.0",
"prettier": "3.5.3",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.0"
},
"scripts": {
"format": "prettier --write .",
"format:check": "prettier --check .",
"build:all": "nx run-many --target=build --all --parallel=1",
"lint:all": "nx run-many --target=lint --all --parallel=1",
"test:all": "nx run-many --target=test --all --parallel=1",
"clean:all": "nx run-many --target=clean --all --parallel=1",
"release": "pnpm build:all && changeset publish"
"build:all": "pnpm --recursive run build",
"lint:all": "pnpm --recursive run lint",
"test:all": "pnpm --recursive run test",
"clean:all": "pnpm --recursive run clean",
"release": "pnpm build:all && pnpm publish -r"
},
"workspaces": [
"extension",
"packages/*",
"packages/d3-state-visualizer/examples/tree",
"packages/react-dock/demo",
"packages/react-json-tree/examples",
"packages/redux-devtools/examples/counter",
"packages/redux-devtools/examples/todomvc",
"packages/redux-devtools-inspector-monitor/demo",
"packages/redux-devtools-inspector-monitor-test-tab/demo",
"packages/redux-devtools-rtk-query-monitor/demo",
"packages/redux-devtools-slider-monitor/examples/todomvc"
],
"packageManager": "pnpm@8.6.12"
"packageManager": "pnpm@9.15.6"
}

View File

@ -1,2 +0,0 @@
examples
lib

View File

@ -1,13 +0,0 @@
module.exports = {
extends: '../../eslintrc.js.base.json',
overrides: [
{
files: ['*.ts'],
extends: '../../eslintrc.ts.base.json',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
},
],
};

View File

@ -1,5 +1,17 @@
# Change Log
## 3.0.0
### Major Changes
- 191d419: Convert d3 packages to ESM
### Patch Changes
- Updated dependencies [191d419]
- d3tooltip@4.0.0
- map2tree@4.0.0
## 2.0.0
### Major Changes

View File

@ -1,7 +0,0 @@
{
"presets": [
["@babel/preset-env", { "targets": "defaults", "modules": false }],
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-transform-runtime"]
}

View File

@ -1,7 +0,0 @@
{
"presets": [
["@babel/preset-env", { "targets": "defaults" }],
"@babel/preset-typescript"
],
"plugins": ["@babel/plugin-transform-runtime"]
}

View File

@ -0,0 +1,10 @@
import eslintJs from '../../eslint.js.config.base.mjs';
import eslintTs from '../../eslint.ts.config.base.mjs';
export default [
...eslintJs,
...eslintTs(import.meta.dirname),
{
ignores: ['examples', 'lib'],
},
];

View File

@ -1,17 +0,0 @@
module.exports = {
extends: '../../../../eslintrc.ts.base.json',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
overrides: [
{
files: ['webpack.config.ts'],
extends: '../../../../eslintrc.ts.base.json',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.webpack.json'],
},
},
],
};

View File

@ -1,5 +1,13 @@
# d3-state-visualizer-tree-example
## 0.1.6
### Patch Changes
- Updated dependencies [191d419]
- d3-state-visualizer@3.0.0
- map2tree@4.0.0
## 0.1.5
### Patch Changes

View File

@ -0,0 +1,15 @@
import eslintJs from '../../../../eslint.js.config.base.mjs';
import eslintTs from '../../../../eslint.ts.config.base.mjs';
export default [
...eslintJs,
...eslintTs(import.meta.dirname),
...eslintTs(
import.meta.dirname,
['webpack.config.ts'],
['./tsconfig.webpack.json'],
),
{
ignores: ['dist'],
},
];

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "d3-state-visualizer-tree-example",
"version": "0.1.5",
"version": "0.1.6",
"description": "Visualize your app state as a tree",
"keywords": [
"d3",
@ -21,30 +21,26 @@
"scripts": {
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --open",
"build": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack",
"lint": "eslint . --ext .ts",
"lint": "eslint .",
"type-check": "tsc --noEmit"
},
"dependencies": {
"d3-state-visualizer": "^2.0.0",
"map2tree": "^3.0.0"
"d3-state-visualizer": "workspace:^",
"map2tree": "workspace:^"
},
"devDependencies": {
"@babel/core": "^7.22.10",
"@babel/preset-env": "^7.22.10",
"@babel/preset-typescript": "^7.22.5",
"@types/node": "^18.17.6",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"babel-loader": "^9.1.3",
"@babel/core": "^7.26.9",
"@babel/preset-env": "^7.26.9",
"@babel/preset-typescript": "^7.26.0",
"@types/node": "^22.13.9",
"babel-loader": "^10.0.0",
"cross-env": "^7.0.3",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"html-webpack-plugin": "^5.5.3",
"ts-node": "^10.9.1",
"typescript": "~5.1.6",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
"fork-ts-checker-webpack-plugin": "^9.0.2",
"html-webpack-plugin": "^5.6.3",
"ts-node": "^10.9.2",
"typescript": "~5.8.2",
"webpack": "^5.98.0",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.0"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "d3-state-visualizer",
"version": "2.0.0",
"version": "3.0.0",
"description": "Visualize your app state with a range of reusable charts",
"keywords": [
"d3",
@ -20,46 +20,33 @@
"lib",
"src"
],
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"types": "lib/types/index.d.ts",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"type": "module",
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
"build": "tsc",
"clean": "rimraf lib",
"lint": "eslint . --ext .ts",
"lint": "eslint .",
"type-check": "tsc --noEmit",
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint"
"prepublish": "pnpm run lint"
},
"dependencies": {
"@babel/runtime": "^7.22.10",
"@types/d3": "^7.4.0",
"d3": "^7.8.5",
"d3tooltip": "^3.0.0",
"@types/d3": "^7.4.3",
"d3": "^7.9.0",
"d3tooltip": "workspace:^",
"deepmerge": "^4.3.1",
"map2tree": "^3.0.0",
"ramda": "^0.29.0"
"map2tree": "workspace:^",
"ramda": "^0.30.1"
},
"devDependencies": {
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.10",
"@babel/eslint-parser": "^7.22.10",
"@babel/preset-env": "^7.22.10",
"@babel/preset-typescript": "^7.22.5",
"@types/ramda": "^0.29.3",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"rimraf": "^5.0.1",
"typescript": "~5.1.6"
"@types/ramda": "^0.30.2",
"rimraf": "^6.0.1",
"typescript": "~5.8.2"
}
}

View File

@ -1,4 +1,4 @@
export type { HierarchyPointNode } from 'd3';
export type { StyleValue } from 'd3tooltip';
export { default as tree } from './tree/tree';
export type { Node, Options } from './tree/tree';
export { default as tree } from './tree/tree.js';
export type { Node, Options } from './tree/tree.js';

View File

@ -9,14 +9,14 @@ import {
toggleChildren,
visit,
getNodeGroupByDepthCount,
} from './utils';
} from './utils.js';
import { tooltip } from 'd3tooltip';
import type { StyleValue } from 'd3tooltip';
export interface Options {
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
state?: {} | null;
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
tree?: Node | {};
rootKeyName: string;
@ -401,8 +401,8 @@ export default function (DOMNode: HTMLElement, options: Partial<Options> = {}) {
d.data._children && d.data._children.length > 0
? nodeStyleOptions.colors.collapsed
: d.data.children && d.data.children.length > 0
? nodeStyleOptions.colors.parent
: nodeStyleOptions.colors.default,
? nodeStyleOptions.colors.parent
: nodeStyleOptions.colors.default,
);
// transition nodes to their new position
@ -473,9 +473,10 @@ export default function (DOMNode: HTMLElement, options: Partial<Options> = {}) {
// update the links
const link = vis
.selectAll<SVGPathElement, HierarchyPointLink<InternalNode>>(
'path.link',
)
.selectAll<
SVGPathElement,
HierarchyPointLink<InternalNode>
>('path.link')
.data(links, (d) => d.target.data.id);
// enter any new links at the parent's previous position

View File

@ -1,6 +1,6 @@
import { is, join, pipe, replace } from 'ramda';
import sortAndSerialize from './sortAndSerialize';
import type { InternalNode } from './tree';
import sortAndSerialize from './sortAndSerialize.js';
import type { InternalNode } from './tree.js';
export function collapseChildren(node: InternalNode) {
if (node.children) {

View File

@ -1,2 +1,7 @@
export { tree } from './charts';
export type { HierarchyPointNode, Node, Options, StyleValue } from './charts';
export { tree } from './charts/index.js';
export type {
HierarchyPointNode,
Node,
Options,
StyleValue,
} from './charts/index.js';

Some files were not shown because too many files have changed in this diff Show More