Don't redbox on startup if Metro is not running
Don't redbox on startup if Metro is not running

Summary:
This fixes a problem that occurs when:

1. You run an Android app with Fast Refresh on
2. Kill the app
3. Start the app again

We used to redbox (on Android only). This is probably because we are missing some check on the native side, and we try to enable the socket anyway.

We could potentially fix this on the native side. But also, there's no good reason why this code needs to ever throw an error if Fast Refresh is disabled.

So I'm unifying it with the existing code path for other Fast Refresh errors. They are ignored when it's off, shown as yellowboxes when it's on, and shown as redboxes if you intentionally try to turn it off and on again.

I'm also adding core to prevent logging more than one Fast Refresh warning. Since they're not super actionable and usually indicate the same problem (e.g. Metro not running). The earliest one wins.

Reviewed By: rickhanlonii

Differential Revision: D16286232

fbshipit-source-id: bf3960f11c767a2352b1282d46950e4ba9e5031d

arthuralee/react-native,janicduplessis/react-native,myntra/react-native,arthuralee/react-native,facebook/react-native,hoangpham95/react-native,javache/react-native,hoangpham95/react-native,pandiaraj44/react-native,facebook/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,exponentjs/react-native,exponent/react-native,facebook/react-native,exponentjs/react-native,pandiaraj44/react-native,pandiaraj44/react-native,hammerandchisel/react-native,pandiaraj44/react-native,exponent/react-native,exponentjs/react-native,javache/react-native,facebook/react-native,arthuralee/react-native,hammerandchisel/react-native,myntra/react-native,hammerandchisel/react-native,hoangpham95/react-native,hoangpham95/react-native,janicduplessis/react-native,janicduplessis/react-native,facebook/react-native,myntra/react-native,pandiaraj44/react-native,javache/react-native,arthuralee/react-native,exponent/react-native,janicduplessis/react-native,javache/react-native,myntra/react-native,exponentjs/react-native,myntra/react-native,arthuralee/react-native,javache/react-native,exponent/react-native,facebook/react-native,hammerandchisel/react-native,myntra/react-native,myntra/react-native,pandiaraj44/react-native,janicduplessis/react-native,myntra/react-native,hoangpham95/react-native,exponentjs/react-native,facebook/react-native,exponent/react-native,myntra/react-native,exponentjs/react-native,exponentjs/react-native,pandiaraj44/react-native,hoangpham95/react-native,exponent/react-native,javache/react-native,hammerandchisel/react-native,hammerandchisel/react-native,javache/react-native,janicduplessis/react-native,exponent/react-native,hammerandchisel/react-native,exponentjs/react-native,facebook/react-native,hoangpham95/react-native,hoangpham95/react-native,janicduplessis/react-native,pandiaraj44/react-native,exponent/react-native,hammerandchisel/react-native,facebook/react-native