Commit Graph

1265 Commits

Author SHA1 Message Date
Douglas Lowder d368ebfab2 Apple TV support 1: existing Objective C code should compile for tvOS
Summary:
First commit for Apple TV support: changes to existing Objective-C code so that it will compile correctly for tvOS.
Closes https://github.com/facebook/react-native/pull/9649

Differential Revision: D3916021

Pulled By: javache

fbshipit-source-id: 34acc9daf3efff835ffe38c43ba5d4098a02c830
2016-09-27 06:28:33 -07:00
Pieter De Baets 339531065f Fix some linter warnings
Reviewed By: majak

Differential Revision: D3930059

fbshipit-source-id: dbbf67f287c46535f9c5947cd7ac101c5c91615e
2016-09-27 06:13:31 -07:00
Martin Kralik cfae3e376d fixed crash when setting custom shadow props to null
Reviewed By: emilsjolander

Differential Revision: D3923634

fbshipit-source-id: 005e316e70fa280960c796375b2e94f9967a089d
2016-09-27 03:43:34 -07:00
Marc Horowitz 97e3c091f8 Sync support for new ios bridge
Reviewed By: javache

Differential Revision: D3897528

fbshipit-source-id: f30d2b1c490c1a9f7fc1f136858e6c7a146b9ca2
2016-09-26 16:14:11 -07:00
Marc Horowitz 51df83d7d5 Move batchedbridge start out of init
Reviewed By: javache

Differential Revision: D3913304

fbshipit-source-id: 7d9b5b352d95dd770757cc99dddcce510cdd4909
2016-09-26 16:14:11 -07:00
Antti Moilanen 72e203bf95 Fix ScrollView's snap index when scrolling forward and user taps the screen again while still scrolling
Summary:
Currently when snapping is used with ScrollView it calculates wrong snap index if user taps the screen second time while ScrollView is still scrolling. This happens because the code only adds 1 to the snap index when translationAlongAxis is smaller than zero. When user taps screen second time the translationAlongAxis is 0 and snap index ends up being one less than it should. This causes the ScrollView to scroll one step backwards.

Bug can be reproduced with the new examples I added to UIExplorer's ScrollView in [scrollview-snap-bug-example branch](https://github.com/anttimo/react-native/tree/scrollview-snap-bug-example).

