Summary: This implements `EventHandlers` abstract class (aka "Events Guy") which encapsulates `eventDispatcher` and `instanceHandle` (and ownership of future `eventTarget`), all of this as part of existing {ShadowNode + Props + LayoutMetrics + LocalData + Descriptor + (and now) EventHandlers} infra. (We don't plan to add anything else to this model. Ever.)
Reviewed By: fkgozali
Differential Revision: D8053351
fbshipit-source-id: 1dd9ccbcbe5a2eb284b59ea351dc8beca645e8bf
Summary:
Given that fact that life-time of YGNode and ShadowNode objects must be idential and that we always allocate ShadowNode on heap,
we can embed YGNode object right inside ShadowNode object and use pointer to it safely.
That allows us to save additional memory allocation for every single layoutable shadow node! Whoo-hoo!
Reviewed By: fkgozali
Differential Revision: D8070121
fbshipit-source-id: 6eefbca1b7ac0a8aad235513b4c4899d414835f2
Summary: <Image> support isn't there, so fallback to <View> instead of crashing.
Reviewed By: shergin
Differential Revision: D8086403
fbshipit-source-id: 16d7fd8023f93cbe25f2bc0f7d0a03e32cd402ce
Summary:
This is to unbreak builds due to deprecated methods.
Cocoapods build seems unaffected.
Reviewed By: mmmulani
Differential Revision: D8060139
fbshipit-source-id: a4302d649dd75d29d293aeffdcc352bf09b0c504
Summary: Moving target deployment to iOS 9.0+ from now on, removing customization for iOS 8.
Reviewed By: shergin
Differential Revision: D8053439
fbshipit-source-id: 292c58f15c6e6caf8b28d15c1521812d6ed675c5
Summary:
Fixes a bug I accidentally introduced in the responder logic for `Text`.
I forgot that I was using arrow functions to preserve `context` while still relying on the creation of `arguments`. Oops.
Differential Revision: D8077595
fbshipit-source-id: 1f7dc11ea90ca4d6bb2129823ba09c79fb5a32b0
Summary:
We were incorrectly writing jest's junit output to ~/reports/ instead of ~/react-native/reports.
Run on Circle and confirm JUnit test results are rendered: https://circleci.com/gh/hramos/react-native/2208
[INTERNAL][MINOR][CI] - JUnit test collection
[skip ci]
Closes https://github.com/facebook/react-native/pull/19349
Differential Revision: D8062654
Pulled By: hramos
fbshipit-source-id: 72066270042dfae8afce62469fcfabb57bd405a6
Summary:
I recently realized (Thanks David!) that we should not use `shared_ptr` for storing YGNode*
because ShadowNode does not share ownership of the Yoga node with anybody.
So the lifecycle of shadow node and yoga node must be synchronized (this is already the case but changing to unique_ptr makes this explicit and a bit more performant).
Reviewed By: fkgozali
Differential Revision: D8030417
fbshipit-source-id: c7f85ea309598d2a5ebfed55b1d182d3fe1336ae
Summary: Each app has its own set of components to support, so this mechanism allows each of them to customize the set. Core library only provides the signature (.h file) without any impl.
Reviewed By: shergin
Differential Revision: D8065360
fbshipit-source-id: c123397afda678e84f1d1fa41a6393f25b2c15e1
Summary:
This will allow us to present a user with a different template depending on the type of help they need.
To do:
1. Update the bot so that it auto-closes any issue that contains text from `question.md` (i.e. tried to ask a question through GitHub).
2. In a separate PR: new template to handle feature requests (update the bot to allow these to remain open)
3. Allow multiple other types of issues, such as requesting a cherry pick, or reporting a regression vs. something that does not work as expected.
4. Link to Stack Overflow / Discuss directly if and when GitHub allows the 'Get Started' button to point to a URL.
Closes https://github.com/facebook/react-native/pull/19334
Differential Revision: D8051229
Pulled By: hramos
fbshipit-source-id: 9e8aea232688c53dcbb0c047e92799e68b8b7842
Summary:
Now ConcreteComponentDescriptor can infer `ComponentName` from `ShadowNodeT` automatically,
so in the most cases we even don't need to create a subclass of that.
Reviewed By: fkgozali
Differential Revision: D8016965
fbshipit-source-id: d910597093c9f4c9f32ca06cb3ef1b12538b9543
Summary: We don't use them at all; moreover they complicate adding/changing signatures of those methods (because arguments with defaults must be grouped at the end and some arguments cannot have defaults).
Reviewed By: fkgozali
Differential Revision: D7981456
fbshipit-source-id: d7dd098e83630d1ab3342d2ca52ade9c4e27b2c3
Summary: Note: not all scrollview props and features (especially event listeners and imperative calls) are supported yet.
Reviewed By: fkgozali
Differential Revision: D7961868
fbshipit-source-id: 5277674fe976e089fd963066f78e705ad846d78d
Summary:
All the props of a scrollview, and local data.
LocalData part is probably the most interesting: with it we precompute content size which we use inside native scrollview. Previously we rely on some assumptions like "ScrollView must have only one subview" instead, and that was not so efficient and straight-forward.
Reviewed By: fkgozali
Differential Revision: D7961869
fbshipit-source-id: fa070b8423a3e7739aeb62220e51213683e1a223
Summary:
This PR fixes a bug where in `RCTNetworking` not all tasks/handlers were not being cleared when invalidating the class.
I came across this issue when writing some unit tests for my native plugins, sometimes a test would finish running (and the bridge invalidated), and only afterwards a callback from RCTNetworking would come, resulting in this exception:
```
2018-05-07 15:23:34.264494-0700 Guardian[73794:10710945] *** Assertion failure in -[RCTEventEmitter sendEventWithName:body:](), /Users/.../app/node_modules/react-native/React/Modules/RCTEventEmitter.m:41
2018-05-07 15:23:34.276505-0700 Guardian[73794:10710945] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error when sending event: didCompleteNetworkResponse with body: (
2,
cancelled,
0
). Bridge is not set. This is probably because you've explicitly synthesized the bridge in RCTNetworking, even though it's inherited from RCTEventEmitter.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010d5b21e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010be6f031 objc_exception_throw + 48
2 CoreFoundation 0x000000010d5b7472 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000010b94864f -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 165
4 Guardian 0x0000000106ff5227 -[RCTEventEmitter sendEventWithName:body:] + 567
5 Guardian 0x0000000106e9ebab __76-[RCTNetworking sendRequest:responseType:incrementalUpdates:responseSender:]_block_invoke.423 + 1115
6 Guardian 0x0000000106e8f48c __50-[RCTNetworkTask URLRequest:didCompleteWithError:]_block_invoke + 92
7 Guardian 0x0000000106e8ded1 -[RCTNetworkTask dispatchCallback:] + 113
8 Guardian 0x0000000106e8f37a -[RCTNetworkTask URLRequest:didCompleteWithError:] + 410
9 Guardian 0x0000000106ea1aa3 -[RCTHTTPRequestHandler URLSession:task:didCompleteWithError:] + 403
10 CFNetwork 0x000000010cf3a437 __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.207 + 80
11 Foundation 0x000000010b885363 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
12 Foundation 0x000000010b8851ca -[NSBlockOperation main] + 68
13 Foundation 0x000000010b8836b2 -[__NSOperationInternal _start:] + 766
14 libdispatch.dylib 0x0000000112457779 _dispatch_client_callout + 8
15 libdispatch.dylib 0x000000011245c931 _dispatch_block_invoke_direct + 317
16 libdispatch.dylib 0x0000000112457779 _dispatch_client_callout + 8
17 libdispatch.dylib 0x000000011245c931 _dispatch_block_invoke_direct + 317
18 libdispatch.dylib 0x000000011245c7d4 dispatch_block_perform + 109
19 Foundation 0x000000010b87f75b __NSOQSchedule_f + 337
20 libdispatch.dylib 0x0000000112457779 _dispatch_client_callout + 8
21 libdispatch.dylib 0x000000011245f1b2 _dispatch_queue_serial_drain + 735
22 libdispatch.dylib 0x000000011245f9af _dispatch_queue_invoke + 321
23 libdispatch.dylib 0x0000000112461cf8 _dispatch_root_queue_drain + 473
24 libdispatch.dylib 0x0000000112461ac1 _dispatch_worker_thread3 + 119
25 libsystem_pthread.dylib 0x000000011297a169 _pthread_wqthread + 1387
26 libsystem_pthread.dylib 0x0000000112979be9 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
```
Bug can be reproduced by making a `XMLHttpRequest` (uses `RCTNetworking` internally) that takes a couple seconds to perform, and issuing a RCTBridge reload command in the meantime.
You can add the following code to the react-native template project,
```
componentDidMount() {
var oReq = new XMLHttpRequest();
oReq.addEventListener("load", () => console.log('Finished'));
oReq.open("GET", "https://www.dropbox.com/s/o01hz0chqvjafhv/file.bin?dl=1");
oReq.send();
console.log('Request is being performed...')
}
```
In my case I download a 1MB file.
Run the project and reload the a couple times. Bug is triggered.
[INTERNAL] [BUGFIX] [RCTNetworking] - Clear handlers and tasks on RCTNetworking invalidation
Closes https://github.com/facebook/react-native/pull/19169
Differential Revision: D8053070
Pulled By: hramos
fbshipit-source-id: d8af54fecd99173905363f962ffc638ef8b85082
Summary:
a275eac56e removed TextInput.State but we should keep it as it was a public-ish API and we don't have any migration plan off it. Also bring back `focusTextInput` and `blurTextInput` with a deprecation warning.
Tested TextInput.State is back
[GENERAL][ENHANCEMENT][TextInput] - Bring back TextInput.State, deprecate focusTextInput and blurTextInput
Closes https://github.com/facebook/react-native/pull/18936
Differential Revision: D8044439
Pulled By: hramos
fbshipit-source-id: fde145f04bb1d46ef58b5954cb7963adf495b21c
Summary:
add google maven repo required by appcompat-v7 26
CI will download appcompat-v7 version 26.0.2
[GENERAL][MINOR][Android] - add google maven repo required by appcompat-v7 26
Closes https://github.com/facebook/react-native/pull/19316
Differential Revision: D8039324
Pulled By: hramos
fbshipit-source-id: 3e9f4dd20560f4337e81967ee9b5c30ec61016de
Summary:
If `package.json` has changed, let's throw away the cache and let yarn install do its thing.
Circle CI.
[INTERNAL][MINOR][CircleCI] - Remove checksum fallbacks
Closes https://github.com/facebook/react-native/pull/19303
Differential Revision: D8029286
Pulled By: hramos
fbshipit-source-id: 528681e4da9f0215bf63f9f8b3920a95036badca
Summary:
A few fixes:
* missing include: folly/Optional.h
* switch folly::Optional's `has_value()` to `hasValue()` for now until folly is upgraded to newer version
* fix up import for RCTTextAttributes.h
* fix up includes for "conversions.h" to use namespaced includes
Reviewed By: mmmulani
Differential Revision: D8021149
fbshipit-source-id: d3955986d3ab6b1d9b61ac1e385767893ce57e5e
Summary:
Packages are now defined in `scripts/.tests.env`, so the checksum is updated accordingly.
We also throw away the cache if the checksum fails as not doing so may prevent us from picking up new packages due to the filesystem check in `scripts/android-setup.sh`#getAndroidPackages(), as the presence of the `installed-dependencies` file restored from cache will incorrectly flag all deps as being installed.
Closes https://github.com/facebook/react-native/pull/19298
Differential Revision: D8025918
Pulled By: hramos
fbshipit-source-id: 189492baac2fea39280884ea20e376a368e23c2e
Summary: We will need this for several components, first of all for ScrollView.
Reviewed By: fkgozali
Differential Revision: D7958246
fbshipit-source-id: 364b939abe8f0734376448149bbdc735abd00189
Summary: Trivial. We will need them soon at least for ScrollView.
Reviewed By: fkgozali
Differential Revision: D7958244
fbshipit-source-id: ce92c6e6181181ac17d817292af18ffa46a4d975
Summary: Apparently, `calculateMutationInstructions` must also produce mutation instructions for root node as well. To make it possible we have to change the signature of the function and weak some restrictions in TreeMutationInstruction.
Reviewed By: fkgozali
Differential Revision: D7958248
fbshipit-source-id: 4109a6bce3a77f7eb89157201fd0e80f98487dbd
Summary: Conceptually, it always must be node owner's responsibility, but for the root node, we have to make an exception because there is no another parent node and there is no another component which has access to YogaNode.
Reviewed By: fkgozali
Differential Revision: D7958251
fbshipit-source-id: 0bdaea87adbd323c758bc3c28f325be615aa90f3
Summary:
a3931e9531 bumped buildToolsVersions to 26.0.3, and `test_android` started failing because that particular build tools version was not getting installed in CircleCI.
Closes https://github.com/facebook/react-native/pull/19276
Differential Revision: D8020664
Pulled By: hramos
fbshipit-source-id: 561aa8186ed165b3652923a9bcaf56134acfd90b