GithubHelp home page GithubHelp logo

lautaro-osacar / remotedev-rn-debugger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kent-hardstep/remotedev-rn-debugger

0.0 0.0 0.0 1.44 MB

Injecting remotedev-app monitor into official Remote debugger of React Native. (formerly remote-redux-devtools-on-debugger)

License: MIT License

CSS 4.00% JavaScript 96.00%

remotedev-rn-debugger's Introduction

remotedev-rn-debugger

Build Status NPM version Dependency Status devDependency Status

Demo

Injecting remotedev-app monitor into official Remote debugger of React Native. (formerly remote-redux-devtools-on-debugger)

We can use it with:

NOTE We will stop publish the old name remote-redux-devtools-on-debugger on next major version v0.9.

Installation

$ npm install --save-dev remotedev-rn-debugger

Usage

Add command to your project's package.json:

"scripts": {
  "postinstall": "remotedev-debugger [options]"
}

It will be run after npm install. (You can run npm run postinstall first)
The ./node_modules/react-native/local-cli/server/util/debugger.html will be replaced.

Options (--option)

Name Description
hostname The remotedev-server hostname. (default: localhost if port is set)
port The remotedev-server port. (default: 8000 if runserver or hostname is set)
runserver Start the remotedev-server with hostname, port option on local. (default: false)
secure Use https protocol for hostname. If you're use runserver or injectserver option, you can provide key, cert, passphrase options for remotedev-server. (default: false)
injectserver Inject remotedev-server with hostname, port option to node_modules/react-native/local-cli/server/server.js, then you can start ReactNative local server and RemoteDev local server with one command ($ npm start). (default: false)
injectdebugger Inject remotedev-app with hostname, port option to node_modules/react-native/local-cli/server/util/debugger.html. (default: true)
macos Use react-native-macos module name instead of react-native. (default: false)
revert Revert all injection. (default: false)
wsengine The web socket engine used in remotedev-server: ws or uws. If not set, remotedev-server default value is used. (default: undefined)

If you not set hostname or port or runserver or injectserver, it will apply default options.

Example - Use custom options in React Native project

You can ignore this guide if you used default options.

Install dev dependencies

$ npm install --save-dev remote-redux-devtools
$ npm install --save-dev remotedev-rn-debugger

Add command

Add command to your project's package.json:

"scripts": {
  "postinstall": "remotedev-debugger --hostname localhost --port 5678 --injectserver"
}

It will be run after npm install. (You can run npm run postinstall first)
If you debug on real device, you should use LAN IP as a hostname.

Edit configureStore.js

import { Platform } from 'react-native';
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import devTools from 'remote-redux-devtools';
import reducer from '../reducers';

export default function configureStore(initialState) {
  const enhancer = compose(
    applyMiddleware(thunk),
    devTools({
      name: Platform.OS,
      hostname: 'localhost',
      port: 5678
    })
  );
  return createStore(reducer, initialState, enhancer);
}

You can reference this example.

License

MIT

remotedev-rn-debugger's People

Contributors

jhen0409 avatar zalmoxisus avatar skovhus avatar iqqmut avatar

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.