Commit Graph

13309 Commits

Author SHA1 Message Date
Jake 228f5c83f9 use correct delegate queue in RCTRSWebSocket
Summary:
This commit makes the websocket's delegate dispatch queue use `RCTWebSocketModule`'s method queue.

This fixes a bug where didReceiveMessage was called on the wrong queue, which is especially harmful if the websocket has a contentHandler expects to be running on the RCTWebSocketModule's method queue.

This also fixes the race condition where `_contentHandlers` and `_sockets` can be mutated from the main dispatch queue (the default in `RCTRSWebSocket`) and `RCTWebSocketModule`'s method queue.

Websockets still work, and hopefully crash less now.

- [iOS][BUGFIX][WebSocket] fix crashes caused by a race condition in websocket delegates.
Closes https://github.com/facebook/react-native/pull/18530

Differential Revision: D7394298

Pulled By: hramos

fbshipit-source-id: 230466ccb47ea532ced15cd7603256a19077b32b
2018-03-24 23:16:20 -07:00
Kevin Gozali 1acef45977 iOS: added placeholder test setup for fabric graphics/uimanager/view targets
Reviewed By: shergin

Differential Revision: D7390366

fbshipit-source-id: d49fcc335fc03d52402676341f1da24177c6084b
2018-03-23 22:22:20 -07:00
Kevin Gozali 408a5f264b iOS: added fabric/core ComponentDescriptor tests
Summary: Basic test for ComponentDescriptor mechanism.

Reviewed By: shergin

Differential Revision: D7388297

fbshipit-source-id: 3b0c625656e31df03d71a2e036388621a5e2e21d
2018-03-23 17:32:52 -07:00
Kevin Gozali e254474d4c iOS: added fabric/core ShadowNode tests
Summary: basic tests for shadow nodes and props for fabric

Reviewed By: shergin

Differential Revision: D7377867

fbshipit-source-id: dc8e5bb369aeb32b4790fd8b56f333376bc1578c
2018-03-23 17:32:52 -07:00
Kevin Gozali 8c0070c706 iOS: added fabric/core primitives tests
Summary: basic tests for fabric core primitives

Reviewed By: shergin

Differential Revision: D7373952

fbshipit-source-id: e2d9b3c15716c16b1aab698883817e670dcb7a57
2018-03-23 17:32:52 -07:00
Danny Cochran dd479a9377 Pass invertStickyHeaders to ScrollView
Summary:
invertStickyHeaders was being set to "this.props.inverted" -- it should just inherit from the props of VirtualizedList instead, per discussion in https://github.com/facebook/react-native/issues/18471

Fixes #18471

Pass "invertStickyHeaders: false" to a SectionList (or FlatList), and expect that your sticky headers stick to the bottom of the ScrollView, instead of the top.

none

[ANDROID] [BUGFIX] [SectionList] - invertStickyHeaders can now be set from SectionList or FlatList.
Closes https://github.com/facebook/react-native/pull/18524

Differential Revision: D7386163

Pulled By: hramos

fbshipit-source-id: 3b66dfca280e657303f69f98c5a8bc0df033f9f7
2018-03-23 15:12:39 -07:00
Andrew Chen (Eng) cbb7c7c193 Pass fabric flag from native to JS
Reviewed By: mdvacca

Differential Revision: D7373722

fbshipit-source-id: 3cd051f38677900693f3da797effa11f9161df37
2018-03-23 09:32:00 -07:00
Andrew Chen (Eng) 046d4cee8b Assert root node isn't null in createView
Reviewed By: mdvacca

Differential Revision: D7374406

fbshipit-source-id: 534e58e7867a9fa8e395abd587e2c808c9c7843d
2018-03-22 22:20:30 -07:00
Valentin Shergin 0376baf4b3 Revert D7343566: [RN] Fixed race condition in RCTUIManager's mounting process
Differential Revision:
D7343566

Original commit changeset: e45a691add5e

