Skip to content

Commit b33e9b6

Browse files
authored
Add the recently changes from redux-devtools-extension (#248)
* Bump redux-devtools-instrument to v1.9 * Add actionCreators option for connect API
1 parent d1fbd52 commit b33e9b6

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed

__e2e__/fixture/remotedev.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ const connectViaExtension = window.devToolsExtension.connect;
55
const logReducer = reducer => {
66
const remotedev = connectViaExtension({
77
name: 'RemoteDev store instance 1',
8+
actionCreators: {
9+
test: () => {},
10+
},
811
});
912
return (state, action) => {
1013
const reducedState = reducer(state, action);

app/worker/remotedev.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Edit from https://github.com/zalmoxisus/remotedev/blob/master/src/devTools.js
22

33
import { stringify, parse } from 'jsan';
4-
import { generateId } from 'remotedev-utils';
4+
import { generateId, getActionsArray } from 'remotedev-utils';
55

66
let listenerAdded;
77
const listeners = {};
@@ -22,7 +22,7 @@ function handleMessages(message) {
2222
if (typeof fn === 'function') {
2323
fn(message);
2424
} else {
25-
fn.forEach(func => { func(message); });
25+
fn.forEach(func => func(message));
2626
}
2727
return false;
2828
}
@@ -69,6 +69,12 @@ export function send(action, state, type, options) {
6969
instanceId: options.instanceId,
7070
name: options.name,
7171
};
72+
message.libConfig = {
73+
type: options.type,
74+
name: options.name,
75+
serialize: !!options.serialize,
76+
actionCreators: options.actionCreators,
77+
};
7278
postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: message });
7379
}, 0);
7480
}
@@ -79,6 +85,7 @@ export function connect(options = {}) {
7985
...options,
8086
instanceId: id,
8187
name: options.name || id,
88+
actionCreators: JSON.stringify(getActionsArray(options.actionCreators || {})),
8289
};
8390
start();
8491
return {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@
8282
"react-devtools-core": "^2.5.2",
8383
"react-dom": "^15.6.1",
8484
"react-redux": "^5.0.7",
85-
"redux": "^3.7.2",
85+
"redux": "^4.0.0",
8686
"redux-devtools": "^3.4.1",
87-
"redux-devtools-instrument": "^1.8.3",
87+
"redux-devtools-instrument": "^1.9.0",
8888
"redux-persist": "^4.10.2",
8989
"remotedev-app": "^0.10.8",
9090
"remotedev-monitor-components": "^0.0.5",

yarn.lock

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6404,9 +6404,9 @@ redux-devtools-instrument@^1.0.1:
64046404
lodash "^4.2.0"
64056405
symbol-observable "^1.0.2"
64066406

6407-
redux-devtools-instrument@^1.8.3:
6408-
version "1.8.3"
6409-
resolved "https://registry.yarnpkg.com/redux-devtools-instrument/-/redux-devtools-instrument-1.8.3.tgz#c510d67ab4e5e4525acd6e410c25ab46b85aca7c"
6407+
redux-devtools-instrument@^1.9.0:
6408+
version "1.9.0"
6409+
resolved "https://registry.yarnpkg.com/redux-devtools-instrument/-/redux-devtools-instrument-1.9.0.tgz#2faed9ac3292c783284b21843edfaa0567764a0c"
64106410
dependencies:
64116411
lodash "^4.2.0"
64126412
symbol-observable "^1.0.2"
@@ -6463,7 +6463,7 @@ redux-persist@^4.10.2:
64636463
lodash "^4.17.4"
64646464
lodash-es "^4.17.4"
64656465

6466-
redux@^3.0.5, redux@^3.7.2:
6466+
redux@^3.0.5:
64676467
version "3.7.2"
64686468
resolved "https://registry.yarnpkg.com/redux/-/redux-3.7.2.tgz#06b73123215901d25d065be342eb026bc1c8537b"
64696469
dependencies:
@@ -6472,6 +6472,13 @@ redux@^3.0.5, redux@^3.7.2:
64726472
loose-envify "^1.1.0"
64736473
symbol-observable "^1.0.3"
64746474

6475+
redux@^4.0.0:
6476+
version "4.0.0"
6477+
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.0.tgz#aa698a92b729315d22b34a0553d7e6533555cc03"
6478+
dependencies:
6479+
loose-envify "^1.1.0"
6480+
symbol-observable "^1.2.0"
6481+
64756482
reflexbox@^2.2.2:
64766483
version "2.2.3"
64776484
resolved "https://registry.yarnpkg.com/reflexbox/-/reflexbox-2.2.3.tgz#9b9ce983dbe677cebf3a94cf2c50b8157f50c0d1"
@@ -7493,6 +7500,10 @@ symbol-observable@^1.0.1, symbol-observable@^1.0.2, symbol-observable@^1.0.3:
74937500
version "1.0.4"
74947501
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
74957502

7503+
symbol-observable@^1.2.0:
7504+
version "1.2.0"
7505+
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"
7506+
74967507
symbol-tree@^3.2.1:
74977508
version "3.2.2"
74987509
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6"

0 commit comments

Comments
 (0)