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

698 Коммитов

Автор SHA1 Сообщение Дата
Rubén Norte c628d07044 Remove unused buildStyleInterpolator module from react-native
Summary: Changelog: [internal] Removed unused internal buildStyleInterpolator module

Reviewed By: christophpurrer

Differential Revision: D43116880

fbshipit-source-id: e9f89ad99ecb3e22b9c7516c7a2610f9dd05f984
2023-02-09 06:29:14 -08:00
Rubén Norte 86fba5375a Remove unused deprecatedPropType module from react-native
Summary: Changelog: [internal] Removed unused internal deprecatedPropType module

Reviewed By: christophpurrer

Differential Revision: D43116885

fbshipit-source-id: 6833f104e8b2d818a04dd957d1a219776355606e
2023-02-09 06:29:14 -08:00
Rubén Norte 7c1b6759c2 Remove unused mergeIntoFast module from react-native
Summary: Changelog: [internal] Removed unused internal mergeIntoFast module

Reviewed By: filhoweuler

Differential Revision: D43116879

fbshipit-source-id: 16dca709deb1fca714d95535658e1e7700764781
2023-02-09 06:29:14 -08:00
Rubén Norte 8cab3b0fbd Remove unused truncate module from react-native
Summary: Changelog: [internal] Removed unused internal truncate module

Reviewed By: waddah-fb

Differential Revision: D43116881

fbshipit-source-id: 36ba4bbbea4c07dd14e4922a5aa53cba95927b9e
2023-02-09 06:29:14 -08:00
Rubén Norte 69e23658e1 Remove unused groupByEveryN module from react-native
Summary: Changelog: [internal] Removed unused internal groupByEveryN module

Reviewed By: sammy-SC

Differential Revision: D43116883

fbshipit-source-id: 4d2e3240ab11cfc67ae4e08b9dbf4c1ca1e2f388
2023-02-09 06:29:14 -08:00
Rubén Norte 38542aeebe Remove unused MatrixMath module from react-native
Summary: Changelog: [internal] Removed unused internal MatrixMath module

Reviewed By: sammy-SC

Differential Revision: D43116884

fbshipit-source-id: 6b7ae02e4f465730e7ae8d6092e6bd8304f8f7d6
2023-02-09 06:29:14 -08:00
Nick Gerleman 6d1667cf86 Back out "Add Appearance.setColorScheme support"
Summary:
See https://github.com/facebook/react-native/pull/35989#discussion_r1101016329

Changelog:
[General][Fixed] - Back out "Add Appearance.setColorScheme support"

Reviewed By: jacdebug

Differential Revision: D43148056