fbshipit-source-id: 08ec04538c07dc3cd630240da8bb42a932a23b6f
2018-03-22 18:14:35 -07:00
Shoaib Meenai cf642c9b1d Mark global variable as extern "C"
Reviewed By: mnovakovic

Differential Revision: D7369214

fbshipit-source-id: 710d817b4bf74b5ca0621645dd5c005b778d7171
2018-03-22 16:32:12 -07:00
Eric Samelson 15fa2250fd fix ReadableNativeMap.toHashMap() for nested maps and arrays
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Commit 7891805d22 broke the previous behavior of `ReadableNativeMap.toHashMap()` for nested maps and arrays. Previously, all nested `ReadableNativeMap`s and `ReadableNativeArray`s were recursively converted to `HashMap`s and `ArrayList`s, but this is lost when only `getLocalMap()` is returned.

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

Call `ReadableNativeMap.toHashMap()` on a map with values of type `ReadableNativeMap` and `ReadableNativeArray`. Verify the returned hash map has these converted to `HashMap` and `ArrayList`, respectively.

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [ReadableNativeMap] - Fix toHashMap() for nested maps and arrays

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/18455

Reviewed By: kathryngray

Differential Revision: D7347344

Pulled By: mdvacca

fbshipit-source-id: af2bca9dec6c0cb8a7da099b6757434fcc3ac785
2018-03-22 10:49:44 -07:00
Kevin Gozali 10c95a25cc fixed contacts for the test target
Reviewed By: mdvacca

Differential Revision: D7366977

fbshipit-source-id: 93341f8964da71a7e23049fc5d2324a0da376746
2018-03-22 10:49:44 -07:00
Andrew Jack ff1444e215 Add fresco proguard rules
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->
Adds proguard rules, which I missed off from the #18496 PR.

I've added the proguard rules as suggested in http://frescolib.org/docs/shipping.html, with the duplicates & unused libraries removed.

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->
CI passes.
Build example project with proguard turned on.

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BREAKING] [proguard] - Update Proguard config in template. If upgrading make sure you update your project's proguard file.

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->

cc foghina & hramos
Closes https://github.com/facebook/react-native/pull/18499

Differential Revision: D7366113

Pulled By: foghina

