Skip to content

Commit

Permalink
Revert stringifying Symbols out of the box
Browse files Browse the repository at this point in the history
As not being reliable in case of constructors. Fix #302
  • Loading branch information
zalmoxisus committed Feb 7, 2017
1 parent 5f4dd81 commit 4290116
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 31 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
"react-redux": "^4.4.5",
"redux": "^3.5.2",
"redux-devtools": "^3.3.1",
"redux-devtools-instrument": "^1.7.1",
"remotedev-app": "^0.10.6",
"remotedev-monitor-components": "^0.0.4",
"redux-devtools-instrument": "^1.8.0",
"remotedev-app": "^0.10.7",
"remotedev-monitor-components": "^0.0.5",
"remotedev-serialize": "^0.1.0",
"remotedev-slider": "^1.1.1",
"remotedev-utils": "0.0.1"
Expand Down
10 changes: 3 additions & 7 deletions src/app/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,11 @@ function post(message) {
window.postMessage(message, '*');
}

function amendActionType(action, serialize) {
function amendActionType(action) {
if (typeof action === 'string') return { action: { type: action }, timestamp: Date.now() };
if (!action.type) return { action: { type: 'update' }, timestamp: Date.now() };
if (action.action) return action;
return {
action: !serialize && typeof action.type === 'symbol' ?
{ ...action, type: action.type.toString() } : action,
timestamp: Date.now()
};
return { action, timestamp: Date.now() };
}

export function toContentScript(message, serializeState, serializeAction) {
Expand Down Expand Up @@ -208,7 +204,7 @@ export function connect(preConfig) {
}
}
else if (config.actionSanitizer) amendedAction = config.actionSanitizer(action);
amendedAction = amendActionType(amendedAction, config.serialize);
amendedAction = amendActionType(amendedAction);
if (latency) {
delayedActions.push(amendedAction);
delayedStates.push(amendedState);
Expand Down
1 change: 0 additions & 1 deletion src/app/stores/enhancerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default function configureStore(next, monitorReducer, config) {
monitorReducer,
{
maxAge: config.maxAge || window.devToolsOptions.maxAge || 50,
stringifyActionTypes: !config.serialize,
shouldCatchErrors: config.shouldCatchErrors || window.shouldCatchErrors,
shouldHotReload: config.shouldHotReload,
shouldRecordChanges: config.shouldRecordChanges,
Expand Down
33 changes: 13 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5299,15 +5299,15 @@ redux-devtools-chart-monitor@^1.6.1:
redux-devtools-themes "^1.0.0"

redux-devtools-instrument@^1.0.1:
version "1.7.0"
resolved "https://registry.yarnpkg.com/redux-devtools-instrument/-/redux-devtools-instrument-1.7.0.tgz#0b8cdd3f7731dcf4ca6146950cc4966c78a91de5"
version "1.7.1"
resolved "https://registry.yarnpkg.com/redux-devtools-instrument/-/redux-devtools-instrument-1.7.1.tgz#30a28b76ac7fcfd0b8d4295ab6178cfc85088f6c"
dependencies:
lodash "^4.2.0"
symbol-observable "^1.0.2"

redux-devtools-instrument@^1.7.1:
version "1.7.1"
resolved "https://registry.yarnpkg.com/redux-devtools-instrument/-/redux-devtools-instrument-1.7.1.tgz#30a28b76ac7fcfd0b8d4295ab6178cfc85088f6c"
redux-devtools-instrument@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/redux-devtools-instrument/-/redux-devtools-instrument-1.8.0.tgz#db1840ed3d8152af6792913698e3424c119de9aa"
dependencies:
lodash "^4.2.0"
symbol-observable "^1.0.2"
Expand Down Expand Up @@ -5405,9 +5405,9 @@ regjsparser@^0.1.4:
dependencies:
jsesc "~0.5.0"

remotedev-app@^0.10.6:
version "0.10.6"
resolved "https://registry.yarnpkg.com/remotedev-app/-/remotedev-app-0.10.6.tgz#1658e7e73ef4d8a5dd7bd8b991817f34a5731751"
remotedev-app@^0.10.7:
version "0.10.7"
resolved "https://registry.yarnpkg.com/remotedev-app/-/remotedev-app-0.10.7.tgz#f5b646851d317b62bce0a890546af556da48cf64"
dependencies:
chrome-storage-local "^0.1.6"
d3-state-visualizer "^1.3.1"
Expand All @@ -5426,15 +5426,15 @@ remotedev-app@^0.10.6:
redux-devtools-log-monitor "^1.2.0"
redux-devtools-test-generator "^0.4.0"
redux-devtools-themes "^1.0.0"
remotedev-inspector-monitor "^0.10.0"
remotedev-inspector-monitor "^0.10.2"
remotedev-monitor-components "^0.0.5"
remotedev-slider "1.1.3"
socketcluster-client "^5.0.0"
styled-components "^1.1.1"

remotedev-inspector-monitor@^0.10.0:
version "0.10.1"
resolved "https://registry.yarnpkg.com/remotedev-inspector-monitor/-/remotedev-inspector-monitor-0.10.1.tgz#fa2d3dd87328a2d4147c006b48ffa540f46faa20"
remotedev-inspector-monitor@^0.10.2:
version "0.10.2"
resolved "https://registry.yarnpkg.com/remotedev-inspector-monitor/-/remotedev-inspector-monitor-0.10.2.tgz#2f6618fc2a2d5aa9d57e97baa21b9cb4f330f638"
dependencies:
babel-runtime "^6.3.19"
dateformat "^1.0.12"
Expand All @@ -5448,7 +5448,7 @@ remotedev-inspector-monitor@^0.10.0:
lodash.debounce "^4.0.3"
react-base16-styling "^0.4.1"
react-dragula "^1.1.17"
react-json-tree "^0.10.0"
react-json-tree "0.10.0"
react-pure-render "^1.0.2"
redux-devtools-themes "^1.0.0"

Expand All @@ -5459,13 +5459,6 @@ remotedev-monitor-components@^0.0.2:
codemirror "^5.21.0"
styled-components "^1.1.1"

remotedev-monitor-components@^0.0.4:
version "0.0.4"
resolved "https://registry.yarnpkg.com/remotedev-monitor-components/-/remotedev-monitor-components-0.0.4.tgz#b782c3992c89367f04af5ca1fc63b81b582c761a"
dependencies:
codemirror "^5.21.0"
styled-components "^1.1.1"

remotedev-monitor-components@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/remotedev-monitor-components/-/remotedev-monitor-components-0.0.5.tgz#3a8142a0795f4893d665e42e1d4825fe7536104d"
Expand Down

0 comments on commit 4290116

Please sign in to comment.