Reviewed By: mkonicek
Differential Revision:D2917191
Ninja: Only related to open source React Native, does not affect any fb apps
fb-gh-sync-id: c4fc80ebdd520942e75161a4a30ea4d18030bec4
shipit-source-id: c4fc80ebdd520942e75161a4a30ea4d18030bec4
Summary:
Output the Android artifacts in the new location so we can simply
do `./gradlew :ReactAndroid:installArchives` and `npm publish`.
**Test Plan**
Same as test plan of 702f999b05 without having to manually move the artifacts.
public
Reviewed By: bestander
Differential Revision: D2916664
fb-gh-sync-id: 27dcc711b3055a5a6c554ed1e69cf4a64add849c
shipit-source-id: 27dcc711b3055a5a6c554ed1e69cf4a64add849c
Summary:
As a part of this change I'm also renaming SimpleArray to JavaOnlyArray and SimpleMap to JavaOnlyMap. The main reason for the change is to support use-cases such as driving animations form the native code. In the case of native "animated" I'd like to be able to use the same interface as JS is using for updating the View properties. As view setters can take ReadableMap and ReadableArray as an argument in some cases it is necessary to create and pass those types to the setter. Using WritableNativeArray and WritableNativeMap for this purpose seems to me like a misuse and IMO will be less performant (vs java-only map/array) as those implementations of ReadableMap and ReadableArray proxies all their methods through JNI.
I'm also adding some additional class-level comments for the moved classes to avoid confusion and hopefuly prevent people from using those classess accidentally while writing native modules or methods that calls to JS.
Closes https://github.com/facebook/react-native/pull/5816
Reviewed By: svcscm
Differential Revision: D2911339
Pulled By: foghina
fb-gh-sync-id: 5b9a98d64f48d8bba34c15e3eecba2151da3577a
shipit-source-id: 5b9a98d64f48d8bba34c15e3eecba2151da3577a
Summary:
This lets us say goodbye to Maven Central. This will greatly simplify
and speed up the release process as releasing Android artifacts to
Maven Central adds a lot of [complexity](https://github.com/facebook/react-native/blob/master/Releases-publish.md)
and delays the whole release by several hours when we have to wait
for the artifacts to propagate.
This diff assumes there's a local Maven repo at
`node_modules/react-native/android`.
The second part once this lands is to change our `release.sh` script to
output the artifacts under `react-native/android` before publishing to
npm.
This adds 3.7MB to the size of `node_modules` of any app. However,
we just download eagerly what we'd normally download later via Gradle.
**Test plan**
Released RN including a local Maven repo into Sinopia:
$ cd react-native
# Updated version in gradle.properties to 0.21.0
$ ./gradlew ReactAndroid:installArchives
# Moved everything in .m2/repository/com/facebook/react to react-native/android
$ ls react-native/android
com/facebook/react/react-native/0.21.0/react-native-0.21.0.aar
com/facebook/react/react-native/0.21.0/react-native-0.21.0.pom
com/facebook/react/react-native/maven-metadata.xml
...
# Set version in package.json to 0.21.0
$ npm set registry http://localhost:4873/
$ npm publish
Created and ran an app:
$ cd /tmp
$ react-native init AndroidNpm
$ cd AndroidNpm
$ react-native run-android
It worked.
Checked that we're using the artifacts from node_modules/react-native/android:
$ cd android
$ ./gradlew app:dependencies
compile - Classpath for compiling the main sources.
+--- com.android.support:appcompat-v7:23.0.1
| \--- com.android.support:support-v4:23.0.1
| \--- com.android.support:support-annotations:23.0.1
\--- com.facebook.react:react-native:+ -> 0.21.0
+--- com.google.code.findbugs:jsr305:3.0.0
+--- com.facebook.stetho:stetho-okhttp:1.2.0
...
Checked that Android Studio can find the source jars (you can navigate to RN sources in Android Studio). Opened the new project as described in the [docs](https://facebook.github.io/react-native/docs/android-setup.html#editing-your-app-s-java-code-in-android-studio).
public
Reviewed By: bestander
Differential Revision: D2912557
fb-gh-sync-id: 251c180518a3fb9bb8e80963b236e982d65533be
shipit-source-id: 251c180518a3fb9bb8e80963b236e982d65533be
Summary:
This commit adds the delegate hooks so that local notifications get
passed onto the JS and adds a new event listener type for local
notifications.
Also add functions to clear local notifications
Closes https://github.com/facebook/react-native/pull/2084
Reviewed By: svcscm
Differential Revision: D2908096
Pulled By: nicklockwood
fb-gh-sync-id: 759d299ea35abea177e72934076297d666d3ea20
shipit-source-id: 759d299ea35abea177e72934076297d666d3ea20
Summary:
I ran into an issue trying to upload videos selected with ImagePickerIOS to S3. The file would upload just fine but would be reduced in size and have no duration. It appears to be just a thumbnail of the video. Using the media url resolves this.
Closes https://github.com/facebook/react-native/pull/5771
Reviewed By: svcscm
Differential Revision: D2905720
Pulled By: nicklockwood
fb-gh-sync-id: 4b0200652c3b6a62cdb65deb582fbc5829c577a6
shipit-source-id: 4b0200652c3b6a62cdb65deb582fbc5829c577a6
Summary:
public
Lazy export of module constants required a sync dispatch to the main thread, which was deadlocking in some of our projects.
This moves the constants export to the initial bridge init, which may slightly increase initial startup time, but avoids the deadlock.
Reviewed By: javache
Differential Revision: D2911295
fb-gh-sync-id: 0d14a629ac4fc7ee21acd293c09595c18232659b
shipit-source-id: 0d14a629ac4fc7ee21acd293c09595c18232659b
Summary:
public
- Intro new back action
- Add support in the two main reducers
- Use it in examples to support Android back button
- Disable NavigationCard gestures on Android
Reviewed By: hedgerwang
Differential Revision: D2914154
fb-gh-sync-id: d4dce6538e19613a2ffca21e2e3b2ecaded3d5dc
shipit-source-id: d4dce6538e19613a2ffca21e2e3b2ecaded3d5dc
Summary:
public
Navigator expects that the navigation bar implements the method to refresh itself.
NavigatorNavigationBar already has this method but not for NavigatorBreadcrumbNavigationBar.
Fix diff fixes this with the same fix as D2751922 did.
Reviewed By: wenjingw
Differential Revision: D2914475
fb-gh-sync-id: a2960bad5df3b403bdd2ab1dc4d349d7251b86c8
shipit-source-id: a2960bad5df3b403bdd2ab1dc4d349d7251b86c8
Summary:
We should use 4 spaces of indentation in the MainActivity template as this
is the most common setting outside fb.
public
Reviewed By: bestander
Differential Revision: D2911952
fb-gh-sync-id: 3b5285945f0033d7342348b7a7cbafa32809f7dc
shipit-source-id: 3b5285945f0033d7342348b7a7cbafa32809f7dc
Summary:
Turns out, even after discussion that was had in https://github.com/facebook/react-native/pull/5294#issuecomment-174397103, we really do need this transform.
I've just included it in the preset...let me know if you all would rather publish to npm.
The actual reason why this is necessary is because in the latest sync from FB, fbjs was updated to use the `Symbol.iterator` express in it's isEmpty function: 064a484e18
We use this in RN in the ListView...and this change (once #5084 is merged) will cause ListView to break on older JSC context's.
This resolves that, and is probably something we should have had all along.
Closes https://github.com/facebook/react-native/pull/5824
Reviewed By: svcscm
Differential Revision: D2913315
Pulled By: vjeux
fb-gh-sync-id: abaf484a9431b3111e8118d01db8d2c0d2dd73ca
shipit-source-id: abaf484a9431b3111e8118d01db8d2c0d2dd73ca
Summary:
public
KeyboardListener needs DisplayMetrics to be initialized when it is attached. At
the moment, this breaks easily whenever we change these components, since DisplayMetrics are intialized
in a module and KeyboardListener is created eagerly in ReactRootView, whereas
ReactRootView can exist without the instance.
This changes to create DisplayMetrics as soon as possible, when the react
instance is built. The KeyboardListener is created and attached after the ReactRootView is
attached to an existing instance, point at which DisplayMetrics have to be
initialized.
Reviewed By: dmmiller
Differential Revision: D2911351
fb-gh-sync-id: 64d1805c5d5b2f6876adb694b565a2df059b381d
Summary:
The bundler class had duplicated code and parts that were hard to follow, because functions accepted heterogenous arguments, leading to a lot of conditionals.
This commit tries to remove duplication between build steps of different type of bundles, and by accepting less different types of arguments. These differences are now handled further up the call stack.
public
Reviewed By: sebmarkbage
Differential Revision: D2905807
fb-gh-sync-id: ef85ea0d461a9a06a4a64480e014a5324c4ef532
Summary:
This is a cut down version of a previous pull request with just the 4 corners catered for.
Closes https://github.com/facebook/react-native/pull/4252
Reviewed By: svcscm
Differential Revision: D2911959
Pulled By: androidtrunkagent
fb-gh-sync-id: 7ddcd684d90d4d92ccefed906c0126e92818dcde
Summary:
Expose method to implement changing font family cache. Like ide suggested in #4420 , this will helpful for using remote font file (use `Typeface#createFromFile` to load downloaded font file).
iOS's CoreText already allow this in native code.
Closes https://github.com/facebook/react-native/pull/4696
Reviewed By: bestander
Differential Revision: D2911762
Pulled By: andreicoman11
fb-gh-sync-id: a931e2e711dd94fa0df6fdd066827756d862a4ba
Summary:
- Capitalise productFlavorName for target path
- Capitalise buildType in sourceName when flavour exists
- Fix the path the assets are added.
- Backward compatibility with bundleIn(buildTypeName) when flavours are added
Closes https://github.com/facebook/react-native/pull/5580
Reviewed By: svcscm
Differential Revision: D2911735
Pulled By: mkonicek
fb-gh-sync-id: 6fb391a12ee27ee2a503961d8779a85d31cf5367
Summary:
until we have an automated test in CI
Closes https://github.com/facebook/react-native/pull/5775
Reviewed By: svcscm
Differential Revision: D2911639
Pulled By: mkonicek
fb-gh-sync-id: 26d8194dd5a6fd7210f4b014787e6847217dd7f1
Summary:
public
Expose JS hooks to create flow events in systrace (the nice arrows to show async work flow) +
add support to the showing all the work enqueued from the JS thread as added in D2743733
Depends on D2743733
Reviewed By: jspahrsummers
Differential Revision: D2815293
fb-gh-sync-id: 4278f61a67a6e78cf2704bacce34b1389328c6df
Summary:
…while an event is dispatched
While it is guarded, a copy of the Set is created before listeners are added or removed. The event dispatch loop continues with the old Set of listeners.
This PR modifies `BackAndroid` to match the proposal at the end of #5781.
Closes https://github.com/facebook/react-native/pull/5783
Reviewed By: svcscm
Differential Revision: D2911282
Pulled By: foghina
fb-gh-sync-id: 34964ec3414af85eb9574bbcef081238fc67ffaf
Summary:
Now that String.prototype.includes is there, we should remove the .contains one which has not been standardized.
For fb reviewers, this needs to land after D2910339 which updates internal callsites.
Closes https://github.com/facebook/react-native/pull/5794
Reviewed By: svcscm
Differential Revision: D2910855
Pulled By: vjeux
fb-gh-sync-id: 8fd216222385f038995d1ed10e8a2c4c34c7e928
Summary:
RefreshControl did not start refreshing when refreshing was set to true initially. It also did not start refreshing on iOS when setting the prop from false to true without doing a pull to refresh gesture.
This was a pain in the ass to make work on iOS because UIRefreshControl seems super sensitive to when beginRefreshing can be called, for the initial render I need to call it in layoutSubviews. I also have to manually adjust the scrollview content offset when calling beginRefreshing. The code is a bit hacky but it was the only solution I found that was actually working.
Fixes#5716
Closes https://github.com/facebook/react-native/pull/5745
Reviewed By: svcscm
Differential Revision: D2910716
Pulled By: nicklockwood
fb-gh-sync-id: d60e73bcfe8d86bb01249ba5f17e6a23c5a5aff6
Summary:
The hex8 specified version is #rrggbbaa so it would be great to have the internal representation be 0xrrggbbaa to prevent confusion.
This pull request changes the internals of normalizeColor. It changes a lot of lines but there isn't any big changes.
Small changes:
- Use | instead of + for number operations
- Use x << 24 instead of x * (1 << 24)
- Have hslToRgb return pre shifted number
processColor is still sending colors the 0xaarrggbb format to native and tests still pass without changes.
Closes https://github.com/facebook/react-native/pull/5792
Reviewed By: svcscm
Differential Revision: D2910589
Pulled By: vjeux
fb-gh-sync-id: 6dd353f2edd5127f1762e7a57a65379d2a58e0c1
Summary:
Put the transform list up to date and add a polyfill section
Closes https://github.com/facebook/react-native/pull/5793
Reviewed By: svcscm
Differential Revision: D2910585
Pulled By: vjeux
fb-gh-sync-id: c67852654241def4a826d6d694ad6fc9cb849264
Summary:
fc94f1e6d0 and the following commits introduced some changes to the jni build but only changed the BUCK build files and not the gradle ones. This ports the changes to the gradle build files to fix the build.
Closes https://github.com/facebook/react-native/pull/5791
Reviewed By: svcscm
Differential Revision: D2910012
Pulled By: vjeux
fb-gh-sync-id: b6c7edfed6873d501e46e80a0c9f128d9df04ca4
Summary:
Everything below the bridge interacts with just a MessageQueueThread. The implementation (JMessageQueueThread) is injected from react/jni.
public
Reviewed By: astreet
Differential Revision: D2905178
fb-gh-sync-id: 8b138e746d5a96dd70837bb2149cd4e188fcdacc