Commit Graph

12270 Commits

Author SHA1 Message Date
Samuel Susla 1250b8afb1 Revert D45145742: Synchronously flush the transition lane scheduled in a popstate event (#26025)
Differential Revision:
D45145742

Original commit changeset: 196fe3539ee8

Original Phabricator Diff: D45145742

fbshipit-source-id: ad9e911cf702f539e44d785db030d664a48ebe42
2023-04-20 09:11:41 -07:00
acdlite 7f495a3cf2 Synchronously flush the transition lane scheduled in a popstate event (#26025)
Summary:
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn debug-test --watch TestName`, open
`chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

Browsers restore state like forms and scroll position right after the
popstate event. To make sure the page work as expected on back or
forward button, we need to flush transitions scheduled in a popstate
synchronously, and only yields if it suspends.
This PR adds a new HostConfig method to check if `window.event ===
'popstate'`, and `scheduleMicrotask` if a transition is scheduled in a
`PopStateEvent`.

## How did you test this change?

yarn test

DiffTrain build for commit https://github.com/facebook/react/commit/d121c67004a2e6b0bb5d341843663ef213f64863.

Reviewed By: kassens

Differential Revision: D45145742

Pulled By: sammy-SC

fbshipit-source-id: 196fe3539ee8588a31012d6af86a5ce0cd7fc973
2023-04-20 07:53:57 -07:00
Lulu Wu 8f0307b124 Add bolts task files as internal dependency (#36824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36824

After this diff, RNTester Android can build successfully, and it should be safe to land this stack to move Venice Android to OSS folders

Changelog:
[Android][Changed] - Add bolts task files as internal dependency

Reviewed By: cortinico

Differential Revision: D44729814

fbshipit-source-id: 80926dc548bb269bb9c69efab4c7620a3fb9fdc2
2023-04-20 07:53:37 -07:00
Facebook Community Bot 5428b55113 Re-sync with internal repository (#37005)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
2023-04-20 19:14:31 +01:00
Samuel Susla 2d9c81780c Initialise ScrollView state with content offset from props (#36961)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36961

changelog: [internal]

Initial state must reflect content offset, otherwise ShadowTree will not know about the contentOffset until user scrolls.

This was affecting both, iOS and Android.

Reviewed By: mdvacca

Differential Revision: D45087358

fbshipit-source-id: 8812c2d3fe97e017938a9a81acbb31d579a00d45
2023-04-20 07:36:59 -07:00
Alex Hunt 6971540c90 Rename "Debug Menu" title to "Dev Menu" on iOS (#36981)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36981

We are (following a quick internal RFC) looking to standardise the term "[in-app] [Developer|Debug] menu" to "Dev Menu" in the React Native Debugging docs (and all docs references). (Indeed, the prevalent existing use in docs was already "Developer menu".) This PR aligns naming in the `RCTDevMenu` component on iOS.

See also https://github.com/facebook/react-native-website/pull/3692.

Changelog:
[iOS][Changed] - Rename "Debug Menu" title to "Dev Menu"

Reviewed By: christophpurrer

Differential Revision: D44872456

fbshipit-source-id: c222bb2c551a4f434a1dc0efbb8d4f75c785aa11
2023-04-20 07:16:02 -07:00
Ruslan Shestopalyuk dec8562494 Clean up uneeded "duration" parameter from the Performance.mark API (#36997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36997

I've noticed that `Performance.mark`, for some reason, has been using an explicit `duration` parameter throughout, whereas it doesn't really make sense - neither from the web standard perspective, nor in general.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D45141978

fbshipit-source-id: ce3d149401249882f673c4bb6727eb1560469fa3
2023-04-20 06:31:27 -07:00
Lulu Wu 244c9ff549 Move QPL bindings to internal
Summary:
Changelog:
[Android][Changed] - Move QPL bindings to internal

Reviewed By: RSNara

Differential Revision: D45046703

fbshipit-source-id: 6383c718bf75dd6436136cdc881c9f59f18a452f
2023-04-20 04:39:08 -07:00
Lulu Wu dd8454b689 Migrate "robolectric4_test" to "rn_robolectric_test" (#36812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36812

```robolectric4_test``` is internal and would fail CircleCI tests so we have to migrate away from it.

Changes:
> load("fbsource/tools/build_defs/oss:rn_defs.bzl") -> load("//tools/build_defs/oss:rn_defs.bzl")

> fb_android_library -> rn_android_library

> robolectric4_test -> rn_robolectric_test

I have to disable one test ```BridgelessReactContextTest.getJSIModuleTest``` since it keeps failing to create FabricUIManager which has static code in initialization, I've tried multiple ways but didn't work so disabled it temporarily to unblock.

bypass-github-export-checks

Changelog:
[Android][Changed] - Migrate "robolectric4_test" to "rn_robolectric_test" for bridgeless tests

Reviewed By: cortinico

Differential Revision: D44704765

fbshipit-source-id: 25729617a4d97f4d95a92c550ba42238f09664cb
2023-04-20 03:08:45 -07:00
Christoph Purrer 79c42e7259 Use C++17 namespace format (#36983)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36983

Changelog: [Internal]

This updates ReactCommon/react code to use C++17 namespace format which was already used partially in other files

Reviewed By: NickGerleman

Differential Revision: D45121589

fbshipit-source-id: 0be5a7bce75dc9f8cde7856684f730f4d6df9202
2023-04-19 23:41:29 -07:00
David Vacca 6babe4acfa Delete sStateDescription from BaseViewManager (#36904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36904

In this diff I'm deleting sStateDescription from BaseViewManager, which their usages were originally deleted in D17152891

bypass-github-export-checks

changelog: [Android][Deleted] Delete sStateDescription from BaseViewManager, it's safe to delete because it shouldn't be used anywhere

Reviewed By: genkikondo

Differential Revision: D44682968

fbshipit-source-id: 732c32429b2c0c107f7968ece5b2e1ed256eed90
2023-04-19 20:37:52 -07:00
David Vacca bbc3657ff4 Delete unused method exposed in BaseJavaModule (#36907)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36907

Delete unused method exposed in BaseJavaModule

bypass-github-export-checks

Changelog: [Android][Removed] Delete hasConstants() method from BaseJavaModule

Reviewed By: philIip

Differential Revision: D44678688

fbshipit-source-id: 9fd15f2097a6251fd2cf6c81c89370dd18c6bd6c
2023-04-19 18:44:54 -07:00
David Vacca 65bf785e5b Cleanup unused methods of view recycling in Android (#36906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36906

There are some unused methods of view recycling in Android

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: cortinico, genkikondo

Differential Revision: D44677790

fbshipit-source-id: 59bdbbee4f739c6427112c5a4b07c42d05e65d90
2023-04-19 16:31:55 -07:00
Christoph Purrer 4768a2762d Update license information (#36982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36982

Changelog: [Internal]

Reviewed By: shwanton, luluwu2032

Differential Revision: D45121323

fbshipit-source-id: 93eedc6b24f0a6fcd977d3afc5c77b4e3b7172ad
2023-04-19 15:22:31 -07:00
Nick Gerleman 5f0c3a3e34 Fix Android linting using old minSdkVersion (#36587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36587

Right now an arc focus'd Android Studio (and presumably Android studio in OSS) will warn on any call incompatible with API 20 and later, but we only target API 21+ (Lollipop). See D24380233 for where we removed Lollipop and earlier code in October 2020.

https://pxl.cl/2xMGG

From searching, these warnings are controlled by the closest parent `AndroidManifest.xml`. We don't use this to control the actual SDK version, but we can add one for correct lint warning.

This change does that, then removes any extraneous version checks that were added since then.

Changelog:
[Internal]

Reviewed By: cortinico

Differential Revision: D44305441

fbshipit-source-id: f7b9b8889f4b0523a1e7b1a14808b0f587012a90
2023-04-19 15:03:07 -07:00
Lulu Wu 537c28a422 Remove @SoLoaderLibrary to avoid OSS breakage (#36821)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36821

About SoLoaderLibrary:
```
/**
 * This class is used to mark Java classes that depend on native libraries.
 *
 * <p>The purpose is to enable compile-time checking of library renaming. Adding a native target to
 * the native library merge map will cause its library name to change in release builds, which
 * SoLoader only supports if the target sets allow_jni_merging = True.
 *
 * <p>By publishing the library names to Buck via this annotation, we can validate at build time
 * that this parameter is set.
 */
```
This annotation is not supported in OSS so move it to avoid breakage

Changelog:
[Android][Changed] -Remove SoLoaderLibrary to avoid OSS breakage

Reviewed By: cortinico

Differential Revision: D44679498

fbshipit-source-id: 6255e3c5f011d999d5e5aa6ae756a783bea2ee77
2023-04-19 14:52:52 -07:00
Lulu Wu 81c1153c03 Move components registry to non-OSS (#36823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36823

Move  ```CatalystRegistry.register(componentFactory);``` to internal to avoid internal dependency ``` "//fbandroid/java/com/facebook/fbreact/fabric/components:components"``` in Bridgeless.

Changelog:
[Android][Changed] - Move components registry to non-OSS

Reviewed By: cortinico

Differential Revision: D44679499

fbshipit-source-id: d5e7b7b0832affed93c3a54f9d4a239c5a27922b
2023-04-19 14:52:52 -07:00
Christoph Purrer 6832f937c1 Move BridgelessNativeCallInvoker to shared ReactCommon/react folder (#36966)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36966

Changelog: [Internal]

This allows to re-use the same implementation for multiple platforms

Reviewed By: javache

Differential Revision: D45102417

fbshipit-source-id: 22de8b87774ccf87d76df0a0fe4663198207f324
2023-04-19 13:43:18 -07:00
Lulu Wu 93851fc2c8 Move Hermes code coverage to non-OSS (#36800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36800

Hermes code coverage was added in D43458602, move the logic to internal to avoid internal dependencies in Bridgeless.

Changelog:
[Android][Changed] - Move Hermes code coverage to non-OSS

Reviewed By: cortinico

Differential Revision: D44626679

fbshipit-source-id: 95d71ec6fe6c75664682511efb571a8122d955c2
2023-04-19 13:15:47 -07:00
Christoph Purrer 5763594cda Add missing #pragma once to JsErrorHandler.h (#36964)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36964

Changelog: [Internal]

W/o #pragma once, .cpp files would include the same header file content multiple times leading to compile errors as

```
react-native-github/packages/react-native/ReactCommon/jserrorhandler/JsErrorHandler.h:14:6: note: unguarded header; consider using #ifdef guards or #pragma once
enum JSErrorHandlerKey : uint16_t {
     ^
```

Reviewed By: shwanton

Differential Revision: D45100413

fbshipit-source-id: 9a8a03624b9475506caf1e485dc8a06a7f14c1e5
2023-04-19 11:28:23 -07:00
Lulu Wu 9789aa640f Move Java files to OSS folders (#36822)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36822

Move Bridgeless Java/Kotlin files from

> fbandroid/java/com/facebook/venice

to

> xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless

Changelog:
[Android][Changed] - Move Bridgeless Java/Kotlin code to OSS folders

Reviewed By: fkgozali

Differential Revision: D44626152

fbshipit-source-id: db6a6f51b3a2b09d81a1bf5c82d5baed903b4e4f
2023-04-19 10:54:01 -07:00
Christoph Purrer ef2951ea0c Merge JSCallInvoker and BridgelessJSCallInvoker (#36965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36965

Changelog: [Internal]

These implementations are identical and can be merged

Reviewed By: javache

Differential Revision: D45101259

fbshipit-source-id: af7b2e0288f0cae44ae183a639a9d10e58887fc2
2023-04-19 10:49:08 -07:00
Nicola Corti 50553f4e81 Re-sync repo after ShipIt change - Removal of BUCK files (#36955) 2023-04-19 12:12:04 +01:00
Christoph Purrer 54f7b8b669 Use C++ #include for HermesInstance (#36963)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36963

Changelog: [Internal]

Reviewed By: luluwu2032

Differential Revision: D45096777

fbshipit-source-id: 5a52543d1b83f4e501747664e0d62039a7eda120
2023-04-18 17:58:16 -07:00
Alex Hunt 1c4a505c17 Drop internal base config merge in metro-config (#36777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36777

Changelog: [Internal]

Remove internal merge of `getDefaultConfig` (Metro base defaults) from `react-native/metro-config`. This is unnecessary given the config loading setup of RN CLI and Expo CLI, which use (or replicate) Metro's [`loadConfig`](https://github.com/facebook/metro/blob/1e47cb5b3cc289530fb18e402891f9d2816611dd/packages/metro-config/src/loadConfig.js#L182-L190) function — which will itself apply defaults appropriately.

This relates to a previously-breaking behaviour documented in the test plan of https://github.com/react-native-community/cli/pull/1896 (independently fixed and no longer load-bearing) (**read: no need to cherry pick this change**).

https://pxl.cl/2B8NS

While this has no effect under the fixed RN CLI setup, this is a worthwhile simplification to this package that better-aligns with current Metro tooling expectations.

## Notes

- `getDefaultConfig` no longer returns `ConfigT` (full config), and instead returns `MetroConfig` (partial config). This is non-breaking with the expected API of a given `metro.config.js` file.

Reviewed By: cipolleschi

Differential Revision: D44630645

fbshipit-source-id: 472c3967449dfb99f845a82d9e9c49efc343021c
2023-04-18 14:31:46 -07:00
George Zahariev e2116d277d Codemod $Shape to Partial in xplat, suppressing errors [4] (#36960)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36960

We're deprecating the unsafe `$Shape` and moving to the safe `Partial`: https://fb.workplace.com/groups/flowlang/posts/1251655088773485

I have previously codemodded all locations that do not cause errors. Now start on the remaining ones: codemod and suppress.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D45076273

fbshipit-source-id: 27ebf33370143e19751dbdcfcc1876cf3c586e14
2023-04-18 13:49:07 -07:00
Genki Kondo b68f53d44f Support events with mixed payloads in codegen (#36942)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36942

Changelog:
[General][Changed] - Support mixed props for events in codegen

Reviewed By: javache

Differential Revision: D44580879

fbshipit-source-id: 52f3b12795af767c038e2db7a4faf46cf2906b95
2023-04-18 13:35:45 -07:00
Deepak Jacob 25709afc6c Bump CLI to 12.0.0-alpha.3 and Metro to 0.76.2 (#36948)
Summary:
This is follow up of Metro release 0.76.2 to Bump versions in RN.

Metro version: 0.76.2
Metro release notes: https://github.com/facebook/metro/releases/tag/v0.76.2
CLI Bump PR: https://github.com/react-native-community/cli/pull/1910
CLI npm version: 12.0.0-alpha.3

Took changelog and testplan from https://github.com/facebook/react-native/pull/36793

## Changelog:

[General][Fixed] - Bump CLI to 12.0.0-alpha.3 and Metro to 0.76.2

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

Test Plan: CircleCI

Reviewed By: huntie

Differential Revision: D45081058

Pulled By: jacdebug

fbshipit-source-id: 4c7b1004668ac30045577da54311bcab1a905ca9
2023-04-18 13:21:23 -07:00
Christoph Purrer 5810e23aaf Add C++ JSCallInvoker (#36962)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36962

Changelog:  [Internal]

Reviewed By: sshic

Differential Revision: D45089838

fbshipit-source-id: 42340b4f0892c5cde2fc513b8f0c4f04869c8ab7
2023-04-18 13:16:15 -07:00
Lulu Wu 9bd68a54d1 Move jni files to OSS folders (#36825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36825

Move Bridgeless Android jni files from

> fbandroid/java/com/facebook/venice

to

> xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/react/bridgeless

Changelog:
[Android][Changed] - Move Bridgeless Android jni code to OSS folders

Reviewed By: cortinico

Differential Revision: D44501428

fbshipit-source-id: 442276a56f35bccd24c2fd425abc0e68479ad379
2023-04-18 12:59:04 -07:00
Genki Kondo 645b643f68 Enable animating skew in transforms with native driver (#36933)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36933

Skew is already supported on the platform side; there's no reason to disable animating it.

Changelog:
[General][Added] - Enable animating skew in transforms with native driver

Reviewed By: mdvacca

Differential Revision: D45053914

fbshipit-source-id: 31198c35eeb55211a3ff88c968707db65b025f49
2023-04-18 11:53:57 -07:00
Lulu Wu e2e59c4d0e Move C++ code to OSS folders (#36789)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36789

Move
> xplat/ReactNative/venice

to

> xplat/js/react-native-github/packages/react-native/ReactCommon/react/bridgeless

Changelog:
[General][Changed] - Move Bridgeless C++ code to OSS folders

Reviewed By: fkgozali

Differential Revision: D44626153

fbshipit-source-id: ec8340db92b805d07d3c5f8e86cb35335637ccd6
2023-04-18 11:01:12 -07:00
Kyle Roach 94356e14ec fix(types): cross platform autoComplete for TextInput (#36931)
Summary:
Since v0.71 the autoComplete prop on TextInput is available on iOS ([release notes](https://reactnative.dev/blog/2023/01/12/version-071#component-specific-behavior)). However, this change is not reflected in the types.

Original types PR here - https://github.com/DefinitelyTyped/DefinitelyTyped/pull/65144 by chwallen

## Changelog:

[GENERAL] [FIXED] - Fix autoComplete type for TextInput

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

Test Plan: Setting the autoComplete prop on TextInput to `nickname`, `organization`, `organization-title`, or `url` should not result in typescript errors.

Reviewed By: NickGerleman

Differential Revision: D45052350

Pulled By: javache

fbshipit-source-id: 40993833b4ed14f91e3bf3521a264ea93517a0c9
2023-04-18 10:11:53 -07:00
Oskar Kwaśniewski eb30a80c81 fix: make sure initialScrollIndex is bigger than 0 (#36844)
Summary:
Hey,

`adjustCellsAroundViewport` function was checking if `props.initialScrollIndex` is truthy and -1 was returning true. This caused bugs with rendering for tvOS: https://github.com/react-native-tvos/react-native-tvos/pull/485 There are warnings in the code about `initalScrollIndex` being smaller than 0 but this if statement would still allow that.

## Changelog:

[General] [Fixed] - Make sure initialScrollToIndex is bigger than 0 when adjusting cells

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

Test Plan: Pass -1 as initialScrollToIndex. Check that this code is executed.

Reviewed By: cipolleschi

Differential Revision: D44856266

Pulled By: NickGerleman

fbshipit-source-id: 781a1c0efeae93f00766eede4a42559dcd066d7d
2023-04-18 09:51:51 -07:00
Broda Noel 4264ddb059 Fix typo (#36956)
Summary:
Fixing a simple typo

## Changelog:
Not applicable

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

Test Plan: Not applicable

Reviewed By: NickGerleman

Differential Revision: D45085878

Pulled By: cortinico

fbshipit-source-id: 2b338c7a68cdbc38da85d74acaae3854df561cfe
2023-04-18 09:45:55 -07:00
Lulu Wu e6177d6bf9 Move C++ code to OSS folders (#36788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36788

Move
> xplat/ReactNative/venice/hermes

to

> xplat/js/react-native-github/packages/react-native/ReactCommon/react/bridgeless/hermes

Changelog:
[General][Changed] - Move Bridgeless C++ code to OSS folders

Reviewed By: cortinico

Differential Revision: D44501429

fbshipit-source-id: 5a63fe53dd4e1f3906fc9a1011114b53a6549caf
2023-04-18 09:38:08 -07:00
Genki Kondo 4934cdb403 Enable animating transform matrix (#36935)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36935

With the addition of AnimatedObject, animating prop values with arbitrary map/array nestings are possible (including transform matrix).

Note: this is only enabled when ReactNativeFeatureFlags.useAnimatedObjectForTransform is true.

Changelog:
[General][Added] - Enable animating skew in transforms with native driver

Reviewed By: mdvacca

Differential Revision: D45055381

fbshipit-source-id: 1b9224c0603ca7e89cd6f220d38a4579a4722e02
2023-04-18 09:20:46 -07:00
Nick Gerleman 5c4649af27 Bump @tsconfig/react-native to 3.0.0 (#36957)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36957

Fixes https://github.com/facebook/react-native/issues/36830

This bumps the version of tsconfig/react-native to inform TypeScript of more libraries provided by Hermes/React Native. See https://github.com/tsconfig/bases/commit/eee5f19ce8c6a9a8d8baed5ce42588b95262b1a8.

I did the search off of current Hermes/RN main branch, but I think the new config should be valid as far back as 0.71. It doesn't make sense to change the new app template for an old version though, so instead I think we should include this new version in 0.72.

Changelog:
[General][Changed] - Bump tsconfig/react-native to 3.0.0

Reviewed By: cortinico

Differential Revision: D45085932

fbshipit-source-id: 448f1103ef13f76fa95884f790a3cccd9ff75b2f
2023-04-18 08:42:34 -07:00
Samuel Susla 64e789e1e5 Mark dtor as virtual (#36932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36932

changelog: [internal]

ShadowNode must have its destructor as virtual because it is a base class and is used polymorphically. It is deleted through a pointer.

Reviewed By: nlutsenko

Differential Revision: D45045682

fbshipit-source-id: 882d06d2ab200c201acc09693cb982561e908859
2023-04-18 08:31:17 -07:00
Nicola Corti 0c0dc1dbda Skip flaky unmounted.measureInWindow(...) does nothing test on Windows (#36950)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36950

This test is flaky and is being reported on a number of diffs: D44729814
I'm suppressing it on Windows only as it's not failing on other platforms.

Changelog:
[Internal] [Changed] - Skip flaky `unmounted.measureInWindow(...) does nothing` test on Windows

Reviewed By: sshic

Differential Revision: D45081060

fbshipit-source-id: 917018d5e4a3298c7e4dee8658a41e2b18f68bb1
2023-04-18 06:41:42 -07:00
Pieter De Baets d97cca3d71 Migrate ReactInstanceManager to lambda's
Summary:
We have modern Java now, so inline these lambda's to improve readability. Also removed some old logging related to a completed investigation.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D45062457

fbshipit-source-id: b29f289b84083cb8b5dd2ccb7631ac21b4d04786
2023-04-18 05:46:12 -07:00
Dmitry Rykun a804c0f22b Do not send extra onChangeText even wnen instantianting multiline TextView (#36930)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36930

This diff fixes https://github.com/facebook/react-native/issues/36494

Now this code matches its [Fabric counterpart](https://github.com/facebook/react-native/commit/7b4889937ceb0eccdbb62a610b58525c29928be7).

There is also one extra check that `_lastStringStateWasUpdatedWith != nil`. With that in place we don't send extra `onChangeText` event when `attributedText` is assigned for the first time on TextView construction.

Changelog: [IOS][Fixed] - Do not send extra onChangeText even wnen instantianting multiline TextView

Reviewed By: sammy-SC

Differential Revision: D45049135

fbshipit-source-id: 62fa281308b9d2e0a807d024f08d8a214bd99b5e
2023-04-18 05:39:48 -07:00
Nicola Corti 6dcdd2e2bc Fix old-arch component not updating background in interop layer example (#36924)
Summary:
I've noticed that in the Fabric Interop Layer sample on RN-Tester, when running with Old Arch, the legacy view is not receiving the commands correctly.
This is due to us not sending the command as string, which is making the command fail to deliver.

## Changelog:

[INTERNAL] - Fix old-arch component not updating background in interop layer example

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

Test Plan:
Tested locally:

| Before | After |
|--------|--------|
| ![screen-1681728104](https://user-images.githubusercontent.com/3001957/232461662-68b23545-f38c-40fe-9a5d-44bb0cae29e9.png) | ![screen-1681728077](https://user-images.githubusercontent.com/3001957/232461651-eec93a51-b0f0-4650-af3a-c5dd991f2f96.png) |

Reviewed By: cipolleschi

Differential Revision: D45043929

Pulled By: cortinico

fbshipit-source-id: 8bb2a052a1a600046f3a16c868062c5e600385f0
2023-04-18 04:24:13 -07:00
daisy1754 4b39f44a61 Fix RequestBodyUtil for older version of Android (M or before) (#28399)
Summary:
This is bugfix for following code in RequestBodyUtil.java.

```
stream.getChannel().transferFrom(channel, 0, Long.MAX_VALUE);
```

This throws IllegalArgumentException in Android M or before. It seems in old version of JVM it internally casts third argument to integer so when you pass value that is larger than Integer.MAX_VALUE app would crash.

See:
https://bugs.openjdk.java.net/browse/JDK-5105464
https://stackoverflow.com/questions/55696035/thrown-illegalargumentexception-when-using-java-nio

## Changelog

[Android] [Fixed] Fix issue downloading request body via remote URL

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

Test Plan:
Run following code on Android M or before. It would crash w/o this PR but it won't with this PR.

```
const body = new FormData();
const image = { uri: "https://reactnative.dev/img/showcase/facebook.png", path: null };
body.append('user[img]', fileBody(image));
fetch("https://example.com", {
    method: 'POST',
    headers: {
    Accept: 'application/json',
    'Content-Type': 'multipart/form-data;',
    },
    body: body
});
```

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D45057263

Pulled By: cortinico

fbshipit-source-id: e0306eb157a5aa92619ac51e67d106b8651a0ba7
2023-04-18 04:19:14 -07:00
Nick Gerleman f7dc24c958 Use Java 8isms for Span Stripping (#36622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36622

This replaces Java `SpanPredicate` anonymous inner classes with lambdas and `androidx` `Predicate` (compat version of Java 8 predicate).

This may not be able to be merged yet because of Buck in OSS.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D44362123

fbshipit-source-id: 67c9c7aa2acceab406e28ff49546c1240a5e85e6
2023-04-18 03:25:02 -07:00
Genki Kondo 07df82b4e1 Remove gating for AnimatedObject (#36934)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36934

Embarrassingly, the check for ReactNativeFeatureFlags.isAnimatedObjectEnabled wasn't actually useful since it's a function...it's been working as expected, so remove this gating since it's not doing anything.

Changelog:
[Internal] - Remove gating for AnimatedObject

Reviewed By: mdvacca

Differential Revision: D45055855

fbshipit-source-id: c30b3c04efc0e919059dbcb75a5adfea90610b85
2023-04-18 02:39:36 -07:00
Nicola Corti deb6b380b2 Remove deprecated POST_NOTIFICATION from PermissionsAndroid (#36936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36936

I'm removing `POST_NOTIFICATION` as that's a typo as it should be `POST_NOTIFICATIONS`
We had both in version 0.71 so we can remove the wrong one as it's misleading for users.

Changelog:
[Android] [Removed] - Remove deprecated POST_NOTIFICATION from `PermissionsAndroid`

Reviewed By: sshic

Differential Revision: D45054310

fbshipit-source-id: be733811a1ee8e7c9d6e4986c0303eed7c07c35b
2023-04-18 02:35:19 -07:00
Phillip Pan 9e5c963e2d pass eager initialized modules directly to bridge (#36916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36916

Changelog: [iOS][Removed]

the bridge only behavior of eager initialization of native modules was coupled with the turbomodule infra, even though it didn't need to be. this eager initialized modules is a static list, and the bridge owner which is usually app scoped, can pass this list directly to the bridge instead.

Reviewed By: sammy-SC

Differential Revision: D45021784

fbshipit-source-id: f033661e0722f65ae971bd7ce27f8dc7de1173ad
2023-04-17 19:33:02 -07:00
Riccardo Cipolleschi 145af9a18b Back out "Fix escaping in the URL conversion" (#36939)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36939

Revert changes implemented in [this commit](https://github.com/facebook/react-native/commit/2b4e1f5ece7d160935b19d4862af8706a44cee59).

It makes some e2e internal test fail, although it is unclear why.

## Changelog:
[General][Fixed] - Rollback changes on URL escaping

Reviewed By: philIip, mdvacca

Differential Revision: D45061886

fbshipit-source-id: 61e388472209097c5629fc4df402369ef806d081
2023-04-17 14:01:08 -07:00
Nick Gerleman eb83356cee Export EmitterSubscription TypeScript Type (#36632)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36632

Discovered when bumping the RN documentation to typecheck against 0.72, https://github.com/facebook/react-native/pull/36109 removed the `EmitterSubscription` type which should be kept public.

Changelog:
[General][Fixed] -  Export EmitterSubscription TypeScript Type

Reviewed By: cortinico

Differential Revision: D44375081

fbshipit-source-id: c8dbd5694d3a728a0a2091210894d27c9d84a012
2023-04-17 11:31:19 -07:00