Commit Graph

13384 Commits

Author SHA1 Message Date
Naris Siamwalla e512a4ae30 Fix dtor declaration for clang-6
Reviewed By: smeenai

Differential Revision: D7690428

fbshipit-source-id: 4b02a6f6cbccda3446f0a19b1b35c266a33560bd
2018-04-20 10:04:39 -07:00
Rafael Oleza cf1569c556 Export the hmr plugin directly
Summary: This will allow to configure the HMR plugin directly from `.babelrc` again, instead of having to create a bridge file: https://github.com/rafeca/metro-sample-app/blob/master/metro-babel7-plugin-react-transform.js#L3

Reviewed By: davidaurelio

Differential Revision: D7707314

fbshipit-source-id: 4c5612e1e5d27874807f2dce50d99ec0f6354bbc
2018-04-20 09:19:52 -07:00
Peter Ammon 9bbe736f23 Teach JS stack-parsing regex about alternative formats
Reviewed By: adamjernst

Differential Revision: D7706535

fbshipit-source-id: 83cc2defbcad3faa6bdbf4a5b2072b9c023e1c04
2018-04-20 09:01:27 -07:00
Miguel Jimenez Esun fc694fef66 Clean buildBundle.js, index.js and Flow types
Reviewed By: davidaurelio

Differential Revision: D7628725

fbshipit-source-id: 3873e5c7a0c9b988335dcf9b8a11fcf0598a9f50
2018-04-20 07:43:26 -07:00
Miguel Jimenez Esun 11f102373d Clean server.js and runServer.js
Reviewed By: davidaurelio

Differential Revision: D7628734

fbshipit-source-id: 3788b35b0f9b5034d9152c5c3b297313fbec231a
2018-04-20 07:43:26 -07:00
Jean Lauliac 5fd92f90af cxxreact: executors: insert ID of segment reliably into the bundle path
Reviewed By: fromcelticpark

Differential Revision: D7623232

fbshipit-source-id: df833d18f0445d52e3098b58aac347a2e9aa0040
2018-04-20 07:03:23 -07:00
Peter van der Zee 2e7dfd5213 Lock down Babel to 7-beta.40
Summary: This will lock down the plugins to babel version 7-beta.40

Reviewed By: davidaurelio

Differential Revision: D7707160

fbshipit-source-id: 6aec7f98348cac6ddd680c73ea4e36e0fb23e2a8
2018-04-20 05:22:49 -07:00
Tim Yung d69e55060f RN: Support `flexWrap: 'wrap-reverse'`
Reviewed By: fkgozali

Differential Revision: D7684403

fbshipit-source-id: 6c247ba86b8ad1bb4dcc8f44f5609c939afe0f06
2018-04-19 15:50:57 -07:00
Knott Wittawat 654435d1ed Fix VoiceOver not identifying the header correctly
Reviewed By: sophiebits

Differential Revision: D7678644

fbshipit-source-id: ee6c57f2a603eed1c41f22a4142474ab6957ccdf
2018-04-19 13:18:38 -07:00
Himabindu Gadupudi c5ca26a0e5 Correct draw path dimensions while doing even border
Reviewed By: achen1

Differential Revision: D7678473

fbshipit-source-id: 8aa5eb29d22379eaabf9951a901e237fb7569632
2018-04-19 11:44:19 -07:00
Kevin Gozali 60b05133ba Unforked renderApplication()
Summary: This allows toggling fabric renderer via the same renderApplication()

Reviewed By: mdvacca

Differential Revision: D7682524

fbshipit-source-id: 59be1d2bea15f5e13e64e2d72304d79f9cb7d084
2018-04-19 11:44:19 -07:00
David Vacca dc836780cb Make ShadowNodeRegistry thread safe
Reviewed By: achen1

Differential Revision: D7679621

fbshipit-source-id: 1003578edcf9107b736d876dac969f22f9e62b6d
2018-04-19 10:48:50 -07:00
Peter van der Zee 3aa453d975 Add sourceType as a new mandatory option
Summary:
The `sourceType` option is a new mandatory option for Babel which determines whether to parse the file with the module or script goal. The value "disambiguous" determines this state by parsing.

See https://github.com/babel/babel/pull/7417

