Commit Graph

95 Commits

Author SHA1 Message Date
Pieter De Baets 215872c2eb Provide log source to handler
Reviewed By: majak

Differential Revision: D2615567

fb-gh-sync-id: a245813220436f2d83ae2ae28bde916cecb3f416
2015-11-11 06:44:30 -08:00
Nick Lockwood c5b990f65f Added lightweight generic annotations
Summary: public

Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs.

Fixed some type bugs and improved bridge validation in a few places.

Reviewed By: javache

Differential Revision: D2600189

fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
2015-11-03 14:49:30 -08:00
Pieter De Baets 15c53f7563 Fix ReferenceImages resolving for `buck test`
Reviewed By: nicklockwood

Differential Revision: D2605694

fb-gh-sync-id: 90e65974c73405d482476c9eb2ddf1377f9a1401
2015-11-02 11:02:29 -08:00
Pieter De Baets 59e670e453 Fix a warning about SnapshotView
Reviewed By: majak

Differential Revision: D2553669

fb-gh-sync-id: 2a2b47f9cf7a75403e4e2541b32a4b141b3d08be
2015-10-19 06:10:22 -07:00
Dave Miller 19e11232fe Move SnapshotView to SnapshotViewIOS and create an unimplemented android version
Reviewed By: @andreicoman11

Differential Revision: D2536373

fb-gh-sync-id: 0f671e8198175a15540b74d54e53eee941aa0c1b
2015-10-13 11:48:38 -07:00
Ben Alpert ab6f375c66 Log React warnings internally, fix warnings in Android tests
Reviewed By: @javache

Differential Revision: D2517993

fb-gh-sync-id: c91a42a0abe4037b72c4497a5dc8b52a922fbf98
2015-10-09 09:33:24 -07:00
Dave Miller b8c42f7f6f Introduce SnapshotView which wraps Renderable content and will verify the snapshot
Reviewed By: @javache

Differential Revision: D2493722
2015-10-02 12:15:24 -07:00
Pieter De Baets f3a6466fcd Check if test runner is of right type before accessing its internals
Summary: I previously added this check to make the test complete waits until all teardown completed but if you're running tests with any other executor than the JSC one, this would crash.

@​public

Reviewed By: @jspahrsummers

Differential Revision: D2493967
2015-10-01 04:22:24 -07:00
Pieter De Baets 9b1f6c9e30 Make RCTTestRunner wait for JS context to deallocate 2015-09-04 03:24:16 -08:00
Felix Oghina 53fc5624e4 [reactnative] send platform arg with all packager requests 2015-08-29 06:36:18 -08:00
Nick Lockwood 88e0bbc469 Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
Nick Lockwood 26c4be62c8 Fixed test flakiness due to a race condition with RCTRedBox
Summary:
The test runner relied on checking the current error message in the RCTRedbox, which is a singleton (yay, shared mutable state!). This lead to some tests that worked individually but failed when run together due to error messages in RCTRedBox left over from previous tests.

I've replaced the call to -[RCTRedBox currentErrorMessage] by injecting a custom logging function to intercept the errors at source, which is a much more reliable solution.
2015-08-19 03:41:31 -07:00
Nick Lockwood 8d1e02b8bd Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
Pieter De Baets 261f9434e5 Avoid dispatch_async in RCTRootView when bridge has already started
Summary:
There's no good reason for initialProperties to be mutable after the RCTRootView has been created. Passing it in through the constructor means we can skip one dispatch_async.
2015-08-17 05:34:25 -07:00
Nick Lockwood ef5cec4f08 Text highlighting on iOS
Summary:
This diff implements highlighting of tapped text subranges for the iOS `<Text>` component, styled to match how iOS webkit views highlight links (translucent grey overlay with rounded corners).

Highlighting is enabled by default for any `<Text>` component which has an onPress handler. To disable the highlight, add `suppressHighlighting={true}` to the component props.
2015-07-24 08:41:58 -08:00
Nick Lockwood 1b7699f671 Migrate unit tests from FBReactKitModules to FBReactKit 2015-07-07 16:39:35 -08:00
Alex Akers aba148061f [React Native] Re-alphabetize file names in Xcode projects
Summary:
Fixes my OCD problems.
2015-07-06 01:57:06 -08:00
James Ide e3225f3403 [Bridge] Support nullability annotations in bridged methods
Summary:
Fixes a crash due to the selector regex not knowing about the nullability annotations. Adds support for both the core annotations `__nullable` and `__nonnull` plus their shorthand counterparts `nullable` and `nonnull`.

Objective-C allows the shorthand versions only at the front of a parameter type declaration like `(nullable NSString *)` but the regex will pick up `(NSString * nullable)` too. This shouldn't cause any adverse effects and I left the code this way to keep the regex readable.

Fixes #1795

Closes https://github.com/facebook/react-native/pull/1796
Github Author: James Ide <ide@jameside.com>

