Merge branch 'main' into renovate/react-monorepo

This commit is contained in:
Nathan Bierema 2021-09-07 03:40:24 +00:00 committed by GitHub
commit 421012f940
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 244 additions and 144 deletions

View File

@ -2,9 +2,9 @@ name: CI
on: on:
push: push:
branches: [master] branches: [main]
pull_request: pull_request:
branches: [master] branches: [main]
jobs: jobs:
build: build:

View File

@ -100,7 +100,7 @@ To specify [extensions options](https://github.com/zalmoxisus/redux-devtools-
const composeEnhancers = const composeEnhancers =
typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
// Specify extensions options like name, actionsBlacklist, actionsCreators, serialize... // Specify extensions options like name, actionsDenylist, actionsCreators, serialize...
}) })
: compose; : compose;
@ -143,7 +143,7 @@ import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension'; import { composeWithDevTools } from 'redux-devtools-extension';
const composeEnhancers = composeWithDevTools({ const composeEnhancers = composeWithDevTools({
// Specify name here, actionsBlacklist, actionsCreators and other options if needed // Specify name here, actionsDenylist, actionsCreators and other options if needed
}); });
const store = createStore( const store = createStore(
reducer, reducer,
@ -165,7 +165,7 @@ import { devToolsEnhancer } from 'redux-devtools-extension';
const store = createStore( const store = createStore(
reducer, reducer,
/* preloadedState, */ devToolsEnhancer() /* preloadedState, */ devToolsEnhancer()
// Specify name here, actionsBlacklist, actionsCreators and other options if needed // Specify name here, actionsDenylist, actionsCreators and other options if needed
); );
``` ```

View File

@ -240,9 +240,9 @@ const store = createStore(
); );
``` ```
### `actionsBlacklist` / `actionsWhitelist` ### `actionsDenylist` / `actionsAllowlist`
_string or array of strings as regex_ - actions types to be hidden / shown in the monitors (while passed to the reducers). If `actionsWhitelist` specified, `actionsBlacklist` is ignored. _string or array of strings as regex_ - actions types to be hidden / shown in the monitors (while passed to the reducers). If `actionsAllowlist` specified, `actionsDenylist` is ignored.
Example: Example:
@ -251,16 +251,16 @@ createStore(
reducer, reducer,
remotedev({ remotedev({
sendTo: 'http://localhost:8000', sendTo: 'http://localhost:8000',
actionsBlacklist: 'SOME_ACTION', actionsDenylist: 'SOME_ACTION',
// or actionsBlacklist: ['SOME_ACTION', 'SOME_OTHER_ACTION'] // or actionsDenylist: ['SOME_ACTION', 'SOME_OTHER_ACTION']
// or just actionsBlacklist: 'SOME_' to omit both // or just actionsDenylist: 'SOME_' to omit both
}) })
); );
``` ```
### `predicate` ### `predicate`
_function_ - called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor. Use it as a more advanced version of `actionsBlacklist`/`actionsWhitelist` parameters. _function_ - called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor. Use it as a more advanced version of `actionsDenylist`/`actionsAllowlist` parameters.
Example of usage: Example of usage:
```js ```js

View File

@ -65,13 +65,13 @@ const store = createStore(
/* preloadedState, */ compose( /* preloadedState, */ compose(
devToolsEnhancer({ devToolsEnhancer({
instaceID: 1, instaceID: 1,
name: 'Blacklisted', name: 'Denylisted',
actionsBlacklist: '...', actionsDenylist: '...',
}), }),
devToolsEnhancer({ devToolsEnhancer({
instaceID: 2, instaceID: 2,
name: 'Whitelisted', name: 'Allowlisted',
actionsWhitelist: '...', actionsAllowlist: '...',
}) })
) )
); );

View File

@ -5,13 +5,13 @@ import { LiftedState, PerformAction } from '@redux-devtools/instrument';
export type FilterStateValue = export type FilterStateValue =
| 'DO_NOT_FILTER' | 'DO_NOT_FILTER'
| 'BLACKLIST_SPECIFIC' | 'DENYLIST_SPECIFIC'
| 'WHITELIST_SPECIFIC'; | 'ALLOWLIST_SPECIFIC';
export const FilterState: { [K in FilterStateValue]: FilterStateValue } = { export const FilterState: { [K in FilterStateValue]: FilterStateValue } = {
DO_NOT_FILTER: 'DO_NOT_FILTER', DO_NOT_FILTER: 'DO_NOT_FILTER',
BLACKLIST_SPECIFIC: 'BLACKLIST_SPECIFIC', DENYLIST_SPECIFIC: 'DENYLIST_SPECIFIC',
WHITELIST_SPECIFIC: 'WHITELIST_SPECIFIC', ALLOWLIST_SPECIFIC: 'ALLOWLIST_SPECIFIC',
}; };
function isArray(arg: unknown): arg is readonly unknown[] { function isArray(arg: unknown): arg is readonly unknown[] {
@ -19,19 +19,17 @@ function isArray(arg: unknown): arg is readonly unknown[] {
} }
interface LocalFilter { interface LocalFilter {
readonly whitelist: string | undefined; readonly allowlist: string | undefined;
readonly blacklist: string | undefined; readonly denylist: string | undefined;
} }
export function getLocalFilter(config: Config): LocalFilter | undefined { export function getLocalFilter(config: Config): LocalFilter | undefined {
if (config.actionsBlacklist || config.actionsWhitelist) { const denylist = config.actionsDenylist ?? config.actionsBlacklist;
const allowlist = config.actionsAllowlist ?? config.actionsWhitelist;
if (denylist || allowlist) {
return { return {
whitelist: isArray(config.actionsWhitelist) allowlist: isArray(allowlist) ? allowlist.join('|') : allowlist,
? config.actionsWhitelist.join('|') denylist: isArray(denylist) ? denylist.join('|') : denylist,
: config.actionsWhitelist,
blacklist: isArray(config.actionsBlacklist)
? config.actionsBlacklist.join('|')
: config.actionsBlacklist,
}; };
} }
return undefined; return undefined;
@ -56,11 +54,11 @@ export function isFiltered<A extends Action<unknown>>(
return false; return false;
} }
const { whitelist, blacklist } = localFilter || window.devToolsOptions || {}; const { allowlist, denylist } = localFilter || window.devToolsOptions || {};
const actionType = ((action as A).type || action) as string; const actionType = ((action as A).type || action) as string;
return ( return (
(whitelist && !actionType.match(whitelist)) || (allowlist && !actionType.match(allowlist)) ||
(blacklist && actionType.match(blacklist)) (denylist && actionType.match(denylist))
); );
} }

