From acd777a90659ff2116c09e188debbc824d36c3a2 Mon Sep 17 00:00:00 2001 From: Evgen Filatov Date: Tue, 5 May 2015 14:14:49 -0700 Subject: [PATCH 1/2] Fixed name of Chome window, Connects to #297 Summary: Hi! I have the same problem as described here https://github.com/facebook/react-native/issues/297 It could occurs after restarting `packager.sh` or `debuger-ui` page. I found simple solution that works for me, but I am not 100% sure it will works for any user with this problem. How could this be tested automatically? Closes https://github.com/facebook/react-native/pull/1101 Github Author: Evgen Filatov Test Plan: Imported from GitHub, without a `Test Plan:` line. --- launchChromeDevTools.applescript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchChromeDevTools.applescript b/launchChromeDevTools.applescript index 1fe6f4b0..4b718f5b 100755 --- a/launchChromeDevTools.applescript +++ b/launchChromeDevTools.applescript @@ -10,7 +10,7 @@ on run argv set theURL to item 1 of argv - tell application "Google Chrome" + tell application "Chrome" activate if (count every window) = 0 then From b05ca45244939f0a075a4535a9a1425111a3b724 Mon Sep 17 00:00:00 2001 From: Amjad Masad Date: Tue, 5 May 2015 14:05:19 -0700 Subject: [PATCH 2/2] [react-packager] Use gracful-fs to avoid EMFILE errors Summary: @public Currently, every time we call into the packager we have to change the ulimit to make sure we don't hit the EMFILE error (the packager uses as much concurrency as possible). Using graceful-fs, the fs module -- with monkey patching -- becomes intelligent enough to recover from EMFILE errors. Test Plan: * set `ulimit -n 256* * start server * request from your browser: http://localhost:8081/RKJSModules/MainBundle/CatalystBundle.includeRequire.bundle * it works --- react-packager/index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/react-packager/index.js b/react-packager/index.js index 3a70659c..a7b6264b 100644 --- a/react-packager/index.js +++ b/react-packager/index.js @@ -8,6 +8,8 @@ */ 'use strict'; +useGracefulFs(); + var Activity = require('./src/Activity'); var Server = require('./src/Server'); @@ -45,3 +47,16 @@ exports.getDependencies = function(options, main) { return r.dependencies; }); }; + +function useGracefulFs() { + var fs = require('fs'); + var gracefulFs = require('graceful-fs'); + + // A bit sneaky but it's not straightforward to update all the + // modules we depend on. + Object.keys(fs).forEach(function(method) { + if (typeof fs[method] === 'function' && gracefulFs[method]) { + fs[method] = gracefulFs[method]; + } + }); +}