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

21435 Коммитов

Автор SHA1 Сообщение Дата
Tim Yung f6b8736b09 RN: Update ViewConfig for ScrollView
Summary:
Updates `ReactScrollViewManager` and the `ViewConfig` for `ScrollView` so that they are equivalent.

- `inverted` was missing.
- `contentOffset` was missing differ on Android. (However, there does not seem to be any perceivable behavior difference besides the native `ViewConfig` being different.)

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25084470

fbshipit-source-id: 8bea3b7a692c1038819a4147b174583a4faa71e9
2020-11-19 02:52:00 -08:00
Tim Yung de92e7405d RN: Refactor `ViewConfig` Inflation
Summary:
Refactors the conversion of a `PartialViewConfig` into a `ViewConfig` to a separate function so that it can be reused.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25084469

fbshipit-source-id: 8a7f53ff2c68860697c791c37a6abbfd3213a0f9
2020-11-19 02:52:00 -08:00
Luna Wei 003d72d80b Provide default device scale
Summary:
Changelog:
[Internal][Fixed] - Provide a default device scale

Reviewed By: kacieb

Differential Revision: D24975788

fbshipit-source-id: 5f2158d7b704713b6a759734943e52228c9cafbc
2020-11-18 21:27:17 -08:00
Tim Yung 5b527fefcb RN: Fix `registerGeneratedViewConfig` Types
Summary:
Fixes types in `registerGeneratedViewConfig` and also removes some unnecessary hacks for the `ReactNativeViewViewConfig` type.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25076608

fbshipit-source-id: 5cb2060e11db598b42fbb7f2f8aecfd7f4b262ef
2020-11-18 21:19:13 -08:00
Tim Yung e136aa3fc4 RN: Cleanup ViewConfig Types
Summary:
Cleans up the Flow types for React Native ViewConfig. After this diff, we will have two new canonical types:

- `ViewConfig` which is what we get from native and what is registered in the `ReactNativeViewConfigRegistry`.
- `PartialViewConfig` which is what we generate statically and augment at runtime before registering with the `ReactNativeViewConfigRegistry`.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25075299

fbshipit-source-id: 4b53927b2db437b615447b711e83db355d0cfa55
2020-11-18 21:19:12 -08:00
Tim Yung 69b4611049 RN: Hoist Reflection from Verification
Summary:
Hoists the call to `getNativeComponentAttributes` out of the verification function so that it's easier to keep track of when this function is and is not called.

The purpose of this will become clearer in a future refactor.

Changelog:
[Internal]

Reviewed By: ejanzer

Differential Revision: D25072600

fbshipit-source-id: bc42461baae3476fa7ecb6186c4256dd23921ed5
2020-11-18 21:19:12 -08:00
Tim Yung 9611a7b43e RN: Move RN$Bridgeless Check to Registration
Summary:
Moves the `RN$Bridgeless` check as part of moving more logic out of the verification function.

Changelog:
[Internal]

Reviewed By: ejanzer

Differential Revision: D25072601

