RemoteDev
Monitoring flux app's actions along with states to a remote monitor. Meant to be used even in production with any flux architecture for web, universal, React Native, hybrid, desktop and server side apps.
Installation
NPM
npm install --save-dev remotedev
CDN
<script src="https://unpkg.com/remotedev/dist/remotedev.min.js"></script>
Usage
import { connectViaExtension, extractState } from 'remotedev';
// It will try to use Redux DevTools extension first if installed
// In case you want only remote monitoring use `connect`:
// import { connect, extractState } from 'remotedev';
// Connect to the monitor
remotedev = connectViaExtension();
// Subscribe to change state (if need more than just logging)
remotedev.subscribe(message => {
// Helper when only time travelling needed
const state = extractState(message);
this.setState(state);
});
// Send changes to the remote monitor
remotedev.send(action, state);
See the examples for different flux architectures.
Monitoring
Use one of our monitor apps to inspect and dispatch actions:
- web
- redux-devtools-extension - Click "Remote" button (or press
Cmd+Ctrl+Arrow up
) to open remote monitoring. - react-native-debugger - Electron app, which already includes
remotedev-server
,remotedev-app
and even React DevTools. - chrome app.
- remotedev-rn-debugger - Used in React Native debugger as a dock monitor.
- atom-redux-devtools - Used in Atom editor.
- redux-dispatch-cli - A CLI tool for Redux remote dispatch.
Use remotedev-app to create your own monitor app.
Communicate via local server
In order to make it simple to use, by default, the module and the monitor app communicate via remotedev.io 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
.
License
MIT