Skip to content

Commit b301e34

Browse files
committed
Always stringify
1 parent ec6f5b3 commit b301e34

File tree

5 files changed

+8
-29
lines changed

5 files changed

+8
-29
lines changed

docs/API/Methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Send a new action and state manually to be shown on the monitor.
5050

5151
##### Arguments
5252

53-
- [`config`] *Object* intended to be the same as for [Redux store enhancer](Arguments.md#windowdevtoolsextensionconfig). For now only `instanceId` and `shouldStringify` should be specified.
53+
- [`config`] *Object* intended to be the same as for [Redux store enhancer](Arguments.md#windowdevtoolsextensionconfig).
5454

5555
##### Returns
5656
*Object* containing the following methods:

src/app/api/index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function post(message) {
1111
window.postMessage(message, '*');
1212
}
1313

14-
export function toContentScript(message, shouldStringify, serializeState, serializeAction) {
14+
export function toContentScript(message, serializeState, serializeAction) {
1515
if (message.type === 'ACTION') {
1616
message.action = stringify(message.action, serializeAction);
1717
message.payload = stringify(message.payload, serializeState);
@@ -25,7 +25,7 @@ export function toContentScript(message, shouldStringify, serializeState, serial
2525
post(message);
2626
}
2727

28-
export function sendMessage(action, state, shouldStringify, id, name) {
28+
export function sendMessage(action, state, id, name) {
2929
const message = {
3030
payload: state,
3131
source,
@@ -40,7 +40,7 @@ export function sendMessage(action, state, shouldStringify, id, name) {
4040
message.type = 'STATE';
4141
}
4242

43-
toContentScript(message, shouldStringify);
43+
toContentScript(message);
4444
}
4545

4646
function handleMessages(event) {
@@ -84,7 +84,7 @@ export function connect(config = {}) {
8484
};
8585

8686
const send = (action, state) => {
87-
sendMessage(action, state, config.shouldStringify, id, name);
87+
sendMessage(action, state, id, name);
8888
};
8989

9090
const init = (state, action) => {
@@ -93,8 +93,7 @@ export function connect(config = {}) {
9393
type: 'INIT', payload: state,
9494
action: action || {},
9595
instanceId: id, name, source
96-
},
97-
config.shouldStringify
96+
}
9897
);
9998
};
10099

@@ -104,7 +103,7 @@ export function connect(config = {}) {
104103

105104
window.addEventListener('message', handleMessages, false);
106105

107-
toContentScript({ type: 'INIT_INSTANCE', instanceId: id, source});
106+
toContentScript({ type: 'INIT_INSTANCE', instanceId: id, source });
108107

109108
return {
110109
init,

src/browser/extension/inject/pageScript.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const devToolsExtension = function(reducer, preloadedState, config) {
3030
if (!window.devToolsOptions) window.devToolsOptions = {};
3131

3232
let store;
33-
let shouldSerialize = config.serializeState || config.serializeAction;
3433
let errorOccurred = false;
3534
let maxAge;
3635
let isExcess;
@@ -71,11 +70,7 @@ const devToolsExtension = function(reducer, preloadedState, config) {
7170
message.name = config.name || document.title;
7271
}
7372

74-
if (shouldSerialize || window.devToolsOptions.serialize !== false) {
75-
toContentScript(message, true, config.serializeState, config.serializeAction);
76-
} else {
77-
toContentScript(message);
78-
}
73+
toContentScript(message, config.serializeState, config.serializeAction);
7974
}
8075

8176
function relayState(actions, shouldInit) {

src/browser/extension/options/MiscellaneousGroup.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@ export default ({ options, saveOption }) => {
2525
</div>
2626
</div>
2727

28-
<div className="option option_type_checkbox">
29-
<input className="option__element"
30-
id="serialize"
31-
type="checkbox"
32-
checked={options.serialize}
33-
onChange={(e) => saveOption('serialize', e.target.checked)}/>
34-
<label className="option__label" htmlFor="serialize">Serialize the state</label>
35-
<div className="option__hint">
36-
Recommended. Required for ImmutableJS state, optional in most other cases.
37-
{' '}
38-
<a href="https://github.com/zalmoxisus/redux-devtools-extension/pull/54#issuecomment-188167725">More info</a>
39-
</div>
40-
</div>
41-
4228
<div className="option option_type_checkbox">
4329
<input className="option__element"
4430
id="notifyErrors"

src/browser/extension/options/syncOptions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ const get = callback => {
3737
filter: FilterState.DO_NOT_FILTER,
3838
whitelist: '',
3939
blacklist: '',
40-
serialize: true,
4140
shouldCatchErrors: false,
4241
inject: true,
4342
urls: '^https?://localhost|0\\.0\\.0\\.0:\\d+\n^https?://.+\\.github\\.io'

0 commit comments

Comments
 (0)