Compare commits

..

No commits in common. "main" and "remotedev-redux-devtools-extensions@3.1.11" have entirely different histories.

271 changed files with 17564 additions and 17965 deletions

View File

@ -1,5 +0,0 @@
---
'@redux-devtools/cli': major
---
Require Node.js 20

View File

@ -8,12 +8,15 @@ on:
jobs:
build:
runs-on: 'ubuntu-22.04'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'

View File

@ -10,18 +10,18 @@ permissions: write-all
jobs:
release:
name: Release
runs-on: 'ubuntu-22.04'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v6
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@v4
- uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v6
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@v6
uses: actions/upload-artifact@v4
with:
name: chrome
path: extension/chrome/dist
- name: Archive Edge Extension
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v4
with:
name: edge
path: extension/edge/dist
- name: Archive Firefox Extension
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v4
with:
name: firefox
path: extension/firefox/dist

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/). [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`).
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`).
## Backers

View File

@ -1,5 +1,4 @@
import { defineConfig } from 'eslint/config';
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
export default defineConfig([eslint.configs.recommended, eslintConfigPrettier]);
export default [eslint.configs.recommended, eslintConfigPrettier];

View File

@ -1,41 +0,0 @@
import { defineConfig } from 'eslint/config';
import eslint from '@eslint/js';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import jest from 'eslint-plugin-jest';
import eslintConfigPrettier from 'eslint-config-prettier';
export default defineConfig([
{
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'],
...reactHooks.configs.flat.recommended,
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
...jest.configs['flat/recommended'],
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
...jest.configs['jest/style'],
},
{
files: ['test/**/*.js', 'test/**/*.jsx'],
...eslintConfigPrettier,
},
]);

View File

