Summary:
This diff disables the StateListAnimator for the ReactSlider component in Android 6 and 7
This is this is a hack to prevent T37452851 and https://github.com/facebook/react-native/issues/9979
Reviewed By: yungsters
Differential Revision: D13404685
fbshipit-source-id: d4c4f8796664c890f6a6b3502d3493370e17c300
Summary: If a children of a root node is being removed and the Root Node is empty, it was likely already removed and cleaned previously, likely due to a race condition caused by RN's async nature. In those cases, let's avoid crashing the app and instead silently ignore the root view removal.
Reviewed By: fkgozali
Differential Revision: D13405817
fbshipit-source-id: 0179d10a88a2d19f1db5ea35b48cb83d9d7429a6
Summary: This removes the remaining references to `local-cli`. We already have a `cli.js` file on the root that was just forwarding to the local-cli folder, so I removed that. It also seems that `setupBabel.js` is no longer necessary in RN.
Reviewed By: TheSavior
Differential Revision: D13396218
fbshipit-source-id: a945cb91dae39c4b58c5cabcca6b0f0328fc4717
Summary:
Promise semantics per JS should allow calling resolve or reject repeatedly without crashing. Only the first one should do anything, but others should be allowed. This change fixes the Java bridge for Android. A separate change is needed for iOS.
Issue #20262
Pull Request resolved: https://github.com/facebook/react-native/pull/20303
Differential Revision: D13396975
Pulled By: cpojer
fbshipit-source-id: 81f14f73654fa7c44e043f574a39fda481ace44b
Summary:
This fixes app crashes on opening android search assistant when a RN modal is visible. The root cause is that ViewGroup.dispatchProvideStructure() method uses the private variable 'mChildren' to access the children of a view group instead of the publicApi.
This fixes the top crash for the react_MarketplaceProductDetailsNonIPadRoute route.
This also fixes github issues:
https://github.com/facebook/react-native/issues/15932https://github.com/facebook/react-native/issues/13201https://github.com/facebook/react-native/issues/15440
that were closed without a fix
Reviewed By: PeteTheHeat
Differential Revision: D13375993
fbshipit-source-id: d603cb4ef65a423c63a6ef2b51235702c7dbffcb
Summary:
Fixes#16304
The standard format for origin HTTP headers does not allow a trailing slash. In order to not get warnings when connecting a websocket, I removed the trailing slash when generating the default origin HTTP header for the websocket connect request.
Release Notes:
----------
[Android] [Fixed] - Fixed default origin header for websocket connections to match the standard format (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) in WebSocketModule
Pull Request resolved: https://github.com/facebook/react-native/pull/22290
Differential Revision: D13374345
Pulled By: cpojer
fbshipit-source-id: 1173241f2b6912fd6df5e196053a950bb42ff01b
Summary:
@public
`-ffast-math` does not have measurable performance benefits.
By using `NaN` for *undefined* values again, we can squeeze `YGFloatOptional` into 32 bits.
This will also enable us to store `YGValue` (or a variant of it) in 32 bits.
Reviewed By: SidharthGuglani
Differential Revision: D13119110
fbshipit-source-id: 4e6964240bf74ebc22d8783107b89d536a1a0842
Summary: This diff ensures that Events delivered from the C++ side are actually processed. This is done forcing the execution of AsyncEventBeat.beat() in these cases
Reviewed By: shergin
Differential Revision: D13313955
fbshipit-source-id: b2785647913a640c2d557f4fa08d447845a540e9
Summary: I want the same instrumentation we did for the JS thread for the NM thread. This diff adds thread cpu time.
Reviewed By: alexeylang
Differential Revision: D13328876
fbshipit-source-id: 7b310956c52907ffbd881f864e1f8e774853d7f5
Summary: Computing things like "page faults since this thread was created" or "cpu time spent on this thread since it was created" is pretty easy - just measure it when you want it. However, if you want to know "how much wall time has elapsed since this thread was created" you need to record some timing info when the thread is created. This diff adds a an API for querying that from the RN thread holder abstraction.
Reviewed By: alexeylang
Differential Revision: D13246235
fbshipit-source-id: d36af61dbe27f662980fe508b2644e9d5255bb7e
Summary:
This diff fixes a NPE happening in StatusBarModule when the style passed by parameter is null.
Even if JS shoulnd't send a null value, this method should not crash with an NPE. I'm not changing behavior, only avoiding NPE when status is null
Reviewed By: RSNara
Differential Revision: D13287057
fbshipit-source-id: cc5ac4e97083d63f2bf65c03bac0dc9bce976423
Summary: Right now JSBundleLoader is tightly coupled to CatalystInstanceImpl; this diffs adds an interface, JSBundleLoaderDelegate, that CatalystInstanceImpl implements so that we can use the bundle loader with other classes.
Reviewed By: mdvacca
Differential Revision: D13216752
fbshipit-source-id: fc406ef30f12ed9d3ed13a062dedd7b33f3b7985
Summary: Added more information to ending tags so that they can be connected with the starting tags.
Reviewed By: mdvacca
Differential Revision: D7121038
fbshipit-source-id: 72d51952955e22a4c8d66c4f9e75a3fd9d34df7f
Summary:
The reasoning behind this change is that right now, having both added and modified modules inside of a single `modules` field doesn't allow for basic operations like combining two deltas.
For instance, say I have three different bundle revisions: A, B and C.
Module 42 was added in B, and then removed in C.
A->B = `{modules: [42, "..."], deleted: []}`
B->C = `{modules: [], deleted: [42]}`
A->C = `{modules: [], deleted: []}`
However, were we to compute A->C as the combination of A->B and B->C, it would result in `{modules: [], deleted: [42]}` because we have no way of knowing that module 42 was only just added in B.
This means that the `deleted` field of delta X->Y might eventually contain module ids that were never present in revision X, because they were added and then removed between revisions X and Y.
The last time I changed the delta format, we had a few bug reports pop out from people who had desync issues between their version of React Native and their version of Metro. As such, I've tried to make this change backwards compatible in at least one direction (new RN, old Metro). However, this will still break if someone is using a newer version of Metro and an older version of RN. I created T37123645 to follow up on this.
Reviewed By: rafeca, fromcelticpark
Differential Revision: D13156514
fbshipit-source-id: 4a4ee3b6cc0cdff5dca7368a46d7bf663769e281
Summary: The wrappers exposed by `rn_defs.bzl` should mangle visibility to include the cell.
Reviewed By: scottrice
Differential Revision: D13219109
fbshipit-source-id: ded17e79a1d388d6b76fbdf2ab0d75e586092fcd
Summary:
This diff fixes a bug that produces TouchEvents on text to stop working after a react state has happened.
An easy way to reproduce this is opening a YellowBox, minimizing it and trying to open it again
Reviewed By: shergin
Differential Revision: D13198663
fbshipit-source-id: 19b08818bbff8014ab8227b3db1119edc4193389
Summary: Set the default text radius to 0 so that text shadows aren't applied to every text node
Reviewed By: mdvacca
Differential Revision: D13027589
fbshipit-source-id: 4f7386059ac1654b8f77dddf9eb1b772f6049e23
Summary: There is only a single use of this function across RN, and one more use in a test file. I inlined this function in both places to reduce the dependency on fbjs.
Reviewed By: yungsters
Differential Revision: D13138137
fbshipit-source-id: 32660c965a975d17e236bdd13ff0b2a8d64751ee
Summary:
This diff changes the method to calculate the hash of an AttributedString (removing shadowNode and parentShadowNode from it).
This is necessary becuase otherwise hashcode of clonned parent keep changing in every state change, when the text doesnt change
With this change we are able to cache spannables in android properly
Reviewed By: shergin
Differential Revision: D13189110
fbshipit-source-id: c1f7372809ce98a5b4d091485cc15281a4ab5e1e
Summary: This diff adds support to cache the Spannable objects that are created during measure() and updateLocalData() for text
Reviewed By: shergin
Differential Revision: D13188599
fbshipit-source-id: 6547d8ce2bb8b1dfb3c91e64facff3ba0cd97472
Summary: This diff fixes re-measures of a text component result of a change of state. For details of the bug see: T36838266
Reviewed By: shergin
Differential Revision: D13188601
fbshipit-source-id: ea9a889540f600d4e4e788105d5fa22e6cd5448c
Summary: This diff refactors the types used when Yoga requires to measure the size of a View in C++
Reviewed By: shergin
Differential Revision: D13124086
fbshipit-source-id: 89dfe80bb41b4fb2eaba84af630d52ef2509b1e1
Summary:
> Configure project :ReactAndroid
> The Task.leftShift(Closure) method has been deprecated. This is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
> Task :ReactAndroid:buildReactNdkLib
> A problem was found with the configuration of task ':ReactAndroid:buildReactNdkLib'. Registering invalid inputs and outputs via TaskInputs and TaskOutputs methods has been deprecated and is scheduled to be removed in Gradle 5.0.
> - File '[...]/react-native/ReactAndroid/src/main/jni/react' specified for property '$1' is not a file.
Pull Request resolved: https://github.com/facebook/react-native/pull/22360
Differential Revision: D13176269
Pulled By: hramos
fbshipit-source-id: cf6d498049b955d3920d356f2d68f3bc43008c56
Summary:
@public
Remove ability to configure Yoga to run with/without JNI fast calls on dalvik / art.
This switches to always run with fast calls.
Reviewed By: astreet
Differential Revision: D13144652
fbshipit-source-id: 091aab0cd1290d46346323d3e26a11dd0bb17187
Summary:
Add getUndefined() method to obtain the undefined value.
This would allow to obtain the Yoga undefined value in runtime, and not just in compile time
Reviewed By: davidaurelio
Differential Revision: D13136972
fbshipit-source-id: aa198aa1ea65bb6b7302abeba6f9f5d483a45ff3
Summary:
During C++ build, we need the libjsc.so.
But arm64-v8a and x86_64 libjsc.so are in different path and this error raised:
Android NDK: ERROR:/home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/Android.mk:jsc: LOCAL_SRC_FILES points to a missing file
/opt/ndk/android-ndk-r17c/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.
Android NDK: Check that /home/circleci/react-native/ReactAndroid/build/third-party-ndk/jsc/jni/arm64-v8a/libjsc.so exists or that its path is correct
The commit moves prebuilt libjsc.so into
ReactAndroid/src/main/jni/third-party/jsc/jni and let ndkbuild script find the prebuilt libjsc.so.
For AAR packaging, modify the jniLibs so that gradle android library plugin could find the prebuilt libjsc.so as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/22377
Differential Revision: D13166556
Pulled By: hramos
fbshipit-source-id: 61daaede7defbc66491a3e2f20058e7d248ba13e
Summary: This diff extends Text View to support not only paddingLeft, paddingRight, etc but also padding props.
Reviewed By: shergin
Differential Revision: D13111433
fbshipit-source-id: 3b0efe8468f20a5ffaf31e3f1f180e96a5409865
Summary: This diff adds support for layout constraint when measuring text
Reviewed By: shergin
Differential Revision: D13111434
fbshipit-source-id: 0c8689e9ac8ce2281b03386f275d2a8e034f88d8
Summary: Scrolling with multiple fingers produced a redbox in Fabric
Reviewed By: shergin
Differential Revision: D13108544
fbshipit-source-id: 7b70b3f55f325448191adc48c782f2014b502ad6
Summary: These methods and variables were used by Android implementation of Fabric, these are not used anymore.
Reviewed By: shergin
Differential Revision: D13108547
fbshipit-source-id: d169eb58ba20f3bfe117a124f0494ff3a4fb5dce
Summary: A simple test for WritableNativeMap. Also includes a test to verify that the key name exists in the error message if a dynamic cast exception occurs (this will be implemented in the future)
Reviewed By: mdvacca
Differential Revision: D12914375
fbshipit-source-id: 654674b1b32e7b3f38cc1364a2302d1ce08ec33e
Summary:
resizeMode applies to Image.defaultSource, because depending on screen resolution sometimes we see padding around defaultSource image while source loading. Now we can control scale of both source and defaultSource.
Changelog:
----------
[Android] [Fixed] - Image.resizeMode will apply to defaultSource, enhanced user experience. Previously, resizeMode didn't applied to defaultSource, therefore depending on screen resolution sometimes we see padding around defaultSource image while source loading.
Pull Request resolved: https://github.com/facebook/react-native/pull/22216
Differential Revision: D13088220
Pulled By: mdvacca
fbshipit-source-id: 92c66cf6228f3b7666b9ef2404d034f0005b5234
Summary:
@public
Restores the yearless format of the MIT license.
Reviewed By: SidharthGuglani
Differential Revision: D13082510
fbshipit-source-id: f5a849b06652cedf68547d4a7963398b2627915f
Summary:
This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925
It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction.
Fixes#19434
Pull Request resolved: https://github.com/facebook/react-native/pull/21117
Differential Revision: D13082740
Pulled By: hramos
fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
Summary: If a root node is being removed and has an id of NO_ID, it was likely already removed previously, likely due to a race condition caused by RN's async nature. In those cases, let's avoid crashing the app and instead silently ignore the root view removal.
Reviewed By: mdvacca
Differential Revision: D13055140
fbshipit-source-id: ec10f4c79f2ba21614f52f57557f6b3d734c9461
Summary: There are cases where we're trying to drop a view that is not associated with a ViewManager. This is likely caused by race conditions that can occur if we're dropping a view from JS (when it's no longer used) but at the same time dropping it from native (when layout animation ends, when the rootview gets unmounted). In either of those cases, it should be safe to ignore the drop operation because the view was likely dropped already.
Reviewed By: mdvacca
Differential Revision: D13036643
fbshipit-source-id: 260ffb56d32a0d670ad08f449b8df165b2533195
Summary:
Unused loads still take time to process and pollute
execution environment.
drop-conflicts
Reviewed By: passy
Differential Revision: D13054018
fbshipit-source-id: a8fe58d1c55c031925c2c0267e24e67f021cd91d
Summary:
@public
Currently only parent can tell the layout to align its children based on baseline. But if one of the children is a column or row then basealign does not work as expected.
We have added an api setReferenceBaseline which when set to true would mean that it's baseline would be considered as the reference baseline for parent amongst its siblings. If there are more than one siblings with referenceBaseline set, the first one would be considered.
Reviewed By: davidaurelio
Differential Revision: D12883323
fbshipit-source-id: 19beccfc47d98bb38f81f5b66ba764e83680f821