Merge branch 'main' into feat-#1126

This commit is contained in:
Nathan Bierema 2022-07-05 09:00:56 -04:00
commit 2881fe06a3
148 changed files with 24326 additions and 31643 deletions

View File

@ -0,0 +1,5 @@
---
'@redux-devtools/extension': patch
---
Fix type for serialize option

View File

@ -7,6 +7,5 @@ build
coverage
node_modules
__snapshots__
.yarn/*
storybook-static
.vscode/*

View File

@ -12,15 +12,23 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v2
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
- run: yarn install
- run: yarn format:check
- run: yarn build:all
- run: yarn lint:all
- name: Run yarn test:all
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Check formatting
run: pnpm run format:check
- name: Build
run: pnpm exec nx affected --target=build --parallel=3
- name: Lint
run: pnpm exec nx affected --target=lint --parallel=3
- name: Test
uses: GabrielBB/xvfb-action@v1
with:
run: yarn test:all
run: pnpm exec nx affected --target=test --parallel=3

View File

@ -16,21 +16,23 @@ jobs:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'
cache: 'pnpm'
- name: Install Dependencies
run: yarn install
run: pnpm install
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: yarn changeset version
publish: yarn release
version: pnpm changeset version
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

7
.gitignore vendored
View File

@ -9,10 +9,3 @@ coverage
.idea
.eslintcache
!packages/redux-devtools-slider-monitor/examples/todomvc/dist/index.html
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

View File

@ -8,8 +8,7 @@ coverage
node_modules
__snapshots__
dev
.yarn/*
.pnp.*
**/demo/public/**
storybook-static
.vscode/*
pnpm-lock.yaml

10
.vscode/settings.json vendored
View File

@ -1,10 +0,0 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}

File diff suppressed because one or more lines are too long

View File

@ -1,20 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/bin/eslint.js
require(absPnpApiPath).setup();
}
}
// Defer to the real eslint/bin/eslint.js your application uses
module.exports = absRequire(`eslint/bin/eslint.js`);

View File

@ -1,6 +0,0 @@
{
"name": "eslint",
"version": "8.6.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
}

View File

@ -1,5 +0,0 @@
# This file is automatically generated by @yarnpkg/sdks.
# Manual changes might be lost!
integrations:
- vscode

View File

@ -1,20 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier/index.js
require(absPnpApiPath).setup();
}
}
// Defer to the real prettier/index.js your application uses
module.exports = absRequire(`prettier/index.js`);

View File

@ -1,6 +0,0 @@
{
"name": "prettier",
"version": "2.5.1-sdk",
"main": "./index.js",
"type": "commonjs"
}

View File

@ -1,20 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsc
require(absPnpApiPath).setup();
}
}
// Defer to the real typescript/bin/tsc your application uses
module.exports = absRequire(`typescript/bin/tsc`);

View File

@ -1,20 +0,0 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsserver
require(absPnpApiPath).setup();
}
}
// Defer to the real typescript/bin/tsserver your application uses
module.exports = absRequire(`typescript/bin/tsserver`);

View File

@ -1,6 +0,0 @@
{
"name": "typescript",
"version": "4.5.4-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
}

View File

@ -1,16 +0,0 @@
yarnPath: .yarn/releases/yarn-3.1.1.cjs
packageExtensions:
'@storybook/react@*':
dependencies:
'@types/node': '*'
'@storybook/theming@*':
dependencies:
'@emotion/serialize': '^0.11.16'
'@emotion/utils': '^0.11.3'
'apollo-server-core@^3.4.0':
dependencies:
'@types/node': '*'
'tarn@^3.0.1':
dependencies:
'@types/node': '*'

View File

@ -22,6 +22,10 @@ It can be used as a browser extension (for [Chrome](https://chrome.google.com/we
- [Recipes](https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/Recipes.md)
- [FAQ](https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/FAQ.md)
## Development
This is a monorepo powered by [pnpm](https://pnpm.io/) and [Nx](https://nx.dev/). [Install pnpm](https://pnpm.io/installation) and run `pnpm install` to get started. Each package's dependencies need to be built before the package itself can be built. You can either build all the packages (i.e., `pnpm run build:all`) or use Nx commands to build only the packages necessary for the packages you're working on (i.e., `pnpm nx build remotedev-redux-devtools-extension`).
## Backers
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/redux-devtools-extension#backer)]

View File

@ -7,10 +7,3 @@ build/
dev/
tmp/
_book
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

View File

@ -1,5 +1,27 @@
# remotedev-redux-devtools-extension
## 3.0.13
### Patch Changes
- Updated dependencies [8a7eae4]
- react-json-tree@0.17.0
- @redux-devtools/app@2.2.0
- @redux-devtools/slider-monitor@4.0.0
- @redux-devtools/ui@1.3.0
- @redux-devtools/core@3.13.0
- @redux-devtools/utils@2.0.0
## 3.0.12
### Patch Changes
- Updated dependencies [4891bf6]
- @redux-devtools/core@3.12.0
- @redux-devtools/slider-monitor@3.1.2
- @redux-devtools/utils@1.2.1
- @redux-devtools/app@2.1.4
## 3.0.11
### Patch Changes

View File

@ -1,18 +0,0 @@
environment:
matrix:
- nodejs_version: '6'
cache:
- '%LOCALAPPDATA%/Yarn'
- node_modules
install:
- ps: Install-Product node $env:nodejs_version
- yarn install
test_script:
- node --version
- yarn --version
- yarn test
build: off

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "remotedev-redux-devtools-extension",
"version": "3.0.11",
"version": "3.0.13",
"description": "Redux Developer Tools for debugging application state changes.",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/extension",
"license": "MIT",
@ -12,75 +12,74 @@
},
"scripts": {
"start": "webpack --config webpack/dev.config.babel.js",
"build": "yarn run build:extension && yarn run build:firefox",
"build": "pnpm run build:extension && pnpm run build:firefox",
"build:extension": "rimraf build/extension && webpack --config webpack/wrap.config.babel.js && webpack --config webpack/prod.config.babel.js",
"build:firefox": "webpack --config webpack/prod.firefox.config.babel.js",
"build:examples": "babel-node examples/buildAll.js",
"precompress:extension": "yarn run lint && yarn run test:app && yarn run build:extension && yarn run test:chrome && yarn run test:electron",
"precompress:firefox": "yarn run lint && yarn run build:firefox && yarn run test:app",
"precompress:extension": "pnpm run lint && pnpm run test:app && pnpm run build:extension && pnpm run test:chrome && pnpm run test:electron",
"precompress:firefox": "pnpm run lint && pnpm run build:firefox && pnpm run test:app",
"compress:extension": "bestzip build/extension.zip build/extension",
"compress:firefox": "bestzip build/extension.zip build/extension",
"clean": "rimraf build && rimraf dev",
"test:app": "cross-env BABEL_ENV=test jest test/app",
"test:chrome": "jest test/chrome",
"test:electron": "yarn run build:test:electron:fixture && jest test/electron",
"test": "yarn run test:app && yarn run build:extension && yarn run test:chrome && yarn run test:electron",
"test:electron": "pnpm run build:test:electron:fixture && jest test/electron",
"test": "pnpm run test:app && pnpm run build:extension && pnpm run test:chrome && pnpm run test:electron",
"build:test:electron:fixture": "webpack --config test/electron/fixture/webpack.config.js",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@babel/polyfill": "^7.12.1",
"@redux-devtools/app": "^2.1.3",
"@redux-devtools/core": "^3.11.0",
"@redux-devtools/app": "^2.2.0",
"@redux-devtools/core": "^3.13.0",
"@redux-devtools/instrument": "^2.1.0",
"@redux-devtools/serialize": "^0.4.1",
"@redux-devtools/slider-monitor": "^3.1.1",
"@redux-devtools/ui": "^1.2.1",
"@redux-devtools/utils": "^1.2.0",
"@redux-devtools/slider-monitor": "^4.0.0",
"@redux-devtools/ui": "^1.3.0",
"@redux-devtools/utils": "^2.0.0",
"@types/jsan": "^3.1.2",
"jsan": "^3.1.14",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-is": "^17.0.2",
"react-json-tree": "^0.16.2",
"react-redux": "^7.2.8",
"redux": "^4.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.4.0",
"react-is": "^18.2.0",
"react-json-tree": "^0.17.0",
"react-redux": "^8.0.2",
"redux": "^4.2.0",
"redux-persist": "^6.0.0",
"styled-components": "^5.3.5"
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@babel/core": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@babel/register": "^7.17.7",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/react": "^12.1.4",
"@types/chrome": "^0.0.180",
"@types/lodash": "^4.14.181",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@types/react-redux": "^7.1.23",
"@types/styled-components": "^5.1.24",
"babel-loader": "^8.2.4",
"bestzip": "^2.2.0",
"chromedriver": "^100.0.0",
"copy-webpack-plugin": "^9.1.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@types/chrome": "^0.0.191",
"@types/lodash": "^4.14.182",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/styled-components": "^5.1.25",
"babel-loader": "^8.2.5",
"bestzip": "^2.2.1",
"chromedriver": "^102.0.0",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"electron": "^18.0.1",
"eslint": "^8.12.0",
"electron": "^19.0.6",
"eslint": "^8.18.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.0",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^7.2.2",
"immutable": "^4.0.0",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"immutable": "^4.1.0",
"jest": "^27.5.1",
"path-browserify": "^1.0.1",
"pug-html-loader": "^1.1.5",
@ -88,12 +87,12 @@
"react-transform-catch-errors": "^1.0.2",
"react-transform-hmr": "^1.0.4",
"rimraf": "^3.0.2",
"selenium-webdriver": "^4.1.1",
"selenium-webdriver": "^4.3.0",
"sinon-chrome": "^3.0.1",
"style-loader": "^3.3.1",
"ts-jest": "^27.1.4",
"typescript": "~4.5.5",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2"
"ts-jest": "^27.1.5",
"typescript": "~4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0"
}
}

View File

@ -56,7 +56,7 @@ function stringify(obj: unknown, serialize?: Serialize | undefined) {
// 16 MB
/* eslint-disable no-console */
console.warn(
'Application state or actions payloads are too large making Redux DevTools serialization slow and consuming a lot of memory. See https://git.io/fpcP5 on how to configure it.'
'Application state or actions payloads are too large making Redux DevTools serialization slow and consuming a lot of memory. See https://github.com/reduxjs/redux-devtools-extension/blob/master/docs/Troubleshooting.md#excessive-use-of-memory-and-cpu on how to configure it.'
);
/* eslint-enable no-console */
stringifyWarned = true;

View File

@ -1,5 +1,5 @@
import React, { CSSProperties } from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { createRoot, Root } from 'react-dom/client';
import { Provider } from 'react-redux';
import { Persistor } from 'redux-persist';
import { REMOVE_INSTANCE, StoreAction } from '@redux-devtools/app';
@ -27,23 +27,21 @@ let naTimeout: NodeJS.Timeout;
const isChrome = navigator.userAgent.indexOf('Firefox') === -1;
function renderDevTools() {
const node = document.getElementById('root');
unmountComponentAtNode(node!);
function renderDevTools(root: Root) {
root.unmount();
clearTimeout(naTimeout);
({ store, persistor } = configureStore(position, bgConnection));
render(
root.render(
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<App position={position} />
</PersistGate>
</Provider>,
node
</Provider>
);
rendered = true;
}
function renderNA() {
function renderNA(root: Root) {
if (rendered === false) return;
rendered = false;
naTimeout = setTimeout(() => {
@ -76,32 +74,31 @@ function renderNA() {
);
}
const node = document.getElementById('root');
unmountComponentAtNode(node!);
render(message, node);
root.unmount();
root.render(message);
store = undefined;
});
} else {
const node = document.getElementById('root');
unmountComponentAtNode(node!);
render(message, node);
root.unmount();
root.render(message);
store = undefined;
}
}, 3500);
}
function init(id: number) {
renderNA();
const root = createRoot(document.getElementById('root')!);
renderNA(root);
bgConnection = chrome.runtime.connect({
name: id ? id.toString() : undefined,
});
bgConnection.onMessage.addListener(
<S, A extends Action<unknown>>(message: PanelMessage<S, A>) => {
if (message.type === 'NA') {
if (message.id === id) renderNA();
if (message.id === id) renderNA(root);
else store!.dispatch({ type: REMOVE_INSTANCE, id: message.id });
} else {
if (!rendered) renderDevTools();
if (!rendered) renderDevTools(root);
store!.dispatch(message);
}
}

View File

@ -1,5 +1,5 @@
import React from 'react';
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import OptionsComponent from './Options';
import { Options } from './syncOptions';
@ -13,10 +13,8 @@ chrome.runtime.getBackgroundPage((background) => {
};
const renderOptions = (options: Options) => {
render(
<OptionsComponent options={options} saveOption={saveOption} />,
document.getElementById('root')
);
const root = createRoot(document.getElementById('root')!);
root.render(<OptionsComponent options={options} saveOption={saveOption} />);
};
syncOptions.subscribe(renderOptions);

View File

@ -1,5 +1,5 @@
import React from 'react';
import { render } from 'react-dom';
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';
@ -25,13 +25,13 @@ chrome.runtime.getBackgroundPage((window) => {
bg.onMessage.addListener(update);
update();
render(
const root = createRoot(document.getElementById('root')!);
root.render(
<Provider store={localStore}>
<PersistGate loading={null} persistor={persistor}>
<App position={position} />
</PersistGate>
</Provider>,
document.getElementById('root')
</Provider>
);
});

View File

@ -1,5 +1,5 @@
import React from 'react';
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import { Root } from '@redux-devtools/app';
import '../../views/remote.pug';
@ -15,7 +15,8 @@ chrome.storage.local.get(
},
(options) => {
const AppAsAny = Root as any;
render(
const root = createRoot(document.getElementById('root')!);
root.render(
<AppAsAny
selectMonitor={options['select-monitor']}
testTemplates={options['test-templates']}
@ -30,8 +31,7 @@ chrome.storage.local.get(
}
: undefined
}
/>,
document.getElementById('root')
/>
);
}
);

View File

@ -1,12 +0,0 @@
{
"lerna": "3.4.2",
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"publish": {
"allowBranch": "main"
}
},
"ignoreChanges": ["**/test/**", "**/examples/**", "**/*.md"]
}

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,28 +1,29 @@
{
"private": true,
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@changesets/cli": "^2.22.0",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@changesets/cli": "^2.23.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^27.5.1",
"lerna": "^4.0.0",
"prettier": "2.6.2",
"typescript": "~4.5.5"
"prettier": "2.7.1",
"typescript": "~4.7.4",
"nx": "^14.3.6",
"@nrwl/nx-cloud": "^14.1.2"
},
"scripts": {
"format": "prettier --write .",
"build:all": "lerna run build",
"lint:all": "lerna run lint",
"test:all": "lerna run test",
"format:check": "prettier --check .",
"release": "yarn build:all && changeset publish"
"build:all": "nx run-many --target=build --all",
"lint:all": "nx run-many --target=lint --all",
"test:all": "nx run-many --target=test --all",
"release": "pnpm build:all && changeset publish"
},
"workspaces": [
"extension",
@ -37,8 +38,16 @@
"packages/redux-devtools-rtk-query-monitor/demo",
"packages/redux-devtools-slider-monitor/examples/todomvc"
],
"resolutions": {
"@babel/highlight/chalk": "Methuselah96/chalk#head=v2-without-process"
},
"packageManager": "yarn@3.2.0"
"packageManager": "pnpm@7.3.0",
"pnpm": {
"overrides": {
"@babel/highlight>chalk": "Methuselah96/chalk#v2-without-process"
},
"peerDependencyRules": {
"allowedVersions": {
"react": "18",
"react-dom": "18"
}
}
}
}

View File

@ -29,22 +29,22 @@
"map2tree": "^2.1.0"
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@types/node": "^16.11.26",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"babel-loader": "^8.2.4",
"@babel/core": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@types/node": "^16.11.41",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"babel-loader": "^8.2.5",
"cross-env": "^7.0.3",
"eslint": "^8.12.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"fork-ts-checker-webpack-plugin": "^7.2.2",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"html-webpack-plugin": "^5.5.0",
"ts-node": "^10.7.0",
"typescript": "~4.5.5",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
"ts-node": "^10.8.1",
"typescript": "~4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2"
}
}

