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

26248 Коммитов

Автор SHA1 Сообщение Дата
fabriziobertoglio1987 55c0df43b9 Adding pager, scrollview, viewgroup, webview, drawer roles (#34477)
Summary:
- adds missing roles
- adds custom roles that don't exist in TalkBack (see the [compositor.json][10] and [string.xml][11] files).
- fixes [issues with Drawer][12]
- fixes issues with ScrollView missing roles
- seek control already exist as adjustable d460d097ac

Relevant https://github.com/facebook/react-native/issues/30839#issuecomment-1222293556
fixes https://github.com/facebook/react-native/issues/30839

## Changelog

[Android] [Fixed]  - Adding pager, scrollview, viewgroup, webview, drawer roles

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

Test Plan:
Android
- Drawer Layout and ScrollView (02/09/22) https://github.com/facebook/react-native/pull/34477#issuecomment-1235293165
- sliding drawer, drawer layout, icon menu https://github.com/facebook/react-native/pull/34477#issuecomment-1224112650
- Horizontal and Vertical ScrollView https://github.com/facebook/react-native/pull/34477#issuecomment-1225478289
- Toast https://github.com/facebook/react-native/pull/34477#issuecomment-1225369629
- CheckedTextView https://github.com/facebook/react-native/pull/34477#discussion_r959329833
- Spinner (dropdownlist) https://github.com/facebook/react-native/pull/34477#discussion_r959374894
- EditText https://github.com/facebook/react-native/pull/34477#discussion_r959412185
- WebView https://github.com/facebook/react-native/pull/34477#discussion_r959417518
- Testing chime_up and chime_down sound feedback in Scrollable https://github.com/facebook/react-native/pull/34477#issuecomment-1238882030

iOS https://github.com/facebook/react-native/pull/34477#issuecomment-1232418595

[10]: 771de7cdbf/compositor/src/main/res/raw/compositor.json (L1082-L1108)
[11]: 771de7cdbf/compositor/src/main/res/values/strings.xml (L223)
[12]: https://github.com/facebook/react-native/pull/34477#issuecomment-1224112650

Reviewed By: NickGerleman

Differential Revision: D39894307

Pulled By: blavalla

fbshipit-source-id: 4a8da78bae485ead0523689631d88d1031a07b74
2022-11-07 23:25:33 -08:00
Ramanpreet Nara 78aabd29ca Align Bridgeless mode's create/reload/destroy with bridge's
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D40778326

fbshipit-source-id: b5dadfdc06f08ef0db0f97af2ec75e079bb77be6
2022-11-07 17:57:44 -08:00
Gabriel Donadel Dall'Agnol b6869be1ac feat: Update TextInput inputMode to map "none" to showSoftInputOnFocus (#35228)
Summary:
This PR updates `inputMode` prop from the `TextInput` component to map the `none` option to `showSoftInputOnFocus={false}`  as suggested by necolas here -> https://github.com/facebook/react-native/pull/34460#issuecomment-1304837271. This change makes the inputMode API behaves a bit more similarly across platforms.

Related to https://github.com/necolas/react-native-web/issues/2421

## Changelog

[General] [Changed] -  Update TextInput inputMode to map "none" to showSoftInputOnFocus

## Test Plan

1. Open the RNTester app and navigate to the TextInput page
2. Test the `TextInput` component through the `Input modes` section

https://user-images.githubusercontent.com/11707729/200218435-6a33b319-e989-4086-aac3-506546982b38.mov

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

Reviewed By: lunaleaps, necolas

Differential Revision: D41081876

Pulled By: jacdebug

fbshipit-source-id: cc634c3723647d8950bf2cfe67be70d0fbd488a6
2022-11-07 17:43:10 -08:00
Arushi Kesarwani 7a327d9673 Refactor accessory show methods for DevLoading
Summary:
Changelog:
    [Internal][Changed] - In order to make Dev Loading View cross platform, refactoring the accessary show methods.

Reviewed By: cortinico

Differential Revision: D41029102

fbshipit-source-id: 475949548fe98217e61d6cf64accbbdc0fb0f1c5
2022-11-07 11:31:55 -08:00
Christoph Purrer 3d9a15da87 Update ReactCommon.podspec | Debug section (#35236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35236

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41078409

fbshipit-source-id: fbd3daf61da29d0b595902e2541563343ba50de1
2022-11-07 10:30:10 -08:00
Christoph Purrer 19d65a2baf Update .podspec license information (#35245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35245

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41084913

fbshipit-source-id: a4ba31a19ffe515aa4e7c5a6e273a8cc4b6bc42d
2022-11-07 09:52:52 -08:00
Robert Balicki 6152763398 Buck, etc. changes that enable persisted, sync settings for DevTools (#35163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35163

# What

This diff contains all the changes from D40333083 (0fac9817df) (aka https://github.com/facebook/react-native/pull/34964), **except** the change to `setUpReactDevTools.js`, which actually uses the new files.

# Why

* We want to ship the Buck, C++, etc. changes before the JavaScript changes that depend on those files.
* Otherwise, apps can fail at startup with the message:
```
`TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +
      'Verify that a module by this name is registered in the native binary.',
```
* Note that this only occurs if you are using a previously-built version of the C++, Obj C, etc. files in RN, but a more recent version of the JavaScript files. If you are building from matching sources, this does not occur.
* After a few days, we can land the JS files.

## Changelog

Changelog
[General][Added] Add, but don't use, DevTools Settings Manager.

Reviewed By: NickGerleman

Differential Revision: D40873390

fbshipit-source-id: c7bac6ae65f85666b8616443db278ebb175b691b
2022-11-07 07:40:21 -08:00
Christoph Purrer 7203187c80 TurboModules: Simplify React-bridging usage (#35212)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35212

A previous change - https://github.com/facebook/react-native/pull/34011 - already fixed basic usage of <react/bridging/.../ imports.
However that change was only tailored towards the usage of: <react/bridging/CallbackWrapper.h>
Any other header besides <react/bridging/CallbackWrapper.h> from <react/bridging/... can't be imported at this time in Xcode ... ... which is bad.

For C++ TurboModules we need to be able to access *any* <react/bridging/...> header via the React-Codegen CocoaPod.
Hence adding bridging now as a sub-spec to the ReactCommon CocoaPod

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41057878

fbshipit-source-id: 83c117bc5252d84dd419cdb72f145f65547d23b2
2022-11-07 07:24:11 -08:00
Dmitry Rykun d62b0b463b Bump dependency versions to 0.72.0 after the branch cut
Summary:
Changelog
[General][Changed] - Bump dependency versions to 0.72.0 after the branch cut.

Reviewed By: cipolleschi

Differential Revision: D41079762

fbshipit-source-id: 83e912c4eaf969c1673ccc5fa854646efa99fa4a
2022-11-07 06:57:35 -08:00
Samuel Susla 78844458dc React Native sync for revisions ab075a2...4bd245e
Summary:
This sync includes the following changes:
- **[4bd245e9e](https://github.com/facebook/react/commit/4bd245e9e )**: Do not unmount layout effects if ancestor Offscreen is hidden ([#25628](https://github.com/facebook/react/pull/25628)) //<Samuel Susla>//
- **[df61e708c](https://github.com/facebook/react/commit/df61e708c )**: Remove check in renderDidSuspendDelayIfPossible ([#25630](https://github.com/facebook/react/pull/25630)) //<Andrew Clark>//
- **[1a08f1478](https://github.com/facebook/react/commit/1a08f1478 )**: [ServerRenderer] Move fizz external runtime implementation to react-dom-bindings ([#25617](https://github.com/facebook/react/pull/25617)) //<mofeiZ>//
- **[1a902623a](https://github.com/facebook/react/commit/1a902623a )**: Unwrap sync resolved thenables without suspending  ([#25615](https://github.com/facebook/react/pull/25615)) //<Andrew Clark>//
- **[4ea063b56](https://github.com/facebook/react/commit/4ea063b56 )**: refactor isHostResourceType to not receive the context from reconciler and not leak types ([#25610](https://github.com/facebook/react/pull/25610)) //<Josh Story>//
- **[8e69bc45a](https://github.com/facebook/react/commit/8e69bc45a )**: Make host context use null as empty and only error in dev ([#25609](https://github.com/facebook/react/pull/25609)) //<Sebastian Markbåge>//
- **[5f7ef8c4c](https://github.com/facebook/react/commit/5f7ef8c4c )**: [Float] handle resource Resource creation inside svg context ([#25599](https://github.com/facebook/react/pull/25599)) //<Josh Story>//
- **[36426e6cb](https://github.com/facebook/react/commit/36426e6cb )**: Allow uncached IO to stablize ([#25561](https://github.com/facebook/react/pull/25561)) //<Andrew Clark>//
- **[6883d7944](https://github.com/facebook/react/commit/6883d7944 )**: [ServerRenderer] Setup for adding data attributes streaming format ([#25567](https://github.com/facebook/react/pull/25567)) //<mofeiZ>//

Changelog:
[General][Changed] - React Native sync for revisions ab075a2...4bd245e

jest_e2e[run_all_tests]

Reviewed By: GijsWeterings

Differential Revision: D41028209

fbshipit-source-id: a67fdcd441ddd50784f7c1ce402eaecdb5e3126d
2022-11-07 06:52:28 -08:00
Thibault Malbranche 38e35df47c chore: fix typo in build.gradle (#35209)
Summary:
## 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] - fixed typo in template build.gradle

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

Reviewed By: cipolleschi

Differential Revision: D41080347

Pulled By: cortinico

fbshipit-source-id: d2e36f232f798a636f98843edbc5651730125fc4
2022-11-07 06:30:33 -08:00
Gabriel Donadel Dall'Agnol 62244d4a1e chore: Extract codegen translateFunctionTypeAnnotation into a common function (#35182)
Summary:
This PR extracts the codegen `translateFunctionTypeAnnotation` Flow and TypeScript functions into a single common function in the `parsers-primitives.js` file that can be used by both parsers as requested on https://github.com/facebook/react-native/issues/34872.

## Changelog

[Internal] [Changed] -  Extract codegen `translateFunctionTypeAnnotation` into a common function in the` parsers-primitives.js` file

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

Test Plan:
Run `yarn jest react-native-codegen` and ensure CI is green

![image](https://user-images.githubusercontent.com/11707729/199625849-e89b647f-63fb-40f8-b643-a59dedb4c59a.png)

Reviewed By: cortinico

Differential Revision: D41030544

Pulled By: rshest

fbshipit-source-id: bc93c21e31ed4e8c3293cafe3d808d9f36cf8ecc
2022-11-07 06:14:38 -08:00
Pieter De Baets 6db3995175 Improve @Nullable annotions in Java TurboModule codegen
Summary:
Noticed these types could be improved based on the tests added in D40979066 (e81c98c842).

Changelog: [Android][Fixed] Corrected Nullable annotations for parameters and return values in TurboModules codegen

Reviewed By: mdvacca, cipolleschi

Differential Revision: D40979940

fbshipit-source-id: cfc352a9e7eb9f59e2cce3d7da110a9a8d32db4b
2022-11-07 05:13:30 -08:00
Pieter De Baets 3e44d207a5 Shared Fabric color implementation across platforms
Summary: Changelog: [Internal] Align C++ implementations of SharedColor

Reviewed By: mdvacca

Differential Revision: D40632527

fbshipit-source-id: 8ebca5157e5898de4311015c92b5a72dca7197d3
2022-11-07 05:04:04 -08:00
Riccardo Cipolleschi 3823703a41 chore: update changelog with exceptional releases (#35238)
Summary:
This PR updates the Changelog with the recent patch releases.

## Changelog

[Internal] - Update the changelog

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

Test Plan: Not needed

Reviewed By: dmytrorykun

Differential Revision: D41079159

Pulled By: cipolleschi

fbshipit-source-id: 3be8f1dafb5d46a67b65ff8ec58dae98ebee9ad0
2022-11-07 04:42:36 -08:00
Christoph Purrer 35b2150adb react-native-codegen: Enable C++ TurboModule generation in OpenSource builds (#35211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35211

This enables the generation of C++ TurboModule specs in addition to existing Java/ObjC ones.

An example is shown in https://github.com/facebook/react-native/pull/35138

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41057630

fbshipit-source-id: 303881a63eb82f0fe8dfe10e533043a6eedb3d11
2022-11-07 04:22:35 -08:00
Christoph Purrer abe76fbb56 Remove tvOS support rememants (#35214)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35214

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D41058649

fbshipit-source-id: 16b1ec537d09e9ee50fe609417f62a146bc0f075
2022-11-07 03:07:05 -08:00
Dmitry Rykun c05e6c47df Remove hermesc build dir for non-Hermes build
Summary: Changelog: [iOS][Fixed] - Remove hermesc build dir for non-Hermes build.

Reviewed By: christophpurrer

Differential Revision: D41052884

fbshipit-source-id: c9e85ca06cef79fa35e81972181558d44ca93d90
2022-11-07 01:06:38 -08:00
Dmitry Rykun 7f60bcceac Fix removing Copy Hermes Framework script phase
Summary: Changelog: [iOS][Fixed] - Remove `Copy Hermes Framework` script phase for non-Hermes build.

Reviewed By: hramos

Differential Revision: D41051076

fbshipit-source-id: b4b92330934e950ec3156f39f3807b90f803c1ba
2022-11-07 01:06:38 -08:00
Michael Anthony Leon f0b7cbe22e Add perftest dev support manager
Summary:
This is the 2nd iteration of D39468561 (4d1a56813c). We first check if the `BridgeDevSupportManager` can be used before we return the `PerfTestDevSupportManager`. This is to avoid a breakage of Quantum that happened on the previous diff.

Add a `DevSupportManager` that can be used for performance testing. This `DevSupportManager` allows the inspector connection to be established, but leaves everything else disabled.

Previously, if Developer Support was enabled on a release build, the application would present an error as it unsuccessfully attempted to use the bridge dev support manager.

This is now conceptually the new flow for deciding what DevSupportManager to choose.

```
if (developerSupportEnabled) {
  if (full support available) {
    use full support (i.e. bridge)
  } else {
    use profiling-only support (i.e. perftest)
  }
} else {
  disable dev support
}
```

The first attempt at this diff erroneously used this logic:

```
if (developerSupportEnabled) {
  if (debug build) {
    use full support (i.e. bridge)
  } else {
    use profiling-only support (i.e. perftest)
  }
} else {
  disable dev support
}
```

So now we are always checking to see if the `BridgeDevSupportManager` is available, and if it is, we use it.

(`enableOnCrease` indicates the development mode setting: https://www.internalfb.com/code/fbsource/[6b8a941fdf2a0fd58d9db36f5a59fa5fb53ad2df]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java?lines=259)

Changelog: [internal]

Reviewed By: makovkastar

Differential Revision: D40948243

fbshipit-source-id: 50c6b6b905f5b9c5b5ecc090b36edbd6090ea774
2022-11-04 14:47:19 -07:00
Mitch Powell 44f3234d1f Clean up xplat/folly/container redirects
Summary:
Cleans up redirects for xplat/folly/container targets including:
```
//xplat/folly/container:bit_iterator
//xplat/folly/container:f14_hash
//xplat/folly/container:evicting_cache_map
//xplat/folly/container:enumerate
//xplat/folly/container:foreach
```

Reviewed By: Gownta

Differential Revision: D40954195

fbshipit-source-id: c14bfa572a9316cb0262a98f183adb457d0797f2
2022-11-04 09:44:51 -07:00
Ruslan Shestopalyuk cf55e4a14e JS side implementation of PerformanceObserver API
Summary:
[Changelog][Internal]

This adds module specs for the native part of PerformanceObserver, as well as the interaction logic vs the NativePerformanceObserver API.

See https://fb.quip.com/MdqgAk1Eb2dV for more detail.

Reviewed By: rubennorte

Differential Revision: D40897006

fbshipit-source-id: 77475f21dad9ee9dbe15df5a989eb08d314e6db2
2022-11-04 08:41:01 -07:00
Ruslan Lesiutin d03a29ce5f refactor(react-native-github): move ImagePickerIOS to internal (#35199)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35199

**Changelog:**
[iOS][Removed] - Removed ImagePickerIOS module native sources
[JS][Removed] - Removed ImagePickerIOS module from react-native

Reviewed By: cortinico

Differential Revision: D40859520

fbshipit-source-id: a6a114a05574d46ea62600999bff95025ba7cdc8
2022-11-04 08:08:54 -07:00
Sam Zhou fc9954ac14 Deploy Flow 0.192.0
Summary: Changelog: [Internal]

Reviewed By: bradzacher

Differential Revision: D41018709

fbshipit-source-id: 9e0e18d55815bd449b20b3a9a3e556cda74731ba
2022-11-04 08:03:05 -07:00
Pranav Yadav 95e685a44d mv `emitMixedTypeAnnotation` fn > `parsers-primitives.js` (#35185)
Summary:
This PR is a task of https://github.com/facebook/react-native/issues/34872

- Moved the [emitMixedTypeAnnotation](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L102) function to the [`parser-primitives.js` file](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-primitives.js).
- Moved tests for the same respectively
- Fixed/Updated imports and exports for the same respectively

## 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
-->

[INTERNAL] [Changed] - Moved the `emitMixedTypeAnnotation` function to the `parser-primitives.js` file.

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

Test Plan:
`yarn test-ci`
![image](https://user-images.githubusercontent.com/55224033/199693475-60c034bf-cd5c-4cb8-bfe8-e7c7ccbc4300.png)

Reviewed By: cipolleschi

Differential Revision: D40993027

Pulled By: rshest

fbshipit-source-id: 5e025804f4ef6723396accf2f859483f76cb6cd6
2022-11-04 05:11:39 -07:00
Abraham Romero 35ebb57afa Back out "Ship modern animated"
Summary:
Changelog:
[General][Removed] - Reverting concurrency-safe `Animated` to investigate some newly identified issues

Reviewed By: sammy-SC

Differential Revision: D41006680

fbshipit-source-id: 37b89911dfa72f5a94f9bb796d49f2b138b3f45b
2022-11-04 03:32:42 -07:00
Lorenzo Sciandra 5cfb88685f fix (deps): add explicitly eslint config to dependencies (#35192)
Summary:
Basically since this change https://github.com/facebook/react-native/pull/34423 everything worked ok because in the main branch where the monorepo has the workspace section and everything, `react-native-community/eslint-config` was getting pulled in as a node_module anyway - but when moving to a stable branch and wanting to do a release, as we are now with 0.71, because of what the final package.json looks like for react-native and [the modifications that it goes through](f0054e1e30 (diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519)) (ex. the `workspace` section disappears), the fact that it's not directly listed as dependency makes [the CI fails](https://app.circleci.com/pipelines/github/facebook/react-native/17124/workflows/54a4162d-f466-4eab-94ba-ec9fe77e2ecf/jobs/339643) with `Error: Failed to load config "react-native-community" to extend from.`

## 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
-->

[General] [Fixed] - add explicitly eslint config to dependencies

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

Test Plan: In 0.71, add the deps to see the error disappear (it gets replaced by a different one though, looking into that)

Reviewed By: jacdebug, cortinico

Differential Revision: D40988407

Pulled By: cipolleschi

fbshipit-source-id: 38f433a0b4b47a7cb61b59e887459d11182a5b4b
2022-11-04 03:31:21 -07:00
Héctor Ramos ad43deca23 Remove unused saveFilesToRestore function
Summary:
The method that would restore these files was removed in https://github.com/facebook/react-native/pull/34846. The action performed by `saveFilesToRestore` is no longer necessary (thanks kelset for pointing this out).

Changelog: [internal]

Reviewed By: cortinico

Differential Revision: D41003911

fbshipit-source-id: bbc057ac450e7f134c4664173291ca56c18f1b17
2022-11-03 23:37:45 -07:00
Mike Vitousek 7211366c48 Pre-suppress errors in xplat ahead of the v0.192 release
Summary:
Adds needed suppressions ahead of the release of Flow 0.192

drop-conflicts

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D41011869

fbshipit-source-id: 3922eb4463006da5b0bec803051136e8351f68fa
2022-11-03 21:40:00 -07:00
Nicola Corti ef75de97b5 Remove project.android block from rn-tester's CLI config (#35197)
Summary:
The project.android block is unnecessary and contains a wrong path. Let's use the default path which is `./android`.

## Changelog

[Internal] - Remove project.android block from rn-tester's CLI config

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

Test Plan: Tested locally + will wait for a CI run

Reviewed By: robhogan

Differential Revision: D41013193

Pulled By: cortinico

fbshipit-source-id: 5c76c9b571b23ad71a23a8f3f05a9acb4d6e20b9
2022-11-03 20:22:23 -07:00
Dmitry Rykun 8183aac0b1 Bump dependency versions before the branch cut 0.71.0
Summary: Changelog: [General][Changed] - Bump dependency versions.

Reviewed By: cipolleschi

Differential Revision: D40991336

fbshipit-source-id: 71c8edbeb274d095403b2f17e60f217d16fe01c0
2022-11-03 17:28:26 -07:00
Pranav Yadav e73b615f14 fix lint warn -> rm unused import `rm` (#35186)
Summary:
- Fixed lint warning -> rm unused import `rm` in `scripts/run-ci-e2e-tests.js` file
- Hence, removed unused import `rm` in `scripts/run-ci-e2e-tests.js` file

## 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
-->

[GENERAL] [FIXED] - Fixed lint warning -> rm unused import `rm` in `scripts/run-ci-e2e-tests.js` file

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

Test Plan:
`yarn test-ci`
![image](https://user-images.githubusercontent.com/55224033/199700838-c8a6d2d6-0634-4e0a-b50d-5ca89957cf38.png)

Reviewed By: sshic

Differential Revision: D40978104

Pulled By: NickGerleman

fbshipit-source-id: 5a99cd33d25015325133aee1442980b218104e86
2022-11-03 16:23:45 -07:00
Pieter De Baets e81c98c842 Fix Cpp codegen handling of optional arguments
Summary:
Changelog:
[General][Fixed] - Codegen for C++ TurboModules of optional method arguments was incorrect

Reviewed By: christophpurrer

Differential Revision: D40979066

fbshipit-source-id: 5bb48dbafc14dcea21b7e0b15e3f4bb527bc8476
2022-11-03 11:20:16 -07:00
Ruslan Shestopalyuk f32a3a5372 Refactor PerformanceObserver public API
Summary:
Changelog: [Internal]

This is a follow-up to D40892974 (a671d61b6d), addressing the post-land comments and discussions.

Reviewed By: rubennorte

Differential Revision: D40979654

fbshipit-source-id: 2e7e1d24be8211cc3363a07678745039e5606d8d
2022-11-03 09:07:14 -07:00
Dmitry Rykun bbd432e999 feat: make RCTBlobManager TurboModule-compatible (#35188)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35188

This diff reverts D40716048 (279cfec55f) (https://github.com/facebook/react-native/pull/35047) which breaks RCTImageLoader.
https://pxl.cl/2jKrM
Those files are auto-generated and are not supposed to be edited manually.
Changelog: [iOS] [Fixed] - https://github.com/facebook/react-native/pull/35047 reverted.

Reviewed By: cipolleschi

Differential Revision: D40979350

fbshipit-source-id: ef92cf05636cba818151d4184e0275a3aab56cff
2022-11-03 08:52:34 -07:00
Nicola Corti c63133202b Correctly set -DCMAKE_BUILD_TYPE for Hermes on iOS
Summary:
We accidentally added `-DCMAKE_BUILD_TYPE=Debug` for Hermes which is causing
a really slow engine execution. This fixes it and keep the -DCMAKE_BUILD_TYPE
aligned with the one used on Android.

Changelog:
[iOS] [Fixed] - Correctly set -DCMAKE_BUILD_TYPE for Hermes on iOS

Reviewed By: hramos, cipolleschi

Differential Revision: D40980934

fbshipit-source-id: 30f0455990a911b51eb109bebca8272507302650
2022-11-03 07:32:16 -07:00
Ruslan Shestopalyuk f8a2dd74e8 Exclude PerformanceObserver from flow/haste
Summary:
[Changelog][Internal]

This is to prevent an accidental use of PerformanceObserver while it's still a work in progress.

PerformanceObserver is also moved into a dedicated folder, `Libraries/WebPerformance`.

Reviewed By: rubennorte

Differential Revision: D40978749

fbshipit-source-id: 09645a95bed72902870ebc00c1b4a3d81ab4c829
2022-11-03 07:14:41 -07:00
Samuel Susla 5e863fc42c Ship modern animated
Summary:
changelog:
[general][Added] - Concurrent rendering safe implementation of Animated

Reviewed By: yungsters

Differential Revision: D40681265

fbshipit-source-id: b3979c69342ebd7f232f7a00f279ef0b082d4182
2022-11-03 06:55:39 -07:00
Yoonseok Ko d9ab5e81cf A bug fix - the undefined behavior of `idleCallbacks`'s `timeRemaining`.
Summary:
## Changelog:

[Android] [Fixed] - Fix a bug that returns a random number from callback argument `timeRemaining` of `idleCallbacks` registered by `requestIdleCallbacks`.

`global.performance.now()` returns a time from an unknown origin, while `frameTime` is epoch time. Thus, `global.performance.now() - frameTime` is just a random number rather than an elapsed time from the frame start time.

As a simple solution, I would suggest to use `Date.now()`.
Its resolution is lower than `frameTime` due to the security issue in JavaScript VM. So, it loses some precision, but, at least, it is not wrong.

Reviewed By: javache

Differential Revision: D40941461

fbshipit-source-id: b0094e181b97a844d133a9268fe48cd8c8fadfda
2022-11-03 05:19:36 -07:00
Sergei Karpukhin 890805db9c Add various annotation types to markEvent ReactNative API
Summary:
Support various annotations types in QuickPerformanceLogger markEvent for Android.

Changelog:
[Internal][Changed] - Added support for various markEvent annotation types

Reviewed By: dmitry-voronkevich

Differential Revision: D40852658

fbshipit-source-id: fc4053555f65958653be30a58742c83040a19df1
2022-11-03 02:44:08 -07:00
Nick Gerleman aaf1990287 Use TypeScript by default for new applications (#35165)
Summary:
This change moves the default new application template in OSS from Flow to TypeScript. This better aligns with the communities usage, and aligns to the great work that has been happening for TS codegen and built-in types. This used [`react-native-community/react-native-template-typescript`](https://github.com/react-native-community/react-native-template-typescript) as a main reference, maintained by radko93. A few things are different:
1. Updated `types/*` devDependencies to match bumped libraries (e.g. Jest 26 to 20).
2. Removed `types/react-native`
3. Removed explicit `moduleFileExtensions` to Jest config in package.json (TS and TSX and added by default in current versions)
4. Removed overrides to eslint config to disable `no-shadow` and `no-undef`, since this was fixed in the underlying eslint config with https://github.com/facebook/react-native/pull/32644 and https://github.com/facebook/react-native/pull/32655
5. Re-translated `App.js` to be a direct translation (e.g. still a raw function instead of React.FC which is sometimes discouraged)
6. Aligns completely to `tsconfig/react-native` maintained configuration (We no longer have the opinionated override of `skipLibCheck`). The important settings are that `strict` is enabled for, but `allowJS` is also enabled to let users import JS modules without anything unexpected. `esModuleInterop` is enabled, which is needed for consistency with Babel import transformations used by Metro. Consistent with our [current documentation](https://reactnative.dev/docs/typescript) built against the community template, `tsc` will typecheck your code without emitting(building) anything.

[Documentation](https://reactnative.dev/docs/typescript) will need to be updated as a followup.

Changelog:
[General][Changed] - Use TypeScript by default for new applications

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

Test Plan: Added usage of `tsc` and `jest` when validating a newly built app. Passes in CircleCI `test_js` job. This also meant removing some cases of copying packages into the users app to pull in the root Metro config (we seem to be able to use the template Metro config consistent with what real apps would get).

Reviewed By: cortinico

Differential Revision: D40911951

Pulled By: NickGerleman

fbshipit-source-id: 15994534235695e91cf994ad06ba2183dfc89a50
2022-11-02 21:40:58 -07:00
Lulu Wu f207cfddf3 Add atomic registerSegment method to test
Summary:
In the top js errors there are 2 mids related to segment fetching:
- requireForFacebook.js:unknownModuleError (https://www.internalfb.com/logview/details/facebook_android_javascripterrors/ba11461526aff8a6842401b35b02f5a4), 11.64 K vs. 524
- asyncRequire.js:verifySegment (https://www.internalfb.com/logview/details/facebook_android_javascripterrors/5452ba893b8d9ba8e97e070cf6976b65) 5.39 K vs. 180

Both errors will result in surface not loading.

A lot of traces have logs similar with the following:

```11-01 19:57:51.166 27735  7626 W fb4a.BridgelessReact: registerSegment(segmentId = "1090", path = "/data/data/com.facebook.katana/app_overtheair/resources/412137089/414433453/hbc-seg-1090__DELIM__main.jsbundle")
11-01 19:57:51.167 27735  7445 I ReactNativeJS: Module 39122 in segment 0 doesn not exist moduleDefiner
11-01 19:57:51.171 27735  7445 E ReactNativeJS: Error: Requiring unknown module "39122"., js build: 414433453
11-01 19:57:51.175 27735  7445 E ReactNativeJS: Error: Segment meta module is not setup properly. Details: segmentId = 1090, metaModule === undefined
11-01 19:57:51.175 27735  7445 E ReactNativeJS:
11-01 19:57:51.175 27735  7445 E ReactNativeJS: This error is located at:
```

RegisterSegment lives through 3 threads while in bridge there are only 2 threads involved (native & JS):
- Native thread, log printed (fb4a.BridgelessReact: registerSegment...)
- Background thread: no log, added in this diff (Finish registerSegment...)
- JS thread: logs not printed, should print logs here:

https://www.internalfb.com/code/fbsource/[60521987354ed1ef9a0d10bafc60db3c25302ab4]/xplat/ReactNative/venice/ReactInstance.cpp?lines=308-330

Since the JS thread logs aren't printed and there are segment errors right after calling registerSegemnt, I think registerSegment is not done. It could be caused by:
- ReactInstance being null, I added logs in background thread to verify (Finish registerSegment...) since dispatching to background thread relies on non-nullable ReactInstance.
- Work on JS thread hasn't been executed when trying to use/verify the segment. I added atomic method ```registerSegmentAtomic``` to make sure JS thread is blocked until segment is fully registered.

```registerSegmentAtomic``` will be tested behind gating added in D40917444.

Changelog:
[Android][Changed] - Add feature flag enableAtomicRegisterSegment

Reviewed By: RSNara

Differential Revision: D40921759

fbshipit-source-id: 84221aa81f0c549f931a4847b154187299639ef4
2022-11-02 21:01:53 -07:00
Héctor Ramos 4f3ca8facf cleanup publish-npm.js: --include-hermes is not used anywhere (#35166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35166

The Hermes source code is not included in the RN npm package. This piece of code is a remnant from an early experimentation into integrating Hermes more tightly with React Native. We ended up using a combination of the scripts in `scripts/hermes` to fetch the source code from GitHub and relying on prebuilts for stable releases.

Added `strict()` flag to ensure the script fails immediately if an unrecognized flag is passed.

Avoid logging temp publishing folder value to console when `--help` is used.

Changelog: [internal]

Reviewed By: cortinico

Differential Revision: D40918939

fbshipit-source-id: 2e62ab16467c4c67f03efdf5211a156cb70e0b11
2022-11-02 20:59:03 -07:00
Ruslan Shestopalyuk a671d61b6d Add JS stub for PerformanceObserver specs
Summary:
This stubs all the type definitions for the [PerformanceObserver web perf APIs](https://www.w3.org/TR/performance-timeline/#the-performanceobserver-interface).

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D40892974

fbshipit-source-id: 31fe972fc069eb62e51bca82e9cd42ca65811753
2022-11-02 19:44:29 -07:00
Shawn Dempsey 714b22bb43 Local filenames with colon should be parsed correctly (#35123)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35123

**Context**

On RN Desktop, images can be copy/pasted into text inputs.
When copy/pasting local files w/ semi-colons in the filename (`/downloads/devices:pre-call-IMG_346C38284B2B-1.jpeg`), RN would throw this error.

{F785684529}

The error was due to no having the correct asset loader due to the local file path being parsed incorrectly.

To parse the url, we convert the string URI to a `NSURL` using a custom convertor fn.
The conversion was matching any `:` and assuming it was a network url scheme:
https://www.internalfb.com/code/archon_react_native_macos/[fde4113acd89fb13ee11636c48b59eac49c21bae]/React/Base/RCTConvert.m?lines=97-111

When an image path with `:` in the name was passed to this, it was assuming it was a valid network url and not file path.

Because this is a local filepath, the image path needs to be a filesystem url. Since this was parsed as network url, it did not have the `file://` prefix and would not pass this check, causing the loader to throw.l
https://www.internalfb.com/code/fbsource/%5B60d9d5e67383%5D/xplat/js/react-native-github/Libraries/Image/RCTImageLoader.mm?lines=220-230

## Changelog

[iOS] [Added] -  Add support for parsing files w/ `:` in filename

Reviewed By: christophpurrer, philIip

Differential Revision: D40729963

fbshipit-source-id: 2f3adcabc8f0f1f22cbfca69c3484e72b1d93d25
2022-11-02 19:00:07 -07:00
Nicola Corti e8d3fb87f1 Bump RNGP to 0.71.8
Summary:
Just bumping RNGP to make the new sources avialable to the template.

Changelog:
[Internal] [Changed] - Bump RNGP to 0.71.8

Reviewed By: robhogan

Differential Revision: D40948246

fbshipit-source-id: c6a193fcdc0675be9ef7f1320d63e884b8b65daa
2022-11-02 18:57:10 -07:00
Nicola Corti 46de03a46a Fix test_buck by not using lambdas inside ReactImagePropertyTest (#35181)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35181

As the title says, this unblocks `test_buck` by removign the lambdas used inside test.

Changelog:
[Internal] [Changed] - Fix test_buck by not using lambdas inside ReactImagePropertyTest

Reviewed By: cipolleschi

Differential Revision: D40958412

fbshipit-source-id: 60b8609a25985230dfd6c4dcdf983dc2a8cfaf64
2022-11-02 16:02:53 -07:00
Nick Gerleman 5d26ceaa23 Fixup TS Organization (#35169)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35169

This reorganizes typing structure a bit.

`Utilities.d.ts` was originally added for utilitiy types but I ended up leaving it a grab bag of types that didn't belong to any individual bit of code. Out of what is in it right now, `Insets` was actually public, and seems to have been imported.

We also run into files around the renderer which are [currently overwritten](e286da25fc/Libraries/Renderer/implementations/ReactNativeRenderer.d.ts) by the React sync script.

Finally, all of the top-level imports of `Utilities` were auto-generated by VS Code, but fail in real apps. I think this is because our tsconfig sets a `baseUrl` to allow resolution from the types folder, so the tooling in the RN repo will use that, but it breaks in real apps that don't have that mapping.

This splits all these up into a couple separate directories that are hopefully easier to reason about, and removes `Omit` which has been a builtin type for quite some time (we were actually already using built-in `Omit`).

Changelog:
[General][Fixed] - Fixup TS Organization

Reviewed By: cipolleschi

Differential Revision: D40932319

fbshipit-source-id: 0b6e3e3eda603885b4dc01dcb9f5233aa546d128
2022-11-02 14:58:37 -07:00
Nicola Corti b5405b2954 Make sure nightly versions are using the -SNAPSHOT artifacts (#35178)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35178

I forgot to add the logic to fetch the -SNAPSHOT version when on nightlies.
This code takes care of it.

Changelog:
[Internal] [Changed] - Make sure nightly versions are using the -SNAPSHOT artifacts

Reviewed By: cipolleschi

Differential Revision: D40939367

fbshipit-source-id: 29d60cf281d30b3dbd05d7ea1c766541a8fab90a
2022-11-02 10:55:23 -07:00
Pieter De Baets b5ea5a2c4d Fix WebSocketModule not closing connections on reload
Summary:
Saw in the logs an ever increasing number of warnings coming from WebSocketModule about requesting an instance that has already gone away.

On module invalidation we should close all outstanding websockets, as they will no longer be able to send events to JS.

Changelog: [Android][Fixed] On instance destroy, websockets are correctly closed

Reviewed By: mdvacca

Differential Revision: D40897255

fbshipit-source-id: 1578de8baa342479d14ee1070c3314d45c7fbd8d
2022-11-02 10:24:56 -07:00