Commit Graph

7253 Commits

Author SHA1 Message Date
Adam Gleitman 8d11cb4b9c Add Dynamic Type support for iOS (Paper and Fabric) (#35017)
Summary:
This adds Dynamic Type support in iOS as described [here](https://github.com/react-native-community/discussions-and-proposals/issues/519).

`Text` elements have a new prop, `dynamicTypeRamp`, that allows users to specify which font ramp a particular `Text` element should take on as the OS's accessibility setting for text size. The different types line up with different values of `UIFontTextStyle`. If not specified, we default to the current behavior.

~~For the moment, this change is only for Paper. I tried applying a corresponding change to Fabric by adding an additional field to [`facebook::react::TextAttributes`](https://github.com/facebook/react-native/blob/main/ReactCommon/react/renderer/attributedstring/TextAttributes.h) and changing [`RCTEffectiveFontSizeMultiplierFromTextAttributes`](https://github.com/facebook/react-native/blob/afb124dcf0cdf0db525acc7cfd2cea2742c64068/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm#L79-L84) to use that new field, but in the process I discovered that this function doesn't seem to ever get called, hence [this bug](https://github.com/facebook/react-native/issues/34990).~~

## Changelog

[iOS] [Added] - Dynamic Type support

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

Test Plan:
Validated with a test page in RNTester. Screenshots follow:

A) Default text size
B) Largest non-accessibility text size
C) Largest accessibility text size, split across two screenshots due to size

