Commit Graph

26922 Commits

Author SHA1 Message Date
Alex Hunt
0a3c55562b Update custom "exports" conditions in Jest environment
Summary:
Updates the default set of `"exports"` condition names in our `ReactNativeEnv` for Jest, so that it aligns with the defaults in React Native CLI (https://github.com/react-native-community/cli/pull/1862).

Also includes a subtle update to how this is accomplished. Instead of overriding `exportConditions()`, we assign to the underlying class property — this allows users (once https://github.com/facebook/jest/pull/13989 is merged) to override `customExportConditions` via [`testEnvironmentOptions`](https://jestjs.io/docs/configuration#testenvironmentoptions-object).

```js
  preset: 'react-native',
  testEnvironmentOptions: {
    customExportConditions: ['test', 'react-native'],
  },
```

Changelog: [Internal]

Reviewed By: jacdebug

Differential Revision: D43879056

fbshipit-source-id: 86fffe2b5fdf9d8492d25b8b12a78be75b5fa3be
2023-03-15 17:18:08 -07:00
David Vacca
b1b6673796 Refactor usages of TextLayoutManager.sTextPaintInstance
Summary:
Refactor usages of TextLayoutManager.sTextPaintInstance

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D43888689

fbshipit-source-id: 64a198f3ca07e32666701204d94e6e75b3ab53ad
2023-03-15 16:03:39 -07:00
David Vacca
8c3cb4e6db Refactor TextLayoutManager.isRTL() method
Summary:
Quick refactor of refactor TextLayoutManager.isRTL() method to cleanup the method and remove lint warning

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D43888197

fbshipit-source-id: 779fb84527f95b3c04504eaa4302be55ab328634
2023-03-15 16:03:39 -07:00
Adam Gleitman
9ee0e1c78e Use SocketRocket for web socket library (#36471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36471

The previous native web socket API, `RCTSRWebSocket`, appears to be an older version of the one provided as part of [SocketRocket](https://github.com/facebookincubator/SocketRocket). The latter has several improvements, such as the ability to respect proxy settings, which has been requested by a user of a React Native app.

Everything translates over pretty easily, and considering that SocketRocket is already a dependency of Flipper, there doesn't seem to be much additional cost to swapping out the libraries. If we wanted to make things even slimmer, it may even be possible to make the WebSocket library be optional for release builds.

## Changelog

[IOS] [CHANGED] - Use SocketRocket for web socket library

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

Test Plan:
Validated the following:
* The WebSocket test page in RNTester
* Live reloading

Reviewed By: cortinico

Differential Revision: D43768835

Pulled By: javache

fbshipit-source-id: 11e1ac2700bc92991897c594622e6687339bfcbf
2023-03-15 13:32:59 -07:00
George Zahariev
7fee407564 Update React Native codegen to support Partial as alias of $Partial
Summary:
`Partial` is the new name of `$Partial`

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D43993220

fbshipit-source-id: 38e8a6bcfa559857b2ab88efee6b904b387bdc0d
2023-03-15 12:13:36 -07:00
Rubén Norte
06b97ca28e Back out "React Native sync for revisions fccf3a9...47cf4e5"
Summary:
There's some problem in the last sync that changes the memoization behavior in some product code. We'll revert and investigate.

Changelog: [internal]

Reviewed By: bvanderhoof

Differential Revision: D44100907

fbshipit-source-id: 233b478dd6f2f29121ac05323047ab6099b6b56c
2023-03-15 11:38:15 -07:00
Pieter De Baets
01e7ff5513 Fix incorrect hyphenation frequency in TextLayoutManagerMapBuffer
Summary: Changelog: [Android][Fixed] Fixed text measurement issue related to hyphenation frequency

Reviewed By: makovkastar

Differential Revision: D44093758

fbshipit-source-id: 71b7b6cd862586b673a49f5e6efaf9aeeb25c6e1
2023-03-15 11:35:51 -07:00
Dmitry Rykun
b07cf33279 Use RN Build Utils for Building Hermes Artifacts
Summary:
We moved Hermes some build utils from [Hermes repo](https://github.com/facebook/hermes/tree/main/utils) to [React Navtie repo](https://github.com/facebook/react-native/tree/main/sdks/hermes-engine/utils) a while ago to have more control over them. However some paths on the CI were not updated. We continued to use old build scripts for Hermes prebuilds. Some unfortunate side effects are:
- `HERMES_ENABLE_DEBUGGER` is [hardcoded to true](https://github.com/facebook/hermes/blob/main/utils/build-apple-framework.sh#L65). That makes Hermes much slower in Release configuration.
- BUILD_TYPE is [set to Release](https://github.com/facebook/hermes/blob/main/utils/build-apple-framework.sh#L10) instead of `MinSizeRel` which inreases Hermes binary size.

This diff copies these build utils from RN to Hermes source directory before we perform Hermes build.

Changelog
[Internal]

Reviewed By: cipolleschi

Differential Revision: D44066721

fbshipit-source-id: f45ad6a31fb01c10199f69cc7bbcbbc83b793d34
2023-03-15 11:13:17 -07:00
Rob Hogan
a8714075e8 Back out D43959013 - [hermes] Update the hermes packages to 0.10.0 in 'fbsource'
Summary: Changelog: [Internal]

Reviewed By: jacdebug

Differential Revision: D44085857

fbshipit-source-id: b5e0732016942595d9fa98f38524602f9e793811
2023-03-15 08:38:44 -07:00
Rubén Norte
08757962d2 Use getter instead of constant to provide access to FabricUIManager binding
Summary:
The `FabricUIManager` module was providing access to the global binding defined by Fabric, adding proper typing for it.

The problem about this module is that it only evaluated the global binding once (during module evaluation) and it cached the result. If this module happened to be loaded before the binding is defined, which can happen in apps using the legacy renderer and Fabric together, this modules caches an `undefined` value indefinitely.

This refactors the module as a getter function to make sure this lazy behavior is handled correctly in the callsites.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D44065186

fbshipit-source-id: 7c5cfe674605f03ecb8ca0dabc4c823e0013da6b
2023-03-15 08:36:40 -07:00
Rubén Norte
913732b3a4 Create feature flag for DOM trees in Fabric
Summary: Changelog: [internal]

Reviewed By: rshest

Differential Revision: D44088652

fbshipit-source-id: a289b6abbc46141943bb99d9003972eec84ba2da
2023-03-15 08:36:40 -07:00
Rubén Norte
6c208c24d5 React Native sync for revisions fccf3a9...47cf4e5
Summary:
This sync includes the following changes:
- **[47cf4e578](https://github.com/facebook/react/commit/47cf4e578 )**: Restore some guards in ReactFabricGlobalResponderHandler after refactor ([#26394](https://github.com/facebook/react/pull/26394)) //<Rubén Norte>//
- **[cfc1274e3](https://github.com/facebook/react/commit/cfc1274e3 )**: Disable IE innerHTML workaround behind a flag ([#26390](https://github.com/facebook/react/pull/26390)) //<Sebastian Markbåge>//
- **[a57f40d83](https://github.com/facebook/react/commit/a57f40d83 )**: Undo dependency injection of batching ([#26389](https://github.com/facebook/react/pull/26389)) //<Sebastian Markbåge>//
- **[d310d654a](https://github.com/facebook/react/commit/d310d654a )**: Avoid meta programming to initialize functions in module scope  ([#26388](https://github.com/facebook/react/pull/26388)) //<Sebastian Markbåge>//
- **[21aee59e4](https://github.com/facebook/react/commit/21aee59e4 )**: Delete unused DOM files ([#26387](https://github.com/facebook/react/pull/26387)) //<Sebastian Markbåge>//
- **[6bd53a5bd](https://github.com/facebook/react/commit/6bd53a5bd )**: Remove FeatureFlags fork for `react-dom/unstable_testing` ([#26383](https://github.com/facebook/react/pull/26383)) //<Sebastian Markbåge>//
- **[2788d0d8d](https://github.com/facebook/react/commit/2788d0d8d )**: Allow empty string to be passed to formAction ([#26379](https://github.com/facebook/react/pull/26379)) //<Sebastian Markbåge>//
- **[f828bad38](https://github.com/facebook/react/commit/f828bad38 )**: Extracted definition and access to public instances to a separate module in Fabric ([#26321](https://github.com/facebook/react/pull/26321)) //<Rubén Norte>//
- **[131768166](https://github.com/facebook/react/commit/131768166 )**: Support Context as renderable node ([#25641](https://github.com/facebook/react/pull/25641)) //<Andrew Clark>//
- **[d4f58c3b8](https://github.com/facebook/react/commit/d4f58c3b8 )**: Support Promise as a renderable node  ([#25634](https://github.com/facebook/react/pull/25634)) //<Andrew Clark>//
- **[633461486](https://github.com/facebook/react/commit/633461486 )**: Add disableLegacyContext test gates where needed ([#26371](https://github.com/facebook/react/pull/26371)) //<Andrew Clark>//
- **[432ffc9d0](https://github.com/facebook/react/commit/432ffc9d0 )**: Convert more Scheduler.unstable_flushAll in tests to new test utils ([#26369](https://github.com/facebook/react/pull/26369)) //<Tianyu Yao>//
- **[69fd78fe3](https://github.com/facebook/react/commit/69fd78fe3 )**: Update Float tests to check for specific errors ([#26367](https://github.com/facebook/react/pull/26367)) //<Andrew Clark>//
- **[93c10dfa6](https://github.com/facebook/react/commit/93c10dfa6 )**: flushSync: Exhaust queue even if something throws ([#26366](https://github.com/facebook/react/pull/26366)) //<Andrew Clark>//
- **[be353d251](https://github.com/facebook/react/commit/be353d251 )**: [Flight Reply] Add undefined and Iterable Support ([#26365](https://github.com/facebook/react/pull/26365)) //<Sebastian Markbåge>//
- **[ef8bdbecb](https://github.com/facebook/react/commit/ef8bdbecb )**: [Flight Reply] Add Reply Encoding ([#26360](https://github.com/facebook/react/pull/26360)) //<Sebastian Markbåge>//
- **[a8875eab7](https://github.com/facebook/react/commit/a8875eab7 )**: Update more tests to not rely on sync queuing ([#26358](https://github.com/facebook/react/pull/26358)) //<Andrew Clark>//
- **[d1ad984db](https://github.com/facebook/react/commit/d1ad984db )**: [Flight] Add support for returning `undefined` from render ([#26349](https://github.com/facebook/react/pull/26349)) //<Sebastian Silbermann>//
- **[39d4b9365](https://github.com/facebook/react/commit/39d4b9365 )**: [Internal tests] Close MessageChannel port to prevent leak ([#26357](https://github.com/facebook/react/pull/26357)) //<Andrew Clark>//
- **[3706edb81](https://github.com/facebook/react/commit/3706edb81 )**: [Float][Fizz]: Don't preload nomodule scripts ([#26353](https://github.com/facebook/react/pull/26353)) //<Josh Story>//
- **[2b003a5cc](https://github.com/facebook/react/commit/2b003a5cc )**: Split out ServerReferenceMetadata into Id and Bound Arguments ([#26351](https://github.com/facebook/react/pull/26351)) //<Sebastian Markbåge>//
- **[62cd5af08](https://github.com/facebook/react/commit/62cd5af08 )**: Codemod redundant async act scopes ([#26350](https://github.com/facebook/react/pull/26350)) //<Andrew Clark>//
- **[037378202](https://github.com/facebook/react/commit/037378202 )**: Internal `act`: Call scope function after an async gap ([#26347](https://github.com/facebook/react/pull/26347)) //<Andrew Clark>//
- **[d8e49f2af](https://github.com/facebook/react/commit/d8e49f2af )**: Use setTimeout to schedule work on the server in Edge environments ([#26348](https://github.com/facebook/react/pull/26348)) //<Sebastian Markbåge>//
- **[83643778b](https://github.com/facebook/react/commit/83643778b )**: Internal test helpers: Use Node's MessageChannel to queue task ([#26345](https://github.com/facebook/react/pull/26345)) //<Andrew Clark>//
- **[44d380794](https://github.com/facebook/react/commit/44d380794 )**: Move internalAct to internal-test-utils package ([#26344](https://github.com/facebook/react/pull/26344)) //<Andrew Clark>//
- **[d81447304](https://github.com/facebook/react/commit/d81447304 )**: [Internal API only] Delete non-awaited form of act ([#26339](https://github.com/facebook/react/pull/26339)) //<Andrew Clark>//
- **[702fc984e](https://github.com/facebook/react/commit/702fc984e )**: Codemod act -> await act (4/?) ([#26338](https://github.com/facebook/react/pull/26338)) //<Andrew Clark>//
- **[9fb2469a6](https://github.com/facebook/react/commit/9fb2469a6 )**: Restore definition of NativeMethods as an object for React Native ([#26341](https://github.com/facebook/react/pull/26341)) //<Rubén Norte>//
- **[161f6ae42](https://github.com/facebook/react/commit/161f6ae42 )**: Codemod act -> await act (3/?) ([#26336](https://github.com/facebook/react/pull/26336)) //<Andrew Clark>//
- **[58605f798](https://github.com/facebook/react/commit/58605f798 )**: Codemod act -> await act (2/?) ([#26335](https://github.com/facebook/react/pull/26335)) //<Andrew Clark>//
- **[703c67560](https://github.com/facebook/react/commit/703c67560 )**: Codemod act -> await act (1/?) ([#26334](https://github.com/facebook/react/pull/26334)) //<Andrew Clark>//
- **[b380c2485](https://github.com/facebook/react/commit/b380c2485 )**: Convert class equivlance tests to flushSync ([#26333](https://github.com/facebook/react/pull/26333)) //<Andrew Clark>//
- **[8f812e75d](https://github.com/facebook/react/commit/8f812e75d )**: Refactor ReactFabricHostComponent ([#26323](https://github.com/facebook/react/pull/26323)) //<Rubén Norte>//
- **[978fae4b4](https://github.com/facebook/react/commit/978fae4b4 )**: [Float][Fiber] implement a faster hydration match for hoistable elements ([#26154](https://github.com/facebook/react/pull/26154)) //<Josh Story>//
- **[8a9f82ed5](https://github.com/facebook/react/commit/8a9f82ed5 )**: [Float][Fizz][Fiber] - Do not hoist elements with `itemProp` & hydrate more tolerantly in hoist contexts ([#26256](https://github.com/facebook/react/pull/26256)) //<Josh Story>//
- **[3cad3a54e](https://github.com/facebook/react/commit/3cad3a54e )**: Use content hash for facebook-www builds ([#26331](https://github.com/facebook/react/pull/26331)) //<Jan Kassens>//
- **[ba353a50a](https://github.com/facebook/react/commit/ba353a50a )**: Build: make version in build artifacts match ([#26329](https://github.com/facebook/react/pull/26329)) //<Jan Kassens>//
- **[6e1756a5a](https://github.com/facebook/react/commit/6e1756a5a )**: Move suspended render logic to ensureRootIsScheduled ([#26328](https://github.com/facebook/react/pull/26328)) //<Andrew Clark>//
- **[1528c5ccd](https://github.com/facebook/react/commit/1528c5ccd )**: SchedulerMock.unstable_yieldValue -> SchedulerMock.log ([#26312](https://github.com/facebook/react/pull/26312)) //<Andrew Clark>//
- **[4bbac04cd](https://github.com/facebook/react/commit/4bbac04cd )**: Upgrade Flow to 0.201 ([#26326](https://github.com/facebook/react/pull/26326)) //<Jan Kassens>//
- **[eb616a12f](https://github.com/facebook/react/commit/eb616a12f )**: Extract duplicated methods in Fabric and the legacy renderer to a shared module ([#26319](https://github.com/facebook/react/pull/26319)) //<Rubén Norte>//
- **[49f741046](https://github.com/facebook/react/commit/49f741046 )**: Fix: Infinite act loop caused by wrong shouldYield ([#26317](https://github.com/facebook/react/pull/26317)) //<Andrew Clark>//
- **[106ea1c58](https://github.com/facebook/react/commit/106ea1c58 )**: Support Iterables in Flight ([#26313](https://github.com/facebook/react/pull/26313)) //<Sebastian Markbåge>//
- **[f905da227](https://github.com/facebook/react/commit/f905da227 )**: [Flight] Send server reference error chunks to the client ([#26293](https://github.com/facebook/react/pull/26293)) //<Hendrik Liebau>//
- **[e0241b660](https://github.com/facebook/react/commit/e0241b660 )**: Simplify Webpack References by encoding file path + export name as single id ([#26300](https://github.com/facebook/react/pull/26300)) //<Sebastian Markbåge>//
- **[25685d8a9](https://github.com/facebook/react/commit/25685d8a9 )**: Codemod tests to waitFor pattern (9/?) ([#26309](https://github.com/facebook/react/pull/26309)) //<Andrew Clark>//
- **[64dde7082](https://github.com/facebook/react/commit/64dde7082 )**: Codemod tests to waitFor pattern (8/?) ([#26308](https://github.com/facebook/react/pull/26308)) //<Andrew Clark>//
- **[3cb5afb82](https://github.com/facebook/react/commit/3cb5afb82 )**: Codemod tests to waitFor pattern (7/?) ([#26307](https://github.com/facebook/react/pull/26307)) //<Andrew Clark>//
- **[e98695db9](https://github.com/facebook/react/commit/e98695db9 )**: Codemod tests to waitFor pattern (6/?) ([#26305](https://github.com/facebook/react/pull/26305)) //<Andrew Clark>//
- **[9a52cc8bc](https://github.com/facebook/react/commit/9a52cc8bc )**: Convert ReactLazy-test to waitFor pattern ([#26304](https://github.com/facebook/react/pull/26304)) //<Andrew Clark>//
- **[03462cfc7](https://github.com/facebook/react/commit/03462cfc7 )**: [Fizz] External runtime: fix bug in processing existing elements ([#26303](https://github.com/facebook/react/pull/26303)) //<mofeiZ>//
- **[faacefb4d](https://github.com/facebook/react/commit/faacefb4d )**: Codemod tests to waitFor pattern (4/?) ([#26302](https://github.com/facebook/react/pull/26302)) //<Andrew Clark>//
- **[06460b6fb](https://github.com/facebook/react/commit/06460b6fb )**: Remove unnecessary (and incorrect) code for compatibility with Paper in the Fabric version of GlobalResponderHandler ([#26290](https://github.com/facebook/react/pull/26290)) //<Rubén Norte>//
- **[ce8a72fd4](https://github.com/facebook/react/commit/ce8a72fd4 )**: Codemod tests to waitFor pattern (2/?) ([#26296](https://github.com/facebook/react/pull/26296)) //<Andrew Clark>//
- **[1f1f8eb55](https://github.com/facebook/react/commit/1f1f8eb55 )**: [Float][Fizz][Fiber]: Refactor <style> Resource implementation to group on flush ([#26280](https://github.com/facebook/react/pull/26280)) //<Josh Story>//
- **[5c633a48f](https://github.com/facebook/react/commit/5c633a48f )**: Add back accidentally deleted test comments ([#26294](https://github.com/facebook/react/pull/26294)) //<Andrew Clark>//
- **[b72ed698f](https://github.com/facebook/react/commit/b72ed698f )**: Fixed incorrect value returned as public instance from reconciler ([#26283](https://github.com/facebook/react/pull/26283)) //<Rubén Norte>//
- **[25a8b9735](https://github.com/facebook/react/commit/25a8b9735 )**: Codemod tests to waitFor pattern (1/?) ([#26288](https://github.com/facebook/react/pull/26288)) //<Andrew Clark>//
- **[e52446733](https://github.com/facebook/react/commit/e52446733 )**: New internal testing helpers: waitFor, waitForAll, waitForPaint ([#26285](https://github.com/facebook/react/pull/26285)) //<Andrew Clark>//
- **[d49e0e0be](https://github.com/facebook/react/commit/d49e0e0be )**: Removed unused imperative events implementation from React Native renderer ([#26282](https://github.com/facebook/react/pull/26282)) //<Rubén Norte>//
- **[41110021f](https://github.com/facebook/react/commit/41110021f )**: Fix: Selective hydration causing incorrect thenable type passed to DevTools ([#26275](https://github.com/facebook/react/pull/26275)) //<Andrew Clark>//
- **[67a61d5bd](https://github.com/facebook/react/commit/67a61d5bd )**: [Flight Fixture] Show SSR Support with CSS ([#26263](https://github.com/facebook/react/pull/26263)) //<Sebastian Markbåge>//
- **[40755c01a](https://github.com/facebook/react/commit/40755c01a )**: [Flight Fixture] Proxy requests through the global server instead of directly ([#26257](https://github.com/facebook/react/pull/26257)) //<Sebastian Markbåge>//
- **[b2ae9ddb3](https://github.com/facebook/react/commit/b2ae9ddb3 )**: Cleanup enableSyncDefaultUpdate flag ([#26236](https://github.com/facebook/react/pull/26236)) //<Jan Kassens>//
- **[6ff1733e6](https://github.com/facebook/react/commit/6ff1733e6 )**: [Float][Fizz][Fiber] support type for ReactDOM.preload() options ([#26239](https://github.com/facebook/react/pull/26239)) //<Josh Story>//
- **[1173a17e6](https://github.com/facebook/react/commit/1173a17e6 )**: [Float][Fizz][Fiber] implement preconnect and prefetchDNS float methods ([#26237](https://github.com/facebook/react/pull/26237)) //<Josh Story>//
- **[a8f971b7a](https://github.com/facebook/react/commit/a8f971b7a )**: Switch to mount dispatcher after use() when needed ([#26232](https://github.com/facebook/react/pull/26232)) //<Sophie Alpert>//
- **[96cdeaf89](https://github.com/facebook/react/commit/96cdeaf89 )**: [Fizz Node] Fix null bytes written at text chunk boundaries ([#26228](https://github.com/facebook/react/pull/26228)) //<Sophie Alpert>//
- **[c04b18070](https://github.com/facebook/react/commit/c04b18070 )**: Remove eventTime field from class Update type ([#26219](https://github.com/facebook/react/pull/26219)) //<Andrew Clark>//
- **[60144a04d](https://github.com/facebook/react/commit/60144a04d )**: Split out Edge and Node implementations of the Flight Client ([#26187](https://github.com/facebook/react/pull/26187)) //<Sebastian Markbåge>//
- **[70b0bbda7](https://github.com/facebook/react/commit/70b0bbda7 )**: [fizz][external-runtime] Fix: process mutation records before disconnecting ([#26169](https://github.com/facebook/react/pull/26169)) //<mofeiZ>//
- **[c7967b194](https://github.com/facebook/react/commit/c7967b194 )**: Distribute bundles more evenly into CI shards ([#26208](https://github.com/facebook/react/pull/26208)) //<Sebastian Silbermann>//
- **[bb1e3d0e1](https://github.com/facebook/react/commit/bb1e3d0e1 )**: Fail yarn build if any bundle fails to build ([#26207](https://github.com/facebook/react/pull/26207)) //<Sebastian Silbermann>//
- **[62e6c4612](https://github.com/facebook/react/commit/62e6c4612 )**: Move Mutation/Persistence fork inline into the functions ([#26206](https://github.com/facebook/react/pull/26206)) //<Sebastian Markbåge>//
- **[80cf4a099](https://github.com/facebook/react/commit/80cf4a099 )**: Update Closure Compiler ([#26205](https://github.com/facebook/react/pull/26205)) //<Sebastian Markbåge>//
- **[6b6d0617e](https://github.com/facebook/react/commit/6b6d0617e )**: Update Rollup and related plugins to their most recent versions ([#24916](https://github.com/facebook/react/pull/24916)) //<Glenn 'devalias' Grant>//
- **[bc38a3dfa](https://github.com/facebook/react/commit/bc38a3dfa )**: Update rollup config to use moduleSideEffects ([#26199](https://github.com/facebook/react/pull/26199)) //<Ming Ye>//
- **[c9d9f524d](https://github.com/facebook/react/commit/c9d9f524d )**: Make enableCustomElementPropertySupport a dynamic flag in www build ([#26194](https://github.com/facebook/react/pull/26194)) //<Andrew Clark>//
- **[189f70e17](https://github.com/facebook/react/commit/189f70e17 )**: Create a bunch of custom webpack vs unbundled node bundles ([#26172](https://github.com/facebook/react/pull/26172)) //<Sebastian Markbåge>//
- **[fbf3bc315](https://github.com/facebook/react/commit/fbf3bc315 )**: Add `scale` as a unitless property ([#25601](https://github.com/facebook/react/pull/25601)) //<Jonny Burger>//

Changelog:
[General][Changed] - React Native sync for revisions fccf3a9...47cf4e5

jest_e2e[run_all_tests]

Reviewed By: sammy-SC

Differential Revision: D44090004

fbshipit-source-id: 6ac2d1d22a078d07ce011481063e78843bded28e
2023-03-15 07:33:16 -07:00
MaeIg
26b22a6827 Remove hardcoded language from modules/index.js (#36435)
Summary:
This PR aims to remove the hardcoded language constants to use common parser instead. It is a task of https://github.com/facebook/react-native/issues/34872:
> [Codegen 89 - Assigned to MaeIg] Remove the const language variable from flow/modules/index.js and replace its usage with parser.language()
> [Codegen 90 - Assigned to MaeIg] Remove the const language variable from typescript/modules/index.js and replace its usage with parser.language()

## 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
-->
[Internal] [Changed] - Remove hardcoded language from modules/index.js to use common parser instead

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

Test Plan:
yarn flow:
<img width="145" alt="image" src="https://user-images.githubusercontent.com/40902940/224333480-600cefd0-9dc6-4142-8e88-db20785e49e6.png">

yarn lint:
<img width="504" alt="image" src="https://user-images.githubusercontent.com/40902940/224333852-d510594f-053e-4866-8ceb-5e3e3d074bc2.png">

yarn test
<img width="383" alt="image" src="https://user-images.githubusercontent.com/40902940/224333600-8c772829-2362-4943-895d-1949a0d88918.png">

Reviewed By: cortinico

Differential Revision: D43979030

Pulled By: cipolleschi

fbshipit-source-id: 39c5b99fc628620f1831ed8c4ee531eec0e866c4
2023-03-15 07:14:26 -07:00
Tarun Chauhan
d9f2cbe455 extract Visitor to parsers primitives (#36459)
Summary:
Part of Codegen Issue https://github.com/facebook/react-native/issues/34872
> [Codegen 88] Move the Visitor.js file from parsers/flow/Visitor.js to parser-promitives.js. Copy the TSInterfaceDeclaration(node: $FlowFixMe) function and add it to the Visitor.js just copied. Remove the parsers/typescript/Visitor.js. Make sure we use the same Visitor in both parsers. (We will end up with a Visitor that is the union of the two, being able to handle both Flow and TS. In this specific case, this trade-off make sense as it allows us to remove one file, several duplicated lines for a small price.)

## 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
-->
[Internal][Changed] - Extract Visitor function to parsers primitives and remove both parsers visitor files

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

Test Plan:
```
yarn jest
yarn flow
yarn lint
yarn format-check
```

Reviewed By: cortinico

Differential Revision: D44021825

Pulled By: cipolleschi

fbshipit-source-id: ea465404830402c44081143ee0539107dc75776c
2023-03-15 07:14:26 -07:00
Tarun Chauhan
347d6f8d89 Extract throwIfMoreThanOneCodegenNativecommands error in error-utils (#36407)
Summary:
Part of Codegen Umbrella Issue: https://github.com/facebook/react-native/issues/34872
> [Codegen 99] Extract the throwIfMoreThanOneCodegenNativecommands error in the error-utils.js file and extract the error code from [Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/components/index.js#L111-L133) and [TS](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/components/index.js#L112-L114)

## 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
-->
[Internal] [Changed] - Extract throwIfMoreThanOneCodegenNativecommands error in error-utils

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

Test Plan: `yarn jest react-native-codegen`

Reviewed By: christophpurrer

Differential Revision: D43912403

Pulled By: cipolleschi

fbshipit-source-id: 1c51fc01465a1baa5f06ccea09c3342584bb82cc
2023-03-15 07:14:26 -07:00
TatianaKapos
6a395cb2d7 Change PerformanceApiExample to use ModulePathing (#36478)
Summary:
Recent integration from Windows brought in PerformanceApiExample that uses relative pathing to access react-native library. This causes us to have to override the file since our file structure is different. https://github.com/microsoft/react-native-windows/issues/11373

This PR changes the example to use module pathing instead.

## Changelog

[GENERAL] [CHANGED] - Change PerformanceApiExample to use ModulePathing

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

Test Plan: Tested and passed Windows tests

Reviewed By: rshest

Differential Revision: D44089501

Pulled By: javache

fbshipit-source-id: 99993a4f81556b4fef7c5d15af26b20df960ebf9
2023-03-15 05:47:17 -07:00
gabrieldonadel
43986e8c72 chore: Add functionTypeAnnotation to codegen Parser class (#36468)
Summary:
This PR adds a  `functionTypeAnnotation`  function to the codegen Parser class and implements it in the Flow and TypeScript parsers as requested on https://github.com/facebook/react-native/issues/34872, refactoring the `throwIfModuleTypeIsUnsupported`  function to accept a `Parser` instead of a `ParserType` and use the newly created function instead of the `if (language)` logic.

## Changelog

[Internal] [Added] - Add `functionTypeAnnotation` to codegen Parser class

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

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

![image](https://user-images.githubusercontent.com/11707729/224882017-2c31f326-047d-4c21-91e0-3396203ce1c5.png)

Reviewed By: cipolleschi

Differential Revision: D44056853

Pulled By: rshest

fbshipit-source-id: f22b9efe53df16f7916eb1a9cea8b9531f1194f5
2023-03-15 05:44:57 -07:00
Ruslan Shestopalyuk
b89358263a Use by default new Performance API implementation if available
Summary:
## Changelog:
[Internal] -

Now that Performance API implementation is getting close to the final stage, it should be safe to replace the `global.performance` instance with the corresponding new implementation. This is done *only* if the actual native implementation is present, however (otherwise the behaviour will be exactly the same as before). Currently this is the case for all VR apps, Catalyst and very soon will be the case for fb4a/ios.

Reviewed By: cipolleschi

Differential Revision: D44057951

fbshipit-source-id: 7ccff4a4930175def69ef4d8a44335fbbd4a5df4
2023-03-15 05:36:24 -07:00
Ian Childs
102e40a88d Disable Android platform for more failing tests
Reviewed By: jselbo

Differential Revision: D44022065

fbshipit-source-id: 29568cdf2703eec8fb020b79ea93873ab7807050
2023-03-15 04:08:19 -07:00
Oleksandr Melnykov
57a2508ae6 Back out "React Native sync for revisions fccf3a9...f828bad"
Summary:
Changelog:
[Internal][Fixed] - Reverting the React sync because it's causing some JS errors.

Original commit changeset: 8ac9754c5ffe

Original Phabricator Diff: D44024996

Reviewed By: kassens

Differential Revision: D44069453

fbshipit-source-id: f3985cc98fea17393df12673aa8b708c988b7e80
2023-03-14 21:28:00 -07:00
Oleksandr Melnykov
534a0499c7 Back out "Remove direct references to the global and untyped nativeFabricUIManager"
Summary:
Changelog:
[Internal][Fixed] - Reverting the React sync because it's causing some JS errors.

Original commit changeset: d8300acb5dab

Original Phabricator Diff: D44029301

Reviewed By: kassens

Differential Revision: D44069428

fbshipit-source-id: cad6a936ebffaa2672a96460ab2c171b30db2def
2023-03-14 21:28:00 -07:00
Oleksandr Melnykov
06f054c852 Back out "Create feature flag for DOM trees in Fabric"
Summary:
Changelog:
[Internal][Fixed] - Reverting the React sync because it's causing some JS errors.

Original commit changeset: 77bb1ee4faaa

Original Phabricator Diff: D43981608

Reviewed By: kassens

Differential Revision: D44069455

fbshipit-source-id: d928185e1dd7f4baf5bca1d08a21988da6fd7edc
2023-03-14 21:28:00 -07:00
Ramanpreet Nara
cbdbb47467 Refactor: Move ModuleProvider param to the end in TurboModuleBinding::install()
Summary:
For the TurboModule interop layer, we'll pass in a second ModuleProvider. We'll default that second parameter to null, when the interop layer is disabled. This change will make that easier.

Changelog: [General][Changed] - Re-organize the parameters of TurboModuleBinding::install()

Reviewed By: javache, cortinico

Differential Revision: D43993199

fbshipit-source-id: 2d339cab1f9bfe481f4b72401caa203cd7536da1
2023-03-14 21:16:22 -07:00
Ramanpreet Nara
aa28ea01d2 Refactor: Simplify signature of TurboModuleBinding::getModule
Summary:
Previously, the signature of TurboModuleBinding::getModule was

https://www.internalfb.com/code/fbsource/[839b8756fb58bf8cfa38a7d9f90b4b2b99889a37]/xplat/jsi/jsi/jsi.h?lines=111-112

**Problem:** TurboModuleBinding::getModule couldn't be called from [global.nativeModuleProxy](https://www.internalfb.com/code/fbsource/[cacaf79996c24c52fcedc90933b77dcf3411cf54]/xplat/ReactNative/venice/ReactInstance.cpp?lines=25-46) (i.e: jsi::HostObject::get), where only the prop name was available:

https://www.internalfb.com/code/fbsource/[839b8756fb58bf8cfa38a7d9f90b4b2b99889a37]/xplat/jsi/jsi/jsi.h?lines=133

## Changes
This diff simplifies the signature of TurboModuleBinding::getModule to accept only what it needs: a jsi::Runtime, and moduleName

This way, TurboModuleBinding::getModule can be called from:
- jsi::HostFunction (for [global.__turboModuleProxy](https://www.internalfb.com/code/fbsource/[cc6106d532afd3f179b586d6acb4e99edb09bb96]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=34-48))
- **new:** jsi::HostObject::get (for [global.nativeModuleProxy](https://www.internalfb.com/code/fbsource/[cacaf79996c24c52fcedc90933b77dcf3411cf54]/xplat/ReactNative/venice/ReactInstance.cpp?lines=25-46)).

Changelog: [Internal]

Reviewed By: javache, cortinico

Differential Revision: D43993198

fbshipit-source-id: e1207a129b1033f96d2753c88d372bb7eb4364f3
2023-03-14 21:16:22 -07:00
Nick Gerleman
2d41e6642e Fix types + documentation for CellRendererComponent
Summary:
CellRendererComponent can be given a more useful description, and more constrained type, to ensure it is used more correctly.

Changelog:
[General][Fixed] - Fix types + documentation for CellRendererComponent

Reviewed By: yungsters

Differential Revision: D43925572

fbshipit-source-id: 26aae6a2df989993c97709ffbf1544df7cbae036
2023-03-14 15:32:05 -07:00
Grisha Pushkov
ccbbcaab9c Fix layout width calculation in onTextLayout (#36222)
Summary:
There is a rounding issue in layout calculation when using onTextLayout method in Text component on Android.
As you can see in the example below onTextLayout returns 3 lines, but in fact text is rendered in 2 lines:

<img width="775" alt="Screenshot 2023-02-19 at 23 48 53" src="https://user-images.githubusercontent.com/8476339/220177419-de183ccd-a250-4131-ad05-907fdb791c75.png">

This happens because `(int) width` casting works like `Math.floor`, but after changing it to `Math.round` we get correct result:

<img width="775" alt="Screenshot 2023-02-19 at 23 51 11" src="https://user-images.githubusercontent.com/8476339/220177859-93474c43-ed87-4c1b-986c-2817b29b78be.png">

## Changelog

[ANDROID] [FIXED] - Fix layout width calculation in onTextLayout

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

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

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

Test Plan:
This issue can be tricky to reproduce as width calculation depends on device width. I'm attaching code that I used to reproduce it. You need to tap on the screen to run through different sentences and sooner or later you will get the one with this rounding issue.

<details>
  <summary>Code to reproduce</summary>

```js
import React, { useState, useEffect } from 'react'
import { SafeAreaView, Text, View } from 'react-native'

function App() {
  const [state, setState] = useState({
    index: 0,
    lines: [],
    sentences: [],
  })

  const onTextLayout = (event) => {
    const lines = event.nativeEvent.lines
    console.log(JSON.stringify(lines, null, 2))

    setState(state => ({ ...state, lines }))
  }

  useEffect(() => {
    fetch('https://content.duoreading.io/20-the-adventures-of-tom-sawyer/translations/english.json')
      .then(response => response.text())
      .then(response => {
        setState(state => ({ ...state, sentences: JSON.parse(response) }))
      })
  }, [])

  return (
    <SafeAreaView style={{ flex: 1, padding: 30 }}>
      <View style={{ flex: 1 }} onTouchStart={() => setState(state => ({ ...state, index: state.index + 1 }))}>
        <Text style={{ fontSize: 22 }} onTextLayout={onTextLayout}>
          {state.sentences[state.index]}
        </Text>

        {state.lines.map((line, index) => (
          <View
            key={index}
            style={{
              position: 'absolute',
              top: line.y,
              left: line.x,
              width: line.width,
              height: line.height,
              opacity: 0.3,
              backgroundColor: ['red', 'yellow', 'blue'][index % 3],
            }}>
          </View>
        ))}
      </View>
    </SafeAreaView>
  )
}

export default App
```
</details>

Reviewed By: christophpurrer

Differential Revision: D43907184

Pulled By: javache

fbshipit-source-id: faef757e77e759b5d9ea26da21c9e2b396dc9ff1
2023-03-14 12:24:02 -07:00
Pieter Vanderwerff
19cf5c9af7 Update the hermes packages to 0.10.0 in 'fbsource'
Reviewed By: yungsters

Differential Revision: D43959013

fbshipit-source-id: f785209f5dfe3e76f96525cc96f6cc399f8e7f5f
2023-03-14 12:21:15 -07:00
SheetJS
5b597b5ff9 FileReader#readAsArrayBuffer (#36332)
Summary:
Fixes a number of issues with third party libraries that use `Blob#arrayBuffer` or `FileReader#readAsArrayBuffer`, including https://github.com/facebook/react-native/issues/30769 #34402 https://github.com/facebook/react-native/issues/20091 #21209

## Changelog

[INTERNAL] [FIXED] - Implemented FileReader#readAsArrayBuffer

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

Test Plan: Added a test which fails against current release but passes after code changes.

Reviewed By: christophpurrer

Differential Revision: D43907171

Pulled By: javache

fbshipit-source-id: 73d622ec569a282b6394732b9a0dc687b447fb62
2023-03-14 11:58:11 -07:00
Riccardo Cipolleschi
58d88ec91c Mitigate issues with Sandcastle simulators
Summary:
This change updates the offline mirrors and remove the need for destinations in Sandcastle jobs, to mitigate the problem with the oss jobs we are facing.

allow-large-files

## Changelog:
[internal] - update offline mirror and don't run tests on simulators

Reviewed By: robhogan, dmytrorykun

Differential Revision: D44056468

fbshipit-source-id: c4db37a715eb1307a01a33b1917573f67ed0e2a7
2023-03-14 11:07:02 -07:00
Nick Gerleman
d595fbcc5a Allow out-of-range initialScrollIndex after first scroll
Summary:
The contract here is that `initialScrollIndex` only applies once, right after the components mount. There is other code still relying on live `initialScrollIndex`, which is allowed to become stale. E.g. after removing items.

I looked at a larger change of only ever using `initialScrollIndex` in the start, so we have a consistent value. We also ideally should fix up the logic relying on it for the scroll to top optimization.

That series of changes is more involved than I want to spend time on, so this just avoids the check once we have triggered a scroll, where the rest of the code is UT'd to be permissive if it drifts out of allowed.

Changelog:
[General][Fixed] - Allow out-of-range initialScrollIndex after first scroll

Reviewed By: yungsters

Differential Revision: D43926656

fbshipit-source-id: bd09bd9a9aa6b3b5f07209dac8652c9374a762c4
2023-03-14 09:47:56 -07:00
Nick Gerleman
d8b4737ca6 Fix duplicate [RCTConvert UIUserInterfaceStyle:]
Summary:
After https://github.com/facebook/react-native/pull/36122 we have two of these. This change consolidates the two category methods to be part of the base RCTConvert class instead.

Changelog:
[iOS][Fixed] - Fix duplicate [RCTConvert UIUserInterfaceStyle:]

Reviewed By: cipolleschi

Differential Revision: D44050929

fbshipit-source-id: dd216545e6194446c593cd693072f3959d653d7f
2023-03-14 09:30:07 -07:00
Rubén Norte
01f2936de1 Create feature flag for DOM trees in Fabric
Summary:
This adds a feature flag to enable all the new DOM traversal and layout APIs (in https://github.com/react-native-community/discussions-and-proposals/pull/607).

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D43981608

fbshipit-source-id: 77bb1ee4faaaf30cfc8bb2e493763b168702f498
2023-03-14 08:48:24 -07:00
Rubén Norte
aee7d96fcd Remove direct references to the global and untyped nativeFabricUIManager
Summary:
We shouldn't be accessing `nativeFabricUIManager` directly because it's untyped and makes it harder to mock the values.

This migrates all existing usages to the `FabricUIManager` module.

In the long term, we should refactor this global binding as a TurboModule.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D44029301

fbshipit-source-id: d8300acb5dabe4ba27c7f0242230e203c0e8c674
2023-03-14 08:48:24 -07:00
Rubén Norte
ea57c923b4 React Native sync for revisions fccf3a9...f828bad
Summary:
This sync includes the following changes:
- **[f828bad38](https://github.com/facebook/react/commit/f828bad38 )**: Extracted definition and access to public instances to a separate module in Fabric ([#26321](https://github.com/facebook/react/pull/26321)) //<Rubén Norte>//
- **[131768166](https://github.com/facebook/react/commit/131768166 )**: Support Context as renderable node ([#25641](https://github.com/facebook/react/pull/25641)) //<Andrew Clark>//
- **[d4f58c3b8](https://github.com/facebook/react/commit/d4f58c3b8 )**: Support Promise as a renderable node  ([#25634](https://github.com/facebook/react/pull/25634)) //<Andrew Clark>//
- **[633461486](https://github.com/facebook/react/commit/633461486 )**: Add disableLegacyContext test gates where needed ([#26371](https://github.com/facebook/react/pull/26371)) //<Andrew Clark>//
- **[432ffc9d0](https://github.com/facebook/react/commit/432ffc9d0 )**: Convert more Scheduler.unstable_flushAll in tests to new test utils ([#26369](https://github.com/facebook/react/pull/26369)) //<Tianyu Yao>//
- **[69fd78fe3](https://github.com/facebook/react/commit/69fd78fe3 )**: Update Float tests to check for specific errors ([#26367](https://github.com/facebook/react/pull/26367)) //<Andrew Clark>//
- **[93c10dfa6](https://github.com/facebook/react/commit/93c10dfa6 )**: flushSync: Exhaust queue even if something throws ([#26366](https://github.com/facebook/react/pull/26366)) //<Andrew Clark>//
- **[be353d251](https://github.com/facebook/react/commit/be353d251 )**: [Flight Reply] Add undefined and Iterable Support ([#26365](https://github.com/facebook/react/pull/26365)) //<Sebastian Markbåge>//
- **[ef8bdbecb](https://github.com/facebook/react/commit/ef8bdbecb )**: [Flight Reply] Add Reply Encoding ([#26360](https://github.com/facebook/react/pull/26360)) //<Sebastian Markbåge>//
- **[a8875eab7](https://github.com/facebook/react/commit/a8875eab7 )**: Update more tests to not rely on sync queuing ([#26358](https://github.com/facebook/react/pull/26358)) //<Andrew Clark>//
- **[d1ad984db](https://github.com/facebook/react/commit/d1ad984db )**: [Flight] Add support for returning `undefined` from render ([#26349](https://github.com/facebook/react/pull/26349)) //<Sebastian Silbermann>//
- **[39d4b9365](https://github.com/facebook/react/commit/39d4b9365 )**: [Internal tests] Close MessageChannel port to prevent leak ([#26357](https://github.com/facebook/react/pull/26357)) //<Andrew Clark>//
- **[3706edb81](https://github.com/facebook/react/commit/3706edb81 )**: [Float][Fizz]: Don't preload nomodule scripts ([#26353](https://github.com/facebook/react/pull/26353)) //<Josh Story>//
- **[2b003a5cc](https://github.com/facebook/react/commit/2b003a5cc )**: Split out ServerReferenceMetadata into Id and Bound Arguments ([#26351](https://github.com/facebook/react/pull/26351)) //<Sebastian Markbåge>//
- **[62cd5af08](https://github.com/facebook/react/commit/62cd5af08 )**: Codemod redundant async act scopes ([#26350](https://github.com/facebook/react/pull/26350)) //<Andrew Clark>//
- **[037378202](https://github.com/facebook/react/commit/037378202 )**: Internal `act`: Call scope function after an async gap ([#26347](https://github.com/facebook/react/pull/26347)) //<Andrew Clark>//
- **[d8e49f2af](https://github.com/facebook/react/commit/d8e49f2af )**: Use setTimeout to schedule work on the server in Edge environments ([#26348](https://github.com/facebook/react/pull/26348)) //<Sebastian Markbåge>//
- **[83643778b](https://github.com/facebook/react/commit/83643778b )**: Internal test helpers: Use Node's MessageChannel to queue task ([#26345](https://github.com/facebook/react/pull/26345)) //<Andrew Clark>//
- **[44d380794](https://github.com/facebook/react/commit/44d380794 )**: Move internalAct to internal-test-utils package ([#26344](https://github.com/facebook/react/pull/26344)) //<Andrew Clark>//
- **[d81447304](https://github.com/facebook/react/commit/d81447304 )**: [Internal API only] Delete non-awaited form of act ([#26339](https://github.com/facebook/react/pull/26339)) //<Andrew Clark>//
- **[702fc984e](https://github.com/facebook/react/commit/702fc984e )**: Codemod act -> await act (4/?) ([#26338](https://github.com/facebook/react/pull/26338)) //<Andrew Clark>//
- **[9fb2469a6](https://github.com/facebook/react/commit/9fb2469a6 )**: Restore definition of NativeMethods as an object for React Native ([#26341](https://github.com/facebook/react/pull/26341)) //<Rubén Norte>//
- **[161f6ae42](https://github.com/facebook/react/commit/161f6ae42 )**: Codemod act -> await act (3/?) ([#26336](https://github.com/facebook/react/pull/26336)) //<Andrew Clark>//
- **[58605f798](https://github.com/facebook/react/commit/58605f798 )**: Codemod act -> await act (2/?) ([#26335](https://github.com/facebook/react/pull/26335)) //<Andrew Clark>//
- **[703c67560](https://github.com/facebook/react/commit/703c67560 )**: Codemod act -> await act (1/?) ([#26334](https://github.com/facebook/react/pull/26334)) //<Andrew Clark>//
- **[b380c2485](https://github.com/facebook/react/commit/b380c2485 )**: Convert class equivlance tests to flushSync ([#26333](https://github.com/facebook/react/pull/26333)) //<Andrew Clark>//
- **[8f812e75d](https://github.com/facebook/react/commit/8f812e75d )**: Refactor ReactFabricHostComponent ([#26323](https://github.com/facebook/react/pull/26323)) //<Rubén Norte>//
- **[978fae4b4](https://github.com/facebook/react/commit/978fae4b4 )**: [Float][Fiber] implement a faster hydration match for hoistable elements ([#26154](https://github.com/facebook/react/pull/26154)) //<Josh Story>//
- **[8a9f82ed5](https://github.com/facebook/react/commit/8a9f82ed5 )**: [Float][Fizz][Fiber] - Do not hoist elements with `itemProp` & hydrate more tolerantly in hoist contexts ([#26256](https://github.com/facebook/react/pull/26256)) //<Josh Story>//
- **[3cad3a54e](https://github.com/facebook/react/commit/3cad3a54e )**: Use content hash for facebook-www builds ([#26331](https://github.com/facebook/react/pull/26331)) //<Jan Kassens>//
- **[ba353a50a](https://github.com/facebook/react/commit/ba353a50a )**: Build: make version in build artifacts match ([#26329](https://github.com/facebook/react/pull/26329)) //<Jan Kassens>//
- **[6e1756a5a](https://github.com/facebook/react/commit/6e1756a5a )**: Move suspended render logic to ensureRootIsScheduled ([#26328](https://github.com/facebook/react/pull/26328)) //<Andrew Clark>//
- **[1528c5ccd](https://github.com/facebook/react/commit/1528c5ccd )**: SchedulerMock.unstable_yieldValue -> SchedulerMock.log ([#26312](https://github.com/facebook/react/pull/26312)) //<Andrew Clark>//
- **[4bbac04cd](https://github.com/facebook/react/commit/4bbac04cd )**: Upgrade Flow to 0.201 ([#26326](https://github.com/facebook/react/pull/26326)) //<Jan Kassens>//
- **[eb616a12f](https://github.com/facebook/react/commit/eb616a12f )**: Extract duplicated methods in Fabric and the legacy renderer to a shared module ([#26319](https://github.com/facebook/react/pull/26319)) //<Rubén Norte>//
- **[49f741046](https://github.com/facebook/react/commit/49f741046 )**: Fix: Infinite act loop caused by wrong shouldYield ([#26317](https://github.com/facebook/react/pull/26317)) //<Andrew Clark>//
- **[106ea1c58](https://github.com/facebook/react/commit/106ea1c58 )**: Support Iterables in Flight ([#26313](https://github.com/facebook/react/pull/26313)) //<Sebastian Markbåge>//
- **[f905da227](https://github.com/facebook/react/commit/f905da227 )**: [Flight] Send server reference error chunks to the client ([#26293](https://github.com/facebook/react/pull/26293)) //<Hendrik Liebau>//
- **[e0241b660](https://github.com/facebook/react/commit/e0241b660 )**: Simplify Webpack References by encoding file path + export name as single id ([#26300](https://github.com/facebook/react/pull/26300)) //<Sebastian Markbåge>//
- **[25685d8a9](https://github.com/facebook/react/commit/25685d8a9 )**: Codemod tests to waitFor pattern (9/?) ([#26309](https://github.com/facebook/react/pull/26309)) //<Andrew Clark>//
- **[64dde7082](https://github.com/facebook/react/commit/64dde7082 )**: Codemod tests to waitFor pattern (8/?) ([#26308](https://github.com/facebook/react/pull/26308)) //<Andrew Clark>//
- **[3cb5afb82](https://github.com/facebook/react/commit/3cb5afb82 )**: Codemod tests to waitFor pattern (7/?) ([#26307](https://github.com/facebook/react/pull/26307)) //<Andrew Clark>//
- **[e98695db9](https://github.com/facebook/react/commit/e98695db9 )**: Codemod tests to waitFor pattern (6/?) ([#26305](https://github.com/facebook/react/pull/26305)) //<Andrew Clark>//
- **[9a52cc8bc](https://github.com/facebook/react/commit/9a52cc8bc )**: Convert ReactLazy-test to waitFor pattern ([#26304](https://github.com/facebook/react/pull/26304)) //<Andrew Clark>//
- **[03462cfc7](https://github.com/facebook/react/commit/03462cfc7 )**: [Fizz] External runtime: fix bug in processing existing elements ([#26303](https://github.com/facebook/react/pull/26303)) //<mofeiZ>//
- **[faacefb4d](https://github.com/facebook/react/commit/faacefb4d )**: Codemod tests to waitFor pattern (4/?) ([#26302](https://github.com/facebook/react/pull/26302)) //<Andrew Clark>//
- **[06460b6fb](https://github.com/facebook/react/commit/06460b6fb )**: Remove unnecessary (and incorrect) code for compatibility with Paper in the Fabric version of GlobalResponderHandler ([#26290](https://github.com/facebook/react/pull/26290)) //<Rubén Norte>//
- **[ce8a72fd4](https://github.com/facebook/react/commit/ce8a72fd4 )**: Codemod tests to waitFor pattern (2/?) ([#26296](https://github.com/facebook/react/pull/26296)) //<Andrew Clark>//
- **[1f1f8eb55](https://github.com/facebook/react/commit/1f1f8eb55 )**: [Float][Fizz][Fiber]: Refactor <style> Resource implementation to group on flush ([#26280](https://github.com/facebook/react/pull/26280)) //<Josh Story>//
- **[5c633a48f](https://github.com/facebook/react/commit/5c633a48f )**: Add back accidentally deleted test comments ([#26294](https://github.com/facebook/react/pull/26294)) //<Andrew Clark>//
- **[b72ed698f](https://github.com/facebook/react/commit/b72ed698f )**: Fixed incorrect value returned as public instance from reconciler ([#26283](https://github.com/facebook/react/pull/26283)) //<Rubén Norte>//
- **[25a8b9735](https://github.com/facebook/react/commit/25a8b9735 )**: Codemod tests to waitFor pattern (1/?) ([#26288](https://github.com/facebook/react/pull/26288)) //<Andrew Clark>//
- **[e52446733](https://github.com/facebook/react/commit/e52446733 )**: New internal testing helpers: waitFor, waitForAll, waitForPaint ([#26285](https://github.com/facebook/react/pull/26285)) //<Andrew Clark>//
- **[d49e0e0be](https://github.com/facebook/react/commit/d49e0e0be )**: Removed unused imperative events implementation from React Native renderer ([#26282](https://github.com/facebook/react/pull/26282)) //<Rubén Norte>//
- **[41110021f](https://github.com/facebook/react/commit/41110021f )**: Fix: Selective hydration causing incorrect thenable type passed to DevTools ([#26275](https://github.com/facebook/react/pull/26275)) //<Andrew Clark>//
- **[67a61d5bd](https://github.com/facebook/react/commit/67a61d5bd )**: [Flight Fixture] Show SSR Support with CSS ([#26263](https://github.com/facebook/react/pull/26263)) //<Sebastian Markbåge>//
- **[40755c01a](https://github.com/facebook/react/commit/40755c01a )**: [Flight Fixture] Proxy requests through the global server instead of directly ([#26257](https://github.com/facebook/react/pull/26257)) //<Sebastian Markbåge>//
- **[b2ae9ddb3](https://github.com/facebook/react/commit/b2ae9ddb3 )**: Cleanup enableSyncDefaultUpdate flag ([#26236](https://github.com/facebook/react/pull/26236)) //<Jan Kassens>//
- **[6ff1733e6](https://github.com/facebook/react/commit/6ff1733e6 )**: [Float][Fizz][Fiber] support type for ReactDOM.preload() options ([#26239](https://github.com/facebook/react/pull/26239)) //<Josh Story>//
- **[1173a17e6](https://github.com/facebook/react/commit/1173a17e6 )**: [Float][Fizz][Fiber] implement preconnect and prefetchDNS float methods ([#26237](https://github.com/facebook/react/pull/26237)) //<Josh Story>//
- **[a8f971b7a](https://github.com/facebook/react/commit/a8f971b7a )**: Switch to mount dispatcher after use() when needed ([#26232](https://github.com/facebook/react/pull/26232)) //<Sophie Alpert>//
- **[96cdeaf89](https://github.com/facebook/react/commit/96cdeaf89 )**: [Fizz Node] Fix null bytes written at text chunk boundaries ([#26228](https://github.com/facebook/react/pull/26228)) //<Sophie Alpert>//
- **[c04b18070](https://github.com/facebook/react/commit/c04b18070 )**: Remove eventTime field from class Update type ([#26219](https://github.com/facebook/react/pull/26219)) //<Andrew Clark>//
- **[60144a04d](https://github.com/facebook/react/commit/60144a04d )**: Split out Edge and Node implementations of the Flight Client ([#26187](https://github.com/facebook/react/pull/26187)) //<Sebastian Markbåge>//
- **[70b0bbda7](https://github.com/facebook/react/commit/70b0bbda7 )**: [fizz][external-runtime] Fix: process mutation records before disconnecting ([#26169](https://github.com/facebook/react/pull/26169)) //<mofeiZ>//
- **[c7967b194](https://github.com/facebook/react/commit/c7967b194 )**: Distribute bundles more evenly into CI shards ([#26208](https://github.com/facebook/react/pull/26208)) //<Sebastian Silbermann>//
- **[bb1e3d0e1](https://github.com/facebook/react/commit/bb1e3d0e1 )**: Fail yarn build if any bundle fails to build ([#26207](https://github.com/facebook/react/pull/26207)) //<Sebastian Silbermann>//
- **[62e6c4612](https://github.com/facebook/react/commit/62e6c4612 )**: Move Mutation/Persistence fork inline into the functions ([#26206](https://github.com/facebook/react/pull/26206)) //<Sebastian Markbåge>//
- **[80cf4a099](https://github.com/facebook/react/commit/80cf4a099 )**: Update Closure Compiler ([#26205](https://github.com/facebook/react/pull/26205)) //<Sebastian Markbåge>//
- **[6b6d0617e](https://github.com/facebook/react/commit/6b6d0617e )**: Update Rollup and related plugins to their most recent versions ([#24916](https://github.com/facebook/react/pull/24916)) //<Glenn 'devalias' Grant>//
- **[bc38a3dfa](https://github.com/facebook/react/commit/bc38a3dfa )**: Update rollup config to use moduleSideEffects ([#26199](https://github.com/facebook/react/pull/26199)) //<Ming Ye>//
- **[c9d9f524d](https://github.com/facebook/react/commit/c9d9f524d )**: Make enableCustomElementPropertySupport a dynamic flag in www build ([#26194](https://github.com/facebook/react/pull/26194)) //<Andrew Clark>//
- **[189f70e17](https://github.com/facebook/react/commit/189f70e17 )**: Create a bunch of custom webpack vs unbundled node bundles ([#26172](https://github.com/facebook/react/pull/26172)) //<Sebastian Markbåge>//
- **[fbf3bc315](https://github.com/facebook/react/commit/fbf3bc315 )**: Add `scale` as a unitless property ([#25601](https://github.com/facebook/react/pull/25601)) //<Jonny Burger>//

Changelog:
[General][Changed] - React Native sync for revisions fccf3a9...f828bad

jest_e2e[run_all_tests]

Reviewed By: robhogan, rshest

Differential Revision: D44024996

fbshipit-source-id: 8ac9754c5ffe12bd5d9c3499515c0925bd411f70
2023-03-14 08:48:24 -07:00
David Vacca
ca0d565a3c Back out "1/2 TextInput accessibilityErrorMessage (Talkback, Android)"
Summary:
This diff is reverting PR https://github.com/facebook/react-native/pull/33468

Due to an increase of java.lang.IllegalStateException caused by the PR

Original commit changeset: cd80e9a1be8f

Original Phabricator Diff: D38410635

Changelog:
[Android][Fixed] - removed logic that calls the [AccessibilityNodeInfo#setError][10] and [#setContentInvalid][13] method to display the error message in the TextInput - Revert of PR https://github.com/facebook/react-native/pull/33468

Reviewed By: NickGerleman, makovkastar

Differential Revision: D44032331

fbshipit-source-id: 732ed0cf23e4f30ae00c51dace851a3fdfe65c01
2023-03-14 05:42:06 -07:00
Riccardo Cipolleschi
21d530208f Extracting Platform Specific TM code to break dependency cycle between ReactCommon and React-Core (#36461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36461

This change breaks a dependency cycle between `ReactCommon` and `React-Core`.

`React-Core` depends on `ReactCommon` to have access to the various `TurboModule` native files.

`ReactCommon` depends on `React-Core` because the content of the `core/platform/ios` folder and the `samples` folder needs to access the `RCTBridge` and other files in Core.

To break the circular dependency, we introduced two new `podspecs`:

* `React-NativeModulesApple` for the content of `core/platform/ios`.
* `ReactCommon-Samples` for the content of the `samples` folder.

In this way, the new dependencies are linear as `React-NativeModulesApple` and `ReactCommon-Samples` depends on `React-Core` and `ReactCommon` and `React-Core` only depends on  `ReactCommon`.

While doing this, we also make sure that all the include path are aligned, to limit the amount of breaking changes.

## Changelog:
[iOS][Breaking] - Split the `ReactCommon/react/nativemodule/core/platform/ios` and `ReactCommon/react/nativemodule/samples` in two separate pods to break circular dependencies.

Reviewed By: mdvacca

Differential Revision: D44023865

fbshipit-source-id: a97569506350db5735ac5534b1592471de196cbe
2023-03-14 05:31:16 -07:00
Marco Caldera
320e51f4c4 Unify findComponentConfig return statement (#36446)
Summary:
> [Codegen 100] Create a createComponentConfig function in the parser-commons.js file. It takes the foundConfig and the commandTypeNames as parameters and returns the component config object. Extract the return statements ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/components/index.js#L115-L126) [TS](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/components/index.js#L116-L127)) and use those implementations in that function.

Part of Issue https://github.com/facebook/react-native/issues/34872

In case I should already add better typing I can update the PR while clarifying the type definitions.

## Changelog

[INTERNAL] [CHANGED] - Move the return statement of `findComponentConfig` to `parsers-commons.js` merging Flow and TS implementation.

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

Test Plan: `yarn lint && yarn run flow && yarn test react-native-codegen`

Reviewed By: cortinico

Differential Revision: D44005899

Pulled By: rshest

fbshipit-source-id: 19a4a05476156cbc2d824c9c32a7909c06a382ff
2023-03-14 05:30:39 -07:00
Ruslan Shestopalyuk
dc7941d732 Shim implementation for NativePerformance on JS side
Summary:
Changelog: [Internal]

Implements a shim for the NativePerformance TurboModule, which can be used as a mock to unit test the JS side of WebPerformance functionality (in particular, the higher level API logic of `Performance` and `PerformanceObserver` implementations in JS) without need to have the native NativePerformance implementation available (which would otherwise require running some heavy weight e2e tests).

Reviewed By: rubennorte

Differential Revision: D43985454

fbshipit-source-id: da10387c1d70cb0300c077972d3925bc2fad4f5e
2023-03-14 04:48:02 -07:00
Rubén Norte
803bb16531 Prepare for next React Native sync with new instance format (#36438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36438

This makes the `react-native` repository compatible with the next sync from react after the changes in https://github.com/facebook/react/pull/26321 land.

That PR is changing the format of the Fabric instance and we have a few instances where we assume the internal structure of that instance in the repository.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D43980374

fbshipit-source-id: 718b504ff7c5bb6088c553e0256489b04d92b653
2023-03-13 05:47:18 -07:00
Rubén Norte
4ffe69db10 Improve type definition for FabricUIManager
Summary:
This migrates FabricUIManager to Flow strict.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D43773032

fbshipit-source-id: 45484f9b710d8de92bbfa6b58ced4209afee437e
2023-03-13 05:47:18 -07:00
Riccardo Cipolleschi
348a99a7c8 Fix CircleCI removing lambda in Java (#36458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36458

Our CircleCI infra does not support lambda yet.
Over the weekend, a stack of multiple Android changes landed and one of those diff had a lambda that was not fixed. See this [workflow](https://app.circleci.com/pipelines/github/facebook/react-native/20276/workflows/e73bf98e-12e0-47e3-8bff-a42f6c40798e/jobs/474761).

After the lambda was fixed, another issue related to the `reactApplicationContext` being accessed from an inner class without being `final` [occurred](https://app.circleci.com/pipelines/github/facebook/react-native/20286/workflows/70dab2f0-ee71-4510-8611-c5d29ea4cfae/jobs/475379).

This change should fix these problems.

## Changelog
[Android][Fixed] - Make CircleCI green

Reviewed By: cortinico

Differential Revision: D44019871

fbshipit-source-id: 1a6e39446b0ba2f5a395f54b58a70b67590ee154
2023-03-13 04:59:22 -07:00
Ramanpreet Nara
cfa03db98b Refactor: In JavaTurboModule, use jobject to hold module object
Summary:
## Rationale
JavaTurboModule holds the module object as a JTurboModule. With the TurboModule inteorp layer, JavaTurboModule will also need to hold NativeModule objects.

## Changes
So, this diff makes JavaTurboModule hold the module object as a jobject instead.

This shouldn't impact method dispatch, because method dispatch doesn't rely on the JTurboModule interface.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D43918939

fbshipit-source-id: 7cc43dfe2df7571e39bcf4d6f362dde0e500e2fe
2023-03-11 16:59:39 -08:00
Ramanpreet Nara
43ef2ffe78 Refactor: Move HostFunction management logic to TurboModule::get()
Summary:
## Rationale
Better separation of concerns. Less confusion. All the logic around TurboModule HostFunction management is in TurboModule::get(). And TurboModule::createHostFunction() is only responsible for creating the HostFunction. Also, there aren't two TurboModule::get functions, each with different/unclear responsibilities.

## Motivation
The interop layer (i.e: D43918998) will have to override TurboModule::createHostFunction():
- TurboModule::createHostFunction() relies on static functions for method dispatch.
- The interop layer cannot use static functions for method dispatch: interop modules' methods are only be discoverable at runtime.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D43918940

fbshipit-source-id: f2ffd210329a10967e9b2f0c925f4990cb470083
2023-03-11 16:59:39 -08:00
Ramanpreet Nara
cb18bf8c09 Refactor: Make getOrCreateModule() return NativeModule
Summary:
TurboModuleManager.getOrCreateModule() is responsible for creating TurboModules.

In the future, we'll need this method to create interop NativeModules (i.e: NativeModules that don't implement TurboModule). So, this diff changes the implementation of the method to create NativeModule objects.

In the future, we'll extend the TurboModule create algorithm to create legacy NativeModules, by integrating with TurboModuleManager.getLegacyModule(): D43751055

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D43801536

fbshipit-source-id: d86ef915248d40bea56c6103796a37dd7fb5992a
2023-03-11 16:59:39 -08:00
Ramanpreet Nara
6b42b86620 Refactor: Rename TurboModule create method to getOrCreateModule()
Summary:
Readability.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D43801530

fbshipit-source-id: c33ac91af4614804c5b6566776a1650d4f7855f4
2023-03-11 16:59:39 -08:00
Ramanpreet Nara
c1c17e299e Refactor: Make ModuleHolder hold NativeModules vs TurboModules
Summary:
We'll re-use the ModuleHolder inside TurboModuleManager to cache legacy NativeModules (i.e: NativeModules that don't implement TurboModule).

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D43801533

fbshipit-source-id: 160c6be06fe148595de89770ed78f51248fcda37
2023-03-11 16:59:39 -08:00
Ramanpreet Nara
c338ae64e7 Refactor: Rename TurboModuleProvider -> ModuleProvider<T>
Summary:
In the future, we'll re-use this interface to create NativeModule objects as well.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D43801529

fbshipit-source-id: 90376086744dc996274663792289e3eba7be56c1
2023-03-11 16:59:39 -08:00
Ramanpreet Nara
1b73d1142c Refactor: Rename mTurboModuleCleanupStarted -> mModuleCleanupStarted
Summary:
- Right now, in the TurboModuleManager, "module" refers to TurboModules.
- In the future, we'll use this cleanup lock for interop modules as well (i.e: NativeModules that don't conform to TurboModule).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D43801535

fbshipit-source-id: cecccf8d0005ef11bb0c864515fd284292582e64
2023-03-11 16:59:39 -08:00
Ramanpreet Nara
842800f83c Refactor: Rename mTurboModuleCleanupLock to mModuleCleanupLock
Summary:
- Right now, in the TurboModuleManager, "module" refers to TurboModules.
- In the future, we'll use this cleanup lock for interop modules as well (i.e: NativeModules that don't conform to TurboModule).

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D43801534

fbshipit-source-id: 1ece9faa1ed564b7024098406deaa60b8a904478
2023-03-11 16:59:39 -08:00
Ramanpreet Nara
b6b28d084d Refactor: Rename TurboModuleHolder -> ModuleHolder
Summary:
- Right now, in the TurboModuleManager, "module" refers to TurboModules.
- In the future, we'll use this cleanup lock for interop modules as well (i.e: NativeModules that don't conform to TurboModule).

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D43784169

fbshipit-source-id: dca227374e8d7de319f4fd5556d200ba8b9ac77c
2023-03-11 16:59:39 -08:00