@ -1,57 +1,55 @@
import { defineConfig } from 'eslint/config';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
export default (tsconfigRootDir, files = ['**/*.ts'], project = true) =>
defineConfig([
{
files,
...eslint.configs.recommended,
},
...tseslint.configs.recommendedTypeChecked.map((config) => ({
files,
...config,
})),
...tseslint.configs.stylisticTypeChecked.map((config) => ({
files,
...config,
})),
{
files,
languageOptions: {
parserOptions: {
project,
tsconfigRootDir,
},
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,
...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',
},
{
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

@ -1,66 +1,64 @@
import { defineConfig } from 'eslint/config';
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) =>
defineConfig([
{
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,
},
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['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',
},
{
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

@ -1,88 +1,89 @@
import { defineConfig } from 'eslint/config';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
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,
) =>
defineConfig([
{
files,
...eslint.configs.recommended,
},
...tseslint.configs.recommendedTypeChecked.map((config) => ({
files,
...config,
})),
...tseslint.configs.stylisticTypeChecked.map((config) => ({
files,
...config,
})),
{
files,
languageOptions: {
parserOptions: {
project,
tsconfigRootDir,
},
) => [
{
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,
...react.configs.flat.recommended,
},
{
files,
settings: {
react: {
version: 'detect',
},
},
{
files,
...reactHooks.configs.flat.recommended,
},
{
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,
},
},
{
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',
},
},
],
'@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

@ -1,84 +1,85 @@
import { defineConfig } from 'eslint/config';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
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) =>
defineConfig([
{
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,
},
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'],
...react.configs.flat.recommended,
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
settings: {
react: {
version: 'detect',
},
},
{
files: ['test/**/*.ts', 'test/**/*.tsx'],
...reactHooks.configs.flat.recommended,
},
{
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['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',
},
{
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',
},
},
]);
},
];

3
extension/.eslintignore Normal file
View File

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

31
extension/.eslintrc Normal file
View File

@ -0,0 +1,31 @@
{
"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,85 +1,5 @@
# remotedev-redux-devtools-extension
## 3.2.11
### Patch Changes
- Updated dependencies [6163276]
- @redux-devtools/app@7.0.0
- @redux-devtools/slider-monitor@6.0.0
- @redux-devtools/ui@2.0.0
## 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

View File

@ -57,7 +57,7 @@ const composeEnhancers =
compose;
```
> For TypeScript use [`redux-devtools-extension` npm package](#13-use-redux-devtoolsextension-package-from-npm), which contains all the definitions, or just use `(window as any)` (see [Recipes](docs/Recipes.md#using-in-a-typescript-project) for an example).
> For TypeScript use [`redux-devtools-extension` npm package](#13-use-redux-devtoolsextension-package-from-npm), which contains all the definitions, or just use `(window as any)` (see [Recipes](/docs/Recipes.md#using-in-a-typescript-project) for an example).
```js
const composeEnhancers = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
@ -228,7 +228,7 @@ See [integrations](docs/Integrations.md) and [the blog post](https://medium.com/
- [Methods (advanced API)](docs/API/Methods.md)
- [FAQ](docs/FAQ.md)
- Features
- [Trace actions calls](docs/Features/Trace.md)
- [Trace actions calls](/docs/Features/Trace.md)
- [Troubleshooting](docs/Troubleshooting.md)
- [Articles](docs/Articles.md)
- [Videos](docs/Videos.md)

View File

@ -5,7 +5,7 @@ import pug from 'pug';
const args = process.argv.slice(2);
const prod = !args.includes('--dev');
await esbuild.build({
const commonEsbuildOptions = {
bundle: true,
logLevel: 'info',
outdir: 'dist',
@ -15,24 +15,40 @@ await esbuild.build({
'process.env.NODE_ENV': prod ? '"production"' : '"development"',
'process.env.BABEL_ENV': prod ? '"production"' : '"development"',
},
};
await esbuild.build({
...commonEsbuildOptions,
entryPoints: [
{ out: 'background.bundle', in: 'src/background/index.ts' },
{ out: 'options.bundle', in: 'src/options/index.tsx' },
{ out: 'window.bundle', in: 'src/window/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' },
...(prod ? [] : [{ out: 'pagewrap.bundle', in: 'src/pageScriptWrap.ts' }]),
],
loader: {
'.woff2': 'file',
},
});
if (prod) {
await esbuild.build({
...commonEsbuildOptions,
entryPoints: [{ out: 'pagewrap.bundle', in: 'src/pageScriptWrap.ts' }],
loader: {
'.js': 'text',
},
});
}
console.log();
console.log('Creating HTML files...');
const htmlFiles = ['devpanel', 'devtools', 'options', 'remote'];
const htmlFiles = ['devpanel', 'devtools', 'options', 'remote', 'window'];
for (const htmlFile of htmlFiles) {
fs.writeFileSync(
`dist/${htmlFile}.html`,

View File

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

View File

@ -51,6 +51,7 @@ _number_ - maximum stack trace frames to be stored (in case `trace` option was p
_boolean_ or _object_ which contains:
- **options** `object or boolean`:
- `undefined` - will use regular `JSON.stringify` to send data (it's the fast mode).
- `false` - will handle also circular references.
- `true` - will handle also date, regex, undefined, primitives, error objects, symbols, maps, sets and functions.

View File

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

View File

@ -1,38 +0,0 @@
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,22 +1,28 @@
{
"version": "3.2.10",
"version": "3.1.10",
"name": "Redux DevTools",
"manifest_version": 3,
"manifest_version": 2,
"description": "Redux Developer Tools for debugging application state changes.",
"homepage_url": "https://github.com/reduxjs/redux-devtools",
"browser_specific_settings": {
"applications": {
"gecko": {
"id": "extension@redux.devtools"
}
},
"action": {
"page_action": {
"default_icon": "img/logo/38x38.png",
"default_title": "Redux DevTools",
"default_popup": "devpanel.html#popup"
"default_popup": "window.html#popup"
},
"commands": {
"devtools-window": {
"description": "DevTools window"
"devtools-left": {
"description": "DevTools window to left"
},
"devtools-right": {
"description": "DevTools window to right"
},
"devtools-bottom": {
"description": "DevTools window to bottom"
},
"devtools-remote": {
"description": "Remote DevTools"
@ -36,22 +42,21 @@
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["content.bundle.js"],
"js": ["content.bundle.js", "pagewrap.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",
"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:;"
}
"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:;"
}

View File

@ -3,9 +3,9 @@ module.exports = {
testPathIgnorePatterns: ['<rootDir>/examples'],
testEnvironment: 'jsdom',
moduleNameMapper: {
'\\.css$': '<rootDir>/test/__mocks__/styleMock.js',
'\\.css$': '<rootDir>/test/__mocks__/styleMock.ts',
},
transformIgnorePatterns: [
'node_modules/(?!.pnpm|@babel/code-frame|@babel/highlight|@babel/helper-validator-identifier|@x0k/json-schema-merge|chalk|color|d3|dateformat|delaunator|internmap|jsondiffpatch|js-tokens|lodash-es|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.2.11",
"version": "3.1.11",
"description": "Redux Developer Tools for debugging application state changes.",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/extension",
"license": "MIT",
@ -16,65 +16,70 @@
"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": "cross-env SE_FORCE_BROWSER_DOWNLOAD=true jest test/chrome",
"build:test:electron:fixture": "webpack --config test/electron/fixture/webpack.config.js",
"test:chrome": "jest test/chrome",
"test:electron": "pnpm run build:test:electron:fixture && jest test/electron",
"test": "pnpm run test:app && pnpm run test:chrome && pnpm run test:electron",
"lint": "eslint .",
"build:test:electron:fixture": "webpack --config test/electron/fixture/webpack.config.js",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@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.11.2",
"@emotion/react": "^11.13.0",
"@redux-devtools/app": "^6.1.0",
"@redux-devtools/core": "^4.0.0",
"@redux-devtools/instrument": "^2.1.0",
"@redux-devtools/serialize": "^0.4.1",
"@redux-devtools/slider-monitor": "^5.0.1",
"@redux-devtools/ui": "^1.3.2",
"@redux-devtools/utils": "^3.0.0",
"@reduxjs/toolkit": "^2.2.7",
"@types/jsan": "^3.1.5",
"jsan": "^3.1.14",
"localforage": "^1.10.0",
"lodash-es": "^4.17.22",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"react-icons": "^5.5.0",
"react-is": "^19.2.3",
"react-json-tree": "workspace:^",
"react-redux": "^9.2.0",
"lodash": "^4.17.21",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
"react-is": "^18.3.1",
"react-json-tree": "^0.19.0",
"react-redux": "^9.1.2",
"redux": "^5.0.1",
"redux-persist": "^6.0.0"
"redux-persist": "^6.0.0",
"styled-components": "^5.3.11"
},
"devDependencies": {
"@babel/core": "^7.28.6",
"@babel/preset-env": "^7.28.6",
"@babel/preset-react": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@babel/register": "^7.28.6",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@types/chrome": "^0.1.33",
"@types/lodash-es": "^4.17.12",
"@types/react": "^19.2.8",
"@types/react-dom": "^19.2.3",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@babel/register": "^7.24.6",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@types/chrome": "^0.0.269",
"@types/lodash": "^4.17.7",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/styled-components": "^5.1.34",
"chromedriver": "^126.0.5",
"cross-env": "^10.1.0",
"electron": "^31.7.7",
"esbuild": "^0.27.2",
"globals": "^17.0.0",
"immutable": "^5.1.4",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"cross-env": "^7.0.3",
"electron": "^31.3.1",
"esbuild": "^0.23.0",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"immutable": "^4.3.7",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"pug": "^3.0.3",
"rimraf": "^6.1.2",
"selenium-webdriver": "^4.39.0",
"rimraf": "^6.0.1",
"selenium-webdriver": "^4.23.0",
"sinon-chrome": "^3.0.1",
"ts-jest": "^29.4.6",
"typescript": "~5.9.3",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1"
"ts-jest": "^29.2.4",
"typescript": "~5.5.4",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4"
}
}

View File

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

View File

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

View File

@ -1,23 +1,29 @@
import '../chromeApiMock';
import configureStore from './store/backgroundStore';
import { Store } from 'redux';
import configureStore, { BackgroundAction } from './store/backgroundStore';
import openDevToolsWindow, { DevToolsPosition } from './openWindow';
import { createMenu, removeMenu } from './contextMenus';
import { getOptions } from '../options/syncOptions';
import syncOptions from '../options/syncOptions';
import { BackgroundState } from './store/backgroundReducer';
declare global {
interface Window {
store: Store<BackgroundState, BackgroundAction>;
}
}
// Expose the extension's store globally to access it from the windows
// via chrome.runtime.getBackgroundPage
export const store = configureStore();
window.store = configureStore();
// Listen for keyboard shortcuts
chrome.commands.onCommand.addListener((shortcut) => {
openDevToolsWindow(shortcut as DevToolsPosition);
});
// Disable the action by default and create the context menu when installed
// Create the context menu when installed
chrome.runtime.onInstalled.addListener(() => {
void chrome.action.disable();
getOptions((option) => {
syncOptions().get((option) => {
if (option.showContextMenus) createMenu();
});
});
@ -26,13 +32,6 @@ chrome.runtime.onInstalled.addListener(() => {
chrome.storage.onChanged.addListener((changes) => {
if (changes.showContextMenus) {
if (changes.showContextMenus.newValue) createMenu();
else void removeMenu();
else 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,16 +1,11 @@
import { LIFTED_ACTION } from '@redux-devtools/app';
import { store } from './index';
export function getReport(
reportId: string,
tabId: string | number,
instanceId: number,
) {
chrome.storage.local.get<{
's:hostname': string | undefined;
's:port': string | undefined;
's:secure': string | undefined;
}>(['s:hostname', 's:port', 's:secure'], (options) => {
chrome.storage.local.get(['s:hostname', 's:port', 's:secure'], (options) => {
if (!options['s:hostname'] || !options['s:port']) return;
const url = `${options['s:secure'] ? 'https' : 'http'}://${
options['s:hostname']
@ -29,7 +24,7 @@ export function getReport(
.then((json) => {
const { payload, preloadedState } = json;
if (!payload) return;
store.dispatch({
window.store.dispatch({
type: LIFTED_ACTION,
message: 'IMPORT',
state: JSON.stringify({ payload, preloadedState }),

View File

@ -1,34 +1,83 @@
export type DevToolsPosition = 'devtools-window' | 'devtools-remote';
export type DevToolsPosition =
| 'devtools-left'
| 'devtools-right'
| 'devtools-bottom'
| 'devtools-panel'
| 'devtools-remote';
const windows: { [K in DevToolsPosition]?: number } = {};
let windows: { [K in DevToolsPosition]?: number } = {};
let lastPosition: DevToolsPosition | null = null;
export default function openDevToolsWindow(position: DevToolsPosition) {
if (!windows[position]) {
createWindow(position);
} else {
chrome.windows.update(windows[position], { focused: true }, () => {
if (chrome.runtime.lastError) createWindow(position);
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,
});
}
});
}
});
}
}
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) {
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-window':
return 'devpanel.html';
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':
return 'remote.html';
default:
throw new Error('Unrecognized position');
params = { width: 850, height: 600 };
url = 'remote.html';
break;
}
popWindow('open', url, params);
}

View File

@ -11,7 +11,11 @@ import {
TOGGLE_PERSIST,
UPDATE_STATE,
} from '@redux-devtools/app';
import type { Options, OptionsMessage } from '../../options/syncOptions';
import syncOptions, {
Options,
OptionsMessage,
SyncOptions,
} from '../../options/syncOptions';
import openDevToolsWindow, { DevToolsPosition } from '../openWindow';
import { getReport } from '../logging';
import { Action, Dispatch, Middleware } from 'redux';
@ -28,7 +32,6 @@ 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;
@ -48,11 +51,6 @@ 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;
@ -161,6 +159,10 @@ export type UpdateStateRequest<S, A extends Action<string>> =
| SerializedActionMessage
| SerializedStateMessage<S, A>;
export interface EmptyUpdateStateAction {
readonly type: typeof UPDATE_STATE;
}
interface UpdateStateAction<S, A extends Action<string>> {
readonly type: typeof UPDATE_STATE;
request: UpdateStateRequest<S, A>;
@ -194,7 +196,7 @@ interface SplitUpdateStateAction<S, A extends Action<string>> {
export type TabMessage =
| StartAction
| StopAction
| OptionsAction
| OptionsMessage
| DispatchAction
| ImportAction
| ActionAction
@ -209,6 +211,11 @@ export type PanelMessage<S, A extends Action<string>> =
export type PanelMessageWithSplitAction<S, A extends Action<string>> =
| PanelMessage<S, A>
| SplitUpdateStateAction<S, A>;
export type MonitorMessage =
| NAAction
| ErrorMessage
| EmptyUpdateStateAction
| SetPersistAction;
type TabPort = Omit<chrome.runtime.Port, 'postMessage'> & {
postMessage: (message: TabMessage) => void;
@ -218,15 +225,20 @@ type PanelPort = Omit<chrome.runtime.Port, 'postMessage'> & {
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<
@ -235,6 +247,7 @@ const chunks: {
>;
} = {};
let monitors = 0;
let isMonitored = false;
const getId = (sender: chrome.runtime.MessageSender, name?: string) =>
sender.tab ? sender.tab.id! : name || sender.id!;
@ -248,12 +261,22 @@ type MonitorAction<S, A extends Action<string>> =
// 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}`);
function toMonitors<S, A extends Action<string>>(
action: MonitorAction<S, A>,
tabId?: string | number,
verbose?: boolean,
) {
for (const monitorPort of Object.values(connections.monitor)) {
monitorPort.postMessage(
verbose || action.type === 'ERROR' || action.type === SET_PERSIST
? action
: { type: UPDATE_STATE },
);
}
for (const port of Object.values(connections.panel)) {
for (const panelPort of Object.values(connections.panel)) {
try {
port.postMessage(action);
panelPort.postMessage(action);
} catch (err) {
if (
action.type !== UPDATE_STATE ||
@ -284,11 +307,11 @@ function toMonitors<S, A extends Action<string>>(action: MonitorAction<S, A>) {
value;
}
port.postMessage({ ...action, request: splitMessageStart });
panelPort.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({
panelPort.postMessage({
...action,
request: {
split: 'chunk',
@ -301,7 +324,7 @@ function toMonitors<S, A extends Action<string>>(action: MonitorAction<S, A>) {
}
}
port.postMessage({ ...action, request: { split: 'end' } });
panelPort.postMessage({ ...action, request: { split: 'end' } });
}
}
}
@ -317,15 +340,19 @@ 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(store, message, instanceId, action, state),
id: instanceId.toString().replace(/^[^/]+\//, ''),
state: nonReduxDispatch(
window.store,
message,
instanceId,
action as AppDispatchAction,
state,
),
id: instanceId.toString().replace(/^[^\/]+\//, ''),
});
} else if (messageBody.message === 'IMPORT') {
const { message, action, id, instanceId, state } = messageBody;
@ -333,13 +360,13 @@ function toContentScript(messageBody: ToContentScriptMessage) {
type: message,
action,
state: nonReduxDispatch(
store,
window.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;
@ -347,13 +374,13 @@ function toContentScript(messageBody: ToContentScriptMessage) {
type: message,
action,
state: nonReduxDispatch(
store,
window.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;
@ -361,41 +388,53 @@ function toContentScript(messageBody: ToContentScriptMessage) {
type: message,
action,
state: nonReduxDispatch(
store,
window.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(
store,
window.store,
message,
instanceId,
action as AppDispatchAction,
state,
),
id: (instanceId as number).toString().replace(/^[^/]+\//, ''),
id: (instanceId as number).toString().replace(/^[^\/]+\//, ''),
});
}
}
function toAllTabs(msg: TabMessage) {
console.log(`Message to all tabs: ${msg.type}`);
const tabs = connections.tab;
Object.keys(tabs).forEach((id) => {
tabs[id].postMessage(msg);
});
}
for (const tabPort of Object.values(connections.tab)) {
tabPort.postMessage(msg);
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);
}
isMonitored = shouldMonitor;
}
function getReducerError() {
const instancesState = store.getState().instances;
const instancesState = window.store.getState().instances;
const payload = instancesState.states[instancesState.current];
const computedState = payload.computedStates[payload.currentStateIndex];
if (!computedState) return false;
@ -403,13 +442,13 @@ function getReducerError() {
}
function togglePersist() {
const state = store.getState();
const state = window.store.getState();
if (state.instances.persisted) {
for (const id of Object.keys(state.instances.connections)) {
Object.keys(state.instances.connections).forEach((id) => {
if (connections.tab[id]) return;
store.dispatch({ type: REMOVE_INSTANCE, id });
window.store.dispatch({ type: REMOVE_INSTANCE, id });
toMonitors({ type: 'NA', id });
}
});
}
}
@ -422,35 +461,45 @@ interface OpenOptionsMessage {
readonly type: 'OPEN_OPTIONS';
}
export type SingleMessage = OpenMessage | OpenOptionsMessage | OptionsMessage;
interface GetOptionsMessage {
readonly type: 'GET_OPTIONS';
}
export type SingleMessage =
| OpenMessage
| OpenOptionsMessage
| GetOptionsMessage;
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<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(store.getState().instances.connections).length) {
store.dispatch({ type: DISCONNECTED });
if (!Object.keys(window.store.getState().instances.connections).length) {
window.store.dispatch({ type: DISCONNECTED });
}
return;
}
if (request.type === 'OPEN_OPTIONS') {
void chrome.runtime.openOptionsPage();
chrome.runtime.openOptionsPage();
return;
}
if (request.type === 'OPTIONS') {
toAllTabs({ type: 'OPTIONS', options: request.options });
if (request.type === 'GET_OPTIONS') {
window.syncOptions.get((options) => {
sendResponse!({ options });
});
return;
}
if (request.type === 'GET_REPORT') {
@ -458,8 +507,12 @@ function messaging<S, A extends Action<string>>(
return;
}
if (request.type === 'OPEN') {
let position: DevToolsPosition = 'devtools-window';
if (['remote', 'window'].includes(request.position)) {
let position: DevToolsPosition = 'devtools-left';
if (
['remote', 'panel', 'left', 'right', 'bottom'].indexOf(
request.position,
) !== -1
) {
position = ('devtools-' + request.position) as DevToolsPosition;
}
openDevToolsWindow(position);
@ -467,12 +520,12 @@ function messaging<S, A extends Action<string>>(
}
if (request.type === 'ERROR') {
if (request.payload) {
toMonitors(request);
toMonitors(request, tabId);
return;
}
if (!request.message) return;
const reducerError = getReducerError();
void chrome.notifications.create('app-error', {
chrome.notifications.create('app-error', {
type: 'basic',
title: reducerError
? 'An error occurred in the reducer'
@ -507,31 +560,33 @@ function messaging<S, A extends Action<string>>(
if (request.instanceId) {
action.request.instanceId = instanceId;
}
store.dispatch(action);
window.store.dispatch(action);
toMonitors(action);
if (request.type === 'EXPORT') {
toMonitors(action, tabId, true);
} else {
toMonitors(action, tabId);
}
}
function disconnect(
type: 'tab' | 'panel',
type: 'tab' | 'monitor' | '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 (!store.getState().instances.persisted) {
store.dispatch({ type: REMOVE_INSTANCE, id });
if (!window.store.getState().instances.persisted) {
window.store.dispatch({ type: REMOVE_INSTANCE, id });
toMonitors({ type: 'NA', id });
}
} else {
monitors--;
if (monitors === 0) toAllTabs({ type: 'STOP' });
if (!monitors) monitorInstances(false);
}
};
}
@ -540,23 +595,21 @@ function onConnect<S, A extends Action<string>>(port: chrome.runtime.Port) {
let id: number | string;
let listener;
store.dispatch({ type: CONNECTED, port });
window.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') {
void chrome.action.enable(id);
void chrome.action.setIcon({ tabId: id, path: 'img/logo/38x38.png' });
chrome.pageAction.show(id);
chrome.pageAction.setIcon({ tabId: id, path: 'img/logo/38x38.png' });
}
if (monitors > 0) port.postMessage({ type: 'START' });
if (isMonitored) port.postMessage({ type: 'START' });
const state = store.getState();
const state = window.store.getState();
if (state.instances.persisted) {
const instanceId = `${id}/${msg.instanceId}`;
const persistedState = state.instances.states[instanceId];
@ -580,45 +633,22 @@ function onConnect<S, A extends Action<string>>(port: chrome.runtime.Port) {
port.onMessage.addListener(listener);
port.onDisconnect.addListener(disconnect('tab', id, listener));
} else if (port.name && port.name.indexOf('monitor') === 0) {
// devpanel
id = getId(port.sender!, port.name);
console.log(`Connected to monitor ${id}`);
connections.panel[id] = port;
connections.monitor[id] = port;
monitorInstances(true);
monitors++;
port.onDisconnect.addListener(disconnect('monitor', id));
} else {
// devpanel
id = port.name || port.sender!.frameId!;
connections.panel[id] = port;
monitorInstances(true, port.name);
monitors++;
toAllTabs({ type: 'START' });
listener = (msg: BackgroundAction) => {
console.log(`Message from monitor ${id}: ${msg.type}`);
store.dispatch(msg);
window.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,
});
}
}
}
@ -628,11 +658,18 @@ chrome.runtime.onMessage.addListener(messaging);
chrome.runtime.onMessageExternal.addListener(messaging);
chrome.notifications.onClicked.addListener((id) => {
void chrome.notifications.clear(id);
openDevToolsWindow('devtools-window');
chrome.notifications.clear(id);
openDevToolsWindow('devtools-right');
});
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
declare global {
interface Window {
syncOptions: SyncOptions;
}
}
window.syncOptions = syncOptions(toAllTabs); // Expose to the options page
const api: Middleware<{}, BackgroundState, Dispatch<BackgroundAction>> =
(store) => (next) => (untypedAction) => {
const action = untypedAction as BackgroundAction;

View File

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

View File

@ -1,10 +1,8 @@
import '../chromeApiMock';
import {
getOptions,
injectOptions,
getOptionsFromBg,
isAllowed,
Options,
prefetchOptions,
prepareOptionsForPage,
} from '../options/syncOptions';
import type { TabMessage } from '../background/store/apiMiddleware';
import type {
@ -86,13 +84,6 @@ 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
@ -100,8 +91,7 @@ export type ContentScriptToPageScriptMessage =
| ImportAction
| ActionAction
| ExportAction
| UpdateAction
| OptionsAction;
| UpdateAction;
interface ImportStatePayload<S, A extends Action<string>> {
readonly type: 'IMPORT_STATE';
@ -122,7 +112,6 @@ export type ListenerMessage<S, A extends Action<string>> =
| ActionAction
| ExportAction
| UpdateAction
| OptionsAction
| ImportStateDispatchAction<S, A>;
function postToPageScript(message: ContentScriptToPageScriptMessage) {
@ -167,13 +156,8 @@ function connect() {
source,
});
}
} else if (message.type === 'OPTIONS') {
postToPageScript({
type: message.type,
options: prepareOptionsForPage(message.options),
id: undefined,
source,
});
} else if ('options' in message) {
injectOptions(message.options);
} else {
postToPageScript({
type: message.type,
@ -254,7 +238,7 @@ function tryCatch<S, A extends Action<string>>(
}
newArgs[key as keyof typeof newArgs] = arg;
});
fn(newArgs as SplitMessage);
fn(newArgs as any);
for (let i = 0; i < toSplit.length; i++) {
for (let j = 0; j < toSplit[i][1].length; j += maxChromeMsgSize) {
fn({
@ -305,14 +289,7 @@ function send<S, A extends Action<string>>(
) {
if (!connected) connect();
if (message.type === 'INIT_INSTANCE') {
getOptions((options) => {
postToPageScript({
type: 'OPTIONS',
options: prepareOptionsForPage(options),
id: undefined,
source,
});
});
getOptionsFromBg();
postToBackground({ name: 'INIT_INSTANCE', instanceId: message.instanceId });
} else {
postToBackground({ name: 'RELAY', message });
@ -340,6 +317,4 @@ function handleMessages<S, A extends Action<string>>(
tryCatch(send, message);
}
prefetchOptions();
window.addEventListener('message', handleMessages, false);

View File

@ -5,13 +5,12 @@ 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

@ -6,7 +6,6 @@ import { Persistor } from 'redux-persist';
import {
REMOVE_INSTANCE,
StoreAction,
StoreState,
UPDATE_STATE,
} from '@redux-devtools/app';
import App from '../app/App';
@ -19,24 +18,24 @@ import {
SplitUpdateStateRequest,
UpdateStateRequest,
} from '../background/store/apiMiddleware';
import type { StoreStateWithoutSocket } from './store/panelReducer';
import { PersistGate } from 'redux-persist/integration/react';
const position = location.hash;
const messageStyle: CSSProperties = {
paddingTop: '20px',
padding: '20px',
width: '100%',
textAlign: 'center',
boxSizing: 'border-box',
};
let rendered: boolean | undefined;
let currentRoot: Root | undefined;
let store: Store<StoreState, StoreAction> | undefined;
let store: Store<StoreStateWithoutSocket, StoreAction> | undefined;
let persistor: Persistor | undefined;
let bgConnection: chrome.runtime.Port;
let naTimeout: NodeJS.Timeout;
const isChrome = !navigator.userAgent.includes('Firefox');
const isChrome = navigator.userAgent.indexOf('Firefox') === -1;
function renderNodeAtRoot(node: ReactNode) {
if (currentRoot) currentRoot.unmount();
@ -67,19 +66,13 @@ function renderNA() {
<a
href="https://github.com/zalmoxisus/redux-devtools-extension#usage"
target="_blank"
rel="noreferrer"
>
the instructions
</a>
.
</div>
);
if (
isChrome &&
chrome &&
chrome.devtools &&
chrome.devtools.inspectedWindow
) {
if (isChrome) {
chrome.devtools.inspectedWindow.getResources((resources) => {
if (resources[0].url.substr(0, 4) === 'file') {
message = (
@ -88,7 +81,6 @@ 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>
@ -109,22 +101,17 @@ function renderNA() {
let splitMessage: SplitUpdateStateRequest<unknown, Action<string>>;
function init() {
function init(id: number) {
renderNA();
let name = 'monitor';
if (chrome && chrome.devtools && chrome.devtools.inspectedWindow) {
name += chrome.devtools.inspectedWindow.tabId;
}
bgConnection = chrome.runtime.connect({ name });
bgConnection = chrome.runtime.connect({
name: id ? id.toString() : undefined,
});
bgConnection.onMessage.addListener(
<S, A extends Action<string>>(
message: PanelMessageWithSplitAction<S, A>,
) => {
if (message.type === 'NA') {
// TODO Double-check this now that the name is different
if (message.id === name) renderNA();
if (message.id === id) renderNA();
else store!.dispatch({ type: REMOVE_INSTANCE, id: message.id });
} else {
if (!rendered) renderDevTools();
@ -141,18 +128,12 @@ function init() {
}
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];
if ((splitMessage as Record<string, unknown>)[request.chunk[0]]) {
(splitMessage as Record<string, unknown>)[request.chunk[0]] +=
request.chunk[1];
} else {
(splitMessage as unknown as Record<string, string>)[
request.chunk[0]
] = request.chunk[1];
(splitMessage as Record<string, unknown>)[request.chunk[0]] =
request.chunk[1];
}
return;
}
@ -176,7 +157,4 @@ function init() {
);
}
if (position === '#popup') document.body.style.minWidth = '760px';
if (position !== '#popup') document.body.style.minHeight = '100%';
init();
init(chrome.devtools.inspectedWindow.tabId);

View File

@ -1,29 +1,45 @@
import { combineReducers, Reducer } from 'redux';
import {
connection,
ConnectionState,
instances,
InstancesState,
monitor,
MonitorState,
notification,
NotificationState,
reports,
ReportsState,
section,
socket,
SectionState,
StateTreeSettings,
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;
readonly stateTreeSettings: StateTreeSettings;
}
const rootReducer: Reducer<
StoreState,
StoreStateWithoutSocket,
StoreAction,
Partial<StoreState>
Partial<StoreStateWithoutSocket>
> = combineReducers({
instances,
monitor,
reports,
notification,
section,
socket,
theme,
connection,
stateTreeSettings,

View File

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

View File

@ -7,52 +7,23 @@ import {
TOGGLE_PERSIST,
UPDATE_STATE,
} from '@redux-devtools/app';
import { Dispatch, Middleware, MiddlewareAPI } from 'redux';
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!);
},
);
}
import { Dispatch, Middleware } from 'redux';
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) => (next) => (untypedAction) => {
const action = untypedAction as StoreAction;
const result = next(action);
if (!autoselected && action.type === UPDATE_STATE) {
if (!autoselected && action.type === UPDATE_STATE && tabId) {
autoselected = true;
if (chrome.devtools && chrome.devtools.inspectedWindow) {
selectInstance(chrome.devtools.inspectedWindow.tabId, store, next);
} else {
getCurrentTabId((tabId) => selectInstance(tabId, store, next));
const connections = store.getState().instances.connections[tabId];
if (connections && connections.length === 1) {
next({ type: SELECT_INSTANCE, selected: connections[0] });
}
}
if (action.type === LIFTED_ACTION || action.type === TOGGLE_PERSIST) {

View File

@ -1,8 +1,17 @@
chrome.devtools.panels.create(
'Redux',
'img/logo/scalable.png',
'devpanel.html',
() => {
// do nothing.
},
);
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');
}

View File

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

View File

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

View File

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

View File

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

View File

@ -14,38 +14,34 @@ export interface OptionsProps {
) => void;
}
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>
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.
</div>
);
}
</div>
);

View File

@ -2,25 +2,22 @@ import '../chromeApiMock';
import React from 'react';
import { createRoot } from 'react-dom/client';
import OptionsComponent from './Options';
import {
getOptions,
Options,
OptionsMessage,
saveOption,
subscribeToOptions,
} from './syncOptions';
import { Options } from './syncOptions';
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);
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);
});
});

View File

@ -38,22 +38,21 @@ let options: Options | undefined;
let subscribers: ((options: Options) => void)[] = [];
export interface OptionsMessage {
readonly type: 'OPTIONS';
readonly options: 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!);
}
};
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!));
};
const migrateOldOptions = (oldOptions: OldOrNewOptions): Options => ({
...oldOptions,
@ -72,10 +71,10 @@ const migrateOldOptions = (oldOptions: OldOrNewOptions): Options => ({
: oldOptions.filter,
});
export const getOptions = (callback: (options: Options) => void) => {
const get = (callback: (options: Options) => void) => {
if (options) callback(options);
else {
chrome.storage.sync.get<OldOrNewOptions>(
chrome.storage.sync.get(
{
useEditor: 0,
editor: '',
@ -92,39 +91,74 @@ export const getOptions = (callback: (options: Options) => void) => {
showContextMenus: true,
},
function (items) {
options = migrateOldOptions(items);
options = migrateOldOptions(items as OldOrNewOptions);
callback(options);
},
);
}
};
export const prefetchOptions = () =>
getOptions(() => {
// do nothing.
});
export const subscribeToOptions = (callback: (options: Options) => void) => {
const subscribe = (callback: (options: Options) => void) => {
subscribers = subscribers.concat(callback);
};
const toReg = (str: string) =>
str !== '' ? str.split('\n').filter(Boolean).join('|') : null;
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 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 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

@ -1,3 +1,4 @@
import mapValues from 'lodash/mapValues';
import { Action } from 'redux';
import { LiftedState, PerformAction } from '@redux-devtools/instrument';
import { LocalFilter } from '@redux-devtools/utils';
@ -26,7 +27,8 @@ export function isFiltered<A extends Action<string>>(
) {
if (
noFiltersApplied(localFilter) ||
(typeof action !== 'string' && typeof action.type.match !== 'function')
(typeof action !== 'string' &&
typeof (action.type as string).match !== 'function')
) {
return false;
}
@ -44,15 +46,10 @@ function filterActions<A extends Action<string>>(
actionSanitizer: ((action: A, id: number) => A) | undefined,
): { [p: number]: PerformAction<A> } {
if (!actionSanitizer) return actionsById;
return Object.fromEntries(
Object.entries(actionsById).map(([actionId, action]) => [
actionId,
{
...action,
action: actionSanitizer(action.action, actionId as unknown as number),
},
]),
);
return mapValues(actionsById, (action, id) => ({
...action,
action: actionSanitizer(action.action, id as unknown as number),
}));
}
function filterStates<S>(

View File

@ -58,7 +58,7 @@ export default function importState<S, A extends Action<string>>(
| LiftedState<S, A, unknown> = parse(state) as
| ParsedSerializedLiftedState
| LiftedState<S, A, unknown>;
const preloadedState =
let 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-es';
import throttle from 'lodash/throttle';
import { immutableSerialize } from '@redux-devtools/serialize';
import { getActionsArray, getLocalFilter } from '@redux-devtools/utils';
import { isFiltered, PartialLiftedState } from './filters';
@ -222,7 +222,6 @@ function post<S, A extends Action<string>>(
function getStackTrace(
config: Config,
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
toExcludeFromTrace: Function | undefined,
) {
if (!config.trace) return undefined;
@ -249,7 +248,6 @@ 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
@ -267,11 +265,10 @@ function amendActionType<A extends Action<string>>(
| StructuralPerformAction<A>[]
| string,
config: Config,
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
toExcludeFromTrace: Function | undefined,
): StructuralPerformAction<A> {
const timestamp = Date.now();
const stack = getStackTrace(config, toExcludeFromTrace);
let timestamp = Date.now();
let stack = getStackTrace(config, toExcludeFromTrace);
if (typeof action === 'string') {
return { action: { type: action } as A, timestamp, stack };
}
@ -598,11 +595,7 @@ export function connect(preConfig: Config): ConnectResponse {
};
const sendDelayed = throttle(() => {
sendMessage(
delayedActions,
delayedStates as unknown as LiftedState<unknown, Action<string>, unknown>,
config,
);
sendMessage(delayedActions, delayedStates as any, config);
delayedActions = [];
delayedStates = [];
}, latency);

View File

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

View File

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

View File

@ -4,8 +4,8 @@ import { persistState } from '@redux-devtools/core';
import type { ConfigWithExpandedMaxAge } from './index';
export function getUrlParam(key: string) {
const matches = new RegExp(`[?&]${key}=([^&#]+)\\b`).exec(
window.location.href,
const matches = window.location.href.match(
new RegExp(`[?&]${key}=([^&#]+)\\b`),
);
return matches && matches.length > 0 ? matches[1] : null;
}

View File

@ -4,8 +4,15 @@ import {
getActionsArray,
getLocalFilter,
} from '@redux-devtools/utils';
import { throttle } from 'lodash-es';
import { Action, ActionCreator, Dispatch, Reducer, StoreEnhancer } from 'redux';
import throttle from 'lodash/throttle';
import {
Action,
ActionCreator,
Dispatch,
Reducer,
StoreEnhancer,
StoreEnhancerStoreCreator,
} from 'redux';
import Immutable from 'immutable';
import {
EnhancedStore,
@ -53,7 +60,7 @@ type EnhancedStoreWithInitialDispatch<
> = EnhancedStore<S, A, MonitorState> & { initialDispatch: Dispatch<A> };
const source = '@devtools-page';
const stores: {
let stores: {
[K in string | number]: EnhancedStoreWithInitialDispatch<
unknown,
Action<string>,
@ -167,7 +174,7 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<string>>(
const localFilter = getLocalFilter(config);
const serializeState = getSerializeParameter(config);
const serializeAction = getSerializeParameter(config);
const { stateSanitizer, actionSanitizer, predicate, latency = 500 } = config;
let { stateSanitizer, actionSanitizer, predicate, latency = 500 } = config;
// Deprecate actionsWhitelist and actionsBlacklist
if (config.actionsWhitelist) {
@ -432,13 +439,6 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<string>>(
serializeAction,
);
}
return;
case 'OPTIONS':
window.devToolsOptions = Object.assign(
window.devToolsOptions || {},
message.options,
);
return;
}
}
@ -447,7 +447,7 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<string>>(
liftedAction?: LiftedAction<S, A, unknown>,
liftedState?: LiftedState<S, A, unknown> | undefined,
) => {
const m = (config && config.maxAge) || window.devToolsOptions.maxAge || 50;
let m = (config && config.maxAge) || window.devToolsOptions.maxAge || 50;
if (
!liftedAction ||
noFiltersApplied(localFilter) ||
@ -464,7 +464,10 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<string>>(
if (filteredActionIds.length >= m) {
const stagedActionIds = liftedState!.stagedActionIds;
let i = 1;
while (maxAge > m && !filteredActionIds.includes(stagedActionIds[i])) {
while (
maxAge > m &&
filteredActionIds.indexOf(stagedActionIds[i]) === -1
) {
maxAge--;
i++;
}
@ -536,7 +539,7 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<string>>(
...config,
maxAge: getMaxAge as any,
}) as any
)(reducer_, initialState_);
)(reducer_, initialState_) as any;
if (isInIframe()) setTimeout(init, 3000);
else init();
@ -588,18 +591,18 @@ export type InferComposedStoreExt<StoreEnhancers> = StoreEnhancers extends [
? HeadStoreEnhancer extends StoreEnhancer<infer StoreExt>
? StoreExt & InferComposedStoreExt<RestStoreEnhancers>
: never
: // eslint-disable-next-line @typescript-eslint/no-empty-object-type
{};
: {};
const extensionCompose =
(config: Config) =>
<StoreEnhancers extends readonly StoreEnhancer[]>(
...funcs: StoreEnhancers
): StoreEnhancer<InferComposedStoreExt<StoreEnhancers>> => {
// @ts-expect-error FIXME
// @ts-ignore 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),
);

View File

@ -0,0 +1,19 @@
// @ts-ignore
import script from '../dist/page.bundle.js';
let s = document.createElement('script');
s.type = 'text/javascript';
if (process.env.NODE_ENV === 'production') {
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

@ -0,0 +1,37 @@
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';
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.minWidth = '760px';
if (position !== '#popup') document.body.style.minHeight = '100%';

View File

@ -0,0 +1,51 @@
import { Dispatch, Middleware, MiddlewareAPI } from 'redux';
import {
SELECT_INSTANCE,
StoreAction,
StoreState,
UPDATE_STATE,
} from '@redux-devtools/app';
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!);
},
);
}
const popupSelector: Middleware<{}, StoreState, Dispatch<StoreAction>> =
(store) => (next) => (untypedAction) => {
const action = untypedAction as 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;
};
export default popupSelector;

View File

@ -0,0 +1,34 @@
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

@ -0,0 +1,32 @@
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,
Partial<StoreState>
> = combineReducers({
instances,
monitor,
socket,
reports,
notification,
section,
theme,
connection,
stateTreeSettings,
}) as any;
export default rootReducer;

View File

@ -0,0 +1,81 @@
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 as Store, null, () => {
if (store.getState().connection.type !== 'disabled') {
store.dispatch({
type: CONNECT_REQUEST,
});
}
});
return { store, persistor };
}

View File

@ -0,0 +1,37 @@
import {
getActiveInstance,
LIFTED_ACTION,
StoreAction,
StoreState,
TOGGLE_PERSIST,
UPDATE_STATE,
} from '@redux-devtools/app';
import { Dispatch, Middleware, Store } from 'redux';
import type { BackgroundState } from '../../background/store/backgroundReducer';
import type { BackgroundAction } from '../../background/store/backgroundStore';
const syncStores =
(
baseStore: Store<BackgroundState, BackgroundAction>,
): Middleware<{}, StoreState, Dispatch<StoreAction>> =>
(store) =>
(next) =>
(untypedAction) => {
const action = untypedAction as 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

@ -0,0 +1,18 @@
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;'
)
link(href='/window.bundle.css', rel='stylesheet')
script(src='/window.bundle.js')

View File

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

View File

@ -0,0 +1 @@
export default {};

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/devpanel/store/panelStore';
import configureStore from '../../../src/window/store/windowStore';
import App from '../../../src/app/App';
Object.defineProperty(window, 'matchMedia', {

View File

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

View File

@ -27,9 +27,9 @@ describe('Chrome extension', function () {
});
it("should open extension's window", async () => {
await driver.get(`chrome-extension://${extensionId}/devpanel.html`);
await driver.get(`chrome-extension://${extensionId}/window.html#left`);
const url = await driver.getCurrentUrl();
expect(url).toBe(`chrome-extension://${extensionId}/devpanel.html`);
expect(url).toBe(`chrome-extension://${extensionId}/window.html#left`);
});
it('should match document title', async () => {
@ -37,6 +37,25 @@ 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[@data-testid="inspector"]'))
.getText();
expect(val).toBeDefined();
});
it('should contain an empty actions list', async () => {
const val = await driver
.findElement(webdriver.By.xpath('//div[@data-testid="actionListRows"]'))
.getText();
expect(val).toBe('');
});
Object.keys(switchMonitorTests).forEach((description) =>
it(description, () => switchMonitorTests[description](driver)),
);
it('should get actions list', async () => {
const url = 'https://zalmoxisus.github.io/examples/router/';
await driver.executeScript(`window.open('${url}')`);
@ -49,7 +68,6 @@ describe('Chrome extension', function () {
await driver.switchTo().window(tabs[0]);
await delay(1000);
const result = await driver.wait(
driver
.findElement(webdriver.By.xpath('//div[@data-testid="actionListRows"]'))
@ -62,16 +80,4 @@ 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

@ -6,7 +6,7 @@ import chromedriver from 'chromedriver';
import { switchMonitorTests, delay } from '../utils/e2e';
const devPanelPath =
'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/devpanel.html';
'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/window.html';
describe('DevTools panel for Electron', function () {
let driver;
@ -76,7 +76,6 @@ 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()
@ -108,11 +107,9 @@ describe('DevTools panel for Electron', function () {
});
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

40
nx.json Normal file
View File

@ -0,0 +1,40 @@
{
"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,27 +1,43 @@
{
"private": true,
"devDependencies": {
"@babel/core": "^7.28.6",
"@changesets/cli": "^2.29.8",
"@eslint/js": "^9.39.2",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jest": "^29.12.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"jest": "^30.2.0",
"prettier": "3.8.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.53.0"
"@babel/core": "^7.25.2",
"@changesets/cli": "^2.27.7",
"@eslint/compat": "^1.1.1",
"@eslint/js": "^8.57.0",
"@nrwl/nx-cloud": "^19.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.7.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"jest": "^29.7.0",
"nx": "^19.5.6",
"prettier": "3.3.3",
"typescript": "~5.5.4",
"typescript-eslint": "^8.0.1"
},
"scripts": {
"format": "prettier --write .",
"format:check": "prettier --check .",
"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"
"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"
},
"packageManager": "pnpm@10.28.0"
"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.15.9"
}

View File

@ -17,6 +17,7 @@
### Major Changes
- b323f77d: Upgrade D3
- Remove UMD build.
- Split `style` option into `chartStyles`, `nodeStyleOptions`, `textStyleOptions`, and `linkStyles`.
- The shape of the argument passed to the `onClickText` option has been updated.

View File

@ -25,22 +25,22 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"d3-state-visualizer": "workspace:^",
"map2tree": "workspace:^"
"d3-state-visualizer": "^3.0.0",
"map2tree": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.28.6",
"@babel/preset-env": "^7.28.6",
"@babel/preset-typescript": "^7.28.5",
"@types/node": "^24.10.9",
"babel-loader": "^10.0.0",
"cross-env": "^10.1.0",
"fork-ts-checker-webpack-plugin": "^9.1.0",
"html-webpack-plugin": "^5.6.5",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/preset-typescript": "^7.24.7",
"@types/node": "^20.14.14",
"babel-loader": "^9.1.3",
"cross-env": "^7.0.3",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"html-webpack-plugin": "^5.6.0",
"ts-node": "^10.9.2",
"typescript": "~5.9.3",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.3"
"typescript": "~5.5.4",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
}
}

View File

@ -39,14 +39,14 @@
"dependencies": {
"@types/d3": "^7.4.3",
"d3": "^7.9.0",
"d3tooltip": "workspace:^",
"d3tooltip": "^4.0.0",
"deepmerge": "^4.3.1",
"map2tree": "workspace:^",
"ramda": "^0.32.0"
"map2tree": "^4.0.0",
"ramda": "^0.30.1"
},
"devDependencies": {
"@types/ramda": "^0.31.1",
"rimraf": "^6.1.2",
"typescript": "~5.9.3"
"@types/ramda": "^0.30.1",
"rimraf": "^6.0.1",
"typescript": "~5.5.4"
}
}

View File

@ -17,6 +17,7 @@
### Major Changes
- b323f77d: Upgrade D3
- Remove UMD build.
- Upgrade d3 peer dependency from v3 to v7.
- Remove `attr` configuration method.

View File

@ -35,8 +35,8 @@
"devDependencies": {
"@types/d3": "^7.4.3",
"d3": "^7.9.0",
"rimraf": "^6.1.2",
"typescript": "~5.9.3"
"rimraf": "^6.0.1",
"typescript": "~5.5.4"
},
"peerDependencies": {
"@types/d3": "^7.4.3",

View File

@ -37,15 +37,15 @@
"prepublish": "pnpm run lint && pnpm run test"
},
"dependencies": {
"lodash-es": "^4.17.22"
"lodash-es": "^4.17.21"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/jest": "^29.5.12",
"@types/lodash-es": "^4.17.12",
"immutable": "^5.1.4",
"jest": "^30.2.0",
"rimraf": "^6.1.2",
"ts-jest": "^29.4.6",
"typescript": "~5.9.3"
"immutable": "^4.3.7",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.4",
"typescript": "~5.5.4"
}
}

View File

@ -36,19 +36,19 @@
"prepublish": "pnpm run lint && pnpm run test"
},
"dependencies": {
"@types/lodash": "^4.17.23",
"color": "^5.0.3",
"csstype": "^3.2.3",
"lodash-es": "^4.17.22"
"@types/lodash": "^4.17.7",
"color": "^4.2.3",
"csstype": "^3.1.3",
"lodash-es": "^4.17.21"
},
"devDependencies": {
"@types/color": "^4.2.0",
"@types/jest": "^30.0.0",
"@types/color": "^3.0.6",
"@types/jest": "^29.5.12",
"@types/lodash-es": "^4.17.12",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"rimraf": "^6.1.2",
"ts-jest": "^29.4.6",
"typescript": "~5.9.3"
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.4",
"typescript": "~5.5.4"
}
}

View File

@ -1,11 +1,5 @@
# Change Log
## 0.8.0
### Minor Changes
- 6830118: Add React 19 to peer deps
## 0.7.0
### Minor Changes

View File

@ -1,12 +1,5 @@
# react-dock-demo
## 0.1.7
### Patch Changes
- Updated dependencies [6830118]
- react-dock@0.8.0
## 0.1.6
### Patch Changes

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "react-dock-demo",
"version": "0.1.7",
"version": "0.1.6",
"license": "MIT",
"scripts": {
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --open",
@ -10,30 +10,31 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@emotion/styled": "^11.14.1",
"react": "^19.2.3",
"react-bootstrap": "^2.10.10",
"react-dock": "workspace:^",
"react-dom": "^19.2.3",
"react-icons": "^5.5.0",
"react-is": "^19.2.3"
"react": "^18.3.1",
"react-bootstrap": "^2.10.4",
"react-dock": "^0.7.0",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
"react-is": "^18.3.1",
"styled-components": "^5.3.11"
},
"devDependencies": {
"@babel/core": "^7.28.6",
"@babel/preset-env": "^7.28.6",
"@babel/preset-react": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@types/node": "^24.10.9",
"@types/react": "^19.2.8",
"@types/react-dom": "^19.2.3",
"babel-loader": "^10.0.0",
"cross-env": "^10.1.0",
"fork-ts-checker-webpack-plugin": "^9.1.0",
"html-webpack-plugin": "^5.6.5",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@types/node": "^20.14.14",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/styled-components": "^5.1.34",
"babel-loader": "^9.1.3",
"cross-env": "^7.0.3",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"html-webpack-plugin": "^5.6.0",
"ts-node": "^10.9.2",
"typescript": "~5.9.3",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.3"
"typescript": "~5.5.4",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
}
}

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import Button from 'react-bootstrap/Button';
import Form from 'react-bootstrap/Form';
import { BsX } from 'react-icons/bs';
import styled from '@emotion/styled';
import styled from 'styled-components';
import { Dock } from 'react-dock';

View File

@ -1,9 +1,11 @@
import eslintJs from '../../eslint.js.config.base.mjs';
import eslintTsReact from '../../eslint.ts.react.config.base.mjs';
import eslintTsReactJest from '../../eslint.ts.react.jest.config.base.mjs';
export default [
...eslintJs,
...eslintTsReact(import.meta.dirname),
...eslintTsReactJest(import.meta.dirname),
{
ignores: ['demo', 'lib'],
},

View File

@ -0,0 +1,13 @@
module.exports = {
testEnvironment: 'jsdom',
extensionsToTreatAsEsm: ['.ts', '.tsx'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{ tsconfig: 'tsconfig.test.json', useESM: true },
],
},
};

View File

@ -1,6 +1,6 @@
{
"name": "react-dock",
"version": "0.8.0",
"version": "0.7.0",
"description": "Resizable dockable react component",
"keywords": [
"react",
@ -29,23 +29,30 @@
"scripts": {
"build": "tsc",
"clean": "rimraf lib",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"lint": "eslint .",
"type-check": "tsc --noEmit",
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run lint"
"prepublish": "pnpm run lint && pnpm run test"
},
"dependencies": {
"@types/lodash-es": "^4.17.12",
"lodash-es": "^4.17.22"
"lodash-es": "^4.17.21"
},
"devDependencies": {
"@types/react": "^19.2.8",
"react": "^19.2.3",
"rimraf": "^6.1.2",
"typescript": "~5.9.3"
"@types/jest": "^29.5.12",
"@types/react": "^18.3.3",
"@types/react-test-renderer": "^18.3.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"react": "^18.3.1",
"react-test-renderer": "^18.3.1",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.4",
"typescript": "~5.5.4"
},
"peerDependencies": {
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0"
}
}

View File

@ -228,12 +228,12 @@ interface Props {
dockHiddenStyle?: React.CSSProperties | null;
duration: number;
children?:
| ((params: {
| React.FunctionComponent<{
position: 'left' | 'right' | 'top' | 'bottom';
isResizing: boolean | undefined;
size: number;
isVisible: boolean | undefined;
}) => ReactNode)
}>
| ReactNode;
}
@ -363,7 +363,14 @@ export default class Dock extends Component<Props, State> {
/>
<div style={styles.dockContent}>
{typeof children === 'function'
? children({
? (
children as React.FunctionComponent<{
position: 'left' | 'right' | 'top' | 'bottom';
isResizing: boolean | undefined;
size: number;
isVisible: boolean | undefined;
}>
)({
position,
isResizing,
size,

View File

@ -39,8 +39,7 @@ const prefixes = ['Moz', 'Webkit', 'ms', 'O'];
function prefixProp<Value>(key: string, value: Value) {
return prefixes.reduce<{ [key: string]: Value }>(
(obj, pre) => (
(obj[pre + key[0].toUpperCase() + key.substr(1)] = value),
obj
(obj[pre + key[0].toUpperCase() + key.substr(1)] = value), obj
),
{},
);

View File

@ -0,0 +1,23 @@
import React from 'react';
import TestRenderer from 'react-test-renderer/shallow';
import Dock from '../src/Dock.js';
describe('Dock component', function () {
it('should have shallow rendering', function () {
const renderer = TestRenderer.createRenderer();
const DockEl = <Dock />;
renderer.render(DockEl);
const result = renderer.getRenderOutput();
expect(DockEl.props).toEqual({
position: 'left',
zIndex: 99999999,
fluid: true,
defaultSize: 0.3,
dimMode: 'opaque',
duration: 200,
});
expect(result.type).toBe('div');
});
});

View File

@ -1,11 +1,5 @@
# Change Log
## 0.20.0
### Minor Changes
- 6830118: Add React 19 to peer deps
## 0.19.0
### Minor Changes
@ -22,6 +16,7 @@
### Major Changes
- 81926f32: Remove UNSAFE method from react-json-tree
- Replace `shouldExpandNode` with `shouldExpandNodeInitially`. This function is now only called when a node in the tree is first rendered, when before it would update the expanded state of the node if the results of calling `shouldExpandNode` changed between renders. There is no way to replicate the old behavior exactly, but the new behavior is the intended behavior for the use cases within Redux DevTools. Please open an issue if you need a way to programatically control the expanded state of nodes.
- Bump the minimum React version from `16.3.0` to `16.8.0` so that `react-json-tree` can use hooks.
- Tightened TypeScript prop types to use `unknown` instead of `any` where possible and make the key path array `readonly`.

View File

@ -1,12 +1,5 @@
# react-json-tree-example
## 1.1.10
### Patch Changes
- Updated dependencies [6830118]
- react-json-tree@0.20.0
## 1.1.9
### Patch Changes

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "react-json-tree-example",
"version": "1.1.10",
"version": "1.1.9",
"description": "React-Json-Tree example",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/react-json-tree/examples",
"bugs": {
@ -19,28 +19,28 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"immutable": "^5.1.4",
"react": "^19.2.3",
"react-base16-styling": "workspace:^",
"react-dom": "^19.2.3",
"react-json-tree": "workspace:^"
"immutable": "^4.3.7",
"react": "^18.3.1",
"react-base16-styling": "^0.10.0",
"react-dom": "^18.3.1",
"react-json-tree": "^0.19.0"
},
"devDependencies": {
"@babel/core": "^7.28.6",
"@babel/preset-env": "^7.28.6",
"@babel/preset-react": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@types/node": "^24.10.9",
"@types/react": "^19.2.8",
"@types/react-dom": "^19.2.3",
"babel-loader": "^10.0.0",
"cross-env": "^10.1.0",
"fork-ts-checker-webpack-plugin": "^9.1.0",
"html-webpack-plugin": "^5.6.5",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@types/node": "^20.14.14",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"babel-loader": "^9.1.3",
"cross-env": "^7.0.3",
"fork-ts-checker-webpack-plugin": "^9.0.2",
"html-webpack-plugin": "^5.6.0",
"ts-node": "^10.9.2",
"typescript": "~5.9.3",
"webpack": "^5.104.1",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.3"
"typescript": "~5.5.4",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "react-json-tree",
"version": "0.20.0",
"version": "0.19.0",
"description": "React JSON Viewer Component, Extracted from redux-devtools",
"keywords": [
"react",
@ -40,20 +40,22 @@
"prepublish": "pnpm run lint && pnpm run test"
},
"dependencies": {
"@types/lodash": "^4.17.23",
"react-base16-styling": "workspace:^"
"@types/lodash": "^4.17.7",
"react-base16-styling": "^0.10.0"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/react": "^19.2.8",
"jest": "^30.2.0",
"react": "^19.2.3",
"rimraf": "^6.1.2",
"ts-jest": "^29.4.6",
"typescript": "~5.9.3"
"@types/jest": "^29.5.12",
"@types/react": "^18.3.3",
"@types/react-test-renderer": "^18.3.0",
"jest": "^29.7.0",
"react": "^18.3.1",
"react-test-renderer": "^18.3.1",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.4",
"typescript": "~5.5.4"
},
"peerDependencies": {
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
}

View File

@ -0,0 +1,22 @@
import React from 'react';
import TestRenderer from 'react-test-renderer/shallow';
import { JSONTree } from '../src/index.js';
import JSONNode from '../src/JSONNode.js';
const BASIC_DATA = { a: 1, b: 'c' };
function render(component: React.ReactElement) {
const renderer = TestRenderer.createRenderer();
renderer.render(component);
return renderer.getRenderOutput();
}
describe('JSONTree', () => {
it('should render basic tree', () => {
const result = render(<JSONTree data={BASIC_DATA} />);
expect(result.type).toBe('ul');
expect(result.props.children.type.name).toBe(JSONNode.name);
});
});

View File

@ -1,61 +1,5 @@
# @redux-devtools/app-core
## 2.0.0
### Major Changes
- 6163276: Replace styled-components with Emotion
### Patch Changes
- Updated dependencies [6163276]
- Updated dependencies [20883e5]
- @redux-devtools/inspector-monitor-test-tab@5.0.0
- @redux-devtools/rtk-query-monitor@6.0.0
- @redux-devtools/slider-monitor@6.0.0
- @redux-devtools/ui@2.0.0
- @redux-devtools/inspector-monitor@6.1.2
## 1.1.2
### Patch Changes
- Updated dependencies [17b55ef]
- @redux-devtools/rtk-query-monitor@5.2.0
## 1.1.1
### Patch Changes
- Updated dependencies [91f21b2]
- @redux-devtools/core@4.1.1
- @redux-devtools/chart-monitor@5.1.1
- @redux-devtools/inspector-monitor@6.1.1
- @redux-devtools/inspector-monitor-test-tab@4.1.1
- @redux-devtools/inspector-monitor-trace-tab@4.1.1
- @redux-devtools/log-monitor@5.1.1
- @redux-devtools/rtk-query-monitor@5.1.1
- @redux-devtools/slider-monitor@5.1.1
## 1.1.0
### Minor Changes
- 6830118: Add React 19 to peer deps
### Patch Changes
- Updated dependencies [6830118]
- @redux-devtools/chart-monitor@6.0.0
- @redux-devtools/inspector-monitor-test-tab@5.0.0
- @redux-devtools/inspector-monitor-trace-tab@5.0.0
- @redux-devtools/inspector-monitor@7.0.0
- @redux-devtools/log-monitor@6.0.0
- @redux-devtools/rtk-query-monitor@6.0.0
- @redux-devtools/slider-monitor@6.0.0
- @redux-devtools/ui@1.4.0
- @redux-devtools/core@4.1.0
## 1.0.0
### Major Changes

View File

@ -10,6 +10,6 @@ module.exports = {
'^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.test.json' }],
},
transformIgnorePatterns: [
'node_modules/(?!.pnpm|@babel/code-frame|@babel/highlight|@babel/helper-validator-identifier|@x0k/json-schema-merge|chalk|color|d3|dateformat|delaunator|internmap|jsondiffpatch|js-tokens|lodash-es|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,6 +1,6 @@
{
"name": "@redux-devtools/app-core",
"version": "2.0.0",
"version": "1.0.0",
"description": "Redux DevTools app core",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-app-core",
"bugs": {
@ -35,67 +35,69 @@
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/runtime": "^7.28.6",
"@redux-devtools/chart-monitor": "workspace:^",
"@redux-devtools/core": "workspace:^",
"@redux-devtools/inspector-monitor": "workspace:^",
"@redux-devtools/inspector-monitor-test-tab": "workspace:^",
"@redux-devtools/inspector-monitor-trace-tab": "workspace:^",
"@redux-devtools/log-monitor": "workspace:^",
"@redux-devtools/rtk-query-monitor": "workspace:^",
"@redux-devtools/slider-monitor": "workspace:^",
"@redux-devtools/ui": "workspace:^",
"d3-state-visualizer": "workspace:^",
"@babel/runtime": "^7.25.0",
"@redux-devtools/chart-monitor": "^5.0.1",
"@redux-devtools/core": "^4.0.0",
"@redux-devtools/inspector-monitor": "^6.0.0",
"@redux-devtools/inspector-monitor-test-tab": "^4.0.0",
"@redux-devtools/inspector-monitor-trace-tab": "^4.0.0",
"@redux-devtools/log-monitor": "^5.0.0",
"@redux-devtools/rtk-query-monitor": "^5.0.0",
"@redux-devtools/slider-monitor": "^5.0.0",
"@redux-devtools/ui": "^1.3.1",
"d3-state-visualizer": "^3.0.0",
"javascript-stringify": "^2.1.0",
"jsan": "^3.1.14",
"jsondiffpatch": "^0.7.3",
"react-icons": "^5.5.0",
"react-is": "^19.2.3"
"jsondiffpatch": "^0.6.0",
"react-icons": "^5.2.1",
"react-is": "^18.3.1"
},
"devDependencies": {
"@babel/cli": "^7.28.6",
"@babel/core": "^7.28.6",
"@babel/eslint-parser": "^7.28.6",
"@babel/plugin-transform-runtime": "^7.28.5",
"@babel/preset-env": "^7.28.6",
"@babel/preset-react": "^7.28.5",
"@babel/preset-typescript": "^7.28.5",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@reduxjs/toolkit": "^2.11.2",
"@rjsf/core": "^6.2.4",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@types/jest": "^30.0.0",
"@babel/cli": "^7.24.8",
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/plugin-transform-runtime": "^7.24.7",
"@babel/preset-env": "^7.25.3",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@emotion/react": "^11.13.0",
"@reduxjs/toolkit": "^2.2.7",
"@rjsf/core": "^4.2.3",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@types/jest": "^29.5.12",
"@types/jsan": "^3.1.5",
"@types/json-schema": "^7.0.15",
"@types/node": "^24.10.9",
"@types/react": "^19.2.8",
"@types/react-dom": "^19.2.3",
"cross-env": "^10.1.0",
"esbuild": "^0.27.2",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"react-redux": "^9.2.0",
"@types/node": "^20.14.14",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/styled-components": "^5.1.34",
"cross-env": "^7.0.3",
"esbuild": "^0.23.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-redux": "^9.1.2",
"redux": "^5.0.1",
"redux-persist": "^6.0.0",
"rimraf": "^6.1.2",
"ts-jest": "^29.4.6",
"rimraf": "^6.0.1",
"styled-components": "^5.3.11",
"ts-jest": "^29.2.4",
"ts-node": "^10.9.2",
"typescript": "~5.9.3"
"typescript": "~5.5.4"
},
"peerDependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@emotion/react": "^11.13.0",
"@reduxjs/toolkit": "^1.0.0 || ^2.0.0",
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react": "^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"@types/styled-components": "^5.1.34",
"react": "^16.8.4 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.4 || ^17.0.0 || ^18.0.0",
"react-redux": "^8.0.0 || ^9.0.0",
"redux": "^4.0.0 || ^5.0.0",
"redux-persist": "^6.0.0"
"redux-persist": "^6.0.0",
"styled-components": "^5.3.11"
}
}

View File

@ -55,7 +55,7 @@ interface ChangeThemeFormData {
readonly colorPreference: 'auto' | 'light' | 'dark';
}
interface ChangeThemeData {
readonly formData?: ChangeThemeFormData;
readonly formData: ChangeThemeFormData;
}
export interface ChangeThemeAction {
readonly type: typeof CHANGE_THEME;
@ -64,7 +64,7 @@ export interface ChangeThemeAction {
readonly colorPreference: 'auto' | 'light' | 'dark';
}
export function changeTheme(data: ChangeThemeData): ChangeThemeAction {
return { type: CHANGE_THEME, ...data.formData! };
return { type: CHANGE_THEME, ...data.formData };
}
interface ChangeStateTreeSettingsFormData {
@ -73,7 +73,7 @@ interface ChangeStateTreeSettingsFormData {
}
interface ChangeStateTreeSettingsData {
readonly formData?: ChangeStateTreeSettingsFormData;
readonly formData: ChangeStateTreeSettingsFormData;
}
export interface ChangeStateTreeSettingsAction {
@ -85,7 +85,7 @@ export interface ChangeStateTreeSettingsAction {
export function changeStateTreeSettings(
data: ChangeStateTreeSettingsData,
): ChangeStateTreeSettingsAction {
return { type: CHANGE_STATE_TREE_SETTINGS, ...data.formData! };
return { type: CHANGE_STATE_TREE_SETTINGS, ...data.formData };
}
export interface InitMonitorAction {

View File

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { withTheme } from '@emotion/react';
import { withTheme } from 'styled-components';
import { LiftedAction, LiftedState } from '@redux-devtools/core';
import { Action } from 'redux';
import getMonitor from '../utils/getMonitor';

View File

@ -1,14 +1,8 @@
// Based on https://github.com/YoruNoHikage/redux-devtools-dispatch
import React, { Component } from 'react';
import styled from '@emotion/styled';
import {
Button,
Select,
Editor,
Toolbar,
Base16Theme,
} from '@redux-devtools/ui';
import styled from 'styled-components';
import { Button, Select, Editor, Toolbar } from '@redux-devtools/ui';
import { connect, ResolveThunks } from 'react-redux';
import { dispatchRemotely } from '../../actions';
import { Options } from '../../reducers/instances';
@ -18,7 +12,7 @@ export const DispatcherContainer = styled.div`
flex-direction: column;
flex-shrink: 0;
padding-top: 2px;
background: ${(props: { theme?: Base16Theme }) => props.theme!.base01};
background: ${(props) => props.theme.base01};
`;
export const CodeContainer = styled.div`
@ -30,7 +24,7 @@ export const CodeContainer = styled.div`
export const ActionContainer = styled.div`
display: table;
width: 100%;
color: ${(props: { theme?: Base16Theme }) => props.theme!.base06};
color: ${(props) => props.theme.base06};
> div {
display: table-row;

View File

@ -1,6 +1,6 @@
import React, { Component, RefCallback } from 'react';
import { connect, ResolveThunks } from 'react-redux';
import { withTheme } from '@emotion/react';
import { withTheme } from 'styled-components';
import { tree } from 'd3-state-visualizer';
import type { HierarchyPointNode, Node, Options } from 'd3-state-visualizer';
import { getPath } from '../ChartMonitorWrapper';

View File

@ -1,8 +1,8 @@
import React, { Component } from 'react';
import type { Delta } from 'jsondiffpatch';
import * as htmlFormatter from 'jsondiffpatch/formatters/html';
import styled from '@emotion/styled';
import { Base16Theme, effects } from '@redux-devtools/ui';
import styled, { ThemedStyledProps } from 'styled-components';
import { effects, Theme } from '@redux-devtools/ui';
export const StyledContainer = styled.div`
.jsondiffpatch-delta {
@ -19,7 +19,8 @@ export const StyledContainer = styled.div`
padding: 2px 3px;
border-radius: 3px;
position: relative;
color: ${(props: { theme?: Base16Theme }) => props.theme!.base07};
${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''}
color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base07};
display: inline-block;
}
@ -43,22 +44,25 @@ export const StyledContainer = styled.div`
.jsondiffpatch-modified .jsondiffpatch-right-value:before {
vertical-align: top;
padding: 2px;
color: ${(props) => props.theme.base0E};
${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''}
color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base0E};
content: ' => ';
}
.jsondiffpatch-added .jsondiffpatch-value pre,
.jsondiffpatch-modified .jsondiffpatch-right-value pre,
.jsondiffpatch-textdiff-added {
background: ${(props: { theme?: Base16Theme }) =>
effects.color(props.theme!.base0B, 'alpha', 0.2)};
${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''}
background: ${(props: ThemedStyledProps<{}, Theme>) =>
effects.color(props.theme.base0B, 'alpha', 0.2)};
}
.jsondiffpatch-deleted pre,
.jsondiffpatch-modified .jsondiffpatch-left-value pre,
.jsondiffpatch-textdiff-deleted {
background: ${(props: { theme?: Base16Theme }) =>
effects.color(props.theme!.base08, 'alpha', 0.2)};
${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''}
background: ${(props: ThemedStyledProps<{}, Theme>) =>
effects.color(props.theme.base08, 'alpha', 0.2)};
text-decoration: line-through;
}
@ -125,12 +129,14 @@ export const StyledContainer = styled.div`
padding: 2px 0;
padding-right: 5px;
vertical-align: top;
color: ${(props) => props.theme.base0D};
${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''}
color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base0D};
}
.jsondiffpatch-property-name:after {
content: ': ';
color: ${(props) => props.theme.base07};
${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''}
color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base07};
}
.jsondiffpatch-child-node-type-array > .jsondiffpatch-property-name:after {
@ -166,7 +172,8 @@ export const StyledContainer = styled.div`
}
.jsondiffpatch-value pre:after {
color: ${(props) => props.theme.base07};
${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''}
color: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base07};
content: ',';
}
@ -189,7 +196,8 @@ export const StyledContainer = styled.div`
.jsondiffpatch-moved .jsondiffpatch-moved-destination {
display: inline-block;
background: ${(props) => props.theme.base0A};
${/* eslint-disable-next-line @typescript-eslint/no-empty-object-type */ ''}
background: ${(props: ThemedStyledProps<{}, Theme>) => props.theme.base0A};
}
.jsondiffpatch-moved .jsondiffpatch-moved-destination:before {

View File

@ -1,14 +1,13 @@
import React, { Component } from 'react';
import styled from '@emotion/styled';
import { withTheme } from '@emotion/react';
import styled, { withTheme } from 'styled-components';
import { SliderMonitor } from '@redux-devtools/slider-monitor';
import { LiftedAction } from '@redux-devtools/core';
import { Action } from 'redux';
import { Base16Theme, ThemeFromProvider } from '@redux-devtools/ui';
import { ThemeFromProvider } from '@redux-devtools/ui';
import { State } from '../../reducers/instances';
const SliderWrapper = styled.div`
border-color: ${(props: { theme?: Base16Theme }) => props.theme!.base02};
border-color: ${(props) => props.theme.base02};
border-style: solid;
border-width: 1px 0;
`;

View File

@ -1,41 +1,5 @@
# Change Log
## 7.0.0
### Major Changes
- 6163276: Replace styled-components with Emotion
### Patch Changes
- Updated dependencies [6163276]
- @redux-devtools/app-core@2.0.0
- @redux-devtools/ui@2.0.0
## 6.2.2
### Patch Changes
- @redux-devtools/app-core@1.1.2
## 6.2.1
### Patch Changes
- @redux-devtools/app-core@1.1.1
## 6.2.0
### Minor Changes
- 6830118: Add React 19 to peer deps
### Patch Changes
- Updated dependencies [6830118]
- @redux-devtools/app-core@1.1.0
- @redux-devtools/ui@1.4.0
## 6.1.0
### Minor Changes

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