Coder Social home page Coder Social logo

remote-redux-devtools's Introduction

Remote Redux DevTools

This package was renamed to @redux-devtools/remote and merged into redux-devtools monorepo. Please refer to that repository for the latest updates, issues and pull requests.

Demo

Use Redux DevTools remotely for React Native, hybrid, desktop and server side Redux apps.

Installation

npm install --save-dev remote-redux-devtools

Note: for Windows use [email protected] (newer versions will not work due to a Windows issue fixed in react-native).

Usage

There are 2 ways of usage depending if you're using other store enhancers (middlewares) or not.

Add DevTools enhancer to your store

If you have a basic store as described in the official redux-docs, simply replace:

import { createStore } from 'redux';
const store = createStore(reducer);

with

import { createStore } from 'redux';
import devToolsEnhancer from 'remote-redux-devtools';
const store = createStore(reducer, devToolsEnhancer());
// or const store = createStore(reducer, preloadedState, devToolsEnhancer());

Note: passing enhancer as last argument requires redux@>=3.1.0

When to use DevTools compose helper

If you setup your store with middlewares and enhancers like redux-saga and similar, it is crucial to use composeWithDevTools export. Otherwise, actions dispatched from Redux DevTools will not flow to your middlewares.

In that case change this:

import { createStore, applyMiddleware, compose } from 'redux';

