Commit Graph
32109 Commits
Author SHA1 Message Date
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 749588313e Bump react-native-android docker container to 8.0 (#36954)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36954

This bumps the docker container we use to the latest major.

Changelog:
[Internal] [Changed] - Bump react-native-android docker container to 8.0

Reviewed By: cipolleschi

Differential Revision: D45083111

fbshipit-source-id: 44285e3e9af9be352c23bb1066fed3c35f51fb29
2023-04-18 06:58:00 -07:00
Pranav Yadav abddf14bf1 chore: bump actions/checkout to v3 (#36937)
Summary:
A recent [Rebase run](https://github.com/facebook/react-native/actions/runs/4724279197/jobs/8381306851) gave following warning:
>Node.js 12 actions are *deprecated*. Please update the following actions to use Node.js 16: actions/checkout@v2. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

So, it makes sense to upgrade to `actions/checkout@v3`.

## Changelog:

[GENERAL] [SECURITY] - Bump `actions/checkout` to `v3`

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

Test Plan: - ci should be green + the `/rebase` command works as usual.

Reviewed By: rshest

Differential Revision: D45079793

Pulled By: cortinico

fbshipit-source-id: 49e654cf15f6ae7208bf8b277a194ace3fa62aa0
2023-04-18 06:49:37 -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
Pranav Yadav ee271c84c2 chore: cleanup - rm unused files (Movies App) (#36913)
Summary:
The example **Movies App** *no longer exists*, no wonder; why no one noticed these files ;).
It makes sense to remove all files specifically related to it.
This diff removes such dir and files.

## Changelog:

[GENERAL][REMOVED] - Cleanup - remove  unused files (Movies App)

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

Test Plan: - `yarn test-ci` --> should be green.

Reviewed By: christophpurrer

Differential Revision: D45056787

Pulled By: cortinico

fbshipit-source-id: 56b8d39772c70d31f2ba65ad986477710fa9fa9d
2023-04-17 16:09:35 -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
Pranav Yadav 4ad2fc8a9e chore: specify eol config in .prettierrc as lf (#36884)
Summary:
- Although we have `.editorconfig`, on Windows machines most of the times the IDEs default to `CRLF` as default EOL config
- we've already specified the `eol` config as `lf` in `.editorconfig` at root level
- this diff syncs same config for prettier as well

>NOTE: Using `[skip ci]` as it's non code change and is tested for formatting.

## Changelog:

[GENERAL] [CHANGED] - Specify `eol` config in `.prettierrc` as `lf` at the root level

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

Test Plan: - `yarn run format`  --> _nothing should change_

Reviewed By: christophpurrer

Differential Revision: D45056330

Pulled By: cortinico

fbshipit-source-id: 166cbba04728e04521de58144abf0576730c8edd
2023-04-17 12:38:24 -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
Marshall Roch 4e97283983 Upgrade to Flow v0.204.0 (#36928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36928

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D45022693

fbshipit-source-id: 1cc543d49139990b75f3a5f9326f53d3ddb2b6a5
2023-04-17 11:18:28 -07:00
Nicola Corti 72d2880999 Remove Buck OSS third-party files (#36912)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36912

Those files were in use to `buck fetch` dependencies for local consumption by the Buck OSS build.
They're not in use anymore and can be removed for now

Changelog:
[Internal] [Changed] - Remove Buck OSS third-party files

Reviewed By: cipolleschi

Differential Revision: D44992505

fbshipit-source-id: 0462a23c95107e67b1dd8d969648826cdb77554f
2023-04-17 08:27:51 -07:00
Riccardo Cipolleschi 2b4e1f5ece Fix escaping in the URL conversion (#36898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36898

This changes are a followup from D42281798 and the task T141309497.

In the previous diff, we were able to handle most cases thanks to `NSURLComponents`. `NSURLComponents` provides us with more flexibility so that we could handle the missing cases.

## Changelog:
[iOS][Fixed] - Handle doulbe `#` and partially escaped urls

Reviewed By: sammy-SC

Differential Revision: D44958172

fbshipit-source-id: 03628d86966c149d0785ad90fdbccbcb5e70106e
2023-04-17 05:27:32 -07:00
Tomáš Hübelbauer ee2f488670 Refer to the correct community package in the Clipboard deprecation notice (#36914)
Summary:
The URLs in this file were pointing to something but that package ended up not working for me. I checked the docs and sure enough those suggest a URL which ultimately redirects to a different URL that the one in these docs:

https://reactnative.dev/docs/clipboard -> https://reactnative.directory/?search=clipboard -> https://github.com/react-native-clipboard/clipboard

I believe this is the right URL.

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

Reviewed By: christophpurrer, cortinico

Differential Revision: D45018301

Pulled By: lunaleaps

fbshipit-source-id: 66c15b5416def75862ebb6ef30f25283a9fc1a20
2023-04-17 03:47:51 -07:00
Christoph Purrer f5c0606185 Add jsi::HostObject example to rn-tester (#36909)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36909

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D44978689

fbshipit-source-id: 0e31b5c37a7890744694706994ea672c3e619341
2023-04-14 13:58:39 -07:00
Yurii Nakonechnyi adb210306d Minor: removed extra semicolon (#937)
Summary:
X-link: https://github.com/facebook/litho/pull/937

Latest `emscripten` compiler shows the next warning:
```
yoga/event/event.h:83:6: warning: extra ‘;’ [-Wpedantic]
   83 |     };
      |      ^
```

This small PR fixes it

X-link: https://github.com/facebook/yoga/pull/1240

Reviewed By: cortinico, mdvacca

Differential Revision: D44775620

Pulled By: philIip

fbshipit-source-id: 79b7ca5df2a31ac9a6ef24ef55d4acb6117a8acb
2023-04-14 13:23:44 -07:00
TatianaKapos 3c0ad81fef Comment out unreferenced formal parameter (#36853)
Summary:
Recent windows integration brought in a change where a unreferenced formal parameter was introduced in TurboModule.h. Windows treats with warning as an error, this change comments out the formal parameter name to get rid of the error/warning.

## Changelog:

[GENERAL] [FIXED] - Comment out unreferenced formal parameter

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

Test Plan: Passed Windows testcases

Reviewed By: javache

Differential Revision: D45007332

Pulled By: philIip

fbshipit-source-id: 2e8128549d628a8be6bcd76c1fa473d0bc27649b
2023-04-14 13:07:09 -07:00
David Vacca ce17c37050 Replace callback for lambdas in TurboModules classes (#36908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36908

We can now use Java 8, this diff i'm replacing old callbacks by lambdas
changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D44977955

fbshipit-source-id: 0ab0d1c49a013e930041936bb08bbdb86dd30236
2023-04-14 08:00:55 -07:00
leedom 234f1999a1 chore: update all website links about react (#36638)
Summary:
New website of React is online, so some links about react should be also updated in README.md.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[General] [Fixed] - Fix some links about react in readme

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

Test Plan: The PR just changes some links in readme, don't need to test.

Reviewed By: jacdebug

Differential Revision: D44959199

Pulled By: blakef

fbshipit-source-id: 14a66a2d2b086fbe16f715c621c59a6d8d6ee698
2023-04-14 06:23:52 -07:00
Pieter De Baets ebf10798a5 Remove unused View foregroundColor (#36882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36882

This property was never used as TextAttributes has its own foreground color attribute.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D44884978

fbshipit-source-id: daac06c9dfcbceedc084b6adc2cb114758533036
2023-04-14 05:00:17 -07:00
gabrieldonadel e962d43233 chore: Extract logic to compute codegen TS extendsProps and props in getProps function (#36889)
Summary:
[Codegen 103] This PR extracts the logic to compute the `extendsProps` and `props` properties in TypeScript Codegen in a `getProps()` function as requested on https://github.com/facebook/react-native/issues/34872

## Changelog:

[Internal] [Added] - Extract logic to compute codegen TS `extendsProps` and `props` properties in a single `getProps` function

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

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

Reviewed By: rshest

Differential Revision: D44952664

Pulled By: cipolleschi

fbshipit-source-id: fd51f0b8767efbb0071b6391e0852c19b5a984c6
2023-04-14 04:40:49 -07:00
Alex Hunt 808b3c9716 Restore 'import' in default Package Exports conditions (#36902)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36902

Reverts https://github.com/facebook/react-native/pull/36584.

Since we've come across example packages (typically targeting Node.js) which only distribute ESM, we believe it's more helpful to return to asserting the `"import"` condition by default, for maximum compatibility. The above issue and comments outline the pros/cons.

Changelog:
[General][Changed] - Default condition set for experimental Package Exports is now ['require', 'import', 'react-native']

Metro changelog: [Experimental] Package Exports unstable_conditionNames now defaults to ['require', 'import']

Reviewed By: robhogan

Differential Revision: D44962143

fbshipit-source-id: 004172388916c902469b49cfc920ebe13c62c430
2023-04-14 03:39:46 -07:00
Nicola Corti 3b4037e379 Cleanup the IS_OSS_BUILD logic from Buck files (#36899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36899

We don't need this logic anymore as `IS_OSS_BUILD` is always false.

Changelog:
[Internal] [Changed] - Cleanup the `IS_OSS_BUILD` logic from Buck files

Reviewed By: cipolleschi

Differential Revision: D44958368

fbshipit-source-id: 1b56758879fcd7193417c5b04a819a9d72a7f1f7
2023-04-14 00:49:36 -07:00
Nicola Corti 7d7f48da41 Remove Buck OSS 1 setup. (#36900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36900

This commit effectively removes all the Buck 1 OSS infra code we do have inside
React Native as we'll need to rework most of it once we move to Buck 2

Changelog:
[Internal] [Changed] - Remove Buck OSS 1 setup

Reviewed By: mdvacca, cipolleschi

Differential Revision: D44956134

fbshipit-source-id: c0ad1914286c428480248658c4282df5477bba2b
2023-04-13 13:19:24 -07:00
Rubén Norte d50934a2de Make test FB-specific to fix OSS CI (#36903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36903

Changelog: [internal]

Reviewed By: rickhanlonii, rshest

Differential Revision: D44965985

fbshipit-source-id: 1e770f1a6a1e9f5526f9ac3081ea00a8e1a9ad0f
2023-04-13 10:36:38 -07:00
Rubén Norte 6dbc2ccdf9 Implement ReadOnlyText and ReadOnlyCharacterData
Summary:
This adds supports for text instances in React Native using a DOM-like interface (as defined in https://github.com/react-native-community/discussions-and-proposals/pull/607).

This reuses the `getTextContent` method from Fabric that we added in D44464637, which is supported for this use case as well.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: rshest

Differential Revision: D44632362

fbshipit-source-id: edea99ce61fb17d33853c72196ece7bb06a01e41
2023-04-13 09:19:00 -07:00
Rubén Norte 26fdb44c57 Implement offsetParent, offsetTop and offsetLeft
Summary:
This adds a new method in Fabric to get the offset for an element, and uses it to implement the following methods as defined in  as defined in https://github.com/react-native-community/discussions-and-proposals/pull/607 :
* `offsetParent`: returns the ancestor that's used to position the element relative to. In React Native, this is always the immediate parent, except if the element has `display: none`, in which case is `null`.
* `offsetTop`, `offsetLeft`: returns the position of the outer border of the element, relative to the inner border of its offset parent. This is similar to our existing `measure` function, except that `measure` uses the outer border of the parent, instead of the inner one.

As with `offsetWidth` and `offsetHeight`, these methods return integers instead of double precision values.

Extra: added descriptions to some fields in `LayoutMetrics` :)

Changelog: [internal]

bypass-github-export-checks

Reviewed By: rshest

Differential Revision: D44512594

fbshipit-source-id: 8f05e21f73397db7b88e6841cc117320d1229979
2023-04-13 09:19:00 -07:00
Rubén Norte 6b2596d187 Implement offsetWidth and offsetHeight
Summary:
These can just be derived from `getBoundingClientRect`. The only difference is that they're always integers (so we do we rounding manually in JS).

They're implemented as defined in  as defined in https://github.com/react-native-community/discussions-and-proposals/pull/607.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44512595

fbshipit-source-id: 0d994135efbb77740a06ea37eb1e6aeddde1af6e
2023-04-13 09:19:00 -07:00
Rubén Norte 245c405bd6 Implement element.textContent
Summary:
This implements the `textContent` property in `ReadOnlyElement` as defined in https://github.com/react-native-community/discussions-and-proposals/pull/607.

This requires a new method in Fabric because we can't derive that from the existing methods.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: rshest

Differential Revision: D44464637

fbshipit-source-id: de7e4539b4ef70f3586f802fd07888d22678c239
2023-04-13 09:19:00 -07:00
Rubén Norte 528edd82bb Implement node.compareDocumentPosition and node.contains
Summary:
This implements the `compareDocumentPosition` and `contains` methods (contains is implemented in JS) as defined in https://github.com/react-native-community/discussions-and-proposals/pull/607.

This requires a new method in Fabric because we can't derive that from the existing methods.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: rshest

Differential Revision: D44370433

fbshipit-source-id: a7c12a35955e9ccbf8eb19f394125bf05cb995ce
2023-04-13 09:19:00 -07:00
Rubén Norte 03430ca660 Implement node.isConnected
Summary:
This implements the `isConnected` method as defined in https://github.com/react-native-community/discussions-and-proposals/pull/607.

This requires a new method in Fabric because we can't derive that from the existing methods.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44346661

fbshipit-source-id: 1eefa589f2937d1dac2461350ddc8df006f0e873
2023-04-13 09:19:00 -07:00
Rubén Norte be7f2ab4f6 Implement getBoundingClientRect in React Native
Summary:
We already have `getBoundingClientRect` implemented in Fabric, so we can expose this as a proper method in `ReactNativeElement` (behind a feature flag).

Changelog: [internal]

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D44065187

fbshipit-source-id: bd87e72f78d135079f5440b0b0bd4c572b05ba2a
2023-04-13 09:19:00 -07:00
Rubén Norte 3838a1894c Implement the traversal methods in ReadOnlyNode and ReadOnlyElement that are available in Fabric
Summary:
Now that we have `getParentNode` and `getChildNodes` in Fabric, we can implement a large part of the traversal methods in this proposal: https://github.com/react-native-community/discussions-and-proposals/pull/607

This implements all traversal methods in `ReadOnlyNode` and `ReadOnlyElement` except for:
1. Proper implementation of `getRootNode()` returning a true document-level node.
2. `compareDocumentPosition` method (which we'll use to implement `contains`).
3. `isConnected`, which requires a new method in Fabric.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D44333175

fbshipit-source-id: 06e138277a43d34fd7a10070413bdd238e92b8dd
2023-04-13 09:19:00 -07:00
Rubén Norte 43864a1d60 Add getParentNode and getChildNodes to Fabric UIManager binding
Summary:
Implements these 2 base methods to allow basic traversal of the host tree from JS to implement part of the proposal in https://github.com/react-native-community/discussions-and-proposals/pull/607.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44022477

fbshipit-source-id: 34fbab0fbce4d57a93b8ed1dcd0ef89e9f542237
2023-04-13 09:19:00 -07:00
Nikita Lutsenko 6be4449a27 react-native | Fix inconsistent-missing-destructor-override warnings (#36887)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36887

changelog: [internal]

Fixing inconsistent use of 'override' in destructors.

Differential Revision: D44942615

fbshipit-source-id: 16336596d67442d9f1ca775cc8f97d35247a4257
2023-04-13 04:18:33 -07:00
Rubén Norte 130a951e2e Implement compatibility methods in ReactNativeElement and use it behind a flag
Summary:
This implements all compatibility methods from `ReactFabricHostComponent` into `ReactNativeElement` and uses the feature flag `enableAccessToHostTreeInFabric` to choose between them at runtime.

This flag is disabled everywhere so this won't have an effect for now.

Both these classes implement the NativeMethods interface, so they're interchangeable as refs in existing product code.

Changelog: [internal]

bypass-github-export-checks

Reviewed By: yungsters

Differential Revision: D44304435

fbshipit-source-id: 43b5525b943e385287d7b00107147884b859c1fd
2023-04-13 03:07:47 -07:00
Rubén Norte fbb3a9eda8 React Native sync for revisions ca01f35...58742c2
Summary:
This sync includes the following changes:
- **[58742c21b](https://github.com/facebook/react/commit/58742c21b )**: Delete unused `eventTimes` Fiber field ([#26599](https://github.com/facebook/react/pull/26599)) //<Andrew Clark>//
- **[0b931f90e](https://github.com/facebook/react/commit/0b931f90e )**: Remove JND delay for non-transition updates ([#26597](https://github.com/facebook/react/pull/26597)) //<Andrew Clark>//
- **[ac43bf687](https://github.com/facebook/react/commit/ac43bf687 )**: Move validation of text nesting into ReactDOMComponent  ([#26594](https://github.com/facebook/react/pull/26594)) //<Sebastian Markbåge>//
- **[ca41adb8c](https://github.com/facebook/react/commit/ca41adb8c )**: Diff properties in the commit phase instead of generating an update payload ([#26583](https://github.com/facebook/react/pull/26583)) //<Sebastian Markbåge>//
- **[dd0619b2e](https://github.com/facebook/react/commit/dd0619b2e )**: rename $$$hostConfig to $$$config ([#26593](https://github.com/facebook/react/pull/26593)) //<Josh Story>//
- **[b55d31955](https://github.com/facebook/react/commit/b55d31955 )**: Rename HostConfig files to FiberConfig to clarify they are configs fo… ([#26592](https://github.com/facebook/react/pull/26592)) //<Josh Story>//
- **[ffb8eaca5](https://github.com/facebook/react/commit/ffb8eaca5 )**: Rename ReactServerFormatConfig to ReactFizzConfig ([#26591](https://github.com/facebook/react/pull/26591)) //<Josh Story>//
- **[f4f873f62](https://github.com/facebook/react/commit/f4f873f62 )**: Implements wiring for Flight to have it's own "HostConfig" ([#26590](https://github.com/facebook/react/pull/26590)) //<Josh Story>//
- **[44db16afc](https://github.com/facebook/react/commit/44db16afc )**: Normalize ReactFlightServerConfig and related files ([#26589](https://github.com/facebook/react/pull/26589)) //<Josh Story>//
- **[fec97ecbc](https://github.com/facebook/react/commit/fec97ecbc )**: act: Move didScheduleLegacyUpdate to ensureRootIsScheduled ([#26552](https://github.com/facebook/react/pull/26552)) //<Andrew Clark>//
- **[9a9da7721](https://github.com/facebook/react/commit/9a9da7721 )**: Don't update textarea defaultValue and input checked unnecessarily ([#26580](https://github.com/facebook/react/pull/26580)) //<Sebastian Markbåge>//
- **[e5146cb52](https://github.com/facebook/react/commit/e5146cb52 )**: Refactor some controlled component stuff ([#26573](https://github.com/facebook/react/pull/26573)) //<Sebastian Markbåge>//
- **[657698e48](https://github.com/facebook/react/commit/657698e48 )**: [Tests] `waitForThrow` should diff strings ([#26568](https://github.com/facebook/react/pull/26568)) //<Josh Story>//
- **[85bb7b685](https://github.com/facebook/react/commit/85bb7b685 )**: Fix: Move `destroy` field to shared instance object ([#26561](https://github.com/facebook/react/pull/26561)) //<Andrew Clark>//
- **[9cfba0f6e](https://github.com/facebook/react/commit/9cfba0f6e )**: Clean up discrete event replaying ([#26558](https://github.com/facebook/react/pull/26558)) //<Sebastian Markbåge>//
- **[790ebc962](https://github.com/facebook/react/commit/790ebc962 )**: Remove no-fallthrough lint suppressions ([#26553](https://github.com/facebook/react/pull/26553)) //<Sophie Alpert>//
- **[c15579631](https://github.com/facebook/react/commit/c15579631 )**: Put common aliases in Map/Set instead of switch over strings ([#26551](https://github.com/facebook/react/pull/26551)) //<Sebastian Markbåge>//
- **[d5fd60f7e](https://github.com/facebook/react/commit/d5fd60f7e )**: Remove findInstanceBlockingEvent unused parameters ([#26534](https://github.com/facebook/react/pull/26534)) //<Mohammad Ghorbani>//
- **[eeabb7312](https://github.com/facebook/react/commit/eeabb7312 )**: Refactor DOM Bindings Completely Off of DOMProperty Meta Programming ([#26546](https://github.com/facebook/react/pull/26546)) //<Sebastian Markbåge>//
- **[da94e8b24](https://github.com/facebook/react/commit/da94e8b24 )**: Revert "Cleanup enableSyncDefaultUpdate flag ([#26236](https://github.com/facebook/react/pull/26236))" ([#26528](https://github.com/facebook/react/pull/26528)) //<Jan Kassens>//
- **[0700dd50b](https://github.com/facebook/react/commit/0700dd50b )**: Implement public instances for text nodes in Fabric ([#26516](https://github.com/facebook/react/pull/26516)) //<Rubén Norte>//
- **[4a1cc2ddd](https://github.com/facebook/react/commit/4a1cc2ddd )**: Fix logic around attribute seralization ([#26526](https://github.com/facebook/react/pull/26526)) //<Josh Story>//
- **[7329ea81c](https://github.com/facebook/react/commit/7329ea81c )**: Fix suspense replaying forward refs ([#26535](https://github.com/facebook/react/pull/26535)) //<Hans Otto Wirtz>//
- **[0ae348018](https://github.com/facebook/react/commit/0ae348018 )**: [Float] Suspend unstyled content for up to 1 minute ([#26532](https://github.com/facebook/react/pull/26532)) //<Andrew Clark>//
- **[888874673](https://github.com/facebook/react/commit/888874673 )**: Allow transitions to interrupt Suspensey commits ([#26531](https://github.com/facebook/react/pull/26531)) //<Andrew Clark>//
- **[09c8d2563](https://github.com/facebook/react/commit/09c8d2563 )**: Move update scheduling to microtask ([#26512](https://github.com/facebook/react/pull/26512)) //<Andrew Clark>//
- **[8310854ce](https://github.com/facebook/react/commit/8310854ce )**: Clean up enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay ([#26521](https://github.com/facebook/react/pull/26521)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions ca01f35...58742c2

jest_e2e[run_all_tests]
bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44872333

fbshipit-source-id: 0695e86645955aac7a20afdaf3ed02ad33592f5c
2023-04-13 03:07:47 -07:00
Nicola Corti acfe5e8ee2 Allow to disable the New Architecture inside RN Tester (#36895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36895

Currently RN-Tester build with the New Architecture hardcoded to true.
For testing is convenient to disable it at times so we can test how the app behaves in the old arch.

Changelog:
[Internal] [Changed] - Allow to disable the New Architecture inside RN Tester

Reviewed By: cipolleschi

Differential Revision: D44917566

fbshipit-source-id: f1e6393e37bf6702677157b9577a26f0c4da0b86
2023-04-13 02:36:03 -07:00