View File

@ -30,7 +30,7 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types && yarn build:umd",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && pnpm run build:umd",
"build:cjs": "babel src --extensions \".ts\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -38,11 +38,11 @@
"clean": "rimraf lib",
"lint": "eslint . --ext .ts",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@babel/runtime": "^7.18.3",
"@types/d3": "^3.5.47",
"d3": "^3.5.17",
"d3tooltip": "^2.1.0",
@ -51,25 +51,26 @@
"ramda": "^0.28.0"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/ramda": "^0.28.7",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/node": "^16.11.41",
"@types/ramda": "^0.28.14",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"rimraf": "^3.0.2",
"rollup": "^2.70.1",
"rollup": "^2.75.7",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"tslib": "^2.3.1",
"typescript": "~4.5.5"
"rollup-plugin-typescript2": "^0.32.1",
"tslib": "^2.4.0",
"typescript": "~4.7.4"
}
}

View File

@ -26,7 +26,7 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types && yarn build:umd",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && pnpm run build:umd",
"build:cjs": "babel src --extensions \".ts\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -34,36 +34,37 @@
"clean": "rimraf lib",
"lint": "eslint . --ext .ts",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@babel/runtime": "^7.18.3",
"ramda": "^0.28.0"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/d3": "^3.5.47",
"@types/ramda": "^0.28.7",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"@types/node": "^16.11.41",
"@types/ramda": "^0.28.14",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"d3": "^3.5.17",
"eslint": "^8.12.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"rimraf": "^3.0.2",
"rollup": "^2.70.1",
"rollup": "^2.75.7",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"tslib": "^2.3.1",
"typescript": "~4.5.5"
"rollup-plugin-typescript2": "^0.32.1",
"tslib": "^2.4.0",
"typescript": "~4.7.4"
},
"peerDependencies": {
"@types/d3": "^3.5.47",

View File

@ -29,7 +29,7 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types && yarn build:umd",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && pnpm run build:umd",
"build:cjs": "babel src --extensions \".ts\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -38,38 +38,39 @@
"test": "jest",
"lint": "eslint . --ext .ts",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@babel/runtime": "^7.18.3",
"lodash": "^4.17.21"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.181",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.182",
"@types/node": "^16.11.41",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"immutable": "^4.0.0",
"eslint-plugin-jest": "^26.5.3",
"immutable": "^4.1.0",
"jest": "^27.5.1",
"rimraf": "^3.0.2",
"rollup": "^2.70.1",
"rollup": "^2.75.7",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"ts-jest": "^27.1.4",
"tslib": "^2.3.1",
"typescript": "~4.5.5"
"rollup-plugin-typescript2": "^0.32.1",
"ts-jest": "^27.1.5",
"tslib": "^2.4.0",
"typescript": "~4.7.4"
}
}

View File

@ -27,7 +27,7 @@
"url": "git+https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -35,36 +35,36 @@
"test": "jest",
"lint": "eslint . --ext .ts",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@babel/runtime": "^7.18.3",
"@types/base16": "^1.0.2",
"@types/lodash": "^4.14.181",
"@types/lodash": "^4.14.182",
"base16": "^1.0.0",
"color": "^4.2.3",
"csstype": "^3.0.11",
"csstype": "^3.1.0",
"lodash.curry": "^4.1.1"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@types/color": "^3.0.3",
"@types/jest": "^27.4.1",
"@types/lodash.curry": "^4.1.6",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@types/jest": "^27.5.2",
"@types/lodash.curry": "^4.1.7",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-jest": "^26.5.3",
"jest": "^27.5.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.4",
"typescript": "~4.5.5"
"ts-jest": "^27.1.5",
"typescript": "~4.7.4"
}
}

View File

@ -3,6 +3,7 @@ import { Base16Theme } from 'base16';
import Color from 'color';
import * as CSS from 'csstype';
import curry from 'lodash.curry';
import type { CurriedFunction3 } from 'lodash';
import { Color as ColorTuple, yuv2rgb, rgb2yuv } from './colorConverters';
import {
Styling,
@ -201,7 +202,12 @@ interface Options {
base16Themes?: { [themeName: string]: Base16Theme };
}
export const createStyling = curry<
export const createStyling: CurriedFunction3<
(base16Theme: Base16Theme) => StylingConfig,
Options | undefined,
Theme | undefined,
StylingFunction
> = curry<
(base16Theme: Base16Theme) => StylingConfig,
Options | undefined,
Theme | undefined,

View File

@ -1,5 +1,11 @@
# Change Log
## 0.6.0
### Minor Changes
- 8a7eae4: Add React 18 to peerDependencies range
## 0.5.0
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):

View File

@ -0,0 +1,8 @@
# react-dock-demo
## 0.1.5
### Patch Changes
- Updated dependencies [8a7eae4]
- react-dock@0.6.0

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "react-dock-demo",
"version": "0.1.4",
"version": "0.1.5",
"license": "MIT",
"scripts": {
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --open",
@ -10,37 +10,37 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"react": "^17.0.2",
"react-bootstrap": "^2.2.2",
"react-dock": "^0.5.1",
"react-dom": "^17.0.2",
"react-icons": "^4.3.1",
"react-is": "^17.0.2",
"react": "^18.2.0",
"react-bootstrap": "^2.4.0",
"react-dock": "^0.6.0",
"react-dom": "^18.2.0",
"react-icons": "^4.4.0",
"react-is": "^18.2.0",
"styled-components": "^5.3.5"
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@types/node": "^16.11.26",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@types/styled-components": "^5.1.24",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"babel-loader": "^8.2.4",
"@babel/core": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@types/node": "^16.11.41",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/styled-components": "^5.1.25",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"babel-loader": "^8.2.5",
"cross-env": "^7.0.3",
"eslint": "^8.12.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"fork-ts-checker-webpack-plugin": "^7.2.2",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"html-webpack-plugin": "^5.5.0",
"ts-node": "^10.7.0",
"typescript": "~4.5.5",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
"ts-node": "^10.8.1",
"typescript": "~4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2"
}
}

View File

@ -1,5 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));
const root = ReactDOM.createRoot(document.getElementById('root')!);
root.render(<App />);

View File