| A | B | C |
|-|-|-|
| ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 17 08](https://user-images.githubusercontent.com/717674/196562746-c8bbf53d-3c70-4e55-8600-0cfed8aacf5d.png) | ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 17 55](https://user-images.githubusercontent.com/717674/196563051-68bb0e34-c573-47ed-8c19-58ae45a7ce2b.png) | ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 18 33](https://user-images.githubusercontent.com/717674/196563185-61ede5ee-e79e-4af5-84a7-8f1e230a25f8.png) |
||| ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 18 42](https://user-images.githubusercontent.com/717674/196563208-2242efa2-5f24-466d-80f5-eb57a7678a67.png) |

Reviewed By: sammy-SC

Differential Revision: D40779346

Pulled By: NickGerleman

fbshipit-source-id: efc7a8e9810a93afc82c5def97af15a2e8453d90

# Conflicts:
#	packages/rn-tester/Podfile.lock
2022-11-22 11:27:55 +00:00
Christoph Purrer 08430bf214 react-native code-gen > C++ TurboModules struct support (#35265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35265

This adds a templating layer for C++ TurboModules to automatically generate struct templates from TurboModule specs.

You have to define concrete types for those templates to use them in your C++ TurboModule.

E.g. for the JS flow type:
```
export type ObjectStruct = {|
  a: number,
  b: string,
  c?: ?string,
|};
```
code-gen will now generate the following template code:
```
#pragma mark - NativeCxxModuleExampleCxxBaseObjectStruct

template <typename P0, typename P1, typename P2>
struct NativeCxxModuleExampleCxxBaseObjectStruct {
  P0 a;
  P1 b;
  P2 c;
  bool operator==(const NativeCxxModuleExampleCxxBaseObjectStruct &other) const {
    return a == other.a && b == other.b && c == other.c;
  }
};

template <typename P0, typename P1, typename P2>
struct NativeCxxModuleExampleCxxBaseObjectStructBridging {
  static NativeCxxModuleExampleCxxBaseObjectStruct<P0, P1, P2> fromJs(
      jsi::Runtime &rt,
      const jsi::Object &value,
      const std::shared_ptr<CallInvoker> &jsInvoker) {
    NativeCxxModuleExampleCxxBaseObjectStruct<P0, P1, P2> result{
      bridging::fromJs<P0>(rt, value.getProperty(rt, "a"), jsInvoker),
      bridging::fromJs<P1>(rt, value.getProperty(rt, "b"), jsInvoker),
      bridging::fromJs<P2>(rt, value.getProperty(rt, "c"), jsInvoker)};
    return result;
  }

  static jsi::Object toJs(
      jsi::Runtime &rt,
      const NativeCxxModuleExampleCxxBaseObjectStruct<P0, P1, P2> &value) {
    auto result = facebook::jsi::Object(rt);
    result.setProperty(rt, "a", bridging::toJs(rt, value.a));
    result.setProperty(rt, "b", bridging::toJs(rt, value.b));
    if (value.c) {
      result.setProperty(rt, "c", bridging::toJs(rt, value.c.value()));
    }
    return result;
  }
};
```
and you can use it in our C++ TurboModule for example as:
```
using ObjectStruct = NativeCxxModuleExampleCxxBaseObjectStruct<
    int32_t,
    std::string,
    std::optional<std::string>>;

template <>
struct Bridging<ObjectStruct>
    : NativeCxxModuleExampleCxxBaseObjectStructBridging<
          int32_t,
          std::string,
          std::optional<std::string>> {};
```
or as
```
using ObjectStruct = NativeCxxModuleExampleCxxBaseObjectStruct<
    float,
    folly::StringPiece,
    std::optional<std::string>>;

template <>
struct Bridging<ObjectStruct>
    : NativeCxxModuleExampleCxxBaseObjectStructBridging<
          float,
          folly::StringPiece,
          std::optional<std::string>> {};
```
Or as
...

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D41133761

fbshipit-source-id: fdf36e51073cb46c5234f6121842c79a884899c7
2022-11-22 11:15:24 +00:00
Ruslan Lesiutin adcdb366da 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-22 11:15:16 +00:00
Ruslan Shestopalyuk b310f2b078 Scaffolding for the PerformanceObserver TurboModule (C++ side) (#35226)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35226

Changelog: [Internal]

This adds scaffolding for the C++ side of NativePerformanceObserver module.

Thanks to christophpurrer for helping set this up, as this is the first one of this kind inside core/OSS.

Reviewed By: rubennorte

Differential Revision: D41028555

fbshipit-source-id: 4acf0e71a254a42044cbbe5f94f40938342c6aa2
2022-11-22 11:14:01 +00:00
Ruslan Shestopalyuk ea0cd5b7ca 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-22 11:13:38 +00:00
Ruslan Shestopalyuk d02b51332e Refactor PerformanceObserver public API
Summary:
Changelog: [Internal]

This is a follow-up to D40892974 (https://github.com/facebook/react-native/commit/a671d61b6de5f106e9fd803a73fddb4b6fa6656b), addressing the post-land comments and discussions.

Reviewed By: rubennorte

Differential Revision: D40979654

fbshipit-source-id: 2e7e1d24be8211cc3363a07678745039e5606d8d
2022-11-22 11:13:25 +00:00
Ruslan Shestopalyuk 8c488d8757 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-22 11:13:19 +00:00
Distiller 60129ab7ac [0.71.0-rc.0] Bump version numbers 2022-11-04 15:25:07 +00:00
Lorenzo Sciandra 94b1165a44 Revert "[0.71.0-rc.0] Bump version numbers"
This reverts commit 27c32b2d71.
2022-11-04 15:14:34 +00:00
Distiller 27c32b2d71 [0.71.0-rc.0] Bump version numbers 2022-11-04 14:31:20 +00:00
Lorenzo Sciandra 4d0be144bf Revert "[0.71.0-rc.0] Bump version numbers"
This reverts commit ea9dd430a6.
2022-11-04 14:26:17 +00:00
Distiller ea9dd430a6 [0.71.0-rc.0] Bump version numbers 2022-11-04 12:33:34 +00:00
Lorenzo Sciandra c4a7e46976 Revert "[0.71.0-rc.0] Bump version numbers"
This reverts commit c9a3c5749b.
2022-11-04 12:28:15 +00:00
Distiller c9a3c5749b [0.71.0-rc.0] Bump version numbers 2022-11-04 11:27:06 +00:00
Riccardo Cipolleschi 39798cfa91 Revert "[0.71.0-rc.0] Bump version numbers"
This reverts commit f0054e1e30.
2022-11-04 10:53:57 +00:00
Distiller f0054e1e30 [0.71.0-rc.0] Bump version numbers 2022-11-03 14:45:25 +00: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
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
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](https://github.com/facebook/react-native/commits/e286da25fc83324363486eb668806aca179f74b3/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
Samuel Susla 6a23b131e5 Add file ReactNativeTypes.d.ts to fix CircleCI (#35173)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35173

changelog: [internal]

D40897093 (https://github.com/facebook/react-native/commit/f49b2517d739ab129aae44d4ddab01748a96301c) deleted TypeScript definitions.

Reviewed By: cipolleschi

Differential Revision: D40935747

fbshipit-source-id: 020cba21b8b40c8b0c92bb5ab2dc4f6ba5da610a
2022-11-02 08:43:22 -07:00
Ruslan Shestopalyuk e89d223c31 Remove misleading comment about RootTag type not being opaque
Summary: Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D40902247

fbshipit-source-id: 5ed8f69bb46e35d5250bd04898765ead500d7db6
2022-11-02 07:44:34 -07: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
Mike Vitousek 91d58cf5b5 Codemod cycle annotations for xplat/js
Summary:
Add annotations using flow codemod annotate-cycles --write

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D40896688

fbshipit-source-id: 0c32932d17542be070360db29b7797f8e6e5978b
2022-11-01 17:13:27 -07:00
Sam Zhou dbb9252d28 Annotate Array.map returns when the implicit return type is widened
Summary: Changelog: [Internal]

Differential Revision: D40840078

fbshipit-source-id: 0104444060d8d6a1a22066d63579ac06ff715226
2022-11-01 13:37:03 -07:00
Dmytro Voronkevych c565a770eb Migrating all qpl.markerAnnotate call sites to the new signature
Summary:
As part of unifying JS QPL interface, I'm bringing markerAnnotate to the parity with Web version.

At the moment it supports only string annotations, but I'm adding support for ints, arrays of ints, arrays of strings, etc.

## Changelog:
[Internal] [Changed] - Refactored markerAnnotateWithMap -> markerAnnotate

Reviewed By: eddyerburgh

Differential Revision: D40796535

fbshipit-source-id: 9831e353036835b97bb7b2f60085016034c04269
2022-11-01 12:25:00 -07:00
Dmytro Voronkevych e3eeadb63a Adding new markerAnnotateWithMap method
Summary:
## Changelog:
[Internal] [Added] - Adding new markerAnnotateWithMap to the QPL.

This is part of bigger effort to unify JS QPL interfaces across platforms.

Reviewed By: eddyerburgh

Differential Revision: D40796537

fbshipit-source-id: a75b97c20ca411653552228f7dc2fcbedd8ddca9
2022-11-01 12:25:00 -07:00
Samuel Susla f49b2517d7 React Native sync for revisions 54f297a...ab075a2
Summary:
This sync includes the following changes:
- **[ab075a232](https://github.com/facebook/react/commit/ab075a232 )**: Do not unmount layout effects on initial Offscreen mount ([#25592](https://github.com/facebook/react/pull/25592)) //<Samuel Susla>//
- **[765805bf8](https://github.com/facebook/react/commit/765805bf8 )**: Fix type check for null ([#25595](https://github.com/facebook/react/pull/25595)) //<Sebastian Markbåge>//
- **[2ac77aab9](https://github.com/facebook/react/commit/2ac77aab9 )**: Clean up vestige of useOpaqueIdentifier ([#25587](https://github.com/facebook/react/pull/25587)) //<Andrew Clark>//
- **[bdd3d0807](https://github.com/facebook/react/commit/bdd3d0807 )**: Extract logic for detecting bad fallback to helper //<Andrew Clark>//
- **[952dfff3f](https://github.com/facebook/react/commit/952dfff3f )**: Split suspended work loop logic into separate functions //<Andrew Clark>//
- **[d2c0ab10d](https://github.com/facebook/react/commit/d2c0ab10d )**: In work loop, add enum of reasons for suspending //<Andrew Clark>//
- **[5450dd409](https://github.com/facebook/react/commit/5450dd409 )**: Strict Mode: Reuse memoized result from first pass ([#25583](https://github.com/facebook/react/pull/25583)) //<Andrew Clark>//
- **[d2a0176a1](https://github.com/facebook/react/commit/d2a0176a1 )**: Detect and warn if use(promise) is wrapped with try/catch block ([#25543](https://github.com/facebook/react/pull/25543)) //<Andrew Clark>//
- **[cf3932be5](https://github.com/facebook/react/commit/cf3932be5 )**: Remove old react-fetch, react-fs and react-pg libraries ([#25577](https://github.com/facebook/react/pull/25577)) //<Sebastian Markbåge>//
- **[28a574ea8](https://github.com/facebook/react/commit/28a574ea8 )**: Try assigning fetch to globalThis if global assignment fails ([#25571](https://github.com/facebook/react/pull/25571)) //<Sebastian Markbåge>//
- **[09def5990](https://github.com/facebook/react/commit/09def5990 )**: [Float] handle noscript context for Resources ([#25559](https://github.com/facebook/react/pull/25559)) //<Josh Story>//
- **[17204056d](https://github.com/facebook/react/commit/17204056d )**: [Float] fix coordination of resource identity and hydration ([#25569](https://github.com/facebook/react/pull/25569)) //<Josh Story>//
- **[d925a8d0b](https://github.com/facebook/react/commit/d925a8d0b )**: Flight client error stack ([#25560](https://github.com/facebook/react/pull/25560)) //<Josh Story>//
- **[996b00b78](https://github.com/facebook/react/commit/996b00b78 )**: [Tiny] Fixed incorrect import in `react-server-dom-webpack` ([#25554](https://github.com/facebook/react/pull/25554)) //<Leo Lamprecht>//
- **[e7c5af45c](https://github.com/facebook/react/commit/e7c5af45c )**: Update cache() and use() to the canary aka next channel ([#25502](https://github.com/facebook/react/pull/25502)) //<Sebastian Markbåge>//
- **[fa77f52e7](https://github.com/facebook/react/commit/fa77f52e7 )**: Unify promise switch statements //<Andrew Clark>//
- **[7572e4931](https://github.com/facebook/react/commit/7572e4931 )**: Track thenable state in work loop //<Andrew Clark>//
- **[7fc3eefd8](https://github.com/facebook/react/commit/7fc3eefd8 )**: Revert yieldy behavior for non-use Suspense (in Flight, too) //<Andrew Clark>//
- **[61f9b5e97](https://github.com/facebook/react/commit/61f9b5e97 )**: [Float] support <base> as Resource ([#25546](https://github.com/facebook/react/pull/25546)) //<Josh Story>//
- **[1d3fc9c9c](https://github.com/facebook/react/commit/1d3fc9c9c )**: Bug fix when resolving cache ([#25545](https://github.com/facebook/react/pull/25545)) //<Sebastian Markbåge>//
- **[cce18e350](https://github.com/facebook/react/commit/cce18e350 )**: [Flight] Use AsyncLocalStorage to extend the scope of the cache to micro tasks ([#25542](https://github.com/facebook/react/pull/25542)) //<Sebastian Markbåge>//
- **[caa84c8da](https://github.com/facebook/react/commit/caa84c8da )**: Revert fetch instrumentation to only RSC ([#25540](https://github.com/facebook/react/pull/25540)) //<Sebastian Markbåge>//
- **[0c11baa6a](https://github.com/facebook/react/commit/0c11baa6a )**: add warnings for non-resources rendered outside body or head ([#25532](https://github.com/facebook/react/pull/25532)) //<Josh Story>//
- **[9236abdb5](https://github.com/facebook/react/commit/9236abdb5 )**: when float is enabled only push title and script as a single unit ([#25536](https://github.com/facebook/react/pull/25536)) //<Josh Story>//
- **[dd5c20825](https://github.com/facebook/react/commit/dd5c20825 )**: Revert yieldy behavior for non-use Suspense ([#25537](https://github.com/facebook/react/pull/25537)) //<Andrew Clark>//
- **[934177598](https://github.com/facebook/react/commit/934177598 )**: fix transposed escape functions ([#25534](https://github.com/facebook/react/pull/25534)) //<Josh Story>//
- **[d1ced9fd5](https://github.com/facebook/react/commit/d1ced9fd5 )**: [Float] support all links as Resources ([#25515](https://github.com/facebook/react/pull/25515)) //<Josh Story>//
- **[973b90bdf](https://github.com/facebook/react/commit/973b90bdf )**: [Float] support meta tags as Resources ([#25514](https://github.com/facebook/react/pull/25514)) //<Josh Story>//
- **[79c582981](https://github.com/facebook/react/commit/79c582981 )**: Let ReactDOM initialize in RSC ([#25503](https://github.com/facebook/react/pull/25503)) //<Sebastian Markbåge>//
- **[1f7a2f577](https://github.com/facebook/react/commit/1f7a2f577 )**: [Float] support title tags as Resources ([#25508](https://github.com/facebook/react/pull/25508)) //<Josh Story>//
- **[c63580787](https://github.com/facebook/react/commit/c63580787 )**: Support `use` in `act` testing API ([#25523](https://github.com/facebook/react/pull/25523)) //<Andrew Clark>//
- **[65e32e58b](https://github.com/facebook/react/commit/65e32e58b )**: Add fetch Instrumentation to Dedupe Fetches ([#25516](https://github.com/facebook/react/pull/25516)) //<Sebastian Markbåge>//
- **[9336e29d9](https://github.com/facebook/react/commit/9336e29d9 )**: [useEvent] Lint for presence of useEvent functions in dependency lists ([#25512](https://github.com/facebook/react/pull/25512)) //<lauren>//
- **[3cc792bfb](https://github.com/facebook/react/commit/3cc792bfb )**: [useEvent] Non-stable function identity ([#25473](https://github.com/facebook/react/pull/25473)) //<lauren>//
- **[987292815](https://github.com/facebook/react/commit/987292815 )**: Remove feature flag enableStrictEffects ([#25387](https://github.com/facebook/react/pull/25387)) //<Samuel Susla>//
- **[8e2bde6f2](https://github.com/facebook/react/commit/8e2bde6f2 )**: Add cache() API ([#25506](https://github.com/facebook/react/pull/25506)) //<Sebastian Markbåge>//
- **[9cdf8a99e](https://github.com/facebook/react/commit/9cdf8a99e )**: [Codemod] Update copyright header to Meta ([#25315](https://github.com/facebook/react/pull/25315)) //<Andrew Clark>//
- **[e54015e26](https://github.com/facebook/react/commit/e54015e26 )**: Refactor: fill in the flow missing type ([#25496](https://github.com/facebook/react/pull/25496)) //<c0dedance>//
- **[3b1fd5767](https://github.com/facebook/react/commit/3b1fd5767 )**: refactor: Flow: typing of Scheduler ([#25485](https://github.com/facebook/react/pull/25485)) //<bubucuo>//
- **[14072ce64](https://github.com/facebook/react/commit/14072ce64 )**: Add detach to Offscreen component ([#25265](https://github.com/facebook/react/pull/25265)) //<Samuel Susla>//
- **[3bb71dfd4](https://github.com/facebook/react/commit/3bb71dfd4 )**: Rename react-server-dom-webpack entry points to /client and /server ([#25504](https://github.com/facebook/react/pull/25504)) //<Sebastian Markbåge>//
- **[71f2c8cf1](https://github.com/facebook/react/commit/71f2c8cf1 )**: move resource acquisition to mutation phase ([#25500](https://github.com/facebook/react/pull/25500)) //<Josh Story>//
- **[500bea532](https://github.com/facebook/react/commit/500bea532 )**: Add option to load Fizz runtime from external file ([#25499](https://github.com/facebook/react/pull/25499)) //<Andrew Clark>//
- **[4494f2a86](https://github.com/facebook/react/commit/4494f2a86 )**: [Float] add support for scripts and other enhancements ([#25480](https://github.com/facebook/react/pull/25480)) //<Josh Story>//
- **[9ecf84ed7](https://github.com/facebook/react/commit/9ecf84ed7 )**: Bugfix: Suspending in shell during discrete update ([#25495](https://github.com/facebook/react/pull/25495)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 54f297a...ab075a2

jest_e2e[run_all_tests]

Reviewed By: kassens

Differential Revision: D40897093

fbshipit-source-id: 6a040315834dea5c0ab994ea94d91f5605b9d6b0
2022-11-01 10:45:24 -07:00
Ruslan Lesiutin 20eeb1bfe3 refactor(react-native-github): remove AsyncStorage from JS
Summary:
## Changelog
[JS][Removed] - Removed AsyncStorage module from react-native

Reviewed By: NickGerleman

Differential Revision: D40302352

fbshipit-source-id: 9377ea12036e498dde0b4b0f56de5c4fb9bd2461
2022-10-31 14:39:19 -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
atp ad5e3f6b9a Fix typo syncronization -> synchronization (#35132)
Summary:
Fix typo

## Changelog
[General][Fixed] - Fixed typo syncronization -> synchronization
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[CATEGORY] [TYPE] - Message

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

Reviewed By: christophpurrer

Differential Revision: D40832387

Pulled By: rshest

fbshipit-source-id: 834ece525e4469c942e678e2a3d4ecf30be4f550
2022-10-31 02:32:58 -07:00
Riccardo Cipolleschi ec5a4301a3 Separatedly enable TM/Fabric (#35117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35117

This mimics some behavior we have in Android that allow uesers to turn on selectively TM and Fabric.

Notice that if fabric is enabled, TM must be enabled as well, otherwise the app won't work

## Changelog
[iOS][Added] - Added the possibility to selectively enable TM and Fabric with the new Architecture

Reviewed By: cortinico

Differential Revision: D40794328

fbshipit-source-id: b7fc7bb819d05566dcd335832cab224f80b23346
2022-10-29 04:00:24 -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
Sam Zhou 281f7a7524 Annotate React hooks on xplat
Summary:
Changelog:
[Internal]

Reviewed By: pieterv

Differential Revision: D40699106

fbshipit-source-id: 236fcd1001e60f508f70a651ca2d0a602b50c19a
2022-10-28 12:10:27 -07:00
Tianyu Yao 7e8992705a Use pointer events for hover
Summary:
Changelog:
[Category][Internal] - Uses the new experimental pointer events to enable mouse hover events during element inspection

Reviewed By: rbalicki2

Differential Revision: D40705973

fbshipit-source-id: fd0fb4539866dfc13592cfca1a864c2796497dc6
2022-10-28 11:53:51 -07:00
Rick Hanlon b966d29724 Add back deprecated prop-types
Summary:
In 2017, React published v15.5 which extracted the built-in `prop types` to a separate package to reflect the fact that not everybody uses them. In 2018, React Native started to remove `PropTypes` from React Native for the same reason. In 0.68 React Native introduced a deprecation warning which notified users that the change was coming, and in 0.69 we removed the PropTypes entirely.

The feedback we've received from the community is that there has not been enough time to migrate libraries off of PropTypes. This has resulted in users needing to patch the React Native package `index.js` file directly to add back the PropTypes, instead of migrating off of them. We can empathize with this fix short term (it unblocks the upgrade) but long term this patch will cause users to miss important changes to `index.js`, and add a maintenance cost for users.

Part of the reason there was not enough time is that we didn't do a good job surfacing libraries that were using PropTypes. This means, when you got a deprecation warning, it wasn't clear where the source of the usage was (either in your code or in a library). So even if you wanted to migrate, it was difficult to know where to actually make the change.

In the next release, we've made it easier to find call sites using deprecated types by [fixing the code frame in errors](https://github.com/react-native-community/cli/pull/1699) reporting in LogBox, and ensuring that [the app doesn't crash without a warning](https://github.com/facebook/react-native/pull/34650). This should make it easier to identify exactly where the deprecated usage is, so you can migrate it.

To help users get off of the patch, and allow more time to migrate, we're walking back the removal of PropTypes, and keeping it as a deprecation for a couple more versions. We ask that you either migrate off PropTypes to a type system like TypeScript, or migrate to the `deprecated-react-native-prop-types` package.

Once we feel more confident that the community has migrated and will not need to patch React Native in order to fix this issue, we'll remove the PropTypes again. **If you have any trouble finding the source of the PropType usage, please file an issue so we can help track it down with you.**

Changelog:
[General][Changed] - Add back deprecated PropTypes

Reviewed By: yungsters

Differential Revision: D40725705

fbshipit-source-id: 8ce61be30343827efd6dc89a012eeef0b6676deb
2022-10-26 22:03:19 -07:00
Rick Hanlon fa2842d113 Do not filter errors/warnings from console
Summary:
## Overview

When I implemented `ignoreLogs` it was originally just to move `console.ignoreYellowBox` over to LogBox. When I did that, I also added filtering for console messages too. My thought process was: Developers probably don't want to configure hiding logs twice, so the LogBox method can handle both.

This was a mistake. We should never hide console errors and warnings, because it completely silences important feedback to the users such as deprecation warnings. These issues should be fixed, not silenced, and since adding the silencing behavior it's clear that this feature is being abused to ignore legitimate warnings that need address.

Issue #33557 is a great reason why - the correct fix for this is not to ignore the errors, it's to address the deprecation / removal of the API. Allowing an easy `ignoreLog` method to hide the problem made this migration much more painful.

Thus, we're reverting back to the pre-logbox behavior of always showing console logs, even if they're ignored by LogBox in the app UI. Hopefully, this results in more of these issue being addressed instead of ignored.

Changelog:
[General] [Changed] - Do not filter errors/warnings from console

Reviewed By: yungsters

Differential Revision: D40724661

fbshipit-source-id: de3d2db1b0c32dee96acf92c9b1ca07ba0f4e218
2022-10-26 22:03:19 -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
Nick Gerleman 51d14b9dbd Revert D40333083: Support persisted settings in Android + iOS
Differential Revision:
D40333083 (https://github.com/facebook/react-native/commit/0fac9817df403e31d8256befe52409c948614706)

Original commit changeset: f3816e3bd7de

Original Phabricator Diff: D40333083 (https://github.com/facebook/react-native/commit/0fac9817df403e31d8256befe52409c948614706)

fbshipit-source-id: 1a52a06b057c4c0ea6e3e4c3315ba73a883e3579
2022-10-26 12:28:44 -07:00
ankit-tailor 7a19af7fb6 fix: add mixed to aria-checked typings (#34633)
Summary:
`aria-checked` prop should accept `mixed` as value as given [here](https://www.w3.org/WAI/GL/wiki/Using_WAI-ARIA_aria-checked%3Dmixed) and also [accessibilityState.checked](https://reactnative.dev/docs/accessibility#accessibilitystate) accepts mixed to represent checkboxes. This change refers to issue https://github.com/facebook/react-native/issues/34424 and PR https://github.com/facebook/react-native/pull/34524

## Changelog

[General] [Added] - Added `mixed` value for `aria-checked`.

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

Test Plan:
```js
<TouchableOpacity
  accessibilityRole="checkbox"
  aria-checked="mixed"
  accessibilityHint="click me to change state">
  <Text>Checkbox example</Text>
</TouchableOpacity>
```

Reviewed By: lunaleaps

Differential Revision: D39382158

Pulled By: necolas

fbshipit-source-id: fa026274111305cc0bcbb42ed974ca1be7d779a5
2022-10-26 11:47:58 -07:00
Luna Wei fae770b9fe InputAccessoryView
Summary: Changelog: [Internal] Flow InputAccessoryView

Reviewed By: yungsters

Differential Revision: D39855166

fbshipit-source-id: 9c389854e6d76a0c0e881190cd1808088de324fd
2022-10-26 11:24:16 -07:00
Samuel Susla 925e81ab86 Rewrite of ScrollViewStickyHeader for concurrent rendering
Summary:
changelog:
[general][Added] - Concurrent rendering safe implementation of ScrollViewStickyHeader

This is a re-land of ScrollViewStickyHeader from Kacie Bawiec.

Reviewed By: yungsters

Differential Revision: D40380217

fbshipit-source-id: 60dc86086a4d9d97eef71c4ed2e26536f7e72889
2022-10-26 08:17:49 -07:00
Christoph Purrer d0599ac56b Back out "Add enum example to Android/iOS rn-tester TurboModule" (#35089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35089

Changelog:
[General][Fixed] - Back out "Add enum example to Android/iOS rn-tester TurboModule"

This broke the rn-tester adding due to an invalid flow-enum setup. Needs further investigation

Reviewed By: cipolleschi

Differential Revision: D40714320

fbshipit-source-id: 9831276762f90df0ffaca3304382fe5925009343
2022-10-26 06:30:14 -07:00
Robert Balicki 0fac9817df Support persisted settings in Android + iOS (#34964)
Summary:
* Add a DevToolsSettingsManager, which has android and iOS variants, which uses a new TM (Android) or takes advantage of the Settings TM (iOS) to get/set console patch settings
* This is backed by either the existing Settings module (iOS) or a new Java TM, which uses the SharedPreferences AP

## Testing

Manual testing

## Changelog

[General] [Added] - Add DevToolsSettingsManager

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

Test Plan: * Extensive manual testing

Reviewed By: NickGerleman

Differential Revision: D40333083

Pulled By: rbalicki2

fbshipit-source-id: f3816e3bd7dea3086f6f2269c3a099af14aebb3b
2022-10-25 21:01:25 -07:00
Christoph Purrer 02e4fcd825 Add enum example to Android/iOS rn-tester TurboModule
Summary:
Add enum example to Android/iOS rn-tester TurboModule

Changelog:
[General][Added] - Add enum example to Android/iOS rn-tester TurboModule

Reviewed By: javache

Differential Revision: D40619020

fbshipit-source-id: a113c5c78bcff3275e80d11bce8d0e6421b0b97d
2022-10-25 14:40:08 -07:00
Ethan Zhu 3b0c65583d Suppress useNativeDriver is not supported warning
Summary:
Changelog:
[Internal] - Suppress unnecessary warning for native module in jest tests

Reviewed By: yungsters

Differential Revision: D40653968

fbshipit-source-id: ff3d894c36a18943a7b3fd061f52b65685a481a6
2022-10-25 11:45:17 -07:00
Riccardo Cipolleschi 52d37aa403 Back out "add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_batch10" (#35064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35064

Original commit changeset: 0fb0db845c04

Original Phabricator Diff: D40610875 (https://github.com/facebook/react-native/commit/d941940b4ce7ed9030be4f72980fb45d9b62365d)

Open source is using BUCK 1 which does not seem to have the `oncall` directive.

Backing it out because it is breaking the external CI.

## Changelog
[internal]

Reviewed By: cortinico

Differential Revision: D40635873

fbshipit-source-id: 79ebd4db0972520fcca6ccb8c1725657a8ef7949
2022-10-24 10:44:39 -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
Pieter De Baets 9a87db266a Remove initialProps handling for legacy createAnimatedComponent
Summary: Changelog: [Internal] Remove additional Animated logic under Fabric that's no longer required

Reviewed By: jehartzog

Differential Revision: D40513977

fbshipit-source-id: 1e96366377ca4c3bf032d830b5641ab658462ce8
2022-10-24 05:58:05 -07:00
Paige Sun 880e889380 Drop using namespace in .h files
Summary:
using namespace in header file is a bad practice due to many reasons as well as discouraged by -Wheader-hygiene compiler flag which is default for many apps
https://stackoverflow.com/questions/5849457/using-namespace-in-c-headers
https://stackoverflow.com/questions/223021/whats-the-scope-of-the-using-declaration-in-c

Changelog:
[Internal] Drop `using namespace` in .h files.

Reviewed By: christophpurrer

Differential Revision: D40628064

fbshipit-source-id: 8a032f3ab0321a531e26bd88656ad9a65b6d5154
2022-10-24 04:35:28 -07:00
Jonathan Keljo e69e6f4014 supermodule:xplat/default/public.react_native.infra
Reviewed By: javache

Differential Revision: D40376280

fbshipit-source-id: d76e692fd8a571614729d0fb15ebde8895d3de28
2022-10-23 15:55:13 -07:00