Commit Graph

12270 Commits

Author SHA1 Message Date
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
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
David Vacca 9f24df015d Cache Spannables during rendering of Text (#36885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36885

Create cache to hold Spannables during measurment and rendering of Text

We used to have a similar cache in the past, it was removed because it seemed not have an implact.
We are incorporating this again to measure while rendering 1000s of text components

changelog: [internal] internal

Reviewed By: cipolleschi

Differential Revision: D44918981

fbshipit-source-id: 581d22978841e1b62a1709da0fec2baba6c59cea
2023-04-12 15:51:01 -07:00
Moti Zilberman b66ab690fe Implement caching in __loadBundleAsync (#36809)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36809

Changelog: [General][Added] [2/n] Support lazy bundling in development

Implements caching in `__loadBundleAsync` in line with https://github.com/react-native-community/discussions-and-proposals/pull/628.

Reviewed By: jacdebug

Differential Revision: D44630077

fbshipit-source-id: f1a19217f54493e5cf0c8bba910a6a6e14c10c03
2023-04-12 14:21:48 -07:00
Moti Zilberman 799b0f4be8 Inject __loadBundleAsync global in development (#36808)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36808

Changelog: [General][Added] [1/n] Support lazy bundling in development

Implements part of the [lazy bundling RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0605-lazy-bundling.md#__loadbundleasync-in-react-native):

> In development builds, React Native will provide an implementation of `__loadBundleAsync` that fetches a bundle URL from the currently connected Metro server, integrates with Fast Refresh and LogBox, and provides feedback to the developer on the progress of loading a bundle.

NOTE: This implementation of `__loadBundleAsync` is currently unused in OSS, pending a handful of changes to Metro and React Native that have not landed yet. The plan is to land everything in time for React Native 0.73.

Reviewed By: robhogan

Differential Revision: D43600052

fbshipit-source-id: 9342d5894eaf4b90b30598148bd55b0c956a8b08
2023-04-12 14:21:48 -07:00
Christoph Purrer 846ec6dd25 Remove reference to non existing butter/mutex.h (#36879)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36879

Changelog: [Internal]

Removed in https://github.com/facebook/react-native/commit/e665a0f9952a7852c5506bf334452f8156991ad2

Reviewed By: sammy-SC

Differential Revision: D44901760

fbshipit-source-id: a2a037649d3eb24684d5ff691ae563a28d3f5398
2023-04-12 10:26:08 -07:00
Rubén Norte 4fdad9e765 Use FB-specific renderers when running tests in Meta infra (#36877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36877

This diffs allows having Meta-specific tests and modules that are only used when running tests in Meta's infra. Meta-specific modules aren't synced to Github, so the OSS versions will be used when running tests on Github.

This is needed because we recently some files from React to React Native, including a test that now uses the `ReactFabric` module to test the behavior of public instances in React Native. This module is always using the OSS version of the renderer, but at Meta we have a custom version that's being ignored in tests.

Changelog: [internal]

Reviewed By: cortinico

Differential Revision: D44874631

fbshipit-source-id: e3112041f134240601495a28ba643bce45d802fb
2023-04-12 05:17:01 -07:00
Yurii Nakonechnyi 6f4bfdd3d6 Minor formatting: added space in YGNodeMarkDirty assert message (#1243)
Summary:
Currently `YGNodeMarkDirty()` assert message displayed **without** space between 2 lines:
```
"Only leaf nodes with custom measure functionsshould manually mark themselves as dirty"
                                     ^^^^^^^^^^^^^^^
```
This minor PR fixes it :)

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

Reviewed By: jacdebug

Differential Revision: D44870410

Pulled By: javache

fbshipit-source-id: 58db50106e8e2980ec84c99976f569b94b739d9b
2023-04-11 08:28:00 -07:00
Rubén Norte 6eebc99742 React Native sync for revisions 77ba161...ca01f35
Summary:
This sync includes the following changes:
- **[ca01f359b](https://github.com/facebook/react/commit/ca01f359b )**: Remove skipUnmountedBoundaries ([#26489](https://github.com/facebook/react/pull/26489)) //<Ricky>//
- **[43a70a610](https://github.com/facebook/react/commit/43a70a610 )**: Limit the meaning of "custom element" to not include `is` ([#26524](https://github.com/facebook/react/pull/26524)) //<Sebastian Markbåge>//
- **[1308e49a6](https://github.com/facebook/react/commit/1308e49a6 )**: [Flight Plugin] Scan for "use client" ([#26474](https://github.com/facebook/react/pull/26474)) //<dan>//
- **[1a1d61fed](https://github.com/facebook/react/commit/1a1d61fed )**: Warn for ARIA typos on custom elements ([#26523](https://github.com/facebook/react/pull/26523)) //<Sebastian Markbåge>//
- **[73deff0d5](https://github.com/facebook/react/commit/73deff0d5 )**: Refactor DOMProperty and CSSProperty ([#26513](https://github.com/facebook/react/pull/26513)) //<Sebastian Markbåge>//
- **[2d51251e6](https://github.com/facebook/react/commit/2d51251e6 )**: Clean up deferRenderPhaseUpdateToNextBatch ([#26511](https://github.com/facebook/react/pull/26511)) //<Andrew Clark>//
- **[0ffc7f632](https://github.com/facebook/react/commit/0ffc7f632 )**: Update useMemoCache test to confirm that cache persists across errors ([#26510](https://github.com/facebook/react/pull/26510)) //<Joseph Savona>//
- **[29a3be78b](https://github.com/facebook/react/commit/29a3be78b )**: Move ReactDOMFloat to react-dom/src/ ([#26514](https://github.com/facebook/react/pull/26514)) //<Sebastian Markbåge>//
- **[4c2fc0190](https://github.com/facebook/react/commit/4c2fc0190 )**: Generate safe javascript url instead of throwing with disableJavaScriptURLs is on ([#26507](https://github.com/facebook/react/pull/26507)) //<Sebastian Markbåge>//
- **[f0aafa1a7](https://github.com/facebook/react/commit/f0aafa1a7 )**: Convert a few more tests to waitFor test helpers ([#26509](https://github.com/facebook/react/pull/26509)) //<Andrew Clark>//
- **[90995ef8b](https://github.com/facebook/react/commit/90995ef8b )**: Delete "triangle" resuming fuzz tester ([#26508](https://github.com/facebook/react/pull/26508)) //<Andrew Clark>//
- **[f118b7ceb](https://github.com/facebook/react/commit/f118b7ceb )**: [Flight] Gated test for dropped transport of undefined object values ([#26478](https://github.com/facebook/react/pull/26478)) //<Sebastian Silbermann>//
- **[fd0511c72](https://github.com/facebook/react/commit/fd0511c72 )**: [Flight] Add support BigInt support ([#26479](https://github.com/facebook/react/pull/26479)) //<Sebastian Silbermann>//
- **[85de6fde5](https://github.com/facebook/react/commit/85de6fde5 )**: Refactor DOM special cases per tags including controlled fields ([#26501](https://github.com/facebook/react/pull/26501)) //<Sebastian Markbåge>//
- **[1f5cdf8c7](https://github.com/facebook/react/commit/1f5cdf8c7 )**: Update Suspense fuzz tests to use `act` ([#26498](https://github.com/facebook/react/pull/26498)) //<Andrew Clark>//
- **[f62cb39ee](https://github.com/facebook/react/commit/f62cb39ee )**: Make disableSchedulerTimeoutInWorkLoop a static ff ([#26497](https://github.com/facebook/react/pull/26497)) //<Ricky>//
- **[41b4714f1](https://github.com/facebook/react/commit/41b4714f1 )**: Remove disableNativeComponentFrames ([#26490](https://github.com/facebook/react/pull/26490)) //<Ricky>//
- **[fc90eb636](https://github.com/facebook/react/commit/fc90eb636 )**: Codemod more tests to waitFor pattern ([#26494](https://github.com/facebook/react/pull/26494)) //<Andrew Clark>//
- **[e0bbc2662](https://github.com/facebook/react/commit/e0bbc2662 )**: Improve tests that deal with microtasks ([#26493](https://github.com/facebook/react/pull/26493)) //<Andrew Clark>//
- **[8faf75193](https://github.com/facebook/react/commit/8faf75193 )**: Codemod some expiration tests to waitForExpired ([#26491](https://github.com/facebook/react/pull/26491)) //<Andrew Clark>//
- **[8342a0992](https://github.com/facebook/react/commit/8342a0992 )**: Remove unused feature flag disableSchedulerTimeoutBasedOnReactExpirationTime ([#26488](https://github.com/facebook/react/pull/26488)) //<Jan Kassens>//
- **[afea1d0c5](https://github.com/facebook/react/commit/afea1d0c5 )**: [flow] make Flow suppressions explicit on the error ([#26487](https://github.com/facebook/react/pull/26487)) //<Jan Kassens>//
- **[768f965de](https://github.com/facebook/react/commit/768f965de )**: Suspensily committing a prerendered tree ([#26434](https://github.com/facebook/react/pull/26434)) //<Andrew Clark>//
- **[d12bdcda6](https://github.com/facebook/react/commit/d12bdcda6 )**: Fix Flow types of useEffectEvent ([#26468](https://github.com/facebook/react/pull/26468)) //<Sebastian Silbermann>//
- **[73b6435ca](https://github.com/facebook/react/commit/73b6435ca )**: [Float][Fiber] Implement waitForCommitToBeReady for stylesheet resources ([#26450](https://github.com/facebook/react/pull/26450)) //<Josh Story>//
- **[175962c10](https://github.com/facebook/react/commit/175962c10 )**: Fix remaining CommonJS imports after Rollup upgrade ([#26473](https://github.com/facebook/react/pull/26473)) //<dan>//
- **[909c6dacf](https://github.com/facebook/react/commit/909c6dacf )**: Update Rollup to 3.x ([#26442](https://github.com/facebook/react/pull/26442)) //<Mark Erikson>//
- **[9c54b29b4](https://github.com/facebook/react/commit/9c54b29b4 )**: Remove ReactFabricPublicInstance and used definition from ReactNativePrivateInterface ([#26437](https://github.com/facebook/react/pull/26437)) //<Rubén Norte>//
- **[f77099b6f](https://github.com/facebook/react/commit/f77099b6f )**: Remove layout effect warning on the server ([#26395](https://github.com/facebook/react/pull/26395)) //<Ricky>//
- **[51a7c45f8](https://github.com/facebook/react/commit/51a7c45f8 )**: Bugfix: SuspenseList incorrectly forces a fallback ([#26453](https://github.com/facebook/react/pull/26453)) //<Andrew Clark>//
- **[afb3d51dc](https://github.com/facebook/react/commit/afb3d51dc )**: Fix enableClientRenderFallbackOnTextMismatch flag ([#26457](https://github.com/facebook/react/pull/26457)) //<Sebastian Markbåge>//
- **[8e17bfd14](https://github.com/facebook/react/commit/8e17bfd14 )**: Make InternalInstanceHandle type opaque in ReactNativeTypes ([#26461](https://github.com/facebook/react/pull/26461)) //<Rubén Norte>//
- **[b93b4f074](https://github.com/facebook/react/commit/b93b4f074 )**: Should not throw for children of iframe or object ([#26458](https://github.com/facebook/react/pull/26458)) //<Sebastian Markbåge>//
- **[c0b34bc5f](https://github.com/facebook/react/commit/c0b34bc5f )**: chore: update links of docs and api ([#26455](https://github.com/facebook/react/pull/26455)) //<Leedom>//
- **[ffb6733ee](https://github.com/facebook/react/commit/ffb6733ee )**: fix docs link for useSyncExternalStore ([#26452](https://github.com/facebook/react/pull/26452)) //<Valor(华洛)>//
- **[12a1d140e](https://github.com/facebook/react/commit/12a1d140e )**: Don't prerender siblings of suspended component  ([#26380](https://github.com/facebook/react/pull/26380)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 77ba161...ca01f35

jest_e2e[run_all_tests]

bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44669450

fbshipit-source-id: f160aad4719a00df3ceeca78d5f3fcd0aa0f8437
2023-04-11 04:50:05 -07:00
Kevin Gozali 511bf4f3e9 Buck: renamed rn_library() kwarg: native_module_android_package_name -> android_package_name (#36867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36867

This will make it consistent with rn_codegen() kwargs, and because android_package_name is not just limited to native_module's

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D44857744

fbshipit-source-id: 37a8a69b443ffc8bfbaa145b0f21270a0f3515d4
2023-04-11 02:48:42 -07:00
Vincent Riemer 71506cefbf Add basic emitting of click event (#36616)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36616

Changelog: [iOS][Internal] - Add basic emitting of click event

This diff adds the basic implementation of click event emitting, particularlly focused on ensuring clicks are only fired if the pointer interaction ends within the same tree "branch" of elements as which it started.

Reviewed By: yungsters

Differential Revision: D44148427

fbshipit-source-id: 9e91c32fe0e1ca8a5c50e72cd819625294e070f4
2023-04-10 13:08:03 -07:00
Christoph Purrer a6690bfb7b Share between mobile and desktop (#36852)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36852

Changelog:
[Internal]

Reviewed By: shwanton

Differential Revision: D44796009

fbshipit-source-id: 614dd3c2bb002b068b0cd51f546d30d010768bda
2023-04-07 14:47:30 -07:00
Christoph Purrer 95dabeb53c code-gen: Enable opt-in to mobile dependencies when building for Apple Catalyst (#36851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36851

Changelog:
[Internal]

Differential Revision: D44795138

fbshipit-source-id: 4d667531a50d41b8da8146be3c0a9b8854eb6bd1
2023-04-07 12:46:03 -07:00
Shawn Dempsey 247a913af0 Refactor react native codegen to export macOS specific deps (#36805)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36805

**Changelog:** Export macOS specific dependencies for react-native-codgen

[Internal][Changed] - RN macOS uses an older version of React Native (0.68) so we need to specify macOS specific dependencies when running codegen for RN Desktop

Reviewed By: christophpurrer

Differential Revision: D44687704

fbshipit-source-id: 9dcabc88d4abf17845db0844c952f1cb4a13e3ad
2023-04-06 17:37:53 -07:00
Alex Danoff a27270f492 W3CPointerEvents: use description to indicate HW requirements for tests (#36840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36840

Changelog: [Internal] - W3CPointerEvents: use description to indicate HW requirements for tests

As title. This lets users/testers know whether additional hardware is required to run each test and can give info on the test status (e.g. whether it's expected to fail). Tests with no description should be assumed to work without any special requirements.

Reviewed By: vincentriemer

Differential Revision: D44687709

fbshipit-source-id: 6a23344c4cce6917f3cf5cd3ada0c75b813b5abe
2023-04-06 13:06:10 -07:00
Riccardo Cipolleschi 610b14e4f3 Move min ios version to 13.4 for OSS (#36795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36795

This change bump the min iOS version for React Native to 13.4, to align with company guidelines.

## Changelog:
[iOS][Changed] - Moved the min iOS version to 13.4

Reviewed By: cortinico

Differential Revision: D44634663

fbshipit-source-id: 035e8fcbb395f7394f8253e3ec485ad9937531c2
2023-04-06 12:07:26 -07:00
Gijs Weterings 03e78010ae add customizeStack hook (#36819)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36819

X-link: https://github.com/facebook/metro/pull/964

This diff creates a new hook to the Metro symbolicator. `customizeStack` aims to provide a whole stack modification hook on the output of the `/symbolicate` endpoint.

The purpose of this hook is to be able to apply callsite-based modifications to the stack trace. One such example is user-facing frame skipping APIs like FBLogger internally.

Consider the following API:

```
  FBLogger('my_project')
    .blameToPreviousFile()
    .mustfix(
      'This error should refer to the callsite of this method',
    );
```

In this particular case, we'd want to skip all frames from the top that come from the same source file. To do that, we need knowledge of the entire symbolicated stack, neither a hook before symbolication nor an implementation in `symbolicator.customizeFrame` are sufficient to be able to apply this logic.

This diff creates the new hook, which allows for mutations of the entire symbolicated stack via a `symbolicator.customizeStack` hook. The default implementation of this simply returns the same stack, but it can be wrapped similar to `symbolicator.customizeFrame`.

To actually have information for this hook to act on, I've created the possibility to send additional data to the metro `/symbolicate` endpoint via an `extraData` object. This mirrors the `extraData` from https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/NativeExceptionsManager.js#L33, and I've wired up LogBox to send that object along with the symbolicate call.

Changelog:
[General][Added] - Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level.

Reviewed By: motiz88

Differential Revision: D44257733

fbshipit-source-id: 05cd57f5917a1e97b0520e772692ce64029fbf8a
2023-04-06 11:43:23 -07:00
Gijs Weterings ad46bc6d77 Remove DevServerHelper.symbolicateStackTrace and DevServerHelper.openStackFrameCall. (#36652)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36652

I can't find any usecases for them, and JavaScript stack symbolication during development should probably just exclusively be done from the JS environment.

Changelog:
[Android][Removed] - Deleted obsolete native methods DevServerHelper.symbolicateStackTrace and DevServerHelper.openStackFrameCall

Reviewed By: motiz88

Differential Revision: D44257731

fbshipit-source-id: d090ecf413526c31d5fb028507d22fc7992e74b7
2023-04-06 11:43:23 -07:00
Ruslan Shestopalyuk 6bcf904f77 Fix for potential breakage due to incompatibility between binary and JS code in NativePerformanceObserver (#36841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36841

## Changelog:
[Internal] -

A follow-up to D44712550, which did not take into account that there may be incompatibility between app's binary and JS code.

Note that this is for VR apps only, as other platforms don't (yet) use the module in question (WebPerformance).

Reviewed By: javache

Differential Revision: D44751928

fbshipit-source-id: 6a029f5725dd45abded7dda3325debe864f29ca0
2023-04-06 11:38:06 -07:00
Ruslan Shestopalyuk 3506c8d740 Ability to always log certain performance entry types (#36820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36820

## Changelog:
[Internal] -

A follow-up to the D44584166 (which was abandoned, but this change makes sense nevertheless).

This allows to selectively enable logging of certain event types regardless of whether they are observed or not. For now it's marks and measures, but potentially it may be also e.g. navigation/resource entries.

Also expands unit tests for the JS side of the `Performance` API correspondingly.

Note that "always logged" and "observed" have different semantics. An "always logged" entry won't be sent back from native to JS, unless either:
* explicitly requested via `Performance.getEntries*`
* actually observed via `PerformanceObserver`

Reviewed By: rubennorte

Differential Revision: D44712550

fbshipit-source-id: 7fc891b09bd00fa9b510d1dc059cf908d5caea07
2023-04-06 08:08:07 -07:00
Nicola Corti f874a7e7d3 Update react-native-xcode.sh to do not point users towards our issue … (#36837)
Summary:
Pointing users towards our issue tracker is not really effective as the underlying issue is a misconfiguration of their environment. I'm tweaking this error message.

## Changelog:

[INTERNAL] - Update react-native-xcode.sh to do not point users towards our issue …

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

Test Plan: n/a just a string change

Reviewed By: cipolleschi

Differential Revision: D44748094

Pulled By: cortinico

fbshipit-source-id: 6d960268eb7324b86ff5e4d3d5ddf4bbe67c2349
2023-04-06 07:37:13 -07:00
Vincent Viego 49f1237526 Rename FabricMountItem.* to MountItem.* (#36722)
Summary:
Changelog: [Android] [Breaking] - Renamed FabricMountItem.* files to MountItem.* to better match the name of the struct.

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

Reviewed By: cortinico, cipolleschi

Differential Revision: D44540079

fbshipit-source-id: 79d8aa7c6f6b908be52009c51c4ea2f601f788fd
2023-04-06 05:03:22 -07:00
Genki Kondo 08588538fe Introduce RCTObjectAnimatedNode (#36804)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36804

AnimatedObject is a more generic version of AnimatedTransform, able to handle animated values within arrays and objects. This is useful for props of native components that may need to be animated per field.

This diff adds the native (iOS) counterpart to AnimatedObject node in JS. The node handles array and map value types.

Changelog:
[Internal][Added] - Introduce ObjectAnimatedNode iOS-side node for handling array and object prop values

Reviewed By: philIip

Differential Revision: D44678162

fbshipit-source-id: 7cdc075229a55fcb450f23ba5667b3ddd48c24df
2023-04-05 16:22:44 -07:00
Vincent Riemer 54a6922bdc Add plumbing/boilerplate for an iOS implementation of the click event (#36615)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36615

Changelog: [Internal] - Add plumbing/boilerplate for an iOS implementation of the `click` event

This diff simply adds the boilerplate necessary to hook up a click event to the fabric iOS touch handler. This diff does not contain any actual implementation of the click's behavior as that will occur in future diffs.

Reviewed By: necolas

Differential Revision: D43129366

fbshipit-source-id: 71488b893c789d21c833533471745275062c0730
2023-04-05 15:00:05 -07:00
Zihan Chen (MSFT) 9bb71650c9 Add @react-native/codegen-typescript-test to verify .d.ts files in @react-native/codegen (1) (#36562)
Summary:
- Add a typescript project to test `CodegenSchema.d.ts`. More tests for other .d.ts files will be added in future pull requests.
- The build script scans all snapshots from `react-native/codegen`'s typescript frontend and generates .ts files for each snapshot, but they are .gitignore-ed.
- `npm run build` will build these .ts files against `CodegenSchema.d.ts` after generating them.
- A failed jest case is included to ensure CI catch it, it will be removed before merged.

bypass-github-export-checks

## Changelog:

[General] [Added] - Add react-native/codegen-typescript-test to verify .d.ts files in react-native/codegen (1)

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

Test Plan:
`npm run build` in `packages/react-native-codegen-typescript-test` and see all test files appear in `__generated__`.

## Screenshot

![Untitled](https://user-images.githubusercontent.com/53799235/226757755-cab4cb29-7d22-46a1-9ecb-d6732122ed38.png)

Reviewed By: rshest

Differential Revision: D44292277

Pulled By: cipolleschi

fbshipit-source-id: 8d79fe913f9563d64c92aae7c4f4e97a24ae9a21
2023-04-05 07:38:25 -07:00
Genki Kondo a248456d18 Introduce ObjectAnimatedNode (#36742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36742

AnimatedObject is a more generic version of AnimatedTransform, able to handle animated values within arrays and objects. This is useful for props of native components that may need to be animated per field.

This diff adds the native (Android) counterpart to AnimatedObject node in JS. The node handles array and map value types.

Changelog:
[Internal][Added] - Introduce ObjectAnimatedNode Java-side node for handling array and object prop values

Reviewed By: mdvacca

Differential Revision: D44466563

fbshipit-source-id: bd026cbd921ec51ae17eab08417708f3272c0418
2023-04-05 07:27:38 -07:00