Граф коммитов

10025 Коммитов

Автор SHA1 Сообщение Дата
Valentin Shergin d272334186 RCTRootView is now has empty autoresizing mask by default
Summary: `autoresizingMask` is supposed to be set outside self class, this is UIKit convention.

Reviewed By: mmmulani

Differential Revision: D4697098

fbshipit-source-id: 7e0aa5d3032184de980b3cecafebbc4ce8ef9ada
2017-03-19 22:01:56 -07:00
Valentin Shergin 64c327ae68 Fixed issue where setting `zero scale` transfrom matrix to UIView brokes `hitTest` mechanism
Summary:
The Math Strikes Back

Several related things:
 * When we specify `scale: 0;` style for some view it ends up with calling `CATransform3DScale` with zero scale parameter.
 * In this case `CATransform3DScale` returns transform matrix full of zeros. It actually depends on representation and matrix-type (2d or 3d) but in UIView debugger it appears as [0, 0, 0, 0, ...]. And probably it is correct result.
 * By default, for hit-testing, UIKit uses specially optimized logic based on GPU/CALayer infrastructure under the hood. And the transform matrix full of zeros breaks this algorithm. I guess, it happens because zero-matrix doesn't quite make sense.

So, `scale: 0;` is a weird edge case, and in this diff, we are trying to illuminate it by replacing with epsilon value.

Related SO issues:
http://stackoverflow.com/questions/25964224/cgaffinetransformscale-not-working-with-zero-scale
http://stackoverflow.com/questions/7937369/animate-uiview-scale-to-zero

Reviewed By: blairvanderhoof

Differential Revision: D4734475

fbshipit-source-id: 7241cdffa86c05a6552860a25789e2281588ba23
2017-03-19 22:01:55 -07:00
Valentin Shergin 23c2a6cf1a Removed harmful optimization in ReactNativeEventEmitter
Reviewed By: spicyj

Differential Revision: D4729779

fbshipit-source-id: 2dd5ec10d42df7f24804796c4100eca107edeedb
2017-03-19 21:46:48 -07:00
Adam Ernst 47d2cfeac5 Whitelist some stuff in React
Reviewed By: mzlee

Differential Revision: D4731968

fbshipit-source-id: 1d1ae12a50beef4cd024a467427ec3b6cd446f4c
2017-03-19 14:01:09 -07:00
Aaron Chiu 5328d952a8 kill bridge only after cleaning up NativeModules
Reviewed By: javache

Differential Revision: D4734634

fbshipit-source-id: c2d425485679454397d18b1a0c389714c0e3c484
2017-03-19 13:18:31 -07:00
Nick cbd46aaa7c more accurate product-name regex
Summary:
Some projects define multiple targets, including app extensions, which are built with a “.appex” extension.   This fix prevents the buildProject method from selecting any app extension (e.g. a Today.appex today-widget extension) as the product name.

Thanks for submitting a PR! Please read these instructions carefully:

- [X] Explain the **motivation** for making this change.
- [X] Provide a **test plan** demonstrating that the code is solid.
- [X] Match the **code formatting** of the rest of the codebase.
- [X] Target the `master` branch, NOT a "stable" branch.

When building our workspace, ReactNative was failing to install the app to the simulator because it calculated an incorrect path to the app itself.   It was attempting to install "Today.app" when it should have been installing "Remitly.app".   I discovered that ReactNative parses the build output to identify the generated app name, and that this was broken when the build also generated an app extension.  The f
Closes https://github.com/facebook/react-native/pull/13001

Differential Revision: D4735360

fbshipit-source-id: afeeb2073ccd65c95916b153fcde574b5343af8c
2017-03-18 13:16:08 -07:00
Arman Dezfuli-Arjomandi 22da6f2f3f Fix typo in FlatList docs
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

There was a typo in the FlatList docs for numColumns affecting the formatting of its description.

N/A

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
Closes https://github.com/facebook/react-native/pull/13002

Differential Revision: D4735343

fbshipit-source-id: f781c50c892d64e69f61aec980614e948a48f48b
2017-03-18 13:02:29 -07:00
Kevin Cooper 06dd08316f Fix suggestion to "npm start -- --reset-cache"
Summary:
As discussed in https://github.com/facebook/react-native/pull/11983. The double dash is necessary to pass through the argument to node. Based on the comments [here](https://github.com/facebook/react-native/issues/1924#issuecomment-249861004), it looks like most people use the double dash; it's unclear whether it would do anything at all if the dashes were omitted. If anyone else has better insight, let me know!
Closes https://github.com/facebook/react-native/pull/13003