Fix can be verified by running the same examples with the ScrollView fix in [scrollview-snap-bug-example-with-fix branch](https://github.com/anttimo/react-native/tree/scrollview-snap-bug-example-with-fix).

![scrollview-bug](https://cloud.githubusercontent.com/assets/150881/14427555/10d59d1e-fffe-11
Closes https://github.com/facebook/react-native/pull/6906

Differential Revision: D3927123

Pulled By: majak

fbshipit-source-id: 38828cc60a02a754bdc3ec72fb98d8777917f15e
2016-09-26 16:14:10 -07:00
Mehdi Mulani 0ce2bbdd64 Fix Modal to handle in-call status bar
Summary: Changing the Modal's presentation style ensures that UIKit correctly adjusts its bounds when entering/exiting the in-call status bar.

Reviewed By: fkgozali

Differential Revision: D3916167

fbshipit-source-id: a0bea60751744ac082ba6ec38177fb093a8f2be5
2016-09-26 15:58:29 -07:00
Emil Sjolander 0a9b6bedb3 BREAKING - Fix unconstraint sizing in main axis
Summary:
This fixes measuring of items in the main axis of a container. Previously items were in a lot of cases measured with UNSPECIFIED instead of AT_MOST. This was to support scrolling containers. The correct way to handle scrolling containers is to instead provide them with their own overflow value to activate this behavior. This is also similar to how the web works.

This is a breaking change. Most of your layouts will continue to function as before however some of them might not. Typically this is due to having a `flex: 1` style where it is currently a no-op due to being measured with an undefined size but after this change it may collapse your component to take zero size due to the implicit `flexBasis: 0` now being correctly treated. Removing the bad `flex: 1` style or changing it to `flexGrow: 1` should solve most if not all layout issues your see after this diff.

Reviewed By: majak

Differential Revision: D3876927

fbshipit-source-id: 81ea1c9d6574dd4564a3333f1b3617cf84b4022f
2016-09-26 06:13:56 -07:00
Pieter De Baets 31b158c9fe Export native modules without RCT or RK prefix
Reviewed By: mmmulani

Differential Revision: D3901600

fbshipit-source-id: 7d4a027f0f2478e2a9ac9916326b91279bec3cb3
2016-09-23 11:14:11 -07:00
Pieter De Baets ff79224d37 Simplify ModuleConfig array format
Reviewed By: lexs, mhorowitz

Differential Revision: D3901563

fbshipit-source-id: 70aea19db1b01170be57b74ccfa1a306dfa1f362
2016-09-23 11:14:10 -07:00
mattpodwysocki 2da08884b2 Introducing .NET version of css-layout using P/Invoke
Summary:
This version of the css-layout project includes support for .NET projects.  Up in the air is how many configurations of .NET projects we allow for, such as Portable Class Libraries, Universal Windows Platform, .NET Core, etc.  Still needs integration with Buck.
Closes https://github.com/facebook/css-layout/pull/220

Reviewed By: lucasr

Differential Revision: D3909367

Pulled By: emilsjolander

fbshipit-source-id: aaaa9c4ff2d3452649f256c3268cf873cf33a0b9
2016-09-22 16:28:38 -07:00
Mehdi Mulani 858e95b2aa Warn when displaying a modal with unsupported interface orientations
Summary: In dev mode, this removes all iOS crashes from specifying the incorrect interface orientations. It also includes okay-ish instructions for how to fix the problem.

Reviewed By: fkgozali

Differential Revision: D3904998

fbshipit-source-id: 699599fa77fd87e6615436250e38944e577e75a0
2016-09-22 12:58:33 -07:00
Yiding Jia bb933c8ad4 Make custom jsc initialization a link-time replacable function.
Reviewed By: bnham

Differential Revision: D3880106

fbshipit-source-id: 2a3c3c8ff120ecc66b31325700c187cbd957f361
2016-09-20 16:58:42 -07:00
Emil Sjolander 375a5805d1 Cleanup some multiline code
Reviewed By: lucasr

Differential Revision: D3886866

fbshipit-source-id: e19c1be4af58605933f90b5bf381008338be2236
2016-09-20 10:30:15 -07:00
Emil Sjolander 10601c921e Move justifyContent check into switch statement
Reviewed By: lucasr

Differential Revision: D3886861

fbshipit-source-id: 17ba2962016af34b5add3ce6d8355c9c305a35c0
2016-09-20 10:30:13 -07:00
Emil Sjolander be140107b9 Remove empty line in function call
Reviewed By: lucasr

Differential Revision: D3886856

fbshipit-source-id: cf76ad9b6c85a62b9f2683618a6abe986d98acc2
2016-09-20 10:30:11 -07:00
Emil Sjolander 7f2bbf4263 Remove use of snake_case
Reviewed By: lucasr

Differential Revision: D3886849

fbshipit-source-id: eaf3f219fe1ccb717ba363dba0d2f475ffb204e3
2016-09-20 10:30:08 -07:00
Pieter De Baets 21fda19ca9 Consistently handle startup errors
Summary:
If we use RCTLogError, we show a redbox with a native stacktrace before we can actually show the JS stacktrace (which is only done through dispatch_async). Instead use RCTLogWarn so its logged to console but not reported as a redbox.

Also fix call to RCTNSErrorFromJSErrorRef off the main thread RCTJSCExecutor.

Reviewed By: majak, mmmulani

Differential Revision: D3886813

fbshipit-source-id: 119d04858cb0c85c79e12ff8a79806711f8e0b27
2016-09-20 06:28:36 -07:00
Pieter De Baets bd4cd6ea5d Fix non-exported module warnings for superclasses
Reviewed By: mhorowitz

Differential Revision: D3841655

fbshipit-source-id: b855f9bef6c53a0964c59e1977e5eb23452edce3
2016-09-19 04:44:12 -07:00
littlesome 610c4826a5 Set viewTag for RCTTouchEvent to avoid EventID conflict
Summary:
Using target view's reactTag as viewTag for RCTTouchEvent.

Fix issue https://github.com/facebook/react-native/issues/9503
Closes https://github.com/facebook/react-native/pull/9952

Differential Revision: D3880152

Pulled By: majak

fbshipit-source-id: 1025aae6a6a1d5074496a9e4a6cf7dfebc713dc7
2016-09-16 16:13:47 -07:00
Pieter De Baets 9ff4d31dc4 Remove unnecessary JSContextGetGlobalContext call
Reviewed By: majak, alexeylang

Differential Revision: D3871178

fbshipit-source-id: 4a6dff7cce233e9bc2e2a80858774a2e6af6b67d
2016-09-16 06:28:48 -07:00
Pieter De Baets 228f104dad Improve RCTNSErrorFromJSError
Reviewed By: adamjernst

Differential Revision: D3871146

fbshipit-source-id: 44de849852d8c00ab4589938ef317e4c8d98d7e6
2016-09-16 06:28:48 -07:00
Pieter De Baets 95cce07baf Support invoking method that returns result and flushes call queue
Reviewed By: mhorowitz

Differential Revision: D3870879

fbshipit-source-id: bc8f70d9866dfc25468c9072c209cc6842b98575
2016-09-16 06:28:48 -07:00
Emil Sjolander a6e1e33a50 Reverted commit D3855801
Summary: Introduce `overflow:scroll` so that scrolling can be implemented without the current overflow:visible hackiness. Currently we use AT_MOST to measure in the cross axis but not in the main axis. This was done to enable scrolling containers where children are not constraint in the main axis by their parent. This caused problems for non-scrolling containers though as it meant that their children cannot be measured correctly in the main axis. Introducing `overflow:scroll` fixes this.

Reviewed By: astreet

Differential Revision: D3855801

fbshipit-source-id: 3c365f9e6ef612fd9d9caaaa8c650e9702176e77
2016-09-14 11:28:34 -07:00
Emil Sjolander 1f9c9ecb4b BREAKING - Fix unconstraint sizing in main axis
Summary: Introduce `overflow:scroll` so that scrolling can be implemented without the current overflow:visible hackiness. Currently we use AT_MOST to measure in the cross axis but not in the main axis. This was done to enable scrolling containers where children are not constraint in the main axis by their parent. This caused problems for non-scrolling containers though as it meant that their children cannot be measured correctly in the main axis. Introducing `overflow:scroll` fixes this.

Reviewed By: astreet

Differential Revision: D3855801

fbshipit-source-id: 6077b0bcb68fe5ddd4aa22926acab40ff4d83949
2016-09-14 09:14:02 -07:00
Emil Sjolander 8eee79b5d1 Remove legacy test suite
Reviewed By: lucasr

Differential Revision: D3863095

fbshipit-source-id: a2c4f87cd2263b4cc1fcdec4f2a0964f0696472f
2016-09-14 08:58:35 -07:00
Pieter De Baets d6926c5468 Allow precreated JSC executor init without applicationScript
Reviewed By: mmmulani

Differential Revision: D3836643

fbshipit-source-id: 18937ef5b39ebe3b3fd743490f86e40ffa6ee015
2016-09-13 06:43:40 -07:00
Hugo Dozois 38354c4cbf Add: expose hot & live reload, remote debug, profiling
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

- Being able to call these from JS is really useful in envs where action sheets are not available (eg: App Extensions). I made the functions act as explicit toggles, this way it's easy to set the wanted behavior.

**Test plan (required)**
- I tested the functions manually.

![Remote debug from an iMessage Application](https://cloud.githubusercontent.com/assets/4422516/17445198/976ebfe0-5af8-11e6-885f-1b40f9518aab.png)
Closes https://github.com/facebook/react-native/pull/9242

Differential Revision: D3749568

fbshipit-source-id: 2cea1d609dc792aec73d4bcf1eae07575725b4b7
2016-09-12 02:58:56 -07:00
Alexey Lang d6fe78fc25 Refactor measuring native requires
Reviewed By: javache

Differential Revision: D3829204

fbshipit-source-id: 9a3a29bfc12e3af60eeac1e03b93a626d0d256c8
2016-09-09 15:28:44 -07:00
Jacob Parker 9e6e573e19 NavigatorIOS System Icon Support
Summary:
Continuation on #3959 (started by cancan101). Rebased to latest master, adds support for left system icon, fixes issues mentioned in previous PR.

<img width="432" alt="screen shot 2016-09-05 at 13 54 41" src="https://cloud.githubusercontent.com/assets/7275322/18248478/5b7aa25c-7370-11e6-8c51-01a2b7fd1030.png">
Closes https://github.com/facebook/react-native/pull/9742

Differential Revision: D3836850

Pulled By: javache

fbshipit-source-id: ef9f6e42211ed18bf5f3dc1eb7a8b1318d939674
2016-09-08 17:58:50 -07:00
Alexey Lang 532751f8a8 Start measuring RCTPLBridgeStartup and RCTPLTTI early
Reviewed By: javache

Differential Revision: D3828404

fbshipit-source-id: 7cbfa2eeb60e249be8aad09da5314be998213f0e
2016-09-08 07:28:41 -07:00
Pieter De Baets 99e0267c25 Cleanup and document native module configuration
Summary: Get rid of the old behaviour of JSON encoding in `nativeRequireModuleConfig` and consistently use the same names for function types "async/promise/sync"

Reviewed By: lexs

Differential Revision: D3819348

fbshipit-source-id: fc798a5abcaf6a3ef9d95bd8654afa7825c83967
2016-09-08 04:13:51 -07:00
Ben Roth afde9da93d Scope RCTReloadNotification to one bridge
Summary:
At the moment, posting RCTReloadNotification in any circumstance causes all RCTBridge instances to reload. This change scopes the notification to the bridge for which it was intended.
Closes https://github.com/facebook/react-native/pull/8762

Differential Revision: D3831914

fbshipit-source-id: ff29574f574ecd1a403057ddd0458dea38f0136e
2016-09-07 17:28:47 -07:00
Alexey Lang a31a2910a1 Make bridge logger thread-safe and fix noisy in bridge core time
Reviewed By: javache

Differential Revision: D3828301

fbshipit-source-id: 29efdef2fb2c601984c27c4d0a69e1542bbff385
2016-09-07 13:10:12 -07:00
Mehdi Mulani de3457f31d Allow <Modal /> to be presented in different orientations
Reviewed By: javache

Differential Revision: D3760002

fbshipit-source-id: 01f5c246fb0fc041ec2d63b4ef80de858fb6fdf2
2016-09-07 13:10:11 -07:00
Kevin Gozali 96de161304 enable RTL layout by default for all apps
Summary:
We're now enabling RTL layout by default assuming the app has the proper localized assets. Previously, this was disabled by default to minimize surprise. Apps that don't want this RTL support can still manually disable them by using `RCTI18nUtil.allowRTL(false)` (iOS) or `I18nUtil.allowRTL(false)` (android) in the apps start-up logic, as outlined in the blog post: http://facebook.github.io/react-native/blog/2016/08/19/right-to-left-support-for-react-native-apps.html

iOS Util function: f0fb228ec7/React/Modules/RCTI18nUtil.m (L53)
Android Util function: 380830e4aa/ReactAndroid/src/main/java/com/facebook/react/modules/i18nmanager/I18nUtil.java (L63)

Differential Revision: D3825054

fbshipit-source-id: 88b355fef9e3847939a414f80d2285979e27af08
2016-09-06 17:58:47 -07:00
rh389 6e216d2034 Include CSSLayout.h consistently with other project includes
Summary:
Include CSSLayout headers in the same way as other project headers, ie `#import <CSSLayout/CSSLayout.h>` becomes `#import "CSSLayout.h"`. CSSLayout is not a framework or system dependency, so shouldn't (AFAIK) be included with angle brackets. Doing so breaks framework builds, such as when RN is used as a pod in a swift project.

In combination with https://github.com/facebook/css-layout/pull/217 this fixes https://github.com/facebook/react-native/issues/9014 (specifically swift cocoapods projects). There is then no need for a separate CSSLayout pod subspec.

Tests run on the RN project in isolation (with changes inside `CSSLayout` itself also applied) and against a dummy swift project with RN included as a pod.

NB: This effectively reverts https://github.com/facebook/react-native/pull/9015 and may break non-swift cocoapods projects unless https://github.com/facebook/css-layout/pull/217 is merged and synced first.

Update: As discussed with alloy and emilsjolander, wrap these imports in a preprocess
Closes https://github.com/facebook/react-native/pull/9544

Differential Revision: D3821791

Pulled By: javache

fbshipit-source-id: d27ac8be9ce560d03479b43d3db740cd196c24da
2016-09-06 09:13:39 -07:00
BaihaoTian d31756bf01 improve (RCTJSErrorFromCodeMessageAndNSError)
Summary:
First of all,please forgive my poor english. LOL

When I use Promises  as callBack,

 I followed the guide to make a (RCTPromiseRejectBlock),in this RCTPromiseRejectBlock,

from the guide I should add a (NSString)code a (NSString)message and an (NSError) to a  RCTPromiseRejectBlock.

As what did guide said I just make a NSError with

```
 NSError *error=[NSError errorWithDomain:@"native stroage error" code:402 userInfo:@{@"data":key}];

```

As you can see, I want to transfer some data in this callback.But I just found the (userInfo) of NSError didn't composed to a  RCTPromiseRejectBlock.

So I check out the source code of RCTUtil ,I found this

```

// TODO: Can we just replace RCTMakeError with this function instead?
NSDictionary<NSString *, id> *RCTJSErrorFromCodeMessageAndNSError(NSString *code,
                                                                  NSString *message,
                                                                  NSError *__nullable error)
{
  NSString *errorMessage;
Closes https://github.com/facebook/react-native/pull/9519

Differential Revision: D3821334

Pulled By: javache

fbshipit-source-id: 0fa40dd93932af70123b8f8a20a5c7dc5afdd6ac
2016-09-06 06:13:49 -07:00
makee 0d9490fa67 remove incorrect `__unused` modifier
Summary:
the `update` argument was used below
Closes https://github.com/facebook/react-native/pull/9753

Differential Revision: D3820510

fbshipit-source-id: 8cad707a9cd4887c7ee07fe960b1f918761e64c5
2016-09-06 02:43:40 -07:00
Pieter De Baets 1a7c231ef3 Remove last arg from RCTProfileEnd, make macro's function-like
Reviewed By: tadeuzagallo

Differential Revision: D3801302

fbshipit-source-id: 297a58db876366e21e232094c1361aa0dcd9016d
2016-09-05 11:13:33 -07:00
Pieter De Baets dda3c5f48d Support sync method calls in the objc bridge
Reviewed By: mhorowitz

Differential Revision: D3801188

fbshipit-source-id: b990680049a46840472a25e66882f8a29890ae90
2016-09-05 07:44:00 -07:00
Pieter De Baets 753b37e479 Remove unused -[RCTBridgeMethod profileArgs]
Reviewed By: mhorowitz

Differential Revision: D3801106

fbshipit-source-id: 214a18b548f8142c0f3d6b2f7db7a24894d1f01d
2016-09-05 07:44:00 -07:00
Gant dcdf16a0fb RefreshControl Position Bug
Summary:
Refresh bug #7976
This bug has persisted for 3 versions of React Native.   Currently everyone is having to do a silly fix, documented in the bug.   I spent an hour trying to find the source of the bug.   Failing to find the issue quickly, I've just decided to make this simple bugfix.

According to janicduplessis #7976 we will likely be re-writing this control in iOS 10.
Closes https://github.com/facebook/react-native/pull/9249

Differential Revision: D3817227

fbshipit-source-id: f98282aadeca3e85239836f589eda901d454f2ce
2016-09-04 01:43:38 -07:00
Indragie Karunaratne 31c8e20c8e Remove -[RCTJSExecutor errorForJSError:]
Reviewed By: javache

Differential Revision: D3814718

fbshipit-source-id: 9b8c91cb81d77fda4959df26806d54c9b7be42a0
2016-09-02 17:43:37 -07:00
Marc Horowitz 3940f06211 Add more profiling, fix existing profiling, perf fix
Reviewed By: javache

Differential Revision: D3807467

fbshipit-source-id: 3ff6feebd6d7966952152bac708389506de721e6
2016-09-02 12:43:48 -07:00
Marc Horowitz a8cf12a932 Fix some unsafe thread behavior
Reviewed By: javache

Differential Revision: D3789293

fbshipit-source-id: 80118c7f8faf487fe35d4d83a91f023219f6bf80
2016-09-01 19:58:58 -07:00
Pieter De Baets 6abacc893b Use NSURLComponents.queryItems instead of parsing query strings
Reviewed By: mmmulani

Differential Revision: D3742617

fbshipit-source-id: 2d6580919fa546d89266943a917165fbc44aa8e8
2016-09-01 19:43:48 -07:00
Pieter De Baets 07553d0f1c Update React Native minimum OS version to iOS8
Reviewed By: majak

Differential Revision: D3723143

fbshipit-source-id: 482f9820370b752d937e6df7f74c33d53a0a2e7d
2016-09-01 19:43:47 -07:00
Pieter De Baets 46b54fd7a8 Support bundle argument for image loading
Reviewed By: mmmulani

Differential Revision: D3768798

fbshipit-source-id: 5b35f06957cebfe74aca90fe6a456f7f739509a9
2016-08-31 17:43:49 -07:00
Pieter De Baets 17205aac57 Track BatchedBridge in FBReactModule to decide when to re-apply feature flags
Reviewed By: majak

Differential Revision: D3735447

fbshipit-source-id: a38c34feddb3f11cb5b99783054849fd291fc14f
2016-08-31 16:14:03 -07:00
Ben Nham 7db93a376b configure glog sink for custom jsc
Reviewed By: alexeylang

Differential Revision: D3789493

fbshipit-source-id: b3ecbd1caddfeef5e948e43444be95207c573f67
2016-08-31 11:29:05 -07:00
Adam Comella 6897f40af7 Fix sizing of absolutely positioned nodes inside overflow:hidden parent
Summary:
When an absolutely positioned node appeared inside an overflow:hidden
parent, we were limiting its height. This is inconsistent with how
layout behaves on the web.
Closes https://github.com/facebook/css-layout/pull/218

Reviewed By: lucasr

Differential Revision: D3797285

Pulled By: emilsjolander

fbshipit-source-id: 98f98e77aa26edce86b9882c1cac284799b69a27
2016-08-31 08:13:41 -07:00
Emil Sjolander e5aa29c195 Fix and add tests for cssedge priority
Reviewed By: lucasr

Differential Revision: D3791106

fbshipit-source-id: 3e0c943f94218848a1fbf36e5ae48dbc720ea923
2016-08-31 08:13:41 -07:00
Scott Wolchok 8a8ac771b1 clean up NSClassFromString in Libraries/
Reviewed By: adamjernst

Differential Revision: D3794507

fbshipit-source-id: 5f6f8d3ccfcb8a7339532ca1c092750b85d622d2
2016-08-30 17:58:47 -07:00
Emil Sjolander 899adf5343 Expose flexGrow, flexShrink, and flexBasis properties
Reviewed By: javache, astreet

Differential Revision: D3785140

fbshipit-source-id: a735602c53da72e3bce69ba30936c4ed25d76b88
2016-08-30 03:13:39 -07:00
Adam Comella 4178d21e96 Expose overflow prop to layout engine
Summary:
The overflow prop needs to be set on the shadow view so that it can make its way into the layout engine. In some situations, the value of the overflow prop affects the calculations of the layout engine.

**Test plan (required)**

Verified in a test app that the `overflow` prop makes its way into the layout engine. Also, my team's app is currently using this change.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9659

Differential Revision: D3790552

fbshipit-source-id: 61513ece63ae214f48c6cb6f40fb29757a0ac706
2016-08-30 00:59:00 -07:00
Mehdi Mulani 029f5687be Display React Native Modals with transparent background
Reviewed By: javache

Differential Revision: D3779522

fbshipit-source-id: c7c036b20755ac49714c5085c38ba122abcbae04
2016-08-29 13:58:48 -07:00
Kasper Hirvikoski 101190f7f8 Verify exported modules only once to support dynamic context in DEBUG-mode
Summary:
**Motivation:** We have a project that dynamically changes classes in runtime. This component is initialised within the React Native context. Therefor `RCTBatchedBridge` copies the classes before changes are made to them. While React Native is running, changes are made to the classes dynamically. When the project reloads the `RCTBatchedBridge`, it now has an invalid list of classes containing trash pointers. This causes the project to crash on https://github.com/facebook/react-native/blob/master/React/Base/RCTBatchedBridge.m#L288 with EXC_BAD_ACCESS in the DEBUG-mode.

**Solution:** Copy the class list on each reload to get the current state. Since this is only a DEBUG-feature the overhead of this should not be a major issue.
Closes https://github.com/facebook/react-native/pull/9541

Differential Revision: D3775012

Pulled By: javache

fbshipit-source-id: d55fa0742ca100d8018c73080230cf718aa5a7e9
2016-08-29 12:13:34 -07:00
Kevin Gozali 35e7a266db allow finding the rootTag of any reactTag inside UIManager
Summary: added API to in UIManager to find the rootTag/View of any reactTag based on its layout (shadow views) hierarchy (not to be used by JS)

Reviewed By: javache

Differential Revision: D3750410

fbshipit-source-id: 68611e39930d53ece478f25245ddc7f7838daaa6
2016-08-28 22:58:28 -07:00
Pieter De Baets ea3bb35db0 Fix crash in RCTJSStackFrame
Reviewed By: mmmulani

Differential Revision: D3776330

fbshipit-source-id: 0e9126825e86dd7c124bc22341ab3b39b1bd3e0b
2016-08-26 09:58:47 -07:00
Emil Sjolander 2a859eb7e3 Revert changes causing layout failures
Differential Revision: D3776987

fbshipit-source-id: 06bd154a36f895782f45511cd8cf49cc6d7cbe7d
2016-08-26 03:13:41 -07:00
Emil Sjolander 06ee832928 Generate tests for flex properties
Differential Revision: D3771513

fbshipit-source-id: 1b5edc7a28bb26217e8a6d10d1829d9031c3ae2e
2016-08-25 15:44:23 -07:00
rh389 d943e28bc6 Use quote style for local includes
Summary:
This PR changes `#include <CSSLayout/*.h>` to  `#include "*.h"` within the `CSSLayout` directory.

Rationale: Quote includes are preferred for user (aka local/project) includes, whereas angle includes are preferred for standard libraries and external frameworks. In particular, XCode 7.1+ will not search user paths (even the current directory) when angle brackets are used unless "Always search user paths" is enabled - it is off by default and [Apple recommend](https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW110) that it is only enabled for backwards compatibility.

I think this is the best fix for https://github.com/facebook/react-native/issues/9014, and seems like good practice in any case.
Closes https://github.com/facebook/css-layout/pull/217

Reviewed By: majak

Differential Revision: D3764132

Pulled By: emilsjolander

fbshipit-source-id: c8a6e8d19db71455922e3ba8f6c72bd66018fa84
2016-08-24 10:43:42 -07:00
Bret Johnson 8fd2d7d17c Added way to not launch packager during CI build, as it hangs CI builds
Summary:
Change & motivation:
Added an environment variable, RCT_NO_LAUNCH_PACKAGER, that when set
Xcode not the launch the packager when building. This switch is needed
for CI builds, where launching the packager, which stays running, causes
the build to hang; port conflicts can be an issue as well. Really the
packager is only appropriate for interactive developer builds.  This
is a problem for Visual Studio Team Services where we just added
React Native CI build support with a React Native build extension and
surely a problem for all CI systems.  This fix is simple, and now if
the build machine sets RCT_NO_LAUNCH_PACKAGER globally or passes
it as an arg to xcodebuild, the packager won't launch and all is well.

Testing:
I tested by building both with & without the environment variable defined, ensuring
things work probably in both cases.  I also added support to our VSTS build ask to use
this and verified it works as expected too, when setting the variable..
Closes https://github.com/facebook/react-native/pull/6180

Differential Revision: D3764648

Pulled By: sahrens

fbshipit-source-id: b41cc06152aec271bbfdb2bd52d4b83a5f9c09a7
2016-08-24 10:13:36 -07:00
Matt Johnston 96d27ca9f1 fix typo
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**

Explain the **motivation** for making this change. What existing problem does the pull request solve?

Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).

For more info, see
Closes https://github.com/facebook/react-native/pull/9560

Differential Revision: D3763027

Pulled By: hramos

fbshipit-source-id: 3d60833fde92a30658f3d9f108708b41ce859a13
2016-08-24 08:29:00 -07:00
Mehdi Mulani d8b2bab794 Allow <Modal /> to be configured with a custom presentation/dismissal block
Reviewed By: javache, majak

Differential Revision: D3751545

fbshipit-source-id: 4cf420769f7939289c0b0b70ae784328df8e2bbf
2016-08-23 16:58:41 -07:00
Pieter De Baets a718f14af7 Remove deprecated RCTImageSource method
Reviewed By: majak

Differential Revision: D3755010

fbshipit-source-id: a1c4cfa066c51ec0111378a1b4e08f58b92e6cbd
2016-08-23 11:28:42 -07:00
Martin Kralik a6868161cb dont use ios border rendering if we use default black color
Summary:
iOS and css have a different way to draw borders. Decision which rendering to use considers alpha value of given color as well.
If alpha=0 -> border is invisible -> we use ios render.
That doesn't work as expected in a case where only `borderWidth` property is set.
A default black color is used when no `borderColor` is set, but alpha checking logic will test `null`. Which resolves as alpha=0.

Reviewed By: javache

Differential Revision: D3750523

fbshipit-source-id: 453d52a16287c6286e8887a9ab3795d3ded1dec6
2016-08-23 03:58:34 -07:00
Emil Sjolander 25f2a26ce9 Use const where possible
Reviewed By: IanChilds

Differential Revision: D3741999

fbshipit-source-id: 1ba7da5784c3047f2d4c03746890192f724aa65e
2016-08-22 06:59:03 -07:00
Emil Sjolander 50b0943c16 Remove unnecessary indirection
Reviewed By: IanChilds

Differential Revision: D3741988

fbshipit-source-id: fdb31dc45a478508b41c522f0e1b3ef842971b50
2016-08-22 06:59:03 -07:00
Ben Nham 4ad01be3a0 Remove iOS 7 version check in RCTJSCWrapperCreate
Reviewed By: michalgr

Differential Revision: D3729175

fbshipit-source-id: 43ee2ba19b3d8fed20bd268d1e2d0fab83e2fe9f
2016-08-18 03:28:34 -07:00
Emil Sjolander 0da5fd21c7 Compute edge values similar to how Spacing.java does it
Reviewed By: lexs

Differential Revision: D3728742

fbshipit-source-id: aa19400880afa49664f7bde72b1df45314e699bb
2016-08-17 10:44:01 -07:00
Emil Sjolander fa9cf22074 Remove CSSPosition in favor of CSSEdge
Reviewed By: IanChilds

Differential Revision: D3728740

fbshipit-source-id: 19dc817a637b80d1f6df8d76982feb2e1fb2705a
2016-08-17 10:44:01 -07:00
Pieter De Baets fba96ab990 Use image references consistently in UIExplorer
Reviewed By: davidaurelio

Differential Revision: D3728780

fbshipit-source-id: 4da6a0417eea1ccd0ec0d25574959661f05decb1
2016-08-17 04:43:52 -07:00
Mehdi Mulani e9d6f29b64 Don't allow unsetting a region in RCTMapView
Reviewed By: javache

Differential Revision: D3723065

fbshipit-source-id: c922d03fa6c2a696b2ec00965b17b7215060aee5
2016-08-16 10:59:03 -07:00
Ben Nham 53c5c4f8c3 Rename custom JavaScriptCore.framework to JSC.framework
Reviewed By: michalgr

Differential Revision: D3709748

fbshipit-source-id: bc2a7124127944c5d24e584747074065eefa1207
2016-08-15 15:13:40 -07:00
Emil Sjolander f7a22bc33c Use single function for margin, position, padding, and border
Reviewed By: lucasr

Differential Revision: D3715201

fbshipit-source-id: ea81ed426f0f7853bb542355c01fc16ae4360238
2016-08-15 09:28:41 -07:00
Emil Sjolander 0ea4198009 Add support for flex-grow, flex-shrink, and flex-basis
Reviewed By: lucasr

Differential Revision: D3714520

fbshipit-source-id: 80d3a9a1e2b6f74b863bbe22357f2c9865fa290e
2016-08-15 09:28:41 -07:00
Emil Sjolander 451cc2dee7 Use library style imports
Reviewed By: IanChilds

Differential Revision: D3714512

fbshipit-source-id: 4c42d52b3ab92903e9e9451df0ca1564e2d33f0f
2016-08-15 09:28:41 -07:00
Emil Sjolander 043a6cd2c1 Update clang-format rules
Reviewed By: IanChilds

Differential Revision: D3714510

fbshipit-source-id: f6d0436346416aab023aacbedd70ea189e583e8d
2016-08-15 09:28:41 -07:00
Ben Nham d22003a0de dynamically load JavaScriptCore with RTLD_LOCAL option
Reviewed By: tadeuzagallo

Differential Revision: D3703415

fbshipit-source-id: c67865b7fe75c21a3b620dc3a794b5a0005cf71e
2016-08-13 03:31:08 -07:00
Ben Nham ce2f119222 fix loading of dynamic linked JavaScriptCore on iOS simulator
Reviewed By: michalgr

Differential Revision: D3703392

fbshipit-source-id: 670185de1eefd1c542de2df96e40aede3b2c12cc
2016-08-11 18:43:27 -07:00
Emil Sjolander 656f9f4b9d Use modern initializer syntax instead of comments
Reviewed By: adamjernst

Differential Revision: D3698569

fbshipit-source-id: c92b18540140662979cf001aeedaa76504c6a3ac
2016-08-11 02:58:31 -07:00
Kellie Medlin 2bd1f627ea Test building with clang 3.9
Reviewed By: compnerd

Differential Revision: D3667327

fbshipit-source-id: f3ad04360068ee26aeec6f1c2dbe0ed96ba32ad0
2016-08-10 13:13:34 -07:00
Pieter De Baets 6775d1f136 Set property ivar for shadow view frame
Reviewed By: emilsjolander

Differential Revision: D3683649

fbshipit-source-id: d818cb0eea064baca99be2bc6edf1b61b90bb64b
2016-08-10 10:58:49 -07:00
Pieter De Baets 4afaf5e538 Fix RCTRootView invalidation using the wrong bridge
Reviewed By: majak

Differential Revision: D3696533

fbshipit-source-id: e7ef4373e975e585f4c34df71966c8b5b30d3e9a
2016-08-10 07:43:33 -07:00
Jacob Parker f951da912d Add iOS support for CSS property font-variant, accepting tabular-nums…
Summary:
Ground work for allowing `font-variant`s. Currently allows switching between `tabular-nums` and `proportional-nums`. I will need guidance on how to test this, and a few pointers on code style (new to Objective C, and had to make one or two hacks).
Closes https://github.com/facebook/react-native/pull/9045

Reviewed By: majak

Differential Revision: D3664338

Pulled By: javache

fbshipit-source-id: 032f326c37ee6150348da2b33b6a3fc1988e8920
2016-08-09 08:43:34 -07:00
Pieter De Baets 335132ad63 Fix some analyzer warnings
Reviewed By: majak

Differential Revision: D3683672

fbshipit-source-id: 879578b050186bc779d01a17822d41bf7e473123
2016-08-09 03:58:36 -07:00
Roshan Jossey 915345bd01 Fix memory leak bug in RCTModalHost
Summary:
This PR addresses issue #9265.

Negated the condition that checks if `_hostViews` exists so that `_hostViews` will be allocated only if it doesn't exist
Closes https://github.com/facebook/react-native/pull/9295

Differential Revision: D3686214

fbshipit-source-id: ec0caac99d231786eefad023f3f0ed44a79f687e
2016-08-08 15:58:33 -07:00
ymmuse 7b02c1de3f fix CSSNodeList memory leak
Summary:
CSSNodeListFree does not free the list->items memory
Closes https://github.com/facebook/css-layout/pull/214

Differential Revision: D3683643

Pulled By: emilsjolander

fbshipit-source-id: 7f9ef19f4603d5558cc2f8302756b3bcec2f6c12
2016-08-08 04:58:30 -07:00
Pieter De Baets f35b372883 Make sure layout happens after setFrame:forView:
Reviewed By: majak

Differential Revision: D3682745

fbshipit-source-id: 108ff292aa79765d8e5bb7fc364717eba662c0ea
2016-08-08 03:43:23 -07:00
Pieter De Baets 6b9406ed5a Fix missing font constants on iOS7
Reviewed By: dinhviethoa

Differential Revision: D3682528

fbshipit-source-id: 7e3a0b7c2c043a869f2f5dfe9aaf404897076d0b
2016-08-07 11:58:30 -07:00
Pieter De Baets f571f016d9 Improve types in RCTFont API
Reviewed By: majak

Differential Revision: D3662880

fbshipit-source-id: f54e1ac164373337460047eb3708a588f578b5fc
2016-08-05 12:44:21 -07:00
Pieter De Baets 3d6240f9a6 Implement system font caching in RCTFont
Reviewed By: majak

Differential Revision: D3662848

fbshipit-source-id: 7135c0a80c6781669e43ae9a58a26a2c85f2c827
2016-08-05 12:44:21 -07:00
Pieter De Baets c5a44b7ca3 Move font helpers to RCTFont
Reviewed By: majak

Differential Revision: D3662804

fbshipit-source-id: 2c03a094a74c617c0d6172e327bd77d23d0d44c2
2016-08-05 12:44:20 -07:00
Pieter De Baets e30327cb13 Fix styling of system fonts
Summary:
When you call `-[RCTConvert UIFont:withFamily:...]` with a non-nil font object, we'll try to use the existing font object for system information. On iOS9+ which uses the San Francisco font, `[UIFont fontNamesForFamilyName:]` doesn't return anything useful, so we need to make sure that we detect this as a system font and use the appropriate methods. This issues is made worse by the fact that RCTTextView and friends recreate the font property for every attribute that is set (pretty horrible perf-wise).

This fixes https://github.com/facebook/react-native/issues/2140

Reviewed By: sahrens

Differential Revision: D3662751

fbshipit-source-id: c528e8945ed361a922c03f861d3c0b584658573b
2016-08-05 12:44:20 -07:00
Pieter De Baets 0222107170 Customize main thread initialization of native modules (2nd try)
Reviewed By: majak

Differential Revision: D3671197

fbshipit-source-id: e8df7669be79303d335f2c881e97310b5fed47f9
2016-08-05 11:28:32 -07:00
James Ide f8f7a1540d Prefix isUndefined with "CSS"
Summary:
Consistently namespace all of css-layout's public C API with "CSS". The only function that needed to be renamed was isUndefined, which I renamed to CSSValueIsUndefined.

Fixes #210.
Closes https://github.com/facebook/css-layout/pull/211

Reviewed By: lucasr

Differential Revision: D3674922

Pulled By: emilsjolander

fbshipit-source-id: 1752f477bde45586db112fe2654d0404cc52e1d1
2016-08-05 06:28:38 -07:00
Mengjue Wang f0fb228ec7 Provide forceRTL for LTR language to test
Summary:
1. Provide forceRTL function for developer to test RTL layout in LTR language bundle in I18nUtil and expose it in I18nManager.
2. Rename `allowRTL` and `setAllowRTL` functions

Reviewed By: fkgozali

Differential Revision: D3663693

fbshipit-source-id: 3db13a44c069ae73d1728c211306422db5dd8122
2016-08-04 12:28:30 -07:00
Emil Sjolander 4983a58d6c Add and run clang format script
Reviewed By: lucasr

Differential Revision: D3662225

fbshipit-source-id: ddd4064cbf9be21ca6a97001ace1b56b4314c86f
2016-08-04 08:28:53 -07:00