Commit Graph

12814 Commits

Author SHA1 Message Date
Valentin Shergin 46fd864348 Proper attributed strings comparsion in RCTBaseTextInputView
Summary:
Now, in the new model, we transfer text attributes with actual text via attributed text to a native text component,
so previous text-only comparsion is not sufficient anymore.

Depends on D6600685.

Differential Revision: D6809833

fbshipit-source-id: 475b7426cf3c6694781790d99ef32466606da2f2
2018-01-25 13:47:35 -08:00
Rafael Oleza e9b83e608e Bump metro@0.24.7
Summary: Releasing a new version of metro with an executable CLI

Reviewed By: davidaurelio

Differential Revision: D6808207

fbshipit-source-id: 68f6522924ea8ad7b6f9aaa3e952ebcf23d2cf8b
2018-01-25 09:49:40 -08:00
Michael Lee 869866cc5c Continue wrapping functions as we prepare for skylark
Differential Revision: D6808010

fbshipit-source-id: f24e71558baed2c2da319e20e0faf66858eb27d5
2018-01-25 09:30:00 -08:00
David Aurelio df6c48cf36 `babel-preset-react-native`: only require plugins once
Reviewed By: cpojer

Differential Revision: D6795591

fbshipit-source-id: 30b689e2cf72a4bf4bdae49113369ef536ed81d6
2018-01-25 02:45:43 -08:00
Hogyun Yu  (aka Philographer) b9d058a05c Remove references to Travis
Summary:
react-native project is migrated travis to circleCI.
but the document has some leavings.

Only Docs Edited

https://github.com/facebook/react-native/pull/16354
https://github.com/facebook/react-native/pull/16364

[ DOCS] Remove references to Travis
changed Releases.md
changed RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m
changed scripts/android-e2e-test.js
Closes https://github.com/facebook/react-native/pull/17733

Differential Revision: D6806336

Pulled By: shergin

fbshipit-source-id: 22d21995d718a89bb831f75ed2ff6074dd22c6fe
2018-01-24 22:18:34 -08:00
Avik Chaudhuri 298f3bb69a @allow-large-files flow 0.64 release
Reviewed By: gabelevi

Differential Revision: D6800250

fbshipit-source-id: 7c0902526cce77eb6931856ac24a0560c4fbbc88
2018-01-24 17:03:41 -08:00
Valentin Shergin 2716f53220 The New <Text> on iOS
Summary:
This is a complete rewrite of RCTText, the part of React Native which manages Text and TextInput components.

Key points:

* It's understandable now. It follows a simple architectural pattern, and it's easy to debug and iterate. Text flow layout is a first-class citizen in React Native layout system now, not just a wired special case. It also brings entirely new possibilities such as nested interleaving <Text> and <View> components.
* All <Text>-specific APIs were removed from UIManager and co (it's about ~16 public methods which were used exclusively only by <Text>).
* It relies on new Yoga measurement/cloning API and on-dirty handler. So, it removes built-in dirty propagation subsystem from RN completely.
* It caches string fragments properly and granularly on a per-node basis which makes updating text-containing components more performant.
* It does not instantiate UIView for virtual components which reduces memory utilization.
* It drastically improves <TextInput> capabilities (e.g. rich text inside single line <TextInput> is now supported).

Screenshots:
https://cl.ly/2j3r1V0L0324
https://cl.ly/3N2V3C3d3q3R

Reviewed By: mmmulani

Differential Revision: D6617326

fbshipit-source-id: 35d4d81b35c9870e9557d0211c0e934e6072a41e
2018-01-24 00:03:01 -08:00
Eli White cd263a2cc7 Backed out changeset 409acf8d3356
Differential Revision: D6789941

fbshipit-source-id: 30d431727a4615208f51293d071f9334584a2269
2018-01-23 19:26:03 -08:00
Michael Lee 42c410ac84 Fix permissions on test script
Reviewed By: yungsters

Differential Revision: D6791810

fbshipit-source-id: 849cffd3810eb53a6050e5e1a37d84a5e4ccb62a
2018-01-23 17:01:40 -08:00
Sergei Dryganets 0c18ec5b9c Popups calling error callback instead of crashing if view with passed tagId not found
Summary:
The showPopup method has an error callback. For some reason, it is asserting in case the wrong tagId is passed instead of calling the error callback on Android.

Pass not existing tagId to showPopup method and make sure it is receiving an error in js instead of crashing in native on Android.

[ANDROID] [MINOR] showPopup method calls error callback instead of crashing on errors.
Closes https://github.com/facebook/react-native/pull/17550

Differential Revision: D6776014

Pulled By: hramos

fbshipit-source-id: 1d97b762818d1591018fd43556eb41c3fb491eb9
2018-01-23 14:07:25 -08:00
Alex Dvornikov 70d23e82ad Check for nullptr when accessing isInspectable method
Reviewed By: javache

Differential Revision: D6785733

fbshipit-source-id: 1bbb884746e671124b7d2d950a3419ea33d70522
2018-01-23 10:13:36 -08:00
Jonathan Kim 4f6c157250 Fix open source build load error
Reviewed By: hramos

Differential Revision: D6785610

fbshipit-source-id: d50aab72aa51f8aa063f23fc1e328caf9c02de0c
2018-01-23 09:51:40 -08:00
Pritesh Nandgaonkar be8e7c6e65 Made logging logic dynamic to log string length
Reviewed By: emilsjolander

Differential Revision: D6784491

fbshipit-source-id: 26e4520a84be355ff992b808297ce7a95b3d09e3
2018-01-23 06:46:08 -08:00
Martin Sherburn 6fa039dab0 Added ScrollView support for React VR platform
Reviewed By: sahrens

Differential Revision: D6727393

fbshipit-source-id: 261d5734d5de3b94fd9eaefb5beab0e2d3074b17
2018-01-23 04:17:38 -08:00
Sergei Dryganets 46cc4907e3 ClassCastException fix: getText() returns CharSequence not Spanned.
Summary:
ClassCastException fix: getText() returns CharSequence not Spanned.
From the other hand, EditTexts getText method returns Editable which extends Spanned.
This commit fixes two similar bugs one in flat TextView and another in standard TextView.
Also, it removes redundant checks in the ReactEditText.

Application without this change sporadically crashes with the following stack trace:
```
java.lang.ClassCastException: java.lang.String cannot be cast to android.text.Spanned
	at com.facebook.react.views.text.ReactTextView.reactTagForTouch(ReactTextView.java:195)
	at com.facebook.react.uimanager.TouchTargetHelper.getTouchTargetForView(TouchTargetHelper.java:269)
	at com.facebook.react.uimanager.TouchTargetHelper.findTargetTagAndCoordinatesForTouch$58866680(TouchTargetHelper.java:101)
	at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:77)
	at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:151)
	at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:127)
	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110)

```
Closes https://github.com/facebook/react-native/pull/15452

Differential Revision: D6775986

Pulled By: hramos

fbshipit-source-id: 6de929937cbbb3e7bd98a708a40700f883cbaef0
2018-01-22 15:15:23 -08:00
Héctor Ramos f5975a97ad Add back kwargs
Summary:
Originally added in #17551 by dryganets but lost when an internal diff consolidated files into ReactNative/DEFS
Closes https://github.com/facebook/react-native/pull/17710

Differential Revision: D6778242

Pulled By: hramos

fbshipit-source-id: 22bd3348feccf1ecb53d897c84e1ca704e51fc33
2018-01-22 14:47:11 -08:00
Tim Yung b8c86b8dec RN: Revive `react-native-xcode.sh`
Reviewed By: mmmulani

Differential Revision: D6775989

fbshipit-source-id: da17748c373dd152a743aa1ed8a5f075074415d3
2018-01-22 12:33:14 -08:00
Héctor Ramos 17bd6c8e84 Move JS Bundle build step into Android
Summary:
Current setup prevents Android signal from being obtained when JavaScript environment is affected.

Proposed setup will configure Android build environment, surfacing any issues affecting Android even when a JavaScript bundle cannot be built.

We cannot proceed with unit tests and instrumentation tests if JavaScript is affected, but we will at least still get some signal from running BUCK.
Closes https://github.com/facebook/react-native/pull/17709

Differential Revision: D6775966

Pulled By: hramos

fbshipit-source-id: e50916c39060ed4e8ca880fcecc2830a51539bbd
2018-01-22 12:03:47 -08:00
Héctor Ramos f50af7f8a4 update npm cache key
Summary: Closes https://github.com/facebook/react-native/pull/17708

Differential Revision: D6775450

Pulled By: hramos

fbshipit-source-id: f8b04655dac942c84765ee01359c5f1589e00b76
2018-01-22 11:30:42 -08:00
Rafael Oleza 9a19867798 Make the React Native HMR client extend from the generic metro HMR client
Reviewed By: BYK

Differential Revision: D6752278

fbshipit-source-id: 5c93cba3e9f3cee2119cb90a711909e0b4a5b835
2018-01-22 10:20:19 -08:00
Michael Lee b8e79a7e8b Split folly/Memory out from headers-only targets
Reviewed By: yfeldblum

Differential Revision: D6732464

fbshipit-source-id: 9d9498e0faa02c2003ab0e363444b7a2be51fd93
2018-01-22 08:42:18 -08:00
Bruno Lemos 0d4ff1b7ea Add extensibility point on react-native-xcode.sh script
Summary:
Original pull request: #12863

Useful for generating source maps, for example.

Feature parity with Android, that already have this extensibility point on `build.gradle`:
```
project.ext.react = [
    extraPackagerArgs: [...]
]
```

Xcode > Build Phases > Bundle React Native code and Images
```
export NODE_BINARY=node
export EXTRA_PACKAGER_ARGS="--sourcemap-output ${SRCROOT}/build/main.jsbundle.map"
../node_modules/react-native/scripts/react-native-xcode.sh
```

[IOS] [FEATURE] [./react-native-xcode.sh] - Added $EXTRA_PACKAGER_ARGS extensibility point
Closes https://github.com/facebook/react-native/pull/16933

Differential Revision: D6771709

Pulled By: yungsters

fbshipit-source-id: a33614b45b1e3537daeb31504fdd3a402dc70ff0
2018-01-22 08:07:10 -08:00
Alexey Lang bcfbdf4fbe Add flow typing to QuickPerformanceLogger
Reviewed By: cwdick

Differential Revision: D6613292

fbshipit-source-id: 58e41507a3c7cf9fbc6b972e327ae76d294d6807
2018-01-22 05:30:54 -08:00
Jean Lauliac 5e11b8870a xplat/js: asyncRequire: redirect async modules to control modules
Reviewed By: davidaurelio

Differential Revision: D6750305

fbshipit-source-id: 4cf3f1b6e0adbe88a9e7afb6a1784d1528e131b2
2018-01-22 03:17:38 -08:00
Pascal Hartig ff2658c3de Mark model fields final
Reviewed By: emilsjolander

Differential Revision: D6759564

fbshipit-source-id: 810dc8a9730fb330760d2aedecafcea81cf25cb1
2018-01-22 03:05:17 -08:00
Build Service f49f7932d5 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/instagram-directapp.config.json on master
fbshipit-source-id: ec880908d30772bf2047963013d184e01405de03
2018-01-22 02:16:31 -08:00
Build Service faa9519021 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: c7382ae9de4fb1697190bbc9fe385bd552973fdd
2018-01-22 02:16:31 -08:00
Build Service 8bd00a2361 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/expresswifi.config.json on master
fbshipit-source-id: 42904e404f11a205af8af486e9535a8dc52da81e
2018-01-22 02:16:31 -08:00
Build Service bb6fceac27 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: 9ae5884ac23492feed039da32433cd8c08e2cc0e
2018-01-22 02:16:31 -08:00
Build Service c7846c4bfb @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: a0ba2333de9b635234aa56ccd080252fa400d534
2018-01-22 02:16:31 -08:00
Spencer Ahrens 6e7fb01c02 tighten EdgeInsetsPropType flow type
Reviewed By: yungsters

Differential Revision: D6767104

fbshipit-source-id: 40b1a4f9f41ff4beae141b636738994ccfa96d37
2018-01-21 23:30:32 -08:00
Jonathan Kim 4f2cc42a2d Make xplat react native files buildable
Reviewed By: mzlee

Differential Revision: D6605611

fbshipit-source-id: baa33947319a27b95020924d177a9398a276dabe
2018-01-21 22:05:05 -08:00
Scott Wolchok cec2e80fc2 Fix dependencies
Reviewed By: adamjernst

Differential Revision: D6754488

fbshipit-source-id: 49f2a45d024c7bd6b52f51f7705bcd167a499e47
2018-01-20 12:16:52 -08:00
gengjiawen d7a9ca2893 Remove redundant config in AndroidManifest.xml
Summary:
* remove redundant version code, name, miniSdk, targetSdk, they now are configed in build.gradle
* allowbackup = true is not a secure config

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Clean up redundant config and remove security risk config.

test android template still works.

none

<!--
Help reviewers and the release process by writing your own release notes

**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 ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - 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/17596

Differential Revision: D6768292

Pulled By: hramos

fbshipit-source-id: 9f32f17aebb9c1857d8b64d6687efe7c22e7bc79
2018-01-20 10:44:24 -08:00
Mathias Bynens 431670f908 Remove internal `utf8` utility
Summary:
As requested by davidaurelio in https://github.com/mathiasbynens/utf8.js/issues/17#issuecomment-312500535, this makes it possible for developers to use the `utf8` package from npm in combination with React Native.

Ref. https://github.com/mathiasbynens/utf8.js/issues/17
Closes https://github.com/facebook/react-native/pull/17146

Differential Revision: D6765030

Pulled By: hramos

fbshipit-source-id: dda9b3255618470aea2e32c5ba3cf1325e2ec997
2018-01-19 16:18:32 -08:00
Eli White 3c2bb3e90a TouchableWithoutFeedback will use child's nativeID if specified
Reviewed By: sahrens

Differential Revision: D6733834

fbshipit-source-id: 409acf8d33565aa1e6d4698fd5d2db046a6f9402
2018-01-19 13:02:41 -08:00
David Vacca 4d3519cc6a Adding JS hierarchy information when a StackOverflowException is thrown in Dev mode
Reviewed By: achen1

Differential Revision: D6716309

fbshipit-source-id: 23458cd126d13fec3aa9c09420f7cdd230ec8dd0
2018-01-19 13:02:41 -08:00
Rafael Oleza e8893a021f Bump metro@0.24.6
Reviewed By: arcanis, cpojer

Differential Revision: D6761110

fbshipit-source-id: b23536d639ed9e963893ef784c93aa0c6ab452a4
2018-01-19 11:42:28 -08:00
Rafael Oleza 0de470ec19 Bump metro@0.24.5
Reviewed By: BYK

Differential Revision: D6759031

fbshipit-source-id: b6ba1e2da77b944c8c73d229749f84d9c16035c7
2018-01-19 08:13:54 -08:00
Rafael Oleza 8c6b816caa Allow to attach the HMR server to an external http server
Reviewed By: BYK

Differential Revision: D6752279

fbshipit-source-id: 250255a3b1226f8aab6054e507cb3910cdcd6a85
2018-01-19 08:13:54 -08:00
David Vacca 1aac962378 Capture StackOverflowExceptions triggered when drawing a ReactViewGroup or ReactRootView
Reviewed By: achen1

Differential Revision: D6653395

fbshipit-source-id: 849b1a2ed6ab9bc057414d451e97a673178c30dd
2018-01-18 18:48:59 -08:00
David Vacca 877f1cde2e Fix and re-enable "view flattening" optimizations for Marketplace
Reviewed By: achen1

Differential Revision: D6751078

fbshipit-source-id: 32bfb9ac64f183fabbba85755be372016722afc6
2018-01-18 17:55:08 -08:00
Alex Dvornikov 493f3e8da5 Handle invalidation error in RCTObjcExecutor
Differential Revision: D6748200

fbshipit-source-id: eb98782c2ba080273c1f027846984f5f4caddf26
2018-01-18 15:23:03 -08:00
Spencer Ahrens 65184ec6b0 rename and extend new maintain visible content position feature
Summary:
Builds off of cae7179c94

- Make the prop a dictionary for more configuration options
- Rename `maintainPositionAtOrBeyondIndex` -> `maintainVisibleContentPosition` + `minIndexForVisible`
- Add autoscroll threshold feature

Given the async native of RN JS and background layout, there is no way to trigger the scrollTo from JS without risking a delay, so we add the feature in native code.

== Test Plan ==
ScrollViewExample:
https://youtu.be/pmY8pxC9PRs

Reviewed By: shergin

Differential Revision: D6729160

fbshipit-source-id: 70f9bae460ce84567857a4f696da78ce9b3b834c
2018-01-18 14:01:50 -08:00
Hovhannes Safaryan 7e7d00aebe Update React.podspec for RCTText
Summary:
Some of the classes of RCTText are now in the subfolders, this will fix pod integration for texts

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

I have integrated React Native into my project with [this guide](https://facebook.github.io/react-native/docs/integration-with-existing-apps.html) and got the error `No component found for view with name RCTText`. Searching in the web did not give any useful information so I started to dig into the code and found out that there is now subfolders and pod taking only root classes. After making this change project started to compile again.

Create empty project with pods integrated add `RCTText` subspec and in `.js` file add  some `<Text>` element

Fixed `RCTText` subspec integration.
Closes https://github.com/facebook/react-native/pull/17655

Differential Revision: D6751039

Pulled By: hramos

fbshipit-source-id: f4538d1125af2b45f36e2fa535382e032dbc8f4e
2018-01-18 13:31:50 -08:00
Liubov Zvereva 63ce56f8f5 Stop crashing when open MP on android: Revert D6688488
Reviewed By: achen1

Differential Revision: D6750774

fbshipit-source-id: 96f9e0bd244fdbf1a8784f77a74686d886424529
2018-01-18 12:18:36 -08:00
Ram N f5efc460ad Add support for finding multiple views with NativeIds using a single listener
Reviewed By: mdvacca

Differential Revision: D6735460

fbshipit-source-id: e038a68637a00fda7058fc82e253ae68cdf67c6e
2018-01-18 11:33:34 -08:00
David Vacca 71ec85f24c Cleanup ReactHorizontalScrollView
Reviewed By: achen1

Differential Revision: D6693605

fbshipit-source-id: e58425b2a5b0bf75ffb41ef3ab6fa7ad46222531
2018-01-18 10:46:47 -08:00
Jiajie Zhu 52ffa5d13e make AnimatedValueXY constructor input value immutable
Reviewed By: furdei

Differential Revision: D6741521

fbshipit-source-id: e8401982fbb3c3d6cd4bcc2581358fd4a5de12f9
2018-01-18 10:46:47 -08:00
Jean Lauliac b5e19adc02 metro: allow dynamic dependencies from within node_modules
Summary: Tries to adress https://github.com/facebook/metro/issues/65. We need a reasonnable workaround to support modules like `moment.js` that do dynamic requires but only in some cases. By replacing the call by a function that throws, we move the exception at runtime instead of happening at compile time. We don't want to do that for non-node_modules file because they are fixable directly, while `node_modules` are not fixable by people and they get completely blocked by the error at compile time.

Reviewed By: rafeca

Differential Revision: D6736989

fbshipit-source-id: a6e1fd9b56fa83907400884efd8f8594018b7c37
2018-01-18 08:09:02 -08:00