Differential Revision: D4731566

Pulled By: hramos

fbshipit-source-id: 62562536db7589a03a511762117cbf0e36d3aafb
2017-03-18 13:02:29 -07:00
Eloy Durán 09b8ef41e1 Fix issue with whitespace in path to source and stabilise CI.
Summary:
* Fixes issue where headers could not be found due to whitespace in an unquoted header search path. https://github.com/facebook/react-native/issues/11781#issuecomment-287176373
* Stabilises CI but not needing to download the source for Yoga, but use the existing cloned repo instead.

/cc mkonicek
Closes https://github.com/facebook/react-native/pull/13007

Differential Revision: D4735347

fbshipit-source-id: 933aefcb0e65537d2e759d25f4e3b81cdf4b8cb5
2017-03-18 12:31:37 -07:00
Spencer Ahrens 9c3e6ae9f0 Fix Animated.event attach/detach on component re-render
Summary:
Need to make sure `detach` happens on the old `scrollableNode` before it's unmounted and that `attach` happens on the new `scrollableNode` after it's mounted. This should also be more performant because the detach step no longer requires iterating through all the props, most of which are not animated, and we filter out unneeded updates if props or ref haven't changed.

= Test Plan =

Hook up native onscroll events in `FlatListExample` and toggle "debug" - before, the events would stop working because they would try to attach to the old unmounted node, but with this diff it keeps working as expected.

Reviewed By: fkgozali

Differential Revision: D4687186

fbshipit-source-id: 313a7964d4614190308490a51fc4f56abb6690f8
2017-03-17 22:15:40 -07:00
Ashwin Bharambe f48b54bf62 Expose RCTImageLocalAssetURL as a utility
Reviewed By: javache

Differential Revision: D4696627

fbshipit-source-id: 56d3e59983f524dfd5021835734b9b34203e20f2
2017-03-17 17:02:06 -07:00
Ashwin Bharambe 11814a5a81 Ensure `ResourceDrawableIdHelper` is thread-safe
Reviewed By: jaegs

Differential Revision: D4696625

fbshipit-source-id: e0aa7870ba02d8e6542c436d7f775bb251cf91ae
2017-03-17 17:02:04 -07:00
Ashwin Bharambe 95c1926193 Introduce `DeviceInfo` as a new native module
Summary:
The `UIManager` already has a lot of responsibilities and is deeply
tied with React Native's view architecture. This diff separates out a
`DeviceInfo` native module to provide information about screen dimensions and
font scale, etc.

Reviewed By: fkgozali

Differential Revision: D4713834

fbshipit-source-id: f2ee93acf876a4221c29a8c731f5abeffbb97974
2017-03-17 17:01:57 -07:00
Andrew Y. Chen 238fd4ad19 Move idle detection classes to its own directory
Reviewed By: AaaChiuuu

Differential Revision: D4676282

fbshipit-source-id: 1b07e66ba638d4293eec65cb4e336f21dfb78218
2017-03-17 16:46:17 -07:00
Emil Sjolander e69a80f7f9 Revert D4713847: [rn] Optimize ReactShadowNode by more manually converting between string and enums
Differential Revision: D4713847

fbshipit-source-id: c1a60ad133ec010556c0b4c6e5fd39cdc0eab337
2017-03-17 13:30:26 -07:00
Emil Sjolander b956c111d8 Revert D4716024: [yoga] Avoid transfering cached layout information to java
Differential Revision: D4716024

fbshipit-source-id: 7276b4bbf072aa444c5ae9fd1a3d62ea87a0cec1
2017-03-17 13:30:26 -07:00
Lukas Piatkowski 60142adc72 Extract PackagerConnectionSettings to ensure easier reusability of PackagerConnection module
Reviewed By: cwdick

Differential Revision: D4689535

fbshipit-source-id: f698837f407a03bf91521cc5e921c66f5755e6e0
2017-03-17 10:02:34 -07:00
Emil Sjolander 50ff7167cb Optimize ReactShadowNode by more manually converting between string and enums
Reviewed By: astreet

Differential Revision: D4713847

fbshipit-source-id: 5ef5b59f85bb26f0af9af0698c9fc1f36eb5f7bf
2017-03-17 09:32:24 -07:00
Emil Sjolander f0240e004a Avoid transfering cached layout information to java
Reviewed By: astreet