fbshipit-source-id: 20864c34976bc3930d9fdcc9428f40f7a8d7a9b8
2018-03-22 10:01:26 -07:00
Andrew Jack 8e065baad4 Update fresco to v1.8.1
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->
The current version of fresco in use is [v1.3.0](https://github.com/facebook/fresco/releases/tag/v1.3.0) from April 2017. There has been a lot of [improvements](https://github.com/facebook/fresco/releases) since then.

Fresco also depends on OkHttp 3.8.0 and soloader 0.3.0 so I have updated these too. Let me know if there's any reason either of these shouldn't be updated, however this will prevent Fresco from being updated.

The latest version of OkHttp is 3.10.0, but I have kept it as low as possible to allow developers to choose the version.

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->
Test with local build.
Check CI passes.

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [ENHANCEMENT] [Fresco/OkHttp/SoLoader] - Updates Fresco to 1.8.1, OkHttp to 3.8.0, & SoLoader to 0.3.0

cc foghina

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/18496

Differential Revision: D7361161

Pulled By: foghina

fbshipit-source-id: 6d2c5afb94ce5ff8e621188c2ac60f1ca4b787a6
2018-03-21 18:10:46 -07:00
Andrew Chen (Eng) 47910f0cad Set measure function after YogaNode has been copied
Reviewed By: mdvacca

Differential Revision: D7338948

fbshipit-source-id: e805169e162a47d0c7c775a3decbe9013c27c0e4
2018-03-21 17:48:55 -07:00
Jonathan Kim 96daf677b7 Fix OSS Android test failure
Reviewed By: fkgozali, hramos

Differential Revision: D7358801

fbshipit-source-id: 6f7979489fd7f5c9f7d9e1d7461121b7ff9f3ab0
2018-03-21 17:48:55 -07:00
Kevin Gozali 6ae38feb65 Added sample iOS unit test setup for fabric/debug target
Summary: basic setup for unit testing Fabric impl

Reviewed By: hramos

Differential Revision: D7359239

fbshipit-source-id: ccaf36e775036f2fad4d8c882bce86bbbe06dd28
2018-03-21 16:40:06 -07:00
Kevin Gozali f015900d30 fixed debug string formatting for structure
Summary:
Fixed minor issue:
* use double spaces instead of a tab character for indentation
* depth should increase by 1, not 2

Reviewed By: shergin

Differential Revision: D7332803

fbshipit-source-id: 74fda2c7a4be4f509270d3074a7d71a3d4d32fe4
2018-03-21 16:40:06 -07:00
Jonathan Dann cb3103ce09 Mark more member functions as const
Reviewed By: priteshrnandgaonkar

Differential Revision: D7291364

fbshipit-source-id: 2e7d96cfe0345692ffa411bb21a80eb7a859880b
2018-03-21 16:40:06 -07:00
Jonathan Dann ed0ba1bfc7 Pass some constructor argumetns by const-reference
Reviewed By: priteshrnandgaonkar

Differential Revision: D7291363

fbshipit-source-id: 22e606d0b3fa1133d7e0334c8cf9f5f1f32fe64b
2018-03-21 16:40:06 -07:00
Jonathan Dann 0b085a80bd Pass-by-reference in YGNode::setStyle() ::setChildren() ::setLayout()
Reviewed By: priteshrnandgaonkar

Differential Revision: D7291096

fbshipit-source-id: 7a4025831811d622050adbb5f86608855b94d68e
2018-03-21 16:40:06 -07:00
Andrew Chen (Eng) c0d27de37e Fix removal of virtual nodes in FabricReconciler
Reviewed By: mdvacca

Differential Revision: D7338949

fbshipit-source-id: 31263c138689f9b3f59deb26851132df04b8a823
2018-03-21 14:33:09 -07:00
Orta cf036dbc7a Updates Yoga to handle being in a Xcode framework project
Summary:
Updates the Yoga Podspec to work with Cocoa frameworks. Replicated a2's work over on Yoga https://github.com/facebook/yoga/pull/726

(Which should also get merged too please ❤️ )

Set it manually in my own project and tested 👍

Only https://github.com/facebook/yoga/pull/726

[IOS] [BUGFIX] [Yoga] - Fixes to yoga.podspec when integrating into an iOS app using Cocoa frameworks.
Closes https://github.com/facebook/react-native/pull/18492

Differential Revision: D7355907

Pulled By: hramos

fbshipit-source-id: 6986d2bc560a23bb7f0f20b80e88bb440079891a
2018-03-21 14:15:33 -07:00
Eli White d50cefb1f2 Moving remaining Style types from StyleSheetTypes to StyleSheet
Reviewed By: yungsters

Differential Revision: D7282831

fbshipit-source-id: ced44d79ad30b7abdda77a25b72493899c2108e4
2018-03-21 14:15:32 -07:00
Valentin Shergin c194c18126 Fixed performance regression in `ShadowView`s layout process
Summary:
This fixes perf regression which was introduced by recent refactoring of the layout process.
That is how it used to be:
114c258045/React/Views/RCTShadowView.m (L160-L166)
Note: We have to resert this flag in indication that we already applied those changes and we don't need to traverse this subtree until it is changed again.

Reviewed By: fkgozali

Differential Revision: D7343564

fbshipit-source-id: ba7e00bc5fe4992d777eed20ba0d959fd8f6c037
2018-03-21 11:04:35 -07:00
Valentin Shergin 909861ff05 Fixed race condition in RCTUIManager's mounting process
Summary:
See the comment in code.
This picture also illustrates the problem: https://cl.ly/250z0D1B0c17.
https://pxl.cl/ckBq

Reviewed By: fkgozali

Differential Revision: D7343566

fbshipit-source-id: e45a691add5e43434dea8708be4b76ff18e52131
2018-03-21 11:04:34 -07:00
Valentin Shergin 0594a109d1 Removed unnecessary `intrinsicContentSize` implementation from `RCTSurfaceHostingProxyRootView`
Summary:
The base class already implements `intrinsicContentSize` (and it's a bit more complicated that that).
(Not sure if this change anything visible.)

Reviewed By: fkgozali

Differential Revision: D7343567

fbshipit-source-id: 86f86715b0dacc3c2230289a13926f0520540089
2018-03-21 11:04:34 -07:00
Peter van der Zee b961ac3eff Depend on local version of babel-plugin-react-transform
Reviewed By: arcanis

Differential Revision: D7337432

fbshipit-source-id: 3729359da0ccfd3161546ab3ea9331ad30fb6e8d
2018-03-21 09:33:34 -07:00
Andrew Chen (Eng) 657c1a45bd Add more debug logs to FabricReconciler
Reviewed By: mdvacca

Differential Revision: D7338946

fbshipit-source-id: 839de31ca26a8e45d3bb3271d3ab5a4f53f639b0
2018-03-20 20:01:53 -07:00
Rafael Oleza a3f1ca84af Bump metro@0.31.0
Reviewed By: mjesun

Differential Revision: D7336904

fbshipit-source-id: 2132c77d07e52a91f09b6f905bee4806aaf7d23e
2018-03-20 20:01:52 -07:00
Eli White a0388f4adc Move ViewStyle, TextStyle, ImageStyle from StyleSheetTypes to StyleSheet
Reviewed By: yungsters

Differential Revision: D7282491

fbshipit-source-id: d6b54d0a2e1fe1816b6a856b1b0b1245a655320a
2018-03-20 19:16:46 -07:00
Eli White f68e04136c Move TypeForStyleKey from StyleSheetTypes to StyleSheet
Reviewed By: yungsters

Differential Revision: D7281362

fbshipit-source-id: 936d198e83dfbfc62449e82b5559a30bd57621c4
2018-03-20 19:16:46 -07:00
Héctor Ramos 3b36a6bf06 React sync for revisions ced176e...9d484ed
Reviewed By: bvaughn

Differential Revision: D7338640

fbshipit-source-id: e2d75d2f1795fb3c37f193d15216951c707711d9
2018-03-20 17:14:40 -07:00
Kevin Gozali 38fe8c2a9e moved ReactFabricInternals outside of shims
Summary: Simply moving it out of shims to not confuse React project

Reviewed By: bvaughn

Differential Revision: D7341846

fbshipit-source-id: b1a0cdb0caca977de744699521f42556699993a7
2018-03-20 15:45:08 -07:00
Artem Egorov ea92f47d90 While linking plugin ask for params only once
Summary:
Resolve #18333

CLI should ask users for params only once and waiting for response while linking plugin

Ran the `link` commands for iOS and Android and confirmed that params requested only once.

[CLI][FEATURE][local-cli/link/link.js] - Requesting link params only once for all platforms
Closes https://github.com/facebook/react-native/pull/18349

Differential Revision: D7342181

Pulled By: hramos

fbshipit-source-id: a10f0f7f2170f067d78b30e5a5221634b77da577
2018-03-20 14:49:55 -07:00
Jonathan Kim ddfcaf96bc Drop fb{android|objc} prefixed keys for oss builds
Reviewed By: hramos

Differential Revision: D7329425

fbshipit-source-id: 8a2e5936991f99b0d5112a6940856e8ee1d32a55
2018-03-20 14:49:55 -07:00
Rafael Oleza 15f0a7b76c Add getRunModuleStatement config param to configure the require() statements
Reviewed By: cpojer

Differential Revision: D7334078

fbshipit-source-id: c19340567c634e3173ee707e92389eaaa4e724e9
2018-03-20 07:24:56 -07:00
Rafael Oleza 6f339b6fcb Deprecate postProcessModules config param
Reviewed By: mjesun

Differential Revision: D7320671

fbshipit-source-id: 979108f0931f9ee0dd820025782137d4c726d19f
2018-03-20 07:24:56 -07:00
Naor Matania ad6938cda1 Revert D7319513: Depend on local version of babel-plugin-react-transform
Differential Revision:
D7319513

Original commit changeset: 4945ec753087

fbshipit-source-id: 98de6a0fda19732c02ad780953497f9d9b451dea
2018-03-20 06:46:58 -07:00
Jeff Hampton f6bcd73ed7 feat: Remove platform check in requireNativeComponent to support additional platforms
Summary:
Using platform checks can make it difficult to incorporate changes for other platforms (e.g. Windows).
 Using a check for the underlying function accomplishes the same goal without relying on an Android-specific check.  This change allows this JS file to be re-used instead of copied and modified.

[X] Run Jest tests
[X] Test in RNTester on simulators
[X] Test in Playground

No related PR's found :)

[GENERAL] [ENHANCEMENT] [Libraries/ReactNative/requireFabricComponent.js] - Simplified check against UIManager to support additional platforms, removing Android-specific check
Closes https://github.com/facebook/react-native/pull/18381

Differential Revision: D7336214

Pulled By: hramos

fbshipit-source-id: e936f1fdcf36556c528115ee3f79197883d7b7d4
2018-03-20 05:32:50 -07:00
Peter van der Zee fa7c322af4 Depend on local version of babel-plugin-react-transform
Reviewed By: jeanlauliac

Differential Revision: D7319513

fbshipit-source-id: 4945ec753087206cd01eca4ba9464672d5fb05ba
2018-03-20 04:55:39 -07:00
Charles Dick aabd5d1458 Use map instead of array
Reviewed By: dcaspi

Differential Revision: D7327839

fbshipit-source-id: e48d2b9f34e337d14f9519eac16b6a15fa56deb5
2018-03-20 04:17:55 -07:00
Andrew Chen (Eng) af42829404 Fix TextRenderingTestCase
Reviewed By: mdvacca

Differential Revision: D7330681

fbshipit-source-id: 5dd2a60382d01fb841f16851a9b2027e2b08e748
2018-03-20 01:01:53 -07:00
Andrew Chen (Eng) f136ae1362 Add test for FabricText
Reviewed By: mdvacca

Differential Revision: D7326562

fbshipit-source-id: e1229f84496e9181475979d757066e3796a24a3f
2018-03-20 01:01:53 -07:00
Andrew Chen (Eng) c49afb174f Add debug logs to FabricUIManager
Reviewed By: mdvacca

Differential Revision: D7310879

fbshipit-source-id: 3c874fd4dbd75dd865f7d94e7e31f538ef67eb66
2018-03-20 01:01:53 -07:00
Andrew Chen (Eng) 785c8f7eb9 Use native as the source of truth to decide if a test should use Fabric
Reviewed By: fkgozali

Differential Revision: D7304221

fbshipit-source-id: cdd7053e6ce6522474df261db5710e2d9c013be6
2018-03-20 01:01:53 -07:00
Sam Goldman 0d924dd629 Upgrade to Flow v0.68.0
Reviewed By: gabelevi

Differential Revision: D7310349

fbshipit-source-id: 70d29815dd7912704aec8a015c970be3fafeeba3
2018-03-19 18:31:36 -07:00
David Vacca 5347ecfd29 Fix removal of ReactShadowNode
Reviewed By: achen1

Differential Revision: D7323294

fbshipit-source-id: 411aa1bcd93cc4f9df78f64ceb0c0d8c127bc3b0
2018-03-19 18:31:36 -07:00
David Vacca cc3d45d2e9 Add logging to debug Fabric diffing algorithm
Reviewed By: achen1

Differential Revision: D7319185

fbshipit-source-id: fe47c21db5e1415aebe806f0d74b1f65f667a397
2018-03-19 18:31:36 -07:00
David Vacca 7d3de1016a Implement Fabric Reconciler
Reviewed By: achen1

Differential Revision: D7240208

fbshipit-source-id: 236b76146c50fb7f357190b08f8a5bfcef7f6645
2018-03-19 18:31:36 -07:00