Reviewed By: mjesun

Differential Revision: D7685610

fbshipit-source-id: 3958c5ad396592bb1d790e2df4ce315737421a2f
2018-04-19 10:11:25 -07:00
Peter van der Zee 8642356367 Drop workspace from metro lookup
Summary: Fix the path lookup for metro root.

Reviewed By: mjesun

Differential Revision: D7685280

fbshipit-source-id: 8d506bbf9c5af297d4050d2fa73475fd280bb186
2018-04-19 09:16:48 -07:00
Peter van der Zee da57ae740d Add `ast: true` to transform options for jest
Summary:
This should (at least partially) fix testing for OSS as per f8d6b97140 (r28647044)

Might be related to not locking down the Babel version, will do that in a different commit.

Reviewed By: mjesun

Differential Revision: D7685279

fbshipit-source-id: f00febfad2cec31b7e11996ee8efa2c96b44477b
2018-04-19 09:16:48 -07:00
Peter van der Zee c18684a293 Fix the metro paths for files detected as nodejs
Summary: Fix the path lookup for files to be considered to run in nodejs.

Reviewed By: mjesun

Differential Revision: D7685278

fbshipit-source-id: c921d40b60d795820448842aec464e7ff82b6eab
2018-04-19 09:16:48 -07:00
Peter van der Zee d408de0438 Drop confusing comment
Summary:
Just removing a comment

As per f8d6b97140 (r28569388)

While the comment was more to notify about this in general, I suppose it doesn't matter.

Reviewed By: rafeca

Differential Revision: D7685277

fbshipit-source-id: 2d526aeccc2e89b42ae25cbce21af5fe96f1348d
2018-04-19 09:16:48 -07:00
David Aurelio 0f2e46e84b Remove `Color` workspace
Reviewed By: mjesun

Differential Revision: D7637457

fbshipit-source-id: befee31c649edde654c05e7ba889f7c55b105b86
2018-04-19 08:23:05 -07:00
Peter van der Zee 34bd776af2 Bump babel-preset-react-native version to 5.0.0 for Babel 7
Reviewed By: rafeca

Differential Revision: D7685340

fbshipit-source-id: f229fb5da71f2f1d277d3d55eaa0f400aa76471b
2018-04-19 04:12:14 -07:00
Peter van der Zee 3c0b8922e2 Upgrade Prettier to v1.12.1 on fbsource
Reviewed By: benjaffe, ryanmce, yungsters

Differential Revision: D7652946

fbshipit-source-id: 396d45c675e93f2298cd2920d927630c81867447
2018-04-19 02:45:35 -07:00
David Vacca 7e824867ca Make Spacing cloneable
Reviewed By: achen1

Differential Revision: D7626745

fbshipit-source-id: ca6070a99d561ee5d5dd27456116dd2de75d2bf3
2018-04-18 19:04:01 -07:00
David Vacca 49655c6eb3 Fix BadtokenException thrown when opening Android Catalyst app
Reviewed By: achen1

Differential Revision: D7676053

fbshipit-source-id: e0cf9541de131b7c21de9a2647e4270f78b0a107
2018-04-18 18:17:46 -07:00
Andrew Chen (Eng) 4fcd9970bd Fix crash when reloading with Perf Monitor enabled
Reviewed By: mdvacca

Differential Revision: D7678392

fbshipit-source-id: 5fcf3bda545896f48543a95d4885c6492fac961e
2018-04-18 18:17:46 -07:00
Hugo Sousa b92b38acf9 Remove extra space in source_files
Summary:
This was causing tvOS builds to fail because .m files weren’t being included.

 - Add `tvOS` subspec to your project with a tvOS target.
 - Build
 - Profit.

[TVOS] [BREAKING] [React.podspec] - Fix building for tvOS with CocoaPods
Closes https://github.com/facebook/react-native/pull/18812

Differential Revision: D7680224

Pulled By: hramos

fbshipit-source-id: c6c3b6fb0acd2004579d85c3f72e4edd88e26ed8
2018-04-18 17:45:47 -07:00
Brian Vaughn 908e8850b9 Forked RN renderers for FB and OSS (52afbe0...0887c7d)
Reviewed By: fkgozali