Differential Revision: D4716024

fbshipit-source-id: c30763a6fc7426d653c7a6ca129615cddb4140e9
2017-03-17 09:20:52 -07:00
Emil Sjolander e854775527 Invalidate layout when node is removed from tree
Reviewed By: astreet

Differential Revision: D4716022

fbshipit-source-id: 399cc64a4b3f5fd3fc469ea37bdd31abe474dc6c
2017-03-17 09:20:51 -07:00
Pieter De Baets ce270220e4 Extract module registry creation to helper
Reviewed By: mhorowitz

Differential Revision: D4721817

fbshipit-source-id: 2fa17ca5317a57d429aa75d6c1865932af27e02f
2017-03-17 07:08:14 -07:00
Pieter De Baets ea069b69de Make Cxx modules lazy on iOS
Reviewed By: mhorowitz

Differential Revision: D4716040

fbshipit-source-id: 08cc1317e15f0b3bd1df6d76c483a560f5c43d53
2017-03-17 07:08:14 -07:00
Pieter De Baets 99d73c8927 Move FBReactJSExecutor to Instance
Reviewed By: mhorowitz

Differential Revision: D4589940

fbshipit-source-id: e3f0c374e78f77e54cede5c617414e41844f0f4d
2017-03-17 07:08:14 -07:00
Pieter De Baets 73e81b87d3 Remove unused onNativeException delegate method
Reviewed By: mhorowitz

Differential Revision: D4597914

fbshipit-source-id: 82a109d1e6d8b0c93380840c22ec74dc75ab1a45
2017-03-17 07:08:14 -07:00
Pieter De Baets d7b37c4050 Remove JsToNativeBridge's nativeQueue
Reviewed By: mhorowitz

Differential Revision: D4589737

fbshipit-source-id: 3b2730417d99c4f98cfaad386bc50328f2551592
2017-03-17 07:08:14 -07:00
Adam Perry fbf6d1aaeb Update CRNA blog post with youtube embed.
Summary:
Adds the lightning talk's YouTube video ID to the existing CRNA blog post.

cc hramos
Closes https://github.com/facebook/react-native/pull/12987

Differential Revision: D4727390

Pulled By: ericvicenti

fbshipit-source-id: 86412679f1c476b416d4bfe41e21c255100188df
2017-03-16 20:01:20 -07:00
Brian Vaughn 6620b1ff7d Added ReactNative feature-flag switch between Stack and Fiber builds
Reviewed By: sebmarkbage

Differential Revision: D4606164

fbshipit-source-id: 5f25dbc52298d359e11e52341ff3570c797a6ea9
2017-03-16 19:30:29 -07:00
Sebastian Markbage 17cb70efdd Apply numeric text event bubbling fix for Android
Reviewed By: bvaughn

Differential Revision: D4726029

fbshipit-source-id: 94c8025bb59cc0970b6cc8ce7f3caf6e867bf72b
2017-03-16 18:16:02 -07:00
Spencer Ahrens b1a63f0088 Fix minimumViewTime
Reviewed By: blairvanderhoof

Differential Revision: D4723575

fbshipit-source-id: a120eef4079a808bd3dead08df93989e1db3d96a
2017-03-16 16:45:54 -07:00
Andrew Y. Chen 63fa621df1 Fix FrescoModule not initialized in Nodes
Reviewed By: AaaChiuuu

Differential Revision: D4687127

fbshipit-source-id: d387ff665374bd4ef40fc2e9c19543f2bacf4a66
2017-03-16 16:34:05 -07:00
Mehdi Mulani 55f48eb9f6 Move RCTLinkingManager to the main thread
Reviewed By: shergin

Differential Revision: D4709352

fbshipit-source-id: 3fc86504b12fe64dd94dd7330073d1a4a4f272e2
2017-03-16 16:02:38 -07:00
Spencer Ahrens 7e4c93d65a Fix doubled ItemSeparators
Summary: Forgot to update these after rename...

Reviewed By: yungsters

Differential Revision: D4723788

fbshipit-source-id: 8cf7e8de57a23d9ee0a424aa9c0d62ab1cfbbb12
2017-03-16 16:02:36 -07:00
Martin Konicek e1f493ebd2 Add a flag to support a simplified iOS test - just compile, don't run packager and tests
Reviewed By: gfosco

Differential Revision: D4690887