View File

@ -3,6 +3,8 @@ import {
UPDATE_STATE, UPDATE_STATE,
REMOVE_INSTANCE, REMOVE_INSTANCE,
LIFTED_ACTION, LIFTED_ACTION,
TOGGLE_PERSIST,
SET_PERSIST,
} from '@redux-devtools/app/lib/constants/actionTypes'; } from '@redux-devtools/app/lib/constants/actionTypes';
import { nonReduxDispatch } from '@redux-devtools/app/lib/utils/monitorActions'; import { nonReduxDispatch } from '@redux-devtools/app/lib/utils/monitorActions';
import syncOptions, { import syncOptions, {
@ -18,8 +20,9 @@ import {
CustomAction, CustomAction,
DispatchAction as AppDispatchAction, DispatchAction as AppDispatchAction,
LibConfig, LibConfig,
SetPersistAction,
} from '@redux-devtools/app/lib/actions'; } from '@redux-devtools/app/lib/actions';
import { Action, Dispatch } from 'redux'; import { Action, Dispatch, MiddlewareAPI } from 'redux';
import { import {
ContentScriptToBackgroundMessage, ContentScriptToBackgroundMessage,
SplitMessage, SplitMessage,
@ -35,6 +38,7 @@ import {
LiftedActionAction, LiftedActionAction,
} from '../stores/backgroundStore'; } from '../stores/backgroundStore';
import { Position } from '../api/openWindow'; import { Position } from '../api/openWindow';
import { BackgroundState } from '../reducers/background';
interface TabMessageBase { interface TabMessageBase {
readonly type: string; readonly type: string;
@ -183,8 +187,13 @@ export type TabMessage =
export type PanelMessage<S, A extends Action<unknown>> = export type PanelMessage<S, A extends Action<unknown>> =
| NAAction | NAAction
| ErrorMessage | ErrorMessage
| UpdateStateAction<S, A>; | UpdateStateAction<S, A>
export type MonitorMessage = NAAction | ErrorMessage | EmptyUpdateStateAction; | SetPersistAction;
export type MonitorMessage =
| NAAction
| ErrorMessage
| EmptyUpdateStateAction
| SetPersistAction;
type TabPort = Omit<chrome.runtime.Port, 'postMessage'> & { type TabPort = Omit<chrome.runtime.Port, 'postMessage'> & {
postMessage: (message: TabMessage) => void; postMessage: (message: TabMessage) => void;
@ -224,7 +233,8 @@ const getId = (sender: chrome.runtime.MessageSender, name?: string) =>
type MonitorAction<S, A extends Action<unknown>> = type MonitorAction<S, A extends Action<unknown>> =
| NAAction | NAAction
| ErrorMessage | ErrorMessage
| UpdateStateAction<S, A>; | UpdateStateAction<S, A>
| SetPersistAction;
function toMonitors<S, A extends Action<unknown>>( function toMonitors<S, A extends Action<unknown>>(
action: MonitorAction<S, A>, action: MonitorAction<S, A>,
@ -233,7 +243,9 @@ function toMonitors<S, A extends Action<unknown>>(
) { ) {
Object.keys(connections.monitor).forEach((id) => { Object.keys(connections.monitor).forEach((id) => {
connections.monitor[id].postMessage( connections.monitor[id].postMessage(
verbose || action.type === 'ERROR' ? action : { type: UPDATE_STATE } verbose || action.type === 'ERROR' || action.type === SET_PERSIST
? action
: { type: UPDATE_STATE }
); );
}); });
Object.keys(connections.panel).forEach((id) => { Object.keys(connections.panel).forEach((id) => {
@ -582,9 +594,18 @@ declare global {
window.syncOptions = syncOptions(toAllTabs); // Expose to the options page window.syncOptions = syncOptions(toAllTabs); // Expose to the options page
export default function api() { export default function api(
store: MiddlewareAPI<Dispatch<BackgroundAction>, BackgroundState>
) {
return (next: Dispatch<BackgroundAction>) => (action: BackgroundAction) => { return (next: Dispatch<BackgroundAction>) => (action: BackgroundAction) => {
if (action.type === LIFTED_ACTION) toContentScript(action); if (action.type === LIFTED_ACTION) toContentScript(action);
else if (action.type === TOGGLE_PERSIST) {
togglePersist();
toMonitors({
type: SET_PERSIST,
payload: !store.getState().instances.persisted,
});
}
return next(action); return next(action);
}; };
} }

View File

@ -2,6 +2,7 @@ import {
LIFTED_ACTION, LIFTED_ACTION,
UPDATE_STATE, UPDATE_STATE,
SELECT_INSTANCE, SELECT_INSTANCE,
TOGGLE_PERSIST,
} from '@redux-devtools/app/lib/constants/actionTypes'; } from '@redux-devtools/app/lib/constants/actionTypes';
import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances'; import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances';
import { Dispatch, MiddlewareAPI } from 'redux'; import { Dispatch, MiddlewareAPI } from 'redux';
@ -23,7 +24,7 @@ function panelDispatcher(bgConnection: chrome.runtime.Port) {
next({ type: SELECT_INSTANCE, selected: connections[0] }); next({ type: SELECT_INSTANCE, selected: connections[0] });
} }
} }
if (action.type === LIFTED_ACTION) { if (action.type === LIFTED_ACTION || action.type === TOGGLE_PERSIST) {
const instances = store.getState().instances; const instances = store.getState().instances;
const instanceId = getActiveInstance(instances); const instanceId = getActiveInstance(instances);
const id = instances.options[instanceId].connectionId; const id = instances.options[instanceId].connectionId;

View File

@ -1,6 +1,7 @@
import { import {
UPDATE_STATE, UPDATE_STATE,
LIFTED_ACTION, LIFTED_ACTION,
TOGGLE_PERSIST,
} from '@redux-devtools/app/lib/constants/actionTypes'; } from '@redux-devtools/app/lib/constants/actionTypes';
import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances'; import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances';
import { Dispatch, MiddlewareAPI, Store } from 'redux'; import { Dispatch, MiddlewareAPI, Store } from 'redux';
@ -21,7 +22,7 @@ const syncStores =
instances: baseStore.getState().instances, instances: baseStore.getState().instances,
}); });
} }
if (action.type === LIFTED_ACTION) { if (action.type === LIFTED_ACTION || action.type === TOGGLE_PERSIST) {
const instances = store.getState().instances; const instances = store.getState().instances;
const instanceId = getActiveInstance(instances); const instanceId = getActiveInstance(instances);
const id = instances.options[instanceId].connectionId; const id = instances.options[instanceId].connectionId;

View File

@ -6,6 +6,7 @@ import {
UPDATE_STATE, UPDATE_STATE,
SELECT_INSTANCE, SELECT_INSTANCE,
LIFTED_ACTION, LIFTED_ACTION,
SET_PERSIST,
} from '@redux-devtools/app/lib/constants/actionTypes'; } from '@redux-devtools/app/lib/constants/actionTypes';
import { import {
ExpandedUpdateStateAction, ExpandedUpdateStateAction,
@ -27,6 +28,8 @@ export default function instances(
return state; return state;
case SELECT_INSTANCE: case SELECT_INSTANCE:
return { ...state, selected: action.selected }; return { ...state, selected: action.selected };
case SET_PERSIST:
return { ...state, persisted: action.payload };
default: default:
return state; return state;
} }

View File

@ -66,16 +66,13 @@ export default function configureStore(
); );
} }
const store = createStore(persistedReducer, enhancer); const store = createStore(persistedReducer, enhancer);
const persistor = persistStore(store); const persistor = persistStore(store, null, () => {
if (store.getState().connection.type !== 'disabled') {
if (
store.getState().connection.options.hostname &&
store.getState().connection.options.port
) {
store.dispatch({ store.dispatch({
type: CONNECT_REQUEST, type: CONNECT_REQUEST,
}); });
} }
});
return { store, persistor }; return { store, persistor };
} }

View File

@ -72,7 +72,7 @@ let reportId: string | null | undefined;
function deprecateParam(oldParam: string, newParam: string) { function deprecateParam(oldParam: string, newParam: string) {
/* eslint-disable no-console */ /* eslint-disable no-console */
console.warn( console.warn(
`${oldParam} parameter is deprecated, use ${newParam} instead: https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md` `${oldParam} parameter is deprecated, use ${newParam} instead: https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/API/Arguments.md`
); );
/* eslint-enable no-console */ /* eslint-enable no-console */
} }
@ -84,8 +84,16 @@ export interface SerializeWithImmutable extends Serialize {
export interface ConfigWithExpandedMaxAge { export interface ConfigWithExpandedMaxAge {
instanceId?: number; instanceId?: number;
/**
* @deprecated Use actionsDenylist instead.
*/
readonly actionsBlacklist?: string | readonly string[]; readonly actionsBlacklist?: string | readonly string[];
/**
* @deprecated Use actionsAllowlist instead.
*/
readonly actionsWhitelist?: string | readonly string[]; readonly actionsWhitelist?: string | readonly string[];
readonly actionsDenylist?: string | readonly string[];
readonly actionsAllowlist?: string | readonly string[];
serialize?: boolean | SerializeWithImmutable; serialize?: boolean | SerializeWithImmutable;
readonly serializeState?: readonly serializeState?:
| boolean | boolean
@ -213,6 +221,14 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<unknown>>(
latency = 500, latency = 500,
} = config; } = config;
// Deprecate actionsWhitelist and actionsBlacklist
if (config.actionsWhitelist) {
deprecateParam('actionsWhiteList', 'actionsAllowlist');
}
if (config.actionsBlacklist) {
deprecateParam('actionsBlacklist', 'actionsDenylist');
}
// Deprecate statesFilter and actionsFilter // Deprecate statesFilter and actionsFilter
if (statesFilter) { if (statesFilter) {
deprecateParam('statesFilter', 'stateSanitizer'); deprecateParam('statesFilter', 'stateSanitizer');

View File

@ -3,7 +3,7 @@
"name": "Redux DevTools", "name": "Redux DevTools",
"short_name": "Redux DevTools", "short_name": "Redux DevTools",
"description": "Redux DevTools for debugging application's state changes.", "description": "Redux DevTools for debugging application's state changes.",
"homepage_url": "https://github.com/zalmoxisus/redux-devtools-extension", "homepage_url": "https://github.com/reduxjs/redux-devtools",
"manifest_version": 2, "manifest_version": 2,
"page_action": { "page_action": {
"default_icon": "img/logo/gray.png", "default_icon": "img/logo/gray.png",

View File

@ -29,8 +29,8 @@ export default ({ options, saveOption }: OptionsProps) => {
id="filter-hide" id="filter-hide"
name="filter" name="filter"
type="radio" type="radio"
checked={options.filter === FilterState.BLACKLIST_SPECIFIC} checked={options.filter === FilterState.DENYLIST_SPECIFIC}
onChange={() => saveOption('filter', FilterState.BLACKLIST_SPECIFIC)} onChange={() => saveOption('filter', FilterState.DENYLIST_SPECIFIC)}
/> />
<label className="option__label" htmlFor="filter-hide"> <label className="option__label" htmlFor="filter-hide">
Hide the following: Hide the following:
@ -38,9 +38,9 @@ export default ({ options, saveOption }: OptionsProps) => {
<br /> <br />
<textarea <textarea
className="option__textarea" className="option__textarea"
value={options.blacklist} value={options.denylist}
disabled={options.filter !== FilterState.BLACKLIST_SPECIFIC} disabled={options.filter !== FilterState.DENYLIST_SPECIFIC}
onChange={(e) => saveOption('blacklist', e.target.value)} onChange={(e) => saveOption('denylist', e.target.value)}
/> />
<div className="option__hint">Each action from the new line</div> <div className="option__hint">Each action from the new line</div>
</div> </div>
@ -51,8 +51,8 @@ export default ({ options, saveOption }: OptionsProps) => {
id="filter-show" id="filter-show"
name="filter" name="filter"
type="radio" type="radio"
checked={options.filter === FilterState.WHITELIST_SPECIFIC} checked={options.filter === FilterState.ALLOWLIST_SPECIFIC}
onChange={() => saveOption('filter', FilterState.WHITELIST_SPECIFIC)} onChange={() => saveOption('filter', FilterState.ALLOWLIST_SPECIFIC)}
/> />
<label className="option__label" htmlFor="filter-show"> <label className="option__label" htmlFor="filter-show">
Show the following: Show the following:
@ -60,9 +60,9 @@ export default ({ options, saveOption }: OptionsProps) => {
<br /> <br />
<textarea <textarea
className="option__textarea" className="option__textarea"
value={options.whitelist} value={options.allowlist}
disabled={options.filter !== FilterState.WHITELIST_SPECIFIC} disabled={options.filter !== FilterState.ALLOWLIST_SPECIFIC}
onChange={(e) => saveOption('whitelist', e.target.value)} onChange={(e) => saveOption('allowlist', e.target.value)}
/> />
<div className="option__hint">Each action from the new line</div> <div className="option__hint">Each action from the new line</div>
</div> </div>

View File

@ -6,8 +6,8 @@ export interface Options {
readonly projectPath: string; readonly projectPath: string;
readonly maxAge: number; readonly maxAge: number;
readonly filter: FilterStateValue; readonly filter: FilterStateValue;
readonly whitelist: string; readonly allowlist: string;
readonly blacklist: string; readonly denylist: string;
readonly shouldCatchErrors: boolean; readonly shouldCatchErrors: boolean;
readonly inject: boolean; readonly inject: boolean;
readonly urls: string; readonly urls: string;
@ -19,7 +19,13 @@ interface OldOrNewOptions {
readonly editor: string; readonly editor: string;
readonly projectPath: string; readonly projectPath: string;
readonly maxAge: number; readonly maxAge: number;
readonly filter: FilterStateValue | boolean; readonly filter:
| FilterStateValue
| 'WHITELIST_SPECIFIC'
| 'BLACKLIST_SPECIFIC'
| boolean;
readonly allowlist: string;
readonly denylist: string;
readonly whitelist: string; readonly whitelist: string;
readonly blacklist: string; readonly blacklist: string;
readonly shouldCatchErrors: boolean; readonly shouldCatchErrors: boolean;
@ -54,10 +60,14 @@ const migrateOldOptions = (oldOptions: OldOrNewOptions): Options => ({
// Migrate the old `filter` option from 2.2.1 // Migrate the old `filter` option from 2.2.1
typeof oldOptions.filter === 'boolean' typeof oldOptions.filter === 'boolean'
? oldOptions.filter && oldOptions.whitelist.length > 0 ? oldOptions.filter && oldOptions.whitelist.length > 0
? FilterState.WHITELIST_SPECIFIC ? FilterState.ALLOWLIST_SPECIFIC
: oldOptions.filter : oldOptions.filter
? FilterState.BLACKLIST_SPECIFIC ? FilterState.DENYLIST_SPECIFIC
: FilterState.DO_NOT_FILTER : FilterState.DO_NOT_FILTER
: oldOptions.filter === 'WHITELIST_SPECIFIC'
? FilterState.ALLOWLIST_SPECIFIC
: oldOptions.filter === 'BLACKLIST_SPECIFIC'
? FilterState.DENYLIST_SPECIFIC
: oldOptions.filter, : oldOptions.filter,
}); });
@ -73,6 +83,8 @@ const get = (callback: (options: Options) => void) => {
filter: FilterState.DO_NOT_FILTER, filter: FilterState.DO_NOT_FILTER,
whitelist: '', whitelist: '',
blacklist: '', blacklist: '',
allowlist: '',
denylist: '',
shouldCatchErrors: false, shouldCatchErrors: false,
inject: true, inject: true,
urls: '^https?://localhost|0\\.0\\.0\\.0:\\d+\n^https?://.+\\.github\\.io', urls: '^https?://localhost|0\\.0\\.0\\.0:\\d+\n^https?://.+\\.github\\.io',
@ -98,14 +110,14 @@ export const injectOptions = (newOptions: Options) => {
options = { options = {
...newOptions, ...newOptions,
whitelist: allowlist:
newOptions.filter !== FilterState.DO_NOT_FILTER newOptions.filter !== FilterState.DO_NOT_FILTER
? toReg(newOptions.whitelist)! ? toReg(newOptions.allowlist)!
: newOptions.whitelist, : newOptions.allowlist,
blacklist: denylist:
newOptions.filter !== FilterState.DO_NOT_FILTER newOptions.filter !== FilterState.DO_NOT_FILTER
? toReg(newOptions.blacklist)! ? toReg(newOptions.denylist)!
: newOptions.blacklist, : newOptions.denylist,
}; };
let s = document.createElement('script'); let s = document.createElement('script');
s.type = 'text/javascript'; s.type = 'text/javascript';

View File

@ -3,7 +3,7 @@
"name": "Redux DevTools", "name": "Redux DevTools",
"manifest_version": 2, "manifest_version": 2,
"description": "Redux Developer Tools for debugging application state changes.", "description": "Redux Developer Tools for debugging application state changes.",
"homepage_url": "https://github.com/zalmoxisus/redux-devtools-extension", "homepage_url": "https://github.com/reduxjs/redux-devtools",
"applications": { "applications": {
"gecko": { "gecko": {
"id": "extension@redux.devtools", "id": "extension@redux.devtools",

View File

@ -181,7 +181,7 @@ describe('Redux enhancer', () => {
window.store = createStore( window.store = createStore(
counter, counter,
window.__REDUX_DEVTOOLS_EXTENSION__({ window.__REDUX_DEVTOOLS_EXTENSION__({
actionsBlacklist: ['SOME_ACTION'], actionsDenylist: ['SOME_ACTION'],
statesFilter: (state) => state, statesFilter: (state) => state,
serializeState: (key, value) => value, serializeState: (key, value) => value,
}) })

View File

@ -43,7 +43,7 @@ describe('Chrome extension', function () {
}); });
it("should contain inspector monitor's component", async () => { it("should contain inspector monitor's component", async () => {
await delay(500); await delay(1000);
const val = await driver const val = await driver
.findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]')) .findElement(webdriver.By.xpath('//div[contains(@class, "inspector-")]'))
.getText(); .getText();

View File

@ -73,6 +73,10 @@ export class Select<
borderColor: props.theme.colors.neutral10, borderColor: props.theme.colors.neutral10,
}, },
}), }),
menu: (base) => ({
...base,
zIndex: 10,
}),
}} }}
/> />
); );

View File

@ -333,6 +333,7 @@ exports[`Select should select another option 1`] = `
Object { Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
} }
} }
theme={[Function]} theme={[Function]}
@ -396,6 +397,7 @@ exports[`Select should select another option 1`] = `
Object { Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
} }
} }
tabIndex="0" tabIndex="0"
@ -493,6 +495,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -650,6 +653,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -810,6 +814,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -968,6 +973,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -1120,6 +1126,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -1353,6 +1360,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -1492,6 +1500,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -1642,6 +1651,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -1839,6 +1849,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -1973,6 +1984,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -2027,14 +2039,14 @@ exports[`Select should select another option 1`] = `
"position": "absolute", "position": "absolute",
"top": "100%", "top": "100%",
"width": "100%", "width": "100%",
"zIndex": 1, "zIndex": 10,
} }
} }
onMouseDown={[Function]} onMouseDown={[Function]}
onMouseMove={[Function]} onMouseMove={[Function]}
> >
<div <div
className=" css-1uhnaxp-menu" className=" css-17wpf85-menu"
onMouseDown={[Function]} onMouseDown={[Function]}
onMouseMove={[Function]} onMouseMove={[Function]}
> >
@ -2133,6 +2145,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -2293,6 +2306,7 @@ exports[`Select should select another option 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -2489,6 +2503,7 @@ exports[`Select shouldn't find any results 1`] = `
Object { Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
} }
} }
theme={[Function]} theme={[Function]}
@ -2552,6 +2567,7 @@ exports[`Select shouldn't find any results 1`] = `
Object { Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
} }
} }
tabIndex="0" tabIndex="0"
@ -2649,6 +2665,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -2793,6 +2810,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -2953,6 +2971,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -3111,6 +3130,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -3263,6 +3283,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -3496,6 +3517,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -3635,6 +3657,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -3785,6 +3808,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -3982,6 +4006,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -4116,6 +4141,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -4170,14 +4196,14 @@ exports[`Select shouldn't find any results 1`] = `
"position": "absolute", "position": "absolute",
"top": "100%", "top": "100%",
"width": "100%", "width": "100%",
"zIndex": 1, "zIndex": 10,
} }
} }
onMouseDown={[Function]} onMouseDown={[Function]}
onMouseMove={[Function]} onMouseMove={[Function]}
> >
<div <div
className=" css-1uhnaxp-menu" className=" css-17wpf85-menu"
onMouseDown={[Function]} onMouseDown={[Function]}
onMouseMove={[Function]} onMouseMove={[Function]}
> >
@ -4270,6 +4296,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,
@ -4409,6 +4436,7 @@ exports[`Select shouldn't find any results 1`] = `
"styles": Object { "styles": Object {
"container": [Function], "container": [Function],
"control": [Function], "control": [Function],
"menu": [Function],
}, },
"tabIndex": "0", "tabIndex": "0",
"tabSelectsValue": true, "tabSelectsValue": true,

View File

@ -23,6 +23,7 @@ import {
GET_REPORT_ERROR, GET_REPORT_ERROR,
GET_REPORT_SUCCESS, GET_REPORT_SUCCESS,
ERROR, ERROR,
SET_PERSIST,
} from '../constants/actionTypes'; } from '../constants/actionTypes';
import { import {
AUTH_ERROR, AUTH_ERROR,
@ -302,6 +303,14 @@ export function togglePersist(): TogglePersistAction {
return { type: TOGGLE_PERSIST }; return { type: TOGGLE_PERSIST };
} }
export interface SetPersistAction {
type: typeof SET_PERSIST;
payload: boolean;
}
export function setPersist(persist: boolean): SetPersistAction {
return { type: SET_PERSIST, payload: persist };
}
export interface ToggleSyncAction { export interface ToggleSyncAction {
type: typeof TOGGLE_SYNC; type: typeof TOGGLE_SYNC;
} }
@ -323,7 +332,7 @@ export function toggleDispatcher(): ToggleDispatcherAction {
return { type: TOGGLE_DISPATCHER }; return { type: TOGGLE_DISPATCHER };
} }
export type ConnectionType = 'disabled' | 'remotedev' | 'custom'; export type ConnectionType = 'disabled' | 'custom';
export interface ConnectionOptions { export interface ConnectionOptions {
readonly type: ConnectionType; readonly type: ConnectionType;
readonly hostname: string; readonly hostname: string;
@ -561,6 +570,7 @@ export type StoreActionWithoutUpdateStateOrLiftedAction =
| UpdateMonitorStateAction | UpdateMonitorStateAction
| ExportAction | ExportAction
| TogglePersistAction | TogglePersistAction
| SetPersistAction
| ToggleSyncAction | ToggleSyncAction
| ToggleSliderAction | ToggleSliderAction
| ToggleDispatcherAction | ToggleDispatcherAction

View File

@ -34,7 +34,9 @@ class Header extends Component<Props> {
<Button <Button
title="Documentation" title="Documentation"
tooltipPosition="bottom" tooltipPosition="bottom"
onClick={this.openLink('http://extension.remotedev.io')} onClick={this.openLink(
'https://github.com/reduxjs/redux-devtools/blob/main/README.md'
)}
> >
<GoBook /> <GoBook />
</Button> </Button>
@ -42,7 +44,7 @@ class Header extends Component<Props> {
title="Feedback" title="Feedback"
tooltipPosition="bottom" tooltipPosition="bottom"
onClick={this.openLink( onClick={this.openLink(
'http://extension.remotedev.io/docs/Feedback.html' 'https://github.com/reduxjs/redux-devtools/discussions'
)} )}
> >
<IoMdText /> <IoMdText />

View File

@ -2,7 +2,6 @@ import React, { Component } from 'react';
import { connect, ResolveThunks } from 'react-redux'; import { connect, ResolveThunks } from 'react-redux';
import { Container, Form } from 'devui'; import { Container, Form } from 'devui';
import { import {
JSONSchema7,
JSONSchema7Definition, JSONSchema7Definition,
JSONSchema7Type, JSONSchema7Type,
JSONSchema7TypeName, JSONSchema7TypeName,
@ -33,12 +32,8 @@ const defaultSchema: Schema = {
type: { type: {
title: 'Connection settings (for getting reports and remote debugging)', title: 'Connection settings (for getting reports and remote debugging)',
type: 'string', type: 'string',
enum: ['disabled', 'remotedev', 'custom'], enum: ['disabled', 'custom'],
enumNames: [ enumNames: ['no remote connection', 'use local (custom) server'],
'no remote connection',
'connect via remotedev.io',
'use local (custom) server',
],
}, },
hostname: { hostname: {
type: 'string', type: 'string',

View File

@ -26,8 +26,8 @@ class LockButton extends Component<Props> {
mark={this.props.persisted && 'base0D'} mark={this.props.persisted && 'base0D'}
title={ title={
this.props.persisted this.props.persisted
? 'Persist state history' ? 'Disable state persisting'
: 'Disable state persisting' : 'Persist state history'
} }
onClick={this.props.onClick} onClick={this.props.onClick}
> >

View File

@ -9,6 +9,7 @@ export const LIFTED_ACTION = 'devTools/LIFTED_ACTION';
export const MONITOR_ACTION = 'devTools/MONITOR_ACTION'; export const MONITOR_ACTION = 'devTools/MONITOR_ACTION';
export const TOGGLE_SYNC = 'devTools/TOGGLE_SYNC'; export const TOGGLE_SYNC = 'devTools/TOGGLE_SYNC';
export const TOGGLE_PERSIST = 'devTools/TOGGLE_PERSIST'; export const TOGGLE_PERSIST = 'devTools/TOGGLE_PERSIST';
export const SET_PERSIST = 'devTools/SET_PERSIST';
export const SELECT_MONITOR = 'devTools/SELECT_MONITOR'; export const SELECT_MONITOR = 'devTools/SELECT_MONITOR';
export const UPDATE_MONITOR_STATE = 'devTools/UPDATE_MONITOR_STATE'; export const UPDATE_MONITOR_STATE = 'devTools/UPDATE_MONITOR_STATE';
export const TOGGLE_SLIDER = 'devTools/TOGGLE_SLIDER'; export const TOGGLE_SLIDER = 'devTools/TOGGLE_SLIDER';

View File

@ -1,12 +0,0 @@
const socketOptions = {
hostname: 'remotedev.io',
port: 443,
protocol: 'https',
autoReconnect: true,
secure: true,
autoReconnectOptions: {
randomness: 30000,
},
};
export default socketOptions;

View File

@ -92,8 +92,8 @@ class Dispatcher extends Component<Props, State> {
selectActionCreator = (selected: 'default' | 'actions-help' | number) => { selectActionCreator = (selected: 'default' | 'actions-help' | number) => {
if (selected === 'actions-help') { if (selected === 'actions-help') {
window.open( window.open(
'https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/' + 'https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/' +
'basics/Dispatcher.md' 'API/Arguments.md#actioncreators'
); );
return; return;
} }

View File

@ -14,13 +14,18 @@ class Root extends Component {
persistor?: Persistor; persistor?: Persistor;
UNSAFE_componentWillMount() { UNSAFE_componentWillMount() {
const { store, persistor } = configureStore(); const { store, persistor } = configureStore(
this.store = store; (store: Store<StoreState, StoreAction>) => {
this.persistor = persistor; if (store.getState().connection.type !== 'disabled') {
store.dispatch({ store.dispatch({
type: CONNECT_REQUEST, type: CONNECT_REQUEST,
}); });
} }
}
);
this.store = store;
this.persistor = persistor;
}
render() { render() {
if (!this.store) return null; if (!this.store) return null;

View File

@ -1,7 +1,6 @@
import socketCluster, { SCClientSocket } from 'socketcluster-client'; import socketCluster, { SCClientSocket } from 'socketcluster-client';
import { stringify } from 'jsan'; import { stringify } from 'jsan';
import { Dispatch, MiddlewareAPI } from 'redux'; import { Dispatch, MiddlewareAPI } from 'redux';
import socketOptions from '../constants/socketOptions';
import * as actions from '../constants/socketActionTypes'; import * as actions from '../constants/socketActionTypes';
import { getActiveInstance } from '../reducers/instances'; import { getActiveInstance } from '../reducers/instances';
import { import {
@ -193,9 +192,7 @@ function connect() {
if (process.env.NODE_ENV === 'test') return; if (process.env.NODE_ENV === 'test') return;
const connection = store.getState().connection; const connection = store.getState().connection;
try { try {
socket = socketCluster.create( socket = socketCluster.create(connection.options);
connection.type === 'remotedev' ? socketOptions : connection.options
);
handleConnection(); handleConnection();
} catch (error) { } catch (error) {
store.dispatch({ type: actions.CONNECT_ERROR, error }); store.dispatch({ type: actions.CONNECT_ERROR, error });
@ -204,8 +201,10 @@ function connect() {
} }
function disconnect() { function disconnect() {
if (socket) {
socket.disconnect(); socket.disconnect();
socket.off(); socket.off();
}
} }
function login() { function login() {

View File

@ -14,7 +14,7 @@ export interface ConnectionState {
export default function connection( export default function connection(
state: ConnectionState = { state: ConnectionState = {
options: { hostname: 'localhost', port: 8000, secure: false }, options: { hostname: 'localhost', port: 8000, secure: false },
type: 'remotedev', type: 'disabled',
}, },
action: StoreAction action: StoreAction
) { ) {

View File

@ -8,6 +8,7 @@ import {
REMOVE_INSTANCE, REMOVE_INSTANCE,
TOGGLE_PERSIST, TOGGLE_PERSIST,
TOGGLE_SYNC, TOGGLE_SYNC,
SET_PERSIST,
} from '../constants/actionTypes'; } from '../constants/actionTypes';
import { DISCONNECTED } from '../constants/socketActionTypes'; import { DISCONNECTED } from '../constants/socketActionTypes';
import parseJSON from '../utils/parseJSON'; import parseJSON from '../utils/parseJSON';
@ -349,6 +350,8 @@ export default function instances(
}; };
case TOGGLE_PERSIST: case TOGGLE_PERSIST:
return { ...state, persisted: !state.persisted }; return { ...state, persisted: !state.persisted };
case SET_PERSIST:
return { ...state, persisted: action.payload };
case TOGGLE_SYNC: case TOGGLE_SYNC:
return { ...state, sync: !state.sync }; return { ...state, sync: !state.sync };
case SELECT_INSTANCE: case SELECT_INSTANCE:

View File

@ -1,4 +1,4 @@
import { createStore, compose, applyMiddleware, Reducer } from 'redux'; import { createStore, compose, applyMiddleware, Reducer, Store } from 'redux';
import localForage from 'localforage'; import localForage from 'localforage';
import { persistReducer, persistStore } from 'redux-persist'; import { persistReducer, persistStore } from 'redux-persist';
import api from '../middlewares/api'; import api from '../middlewares/api';
@ -17,7 +17,9 @@ const persistedReducer: Reducer<StoreState, StoreAction> = persistReducer(
rootReducer rootReducer
) as any; ) as any;
export default function configureStore() { export default function configureStore(
callback: (store: Store<StoreState, StoreAction>) => void
) {
let composeEnhancers = compose; let composeEnhancers = compose;
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
if ( if (
@ -47,6 +49,8 @@ export default function configureStore() {
persistedReducer, persistedReducer,
composeEnhancers(applyMiddleware(exportState, api)) composeEnhancers(applyMiddleware(exportState, api))
); );
const persistor = persistStore(store); const persistor = persistStore(store, null, () => {
callback(store);
});
return { store, persistor }; return { store, persistor };
} }

View File

@ -32,7 +32,7 @@ import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension'; import { composeWithDevTools } from 'redux-devtools-extension';
const composeEnhancers = composeWithDevTools({ const composeEnhancers = composeWithDevTools({
// Specify here name, actionsBlacklist, actionsCreators and other options // Specify here name, actionsDenylist, actionsCreators and other options
}); });
const store = createStore( const store = createStore(
reducer, reducer,

View File

@ -56,16 +56,28 @@ export interface EnhancerOptions {
/** /**
* *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers). * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).
* If `actionsWhitelist` specified, `actionsBlacklist` is ignored. * If `actionsWhitelist` specified, `actionsBlacklist` is ignored.
* @deprecated Use actionsDenylist instead.
*/ */
actionsBlacklist?: string | string[]; actionsBlacklist?: string | string[];
/** /**
* *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers). * *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).
* If `actionsWhitelist` specified, `actionsBlacklist` is ignored. * If `actionsWhitelist` specified, `actionsBlacklist` is ignored.
* @deprecated Use actionsAllowlist instead.
*/ */
actionsWhitelist?: string | string[]; actionsWhitelist?: string | string[];
/**
* *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).
* If `actionsAllowlist` specified, `actionsDenylist` is ignored.
*/
actionsDenylist?: string | string[];
/**
* *string or array of strings as regex* - actions types to be hidden / shown in the monitors (while passed to the reducers).
* If `actionsAllowlist` specified, `actionsDenylist` is ignored.
*/
actionsAllowlist?: string | string[];
/** /**
* called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor. * called for every action before sending, takes `state` and `action` object, and returns `true` in case it allows sending the current data to the monitor.
* Use it as a more advanced version of `actionsBlacklist`/`actionsWhitelist` parameters. * Use it as a more advanced version of `actionsDenylist`/`actionsAllowlist` parameters.
*/ */
predicate?: <S, A extends Action>(state: S, action: A) => boolean; predicate?: <S, A extends Action>(state: S, action: A) => boolean;
/** /**

View File

@ -128,7 +128,7 @@ export default class TestTab<S, A extends Action<unknown>> extends Component<
return ( return (
<Container> <Container>
<Toolbar> <Toolbar>
<div style={{ flexGrow: 1, zIndex: 10 }}> <div style={{ flexGrow: 1 }}>
<Select <Select
options={templates} options={templates}
getOptionValue={(template: Template) => template.name!} getOptionValue={(template: Template) => template.name!}

View File

@ -29,7 +29,7 @@
}, },
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.14.5", "@babel/code-frame": "^7.14.5",
"@types/chrome": "^0.0.155", "@types/chrome": "^0.0.156",
"anser": "^1.4.10", "anser": "^1.4.10",
"html-entities": "^2.3.2", "html-entities": "^2.3.2",
"redux-devtools-themes": "^1.0.0" "redux-devtools-themes": "^1.0.0"

View File

@ -10,8 +10,8 @@ interface State {
export const FilterState = { export const FilterState = {
DO_NOT_FILTER: 'DO_NOT_FILTER', DO_NOT_FILTER: 'DO_NOT_FILTER',
BLACKLIST_SPECIFIC: 'BLACKLIST_SPECIFIC', DENYLIST_SPECIFIC: 'DENYLIST_SPECIFIC',
WHITELIST_SPECIFIC: 'WHITELIST_SPECIFIC', ALLOWLIST_SPECIFIC: 'ALLOWLIST_SPECIFIC',
}; };
export function arrToRegex(v: string | string[]) { export function arrToRegex(v: string | string[]) {
@ -41,20 +41,20 @@ function filterStates(
} }
interface Config { interface Config {
actionsBlacklist?: string[]; actionsDenylist?: string[];
actionsWhitelist?: string[]; actionsAllowlist?: string[];
} }
interface LocalFilter { interface LocalFilter {
whitelist?: string; allowlist?: string;
blacklist?: string; denylist?: string;
} }
export function getLocalFilter(config: Config): LocalFilter | undefined { export function getLocalFilter(config: Config): LocalFilter | undefined {
if (config.actionsBlacklist || config.actionsWhitelist) { if (config.actionsDenylist || config.actionsAllowlist) {
return { return {
whitelist: config.actionsWhitelist && config.actionsWhitelist.join('|'), allowlist: config.actionsAllowlist && config.actionsAllowlist.join('|'),
blacklist: config.actionsBlacklist && config.actionsBlacklist.join('|'), denylist: config.actionsDenylist && config.actionsDenylist.join('|'),
}; };
} }
return undefined; return undefined;
@ -63,10 +63,10 @@ export function getLocalFilter(config: Config): LocalFilter | undefined {
interface DevToolsOptions { interface DevToolsOptions {
filter?: filter?:
| typeof FilterState.DO_NOT_FILTER | typeof FilterState.DO_NOT_FILTER
| typeof FilterState.BLACKLIST_SPECIFIC | typeof FilterState.DENYLIST_SPECIFIC
| typeof FilterState.WHITELIST_SPECIFIC; | typeof FilterState.ALLOWLIST_SPECIFIC;
whitelist?: string; allowlist?: string;
blacklist?: string; denylist?: string;
} }
function getDevToolsOptions() { function getDevToolsOptions() {
return ( return (
@ -90,12 +90,12 @@ export function isFiltered(
) )
return false; return false;
const { whitelist, blacklist } = localFilter || opts; const { allowlist, denylist } = localFilter || opts;
return ( return (
// eslint-disable-next-line @typescript-eslint/prefer-regexp-exec // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec
(whitelist && !(type as string).match(whitelist)) || (allowlist && !(type as string).match(allowlist)) ||
// eslint-disable-next-line @typescript-eslint/prefer-regexp-exec // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec
(blacklist && (type as string).match(blacklist)) (denylist && (type as string).match(denylist))
); );
} }

View File

@ -4674,7 +4674,7 @@ __metadata:
"@redux-devtools/core": ^3.9.0 "@redux-devtools/core": ^3.9.0
"@redux-devtools/inspector-monitor": ^1.0.0 "@redux-devtools/inspector-monitor": ^1.0.0
"@types/babel__code-frame": ^7.0.3 "@types/babel__code-frame": ^7.0.3
"@types/chrome": ^0.0.155 "@types/chrome": ^0.0.156
"@types/enzyme": ^3.10.9 "@types/enzyme": ^3.10.9
"@types/enzyme-adapter-react-16": ^1.0.6 "@types/enzyme-adapter-react-16": ^1.0.6
"@types/html-entities": ^1.3.4 "@types/html-entities": ^1.3.4
@ -6179,13 +6179,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/chrome@npm:^0.0.155": "@types/chrome@npm:^0.0.156":
version: 0.0.155 version: 0.0.156
resolution: "@types/chrome@npm:0.0.155" resolution: "@types/chrome@npm:0.0.156"
dependencies: dependencies:
"@types/filesystem": "*" "@types/filesystem": "*"
"@types/har-format": "*" "@types/har-format": "*"
checksum: bdded7b4548396933155ee2129d73a932971c1bf7e5a8bc53729d2bb438185621d1585d4b9d6cf4c7a7665b5f64d3d808bd9507eb5baeb0bc90907e3754be0dc checksum: 4baca9bbd44a9af4e9e393ecd2d581838a3228bf73477eda7b0bc3b1ca382055e66e83458f5d95cc5fba47607ca9f8939ae22c7fcb0df6f9f733543cae76d1a5
languageName: node languageName: node
linkType: hard linkType: hard