Differential Revision: D7658727

fbshipit-source-id: 2fdd30694b169d180b40bc1059ecc297b07cd18d
2018-04-18 15:04:53 -07:00
Andrew Chen (Eng) 2ad0a92d38 Fix OSS Fabric test build
Reviewed By: fkgozali

Differential Revision: D7676633

fbshipit-source-id: a7db945395af10d06dddc1fde4bd035aee14b702
2018-04-18 15:04:53 -07:00
Andrew Chen (Eng) af20958425 Use real YogaNodes in FabricReconcilerTest
Reviewed By: mdvacca

Differential Revision: D7664493

fbshipit-source-id: 74b088a91ea4f691cc15b5ea15dd585fe46e2035
2018-04-18 15:04:53 -07:00
Rafael Oleza 850fd86942 Bump metro@0.33.0
Reviewed By: davidaurelio

Differential Revision: D7661486

fbshipit-source-id: 5186a853eaff139948622e93d851deb9577567dc
2018-04-18 12:29:28 -07:00
Pascal Hartig aa6239301a Add getParent() method for easier migration
Reviewed By: emilsjolander

Differential Revision: D7654526

fbshipit-source-id: efe44807caa97f495c5e5691dedcf281760fa23e
2018-04-18 04:32:34 -07:00
Andrew Chen (Eng) 864cc00a61 Use real YogaNodes in FabricUIManagerTest
Reviewed By: mdvacca

Differential Revision: D7663769

fbshipit-source-id: 78cdde975037c4e8d97d4bd21ddd7927cc105dd0
2018-04-17 18:12:23 -07:00
Andrew Chen (Eng) ff9b3c6517 Display JS component stack in native view exceptions
Reviewed By: mdvacca

Differential Revision: D7578033

fbshipit-source-id: 4dc393cddf8487db58cc3a9fefbff220983ba9da
2018-04-17 17:47:38 -07:00
Luciano Lima c4ab03a18e Add devDependencies support for templates
Summary:
Add devDependencies support to React Native templates.
Template can have a devDependencies.json file with devDependencies inside.
Using separate files to dependencies and devDependencies, it maintains compatibility with the current version.

Allows React Native templates to have devDependencies, which can help applications to have better organization, quality and testability. It's possible start a new app with some dependencies for dev support like prettier, reactotron, eslint packages and others.

Add a devDependencies.json file with at least one dependency (like prettier)

[CLI] [FEATURE] [local-cli/generator/templates.js] - Add support to devDependencies for react native templates
Closes https://github.com/facebook/react-native/pull/18164

Differential Revision: D7660744

Pulled By: hramos

fbshipit-source-id: 6fbb13832d2d1bd0c06bada0842c890dd99cf331
2018-04-17 16:44:51 -07:00
Andrew Chen (Eng) c10c6dbf7c Move Fabric tests to OSS
Reviewed By: mdvacca

Differential Revision: D7654802

fbshipit-source-id: a30c8cf062636243066a1fc73da0711442a29c76
2018-04-17 14:26:48 -07:00
Himabindu Gadupudi 4469952c9a Pass drawable width and height in pixels for inline image
Reviewed By: achen1

Differential Revision: D7655775

fbshipit-source-id: 32887eb5a686ccc45f50fb334248aad6889f704a
2018-04-17 13:44:24 -07:00
shockdesign 7c5d581d78 Switch equality check in BlobModule.java
Summary:
Switch the equality check to avoid crash on the first item. The check can be on a null object and return the correct result.

Fixes #18709

Just a simple switch on equals, to make sure we're not bombing out by having a null scheme.

No related PRs and does not require a document change.

[ANDROID][BUGFIX][BlobModule] Switch equality check in BlobModule.java
Closes https://github.com/facebook/react-native/pull/18893

Differential Revision: D7658036

Pulled By: hramos

fbshipit-source-id: db61b98dae178dbbb645070f7b0d73ab43d30541
2018-04-17 13:26:35 -07:00
Jean Lauliac 281ed9f4ce cxxreact/RAMBundleRegistry: nit fixes
Reviewed By: mhorowitz

Differential Revision: D7587411