const store = createStore(reducer, preloadedState, compose(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

to:

import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'remote-redux-devtools';

const store = createStore(reducer, /* preloadedState, */ composeWithDevTools(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

or with devTools' options:

import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'remote-redux-devtools';

const composeEnhancers = composeWithDevTools({ realtime: true, port: 8000 });
const store = createStore(reducer, /* preloadedState, */ composeEnhancers(
  applyMiddleware(...middleware),
  // other store enhancers if any
));

Enabling

In order not to allow it in production by default, the enhancer will have effect only when process.env.NODE_ENV === 'development'.

For Webpack you should add it as following (webpack.config.dev.js):

// ...
plugins: [
  new webpack.DefinePlugin({
    'process.env.NODE_ENV': JSON.stringify('development')
  })
],
// ...

In case you don't set NODE_ENV, you can set realtime parameter to true or to other global variable to turn it off in production:

const store = createStore(reducer, devToolsEnhancer({ realtime: true }));

Monitoring

Use one of our monitor apps to inspect and dispatch actions:

Use remotedev-app to create your own monitor app.

Communicate via local server

Use remotedev-server cli to run it locally in order to make the connection faster and not to require an internet connection. You can import it in your server.js script and start remotedev server together with your development server:

var remotedev = require('remotedev-server');
remotedev({ hostname: 'localhost', port: 8000 });

See remotedev-server repository for more details. For React Native you can use remotedev-rn-debugger, which already include remotedev-server.

Parameters

Name Description
name String representing the instance name to be shown on the remote monitor.
realtime Boolean specifies whether to allow remote monitoring. By default is process.env.NODE_ENV === 'development'.
hostname String used to specify host for remotedev-server. If port is specified, default value is localhost.
port Number used to specify host's port for remotedev-server.
secure Boolean specifies whether to use https protocol for remotedev-server.
maxAge Number of maximum allowed actions to be stored on the history tree, the oldest actions are removed once maxAge is reached. Default is 30.
actionsBlacklist array of actions to be hidden in DevTools. Overwrites corresponding global setting in the options page. See the example bellow.
actionsWhitelist array of actions to be shown. All other actions will be hidden in DevTools.
actionSanitizer Function which takes action object and id number as arguments, and should return action object back. See the example bellow.
stateSanitizer Function which takes state object and index as arguments, and should return state object back. See the example bellow.
startOn String or Array of strings indicating an action or a list of actions, which should start remote monitoring (when realtime is false).
stopOn String or Array of strings indicating an action or a list of actions, which should stop remote monitoring.
sendOn String or Array of strings indicating an action or a list of actions, which should trigger sending the history to the monitor (without starting it). Note: when using it, add a fetch polyfill if needed.
sendOnError Numeric code: 0 - disabled (default), 1 - send all uncaught exception messages, 2 - send only reducers error messages.
sendTo String url of the monitor to send the history when sendOn is triggered. By default is ${secure ? 'https' : 'http'}://${hostname}:${port}.
actionCreators Array or Object of action creators to dispatch remotely. See the example.
shouldHotReload Boolean - if set to false, will not recompute the states on hot reloading (or on replacing the reducers). Default to true.
shouldRecordChanges Boolean - if specified as false, it will not record the changes till clicked on "Start recording" button on the monitor app. Default is true.
shouldStartLocked Boolean - if specified as true, it will not allow any non-monitor actions to be dispatched till lockChanges(false) is dispatched. Default is false.
id String to identify the instance when sending the history triggered by sendOn. You can use, for example, user id here, to know who sent the data.
suppressConnectErrors Boolean - if set to false, all socket errors thrown while trying to connect will be printed to the console, regardless of if they've been thrown before. This is primarily for suppressing SocketProtocolError errors, which get repeatedly thrown when trying to make a connection. Default is true.

All parameters are optional. You have to provide at least port property to use localhost.

Example:

export default function configureStore(preloadedState) {
  const store = createStore(
    reducer,
    preloadedState,
    devToolsEnhancer({
      name: 'Android app', realtime: true,
      hostname: 'localhost', port: 8000,
      maxAge: 30, actionsBlacklist: ['EFFECT_RESOLVED'],
      actionSanitizer: (action) => (
       action.type === 'FILE_DOWNLOAD_SUCCESS' && action.data ?
       { ...action, data: '<<LONG_BLOB>>' } : action
      ),
      stateSanitizer: (state) => state.data ? { ...state, data: '<<LONG_BLOB>>' } : state
    })
  );
  return store;
}

Demo

Examples

License

MIT

remote-redux-devtools's People

Contributors

alvin777 avatar carloscuatin avatar corbt avatar fredyc avatar g-rath avatar gaearon avatar gramidt avatar jdeniau avatar jhen0409 avatar jkzing avatar kellenproctor avatar lukermelesh avatar methuselah96 avatar mikepugh avatar mlabrum avatar pex avatar stjepangolemac avatar tristanlievens avatar zalmoxisus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remote-redux-devtools's Issues

import not being reflected on device

Hello,
thanks for this great tool! I'm having a problem with import: I'm running a android 5.1.1. device connected through usb. The chrome extension correctly gets the state changes when they happen and I can go back and forth between them. Export works. But then when start the app anew and import the file exported previously, I get the state changes listed but going between them isn't reflected on the device.

Any idea what could be wrong? I tried this with the remotedev.io as well as the local server. Thank you.

Logging server-side actions

Hi @zalmoxisus! I am building a universal app that needs to support SSR. I wasn't sure from the documentation if this library would be appropriate for that?

Ideally, I am looking to get the actions logged on the terminal on the server to show up on the extension. So far in setting it up, it seems that the actions that execute on the server still get logged there and subsequent actions get logged on the extension.

Is that a problem with my setup?

Here is what my code looks like right now:

const composeEnhancers = composeWithDevTools({ realtime: true, port: 8000 });
//const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

store = createStore(
  reducer,
  initialState,
  composeEnhancers(
    applyMiddleware(...middleware),
    persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/))
  )
);

Thank for you all your work on all the extension tools!

Error: Naming collision detected

Hi guys,
I did npm install remote-redux-devtools.
My package.json has:
"devDependencies": {
"react-native-cli": "^0.1.7",
"remote-redux-devtools": "^0.1.2"
}
and when I did run react-native start I got the follow collision.
I tried to solved it by remove the inner react folder but it didn't work.
I did npm uninstall and install to that module and to all my modules but it didn't solve it

That is the Error massage:

Error building DependencyGraph:
Error: Naming collision detected: /Users/oren/Documents/platform-app/node_modules/react-native/node_modules/react/lib/webcomponents.js collides with /Users/oren/Documents/platform-app/node_modules/remote-redux-devtools/node_modules/redux-devtools/node_modules/react/lib/webcomponents.js
at HasteMap._updateHasteMap (HasteMap.js:132:13)
at HasteMap.js:103:28
at tryCallOne (/Users/oren/Documents/platform-app/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
at /Users/oren/Documents/platform-app/node_modules/react-native/node_modules/promise/lib/core.js:123:15
at flush (/Users/oren/Documents/platform-app/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
at doNTCallback0 (node.js:407:9)
at process._tickCallback (node.js:336:13)

Please assist
Thanks

Having trouble getting any of the monitoring solutions to work

I tried:

redux-devtools-extension - Click "Remote" button (or press Cmd+Ctrl+Arrow up) to open remote monitoring.
^ Got the actions to show up but for some reason it completely freezes after a few actions, shortly after starting the app.

remote-redux-devtools-on-debugger - Used in React Native debugger as a dock monitor.
^ Can't get this one to show up.

atom-redux-devtools - Used in Atom editor.
^ Doesn't freeze on me, however the "Dispatcher" won't let me properly edit and keeps giving hasOwnProperty error.

only initial state is received, no actions recorded (React Native)

When I reload my app, I see the initial state in the redux dev tools. But when I perform any actions, none are recorded. The funny thing is the very first time I ran the dev tools, the actions were recorded, but not after that, and I've restarted the dev server, my app, and the chrome app several times.

looping the slider

I read an article a few months ago--I think by @zalmoxisus--about how @gaearon was initially interested in being able to have his application states looped through while he made changes to the code. It seems it would be trivial at this point to implement that in the redux devtools slider. Perhaps with 2 modes:

  • looping from left to right, then from right to left, repeat (i.e. like "pong")
  • looping from left to right, then left to right again, repeat

Are there any challenges to implementing this or reasons why nobody has done it yet?

Only load devTools if local server is 'up'

I would like to add devTools to the store only if the local server is up. Because this is an async operation I end up with an 'incomplete' store.

The async function which checks if the server is there:

export async function isReduxDevServerAlive(url,port, secure = false) {
    const server = secure ? 'https' : 'http' + `://${url}:${port}`;
    try {
        let response = await fetch(server);
        return true;
    } catch(error) {
        return false;
    }
}

The store.js script

import thunk from 'redux-thunk';
import devTools from 'remote-redux-devtools';
import { isReduxDevServerAlive } from './util/dev'
import { createStore, applyMiddleware, combineReducers, compose } from 'redux';

import * as reducers from './reducers';
import * as constants from './constants';

let composable = [ applyMiddleware(thunk) ];
const reducer = combineReducers(reducers);

if(isReduxDevServerAlive(constants.REDUX_DEV_SERVER, constants.REDUX_DEV_SERVER_PORT))
{
    composable.push(
        devTools({
            name: 'EPP app', realtime: true,
            hostname: constants.REDUX_DEV_SERVER, port: constants.REDUX_DEV_SERVER_PORT,
            maxAge: 30, filters: {blacklist: ['EFFECT_RESOLVED']}
        })
    );
}

const bconfigureStore = (c) => {
        return createStore(reducer,{},compose(...c));
}

export default function configureStore() {
    return bconfigureStore(composable);
}

The script should wait to export till when it knows if the server is up or down. Could you help me out how to accomplish this?

Issue installing

I have a weird issue installing which prevents me from using this, the issue seems to be from querystring where it believes this depends on a version 1.2.0 and query string only goes up to 0.2.0:

npm install --save-dev remote-redux-devtools
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.3.1/bin/node" "/usr/local/bin/npm" "install" "--save-dev" "remote-redux-devtools"
npm ERR! node v6.3.1
npm ERR! npm v3.10.6

npm ERR! No compatible version found: [email protected]
npm ERR! Valid install targets:
npm ERR! 0.2.0, 0.1.0, 0.0.4, 0.0.1
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

Unknown named module: 'crypto'

E/ReactNativeJS: Unknown named module: 'crypto'
When i do import import devToolsEnhancer from 'remote-redux-devtools';

Error: Actions must be plain objects.

I am trying to include remote-redux-devtools in a react-native app, but I am consistently getting the below error in the app:
Actions must be plain objects. Use custom middleware for async actions.

screenshot_1490714483

This error does not occur when not using composeWithDevTools

Below are the concerned files:

index.android.js

import React, { Component } from 'react'
import { AppRegistry, View } from 'react-native'
import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import { Provider } from 'react-redux'
import composeWithDevTools from 'remote-redux-devtools'

// Import the reducer and create a store
import { reducer } from './app/reducers/postsRedux'

// Add the thunk middleware to our store
const store = createStore(reducer, composeWithDevTools(applyMiddleware(thunk)))

// Import the App container component
import App from './app/App'

// Pass the store into the Provider
const AppWithStore = () => (
    <Provider store={store}>
        <App />
    </Provider>
)
AppRegistry.registerComponent('SocializeApp', () => AppWithStore)

App.js

import React, { Component } from 'react'
import { View, Text, ActivityIndicator, ScrollView, TouchableOpacity, StyleSheet } from 'react-native'
import { connect } from 'react-redux'

import { actionCreators } from './reducers/postsRedux'

const mapStateToProps = (state) => ({
    loading: state.loading,
    error: state.error,
    posts: state.posts,
})

class App extends Component {

    componentWillMount() {
        const { dispatch } = this.props

        dispatch(actionCreators.fetchPosts())
    }

    renderPost = ({ id, title, body }, i) => {
        return (
            <View
                key={id}
                style={styles.post}
            >
                <View style={styles.postNumber}>
                    <Text>{i + 1}</Text>
                </View>
                <View style={styles.postContent}>
                    <Text>
                        {title}
                    </Text>
                    <Text style={styles.postBody}>
                        {body}
                    </Text>
                </View>
            </View>
        )
    }

    render() {
        const { posts, loading, error } = this.props

        if (loading) {
            return (
                <View style={styles.center}>
                    <ActivityIndicator animating={true} />
                </View>
            )
        }

        if (error) {
            return (
                <View style={styles.center}>
                    <Text>
                        Failed to load posts!
          </Text>
                </View>
            )
        }

        return (
            <View style={styles.container}>
                <ScrollView style={styles.container}>
                    {posts.map(this.renderPost)}
                </ScrollView>
                
            </View>
        )
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
    },
    post: {
        flexDirection: 'row',
    },
    postNumber: {
        width: 50,
        justifyContent: 'center',
        alignItems: 'center',
    },
    postContent: {
        flex: 1,
        borderBottomWidth: 1,
        borderBottomColor: '#EEE',
        paddingVertical: 25,
        paddingRight: 15,
    },
    postBody: {
        marginTop: 10,
        fontSize: 12,
        color: 'lightgray',
    },
    center: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
    },
    button: {
        height: 50,
        justifyContent: 'center',
        alignItems: 'center',
        borderTopWidth: 1,
        borderTopColor: 'lightgray',
    }
})

export default connect(mapStateToProps)(App)

postsRedux.js

let results =
    [
        {
            "userId": 1,
            "id": 1,
            "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
            "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
        },
        {
            "userId": 2,
            "id": 2,
            "title": "qui est esse",
            "body": "est rerum tempore vitae\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\nqui aperiam non debitis possimus qui neque nisi nulla"
        }
    ]



export const types = {
    FETCH_POSTS_REQUEST: 'FETCH_POSTS_REQUEST',
    FETCH_POSTS_RESPONSE: 'FETCH_POSTS_RESPONSE',
    CLEAR_POSTS: 'CLEAR_POSTS',
}


export const actionCreators = {
    fetchPosts: () => async (dispatch, getState) => {
        dispatch({ type: types.FETCH_POSTS_REQUEST })

        setTimeout(function () {
            dispatch({ type: types.FETCH_POSTS_RESPONSE, payload: results })
        }, 3000);        
    }
}

const initialState = {
    loading: true,
    error: false,
    posts: [],
}

export const reducer = (state = initialState, action) => {
    const { todos } = state
    const { type, payload, error } = action

    switch (type) {
        case types.FETCH_POSTS_REQUEST: {
            return { ...state, loading: true, error: false }
        }
        case types.FETCH_POSTS_RESPONSE: {
            if (error) {
                return { ...state, loading: false, error: true }
            }

            return { ...state, loading: false, posts: payload }
        }
    }

    return state
}

the devtools share all state history of other device

We use the devtools, but when I open the devtools , I found the Inspector appear many other devices state log which were my teammates device create. I mean the devtools share all other devices state log.

How to set it only listen to my device and only show my state history?

[Feature Request] Inline Editing

It would be awesome if we had the ability to do inline editing of the state tree. In particular I want to be able to right click a node and delete all of its children. Thoughts?

Filter actions out of view

I'm using react-native-router-flux and for each route change it fires several actions. Ideally, I'd like to filter out these actions from being displayed in RemoteDev because they create a lot of noise; they'd still fire in the background, but I would prefer not to see them displayed. I have a similar situation with Sagas. I came across another library of yours, but it doesn't seem compatible. https://github.com/zalmoxisus/redux-devtools-filter-actions

Do you have any thoughts on how to achieve this?

i can't get this to work!

screenshot_2017-01-04-20-56-50

I've tried to change the version but is not working.

I've a windows machine:

the current version is:
0.5.7 for remote-redux-devtools
5.2.4 socketcluster-client

Usage with only basic node

Hi!
I'd love to use remote-devtools for my node application, but I can't seem to make it work.

Eg. I tried to remote-devtools-ify the most basic example app from the redux repo, and even this one does not seem to connect to my remote-devtools interface. Is it even possible to have remote-devtools work without a browser / React Native interface?

import { createStore } from 'redux'
import devTools from 'remote-redux-devtools'

function counter(state = 0, action) {
  switch (action.type) {
  case 'INCREMENT':
    return state + 1
  case 'DECREMENT':
    return state - 1
  default:
    return state
  }
}

let store = devTools()(createStore)(counter)
store.subscribe(() => console.log(store.getState()))

console.log('Get to your remote devtools application!')
setTimeout(() => store.dispatch({ type: 'INCREMENT' }), 2000)
setTimeout(() => store.dispatch({ type: 'INCREMENT' }), 3000)
setTimeout(() => store.dispatch({ type: 'INCREMENT' }), 4000)

It's worth noting that all the examples from this repo work just fine 😄

Support multiple instances

We need to identify the app instance, so not to mix up the actions in case the monitor receives them from multiple instances.

There should be 2 options of dealing with different instances (or apps) simultaneously:

  1. As independent instances (need a way to select instances in the monitor).
  2. Synchronize them as follows:
    remote

Unknown module "ws" exception on Windows

screenshot_2016-08-21-13-40-42 1

I'm developing on windows 10 + android 5.0 device.
After installing remote-redux-devtools as described on readme.md i got the error
Requiring unknown module "url"
It seems socketcluster-client uses ws/WebSocket.js and do a require("url") and this raises the error

On the web I have not found similar problems so I'm worried this happen only to me

this my package.json
`{

"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "15.2.1",
"react-native": "0.30.0",
"react-redux": "^4.4.5",
"redux": "^3.5.2"
},
"devDependencies": {
"remote-redux-devtools": "^0.4.2"
}
}`

Problem with multiple stores (redux-saga)

Hi, I use multiple stores on a serverside Redux projects. I also use the redux-saga middleware.

When I enable remote-redux-devtools, I get a mixup of states. It seems the middleware is merging all actions dispatched on any store into the last store. I only see the latest store in remotedev.io and the redux generator function (main) of the last store seems to "take" all the actions.

I initialize with different names for the "instances", all in the same process.

Could there be an issue with multiple remote-redux-devtools in the same process, or something with sagas?

I tried deleting the node "require-cache" between calls, to no avail.

My source (typescript) below, work in progress. I have commented out the devtools and things work perfectly.

const RemoteDevTools = require('remote-redux-devtools')
const {composeWithDevTools} = RemoteDevTools

function* mainLoop() : any {
	const {scenarioId} = yield take(SET_SCENARIO)
	console.log("got scenario: ", scenarioId)
	const channel = yield actionChannel('*')
	yield delay(2000)
	yield put(initialized())
	const testState = (yield select()) as IState
	console.log(`state scenario: ${testState.initialized.scenarioId}`)
	while (true) {
		const action = yield take(channel)
		console.log(`got action (${scenarioId}): `, action)
	}
}

export function createScenarioStore(scenarioId: string) {

	// This causes the remote dev tool to use remotedev.io, which can be accessed at remotedev.io/local
	const composeEnhancers = composeWithDevTools({ realtime: true, name: `scenario_${scenarioId}` }) 
	
	const middleware = createSagaMiddleware()
	const store = createStore(mainReducer, applyMiddleware(middleware)) // composeEnhancers(applyMiddleware(middleware)))

	middleware.run(mainLoop)
	store.dispatch(setScenario(scenarioId))

	return store
}

BTW: This project / tool is absolutely excellent!

SocketProtocolError [react-native]

Everything launches fine but console logs the following repetitively and no actions are captured:

SocketProtocolError {
  name: "SocketProtocolError", 
  message: "Client connection establishment timed out",
  code: 4007
}

Ubuntu: 14.04
chrome: Version 49.0.2623.108 (64-bit)
react-native: 19.0
redux: 3.3.1

Remote debuging log another computer simulator

Hello,

We don't know if this is an issue, but we are having 2 pc on the same network (Win7 and a Mac). Both running the same application with remote-redux-devtools 0.5.0 and no special configuration on package.json. The strange thing is that when we have open from the win7 the debugger (http://localhost:8081/debugger-ui) we are catching all actions triggered from Macos Simulator!!

I really cannot understand that! Is this a configuration or something?

with composeWithDevTools, couldn't use 'dispatch' in the action creator.

I want to know the reason why 'remote-redux-devtools' can't work with 'redux-thunk'.

  • I think the reason would be 'compose()' not working in 'composeWithDevTools()'

  1. not working, 'remote-redux-devtools' with 'redux-thunk'

1-1. When I use 'remote-redux-devtools' with 'redux-thunk', I can't use 'dispatch'.
const composeEnhancers = composeWithDevTools({ realtime: true })
const store = createStore(reducer, composeEnhancers(
applyMiddleware(thunk)
))

error1

1-2. When I use 'remote-redux-devtools' like below, it looks like 'compose()' doesn't work.
const store = createStore(reducer, composeWithDevTools(
applyMiddleware(thunk)
))

error2

  1. When I use 'redux-logger' instead of 'remote-redux-devtools', it works fine.
    const logger = createLogger()
    const store = createStore(reducer, compose(
    applyMiddleware(
    thunk,
    logger
    )
    ))

  2. package
    "react": "15.4.2",
    "react-native": "0.40.0",
    "react-redux": "^5.0.3",
    "redux": "^3.6.0",
    "redux-logger": "^2.8.2",
    "redux-thunk": "^2.2.0"

"remote-redux-devtools": "^0.5.7"

Problem of `isMonitored`

I using redux-persist with autoRehydrate in my project, it will dispatch persist/REHYDRATE after @@INIT, but isMonitored is false at the beginning, so my monitor doesn't receive persist/REHYDRATE. (The START message is relatively late)

Empty Store

I've tried to add the remote redux devtools,
using the following syntax

const store = createStore( rootReducer, composeWithDevTools( applyMiddleware(thunk) ) )

(in this file )
When I start the app, I can see all the console.log logs in the console, but the store (State chart) is empty, the tree is empty, and no action is tracked.
Any advice?

Broken on react-native 0.44

After injectserver, the final server.js code end up like this:

...

/* remotedev-server end */
 *
 * This source code is licensed under the BSD-style license found in the

...

Throwing the error node_modules/react-native/local-cli/server/server.js: Unexpected token (10:1)

   8 |       );
   9 | /* remotedev-server end */
> 10 |  *

Support `store.dispatch` for handleMessages

Currently the handleMessages have store.liftedStore.dispatch, it used for devtools. I think we can have behavior of store.dispatch. (maybe APP_DISPATCH?)

It will can dispatch app action with remotedev-app (it also need to support APP_DISPATCH for store.dispatch), like this on node REPL:

> const createRemoteStore = require('remotedev-app/lib/store/createRemoteStore').createRemoteStore
> const store = createRemoteStore({ hostname: 'localhost', port: 8000 }, f => f, 'auto')
> store.dispatch({ type: 'xxx' })

remote-redux-devtools not working in genymotion emulator or device

I am hoping to use remote-redux-devtools to help debug a new react native app. However, for some reason, the remote redux devtools (chrome extension) stopped working and it shows no update. I initially thought it was due to GFW since I am in China and have folllowed the instructions on remotedev-server to establish socket connections through local server (remotedev-server). Still, no success.

In addition, I cloned the example app and the remote redux devtools doesn't show anything either. Thus, I am confused about the cause of the issue.

My repo: Its just a simple app that I hope to integrate with firebase link

Also, I am seeing warnings such as TimeoutError {name: "TimeoutError", message: "Event response for 'login' timed out"} and SocketProtocolError {name: "SocketProtocolError", message: "Client connection establishment timed out", code: 4007}. (both with remotedev or local server, and in both genymotion emulator and actual device Asus ZenFone 2)

Packages:
"react": "15.2.1",
"react-native": "^0.30.0",
"react-native-router-flux": "^3.32.0",
"react-redux": "^4.4.5",
"redux": "^3.5.2",
"redux-logger": "^2.6.1",
"redux-thunk": "^2.1.0"

Would appreciate any gudiance!
The devtools helped me greatly before!

Issue on device

This doesn't appear to happen on the simulator, I've got this error when I access (and then close) an specific view within my app: JSON.stringify cannot serialize cyclic structures.

ST:
2016-07-27 01:19:24.812 [error][tid:com.facebook.react.JavaScript] JSON.stringify cannot serialize cyclic structures.
2016-07-27 01:19:24.815 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: JSON.stringify cannot serialize cyclic structures.

  • stringify @ index.js:28
  • relay @ devTools.js:103
  • handleChange @ devTools.js:267
  • @ devTools.js:290
  • dispatch @ createStore.js:186
  • dispatch @ intrument.js:442

Socket connection failed for unknown reasons with redux-thunk on react-native

Hi
I have react-native app, and i have redux-thunk middleware.

If i dispatch a thunk function, which is Promise and dispatches another tunk function in it self everythink works, exept in a few seconds remote-redux-devtools get disconnected. https://github.com/zalmoxisus/remote-redux-devtools/blob/master/src/devTools.js#L191

Aplications works as expected, remote debug works, console.logs works ..

But the redux-devtools stops working.

I can provide and example app, i have tried to debug it but with no success.

Error in React Native when connected to Chrome debugger

When the app is connected to chrome debugger, it shows the following error message,

screenshot_20160110-174529

I don't see the @@INIT action, so I assume it's unable to connect.

It works fine if not connected to the debugger. For now I detect if the app is running in a web worker instance and disable the dev tools.

const middlewares = [ applyMiddleware(thunk) ];

if (typeof global.self === 'undefined') {
    middlewares.push(devTools());
}

const finalCreateStore = compose(
    ...middlewares
)(createStore);

Instances aren't linked like demo.gif

I think I have everything setup correctly but each instance is independent. How do you get the instances to be linked the way they are in the demo.gif?

Some configuration mistakes in my React-Native project?

Hello,I just started using devtools.
I can see the store-tree in Chat ,but I don't see any response in Inspector when I click the Add button...
Thanks

const store = createStore(
    reducers,
    initialState,
    compose(
      applyMiddleware(thunk),
      devTools()
    )
  );

1

Some state changes are not displayed

I got stuck on something I thought was a bug in my code but it turns out the devtools monitor doesn't display the state properly.

After I dispatch a specific action and print a property in the new state before I return it, it is displayed like this as it should:

console.log(newState.localWallposts)
{ '363755918678537':
  { '1492602002':
 { id: 1492602002,
 text: 'test',
  received: true,
  error: false,
_stamp: 1492602002,
user_id: 359346589177349,
realId: 365061224315545 } } }

However, when I look in the state and diff for that action in devtools it is displayed like this:

localWallposts (pin): {
363755918678537 (pin) : { } 
}

Same in the "Raw" tab.

I looked around and maybe it is related to this? zalmoxisus/redux-devtools-extension#124
I'm really not sure though, I use a normal javascript object as far as I know.

Any ideas?

"Socket hung up"

Dependencies as follows.When debugger in browser, the result as follows. I don't know weather the react-native of 0.42.0 result in this problem.

"dependencies": {
    "antd-mobile": "^1.0.1",
    "react": "~15.4.0",
    "react-dom": "~15.4.0",
    "react-native": "0.42.0",
    "react-native-vector-icons": "^4.0.0",
    "react-redux": "^5.0.3",
    "react-web": "0.4.6",
    "redux": "^3.6.0",
    "redux-thunk": "^2.2.0"
  },
  "devDependencies": {
    "babel-jest": "19.0.0",
    "babel-loader": "^6.2.5",
    "babel-plugin-import": "^1.1.1",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-react-native": "^1.9.0",
    "babel-preset-stage-1": "^6.16.0",
    "haste-resolver-webpack-plugin": "^0.2.2",
    "jest": "19.0.2",
    "json-loader": "^0.5.4",
    "react-devtools": "^2.0.12",
    "react-hot-loader": "^1.3.0",
    "react-test-renderer": "~15.4.0",
    "remote-redux-devtools": "0.5.0",
    "remote-redux-devtools-on-debugger": "^0.7.0",
    "webpack": "^1.13.2",
    "webpack-dev-server": "^1.16.1",
    "webpack-html-plugin": "^0.1.1"
  },

image

package.json in v0.5.2 yarn package still refers to socketcluster-client 5.0.14

I experienced #51 and upgraded from v0.5.1 to v0.5.2 (with yarn upgrade ...), but I still got the JSON value '1' ... error.

Upon closer inspection, the package.json in https://registry.yarnpkg.com/remote-redux-devtools/-/remote-redux-devtools-0.5.2.tgz still includes a reference to socketcluster-client 5.0.14, even though it probably should point to 5.0.17, as seen in https://github.com/zalmoxisus/remote-redux-devtools/blob/master/package.json (and mentioned in #51).

Not sure where such a problem could have been introduced (or whether it is a yarn issue).

Does remote-redux-devtools will be packed to the production bundle?

Thanks for your awsome tools.
But I have two questions plaguing:

  • We import remote-redux-devtools in our js code, So whether it will be packed to the bundle?
  • Meanwhile, we install remote-redux-devtools in devDependencies, whether it will throw error when run with production dependencies?

secure option isn't used for wss: Websockets

The secure parameter option isn't used to set the SocketCluster client options. I'd have expected it would be.

https page end-up with:

was not allowed to run insecure content from ws://remotedev.io/socketcluster/.

Looking into the code it looks like secure is only passed when port is defined, but I don't understand why? Is it because remotedev.io doesn't support wss?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.