From 4c45dbc2199878adf9950e11993f4f7ae3466dc9 Mon Sep 17 00:00:00 2001 From: Steve Kellock Date: Fri, 15 Jul 2016 15:30:15 -0400 Subject: [PATCH] Prep for 0.7.0. --- CHANGES.md | 49 ++++++++++++++++++++++++----------------------- README.md | 1 - bin/reactotron.js | 2 +- dist/client.js | 21 ++++++++++++++++++-- dist/index.js | 2 +- 5 files changed, 46 insertions(+), 29 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0c8eae30f..5ed201a9d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,49 +1,50 @@ -### NEXT +### July 15, 2016 - 0.7.0 -* `NEW` adds an example to the dispatch modal - thx [@darinwilson](https://github.com/darinwilson) +* `NEW` android ip auto-detection support! - [@jhen0409](https://github.com/jhen0409) +* `NEW` adds an example to the dispatch modal - [@darinwilson](https://github.com/darinwilson) +* `NEW` updates the React DOM example to this century - [@skellock](https://github.com/skellock) ### April 27, 2016 - 0.6.1 -* `FIX` adds compatibility with Node 4.x and npm 2.x - thx [@skellock](https://github.com/skellock) - found by [@maraujop](https://github.com/maraujop) and [@avioli](https://github.com/avioli) -* `MOD` no longer using `fbjs` for `performanceNow()` - thx [@skellock](https://github.com/skellock) - found by [@avioli](https://github.com/avioli) +* `FIX` adds compatibility with Node 4.x and npm 2.x - [@skellock](https://github.com/skellock) - found by [@maraujop](https://github.com/maraujop) and [@avioli](https://github.com/avioli) +* `MOD` no longer using `fbjs` for `performanceNow()` - [@skellock](https://github.com/skellock) - found by [@avioli](https://github.com/avioli) ### April 24, 2016 - 0.6.0 -* `NEW` adds a way to do benchmarks - thx [@skellock](https://github.com/skellock) -* `NEW` press `c` to see connected clients - thx [@andrewvy](https://github.com/andrewvy) +* `NEW` adds a way to do benchmarks - [@skellock](https://github.com/skellock) +* `NEW` press `c` to see connected clients - [@andrewvy](https://github.com/andrewvy) ### April 23, 2016 - 0.5.0 -* `NEW` additional details about the client are now shown when connecting - thx [@andrewvy](https://github.com/andrewvy) -* `NEW` client count is shown in status bar - thx [@andrewvy](https://github.com/andrewvy) -* `NEW` a simpler way to integrate redux with an enhancer - thx [@andrewvy](https://github.com/andrewvy) -* `FIX` adds a .babelrc to the react native example app - thx [@skellock](https://github.com/skellock) -* `FIX` the redux action timer is showing the correct times again - thx [@skellock](https://github.com/skellock) -* `MOD` adds a working Android example app - thx [@skellock](https://github.com/skellock) -* `DOC` made a note about ensuring `connect()` gets triggered first in your app - thx [@skellock](https://github.com/skellock) +* `NEW` additional details about the client are now shown when connecting - [@andrewvy](https://github.com/andrewvy) +* `NEW` client count is shown in status bar - [@andrewvy](https://github.com/andrewvy) +* `NEW` a simpler way to integrate redux with an enhancer - [@andrewvy](https://github.com/andrewvy) +* `FIX` adds a .babelrc to the react native example app - [@skellock](https://github.com/skellock) +* `FIX` the redux action timer is showing the correct times again - [@skellock](https://github.com/skellock) +* `MOD` adds a working Android example app - [@skellock](https://github.com/skellock) +* `DOC` made a note about ensuring `connect()` gets triggered first in your app - [@skellock](https://github.com/skellock) ### April 23, 2016 - 0.4.0 -* `NEW` a way to configure options on the client - thx [@gantman](https://github.com/gantman) -* `NEW` a master switch to turn off everything in 1 spot - thx [@gantman](https://github.com/gantman) -* `FIX` fixed the optional user agent assignment issues - thx [@skellock](https://github.com/skellock) +* `NEW` a way to configure options on the client - [@gantman](https://github.com/gantman) +* `NEW` a master switch to turn off everything in 1 spot - [@gantman](https://github.com/gantman) +* `FIX` fixed the optional user agent assignment issues - [@skellock](https://github.com/skellock) ### April 22, 2016 - 0.3.0 -* `NEW` a help menu to show key commands - thx [@gantman](https://github.com/gantman) -* `NEW` emoji logging 🎉 - thx [@skellock](https://github.com/skellock) +* `NEW` a help menu to show key commands - [@gantman](https://github.com/gantman) +* `NEW` emoji logging 🎉 - [@skellock](https://github.com/skellock) * `NEW` the client is now transpiled for easy integration into React DOM - found by [@derekyau](https://github.com/derekyau) and [@Hyra](https://github.com/Hyra) -* `MOD` returns the redux store from `addReduxStore` - thx [@gantman](https://github.com/gantman) +* `MOD` returns the redux store from `addReduxStore` - [@gantman](https://github.com/gantman) * `FIX` stop clobbering the window.navigator - found by [@kevinvangelder](https://github.com/kevinvangelder) * `FIX` separated the examples to prevent colliding deps - found by [@gantman](https://github.com/gantman) -* `DOC` README updates - thx [@gantman](https://github.com/gantman) and [@darinwilson](https://github.com/darinwilson) +* `DOC` README updates - [@gantman](https://github.com/gantman) and [@darinwilson](https://github.com/darinwilson) ### April 21, 2016 - 0.2.0 -* `NEW` supports React DOM - thx [@skellock](https://github.com/skellock) -* `NEW` supports React Native Web - thx [@necolas](https://github.com/necolas) +* `NEW` supports React DOM - [@skellock](https://github.com/skellock) +* `NEW` supports React Native Web - [@necolas](https://github.com/necolas) ### April 20, 2016 - 0.1.0 -* `NEW` initial release - thx [@skellock](https://github.com/skellock) - +* `NEW` initial release - [@skellock](https://github.com/skellock) diff --git a/README.md b/README.md index f3ec01081..8e32828c1 100644 --- a/README.md +++ b/README.md @@ -279,4 +279,3 @@ be cool? A REPL. We should do that." # Change Log See the full [CHANGES.md](CHANGES.md) file. - diff --git a/bin/reactotron.js b/bin/reactotron.js index d461b3a3e..102e5aae7 100644 --- a/bin/reactotron.js +++ b/bin/reactotron.js @@ -340,7 +340,7 @@ var COMMAND$7 = 'redux.dispatch.prompt'; Prompts for a path to grab some redux keys from. */ var process$8 = function process$8(context, action) { - context.prompt('Action to dispatch', function (value) { + context.prompt('Action to dispatch (e.g. {type: \'MY_ACTION\'})', function (value) { var action = null; // try not to blow up the frame diff --git a/dist/client.js b/dist/client.js index a982a410e..8c787a397 100644 --- a/dist/client.js +++ b/dist/client.js @@ -4,7 +4,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument // --- Begin Awkward Hackzorz --- -var REACTOTRON_VERSION = '0.6.1'; +var REACTOTRON_VERSION = '0.7.0'; var R = require('ramda'); // client enabled flag @@ -54,6 +54,21 @@ client.onCommand('devMenu.reload', function (action, client) { // devMenu && devMenu.reload() }); +/* + * Get React Native server IP if hostname is `localhost` + * On Android emulator, the IP of host is `10.0.2.2` (Genymotion: 10.0.3.2) + */ +function getHost(hostname) { + if ((hostname === 'localhost' || hostname === '127.0.0.1') && typeof window !== 'undefined' && window.__fbBatchedBridge && window.__fbBatchedBridge.RemoteModules && window.__fbBatchedBridge.RemoteModules.AndroidConstants) { + var _window$__fbBatchedBr = window.__fbBatchedBridge.RemoteModules.AndroidConstants.ServerHost; + var ServerHost = _window$__fbBatchedBr === undefined ? hostname : _window$__fbBatchedBr; + + return ServerHost.split(':')[0]; + } + + return hostname; +} + /** Connect to the server. @param userConfigurations Client configuration for connecting to Reactotron @@ -74,7 +89,9 @@ client.connect = function () { }; // merge user input with defaults - var config = _extends({}, defaults, userConfigurations); + var config = _extends({}, defaults, userConfigurations, { + server: getHost(userConfigurations.server || defaults.server) + }); // keep track for all ops reactotronEnabled = config.enabled; diff --git a/dist/index.js b/dist/index.js index 7321470b3..e5b3e4ce1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -338,7 +338,7 @@ var COMMAND$7 = 'redux.dispatch.prompt'; Prompts for a path to grab some redux keys from. */ var process$8 = function process$8(context, action) { - context.prompt('Action to dispatch', function (value) { + context.prompt('Action to dispatch (e.g. {type: \'MY_ACTION\'})', function (value) { var action = null; // try not to blow up the frame