fbshipit-source-id: 823ab8276207f243b788ce7757839a3e95bdbe07
2023-02-09 00:54:42 -08:00
Birkir Gudjonsson 0a4dcb0309 Add Appearance.setColorScheme support (#35989)
Summary:
Both Android and iOS allow you to set application specific user interface style, which is useful for applications that support both light and dark mode.

With the newly added `Appearance.setColorScheme`, you can natively manage the application's user interface style rather than keeping that preference in JavaScript. The benefit is that native dialogs like alert, keyboard, action sheets and more will also be affected by this change.

Implemented using Android X [AppCompatDelegate.setDefaultNightMode](https://developer.android.com/reference/androidx/appcompat/app/AppCompatDelegate#setDefaultNightMode(int)) and iOS 13+ [overrideUserInterfaceStyle](https://developer.apple.com/documentation/uikit/uiview/3238086-overrideuserinterfacestyle?language=objc)

## Changelog

[GENERAL] [ADDED] - Added `setColorScheme` to `Appearance` module

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

Test Plan:
This is a void function so testing is rather limited.

```tsx
// Lets assume a given device is set to **dark** mode.

Appearance.getColorScheme(); // `dark`

// Set the app's user interface to `light`
Appearance.setColorScheme('light');

Appearance.getColorScheme(); // `light`

// Set the app's user interface to `unspecified`
Appearance.setColorScheme(null);

Appearance.getColorScheme() // `dark`
 ```

Reviewed By: NickGerleman

Differential Revision: D42801094

Pulled By: jacdebug

fbshipit-source-id: ede810fe9ee98f313fd3fbbb16b60c84ef8c7204
2023-02-07 06:23:39 -08:00
Nick Gerleman 0daf83ac51 Reconnect VirtualizedList Source History 2/2 (Apply D41745930 + history, D42805202, D43063551)
Summary:
This change re-applies D41745930 (2e3dbe9c2f) (and D42805202 (1479b2ac26) which was also partially reverted), re-registers additions as moves, then applies D43063551 which has been added to the changes since migration.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D43068114

fbshipit-source-id: 72997700bf9962d82a988599481e255b69e68a9b
2023-02-06 20:00:19 -08:00
Nick Gerleman ebaa00e327 Reconnect VirtualizedList Source History 1/2 (Revert D41745930)
Summary:
This change reverts D41745930 (2e3dbe9c2f) as part of a stack to splice back source history which was lost (Git registered the file moves as additions).

It is expected this diff will individually fail. The entire stack should be applied at once.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D43068113

fbshipit-source-id: c8398629fe5dcc1ca4bf02f550adc00c78a8487a
2023-02-06 20:00:19 -08:00
Gabriel Donadel Dall'Agnol 2e3dbe9c2f feat: Move virtualized lists to @react-native/virtualized-lists (#35406)
Summary:
This PR moves `VirtualizedList`, `VirtualizedSectionList`, and its files to a separate package called `react-native/virtualized-lists` located under `packages/virtualized-lists` as proposed on https://github.com/facebook/react-native/issues/35263

## Changelog

[General] [Changed] - Move virtualized lists to react-native/virtualized-lists package

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

Test Plan:
1. Open the RNTester app and navigate to `FlatList` or `SectionList` page
2. Test virtualized lists through the many sections

https://user-images.githubusercontent.com/11707729/202878843-2b1322f5-cfee-484e-aaf3-d8d4dc0b96cc.mov

Reviewed By: cipolleschi

Differential Revision: D41745930

Pulled By: hoxyq

fbshipit-source-id: d3d33896801fd69448c6893b86fd5c2363144fd0
2023-02-06 13:39:13 -08:00
Arushi Kesarwani 208f559505 Getting rid of Toast in Dev Loading View post Native Module is released (#35888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35888

Changelog:
[Android][Removed] - For supporting Dev Loading View across multiple platforms, changed the Loading View of Android to rely on the native implementation instead of Toast. Getting rid of the JS changes relying on Toast for Dev Loading View now that the native module is released.

Reviewed By: rshest

Differential Revision: D42599220

fbshipit-source-id: ec7098b508c766c07384d48d3bffed075b092b72
2023-01-19 21:15:03 -08:00
Arushi Kesarwani 9f6b532bdb Changing the Loading View of Android to rely on the native implementation instead of Toast (#35773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35773

Changelog:
[Android][Added] - For supporting Dev Loading View across multiple platforms, changing the Loading View of Android to rely on the native implementation instead of Toast while keeping backwards comptability.

Reviewed By: rshest

Differential Revision: D42286466

fbshipit-source-id: 38749cdbc11208b81a6199467bac00cbc1850c92
2023-01-04 15:01:20 -08:00
Luna Wei 0365f72be5 ESM PixelRatio
Summary: Changelog: [General][Changed] - Convert PixelRatio to ESM and remove old .flow declaration

Reviewed By: yungsters

Differential Revision: D42197759

fbshipit-source-id: b98a8ac2a83280e0848833bceb3350cd4a91d619
2023-01-03 18:09:06 -08:00
Luna Wei c52ed258bf ESM Dimensions
Summary: Changelog: [General][Changed] - Convert Dimensions to ESM

Reviewed By: yungsters

Differential Revision: D42184285

fbshipit-source-id: 49971043f947367aded5fabc45778d5457a35b35
2023-01-03 18:09:06 -08:00
Alex Hunt 28a06d2fd1 Add additional help guidance on HMRClient close event
Summary:
Resolves [comment on #35514](https://github.com/facebook/react-native/issues/35514#issuecomment-1359140208).

Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D42166587

fbshipit-source-id: bb9a28874727e7df45a73d86a876b3d6febe70da
2023-01-03 07:30:47 -08:00
Arushi Kesarwani 8ccb861231 Reverting LoadingView change of native implementation of DevLoadingView (#35744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35744

Changelog:
[Android][Fixed] - LoadingView of Android to use the Toast till the native implementation is functional

Reviewed By: lunaleaps

Differential Revision: D42284732

fbshipit-source-id: dc187e4602240f270b2fbfb40e47604e3a14415d
2022-12-29 17:45:46 -08:00
Arushi Kesarwani 068a20842d Adding native implementation for Dev Loading View for Android (#35743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35743

Changelog:
[Android][Added] - For supporting Dev Loading View across multiple platforms, altering the javascript implementation of Loading view of android to also rely on native implementation as iOS instead of Toast, thereby unifying both platforms

Reviewed By: rshest

Differential Revision: D42258041

fbshipit-source-id: 1be56c1e5696b1024ba09a0aa11da96e0a08f210
2022-12-29 15:06:13 -08:00
Nick Gerleman 8d6e2f86f5 Add missing types for AppRegistry
Summary:
These are all documented on the website and seem to likely work in OSS to at least some extent. Add the missing types corresponding to functions exported from AppRegistry.

Changelog:
[General][Fixed] - Add missing types for AppRegistry

Reviewed By: GijsWeterings

Differential Revision: D42036018

fbshipit-source-id: 0728d6c5602a50e50f1eaf7f76c54ab47dcb0124
2022-12-15 10:22:43 -08:00
Sam Zhou ccefad049a Enable LTI in react-native
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D41788271

fbshipit-source-id: 8e40dc3279ee0283b2845b9559a80862fdf59a17
2022-12-06 19:34:14 -08:00
Sam Zhou 17f221c852 Add annotations to xplat to prepare for LTI
Summary: Changelog: [Internal]

Reviewed By: mvitousek

Differential Revision: D41739285

fbshipit-source-id: 79db8afaad87a2fbba8f6d30d8468a5997c8509d
2022-12-05 14:58:24 -08:00
Blake Friedman 9c75871a81 Fix abnormal close JS exception
Summary:
D40660765 (3982a2c6bd) introduced extra logging for abnormal closes. The websocked 'close' event may not be called with the event argument.

Changelog: [Internal] - Fix for undefined websocket close

Reviewed By: jacdebug, cortinico

Differential Revision: D41731339

fbshipit-source-id: 92b28dcc0d55d0e9e32b4f4321f325fb3471edcd
2022-12-05 06:26:09 -08:00
Tim Yung bf6ed07c0f RN: Delete `setAndForwardRefs`
Summary:
Deletes `setAndForwardRefs` because it encourages a subtle pitfall with managing the referential equality of `ref` entities.

By the time this commit is landed, there will have been no more call sites to it in the `facebook/react-native` repository.

Changelog:
[Internal]

Reviewed By: sammy-SC

Differential Revision: D41209331

fbshipit-source-id: 3ef9c3543b581a716a1e41e524957867ee811675
2022-11-14 08:50:22 -08:00
Mike Vitousek 2c7e89d17c Fix haste module reference
Summary:
Fix a haste module reference inserted by D41226960 (ed02d4baf0)

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D41231733

fbshipit-source-id: e3bcdc220946b7dd1783aa321c024972b3bc8e17
2022-11-11 14:14:21 -08:00
Mike Vitousek ed02d4baf0 Annotate implicit instantiations in xplat, defaulting to any
Summary:
Add explicit annotations to underconstrained implicit instantiations as required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predictable.

This diff adds `any` or `$FlowFixMe` in cases where more precise types could not be determined.

Details:
- Codemod script: `.facebook/flowd codemod annotate-implicit-instantiations ../../xplat/js --default-any --write`
- Local Type Inference announcement: [post](https://fb.workplace.com/groups/flowlang/posts/788206301785035)
- Support group: [Flow Support](https://fb.workplace.com/groups/flow)

drop-conflicts
bypass-lint

Reviewed By: SamChou19815

Differential Revision: D41226960

fbshipit-source-id: e5e3edbb1aed849f90cc683a4d416a9a2f8f3a19
2022-11-11 12:54:51 -08:00
Pieter De Baets 8a59153bd7 Remove $TEMPORARY$object types
Summary:
This was left over from an old codemod.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D41154548

fbshipit-source-id: 0b5fb3e78491b66ebaf13555f80e0265a25dc7d8
2022-11-10 04:48:13 -08:00
William Sawyer 74cb441e97 Corrected documentation to be more gramatically correct (#35141)
Summary:
The documentation for `useColorScheme()` suggested that the user's preferred color scheme will be 'Dark Mode'. Instead suggesting 'Dark Mode' as an example of what the user's preferred color scheme could be is more correct.

## Changelog
[INTERNAL] [FIXED] - Edited documentation for `useColorScheme()` hook
Edited
```javascript
/**
 * A new useColorScheme hook is provided as the preferred way of accessing
 * the user's preferred color scheme (aka Dark Mode).
 */
export function useColorScheme(): ColorSchemeName;
```
to
```javascript
/**
 * A new useColorScheme hook is provided as the preferred way of accessing
 * the user's preferred color scheme (e.g. Dark Mode).
 */
export function useColorScheme(): ColorSchemeName;
```

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

Test Plan: Documentation only - no testing required.

Reviewed By: cipolleschi

Differential Revision: D40934781

Pulled By: rshest

fbshipit-source-id: acac8947c3f99016839be27f505066e8992a20fa
2022-11-02 05:37:43 -07:00
Gabriel Donadel Dall'Agnol e3e635ef84 feat: Add "option" to available role values (#35137)
Summary:
As pointed out by efoken on https://github.com/facebook/react-native/issues/34424#issuecomment-1283854395 we forgot we add the `option` value to the `role` prop, so this PR adds this missing value as requested on https://github.com/facebook/react-native/issues/34424.

## Changelog

[General] [Added] - Add "option" to available role values

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

Test Plan: Ensure that CI is green as there isn't much to test in this case because we're just adding a value that maps to `undefined`

Reviewed By: jacdebug

Differential Revision: D40849497

Pulled By: NickGerleman

fbshipit-source-id: 5e3e24c0ff05c361a7a8dc1ee1f20ba3fb6988ca
2022-10-31 04:47:35 -07:00
George Zahariev 662115077a Fix some issues exposed when making function statics sealed
Reviewed By: SamChou19815

Differential Revision: D40736389

fbshipit-source-id: a3e1c3f5723081bf76e2dbdb637b4deb7a54e180
2022-10-28 17:40:26 -07:00
Nick Gerleman 3982a2c6bd Log Abnormal Closes to Metro Websocket
Summary:
We are running into a group seeing frequent disconnects from Metro in a specific office. These are surfaced (at least on iOS) as websocket closures, without a prior websocket error. WebSocket closure can be for a variety of reasons, and the spec for a CloseEvent is to include fields `wasClean`, `code`, and `reason`, with `code` having the most well-defined meaning.

This change makes it so that we emit extra context when the websocket is closed. That should help inform developers the reason behind any close that may be abnormal.

Changelog:
[General][Added] - Log Abnormal Closes to Metro Websocket

Reviewed By: motiz88

Differential Revision: D40660765

fbshipit-source-id: ef606d8d809af1c697a78eb00cc5666c29a8bca3
2022-10-26 20:09:32 -07:00
Gabriel Donadel Dall'Agnol 20718e6b8c feat: Add role prop to Text component (#34976)
Summary:
As pointed out by necolas on https://github.com/facebook/react-native/issues/34424#issuecomment-1261482517 we forgot we add the `role` prop mapping to the `Text` component. This PR adds a new `role` prop to `Text`, mapping the web `role` values to the already existing `accessibilityRole` prop and moves the `roleToAccessibilityRoleMapping` to a common file that can be imported by both the `Text` and `View` components as requested on https://github.com/facebook/react-native/issues/34424. This PR also updates the RNTester AcessebilityExample to include a test using this new prop.

## Changelog

[General] [Added] - Add role prop to Text component

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

Test Plan:
1. Open the RNTester app and navigate to the Accessibility Example page
2. Test the `role` prop through the `Text with role = heading` section

Reviewed By: yungsters

Differential Revision: D40596039

Pulled By: jacdebug

fbshipit-source-id: f72f02e8bd32169423ea517ad18b598b52257b17
2022-10-24 08:38:47 -07:00
Sam Zhou 466ba91657 Implicit instantiation codemod
Summary: Changelog: [Internal]

Reviewed By: bradzacher

Differential Revision: D40543059

fbshipit-source-id: 4d10671d8f2734b47d2aa86646be7f543a174515
2022-10-20 19:06:09 -07:00
Jordan Brown 7884f6cfec Implicit instantiation codemod
Summary:
This diff adds explicit type arguments to polymorphic function calls that do not constrain their types. This codemod will reduce the error burden that will come in a future version of flow.

This specific diff was generated by running:
```
flow codemod annotate-implicit-instantiations --write .
flow --json --pretty | jq '.errors | .[] | .message | .[] | .loc |.source' | sort | uniq | sed -e 's/"//g' | xargs hg revert
hg st -n | xargs grep "generated" | sed -e 's/:.*//g' | xargs hg revert
arc f
```

So these are the codemod results that introduced no new errors and no generated files.

Changelog: [Internal]

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D40413074

fbshipit-source-id: 42b52719978f1098169662b503dbcfd8cefdad53
2022-10-19 10:25:09 -07:00
Sam Zhou a0ee6fae5e Annotate empty arrays in xplat
Summary: Changelog: [Internal]

Differential Revision: D40410427

fbshipit-source-id: f819fcb00673e19b21aecb383541850436805a0e
2022-10-17 12:40:57 -07:00
Jordan Brown b7f07473df Improve the type of Platform.select for Android
Summary:
There's no need for the 3 type arguments here. Flow will infer a union already if multiple properties are provided. Worse, by not providing these properties these tvars end up with no bounds, which can cause downstream constraints to stall. All of the suppresisons added here are for legitimate errors that were uncovered by consolidating to one type argument.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D40355811

fbshipit-source-id: 088fd087017a6082c793ef00c8810a81b39fb9fb
2022-10-14 11:13:38 -07:00
Jordan Brown b60b70f7ce Improve typings for Platform.select on iOS
Summary:
There's no need for the 3 type arguments here. Flow will infer a union already if multiple properties are provided. Worse, by not providing these properties these tvars end up with no bounds, which can cause downstream constraints to stall. All of the suppresisons added here are for legitimate errors that were uncovered by consolidating to one type argument.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D40355813

fbshipit-source-id: f02a101e5e32f3a2f660a34349e6416b9fde4124
2022-10-14 08:39:26 -07:00
Nick Gerleman 971599317b Ship VirtualizedList_EXPERIMENTAL
Summary:
`VirtualizedList_EXPERIMENTAL` is a fork of VirtualizedList. It was originally created for the purpose of keyboard/a11y fixes, which required the list to allow rendering discontiguous regions of cells. So, the large part of the refactor is in the data structure used to represent state (now a sparse bitmask), and building out the render function to operate off the bitmask.

This structure allows pre-rendering areas where we know focus must be able to be synchronously be moved to. This is exercised on platforms like Windows and macOS which fire view level focus events. The new implementation otherwise aims to preserve near-exact list behavior as previously.

Apart from the structure change, the refactor has made the code (subjectively) a lot easier to reason about, and there are now stronger internal invariants than before. The bitmask structure also enables new approaches for nested list stability, and implementing OffScreen.

**Why ship it now?**

Having two implementations has multiple times prevented other changes to VirtualizedList, so it is incurring a constant engineer cost.

At this point, we have a lot of reason to be confident in the maturity of the new list implementation (see the test plan below). So, reconciling the implementations not only unlocks the enhancements of the new list, but unblocks future changes to VirtualizedList.

## Test Plan

1. **Unit tests:** A few dozen unit tests were added to VirtualizedList, validating the regions it renders in response to injected input, across its API surface. Both VirtualizedList implementations must pass the same tests, around expected behavior.
2. **RNTester:** Scenarios in RNTester were manually validated, and all worked as before
3. **New invariants:** I added a lot of internal logic checks and bounds checks as invariant violations, to try to produce signal if any part of the refactor went unexpected in the wild.
4. **MSFT Rollout:** I rolled out the changes as a fork of VirtualizedList at MSFT to a couple of high-usage surfaces using Android, iOS, and Windows on Paper. Some invariant violations were surfaced and fixed, but telemetry showed solid system and scenario health with the change.
5. **Meta import:** Fixed all land-blocking test failures when using the new list. These were confined to updating snapshots, and adding additional checks for invalid input.
6. **Panel apps:** Manually validated top-level surfaces of panel apps in debug/release modes. Fixed a couple of invariant violations and novel usages. Profiled new JS structures against an expensive list with Hermes profiler.
7. **Facebook App Rollout:** After some manual validation of top-level surfaces, the change was rolled out to Facebook for Android and iOS as an experiment. New invariant violations were fixed, and the change has sat in production for several weeks at this point, while measuring impact to metrics like error rate, responsiveness, and impressions.

This is the first introduction to all of OSS, and some Meta internal apps. This means there may still be novel usages of VirtualizedList that were not picked up during testing, but I think there has been enough diligence to roll out what has been tested, and forward fix anything unexpected that might still come up.

Changelog:
[General][Changed] - Ship VirtualizedList_EXPERIMENTAL

Reviewed By: javache

Differential Revision: D40259791

fbshipit-source-id: 63eee9381d197a1e38ae663b2158436ff135c0e1
2022-10-13 05:04:40 -07:00
Sam Zhou b56d709e6e Annotate `useCallback` in xplat (11/n)
Summary:
Add explicit annotations to useCallback as required for Flow's Local Type Inference project. This codemod prepares the codebase to match Flow's new typechecking algorithm. The new algorithm will make Flow more reliable and predictable.

Codemod command: `flow codemod annotate-use-callback`

drop-conflicts
bypass-lint

Changelog: [Internal]

Reviewed By: evanyeung

Differential Revision: D40079418

fbshipit-source-id: 59750a5d07b2ac1f440927794a7523682f048a5e
2022-10-04 18:51:59 -07:00
Tim Yung 494c47360f RN: Sort Imports via ESLint
Summary:
Applies the autofix from the newly introduced `lint/sort-imports` ESLint rule.

Changelog:
[Internal]

Reviewed By: cortinico, skinsshark

Differential Revision: D39907798

fbshipit-source-id: 17f5f11b08a5b4bb66286816b78eb26e07e829b8
2022-09-30 14:28:48 -07:00
Evan Yeung 8a7f7af753 Deploy 0.188.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D39919034

fbshipit-source-id: a8329aab9bf8f8da93a1c8d414518705048f0d8f
2022-09-29 14:31:12 -07:00
Luna Wei 628db1fcd3 PixelRatio
Summary: Changelog: [Internal] Flow typing PixelRatio

Reviewed By: yungsters

Differential Revision: D39588444

fbshipit-source-id: c1c358799e8012398b0b66f46bb58964a5d6c77f
2022-09-28 11:47:44 -07:00
Tim Yung 7c08d07115 RN: Change Internal Imports to Relative Paths
Summary:
Fixes all internal import statements directly referencing the `react-native` package to instead use relative paths.

Changelog:
[Internal]

Reviewed By: christophpurrer

Differential Revision: D39831223

fbshipit-source-id: 510123e5fc8f6845f96d1b55c67e0e59cb401beb
2022-09-27 09:22:58 -07:00
Nick Gerleman 8cdc9e7f04 Place TypeScript Declarations Alongside Source Files
Summary:
React Native's TS definitions are currently mostly stored in one monolithic file. This change splits the definitions up to correspond to the source files they came from, and are placed next to the source files. I think this should help inform, and make it easy to update the TS declarations when touching the Flow file.

I noticed as part of the change that the typings have not yet removed many APIs that were removed from RN. This is bad, since it means using the removed/non-functional API doesn't cause typechecker errors. Locating typings next to source should prevent that from being able to happen.

The organization here means individual TS declarations can declare what will be in the RN entrypoint, which is a little confusing. Seems like a good potential next refactor, beyond the literal translation I did.

Changelog:
[General][Changed] - Place TS Declarations Alongside Source Files

Reviewed By: lunaleaps, rshest

Differential Revision: D39796598

fbshipit-source-id: b36366466fd1976bdd2d4c8f7a4104a33c457a07
2022-09-26 12:09:45 -07:00
Rujin Cao b2ac528156 @emails -> @oncall (remaining ones)
Differential Revision: D39536169

fbshipit-source-id: 6c8d6787328eefecd23f3498b14a6d9ff750a670
2022-09-15 15:54:10 -07:00
Marshall Roch a8ece43a50 upgrade to flow 0.187.0
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D39542847

fbshipit-source-id: 2eeb8740dd0a142b7e411fbee4765a8f38685c76
2022-09-15 12:24:13 -07:00
Rubén Norte 4d04b1d4c8 Remove last direct references to utilities in Paper from react-native
Summary:
Changelog: [internal]

This replaces all direct references to the `ReactNative` module (which is the Paper renderer) to `RendererProxy` which would select between Paper and Fabric correctly.

The implementation of these functions is exactly the same right now.

As per the removal of the fix for T55744311 in `ScrollView`, I verified this doesn't cause any issues in the screen where it failed before.

Reviewed By: javache

Differential Revision: D39270691

fbshipit-source-id: 03882748fe4b754b9a2c5e9d4c4f003b94ed49ef
2022-09-08 11:12:06 -07:00
Rubén Norte 34e7d48472 Remove unused JSDevSupport module
Summary:
The `JSDevSupport` module is incompatible with Fabric. Given it's not used internally and it's undocumented in OSS, we decided to remove it altogether.

Changelog: [Internal]

Reviewed By: javache, nlutsenko

Differential Revision: D39305892

fbshipit-source-id: 82455701a0b9ba83e6f971fc774280dceb2b22e0
2022-09-07 12:20:58 -07:00
Pieter Vanderwerff 3db19b464d Deploy 0.186.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D39185318

fbshipit-source-id: ca154a5c43eef3e30d5eab382947eedf30e9e850
2022-08-31 16:05:55 -07:00
Pieter Vanderwerff ee3d3c248d Add missing class annotations xplat/js
Reviewed By: SamChou19815

Differential Revision: D38373443

fbshipit-source-id: 1222c4845ebd6b72bd6f54af1a27cf8542dd883a
2022-08-03 12:43:58 -07:00
Vitalii T 14c207d9e1 Refactor: Minor performance improvement of BackHandler.removeEventListener (#34281)
Summary:
I've noticed that `BackHandler.removeEventListener()` performs two same `indexOf()` calls on an array that is not changing. By removing extra `indexOf` we can slightly improve time complexity of `BackHandler.removeEventListener()` from O(2n) to O(n)

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Android] [Fixed] - Remove extra indexOf call in BackHandler.removeEventListener

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

Test Plan:
1. Add the following code to any function component
```javascript
  BackHandler.addEventListener('hardwareBackPress', () => true).remove();
```

2. Press on hardware back button

Expected result: Application closes

Reviewed By: dmitryrykun

Differential Revision: D38198510

Pulled By: javache

fbshipit-source-id: eab6a57689a536623138a4b3ebddbf9ba87d281f
2022-07-27 06:57:21 -07:00