mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
Move background to top-level
This commit is contained in:
parent
35fb3343f5
commit
1dcf198071
|
@ -1,6 +1,6 @@
|
||||||
import jsan from 'jsan';
|
import jsan from 'jsan';
|
||||||
import { immutableSerialize } from '@redux-devtools/serialize';
|
import { immutableSerialize } from '@redux-devtools/serialize';
|
||||||
import {
|
import type {
|
||||||
Config,
|
Config,
|
||||||
SerializeWithImmutable,
|
SerializeWithImmutable,
|
||||||
} from '../../browser/extension/inject/pageScript';
|
} from '../../browser/extension/inject/pageScript';
|
||||||
|
|
|
@ -5,15 +5,15 @@ import { getActionsArray, getLocalFilter } from '@redux-devtools/utils';
|
||||||
import { isFiltered, PartialLiftedState } from './filters';
|
import { isFiltered, PartialLiftedState } from './filters';
|
||||||
import importState from './importState';
|
import importState from './importState';
|
||||||
import generateId from './generateInstanceId';
|
import generateId from './generateInstanceId';
|
||||||
import { Config } from '../../browser/extension/inject/pageScript';
|
import type { Config } from '../../browser/extension/inject/pageScript';
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import { LiftedState, PerformAction } from '@redux-devtools/instrument';
|
import { LiftedState, PerformAction } from '@redux-devtools/instrument';
|
||||||
import { LibConfig } from '@redux-devtools/app';
|
import { LibConfig } from '@redux-devtools/app';
|
||||||
import {
|
import type {
|
||||||
ContentScriptToPageScriptMessage,
|
ContentScriptToPageScriptMessage,
|
||||||
ListenerMessage,
|
ListenerMessage,
|
||||||
} from '../../browser/extension/inject/contentScript';
|
} from '../../browser/extension/inject/contentScript';
|
||||||
import { Position } from './openWindow';
|
import type { Position } from './openWindow';
|
||||||
|
|
||||||
const listeners: {
|
const listeners: {
|
||||||
[instanceId: string]:
|
[instanceId: string]:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
import { PageScriptToContentScriptMessage } from './index';
|
import type { PageScriptToContentScriptMessage } from './index';
|
||||||
|
|
||||||
export type Position = 'left' | 'right' | 'bottom' | 'panel' | 'remote';
|
export type Position = 'left' | 'right' | 'bottom' | 'panel' | 'remote';
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
import { GoRadioTower } from 'react-icons/go';
|
import { GoRadioTower } from 'react-icons/go';
|
||||||
import { MdBorderBottom, MdBorderLeft, MdBorderRight } from 'react-icons/md';
|
import { MdBorderBottom, MdBorderLeft, MdBorderRight } from 'react-icons/md';
|
||||||
import { Position } from '../api/openWindow';
|
import { Position } from '../api/openWindow';
|
||||||
import { SingleMessage } from '../middlewares/api';
|
import type { SingleMessage } from '../../background/store/apiMiddleware';
|
||||||
|
|
||||||
type StateProps = ReturnType<typeof mapStateToProps>;
|
type StateProps = ReturnType<typeof mapStateToProps>;
|
||||||
type DispatchProps = ResolveThunks<typeof actionCreators>;
|
type DispatchProps = ResolveThunks<typeof actionCreators>;
|
||||||
|
|
|
@ -7,9 +7,9 @@ import {
|
||||||
UPDATE_STATE,
|
UPDATE_STATE,
|
||||||
} from '@redux-devtools/app';
|
} from '@redux-devtools/app';
|
||||||
import { Dispatch, MiddlewareAPI, Store } from 'redux';
|
import { Dispatch, MiddlewareAPI, Store } from 'redux';
|
||||||
import { BackgroundState } from '../reducers/background';
|
import type { BackgroundState } from '../../background/store/backgroundReducer';
|
||||||
import { WindowStoreAction } from '../stores/windowStore';
|
import { WindowStoreAction } from '../stores/windowStore';
|
||||||
import { BackgroundAction } from '../stores/backgroundStore';
|
import type { BackgroundAction } from '../../background/store/backgroundStore';
|
||||||
|
|
||||||
const syncStores =
|
const syncStores =
|
||||||
(baseStore: Store<BackgroundState, BackgroundAction>) =>
|
(baseStore: Store<BackgroundState, BackgroundAction>) =>
|
||||||
|
|
|
@ -20,9 +20,12 @@ import {
|
||||||
import syncStores from '../middlewares/windowSync';
|
import syncStores from '../middlewares/windowSync';
|
||||||
import instanceSelector from '../middlewares/instanceSelector';
|
import instanceSelector from '../middlewares/instanceSelector';
|
||||||
import rootReducer from '../reducers/window';
|
import rootReducer from '../reducers/window';
|
||||||
import { BackgroundState } from '../reducers/background';
|
import type { BackgroundState } from '../../background/store/backgroundReducer';
|
||||||
import { BackgroundAction } from './backgroundStore';
|
import type { BackgroundAction } from '../../background/store/backgroundStore';
|
||||||
import { EmptyUpdateStateAction, NAAction } from '../middlewares/api';
|
import type {
|
||||||
|
EmptyUpdateStateAction,
|
||||||
|
NAAction,
|
||||||
|
} from '../../background/store/apiMiddleware';
|
||||||
|
|
||||||
export interface ExpandedUpdateStateAction extends UpdateStateAction {
|
export interface ExpandedUpdateStateAction extends UpdateStateAction {
|
||||||
readonly instances: InstancesState;
|
readonly instances: InstancesState;
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import { Store } from 'redux';
|
import { Store } from 'redux';
|
||||||
import configureStore, {
|
import configureStore, { BackgroundAction } from './store/backgroundStore';
|
||||||
BackgroundAction,
|
|
||||||
} from '../../../app/stores/backgroundStore';
|
|
||||||
import openDevToolsWindow, { DevToolsPosition } from './openWindow';
|
import openDevToolsWindow, { DevToolsPosition } from './openWindow';
|
||||||
import { createMenu, removeMenu } from './contextMenus';
|
import { createMenu, removeMenu } from './contextMenus';
|
||||||
import syncOptions from '../options/syncOptions';
|
import syncOptions from '../browser/extension/options/syncOptions';
|
||||||
import { BackgroundState } from '../../../app/reducers/background';
|
import { BackgroundState } from './store/backgroundReducer';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
|
@ -16,27 +16,22 @@ import syncOptions, {
|
||||||
OptionsMessage,
|
OptionsMessage,
|
||||||
SyncOptions,
|
SyncOptions,
|
||||||
} from '../../browser/extension/options/syncOptions';
|
} from '../../browser/extension/options/syncOptions';
|
||||||
import openDevToolsWindow, {
|
import openDevToolsWindow, { DevToolsPosition } from '../openWindow';
|
||||||
DevToolsPosition,
|
import { getReport } from '../logging';
|
||||||
} from '../../browser/extension/background/openWindow';
|
|
||||||
import { getReport } from '../../browser/extension/background/logging';
|
|
||||||
import { Action, Dispatch, MiddlewareAPI } from 'redux';
|
import { Action, Dispatch, MiddlewareAPI } from 'redux';
|
||||||
import {
|
import {
|
||||||
ContentScriptToBackgroundMessage,
|
ContentScriptToBackgroundMessage,
|
||||||
SplitMessage,
|
SplitMessage,
|
||||||
} from '../../browser/extension/inject/contentScript';
|
} from '../../browser/extension/inject/contentScript';
|
||||||
import {
|
import type {
|
||||||
ErrorMessage,
|
ErrorMessage,
|
||||||
PageScriptToContentScriptMessageForwardedToMonitors,
|
PageScriptToContentScriptMessageForwardedToMonitors,
|
||||||
PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance,
|
PageScriptToContentScriptMessageWithoutDisconnectOrInitInstance,
|
||||||
} from '../api';
|
} from '../../app/api';
|
||||||
import { LiftedState } from '@redux-devtools/instrument';
|
import { LiftedState } from '@redux-devtools/instrument';
|
||||||
import {
|
import type { BackgroundAction, LiftedActionAction } from './backgroundStore';
|
||||||
BackgroundAction,
|
import type { Position } from '../../app/api/openWindow';
|
||||||
LiftedActionAction,
|
import type { BackgroundState } from './backgroundReducer';
|
||||||
} from '../stores/backgroundStore';
|
|
||||||
import { Position } from '../api/openWindow';
|
|
||||||
import { BackgroundState } from '../reducers/background';
|
|
||||||
|
|
||||||
interface TabMessageBase {
|
interface TabMessageBase {
|
||||||
readonly type: string;
|
readonly type: string;
|
|
@ -1,6 +1,6 @@
|
||||||
import { combineReducers, Reducer } from 'redux';
|
import { combineReducers, Reducer } from 'redux';
|
||||||
import { instances, InstancesState } from '@redux-devtools/app';
|
import { instances, InstancesState } from '@redux-devtools/app';
|
||||||
import { BackgroundAction } from '../../stores/backgroundStore';
|
import type { BackgroundAction } from './backgroundStore';
|
||||||
|
|
||||||
export interface BackgroundState {
|
export interface BackgroundState {
|
||||||
readonly instances: InstancesState;
|
readonly instances: InstancesState;
|
|
@ -5,8 +5,8 @@ import {
|
||||||
LIFTED_ACTION,
|
LIFTED_ACTION,
|
||||||
StoreActionWithoutLiftedAction,
|
StoreActionWithoutLiftedAction,
|
||||||
} from '@redux-devtools/app';
|
} from '@redux-devtools/app';
|
||||||
import rootReducer, { BackgroundState } from '../reducers/background';
|
import rootReducer, { BackgroundState } from './backgroundReducer';
|
||||||
import api, { CONNECTED, DISCONNECTED } from '../middlewares/api';
|
import api, { CONNECTED, DISCONNECTED } from './apiMiddleware';
|
||||||
|
|
||||||
interface LiftedActionActionBase {
|
interface LiftedActionActionBase {
|
||||||
action?: DispatchAction | string | CustomAction;
|
action?: DispatchAction | string | CustomAction;
|
|
@ -8,7 +8,7 @@ import configureStore from '../../../app/stores/panelStore';
|
||||||
|
|
||||||
import '../../views/devpanel.pug';
|
import '../../views/devpanel.pug';
|
||||||
import { Action, Store } from 'redux';
|
import { Action, Store } from 'redux';
|
||||||
import { PanelMessage } from '../../../app/middlewares/api';
|
import type { PanelMessage } from '../../../background/store/apiMiddleware';
|
||||||
import { StoreStateWithoutSocket } from '../../../app/reducers/panel';
|
import { StoreStateWithoutSocket } from '../../../app/reducers/panel';
|
||||||
import { PersistGate } from 'redux-persist/integration/react';
|
import { PersistGate } from 'redux-persist/integration/react';
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
getOptionsFromBg,
|
getOptionsFromBg,
|
||||||
isAllowed,
|
isAllowed,
|
||||||
} from '../options/syncOptions';
|
} from '../options/syncOptions';
|
||||||
import { TabMessage } from '../../../app/middlewares/api';
|
import type { TabMessage } from '../../../background/store/apiMiddleware';
|
||||||
import {
|
import {
|
||||||
PageScriptToContentScriptMessage,
|
PageScriptToContentScriptMessage,
|
||||||
PageScriptToContentScriptMessageWithoutDisconnect,
|
PageScriptToContentScriptMessageWithoutDisconnect,
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { PersistGate } from 'redux-persist/integration/react';
|
||||||
import { UPDATE_STATE } from '@redux-devtools/app';
|
import { UPDATE_STATE } from '@redux-devtools/app';
|
||||||
import App from '../../../app/containers/App';
|
import App from '../../../app/containers/App';
|
||||||
import configureStore from '../../../app/stores/windowStore';
|
import configureStore from '../../../app/stores/windowStore';
|
||||||
import { MonitorMessage } from '../../../app/middlewares/api';
|
import type { MonitorMessage } from '../../../background/store/apiMiddleware';
|
||||||
|
|
||||||
import '../../views/window.pug';
|
import '../../views/window.pug';
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ const baseConfig = (params) => ({
|
||||||
// devtool: 'source-map',
|
// devtool: 'source-map',
|
||||||
mode: params.mode,
|
mode: params.mode,
|
||||||
entry: params.input || {
|
entry: params.input || {
|
||||||
background: [mock, `${extpath}background/index`],
|
background: [mock, '../src/background/index'],
|
||||||
options: [mock, `${extpath}options/index`],
|
options: [mock, `${extpath}options/index`],
|
||||||
window: [`${extpath}window/index`],
|
window: [`${extpath}window/index`],
|
||||||
remote: [`${extpath}window/remote`],
|
remote: [`${extpath}window/remote`],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user