Test Plan:
 Wrote a bridge method that uses a nullability annotation and verified that it didn't cause the app to crash:
```
RCT_EXPORT_METHOD(method:(nullable NSNumber *)reactTag)
{
}
```

Also added a nullable annotation to RCTTest.
2015-06-30 04:17:20 -08:00
Alex Kotliarskyi 64d7933e66 [ReactNative] Ignore _UILayoutGuide in tests 2015-06-25 08:09:13 -08:00
Nick Lockwood 6573d256ba Improve test architecture so failures don't crash the simulator 2015-06-17 07:09:23 -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 6358e163a5 [ReactNative] Revert `async exports` changes to MessageQueue + test
Summary:
@public

`[Bridge] Add support for JS async functions to RCT_EXPORT_METHOD` was imported but broke some internal code, reverting the `MessageQueue` that caused the issues and add a test, since the method is not used yet.

Test Plan: Run the test o/
2015-06-09 14:25:32 -08:00
Tadeu Zagallo 1a564eed77 [ReactNative] Run UIExplorer tests on sandcastle 2015-06-05 05:36:06 -08:00
Andy Street 435125f4a0 Revert "[ReactNative] Run UIExplorer tests on sandcastle" 2015-06-03 10:57:19 -08:00
Tadeu Zagallo e1454c29c5 [ReactNative] Run UIExplorer tests on sandcastle 2015-06-03 06:24:12 -08:00
Spencer Ahrens 32666f0aa2 [ReactNative] Add AppEventsTest 2015-05-20 00:31:50 -08:00
Alex Kotliarskyi 735f67337a [ReactNative] Fail faster in OSS tests 2015-05-06 09:33:20 -07:00
Tadeu Zagallo 132a9170f1 [ReactNative] Create private underlying bridge to prevent retain cycles 2015-05-04 10:36:20 -08:00
Nick Lockwood eb0476074f Improved debug and fixed macros 2015-04-30 09:59:16 -08:00
Tadeu Zagallo d293bed5ab [ReactNative] Fix analyze errors on oss 2015-04-24 08:28:35 -08:00
Nick Lockwood b1a15004de Fixed release builds on UIExplorer 2015-04-21 18:22:34 -08:00
Nick Lockwood ead0f2e020 Implemented thread control for exported methods 2015-04-18 11:13:39 -08:00
guru inamdar 7a68691686 MapView to support MKPointAnnotation using new attribute annotate in Map...
Summary:
### MapView to support Pin annotation

    var pinLocation = {
			latitude: property.latitude,
			longitude: property.longitude,
			title: property.title
    };
    this.state = {propertyPoint: pinLocation};
    <MapView style={styles.map} region={this.state.region} annotate={this.state.propertyPoint}>
    </MapView>
![mapview-pinannotation](https://cloud.githubusercontent.com/assets/845379/7100280/6c1ffc08-dfe5-11e4-9d1b-8da6a65da1bc.png)

Closes https://github.com/facebook/react-native/pull/810
Github Author: guru inamdar <guru.inamdar@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-14 18:03:37 -08:00
Nick Lockwood 26fd24dc50 Cleanup 2015-04-11 14:19:49 -08:00
Alex Akers 8a57c4e980 [React Native] RCT_EXPORT lvl.2 2015-04-08 08:34:10 -08:00
Nick Lockwood bf4868edda Added non-class-scanning-based approach fror registering js methods 2015-04-08 05:45:20 -08:00
Tadeu Zagallo f370f9cbc4 [ReactNative] Unfork RKRootView 2015-04-02 07:12:42 -08:00
laiso e35521300a (Xcode) Set indent=2 in all xcodeproj files.
Summary:
These are default settings now.
I saw my Xcode be configured indent=4.

![2015-03-30 12 16 11 pm](https://cloud.githubusercontent.com/assets/39830/6889697/98f8b930-d6d6-11e4-81c8-d2146855d127.png)

Closes https://github.com/facebook/react-native/pull/472
Github Author: laiso <laiso@lai.so>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-01 17:14:45 -08:00
Tadeu Zagallo 20291a02df [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
Tadeu Zagallo 8679c0bc96 [ReactNative] Add deep linking api 2015-03-25 19:01:08 -08:00
Spencer Ahrens 15f6783f34 [ReactNative] Add snapshot tests for examples 2015-03-24 21:48:49 -08:00
Spencer Ahrens 3f137da232 [ReactNative] OSS snapshot tests 2015-03-24 10:16:15 -08:00
Christopher Chedeau 1aeb02ada3 [ReactNative] Expanded license on obj-c files 2015-03-23 13:18:29 -08:00
Christopher Chedeau f8f3f67bed [ReactNative] Increase timeout for obj-c tests 2015-03-17 08:33:42 -08:00
Spencer Ahrens 3cc81c6561 [ReactNative] Add integration test stuff 2015-03-13 18:03:34 -08:00