Commit Graph

8 Commits

Author SHA1 Message Date
Pieter De Baets 31b5b0ac01 Create RCTFatal for reporting fatal React events
Summary: public

Add RCTFatal for reporting fatal runtime conditions. This centralizes failure handling to one function and allows you to customize how they should be handled. RCTFatal will be logged to the console and as a redbox and will also be triggered by fatal exceptions coming from RCTExceptionsManager.

Note that there is no RCTLogFatal, since just logging the fatal condition does not allow us to handle it consistently.

Reviewed By: nicklockwood

Differential Revision: D2615490

fb-gh-sync-id: 7d8e134419e10a8fb549297054ad955db3f6bee0
2015-11-05 12:51:27 -08:00
Pieter De Baets 6ca8f4836d Disable RCTAssert completely in production builds
Reviewed By: @tadeuzagallo, @jspahrsummers

Differential Revision: D2521700

fb-gh-sync-id: f769afd98bb662e8bbe773adb45990f2175cdfe4
2015-10-08 08:26:20 -07:00
Nick Lockwood 3cef3010e6 Fix RCTAssert logic 2015-08-07 06:11:49 -08:00
Nick Lockwood 650fc9de4c Increased warning levels to -Wall -Wextra, and fixed Xcode 7 beta issues
Summary:
@public

I've increased the warning levels in the OSS frameworks, which caught a bunch of minor issues. I also fixed some new errors in Xcode 7 relating to designated initializers and TLS security.

Test Plan:
* Test the sample apps and make sure they still work.
* Run tests.
2015-06-15 07:52:50 -08:00
Tadeu Zagallo 9062bda79b [ReactNative] Add RCTAssertThread and restrict -[UIManager addUIBlock:] to _shadowQueue
Summary:
@public

Add `RCTAssertThread` to `RCTAssert.h` for convenience when checking the current/queue,
it accepts either a `NSString *`, `NSThread *` or `dispatch_queue_t` as the object to be checked

Also add a check to `-[RCTUIManager addUIBlock:]` - There was a discussion on github (https://github.com/facebook/react-native/issues/1365)
due to the weird behavior caused by calling it from a different thread/queue (it might be added after `batchDidComplete` has been called
and will just be dispatched on the next call from JS to objc)

Test Plan:
Change `-[RCTAnimationExperimentalManager methodQueue]` to return `dispatch_get_main_queue()` and run the 2048 example,
it should dispatch with a helpful message (screenshot on the comments)
2015-05-25 05:23:27 -08:00
Nick Lockwood 8e15a0d5e7 Added RCT_DEBUG 2015-04-21 05:24:10 -08:00
Nick Lockwood 26fd24dc50 Cleanup 2015-04-11 14:19:49 -08:00
Tadeu Zagallo 20291a02df [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00