fbshipit-source-id: 516753247af585914381308248de9652f18a6cf5
2018-04-17 12:02:35 -07:00
Jean Lauliac c9094e952b cxxreact/RAMBundleRegistry: prepend segment ID
Reviewed By: fromcelticpark

Differential Revision: D7594348

fbshipit-source-id: 0b433de8722f8a952fd056139a350dc481f0af38
2018-04-17 12:02:35 -07:00
Andrew Chen (Eng) e4f88c66e3 Revert D7569885: Fix anti aliasing rounded background
Differential Revision:
D7569885

Original commit changeset: 4bfb00485211

fbshipit-source-id: 2fc76ca8615d5562ebe8c7527e9a54058b8d82dc
2018-04-17 10:36:54 -07:00
Taras Tsugrii 1433d15557 Avoid top-level read_config invocations.
Reviewed By: danzimm

Differential Revision: D7651745

fbshipit-source-id: 5cbc82b3c9da3ab514278d438f97f98e19946dc7
2018-04-17 09:41:20 -07:00
Dmitry Zakharov b5f90ed497 Update ModuleRegistry if there're new modules registered
Reviewed By: fkgozali

Differential Revision: D7638394

fbshipit-source-id: c1690da7977f0335bc661df5f19dc9f473150d41
2018-04-17 08:32:15 -07:00
Avik Chaudhuri d2a1461d26 @allow-large-files clean up xplat/js for flow 0.70.0
Reviewed By: fishythefish

Differential Revision: D7643236

fbshipit-source-id: 1d9a95f1e249ce3fdc552a4ca92a6c63b267dae4
2018-04-17 05:42:01 -07:00
Peter van der Zee 6de4ff36b0 Fix babel-preset-react-native, bump it to babel 7
Reviewed By: yungsters

Differential Revision: D7635490

fbshipit-source-id: 9f32f4389178904c68e0a03fee0485372ec10900
2018-04-17 05:16:15 -07:00
Peter van der Zee d31dfd6db0 Remove babel packages from package.json
Reviewed By: fkgozali

Differential Revision: D7635547

fbshipit-source-id: d0fd9f7c2adde9ff56699dc5c4bc691f94b15772
2018-04-17 05:10:05 -07:00
Jonathan Kim 7f7020a1db Fix up wrapped macros
Reviewed By: mzlee

Differential Revision: D7645524

fbshipit-source-id: e62101dac95fd7458a2519588105ce43607a9769
2018-04-17 01:28:30 -07:00
Andrew Chen (Eng) eff98b6c25 Better error message for invalid native module
Reviewed By: mdvacca

Differential Revision: D7641828

fbshipit-source-id: b1500029da49b60b6a69bc61ecc7f72629f65dcb
2018-04-16 16:37:36 -07:00
Leo Nikkilä d8fcdb9bd7 Fix view indices with Android LayoutAnimation
Summary:
Fixes issue #11828 that causes layout animations for removed views to
remove some adjacent views as well. This happens because the animated
views are still present in the ViewGroup, which throws off subsequent
operations that rely on view indices having updated.

This issue was addressed in #11962, which was closed in favour of a more
reliable solution that addresses the issue globally since it’s difficult
to account for animated views everywhere. janicduplessis [recommended][0]
handling the issue through ViewManager.

Since API 11, Android provides `ViewGroup#startViewTransition(View)`
that can be used to keep child views visible even if they have been
removed from the group. ViewGroup keeps an array of these views, which
is only used for drawing. Methods such as `ViewGroup#getChildCount()`
and `ViewGroup#getChildAt(int)` will ignore them.

I believe relying on these framework methods within ViewManager is the
most reliable way to solve this issue because it also works if callers
ignore ViewManager and reach into the native view indices and counts
directly.

[0]: https://github.com/facebook/react-native/pull/11962#pullrequestreview-21862640

I wrote a minimal test app that you can find here:

<https://gist.github.com/lnikkila/87f3825442a5773f17ead433a810d53f>

The expected result is that the red and green squares disappear, a blue
one appears, and the black one stays in place. iOS has this behaviour,
but Android removes the black square as well.

We can see the bug with some breakpoint logging.

Without LayoutAnimation:

```
    NativeViewHierarchyOptimizer: Removing node from parent with tag 2 at index 0
    NativeViewHierarchyOptimizer: Removing node from parent with tag 4 at index 1
    NativeViewHierarchyManager: Removing indices [0] with tags [2]
    RootViewManager: Removing child view at index 0 with tag 2
    NativeViewHierarchyManager: Removing indices [1] with tags [4]
    RootViewManager: Removing child view at index 1 with tag 4
```

With LayoutAnimation tag 3 gets removed when it shouldn’t be:

```
    NativeViewHierarchyOptimizer: Removing node from parent with tag 2 at index 0
    NativeViewHierarchyOptimizer: Removing node from parent with tag 4 at index 1
    NativeViewHierarchyManager: Removing indices [0] with tags [2]
    NativeViewHierarchyManager: Removing indices [1] with tags [4]
->  RootViewManager: Removing child view at index 1 with tag 3
    RootViewManager: Removing child view at index 2 with tag 4

    (Animation listener kicks in here)

    RootViewManager: Removing child view at index 1 with tag 2
```

Here are some GIFs to compare, click to expand:

<details>
  <summary><b>Current master (iOS vs Android)</b></summary>
  <p></p>
  <img src="https://user-images.githubusercontent.com/1291143/38695083-fbc29cd4-3e93-11e8-9150-9b8ea75b87aa.gif" height="400" /><img src="https://user-images.githubusercontent.com/1291143/38695108-06eb73a6-3e94-11e8-867a-b95d7f926ccd.gif" height="400" />
</details><p></p>

<details>
  <summary><b>With this patch (iOS vs Android, fixed)</b></summary>
  <p></p>
  <img src="https://user-images.githubusercontent.com/1291143/38695083-fbc29cd4-3e93-11e8-9150-9b8ea75b87aa.gif" height="400" /><img src="https://user-images.githubusercontent.com/1291143/38695137-1090f782-3e94-11e8-94c8-ce33a5d7ebdb.gif" height="400" />
</details><p></p>

Previously addressed in #11962, which wasn’t merged.

Tangentially related to my other LayoutAnimation PR #18651.

No documentation changes needed.

[ANDROID] [BUGFIX] [LayoutAnimation] - Removal LayoutAnimations no longer remove adjacent views as well in certain cases.
Closes https://github.com/facebook/react-native/pull/18830

Reviewed By: achen1

Differential Revision: D7612904

Pulled By: mdvacca

fbshipit-source-id: a04cf47ab80e0e813fa043125b1f907e212b1ad4
2018-04-16 14:39:19 -07:00
David Vacca 660a578aeb Fix cloning for ReactTextInputShadowNode
Reviewed By: shergin

Differential Revision: D7628252

fbshipit-source-id: 034f2d619f716600dde21a5dd43538c261be773b
2018-04-16 14:01:49 -07:00
Andrew Chen (Eng) 311a7a8e82 Use the provided NativeModuleCallExceptionHandler if provided
Summary:
Before, any calls to ReactContext would either use the default DevSupportManager's exception handler in debug mode OR throw exceptions immediately in non debug mode. In order to intercept these kinds of native exceptions, we should reuse the NativeModuleCallExceptionHandler provided by the ReactInstanceManager. For those who don't specify a NativeModuleCallExceptionHandler, the resulting behavior remains the same. For those who do specify a NativeModuleCallExceptionHandler,
the main difference is that it will now be responsible for handling exceptions for ReactContext.handleException

Reviewed By: mdvacca

Differential Revision: D7641772

fbshipit-source-id: 8f175df687723fcbb8a7620f90d8a08c94798738
2018-04-16 13:31:56 -07:00
Sophie Alpert a275eac56e Clean up some grossness in ScrollResponder
Summary: Still gross but less gross.

Reviewed By: sebmarkbage

Differential Revision: D7107180

fbshipit-source-id: 31f1639a8f44e4ab247c338001a4a5c9b4b83cdf
2018-04-16 13:12:13 -07:00
Andrew Chen (Eng) 8102e35271 Fix originalNode memory leak
Reviewed By: mdvacca

Differential Revision: D7608359

fbshipit-source-id: 7cf69f987d4c92202ea5794b76345cb1c685f881
2018-04-16 12:34:37 -07:00