fbshipit-source-id: e6299c9146e1ac97a0606f538e9d10539f147a67
2017-03-16 15:19:02 -07:00
Andy Street 3637bce479 Warn when timers longer than 1 min are set pending AlarmManager support
Summary:
These are bad since the app might not be foregrounded anymore and it also keeps the timing module awake. We could fix the latter but the former would require someone adding AlarmManager support.

Open to better/more helpful ideas for the warning message but there's not a ton we can tell them to do right now.

Reviewed By: achen1

Differential Revision: D4716273

fbshipit-source-id: c5d3a3ce8af53253b240477f2bde38094a138a02
2017-03-16 15:19:02 -07:00
mlanter 9d3292069d Add support for animating nested styles
Summary:
This adds the ability to nest animated styles and is a follow up to #11030 .

**Test plan (required)**
Verify a component with a shadowOffset animation animates.

Example:
```
<Animated.View
  style={{
    shadowOffset: {
      width: 0,
      height: this._pressAnim.interpolate({
        inputRange: [0, 1],
        outputRange: [20, 5],
      }),
    },
  }},
/>

```

![example](https://cloud.githubusercontent.com/assets/19673711/23878825/e29f6ae4-0806-11e7-8650-9cff1f591204.gif)
Closes https://github.com/facebook/react-native/pull/12909

Differential Revision: D4723933

fbshipit-source-id: 751d7ceb4f9bb22283fb14a5e597730ffd1d9ff6
2017-03-16 14:45:53 -07:00
Jean Lauliac a1694ba86b packager: DependencyGraph-test: add broken use case
Summary:
This changeset adds a test that verifies that the duplicate modules use case is broken. The goal is to acknowledge the problem for now, and when we update `jest-haste`, we'll simply fix what needs to be fixed in that test.

See also, https://github.com/facebook/jest/pull/3107

Reviewed By: davidaurelio

Differential Revision: D4673431

fbshipit-source-id: 05e09bdf61a2eddf2e9d1e32a33d32065c9051f1
2017-03-16 14:01:11 -07:00
Jean Lauliac 3bb9512484 packager: FBGlobalTransformCache: move the retry/error logic
Reviewed By: davidaurelio

Differential Revision: D4713585

fbshipit-source-id: 6a83f858692b8a1f6326051f3a3f4a3a549e4027
2017-03-16 14:01:10 -07:00
Jakub Woyke b8cc75c613 Don't call libc malloc and free directly from assembly
Reviewed By: strager, javache

Differential Revision: D4484300

fbshipit-source-id: 97b9c2e9525f38c9158cfb499ba93d1af7d84b69
2017-03-16 12:34:06 -07:00
Jean Lauliac bb266715f1 packager: GlobalTransformCache: finish conversion to async/await
Reviewed By: davidaurelio

Differential Revision: D4713456

fbshipit-source-id: f65c45439d1657872e28a296f13a73ee2032ea93
2017-03-16 09:40:25 -07:00
Andy Street c8d922b467 BREAKING: Only call batchDidComplete when there were actually native calls dispatched
Summary: This is breaking because it affects the contract for onBatchComplete, but modules really shouldn't (and probably aren't) depending on it being called without any actual native module method calls having happened.

Reviewed By: javache

Differential Revision: D4715656

fbshipit-source-id: 53ddd4a26c9949de86f5111d214b3e5002ca2e94
2017-03-16 07:45:38 -07:00
Ashok Menon d5dda1b136 Adding in missing wrapper invocation.
Reviewed By: javache

Differential Revision: D4714260

fbshipit-source-id: 641dfd07e8161bedf31cfd4cf94b1dc64beec0f9
2017-03-15 18:30:20 -07:00
Bin Yue c53404a688 Fix TextInput 'defaultValue' propTypes to 'string'
Summary:
Because `TextInput` only render the `defaultValue` of `string`, when using other types of values, it will render empty('') without any Warnings.
Closes https://github.com/facebook/react-native/pull/11478

Differential Revision: D4340132

Pulled By: lacker

fbshipit-source-id: aedb96d49277836000c0adc53007c97db6363253
2017-03-15 18:08:22 -07:00
Andrew Jack 35046984db Add TextLayoutBuilder proguard rule
Summary:
To enable users to use run proguard in their Android applications.

Fixes: #11891