@ -1,6 +1,6 @@
{
"name": "react-dock",
"version": "0.5.1",
"version": "0.6.0",
"description": "Resizable dockable react component",
"keywords": [
"react",
@ -27,7 +27,7 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -35,44 +35,44 @@
"test": "jest",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@types/lodash": "^4.14.181",
"@types/prop-types": "^15.7.4",
"@babel/runtime": "^7.18.3",
"@types/lodash": "^4.14.182",
"@types/prop-types": "^15.7.5",
"lodash.debounce": "^4.0.8",
"prop-types": "^15.8.1"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@types/jest": "^27.4.1",
"@types/lodash.debounce": "^4.0.6",
"@types/react": "^17.0.43",
"@types/react-test-renderer": "^17.0.1",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@types/jest": "^27.5.2",
"@types/lodash.debounce": "^4.0.7",
"@types/react": "^18.0.14",
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^27.5.1",
"react": "^17.0.2",
"react-test-renderer": "^17.0.2",
"react": "^18.2.0",
"react-test-renderer": "^18.2.0",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.4",
"typescript": "~4.5.5"
"ts-jest": "^27.1.5",
"typescript": "~4.7.4"
},
"peerDependencies": {
"@types/react": "^16.3.0 || ^17.0.0",
"react": "^16.3.0 || ^17.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

@ -1,6 +1,7 @@
import React, { Component, ReactNode } from 'react';
import PropTypes from 'prop-types';
import debounce from 'lodash.debounce';
import type { DebouncedFunc } from 'lodash';
import autoprefix from './autoprefix';
interface Styles {
@ -438,7 +439,10 @@ export default class Dock extends Component<Props, State> {
});
};
debouncedUpdateWindowSizeEnd = debounce(this.updateWindowSizeEnd, 30);
debouncedUpdateWindowSizeEnd: DebouncedFunc<() => void> = debounce(
this.updateWindowSizeEnd,
30
);
handleWrapperLeave = () => {
this.setState({ isResizing: false });

View File

@ -1,5 +1,11 @@
# Change Log
## 0.17.0
### Minor Changes
- 8a7eae4: Add React 18 to peerDependencies range
## 0.16.2
### Patch Changes

View File

@ -0,0 +1,8 @@
# react-json-tree-example
## 1.1.7
### Patch Changes
- Updated dependencies [8a7eae4]
- react-json-tree@0.17.0

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "react-json-tree-example",
"version": "1.1.6",
"version": "1.1.7",
"description": "React-Json-Tree example",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/react-json-tree/examples",
"bugs": {
@ -19,34 +19,34 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"immutable": "^4.0.0",
"react": "^17.0.2",
"immutable": "^4.1.0",
"react": "^18.2.0",
"react-base16-styling": "^0.9.1",
"react-dom": "^17.0.2",
"react-json-tree": "^0.16.1"
"react-dom": "^18.2.0",
"react-json-tree": "^0.17.0"
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@types/node": "^16.11.26",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"babel-loader": "^8.2.4",
"@babel/core": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@types/node": "^16.11.41",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"babel-loader": "^8.2.5",
"cross-env": "^7.0.3",
"eslint": "^8.12.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"fork-ts-checker-webpack-plugin": "^7.2.2",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"html-webpack-plugin": "^5.5.0",
"ts-node": "^10.7.0",
"typescript": "~4.5.5",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
"ts-node": "^10.8.1",
"typescript": "~4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2"
}
}

View File

@ -1,5 +1,6 @@
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import React from 'react';
import App from './App';
render(<App />, document.getElementById('root'));
const root = createRoot(document.getElementById('root')!);
root.render(<App />);

View File

@ -1,6 +1,6 @@
{
"name": "react-json-tree",
"version": "0.16.2",
"version": "0.17.0",
"description": "React JSON Viewer Component, Extracted from redux-devtools",
"keywords": [
"react",
@ -32,7 +32,7 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types && yarn build:umd",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && pnpm run build:umd",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -41,49 +41,51 @@
"test": "jest",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@types/prop-types": "^15.7.4",
"@babel/runtime": "^7.18.3",
"@types/lodash": "^4.14.182",
"@types/prop-types": "^15.7.5",
"prop-types": "^15.8.1",
"react-base16-styling": "^0.9.1"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.0.3",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/jest": "^27.4.1",
"@types/react": "^17.0.43",
"@types/react-test-renderer": "^17.0.1",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.11.41",
"@types/react": "^18.0.14",
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^27.5.1",
"react": "^17.0.2",
"react-test-renderer": "^17.0.2",
"react": "^18.2.0",
"react-test-renderer": "^18.2.0",
"rimraf": "^3.0.2",
"rollup": "^2.70.1",
"rollup": "^2.75.7",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"ts-jest": "^27.1.4",
"tslib": "^2.3.1",
"typescript": "~4.5.5"
"rollup-plugin-typescript2": "^0.32.1",
"ts-jest": "^27.1.5",
"tslib": "^2.4.0",
"typescript": "~4.7.4"
},
"peerDependencies": {
"@types/react": "^16.3.0 || ^17.0.0",
"react": "^16.3.0 || ^17.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

@ -1,9 +1,11 @@
import type { CurriedFunction1 } from 'lodash';
import {
Base16Theme,
createStyling,
StylingConfig,
} from 'react-base16-styling';
import solarized from './themes/solarized';
import { StylingFunction, Theme } from 'react-base16-styling/src';
const colorMap = (theme: Base16Theme) => ({
BACKGROUND_COLOR: theme.base00,
@ -196,6 +198,11 @@ const getDefaultThemeStyling = (theme: Base16Theme): StylingConfig => {
};
};
export default createStyling(getDefaultThemeStyling, {
const createStylingFromTheme: CurriedFunction1<
Theme | undefined,
StylingFunction
> = createStyling(getDefaultThemeStyling, {
defaultBase16: solarized,
});
export default createStylingFromTheme;

View File

@ -1,5 +1,38 @@
# Change Log
## 2.2.0
### Minor Changes
- 8a7eae4: Add React 18 to peerDependencies range
### Patch Changes
- Updated dependencies [8a7eae4]
- @redux-devtools/chart-monitor@3.0.0
- @redux-devtools/inspector-monitor-test-tab@1.0.0
- @redux-devtools/inspector-monitor-trace-tab@1.0.0
- @redux-devtools/inspector-monitor@3.0.0
- @redux-devtools/log-monitor@4.0.0
- @redux-devtools/rtk-query-monitor@3.0.0
- @redux-devtools/slider-monitor@4.0.0
- @redux-devtools/ui@1.3.0
- @redux-devtools/core@3.13.0
## 2.1.4
### Patch Changes
- Updated dependencies [4891bf6]
- @redux-devtools/core@3.12.0
- @redux-devtools/chart-monitor@2.1.1
- @redux-devtools/inspector-monitor@2.1.2
- @redux-devtools/log-monitor@3.1.1
- @redux-devtools/rtk-query-monitor@2.1.2
- @redux-devtools/slider-monitor@3.1.2
- @redux-devtools/inspector-monitor-test-tab@0.8.6
- @redux-devtools/inspector-monitor-trace-tab@0.3.4
## 2.1.3
### Patch Changes

View File

@ -16,10 +16,11 @@ Also it's a react component you can use to build amazing monitor applications li
```js
import React from 'react';
import ReactDom from 'react-dom';
import ReactDOM from 'react-dom/client';
import { Root } from '@redux-devtools/app';
ReactDom.render(<Root />, document.getElementById('root'));
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<Root />);
```
### Parameters

View File

@ -1,8 +1,9 @@
import React from 'react';
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import { Root } from '../src';
render(<Root />, document.getElementById('root'));
const root = createRoot(document.getElementById('root')!);
root.render(<Root />);
if (module.hot) {
// https://github.com/webpack/webpack/issues/418#issuecomment-53398056

View File

@ -1,6 +1,6 @@
{
"name": "@redux-devtools/app",
"version": "2.1.3",
"version": "2.2.0",
"description": "Redux DevTools app",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-app",
"bugs": {
@ -24,8 +24,8 @@
},
"scripts": {
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --hot --env development --env platform=web --progress",
"build": "yarn run build:lib && yarn run build:web && yarn run build:umd && yarn run build:umd:min",
"build:lib": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:lib && pnpm run build:web && pnpm run build:umd && pnpm run build:umd:min",
"build:lib": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -36,22 +36,22 @@
"test": "jest",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@redux-devtools/chart-monitor": "^2.1.0",
"@redux-devtools/core": "^3.11.0",
"@redux-devtools/inspector-monitor": "^2.1.1",
"@redux-devtools/inspector-monitor-test-tab": "^0.8.5",
"@redux-devtools/inspector-monitor-trace-tab": "^0.3.3",
"@redux-devtools/log-monitor": "^3.1.0",
"@redux-devtools/rtk-query-monitor": "^2.1.1",
"@redux-devtools/slider-monitor": "^3.1.1",
"@redux-devtools/ui": "^1.2.1",
"@reduxjs/toolkit": "^1.8.1",
"@types/prop-types": "^15.7.4",
"@babel/runtime": "^7.18.3",
"@redux-devtools/chart-monitor": "^3.0.0",
"@redux-devtools/core": "^3.13.0",
"@redux-devtools/inspector-monitor": "^3.0.0",
"@redux-devtools/inspector-monitor-test-tab": "^1.0.0",
"@redux-devtools/inspector-monitor-trace-tab": "^1.0.0",
"@redux-devtools/log-monitor": "^4.0.0",
"@redux-devtools/rtk-query-monitor": "^3.0.0",
"@redux-devtools/slider-monitor": "^4.0.0",
"@redux-devtools/ui": "^1.3.0",
"@reduxjs/toolkit": "^1.8.2",
"@types/prop-types": "^15.7.5",
"d3-state-visualizer": "^1.6.0",
"javascript-stringify": "^2.1.0",
"jsan": "^3.1.14",
@ -59,67 +59,66 @@
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"prop-types": "^15.8.1",
"react-icons": "^4.3.1",
"react-is": "^17.0.2",
"react-redux": "^7.2.8",
"redux": "^4.1.2",
"react-icons": "^4.4.0",
"react-is": "^18.2.0",
"react-redux": "^8.0.2",
"redux": "^4.2.0",
"redux-persist": "^6.0.0",
"socketcluster-client": "^14.3.2"
"socketcluster-client": "^16.1.1"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@rjsf/core": "^4.1.1",
"@testing-library/jest-dom": "^5.16.3",
"@testing-library/react": "^12.1.4",
"@types/jest": "^27.4.1",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@rjsf/core": "^4.2.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@types/jest": "^27.5.2",
"@types/jsan": "^3.1.2",
"@types/json-schema": "^7.0.11",
"@types/lodash": "^4.14.181",
"@types/node": "^16.11.26",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@types/react-redux": "^7.1.23",
"@types/socketcluster-client": "^13.0.5",
"@types/styled-components": "^5.1.24",
"@types/testing-library__jest-dom": "^5.14.3",
"@types/webpack-env": "^1.16.3",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"babel-loader": "^8.2.4",
"@types/lodash": "^4.14.182",
"@types/node": "^16.11.41",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/socketcluster-client": "^16.0.0",
"@types/styled-components": "^5.1.25",
"@types/testing-library__jest-dom": "^5.14.5",
"@types/webpack-env": "^1.17.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"babel-loader": "^8.2.5",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"eslint": "^8.12.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"fork-ts-checker-webpack-plugin": "^7.2.2",
"html-loader": "^3.1.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"html-loader": "^3.1.2",
"html-webpack-plugin": "^5.5.0",
"jest": "^27.5.1",
"path-browserify": "^1.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^3.0.2",
"style-loader": "^3.3.1",
"styled-components": "^5.3.5",
"ts-jest": "^27.1.4",
"ts-node": "^10.7.0",
"typescript": "~4.5.5",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
"ts-jest": "^27.1.5",
"ts-node": "^10.8.1",
"typescript": "~4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2"
},
"peerDependencies": {
"@types/react": "^16.3.0 || ^17.0.0",
"@types/styled-components": "^5.1.24",
"react": "^16.3.0 || ^17.0.0",
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"@types/styled-components": "^5.1.25",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"styled-components": "^5.3.5"
}
}

View File

@ -1,5 +1,5 @@
import { SchemeName, ThemeName } from '@redux-devtools/ui';
import { AuthStates, States } from 'socketcluster-client/lib/scclientsocket';
import { AuthStates, States } from 'socketcluster-client/lib/clientsocket';
import { REHYDRATE } from 'redux-persist';
import {
CHANGE_SECTION,

View File

@ -16,7 +16,7 @@ export const {
AUTHENTICATED,
PENDING,
UNAUTHENTICATED,
} = socketCluster.SCClientSocket as unknown as States;
} = socketCluster.AGClientSocket as unknown as States;
export const CONNECT_REQUEST = 'socket/CONNECT_REQUEST';
export const CONNECT_SUCCESS = 'socket/CONNECT_SUCCESS';
export const CONNECT_ERROR = 'socket/CONNECT_ERROR';

View File

@ -20,7 +20,7 @@ interface Props {
}
class DevTools extends Component<Props> {
monitorProps: unknown;
monitorProps?: object;
Monitor?: React.ComponentType<
LiftedState<unknown, Action<unknown>, unknown>
> & {

View File

@ -1,4 +1,4 @@
import socketCluster, { SCClientSocket } from 'socketcluster-client';
import socketClusterClient, { AGClientSocket } from 'socketcluster-client';
import { stringify } from 'jsan';
import { Dispatch, MiddlewareAPI } from 'redux';
import * as actions from '../constants/socketActionTypes';
@ -25,11 +25,16 @@ import {
import { nonReduxDispatch } from '../utils/monitorActions';
import { StoreState } from '../reducers';
let socket: SCClientSocket;
let socket: AGClientSocket;
let store: MiddlewareAPI<Dispatch<StoreAction>, StoreState>;
function emit({ message: type, id, instanceId, action, state }: EmitAction) {
socket.emit(id ? `sc-${id}` : 'respond', { type, action, state, instanceId });
void socket.transmit(id ? `sc-${id}` : 'respond', {
type,
action,
state,
instanceId,
});
}
function startMonitoring(channel: string) {
@ -120,7 +125,7 @@ function monitoring(request: MonitoringRequest) {
instanceId === instances.selected &&
(request.type === 'ACTION' || request.type === 'STATE')
) {
socket.emit('respond', {
void socket.transmit('respond', {
type: 'SYNC',
state: stringify(instances.states[instanceId]),
id: request.id,
@ -134,65 +139,84 @@ function subscribe(
subscription: typeof UPDATE_STATE | typeof UPDATE_REPORTS
) {
const channel = socket.subscribe(channelName);
if (subscription === UPDATE_STATE) channel.watch(monitoring);
else {
if (subscription === UPDATE_STATE) {
void (async () => {
for await (const data of channel) {
monitoring(data as MonitoringRequest);
}
})();
} else {
const watcher = (request: UpdateReportsRequest) => {
store.dispatch({ type: subscription, request });
};
channel.watch(watcher);
socket.on(channelName, watcher);
void (async () => {
for await (const data of channel) {
watcher(data as UpdateReportsRequest);
}
})();
}
}
function handleConnection() {
socket.on('connect', (status) => {
store.dispatch({
type: actions.CONNECT_SUCCESS,
payload: {
id: status.id,
authState: socket.authState,
socketState: socket.state,
},
error: status.authError,
});
if (socket.authState !== actions.AUTHENTICATED) {
store.dispatch({ type: actions.AUTH_REQUEST });
void (async () => {
for await (const data of socket.listener('connect')) {
store.dispatch({
type: actions.CONNECT_SUCCESS,
payload: {
id: data.id,
authState: socket.authState,
socketState: socket.state,
},
// @ts-expect-error Is this legitimate?
error: data.authError,
});
if (socket.authState !== actions.AUTHENTICATED) {
store.dispatch({ type: actions.AUTH_REQUEST });
}
}
});
socket.on('disconnect', (code) => {
store.dispatch({ type: actions.DISCONNECTED, code });
});
})();
void (async () => {
for await (const data of socket.listener('disconnect')) {
store.dispatch({ type: actions.DISCONNECTED, code: data.code });
}
})();
socket.on('subscribe', (channel) => {
store.dispatch({ type: actions.SUBSCRIBE_SUCCESS, channel });
});
socket.on('unsubscribe', (channel) => {
socket.unsubscribe(channel);
socket.unwatch(channel);
socket.off(channel);
store.dispatch({ type: actions.UNSUBSCRIBE, channel });
});
socket.on('subscribeFail', (error) => {
store.dispatch({
type: actions.SUBSCRIBE_ERROR,
error,
status: 'subscribeFail',
});
});
socket.on('dropOut', (error) => {
store.dispatch({ type: actions.SUBSCRIBE_ERROR, error, status: 'dropOut' });
});
void (async () => {
for await (const data of socket.listener('subscribe')) {
store.dispatch({
type: actions.SUBSCRIBE_SUCCESS,
channel: data.channel,
});
}
})();
void (async () => {
for await (const data of socket.listener('unsubscribe')) {
void socket.unsubscribe(data.channel);
store.dispatch({ type: actions.UNSUBSCRIBE, channel: data.channel });
}
})();
void (async () => {
for await (const data of socket.listener('subscribeFail')) {
store.dispatch({
type: actions.SUBSCRIBE_ERROR,
error: data.error,
status: 'subscribeFail',
});
}
})();
socket.on('error', (error) => {
store.dispatch({ type: actions.CONNECT_ERROR, error });
});
void (async () => {
for await (const data of socket.listener('error')) {
store.dispatch({ type: actions.CONNECT_ERROR, error: data.error });
}
})();
}
function connect() {
if (process.env.NODE_ENV === 'test') return;
const connection = store.getState().connection;
try {
socket = socketCluster.create(connection.options);
socket = socketClusterClient.create(connection.options);
handleConnection();
} catch (error) {
store.dispatch({ type: actions.CONNECT_ERROR, error: error as Error });
@ -205,43 +229,42 @@ function connect() {
function disconnect() {
if (socket) {
socket.disconnect();
socket.off();
}
}
function login() {
socket.emit('login', {}, (error: Error, baseChannel: string) => {
if (error) {
store.dispatch({ type: actions.AUTH_ERROR, error });
return;
void (async () => {
try {
const baseChannel = (await socket.invoke('login', {})) as string;
store.dispatch({ type: actions.AUTH_SUCCESS, baseChannel });
store.dispatch({
type: actions.SUBSCRIBE_REQUEST,
channel: baseChannel,
subscription: UPDATE_STATE,
});
store.dispatch({
type: actions.SUBSCRIBE_REQUEST,
channel: 'report',
subscription: UPDATE_REPORTS,
});
} catch (error) {
store.dispatch({ type: actions.AUTH_ERROR, error: error as Error });
}
store.dispatch({ type: actions.AUTH_SUCCESS, baseChannel });
store.dispatch({
type: actions.SUBSCRIBE_REQUEST,
channel: baseChannel,
subscription: UPDATE_STATE,
});
store.dispatch({
type: actions.SUBSCRIBE_REQUEST,
channel: 'report',
subscription: UPDATE_REPORTS,
});
});
})();
}
function getReport(reportId: unknown) {
socket.emit(
'getReport',
reportId,
(error: Error, data: { payload: string }) => {
if (error) {
store.dispatch({ type: GET_REPORT_ERROR, error });
return;
}
void (async () => {
try {
const data = (await socket.invoke('getReport', reportId)) as {
payload: string;
};
store.dispatch({ type: GET_REPORT_SUCCESS, data });
store.dispatch(importState(data.payload));
} catch (error) {
store.dispatch({ type: GET_REPORT_ERROR, error: error as Error });
}
);
})();
}
export function api(inStore: MiddlewareAPI<Dispatch<StoreAction>, StoreState>) {

View File

@ -1,4 +1,4 @@
import { AuthStates, States } from 'socketcluster-client/lib/scclientsocket';
import { AuthStates, States } from 'socketcluster-client/lib/clientsocket';
import * as actions from '../constants/socketActionTypes';
import { StoreAction } from '../actions';

View File

@ -1,5 +1,31 @@
# Change Log
## 3.0.1
### Patch Changes
- a55ba302: Fix peer dependencies on @redux-devtools/core
- Updated dependencies [a55ba302]
- @redux-devtools/core@3.13.1
## 3.0.0
### Minor Changes
- 8a7eae4: Add React 18 to peerDependencies range
### Patch Changes
- Updated dependencies [8a7eae4]
- @redux-devtools/core@3.13.0
## 2.1.1
### Patch Changes
- Updated dependencies [4891bf6]
- @redux-devtools/core@3.12.0
## 2.0.0
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):

View File

@ -1,6 +1,6 @@
{
"name": "@redux-devtools/chart-monitor",
"version": "2.1.0",
"version": "3.0.1",
"description": "Chart monitor for Redux DevTools",
"keywords": [
"redux",
@ -28,19 +28,19 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
"clean": "rimraf lib",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@types/prop-types": "^15.7.4",
"@babel/runtime": "^7.18.3",
"@types/prop-types": "^15.7.5",
"@types/redux-devtools-themes": "^1.0.0",
"d3-state-visualizer": "^1.6.0",
"deepmerge": "^4.2.2",
@ -48,30 +48,30 @@
"redux-devtools-themes": "^1.0.0"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@redux-devtools/core": "^3.11.0",
"@types/react": "^17.0.43",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@redux-devtools/core": "^3.13.1",
"@types/react": "^18.0.14",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"react": "^17.0.2",
"redux": "^4.1.2",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"react": "^18.2.0",
"redux": "^4.2.0",
"rimraf": "^3.0.2",
"typescript": "~4.5.5"
"typescript": "~4.7.4"
},
"peerDependencies": {
"@redux-devtools/core": "^3.7.0",
"@types/react": "^16.3.0 || ^17.0.0",
"react": "^16.3.0 || ^17.0.0",
"@redux-devtools/core": "^3.13.1",
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"redux": "^3.4.0 || ^4.0.0"
}
}

View File

@ -31,16 +31,15 @@
<script src="/redux-devtools-app.min.js"></script>
<script src="/port.js"></script>
<script>
ReactDOM.render(
React.createElement(ReduxDevToolsApp, {
socketOptions: {
hostname: location.hostname,
port: reduxDevToolsPort,
autoReconnect: true,
},
}),
document.querySelector('#root')
);
const container = document.querySelector('#root');
const element = React.createElement(ReduxDevToolsApp, {
socketOptions: {
hostname: location.hostname,
port: reduxDevToolsPort,
autoReconnect: true,
},
});
ReactDOM.createRoot(container).render(element);
</script>
</body>
</html>

View File

@ -33,35 +33,35 @@
"test": "jest",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"engines": {
"node": ">=14.15.0"
},
"dependencies": {
"@redux-devtools/app": "^2.1.3",
"@types/react": "^17.0.43",
"apollo-server-express": "^3.6.7",
"@types/react": "^18.0.14",
"apollo-server-express": "^3.9.0",
"body-parser": "^1.20.0",
"chalk": "^4.1.2",
"cors": "^2.8.5",
"cross-spawn": "^7.0.3",
"electron": "^18.0.1",
"express": "^4.17.3",
"electron": "^19.0.6",
"express": "^4.18.1",
"getport": "^0.1.0",
"graphql": "^16.3.0",
"knex": "^0.95.15",
"graphql": "^16.5.0",
"knex": "^2.1.0",
"lodash": "^4.17.21",
"minimist": "^1.2.6",
"morgan": "^1.10.0",
"open": "^8.4.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"semver": "^7.3.5",
"socketcluster": "^14.4.2",
"sqlite3": "^5.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"semver": "^7.3.7",
"socketcluster-server": "^16.2.1",
"sqlite3": "^5.0.8",
"styled-components": "^5.3.5",
"uuid": "^8.3.2"
},
@ -70,28 +70,28 @@
"@types/cors": "^2.8.12",
"@types/cross-spawn": "^6.0.2",
"@types/express": "^4.17.13",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.181",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.182",
"@types/minimist": "^1.2.2",
"@types/morgan": "^1.9.3",
"@types/semver": "^7.3.9",
"@types/socketcluster": "^14.0.4",
"@types/socketcluster-client": "^13.0.5",
"@types/socketcluster-server": "^14.2.6",
"@types/styled-components": "^5.1.24",
"@types/node": "^16.11.41",
"@types/semver": "^7.3.10",
"@types/socketcluster-client": "^16.0.0",
"@types/socketcluster-server": "^16.1.0",
"@types/styled-components": "^5.1.25",
"@types/supertest": "^2.0.12",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-jest": "^26.5.3",
"jest": "^27.5.1",
"ncp": "^2.0.0",
"rimraf": "^3.0.2",
"socketcluster-client": "^14.3.2",
"supertest": "^6.2.2",
"ts-jest": "^27.1.4",
"typescript": "~4.5.5"
"socketcluster-client": "^16.1.1",
"supertest": "^6.2.3",
"ts-jest": "^27.1.5",
"typescript": "~4.7.4"
}
}

View File

@ -88,10 +88,9 @@ if (argv.injectserver) {
}
// eslint-disable-next-line @typescript-eslint/no-floating-promises
server(argv).then(function (r) {
server(argv).then(async function (r) {
if (argv.open && argv.open !== 'false') {
r.on('ready', async function () {
await openApp(argv.open as string, options);
});
await r.listener('ready').once();
await openApp(argv.open as string, options);
}
});

View File

@ -1,8 +1,8 @@
import path from 'path';
import knexModule, { Knex } from 'knex';
import { SCServer } from 'socketcluster-server';
import { AGServer } from 'socketcluster-server';
export default function connector(options: SCServer.SCServerOptions) {
export default function connector(options: AGServer.AGServerOptions) {
const dbOptions = options.dbOptions as Knex.Config;
dbOptions.useNullAsDefault = true;
if (!(dbOptions as any).migrate) {

View File

@ -1,6 +1,10 @@
import express from 'express';
import http from 'http';
import getPort from 'getport';
import SocketCluster from 'socketcluster';
import socketClusterServer from 'socketcluster-server';
import getOptions, { Options } from './options';
import routes from './routes';
import createStore from './store';
// var LOG_LEVEL_NONE = 0;
const LOG_LEVEL_ERROR = 1;
@ -8,16 +12,14 @@ const LOG_LEVEL_WARN = 2;
const LOG_LEVEL_INFO = 3;
export interface ExtendedOptions extends Options {
workerController: string;
allowClientPublish: boolean;
}
export default function (argv: { [arg: string]: any }): Promise<{
portAlreadyUsed?: boolean;
on: (status: 'ready', cb: (() => void) | (() => Promise<void>)) => void;
listener: (eventName: 'ready') => { once(): Promise<void> };
}> {
const options = Object.assign(getOptions(argv), {
workerController: __dirname + '/worker.js',
allowClientPublish: false,
});
const port = options.port;
@ -39,8 +41,12 @@ export default function (argv: { [arg: string]: any }): Promise<{
}
resolve({
portAlreadyUsed: true,
on: function (status: string, cb: () => void) {
cb();
listener: function (eventName: 'ready') {
return {
once() {
return Promise.resolve();
},
};
},
});
} else {
@ -48,7 +54,100 @@ export default function (argv: { [arg: string]: any }): Promise<{
console.log('[ReduxDevTools] Start server...');
console.log('-'.repeat(80) + '\n');
}
resolve(new SocketCluster(options));
const httpServer = http.createServer();
const agServer = socketClusterServer.attach(httpServer, options);
const app = express();
httpServer.on('request', app);
const store = createStore(options);
app.use(routes(options, store, agServer));
agServer.setMiddleware(
agServer.MIDDLEWARE_INBOUND,
// eslint-disable-next-line @typescript-eslint/no-misused-promises
async (middlewareStream) => {
for await (const action of middlewareStream) {
if (action.type === action.TRANSMIT) {
const channel = action.receiver;
const data = action.data;
if (
channel.substring(0, 3) === 'sc-' ||
channel === 'respond' ||
channel === 'log'
) {
void agServer.exchange.transmitPublish(channel, data);
} else if (channel === 'log-noid') {
void agServer.exchange.transmitPublish('log', {
id: action.socket.id,
data: data,
});
}
} else if (action.type === action.SUBSCRIBE) {
if (action.channel === 'report') {
store
.list()
.then(function (data) {
void agServer.exchange.transmitPublish('report', {
type: 'list',
data: data,
});
})
.catch(function (error) {
console.error(error); // eslint-disable-line no-console
});
}
}
action.allow();
}
}
);
void (async () => {
for await (const { socket } of agServer.listener('connection')) {
let channelToWatch: string, channelToEmit: string;
void (async () => {
for await (const request of socket.procedure('login')) {
const credentials = request.data;
if (credentials === 'master') {
channelToWatch = 'respond';
channelToEmit = 'log';
} else {
channelToWatch = 'log';
channelToEmit = 'respond';
}
request.end(channelToWatch);
}
})();
void (async () => {
for await (const request of socket.procedure('getReport')) {
const id = request.data as string;
store
.get(id)
.then(function (data) {
request.end(data);
})
.catch(function (error) {
console.error(error); // eslint-disable-line no-console
});
}
})();
void (async () => {
for await (const data of socket.listener('disconnect')) {
const channel = agServer.exchange.channel('sc-' + socket.id);
channel.unsubscribe();
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
void agServer.exchange.transmitPublish(channelToEmit!, {
id: socket.id,
type: 'DISCONNECTED',
});
}
})();
}
})();
httpServer.listen(options.port);
// @ts-expect-error Shouldn't there be a 'ready' event?
resolve(agServer);
}
/* eslint-enable no-console */
});

View File

@ -1,10 +1,11 @@
import path from 'path';
import express from 'express';
import type { Router } from 'express';
import morgan from 'morgan';
import * as http from 'http';
import bodyParser from 'body-parser';
import cors from 'cors';
import { SCServer } from 'socketcluster-server';
import { AGServer } from 'socketcluster-server';
import { ApolloServer } from 'apollo-server-express';
import { AddData, ReportBaseFields, Store } from './store';
import { resolvers, schema } from './api/schema';
@ -20,10 +21,10 @@ function serveUmdModule(name: string) {
}
function routes(
options: SCServer.SCServerOptions,
options: AGServer.AGServerOptions,
store: Store,
scServer: SCServer
) {
scServer: AGServer
): Router {
const limit = options.maxRequestBody;
const logHTTPRequests = options.logHTTPRequests;
@ -64,7 +65,8 @@ function routes(
serveUmdModule('@redux-devtools/app');
app.get('/port.js', function (req, res) {
res.send(`reduxDevToolsPort = ${options.port!}`);
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
res.send(`reduxDevToolsPort = ${options.port}`);
});
app.get('*', function (req, res) {
res.sendFile(path.join(__dirname, '../app/index.html'));
@ -107,7 +109,7 @@ function routes(
id: (r as ReportBaseFields).id,
error: (r as { error: string }).error,
});
scServer.exchange.publish('report', {
void scServer.exchange.transmitPublish('report', {
type: 'add',
data: r,
});

View File

@ -1,6 +1,6 @@
import { v4 as uuidV4 } from 'uuid';
import pick from 'lodash/pick';
import { SCServer } from 'socketcluster-server';
import { AGServer } from 'socketcluster-server';
import { Knex } from 'knex';
import connector from './db/connector';
@ -139,7 +139,7 @@ export interface Store {
add: (data: AddData) => Promise<ReportBaseFields | { error: string }>;
}
function createStore(options: SCServer.SCServerOptions): Store {
function createStore(options: AGServer.AGServerOptions): Store {
knex = connector(options);
return {

View File

@ -1,86 +0,0 @@
import SCWorker from 'socketcluster/scworker';
import express from 'express';
import routes from './routes';
import createStore from './store';
const app = express();
class Worker extends SCWorker {
run() {
const httpServer = this.httpServer;
const scServer = this.scServer;
const options = this.options;
const store = createStore(options);
httpServer.on('request', app);
app.use(routes(options, store, scServer));
scServer.addMiddleware(scServer.MIDDLEWARE_EMIT, function (req, next) {
const channel = req.event;
const data = req.data;
if (
channel.substr(0, 3) === 'sc-' ||
channel === 'respond' ||
channel === 'log'
) {
scServer.exchange.publish(channel, data);
} else if (channel === 'log-noid') {
scServer.exchange.publish('log', { id: req.socket.id, data: data });
}
next();
});
scServer.addMiddleware(scServer.MIDDLEWARE_SUBSCRIBE, function (req, next) {
next();
if (req.channel === 'report') {
store
.list()
.then(function (data) {
req.socket.emit(req.channel!, { type: 'list', data: data });
})
.catch(function (error) {
console.error(error); // eslint-disable-line no-console
});
}
});
scServer.on('connection', function (socket) {
let channelToWatch: string, channelToEmit: string;
socket.on('login', function (this: Worker, credentials, respond) {
if (credentials === 'master') {
channelToWatch = 'respond';
channelToEmit = 'log';
} else {
channelToWatch = 'log';
channelToEmit = 'respond';
}
this.exchange.subscribe('sc-' + socket.id).watch(function (msg) {
socket.emit(channelToWatch, msg);
});
respond(null, channelToWatch);
});
socket.on('getReport', function (id: string, respond) {
store
.get(id)
.then(function (data) {
respond(null, data);
})
.catch(function (error) {
console.error(error); // eslint-disable-line no-console
});
});
socket.on('disconnect', function (this: Worker) {
const channel = this.exchange.channel('sc-' + socket.id);
channel.unsubscribe();
channel.destroy();
scServer.exchange.publish(channelToEmit, {
id: socket.id,
type: 'DISCONNECTED',
});
});
});
}
}
new Worker();

View File

@ -1,6 +1,6 @@
import childProcess from 'child_process';
import request from 'supertest';
import scClient from 'socketcluster-client';
import socketClusterClient from 'socketcluster-client';
jest.setTimeout(10000);
@ -44,20 +44,30 @@ describe('Server', function () {
});
describe('Realtime monitoring', function () {
let socket: scClient.SCClientSocket,
socket2: scClient.SCClientSocket,
let socket: socketClusterClient.AGClientSocket,
socket2: socketClusterClient.AGClientSocket,
channel;
beforeAll(function () {
socket = scClient.connect({ hostname: 'localhost', port: 8000 });
socket = socketClusterClient.create({
hostname: 'localhost',
port: 8000,
});
socket.connect();
socket.on('error', function (error) {
console.error('Socket1 error', error); // eslint-disable-line no-console
void (async () => {
for await (const data of socket.listener('error')) {
console.error('Socket1 error', data.error); // eslint-disable-line no-console
}
})();
socket2 = socketClusterClient.create({
hostname: 'localhost',
port: 8000,
});
socket2 = scClient.connect({ hostname: 'localhost', port: 8000 });
socket2.connect();
socket.on('error', function (error) {
console.error('Socket2 error', error); // eslint-disable-line no-console
});
void (async () => {
for await (const data of socket2.listener('error')) {
console.error('Socket2 error', data.error); // eslint-disable-line no-console
}
})();
});
afterAll(function () {
@ -65,73 +75,50 @@ describe('Server', function () {
socket2.disconnect();
});
it('should connect', function () {
return new Promise<void>((done) => {
socket.on('connect', function (status) {
expect(status.id).toBeTruthy();
done();
});
});
it('should connect', async function () {
const data = await socket.listener('connect').once();
expect(data.id).toBeTruthy();
});
it('should login', function () {
socket.emit(
'login',
'master',
function (error: Error | undefined, channelName: string) {
if (error) {
/* eslint-disable-next-line no-console */
console.log(error);
return;
}
expect(channelName).toBe('respond');
channel = socket.subscribe(channelName);
expect(channel.SUBSCRIBED).toBe('subscribed');
}
);
it('should login', async function () {
try {
const channelName = (await socket.invoke('login', 'master')) as string;
expect(channelName).toBe('respond');
channel = socket.subscribe(channelName);
expect(channel.SUBSCRIBED).toBe('subscribed');
} catch (error) {
console.log(error);
}
});
it('should send message', function () {
return new Promise<void>((done) => {
const data = {
type: 'ACTION',
payload: {
todos: 'do some',
},
it('should send message', async function () {
const data = {
type: 'ACTION',
payload: {
todos: 'do some',
},
action: {
timestamp: 1483349708506,
action: {
timestamp: 1483349708506,
action: {
type: 'ADD_TODO',
text: 'hggg',
},
type: 'ADD_TODO',
text: 'hggg',
},
instanceId: 'tAmA7H5fclyWhvizAAAi',
name: 'LoggerInstance',
id: 'tAmA7H5fclyWhvizAAAi',
};
},
instanceId: 'tAmA7H5fclyWhvizAAAi',
name: 'LoggerInstance',
id: 'tAmA7H5fclyWhvizAAAi',
};
socket2.emit(
'login',
'',
function (error: Error | undefined, channelName: string) {
if (error) {
/* eslint-disable-next-line no-console */
console.log(error);
return;
}
expect(channelName).toBe('log');
const channel2 = socket2.subscribe(channelName);
expect(channel2.SUBSCRIBED).toBe('subscribed');
channel2.on('subscribe', function () {
channel2.watch(function (message) {
expect(message).toEqual(data);
done();
});
socket.emit(channelName, data);
});
}
);
});
try {
const channelName = (await socket.invoke('login', '')) as string;
expect(channelName).toBe('log');
const channel2 = socket2.subscribe(channelName);
expect(channel2.SUBSCRIBED).toBe('subscribed');
const message = await channel2.listener('subscribe').once();
expect(message).toEqual(data);
} catch (error) {
console.log(error);
}
});
});
@ -149,97 +136,61 @@ describe('Server', function () {
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) ' +
'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36',
};
it('should add a report', function () {
return new Promise<void>((done) => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
request('http://localhost:8000')
.post('/')
.send(report)
.set('Accept', 'application/json')
.expect('Content-Type', /application\/json/)
.expect(200)
.then(function (res: { body: { id: string } }) {
id = res.body.id;
expect(id).toBeTruthy();
done();
});
});
it('should add a report', async function () {
const res = await request('http://localhost:8000')
.post('/')
.send(report)
.set('Accept', 'application/json')
.expect('Content-Type', /application\/json/)
.expect(200);
id = res.body.id;
expect(id).toBeTruthy();
});
it('should get the report', function () {
return new Promise<void>((done) => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
request('http://localhost:8000')
.post('/')
.send({
op: 'get',
id: id,
})
.set('Accept', 'application/json')
.expect('Content-Type', /application\/json/)
.expect(200)
.then(function (res: { body: unknown }) {
expect(res.body).toMatchObject(report);
done();
});
});
it('should get the report', async function () {
const res = await request('http://localhost:8000')
.post('/')
.send({
op: 'get',
id: id,
})
.set('Accept', 'application/json')
.expect('Content-Type', /application\/json/)
.expect(200);
expect(res.body).toMatchObject(report);
});
it('should list reports', function () {
return new Promise<void>((done) => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
request('http://localhost:8000')
.post('/')
.send({
op: 'list',
})
.set('Accept', 'application/json')
.expect('Content-Type', /application\/json/)
.expect(200)
.then(function (res: {
body: { id: string; title: string | null; added: string | null }[];
}) {
expect(res.body).toHaveLength(1);
expect(res.body[0].id).toBe(id);
expect(res.body[0].title).toBe('Test report');
expect(res.body[0].added).toBeTruthy();
done();
});
});
it('should list reports', async function () {
const res = await request('http://localhost:8000')
.post('/')
.send({
op: 'list',
})
.set('Accept', 'application/json')
.expect('Content-Type', /application\/json/)
.expect(200);
expect(res.body).toHaveLength(1);
expect(res.body[0].id).toBe(id);
expect(res.body[0].title).toBe('Test report');
expect(res.body[0].added).toBeTruthy();
});
});
describe('GraphQL backend', function () {
it('should get the report', function () {
return new Promise<void>((done) => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
request('http://localhost:8000')
.post('/graphql')
.send({
query: '{ reports { id, type, title } }',
})
.set('Accept', 'application/json')
.expect('Content-Type', /application\/json/)
.expect(200)
.then(function (res: {
body: {
data: {
reports: {
id: string;
title: string | null;
type: string | null;
}[];
};
};
}) {
const reports = res.body.data.reports;
expect(reports).toHaveLength(1);
expect(reports[0].id).toBeTruthy();
expect(reports[0].title).toBe('Test report');
expect(reports[0].type).toBe('ACTIONS');
done();
});
});
it('should get the report', async function () {
const res = await request('http://localhost:8000')
.post('/graphql')
.send({
query: '{ reports { id, type, title } }',
})
.set('Accept', 'application/json')
.expect('Content-Type', /application\/json/)
.expect(200);
const reports = res.body.data.reports;
expect(reports).toHaveLength(1);
expect(reports[0].id).toBeTruthy();
expect(reports[0].title).toBe('Test report');
expect(reports[0].type).toBe('ACTIONS');
});
});
});

View File

@ -1,5 +1,32 @@
# Change Log
## 3.0.1
### Patch Changes
- a55ba302: Fix peer dependencies on @redux-devtools/core
- Updated dependencies [a55ba302]
- @redux-devtools/core@3.13.1
## 3.0.0
### Minor Changes
- 8a7eae4: Add React 18 to peerDependencies range
### Patch Changes
- Updated dependencies [8a7eae4]
- react-dock@0.6.0
- @redux-devtools/core@3.13.0
## 2.1.1
### Patch Changes
- Updated dependencies [4891bf6]
- @redux-devtools/core@3.12.0
## 2.0.0
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):

View File

@ -1,6 +1,6 @@
{
"name": "@redux-devtools/dock-monitor",
"version": "2.1.0",
"version": "3.0.1",
"description": "A resizable and movable dock for Redux DevTools monitors",
"keywords": [
"redux",
@ -30,49 +30,49 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
"clean": "rimraf lib",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@types/prop-types": "^15.7.4",
"@babel/runtime": "^7.18.3",
"@types/prop-types": "^15.7.5",
"parse-key": "^0.2.1",
"prop-types": "^15.8.1",
"react-dock": "^0.5.1"
"react-dock": "^0.6.0"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@redux-devtools/core": "^3.11.0",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@redux-devtools/core": "^3.13.1",
"@types/parse-key": "^0.2.0",
"@types/react": "^17.0.43",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@types/react": "^18.0.14",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"react": "^17.0.2",
"redux": "^4.1.2",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"react": "^18.2.0",
"redux": "^4.2.0",
"rimraf": "^3.0.2",
"typescript": "~4.5.5"
"typescript": "~4.7.4"
},
"peerDependencies": {
"@redux-devtools/core": "^3.7.0",
"@types/react": "^16.3.0 || ^17.0.0",
"react": "^16.3.0 || ^17.0.0",
"@redux-devtools/core": "^3.13.1",
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"redux": "^3.4.0 || ^4.0.0"
}
}

View File

@ -18,33 +18,34 @@
"url": "https://github.com/reduxjs/redux-devtools"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
"clean": "rimraf lib",
"lint": "eslint . --ext .ts",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint"
},
"dependencies": {
"@babel/runtime": "^7.17.8"
"@babel/runtime": "^7.18.3",
"immutable": "^4.0.0"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"redux": "^4.1.2",
"redux": "^4.2.0",
"rimraf": "^3.0.2",
"typescript": "~4.5.5"
"typescript": "~4.7.4"
},
"peerDependencies": {
"redux": "^3.1.0 || ^4.0.0"

View File

@ -1,3 +1,4 @@
import Immutable from 'immutable';
import { Action, ActionCreator, compose, StoreEnhancer } from 'redux';
export interface EnhancerOptions {
@ -25,26 +26,58 @@ export interface EnhancerOptions {
*/
maxAge?: number;
/**
* - `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, error objects, symbols, maps, sets and functions.
* - object, which contains `date`, `regex`, `undefined`, `error`, `symbol`, `map`, `set` and `function` keys.
* For each of them you can indicate if to include (by setting as `true`).
* For `function` key you can also specify a custom function which handles serialization.
* See [`jsan`](https://github.com/kolodny/jsan) for more details.
* Customizes how actions and state are serialized and deserialized. Can be a boolean or object. If given a boolean, the behavior is the same as if you
* were to pass an object and specify `options` as a boolean. Giving an object allows fine-grained customization using the `replacer` and `reviver`
* functions.
*/
serialize?:
| boolean
| {
date?: boolean;
regex?: boolean;
undefined?: boolean;
error?: boolean;
symbol?: boolean;
map?: boolean;
set?: boolean;
// eslint-disable-next-line @typescript-eslint/ban-types
function?: boolean | Function;
/**
* - `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, error objects, symbols, maps, sets and functions.
* - object, which contains `date`, `regex`, `undefined`, `error`, `symbol`, `map`, `set` and `function` keys.
* For each of them you can indicate if to include (by setting as `true`).
* For `function` key you can also specify a custom function which handles serialization.
* See [`jsan`](https://github.com/kolodny/jsan) for more details.
*/
options?:
| undefined
| boolean
| {
date?: true;
regex?: true;
undefined?: true;
error?: true;
symbol?: true;
map?: true;
set?: true;
function?: true | ((fn: (...args: any[]) => any) => string);
};
/**
* [JSON replacer function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#The_replacer_parameter) used for both actions and states stringify.
* In addition, you can specify a data type by adding a [`__serializedType__`](https://github.com/zalmoxisus/remotedev-serialize/blob/master/helpers/index.js#L4)
* key. So you can deserialize it back while importing or persisting data.
* Moreover, it will also [show a nice preview showing the provided custom type](https://cloud.githubusercontent.com/assets/7957859/21814330/a17d556a-d761-11e6-85ef-159dd12f36c5.png):
*/
replacer?: (key: string, value: unknown) => any;
/**
* [JSON `reviver` function](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter)
* used for parsing the imported actions and states. See [`remotedev-serialize`](https://github.com/zalmoxisus/remotedev-serialize/blob/master/immutable/serialize.js#L8-L41)
* as an example on how to serialize special data types and get them back.
*/
reviver?: (key: string, value: unknown) => any;
/**
* Automatically serialize/deserialize immutablejs via [remotedev-serialize](https://github.com/zalmoxisus/remotedev-serialize).
* Just pass the Immutable library. It will support all ImmutableJS structures. You can even export them into a file and get them back.
* The only exception is `Record` class, for which you should pass this in addition the references to your classes in `refs`.
*/
immutable?: typeof Immutable;
/**
* ImmutableJS `Record` classes used to make possible restore its instances back when importing, persisting...
*/
refs?: Immutable.Record.Factory<any>[];
};
/**
* function which takes `action` object and id number as arguments, and should return `action` object back.

View File

@ -1,5 +1,23 @@
# Change Log
## 1.0.0
### Minor Changes
- 8a7eae4: Add React 18 to peerDependencies range
### Patch Changes
- Updated dependencies [8a7eae4]
- @redux-devtools/inspector-monitor@3.0.0
- @redux-devtools/ui@1.3.0
## 0.8.6
### Patch Changes
- @redux-devtools/inspector-monitor@2.1.2
## 0.8.0
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):

View File

@ -0,0 +1,22 @@
# test-demo
## 0.1.10
### Patch Changes
- Updated dependencies [8a7eae4]
- @redux-devtools/dock-monitor@3.0.0
- @redux-devtools/inspector-monitor-test-tab@1.0.0
- @redux-devtools/inspector-monitor@3.0.0
- @redux-devtools/ui@1.3.0
- @redux-devtools/core@3.13.0
## 0.1.9
### Patch Changes
- Updated dependencies [4891bf6]
- @redux-devtools/core@3.12.0
- @redux-devtools/dock-monitor@2.1.1
- @redux-devtools/inspector-monitor@2.1.2
- @redux-devtools/inspector-monitor-test-tab@0.8.6

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "test-demo",
"version": "0.1.8",
"version": "0.1.10",
"license": "MIT",
"scripts": {
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --open",
@ -10,55 +10,50 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@redux-devtools/core": "^3.11.0",
"@redux-devtools/dock-monitor": "^2.1.0",
"@redux-devtools/inspector-monitor": "^2.1.0",
"@redux-devtools/inspector-monitor-test-tab": "^0.8.5",
"@redux-devtools/ui": "^1.2.1",
"connected-react-router": "^6.9.2",
"history": "^4.10.1",
"immutable": "^4.0.0",
"@redux-devtools/core": "^3.13.0",
"@redux-devtools/dock-monitor": "^3.0.0",
"@redux-devtools/inspector-monitor": "^3.0.0",
"@redux-devtools/inspector-monitor-test-tab": "^1.0.0",
"@redux-devtools/ui": "^1.3.0",
"immutable": "^4.1.0",
"lodash.shuffle": "^4.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"react-redux": "^7.2.8",
"react-router": "^5.2.1",
"redux": "^4.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"redux": "^4.2.0",
"redux-logger": "^3.0.6",
"styled-components": "^5.3.5"
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@types/history": "^4.7.11",
"@types/lodash.shuffle": "^4.2.6",
"@types/node": "^16.11.26",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@types/react-redux": "^7.1.23",
"@types/react-router": "^5.1.18",
"@babel/core": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@types/lodash.shuffle": "^4.2.7",
"@types/node": "^16.11.41",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/redux-logger": "^3.0.9",
"@types/styled-components": "^5.1.24",
"@types/webpack-env": "^1.16.3",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"babel-loader": "^8.2.4",
"@types/styled-components": "^5.1.25",
"@types/webpack-env": "^1.17.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"babel-loader": "^8.2.5",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"eslint": "^8.12.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"fork-ts-checker-webpack-plugin": "^7.2.2",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"html-webpack-plugin": "^5.5.0",
"style-loader": "^3.3.1",
"ts-node": "^10.7.0",
"typescript": "~4.5.5",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
"ts-node": "^10.8.1",
"typescript": "~4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2"
}
}

View File

@ -1,8 +1,8 @@
import React, { CSSProperties } from 'react';
import React, { CSSProperties, useRef } from 'react';
import { connect } from 'react-redux';
import { Button, Toolbar, Spacer } from '@redux-devtools/ui';
import { push as pushRoute } from 'connected-react-router';
import pkg from '@redux-devtools/inspector-monitor-test-tab/package.json';
import { useLocation } from 'react-router-dom';
import getOptions from './getOptions';
import { DemoAppState } from './reducers';
import {
@ -69,87 +69,84 @@ interface Props
shuffleArray: () => void;
}
class DemoApp extends React.Component<Props> {
timeout?: number;
function DemoApp(props: Props) {
const timeout = useRef<number | undefined>();
const location = useLocation();
render() {
const options = getOptions(this.props.router.location);
const options = getOptions(location);
return (
<div style={styles.wrapper}>
<h3>{pkg.name || <span style={styles.muted}>Package Name</span>}</h3>
<h5>
{pkg.description || (
<span style={styles.muted}>Package Description</span>
)}
</h5>
<Toolbar>
<Spacer />
<Button onClick={this.props.increment}>Increment</Button>
<Button onClick={this.props.push}>Push</Button>
<Button onClick={this.props.pop}>Pop</Button>
<Button onClick={this.props.replace}>Replace</Button>
<Button onClick={this.props.changeNested}>Change Nested</Button>
<Spacer />
</Toolbar>
<Toolbar>
<Spacer />
<Button onClick={this.props.pushHugeArray}>Push Huge Array</Button>
<Button onClick={this.props.addHugeObject}>Add Huge Object</Button>
<Button onClick={this.props.hugePayload}>Huge Payload</Button>
<Spacer />
</Toolbar>
<Toolbar>
<Spacer />
<Button onClick={this.props.addIterator}>Add Iterator</Button>
<Button onClick={this.props.addImmutableMap}>
Add Immutable Map
</Button>
<Button onClick={this.props.changeImmutableNested}>
Change Immutable Nested
</Button>
<Spacer />
</Toolbar>
<Toolbar>
<Spacer />
<Button onClick={this.props.addRecursive}>Add Recursive</Button>
<Button onClick={this.props.addFunction}>Add Function</Button>
<Button onClick={this.props.addSymbol}>Add Symbol</Button>
<Spacer />
</Toolbar>
<Toolbar>
<Spacer />
<Button onClick={this.toggleTimeoutUpdate}>
Timeout Update {this.props.timeoutUpdateEnabled ? 'On' : 'Off'}
</Button>
<Button onClick={this.props.shuffleArray}>Shuffle Array</Button>
<Spacer />
</Toolbar>
<div>
{options.useExtension ? (
<a href={`${ROOT}`} style={styles.link}>
Disable browser extension
</a>
) : (
<a href={`${ROOT}?ext`} style={styles.link}>
Use browser extension
</a>
)}
</div>
</div>
);
}
toggleTimeoutUpdate = () => {
const enabled = !this.props.timeoutUpdateEnabled;
this.props.toggleTimeoutUpdate(enabled);
const toggleTimeoutUpdate = () => {
const enabled = !props.timeoutUpdateEnabled;
props.toggleTimeoutUpdate(enabled);
if (enabled) {
this.timeout = window.setInterval(this.props.timeoutUpdate, 1000);
timeout.current = window.setInterval(props.timeoutUpdate, 1000);
} else {
clearTimeout(this.timeout);
clearTimeout(timeout.current);
}
};
return (
<div style={styles.wrapper}>
<h3>{pkg.name || <span style={styles.muted}>Package Name</span>}</h3>
<h5>
{pkg.description || (
<span style={styles.muted}>Package Description</span>
)}
</h5>
<Toolbar>
<Spacer />
<Button onClick={props.increment}>Increment</Button>
<Button onClick={props.push}>Push</Button>
<Button onClick={props.pop}>Pop</Button>
<Button onClick={props.replace}>Replace</Button>
<Button onClick={props.changeNested}>Change Nested</Button>
<Spacer />
</Toolbar>
<Toolbar>
<Spacer />
<Button onClick={props.pushHugeArray}>Push Huge Array</Button>
<Button onClick={props.addHugeObject}>Add Huge Object</Button>
<Button onClick={props.hugePayload}>Huge Payload</Button>
<Spacer />
</Toolbar>
<Toolbar>
<Spacer />
<Button onClick={props.addIterator}>Add Iterator</Button>
<Button onClick={props.addImmutableMap}>Add Immutable Map</Button>
<Button onClick={props.changeImmutableNested}>
Change Immutable Nested
</Button>
<Spacer />
</Toolbar>
<Toolbar>
<Spacer />
<Button onClick={props.addRecursive}>Add Recursive</Button>
<Button onClick={props.addFunction}>Add Function</Button>
<Button onClick={props.addSymbol}>Add Symbol</Button>
<Spacer />
</Toolbar>
<Toolbar>
<Spacer />
<Button onClick={toggleTimeoutUpdate}>
Timeout Update {props.timeoutUpdateEnabled ? 'On' : 'Off'}
</Button>
<Button onClick={props.shuffleArray}>Shuffle Array</Button>
<Spacer />
</Toolbar>
<div>
{options.useExtension ? (
<a href={`${ROOT}`} style={styles.link}>
Disable browser extension
</a>
) : (
<a href={`${ROOT}?ext`} style={styles.link}>
Use browser extension
</a>
)}
</div>
</div>
);
}
export default connect((state: DemoAppState) => state, {
@ -180,5 +177,4 @@ export default connect((state: DemoAppState) => state, {
addFunction: (): AddFunctionAction => ({ type: 'ADD_FUNCTION' }),
addSymbol: (): AddSymbolAction => ({ type: 'ADD_SYMBOL' }),
shuffleArray: (): ShuffleArrayAction => ({ type: 'SHUFFLE_ARRAY' }),
pushRoute,
})(DemoApp);

View File

@ -1,5 +1,4 @@
import React from 'react';
import { connect } from 'react-redux';
import { createDevTools } from '@redux-devtools/core';
import {
InspectorMonitor,
@ -7,10 +6,9 @@ import {
Tab,
} from '@redux-devtools/inspector-monitor';
import { DockMonitor } from '@redux-devtools/dock-monitor';
import { Location } from 'history';
import { useLocation } from 'react-router-dom';
import getOptions from './getOptions';
import { TestTab } from '@redux-devtools/inspector-monitor-test-tab';
import { DemoAppState } from './reducers';
import { Action } from 'redux';
export const getDevTools = (location: { search: string }) =>
@ -38,13 +36,8 @@ export const getDevTools = (location: { search: string }) =>
</DockMonitor>
);
const UnconnectedDevTools = ({ location }: { location: Location }) => {
export function ConnectedDevTools() {
const location = useLocation();
const DevTools = getDevTools(location);
return <DevTools />;
};
const mapStateToProps = (state: DemoAppState) => ({
location: state.router.location,
});
export const ConnectedDevTools = connect(mapStateToProps)(UnconnectedDevTools);
}

View File

@ -9,12 +9,12 @@ export default function getOptions(location: { search: string }) {
return {
useExtension: location.search.indexOf('ext') !== -1,
supportImmutable: location.search.indexOf('immutable') !== -1,
theme: getTheme(),
theme: getTheme(location),
dark: location.search.indexOf('dark') !== -1,
};
}
function getTheme() {
function getTheme(location: { search: string }) {
const match = /theme=([^&]+)/.exec(location.search);
return match ? match[1] : 'inspector';
}

View File

@ -1,5 +1,5 @@
import React from 'react';
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import { Container } from '@redux-devtools/ui';
import { Provider } from 'react-redux';
import {
@ -10,12 +10,10 @@ import {
StoreEnhancerStoreCreator,
} from 'redux';
import logger from 'redux-logger';
import { Route } from 'react-router';
import { createBrowserHistory } from 'history';
import { ConnectedRouter, routerMiddleware } from 'connected-react-router';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import { persistState } from '@redux-devtools/core';
import DemoApp from './DemoApp';
import createRootReducer from './reducers';
import { rootReducer } from './reducers';
import getOptions from './getOptions';
import { ConnectedDevTools, getDevTools } from './DevTools';
@ -31,14 +29,12 @@ const ROOT =
const DevTools = getDevTools(window.location);
const history = createBrowserHistory();
const useDevtoolsExtension =
!!(window as unknown as { __REDUX_DEVTOOLS_EXTENSION__: unknown }) &&
getOptions(window.location).useExtension;
const enhancer = compose(
applyMiddleware(logger, routerMiddleware(history)),
applyMiddleware(logger),
(next: StoreEnhancerStoreCreator) => {
const instrument = useDevtoolsExtension
? (
@ -52,11 +48,12 @@ const enhancer = compose(
persistState(getDebugSessionKey())
);
const store = createStore(createRootReducer(history), enhancer);
const store = createStore(rootReducer, enhancer);
render(
const root = createRoot(document.getElementById('root')!);
root.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<BrowserRouter>
<Container
themeData={{
theme: 'default',
@ -64,12 +61,11 @@ render(
colorPreference: 'auto',
}}
>
<Route path={ROOT}>
<DemoApp />
</Route>
<Routes>
<Route path={ROOT} element={<DemoApp />} />
</Routes>
{!useDevtoolsExtension && <ConnectedDevTools />}
</Container>
</ConnectedRouter>
</Provider>,
document.getElementById('root')
</BrowserRouter>
</Provider>
);

View File

@ -1,12 +1,6 @@
import Immutable from 'immutable';
import shuffle from 'lodash.shuffle';
import { combineReducers, Reducer } from 'redux';
import {
connectRouter,
LocationChangeAction,
RouterState,
} from 'connected-react-router';
import { History } from 'history';
type Nested = { long: { nested: { path: { to: { a: string } } }[] } };
@ -139,11 +133,9 @@ type DemoAppAction =
| HugePayloadAction
| AddFunctionAction
| AddSymbolAction
| ShuffleArrayAction
| LocationChangeAction;
| ShuffleArrayAction;
export interface DemoAppState {
router: RouterState;
timeoutUpdateEnabled: boolean;
store: number;
undefined: { val: undefined };
@ -162,11 +154,8 @@ export interface DemoAppState {
shuffleArray: unknown[];
}
const createRootReducer = (
history: History
): Reducer<DemoAppState, DemoAppAction> =>
export const rootReducer: Reducer<DemoAppState, DemoAppAction> =
combineReducers<DemoAppState, DemoAppAction>({
router: connectRouter(history) as Reducer<RouterState, DemoAppAction>,
timeoutUpdateEnabled: (state = false, action) =>
action.type === 'TOGGLE_TIMEOUT_UPDATE'
? action.timeoutUpdateEnabled
@ -231,5 +220,3 @@ const createRootReducer = (
shuffleArray: (state = DEFAULT_SHUFFLE_ARRAY, action) =>
action.type === 'SHUFFLE_ARRAY' ? shuffle(state) : state,
});
export default createRootReducer;

View File

@ -1,6 +1,6 @@
{
"name": "@redux-devtools/inspector-monitor-test-tab",
"version": "0.8.5",
"version": "1.0.0",
"description": "Generate tests for redux devtools.",
"keywords": [
"redux",
@ -31,7 +31,7 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -39,58 +39,58 @@
"test": "jest",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@redux-devtools/ui": "^1.2.1",
"@types/prop-types": "^15.7.4",
"@babel/runtime": "^7.18.3",
"@redux-devtools/ui": "^1.3.0",
"@types/prop-types": "^15.7.5",
"es6template": "^1.0.5",
"javascript-stringify": "^2.1.0",
"jsan": "^3.1.14",
"object-path": "^0.11.8",
"prop-types": "^15.8.1",
"react-icons": "^4.3.1",
"react-icons": "^4.4.0",
"simple-diff": "^1.6.0"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@redux-devtools/core": "^3.11.0",
"@redux-devtools/inspector-monitor": "^2.1.0",
"@testing-library/react": "^12.1.4",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@redux-devtools/core": "^3.13.0",
"@redux-devtools/inspector-monitor": "^3.0.0",
"@testing-library/react": "^13.3.0",
"@types/es6template": "^1.0.0",
"@types/jest": "^27.4.1",
"@types/jest": "^27.5.2",
"@types/jsan": "^3.1.2",
"@types/object-path": "^0.11.1",
"@types/react": "^17.0.43",
"@types/react": "^18.0.14",
"@types/simple-diff": "^1.6.1",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^27.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"redux": "^4.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"redux": "^4.2.0",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.4",
"typescript": "~4.5.5"
"ts-jest": "^27.1.5",
"typescript": "~4.7.4"
},
"peerDependencies": {
"@redux-devtools/inspector-monitor": "^2.0.0",
"@types/react": "^16.3.0 || ^17.0.0",
"@types/styled-components": "^5.1.24",
"react": "^16.3.0 || ^17.0.0",
"@redux-devtools/inspector-monitor": "^3.0.0",
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"@types/styled-components": "^5.1.25",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"redux": "^3.4.0 || ^4.0.0",
"styled-components": "^5.3.5"
}

View File

@ -1,5 +1,22 @@
# Change Log
## 1.0.0
### Minor Changes
- 8a7eae4: Add React 18 to peerDependencies range
### Patch Changes
- Updated dependencies [8a7eae4]
- @redux-devtools/inspector-monitor@3.0.0
## 0.3.4
### Patch Changes
- @redux-devtools/inspector-monitor@3.0.0
## 0.3.0
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):

View File

@ -1,6 +1,6 @@
{
"name": "@redux-devtools/inspector-monitor-trace-tab",
"version": "0.3.3",
"version": "1.0.0",
"description": "Submonitor for Redux DevTools inspector to show stack traces.",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-inspector-monitor-trace-tab",
"license": "MIT",
@ -18,7 +18,7 @@
"sideEffects": false,
"repository": "https://github.com/reduxjs/redux-devtools",
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -26,13 +26,13 @@
"test": "jest",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/code-frame": "^7.16.7",
"@babel/runtime": "^7.17.8",
"@types/chrome": "^0.0.180",
"@babel/runtime": "^7.18.3",
"@types/chrome": "^0.0.191",
"anser": "^2.1.1",
"html-entities": "^2.3.3",
"path-browserify": "^1.0.1",
@ -40,44 +40,44 @@
"source-map": "^0.5.7"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@redux-devtools/core": "^3.11.0",
"@redux-devtools/inspector-monitor": "^2.1.0",
"@testing-library/react": "^12.1.4",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@redux-devtools/core": "^3.13.0",
"@redux-devtools/inspector-monitor": "^3.0.0",
"@testing-library/react": "^13.3.0",
"@types/babel__code-frame": "^7.0.3",
"@types/html-entities": "^1.3.4",
"@types/jest": "^27.4.1",
"@types/node": "^16.11.26",
"@types/jest": "^27.5.2",
"@types/node": "^16.11.41",
"@types/path-browserify": "^1.0.0",
"@types/react": "^17.0.43",
"@types/react": "^18.0.14",
"@types/redux-devtools-themes": "^1.0.0",
"@types/source-map": "0.5.2",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^27.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-test-renderer": "^17.0.2",
"redux": "^4.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0",
"redux": "^4.2.0",
"rimraf": "^3.0.2",
"ts-jest": "^27.1.4",
"typescript": "~4.5.5"
"ts-jest": "^27.1.5",
"typescript": "~4.7.4"
},
"peerDependencies": {
"@redux-devtools/inspector-monitor": "^2.0.0",
"@types/react": "^16.3.0 || ^17.0.0",
"react": "^16.3.0 || ^17.0.0",
"@redux-devtools/inspector-monitor": "^3.0.0",
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"redux": "^3.4.0 || ^4.0.0"
}
}

View File

@ -128,7 +128,7 @@ export default function openFile(
'confirm("Set the editor to open the file in?")',
(result) => {
if (!result) return;
chrome.runtime.sendMessage({ type: 'OPEN_OPTIONS' });
void chrome.runtime.sendMessage({ type: 'OPEN_OPTIONS' });
}
);
} else if (confirm('Set the editor to open the file in?')) {

View File

@ -1,5 +1,5 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { render, screen, waitFor } from '@testing-library/react';
import { TraceTab } from '../src/StackTraceTab';
const actions = {
@ -42,7 +42,10 @@ describe('StackTraceTab component', () => {
const { container } = render(
<TraceTabAsAny actions={actions} action={actions[2].action} />
);
await screen.findByTestId('stack-trace');
const stackTraceDiv = await screen.findByTestId('stack-trace');
await waitFor(() =>
expect(stackTraceDiv.querySelector('div')).toBeTruthy()
);
expect(container.firstChild).toMatchSnapshot();
});
});

View File

@ -1,5 +1,32 @@
# Change Log
## 3.0.1
### Patch Changes
- a55ba302: Fix peer dependencies on @redux-devtools/core
- Updated dependencies [a55ba302]
- @redux-devtools/core@3.13.1
## 3.0.0
### Minor Changes
- 8a7eae4: Add React 18 to peerDependencies range
### Patch Changes
- Updated dependencies [8a7eae4]
- react-json-tree@0.17.0
- @redux-devtools/core@3.13.0
## 2.1.2
### Patch Changes
- Updated dependencies [4891bf6]
- @redux-devtools/core@3.12.0
## 2.1.1
### Patch Changes

View File

@ -0,0 +1,19 @@
# inspector-demo
## 0.1.7
### Patch Changes
- Updated dependencies [8a7eae4]
- @redux-devtools/dock-monitor@3.0.0
- @redux-devtools/inspector-monitor@3.0.0
- @redux-devtools/core@3.13.0
## 0.1.6
### Patch Changes
- Updated dependencies [4891bf6]
- @redux-devtools/core@3.12.0
- @redux-devtools/dock-monitor@2.1.1
- @redux-devtools/inspector-monitor@2.1.2

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "inspector-demo",
"version": "0.1.5",
"version": "0.1.7",
"license": "MIT",
"scripts": {
"start": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack serve --open",
@ -10,51 +10,46 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@redux-devtools/core": "^3.11.0",
"@redux-devtools/dock-monitor": "^2.1.0",
"@redux-devtools/inspector-monitor": "^2.1.0",
"@redux-devtools/core": "^3.13.0",
"@redux-devtools/dock-monitor": "^3.0.0",
"@redux-devtools/inspector-monitor": "^3.0.0",
"base16": "^1.0.0",
"connected-react-router": "^6.9.2",
"history": "^4.10.1",
"immutable": "^4.0.0",
"immutable": "^4.1.0",
"lodash.shuffle": "^4.2.0",
"react": "^17.0.2",
"react-bootstrap": "^2.2.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.8",
"react-router": "^5.2.1",
"redux": "^4.1.2",
"react": "^18.2.0",
"react-bootstrap": "^2.4.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"redux": "^4.2.0",
"redux-logger": "^3.0.6"
},
"devDependencies": {
"@babel/core": "^7.17.8",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@babel/core": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@types/base16": "^1.0.2",
"@types/history": "^4.7.11",
"@types/lodash.shuffle": "^4.2.6",
"@types/node": "^16.11.26",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"@types/react-redux": "^7.1.23",
"@types/react-router": "^5.1.18",
"@types/lodash.shuffle": "^4.2.7",
"@types/node": "^16.11.41",
"@types/react": "^18.0.14",
"@types/react-dom": "^18.0.5",
"@types/redux-logger": "^3.0.9",
"@types/webpack-env": "^1.16.3",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"babel-loader": "^8.2.4",
"@types/webpack-env": "^1.17.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"babel-loader": "^8.2.5",
"cross-env": "^7.0.3",
"eslint": "^8.12.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"fork-ts-checker-webpack-plugin": "^7.2.2",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"html-webpack-plugin": "^5.5.0",
"ts-node": "^10.7.0",
"typescript": "~4.5.5",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
"ts-node": "^10.8.1",
"typescript": "~4.7.4",
"webpack": "^5.73.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2"
}
}

View File

@ -1,4 +1,4 @@
import React, { CSSProperties } from 'react';
import React, { CSSProperties, useRef } from 'react';
import { connect } from 'react-redux';
import pkg from '@redux-devtools/inspector-monitor/package.json';
import Button from 'react-bootstrap/Button';
@ -10,9 +10,8 @@ import Col from 'react-bootstrap/Col';
import InputGroup from 'react-bootstrap/InputGroup';
import Row from 'react-bootstrap/Row';
import * as base16 from 'base16';
import { push as pushRoute } from 'connected-react-router';
import { Path } from 'history';
import { inspectorThemes } from '@redux-devtools/inspector-monitor';
import { useLocation, useNavigate } from 'react-router-dom';
import getOptions, { Options } from './getOptions';
import {
AddFunctionAction,
@ -140,132 +139,15 @@ interface Props
addFunction: () => void;
addSymbol: () => void;
shuffleArray: () => void;
pushRoute: (path: Path) => void;
}
class DemoApp extends React.Component<Props> {
timeout?: number;
function DemoApp(props: Props) {
const timeout = useRef<number | undefined>();
const location = useLocation();
const navigate = useNavigate();
render() {
const options = getOptions(this.props.router.location);
return (
<div style={styles.wrapper}>
<h1 style={styles.header}>
{pkg.name || <span style={styles.muted}>Package Name</span>}
</h1>
<h5>
{pkg.description || (
<span style={styles.muted}>Package Description</span>
)}
</h5>
<div style={styles.links}>
<div style={styles.input}>
<Form>
<FormGroup as={Row}>
<Col as={FormLabel} sm={3}>
Theme:
</Col>
<Col sm={9}>
<InputGroup>
<FormControl
as="select"
onChange={(event) =>
this.setTheme(options, event.currentTarget.value)
}
>
{themeOptions.map((theme) => (
<option
key={(theme && theme.label) || 'empty'}
label={(theme && theme.label) || '──────────'}
value={theme ? theme.value : undefined}
disabled={!theme}
/>
))}
</FormControl>
<a onClick={this.toggleTheme} style={styles.link}>
{options.dark ? 'Light theme' : 'Dark theme'}
</a>
</InputGroup>
</Col>
</FormGroup>
</Form>
</div>
</div>
<div style={styles.content}>
<div style={styles.buttons}>
<Button onClick={this.props.increment} style={styles.button}>
Increment
</Button>
<Button onClick={this.props.push} style={styles.button}>
Push
</Button>
<Button onClick={this.props.pop} style={styles.button}>
Pop
</Button>
<Button onClick={this.props.replace} style={styles.button}>
Replace
</Button>
<Button onClick={this.props.changeNested} style={styles.button}>
Change Nested
</Button>
<Button onClick={this.props.pushHugeArray} style={styles.button}>
Push Huge Array
</Button>
<Button onClick={this.props.addHugeObject} style={styles.button}>
Add Huge Object
</Button>
<Button onClick={this.props.addIterator} style={styles.button}>
Add Iterator
</Button>
<Button onClick={this.props.addRecursive} style={styles.button}>
Add Recursive
</Button>
<Button onClick={this.props.addNativeMap} style={styles.button}>
Add Native Map
</Button>
<Button onClick={this.props.addImmutableMap} style={styles.button}>
Add Immutable Map
</Button>
<Button
onClick={this.props.changeImmutableNested}
style={styles.button}
>
Change Immutable Nested
</Button>
<Button onClick={this.props.hugePayload} style={styles.button}>
Huge Payload
</Button>
<Button onClick={this.props.addFunction} style={styles.button}>
Add Function
</Button>
<Button onClick={this.props.addSymbol} style={styles.button}>
Add Symbol
</Button>
<Button onClick={this.toggleTimeoutUpdate} style={styles.button}>
Timeout Update {this.props.timeoutUpdateEnabled ? 'On' : 'Off'}
</Button>
<Button onClick={this.props.shuffleArray} style={styles.button}>
Shuffle Array
</Button>
</div>
</div>
<div style={styles.links}>
<a onClick={this.toggleExtension} style={styles.link}>
{(options.useExtension ? 'Disable' : 'Enable') +
' Chrome Extension (will reload this page)'}
</a>
<a onClick={this.toggleImmutableSupport} style={styles.link}>
{(options.supportImmutable ? 'Disable' : 'Enable') +
' Full Immutable Support'}
</a>
</div>
</div>
);
}
toggleExtension = () => {
const options = getOptions(this.props.router.location);
const toggleExtension = () => {
const options = getOptions(location);
window.location.href = buildUrl({
...options,
@ -273,34 +155,147 @@ class DemoApp extends React.Component<Props> {
});
};
toggleImmutableSupport = () => {
const options = getOptions(this.props.router.location);
const toggleImmutableSupport = () => {
const options = getOptions(location);
this.props.pushRoute(
navigate(
buildUrl({ ...options, supportImmutable: !options.supportImmutable })
);
};
toggleTheme = () => {
const options = getOptions(this.props.router.location);
const toggleTheme = () => {
const options = getOptions(location);
this.props.pushRoute(buildUrl({ ...options, dark: !options.dark }));
navigate(buildUrl({ ...options, dark: !options.dark }));
};
setTheme = (options: Options, theme: string) => {
this.props.pushRoute(buildUrl({ ...options, theme }));
const setTheme = (options: Options, theme: string) => {
navigate(buildUrl({ ...options, theme }));
};
toggleTimeoutUpdate = () => {
const enabled = !this.props.timeoutUpdateEnabled;
this.props.toggleTimeoutUpdate(enabled);
const toggleTimeoutUpdate = () => {
const enabled = !props.timeoutUpdateEnabled;
props.toggleTimeoutUpdate(enabled);
if (enabled) {
this.timeout = window.setInterval(this.props.timeoutUpdate, 1000);
timeout.current = window.setInterval(props.timeoutUpdate, 1000);
} else {
clearTimeout(this.timeout);
clearTimeout(timeout.current);
}
};
const options = getOptions(location);
return (
<div style={styles.wrapper}>
<h1 style={styles.header}>
{pkg.name || <span style={styles.muted}>Package Name</span>}
</h1>
<h5>
{pkg.description || (
<span style={styles.muted}>Package Description</span>
)}
</h5>
<div style={styles.links}>
<div style={styles.input}>
<Form>
<FormGroup as={Row}>
<Col as={FormLabel} sm={3}>
Theme:
</Col>
<Col sm={9}>
<InputGroup>
<FormControl
as="select"
onChange={(event) =>
setTheme(options, event.currentTarget.value)
}
>
{themeOptions.map((theme) => (
<option
key={(theme && theme.label) || 'empty'}
label={(theme && theme.label) || '──────────'}
value={theme ? theme.value : undefined}
disabled={!theme}
/>
))}
</FormControl>
<a onClick={toggleTheme} style={styles.link}>
{options.dark ? 'Light theme' : 'Dark theme'}
</a>
</InputGroup>
</Col>
</FormGroup>
</Form>
</div>
</div>
<div style={styles.content}>
<div style={styles.buttons}>
<Button onClick={props.increment} style={styles.button}>
Increment
</Button>
<Button onClick={props.push} style={styles.button}>
Push
</Button>
<Button onClick={props.pop} style={styles.button}>
Pop
</Button>
<Button onClick={props.replace} style={styles.button}>
Replace
</Button>
<Button onClick={props.changeNested} style={styles.button}>
Change Nested
</Button>
<Button onClick={props.pushHugeArray} style={styles.button}>
Push Huge Array
</Button>
<Button onClick={props.addHugeObject} style={styles.button}>
Add Huge Object
</Button>
<Button onClick={props.addIterator} style={styles.button}>
Add Iterator
</Button>
<Button onClick={props.addRecursive} style={styles.button}>
Add Recursive
</Button>
<Button onClick={props.addNativeMap} style={styles.button}>
Add Native Map
</Button>
<Button onClick={props.addImmutableMap} style={styles.button}>
Add Immutable Map
</Button>
<Button onClick={props.changeImmutableNested} style={styles.button}>
Change Immutable Nested
</Button>
<Button onClick={props.hugePayload} style={styles.button}>
Huge Payload
</Button>
<Button onClick={props.addFunction} style={styles.button}>
Add Function
</Button>
<Button onClick={props.addSymbol} style={styles.button}>
Add Symbol
</Button>
<Button onClick={toggleTimeoutUpdate} style={styles.button}>
Timeout Update {props.timeoutUpdateEnabled ? 'On' : 'Off'}
</Button>
<Button onClick={props.shuffleArray} style={styles.button}>
Shuffle Array
</Button>
</div>
</div>
<div style={styles.links}>
<a onClick={toggleExtension} style={styles.link}>
{(options.useExtension ? 'Disable' : 'Enable') +
' Chrome Extension (will reload this page)'}
</a>
<a onClick={toggleImmutableSupport} style={styles.link}>
{(options.supportImmutable ? 'Disable' : 'Enable') +
' Full Immutable Support'}
</a>
</div>
</div>
);
}
export default connect((state: DemoAppState) => state, {
@ -332,5 +327,4 @@ export default connect((state: DemoAppState) => state, {
addFunction: (): AddFunctionAction => ({ type: 'ADD_FUNCTION' }),
addSymbol: (): AddSymbolAction => ({ type: 'ADD_SYMBOL' }),
shuffleArray: (): ShuffleArrayAction => ({ type: 'SHUFFLE_ARRAY' }),
pushRoute,
})(DemoApp);

View File

@ -1,14 +1,12 @@
import React from 'react';
import { connect } from 'react-redux';
import { createDevTools } from '@redux-devtools/core';
import { DockMonitor } from '@redux-devtools/dock-monitor';
import { Location } from 'history';
import {
InspectorMonitor,
base16Themes,
} from '@redux-devtools/inspector-monitor';
import { useLocation } from 'react-router-dom';
import getOptions from './getOptions';
import { DemoAppState } from './reducers';
const CustomComponent = () => (
<div
@ -48,13 +46,8 @@ export const getDevTools = (location: { search: string }) =>
</DockMonitor>
);
const UnconnectedDevTools = ({ location }: { location: Location }) => {
export function ConnectedDevTools() {
const location = useLocation();
const DevTools = getDevTools(location);
return <DevTools />;
};
const mapStateToProps = (state: DemoAppState) => ({
location: state.router.location,
});
export const ConnectedDevTools = connect(mapStateToProps)(UnconnectedDevTools);
}

View File

@ -9,12 +9,12 @@ export default function getOptions(location: { search: string }) {
return {
useExtension: location.search.indexOf('ext') !== -1,
supportImmutable: location.search.indexOf('immutable') !== -1,
theme: getTheme(),
theme: getTheme(location),
dark: location.search.indexOf('dark') !== -1,
};
}
function getTheme() {
function getTheme(location: { search: string }) {
const match = /theme=([^&]+)/.exec(location.search);
return match ? match[1] : 'inspector';
}

View File

@ -1,5 +1,5 @@
import React from 'react';
import { render } from 'react-dom';
import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';
import {
createStore,
@ -9,12 +9,10 @@ import {
StoreEnhancer,
} from 'redux';
import logger from 'redux-logger';
import { Route } from 'react-router';
import { createBrowserHistory } from 'history';
import { ConnectedRouter, routerMiddleware } from 'connected-react-router';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import { persistState } from '@redux-devtools/core';
import DemoApp from './DemoApp';
import createRootReducer from './reducers';
import { rootReducer } from './reducers';
import getOptions from './getOptions';
import { ConnectedDevTools, getDevTools } from './DevTools';
@ -30,14 +28,12 @@ const ROOT =
const DevTools = getDevTools(window.location);
const history = createBrowserHistory();
const useDevtoolsExtension =
!!(window as unknown as { __REDUX_DEVTOOLS_EXTENSION__: unknown })
.__REDUX_DEVTOOLS_EXTENSION__ && getOptions(window.location).useExtension;
const enhancer = compose(
applyMiddleware(logger, routerMiddleware(history)),
applyMiddleware(logger),
(next: StoreEnhancerStoreCreator) => {
const instrument = useDevtoolsExtension
? (
@ -51,16 +47,16 @@ const enhancer = compose(
persistState(getDebugSessionKey())
);
const store = createStore(createRootReducer(history), enhancer);
const store = createStore(rootReducer, enhancer);
render(
const root = createRoot(document.getElementById('root')!);
root.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<Route path={ROOT}>
<DemoApp />
</Route>
<BrowserRouter>
<Routes>
<Route path={ROOT} element={<DemoApp />} />
</Routes>
{!useDevtoolsExtension && <ConnectedDevTools />}
</ConnectedRouter>
</Provider>,
document.getElementById('root')
</BrowserRouter>
</Provider>
);

View File

@ -1,12 +1,6 @@
import Immutable from 'immutable';
import shuffle from 'lodash.shuffle';
import { combineReducers, Reducer } from 'redux';
import {
connectRouter,
LocationChangeAction,
RouterState,
} from 'connected-react-router';
import { History } from 'history';
type Nested = { long: { nested: { path: { to: { a: string } } }[] } };
@ -168,11 +162,9 @@ type DemoAppAction =
| HugePayloadAction
| AddFunctionAction
| AddSymbolAction
| ShuffleArrayAction
| LocationChangeAction;
| ShuffleArrayAction;
export interface DemoAppState {
router: RouterState;
timeoutUpdateEnabled: boolean;
store: number;
undefined: { val: undefined };
@ -192,11 +184,8 @@ export interface DemoAppState {
shuffleArray: unknown[];
}
const createRootReducer = (
history: History
): Reducer<DemoAppState, DemoAppAction> =>
export const rootReducer: Reducer<DemoAppState, DemoAppAction> =
combineReducers<DemoAppState, DemoAppAction>({
router: connectRouter(history) as Reducer<RouterState, DemoAppAction>,
timeoutUpdateEnabled: (state = false, action) =>
action.type === 'TOGGLE_TIMEOUT_UPDATE'
? action.timeoutUpdateEnabled
@ -263,5 +252,3 @@ const createRootReducer = (
shuffleArray: (state = DEFAULT_SHUFFLE_ARRAY, action) =>
action.type === 'SHUFFLE_ARRAY' ? shuffle(state) : state,
});
export default createRootReducer;

View File

@ -1,6 +1,6 @@
{
"name": "@redux-devtools/inspector-monitor",
"version": "2.1.1",
"version": "3.0.1",
"description": "Redux DevTools Diff Monitor",
"homepage": "https://github.com/reduxjs/redux-devtools/tree/master/packages/redux-devtools-inspector-monitor",
"bugs": {
@ -24,24 +24,24 @@
"url": "https://github.com/reduxjs/redux-devtools"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
"clean": "rimraf lib",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@babel/runtime": "^7.18.3",
"@types/dragula": "^3.7.1",
"@types/lodash": "^4.14.181",
"@types/prop-types": "^15.7.4",
"@types/lodash": "^4.14.182",
"@types/prop-types": "^15.7.5",
"dateformat": "^4.6.3",
"hex-rgba": "^1.0.2",
"immutable": "^4.0.0",
"immutable": "^4.1.0",
"javascript-stringify": "^2.1.0",
"jsondiffpatch": "^0.4.1",
"jss": "^10.9.0",
@ -50,40 +50,40 @@
"prop-types": "^15.8.1",
"react-base16-styling": "^0.9.1",
"react-dragula": "^1.1.17",
"react-json-tree": "^0.16.1",
"react-json-tree": "^0.17.0",
"redux-devtools-themes": "^1.0.0"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@redux-devtools/core": "^3.11.0",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@redux-devtools/core": "^3.13.1",
"@types/dateformat": "^3.0.1",
"@types/hex-rgba": "^1.0.1",
"@types/history": "^4.7.11",
"@types/lodash.debounce": "^4.0.6",
"@types/react": "^17.0.43",
"@types/lodash.debounce": "^4.0.7",
"@types/react": "^18.0.14",
"@types/react-dragula": "^1.1.0",
"@types/redux-devtools-themes": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"react": "^17.0.2",
"redux": "^4.1.2",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"react": "^18.2.0",
"redux": "^4.2.0",
"rimraf": "^3.0.2",
"typescript": "~4.5.5"
"typescript": "~4.7.4"
},
"peerDependencies": {
"@redux-devtools/core": "^3.7.0",
"@types/react": "^16.3.0 || ^17.0.0",
"react": "^16.3.0 || ^17.0.0",
"@redux-devtools/core": "^3.13.1",
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"redux": "^3.4.0 || ^4.0.0"
}
}

View File

@ -1,6 +1,7 @@
import React, { MouseEvent, MouseEventHandler, PureComponent } from 'react';
import PropTypes from 'prop-types';
import dateformat from 'dateformat';
import type { DebouncedFunc } from 'lodash';
import debounce from 'lodash.debounce';
import { StylingFunction } from 'react-base16-styling';
import { Action } from 'redux';
@ -179,12 +180,13 @@ export default class ActionListRow<
this.handleMouseEnterDebounced(e.buttons);
};
handleMouseEnterDebounced = debounce((buttons) => {
if (buttons) return;
this.setState({ hover: true });
}, 150);
handleMouseEnterDebounced: DebouncedFunc<(buttons: number) => void> =
debounce((buttons) => {
if (buttons) return;
this.setState({ hover: true });
}, 150);
handleMouseLeave = debounce(() => {
handleMouseLeave: DebouncedFunc<() => void> = debounce(() => {
this.handleMouseEnterDebounced.cancel();
if (this.state.hover) this.setState({ hover: false });
}, 100);

View File

@ -1,8 +1,9 @@
import jss, { StyleSheet } from 'jss';
import preset from 'jss-preset-default';
import { createStyling } from 'react-base16-styling';
import { createStyling, StylingFunction, Theme } from 'react-base16-styling';
import rgba from 'hex-rgba';
import { Base16Theme } from 'redux-devtools-themes';
import type { CurriedFunction1 } from 'lodash';
import inspector from '../themes/inspector';
import * as reduxThemes from 'redux-devtools-themes';
import * as inspectorThemes from '../themes';
@ -405,7 +406,10 @@ const getDefaultThemeStyling = (theme: Base16Theme) => {
export const base16Themes = { ...reduxThemes, ...inspectorThemes };
export const createStylingFromTheme = createStyling(getDefaultThemeStyling, {
export const createStylingFromTheme: CurriedFunction1<
Theme | undefined,
StylingFunction
> = createStyling(getDefaultThemeStyling, {
defaultBase16: inspector,
base16Themes,
});

View File

@ -29,7 +29,7 @@
"url": "https://github.com/reduxjs/redux-devtools.git"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
@ -37,34 +37,34 @@
"test": "jest",
"lint": "eslint . --ext .ts",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint && yarn run test"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint && pnpm run test"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@babel/runtime": "^7.18.3",
"lodash": "^4.17.21"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.181",
"@types/node": "^16.11.26",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.182",
"@types/node": "^16.11.41",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-jest": "^26.5.3",
"jest": "^27.5.1",
"redux": "^4.1.2",
"redux": "^4.2.0",
"rimraf": "^3.0.2",
"rxjs": "^7.5.5",
"ts-jest": "^27.1.4",
"typescript": "~4.5.5"
"ts-jest": "^27.1.5",
"typescript": "~4.7.4"
},
"peerDependencies": {
"redux": "^3.4.0 || ^4.0.0"

View File

@ -1,5 +1,32 @@
# Change Log
## 4.0.1
### Patch Changes
- a55ba302: Fix peer dependencies on @redux-devtools/core
- Updated dependencies [a55ba302]
- @redux-devtools/core@3.13.1
## 4.0.0
### Minor Changes
- 8a7eae4: Add React 18 to peerDependencies range
### Patch Changes
- Updated dependencies [8a7eae4]
- react-json-tree@0.17.0
- @redux-devtools/core@3.13.0
## 3.1.1
### Patch Changes
- Updated dependencies [4891bf6]
- @redux-devtools/core@3.12.0
## 3.0.0
- Adds ESM build (https://github.com/reduxjs/redux-devtools/pull/997) and switches the default export to a named export in order to ensure that the CommonJS output and the ESM output are [interchangeable](https://rollupjs.org/guide/en/#outputexports):

View File

@ -1,6 +1,6 @@
{
"name": "@redux-devtools/log-monitor",
"version": "3.1.0",
"version": "4.0.1",
"description": "The default tree view monitor for Redux DevTools",
"keywords": [
"redux",
@ -30,51 +30,51 @@
"url": "https://github.com/reduxjs/redux-devtools"
},
"scripts": {
"build": "yarn build:cjs && yarn build:esm && yarn build:types",
"build": "pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build:cjs": "babel src --extensions \".ts,.tsx\" --out-dir lib/cjs",
"build:esm": "babel src --config-file ./babel.config.esm.json --extensions \".ts,.tsx\" --out-dir lib/esm",
"build:types": "tsc --emitDeclarationOnly",
"clean": "rimraf lib",
"lint": "eslint . --ext .ts,.tsx",
"type-check": "tsc --noEmit",
"prepack": "yarn run clean && yarn run build",
"prepublish": "yarn run type-check && yarn run lint"
"prepack": "pnpm run clean && pnpm run build",
"prepublish": "pnpm run type-check && pnpm run lint"
},
"dependencies": {
"@babel/runtime": "^7.17.8",
"@types/lodash.debounce": "^4.0.6",
"@types/prop-types": "^15.7.4",
"@babel/runtime": "^7.18.3",
"@types/lodash.debounce": "^4.0.7",
"@types/prop-types": "^15.7.5",
"@types/redux-devtools-themes": "^1.0.0",
"lodash.debounce": "^4.0.8",
"prop-types": "^15.8.1",
"react-json-tree": "^0.16.1",
"react-json-tree": "^0.17.0",
"redux-devtools-themes": "^1.0.0"
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@redux-devtools/core": "^3.11.0",
"@types/react": "^17.0.43",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"eslint": "^8.12.0",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.5",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@babel/preset-typescript": "^7.17.12",
"@redux-devtools/core": "^3.13.1",
"@types/react": "^18.0.14",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "~7.28.0",
"eslint-plugin-react-hooks": "^4.4.0",
"react": "^17.0.2",
"redux": "^4.1.2",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"react": "^18.2.0",
"redux": "^4.2.0",
"rimraf": "^3.0.2",
"typescript": "~4.5.5"
"typescript": "~4.7.4"
},
"peerDependencies": {
"@redux-devtools/core": "^3.7.0",
"@types/react": "^16.3.0 || ^17.0.0",
"react": "^16.3.0 || ^17.0.0",
"@redux-devtools/core": "^3.13.1",
"@types/react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
"redux": "^3.4.0 || ^4.0.0"
}
}

View File

@ -1,4 +1,4 @@
import React, { CSSProperties } from 'react';
import React, { CSSProperties, ReactNode } from 'react';
import { Base16Theme } from 'redux-devtools-themes';
import brighten from './brighten';
@ -29,6 +29,7 @@ interface Props {
theme: Base16Theme;
onClick: () => void;
enabled: boolean;
children?: ReactNode;
}
export default class LogMonitorButton extends React.PureComponent<

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