fbshipit-source-id: 929230c02a6eaa1b724f7fd2e1a691a7c20c4b11
2020-11-18 21:19:12 -08:00
Luke Walczak a7c1c5aff2 Add possibility to disable buttons in action sheet ios (#28979)
Summary:
_**Fixed**_ version of [the previous PR](https://github.com/facebook/react-native/pull/28792) after reverting [changes](c8d678abcf (commitcomment-39299254))

----

I've noticed that currently there is no option to disable button within the `ActionSheetIOS`. It can be really useful and decided to extend the API to support that functionality.

I added a new option called `disabledButtonsIndices` to `ActionSheetIOS` which is an array of button indices which should be disabled.

`ActionSheetIOS` documentation - PR https://github.com/facebook/react-native-website/pull/1898

## Changelog

[iOS] [Added] - Add disableButtonsIndices option to ActionSheetIOS component

Pull Request resolved: https://github.com/facebook/react-native/pull/28979

Test Plan:
1. Run the `RNTester`
2. Choose `ActionSheetIOS`
3. Check the fourth example `Show Action Sheet with disabled buttons`
4. `Option 1` and `Option 2` should be disabled

screenshot | gif
 --- | ---
<img width="493" alt="Screenshot 2020-04-30 at 15 16 22" src="https://user-images.githubusercontent.com/22746080/80739025-1ec52780-8b16-11ea-8b1c-30bb40ad8c99.png"> | <img src="https://user-images.githubusercontent.com/22746080/80739043-24227200-8b16-11ea-8bcb-af25eb57baac.gif" width="493" />

Reviewed By: sammy-SC

Differential Revision: D21727497

Pulled By: PeteTheHeat

fbshipit-source-id: 749b6c623eb8a44fe2bd96829ce89be5310e2368
2020-11-18 21:11:48 -08:00
Tim Yung 130618fd85 RN: Suppress RCTVirtualText Warning in Bridgeless
Summary:
The `DummyUIManager` module warns whenever `RCTVirtualText` is initialized. This stops that.

Changelog:
[Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25073194

fbshipit-source-id: 8b9052d1cbb9a4defa5efbd110e1a91cd8884c48
2020-11-18 20:59:24 -08:00
Peter Argany bea3495fd0 Fix crash in RCTLegacyViewManagerInteropCoordinator
Summary:
Like the task mentions `strongSelf->_eventInterceptors` was crashing, probably because the coordinator was cleaned up before this block ran.

Check to make sure self is still valid before attempting to access any instance variables.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D25073812

fbshipit-source-id: cdf666f2ac028b5523097f15ff51fbae9f9ffbd8
2020-11-18 19:36:05 -08:00
Samuel Susla 19d4cc2d49 Implement ScrollView.zoomToRect
Summary: Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D24991008

fbshipit-source-id: 6048246a784b94a321281547d966379badd8f6fd
2020-11-18 15:32:30 -08:00
inokawa cf97c1f3bd Fix typo (#30330)
Summary:
Fix typo in comment

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[CATEGORY] [TYPE] - Message

Pull Request resolved: https://github.com/facebook/react-native/pull/30330

Reviewed By: fkgozali

Differential Revision: D25062086

Pulled By: PeteTheHeat

fbshipit-source-id: 251bf1d4f4986f77ae72f7654796ae1d49c1863d
2020-11-18 12:13:24 -08:00
Samuel Susla a6b785553b Check error code returned from vImageBoxConvolve_ARGB8888
Summary:
Changelog: [internal]

If value returned from `vImageBoxConvolve_ARGB8888` is negative, an error occurred.
Converting a negative number to `unsigned long` produces a large positive number (larger than memory). Trying to allocate that much memory fails, malloc returns NULL, and abort triggered inside `RCTBlurredImageWithRadius`.

To fix this we need to check for return value from `vImageBoxConvolve_ARGB8888`.

Documentation: https://developer.apple.com/documentation/accelerate/1515945-vimageboxconvolve_argb8888?language=objc

Reviewed By: JoshuaGross

Differential Revision: D25055827

fbshipit-source-id: 2c46ae6eea5cfcc95c2b552c7cd2bc60125fd24a
2020-11-18 09:39:57 -08:00
Samuel Susla 3c8d0112b3 Use variable instead of reference
Summary:
Changelog: [internal]

Reference here is incorrect, we need a container for `ShadowViewMutation`.

Reviewed By: JoshuaGross

Differential Revision: D25024080

fbshipit-source-id: f59a18d859ad391bc168c8990d40b25d18003f74
2020-11-18 06:57:10 -08:00
Samuel Susla 312226362d Add const annotations to LayoutAnimationKeyFrameManager
Summary: Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D25023706

fbshipit-source-id: 678377e2c471386670d1eab9c5adbe8aa6473a3c
2020-11-18 06:57:10 -08:00
Bartosz Kaszubowski 8cc44678ce switch Readme version badge source to shields.io (#30411)
Summary:
Lately there are some loading issues for the `fury.io` badges service which results in missing image and alt text visible in the Readme.

This PR fixes that issue by switching to `shields.io` version badge - badge service that has been used for few other badges already.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Changed] - change Readme npm version badge to `shields.io`

Pull Request resolved: https://github.com/facebook/react-native/pull/30411

Test Plan: All badges will appear in the Readme file. {emoji:1f642}

Reviewed By: cpojer

Differential Revision: D25040061

Pulled By: hramos

fbshipit-source-id: 2ef6b94ff39ec21573b7e58318aba653fd716037
2020-11-17 20:04:52 -08:00
Kevin Gozali 9eb23e741f Android OSS: Solve some Javadoc warning due to missing dependencies
Summary:
A bunch of deps were missing when generating Javadoc, producing warnings. One issue was:

```
project.getConfigurations().getByName("compile").asList()
```

Seems to be deprecated (?), so this list is always empty. The mitigation is to create a new configuration that just inherits from `api()` dependencies, so that we can add them in Javadoc task.

The other problem (not solved in this commit), is that some deps are .aar files, which require some manual unpacking before they can be processed: https://stackoverflow.com/questions/35853906/how-to-generate-javadoc-for-android-library-when-it-has-dependencies-which-are-a

Note that this is separate fix from https://github.com/facebook/react-native/pull/30417

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D25041164

fbshipit-source-id: 2ee8b268c2d38e3ecbf622c05c3c56123b7a15a6
2020-11-17 18:27:35 -08:00
Nick Gerleman b841ee6fb8 Fix :ReactAndroid:androidJavadoc task (#30417)
Summary:
Fixes https://github.com/facebook/react-native/issues/30415

This is a quick and dirty fix to unblock publish, of excluding a class from Javadoc generation that is importing a class current build logic cannot handle. This is not a long-term fix for the issue.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Fixed] - Fix :ReactAndroid:androidJavadoc task

Pull Request resolved: https://github.com/facebook/react-native/pull/30417

Test Plan: Tested that the task now completes locally.

Reviewed By: lunaleaps

Differential Revision: D25041282

Pulled By: fkgozali

fbshipit-source-id: f774ab30a09db473178e2a51c77860e4985dd8e3
2020-11-17 18:27:35 -08:00
Peter Argany 53858ceaa3 Add reset method to RCTFabricSurface [2/N]
Summary:
This method allows a surface to re-render from scratch, without having to delete and reinstantiate the surface.

Changelog: [iOS] Added reset method to RCTFabricSurface to help with reloads

Reviewed By: RSNara

Differential Revision: D25000509

fbshipit-source-id: f74170aa78cc84491ad2679f130ed3c8965bbe34
2020-11-17 14:50:18 -08:00
Samuel Susla 3a0ed2e551 Implement zoom in ScrollView
Summary: changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D24991161

fbshipit-source-id: 6f36cc21b89554006a744da8d32349ff21ccd68f
2020-11-17 11:16:42 -08:00
Samuel Susla 2669118fc8 Make event coalescing more aggressive
Summary:
Changelog: [internal]

Previous implementation of coalescing would only look at the last element in `eventQueue_` and if it was the same type and target, it would coalesce the two together. This was problem when user would scroll in UIScrollView, this triggers onTouchMove and onScroll events at high rates and prevents coalescing of them.

This changes changes the behaviour to search the `eventQueue_` backwards for an event of the same type and target. If one if found, it is moved into its place. If even of another type is found before for the same target, the event is pushed back onto the queue.

Reviewed By: JoshuaGross

Differential Revision: D24992941

fbshipit-source-id: fc1eae4ecd100af6202346674778b0634ed7a15b
2020-11-17 04:21:01 -08:00
Ramanpreet Nara 27cf82074d Guard against initializer interruptions in {Catalyst,Work,RNTester}TurboModuleManagerDelegate
Summary:
Migrate over to [how we load so libraries in Fb4aTurboModuleManagerDelegate](https://fburl.com/diffusion/wu0mcr8o).

## Motivation
When we migrated Twilight over to TurboModules, we used the CatalystTurboModuleManager as a template. This led to a production crash (T70918829) because we weren't loading so's this way. The fix: D24894071.

I'm updating these two TMMDelegates so that people don't fall into the same trap when migrating other Standalone apps.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24992931

fbshipit-source-id: 3ac3b8c30a67e24f79021f915abf5ae980d5b5d3
2020-11-17 00:34:48 -08:00
Brian Vaughn 68a476103a Name a bunch of anonymous RN contexts
Summary:
Changelog:
[General] [Changed] - Added (DEV-only) `displayName` to some RN contexts to make them more easy to differentiate when debugging.

Reviewed By: lunaleaps

Differential Revision: D24993068

fbshipit-source-id: 4904259eda50444c2f74700a3540ff4fd02ac322
2020-11-16 13:12:09 -08:00
Joshua Gross bbd0f03481 Removing pre-API 21 code
Summary:
We don't support pre-API 21/Android <5/pre-Lollipop anymore; delete related code or checks.

No need for this to make it to the changelog, this announcement was already made.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D24965249

fbshipit-source-id: e537e62e8eb18878c29afe17b8c7861d095a37b7
2020-11-16 12:43:14 -08:00
Paige Sun 0937f13cc3 Do not log image if it fails lifecycle assert in getWillRequestUrlTime
Reviewed By: sammy-SC

Differential Revision: D24990452

fbshipit-source-id: ce4d5ec9e3cf237c6edbd17368f2dcf3aecbec2b
2020-11-16 12:39:00 -08:00
Marshall Roch f1f7168795 Deploy Flow v0.138.0
Summary: Changelog: [Internal]

Reviewed By: dsainati1

Differential Revision: D24993067

fbshipit-source-id: ef2ffb61269be49afa970283a7ccef0b4475898a
2020-11-16 12:19:01 -08:00
Joshua Gross 752e7ab1f9 Experiment to replace Fabric MountItem lists with concurrent queues (re-land)
Summary:
Currently, queuing any sort of MountItem or getting the list of MountItems requires synchronization. Since these can be queued up at any point from the JS thread, there will, in theory, be constant contention between JS and UI thread.

To see if this is true, I'm creating an experiment instead of just switching over to concurrent structures. After seeing results, we can hopefully make a decision and delete the non-concurrent stuff or improve on it somehow.

The original was unlanded in D24973616 (26787e2260) due to a typo, which has been fixed now. The typo was that in Blocking Mode, we queued up all PreMountItems to the concurrent PreMountItems queue.

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D24974851

fbshipit-source-id: d081c081bbd0de445bb92408f0ec822056b905a5
2020-11-14 12:19:56 -08:00
Andrei Shikov 26787e2260 Back out "Experiment to replace Fabric MountItem lists with concurrent queues"
Summary:
Changelog: [Internal]

Original commit changeset: fcbdeda51f91

Reviewed By: rubennorte

Differential Revision: D24973616

fbshipit-source-id: 4d21211d329c77dba50972a26b1daeccfffad912
2020-11-14 08:59:02 -08:00
Koichi Nagaoka d85d5d2e19 Fix cannot working Modal's onDismiss. (#29882)
Summary:
Fixes: https://github.com/facebook/react-native/issues/29455

Modal's onDismiss is not called on iOS.
This issue occurred the commit bd2b7d6c03 and was fixed the commit 27a3248a3b.
However, the master and stable-0.63 branches do not have this modified commit applied to them.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Modal's onDismiss prop will now be called successfully.

Pull Request resolved: https://github.com/facebook/react-native/pull/29882

Test Plan:
Tested on iOS with this change:

1. Set function Modal's onDismiss prop.
1. Set Modal's visible props is true. (show Modal)
1. Set Modal's visible props is false. (close Modal)
1. The set function in onDismiss is called.

Reviewed By: shergin

Differential Revision: D24648412

Pulled By: hramos

fbshipit-source-id: acf28fef21420117c845d3aed97e47b5dd4e9390
2020-11-13 23:56:09 -08:00
Joshua Gross 47000756fe Add more systrace sections to FabricJSIModuleProvider
Summary:
Adding more Systrace sections to get perf information during critical paths.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D24960195

fbshipit-source-id: 099e9cfac8ac87287e48e9915e6b28fe7a448783
2020-11-13 21:53:37 -08:00
Joshua Gross c609952ddb Add Systrace sections to UIImplementationProvider
Summary:
Add Systrace sections to initialization of non-Fabric UIImplementationProvider. This path is sometimes invoked during startup of Fabric so I'd like to gather more information about its impact.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D24959965

fbshipit-source-id: a8555b8db284d00f97c71ca859cb2020409cb110
2020-11-13 21:53:36 -08:00
Joshua Gross 66e536739e Add additional debug logging for startSurface crashes
Summary:
There are a very, very small number of crashes in production that are hitting this line. I would like to understand what the existing tag ID is (perhaps it's eqal to the ID being set, which would indicate "double-start"). If not, it indicates that fragments are being reused somewhere, or something else odd is going on with lifecycles.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D24953785

fbshipit-source-id: 079c86cdb571749662cca46feeaebdd6cb1281f4
2020-11-13 21:53:36 -08:00
Joshua Gross 23def0f8f0 Experiment to replace Fabric MountItem lists with concurrent queues
Summary:
Currently, queuing any sort of MountItem or getting the list of MountItems requires synchronization. Since these can be queued up at any point from the JS thread, there will, in theory, be constant contention between JS and UI thread.

To see if this is true, I'm creating an experiment instead of just switching over to concurrent structures. After seeing results, we can hopefully make a decision and delete the non-concurrent stuff or improve on it somehow.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D24942110

fbshipit-source-id: fcbdeda51f91f4bd430a20d7484854fb1e94a832
2020-11-13 21:53:36 -08:00
Tim Yung 480dabd665 RN: Remove Android `setTimeout` Warning
Summary:
Many third-party libraries (especially data management and caching ones) make use of long timeouts.

There are currently no plans to change `setTimeout` on Android to support firing when apps are in the background. In the meantime, this warning is not actionable for developers who are using these frameworks. Their workarounds are to 1) deal with the noise in their logs, or 2) suppress the warning.

Changelog:
[General][Removed] - Removed warning on Android for `setTimeout` with delays greater than 1 minute.

Reviewed By: lunaleaps

Differential Revision: D24964958

fbshipit-source-id: 1b40c8ba95d554c29dec74477aa63ea3ef8e4768
2020-11-13 18:07:37 -08:00
Nadiia D 9be3356e02 replace defaultProps usage in functional components
Summary:
Changelog:
[General] [Removed] - Replace defaultProps usage in functional components

Reviewed By: kacieb

Differential Revision: D24907836

fbshipit-source-id: 05c7381b66c7738790eff5fea594791c3ecfa12e
2020-11-13 17:07:11 -08:00
Dulmandakh 2798e7172b remove ReactFragmentActivity (#30331)
Summary:
Remove ReactFragmentActivity class, which was deprecated at least since 0.58.

## Changelog

[Android] [Changed] - remove ReactFragmentActivity class.

Pull Request resolved: https://github.com/facebook/react-native/pull/30331

Reviewed By: makovkastar

Differential Revision: D24914082

Pulled By: fkgozali

fbshipit-source-id: 6833b76552a1fc19680f96501d4b8e2ff03c2c39
2020-11-13 09:55:40 -08:00
Samuel Susla 53862a1b5a Back out "Fabric: Strengthening StubView mutating validation"
Summary:
Changelog: [internal]

Original commit changeset: 8c8a3d8e205c

Reviewed By: ShikaSD

Differential Revision: D24951341

fbshipit-source-id: b6109a45f1537a9edc702eafac1736e801fbedc9
2020-11-13 08:50:52 -08:00
Kevin Gozali 58c80d4f8d Use codegen from source in default iOS template apps
Summary:
Add the `react-native-codegen` source to the `react-native` npm package.
Instead of using `react-native-codegen` from npm, the iOS app template will now build the package from source. Doing so removes the need to carefully time `react-native-codegen` npm releases to oss `react-native` releases, as the codegen and the oss release will be cut at the same time.

Changelog: [Internal] - Removed react-native-codegen dependency from iOS app template

Reviewed By: TheSavior

Differential Revision: D24904655

fbshipit-source-id: a07932bc748e2afb9359de584181bcb9dd0810ea
2020-11-12 22:30:28 -08:00
George Zahariev 6a039d7be3 Remove usage of deprecated @flow weak in Xplat
Summary:
This is the one usage of `flow weak` in Xplat - change it to normal `flow` and add a suppression where an error appears.

Changelog: [Internal]

Reviewed By: Hans-Halverson

Differential Revision: D24878970

fbshipit-source-id: 16e459c261b41e04de1555ed7ef4ecf2f5b3721e
2020-11-12 21:14:06 -08:00
Joshua Gross f1fbfebccb Add ReactRootView perf markers
Summary:
Add three markers for ReactRootView perf logging: onMeasure, attachToReactInstanceManager, and updateLayoutSpecs.

It is suspected that one or all of these have regressed under Fabric in some cases.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D24909635

fbshipit-source-id: 6b6c0cc792c4b2d72f2360d6cffc02ef00e8a88b
2020-11-12 15:54:58 -08:00
Joshua Gross 68126ed470 Skip execution of IntBufferBatchMountItem if surface has stopped
Summary:
Fixes crashes in surface teardown / navigating away from a surface.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D24907216

fbshipit-source-id: 7bd7578c81687c7e64e8f70fecf8446bb333a1ed
2020-11-12 15:54:58 -08:00
Chris Ewald 0bbab028d8 Update yarn.lock (#30361)
Summary:
This yarn.lock file was regenerated by deleting the existing yarn.lock file and rerunning `yarn install`.

The current `yarn.lock` file is fairly out of date and is affecting the CI servers.

More specifically, fsevents@1.2.7, [referenced in yarn.lock here](46be292f67/yarn.lock (L3215)), [fails to compile](https://github.com/fsevents/fsevents/issues/272) on node 12 or later.

This causes the [yarn install step on CI to error](https://app.circleci.com/pipelines/github/facebook/react-native/7065/workflows/de2bebff-33a5-4d2e-bc73-f7f380641452/jobs/176266/parallel-runs/0/steps/0-104).

This PR is being made as 1 step in getting [the RNTester detox tests running again](https://github.com/facebook/react-native/pull/30312).

We can alternatively manually update the `yarn.lock` file with [the minimum needed fsevent changes](https://github.com/facebook/react-native/compare/master...MLH-Fellowship:update-yarn-lock-fsevents?expand=1#diff-51e4f558fae534656963876761c95b83b6ef5da5103c4adef6768219ed76c2deL3215-L3221) if this PR changes too much.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Changed] - Bump fsevents from 1.2.7 to 1.2.13.

Pull Request resolved: https://github.com/facebook/react-native/pull/30361

Test Plan: Verify yarn install step on CI is fixed.

Reviewed By: hramos

Differential Revision: D24910611

Pulled By: cpojer

fbshipit-source-id: 45a2f25a14d368d2f464e489924b1a2befbdf784
2020-11-12 15:29:45 -08:00
Dulmandakh 96ace87791 remove android support library (#30347)
Summary:
This PR removes remains of Android Support Library, now replaced with AndroidX.

## Changelog

[Internal] [Changed] - remove Android Support Library from Buck

Pull Request resolved: https://github.com/facebook/react-native/pull/30347

Test Plan: CI is green

Reviewed By: JoshuaGross

Differential Revision: D24914088

Pulled By: fkgozali

fbshipit-source-id: 0ff18dfd7c684642a5c27308112b6fddc27608a7
2020-11-12 09:14:29 -08:00
Kevin Gozali 1bbcbd55ff Android OSS: fixed unbound variable error for codegen build script
Summary:
If $FBSOURCE_ENV isn't set, this failed with `/root/react-native/packages/react-native-codegen/android/../scripts/oss/build.sh: line 20: FBSOURCE_ENV: unbound variable`.

This commit fixes https://app.circleci.com/pipelines/github/facebook/react-native/7080/workflows/5cf18a1f-e6d2-4648-8217-d42e9a61fef1/jobs/176451

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24912950

fbshipit-source-id: 113e3dd7f78c75fc3adea0b21c9e38910be8c065
2020-11-11 22:39:27 -08:00
Janic Duplessis d5db2cb5d1 Build rn-codegen in a temporary directory (#30292)
Summary:
When running yarn install from the codegen directory it will reinstall all dependencies for the react-native workspace inside the react-native package. In my case this caused issues with metro because it would now have 2 copies of it (node_modules/metro and node_modules/react-native/node_modules/metro).

To avoid this copy the react-native-codegen source in a temporary directory and yarn install from there, then copy the built files back.

## Changelog

[Internal] - Build rn-codegen in a temporary directory

Pull Request resolved: https://github.com/facebook/react-native/pull/30292

Test Plan: Tested the script in an app with codegen enabled. Fresh install with rn-codegen not built, made sure no extra modules are installed under node_modules/react-native/node_modules.

Reviewed By: yungsters

Differential Revision: D24893216

Pulled By: fkgozali

fbshipit-source-id: 2c372b755632ea6f50ad5d4562248612b349a9a6
2020-11-11 19:17:12 -08:00
Valentin Shergin 28cb7a77db Fabric: Stop storing a raw pointer to ImageResponseObserverCoordinator in RCTImageComponentView
Summary:
Before this change, RCTImageComponentView on every state update extracted the raw pointer to ImageResponseObserverCoordinator and stored this as an instance variable. This worked fine but the code relied on an assumption that `oldState` argument of `updateState:oldState` is always valid (because the `oldState` is what retained that pointer).
Now, because of some issue, seems that `oldState` value is not always correct, so to work around this problem and to make the code more robust, this diff implements a slightly different approach.
Now we don't store the raw pointer to ImageResponseObserverCoordinator as an instance variable; instead, we store a retaining pointer to a state object and retrieve the pointer to an ImageResponseObserverCoordinator on demand. The diff also introduces a new function `_setStateAndResubscribeImageResponseObserver` that incapsulates updating `_state` object, unsubscribing from the previous coordinator, and subscribing for a new one.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D24880820

fbshipit-source-id: 1c4d8ea91ae07dd217447e43cd3dde7b6f02dc40
2020-11-11 16:44:09 -08:00
Valentin Shergin eb6fefa508 Back out "Use ConcreteStateTeller in RCTImageComponentView"
Summary: We don't need ConcreteStateTeller in <Image> component because we don't even update the state from the component. I will change the logic around the state in the next diff, so we have to remove ConcreteStateTeller first.

Reviewed By: sammy-SC

Differential Revision: D24880822

fbshipit-source-id: bc993bc04ef9f6df79bcbc51941ad6bf64baae58
2020-11-11 16:44:09 -08:00
ajpaulingalls 0e9296b95d Update the cached dimensions when orientation changes (#30324)
Summary:
Currently the dimensions are created once, and then cached.  This change will reload the dimensions when the device orientation changes to insure that dimension update events follow orientation changed events.

this should help address the following issues, that I know of:
https://github.com/facebook/react-native/issues/29105
https://github.com/facebook/react-native/issues/29451
https://github.com/facebook/react-native/issues/29323

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Dimension update events are now properly sent following orientation change

Pull Request resolved: https://github.com/facebook/react-native/pull/30324

Test Plan: Open up RNTester app.  Select the Dimensions API list item.  Rotate the device and verify that the dimensions are correct based on orientation.

Reviewed By: fkgozali

Differential Revision: D24874733

Pulled By: ejanzer

fbshipit-source-id: 867681ecb009d368a2ae7b67d94d6355e67dea7b
2020-11-11 11:03:19 -08:00
Valentin Shergin 97a4598bab Fabric: Strengthening StubView mutating validation
Summary:
This diff adds more enforcement for consistency of `ShadowNodeMutation`s, including:
* `Props` object for newly created or updated view must not be nullptr;
* `oldShadowView` must describe the previous state of the view for `Update` instruction;
* `ignoreDuplicateCreates` option was removed.

I suspect some of the crashes we see in Fabric are caused by a violation of one of these constraints. If one of these fails in debug builds, we will get an early signal.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D24880821

fbshipit-source-id: 8c8a3d8e205ce34f6e0335e8a2b0cf676930c284
2020-11-11 10:56:27 -08:00
Samuel Susla 3a0927ce43 Fix memory leak in ScrollViewStickyHeader
Summary:
Changelog: [internal]

`addListener` call needs a matching `removeListener` call. Otherwise a memory leak is introduced to the app.
This memory leak can retain a UIImage on iOS in Fabric and cause OOM.

Reviewed By: JoshuaGross

Differential Revision: D24860489

fbshipit-source-id: 2625e4bfec416d59e048d9b5ada3813019dd107c
2020-11-11 01:59:38 -08:00