[TextLayoutBuilder](https://github.com/facebookincubator/TextLayoutBuilder) is built as a Jar rather than an AAR so the proguard rules cannot be provided with the binary.

This PR adds the rules that are included in TextLayoutBuilder https://github.com/facebookincubator/TextLayoutBuilder/blob/master/proguard-android.txt

- Created an `react-native init ProguardTest` project with proguard turned on for v0.41.0
- Make sure tests pass on both Travis and Circle CI.
Closes https://github.com/facebook/react-native/pull/12511

Differential Revision: D4718029

Pulled By: mkonicek

fbshipit-source-id: 9e3f11c8b9b54eb8e52aa6f44cacd00857a882a5
2017-03-15 17:46:15 -07:00
Hector Ramos 28bb1960a4 Shorten template instructions.
Summary:
I've noticed many pull requests are opened with a very short description that fails to explain the motivation behind the PR, and many more forego providing a test plan. With this PR, I am shortening the template in order to provide concise instructions that provide the essential steps above the fold in the "Open a pull request" composer window.

- We need people to open a PR against master, not stable. The exact reason for this is not important and providing an explanation takes away from other more important points.
- Test plans are essential, but their requirement appears below the fold in the current template.
- More PRs could use tests.
- Make a point of asking PR authors to follow up on CI test failures.
- The composer does not parse Markdown into HTML. Markdown is pretty readable as is, but using reference links instead of inline links should help with readability.

I observed that it will only display the first 8 lines of the PR template above the fold. Seeing t
Closes https://github.com/facebook/react-native/pull/12958

Differential Revision: D4718294

Pulled By: mkonicek

fbshipit-source-id: b19a29e5ed73fb78d09c7de17625b1883590075c
2017-03-15 17:30:58 -07:00
Mike Adams 7f4054df76 Update FlatList.js
Summary:
Only a small amendment, but took me a little bit to figure out why this wasn't working.
Closes https://github.com/facebook/react-native/pull/12706

Differential Revision: D4656700

fbshipit-source-id: d6038581aa70e96a2be775a7a9786e8c7e64f762
2017-03-15 17:00:46 -07:00
Maxime Aoustin 6336e4d41e Update Podfile documentation for RN >= 0.42.0
Summary:
I've updated the documentation that gives an example of Podfile adding a note that from React Native 0.42.0, users have to explicitly include Yoga in their Podfile.

I didn't want to modify existing `Podfile` from this documentation because they refer to `Podfile` from existing projects that do not use RN 0.42.0. So I just added a note and an example to explain how to include Yoga.

This PR is to fix the following issue: https://github.com/facebook/react-native/issues/12670
Closes https://github.com/facebook/react-native/pull/12728

Differential Revision: D4716172

Pulled By: hramos

fbshipit-source-id: 12a6e61b0d426c776a7cc2dea3ac22a50ffe56ef
2017-03-15 14:21:18 -07:00
Marc Horowitz 6eb9ee2652 Missing @DoNotStrip
Reviewed By: javache

Differential Revision: D4715719

fbshipit-source-id: c689ea68efafeb353382c8c3b72f5616932ad761
2017-03-15 13:46:45 -07:00
Andy Street 5873a228f4 Fix crash if native code tries to update the size of a modal view after JS has removed it
Summary:
See https://github.com/facebook/react-native/issues/10845

onSizeChanged is enqueueing a runnable from the ui thread that references a shadow view by id on the native modules thread. Since the shadow thread 'runs ahead' of the UI thread (e.g. it has a newer state of the world than the UI thread), this isn't safe. By the time that code block runs, it's possible that an update from JS has already removed that view from the shadow hierarchy (a change which would then propagate to the native hierarchy on the UI thread).

Reviewed By: AaaChiuuu

Differential Revision: D4706521

fbshipit-source-id: 0915f081068709b895f70b2edce12163b39e5456
2017-03-15 08:02:58 -07:00
Martin Konicek 6a9c2445ed Don't merge before Circle CI tests pass: Re-enable Android e2e test
Summary:
Disabled earlier today, a fix for HMR landed so let's test it works.
Closes https://github.com/facebook/react-native/pull/12943

Differential Revision: D4712940

Pulled By: jeanlauliac

fbshipit-source-id: 38cbfb04a0a16a0a59e8eb4c9c26adb60ab5d635
2017-03-15 07:45:23 -07:00
Jean Lauliac 24183a363c packager: Resolver/polyfills/require: fix nit error message
Reviewed By: davidaurelio

Differential Revision: D4713066

fbshipit-source-id: 35f09ded85472191a3f1c36b5879acee55c60b8b
2017-03-15 07:45:23 -07:00