Commit Graph

38536 Commits

Author SHA1 Message Date
Moti Zilberman 6dcdb93ec0 Remove DevSplitBundleLoader
Summary:
Changelog: [General][Removed] Remove internal DevSplitBundleLoader native module

`DevSplitBundleLoader` was part of an experimental bundling strategy that offloaded Hermes bytecode compilation to the packager server. The React Native parts of this experiment were never part of the public API, and the Metro parts never fully shipped in open source.

As part of implementing the simpler and more general [lazy bundling RFC](https://github.com/react-native-community/discussions-and-proposals/pull/605), we are removing `DevSplitBundleLoader` and associated code from React Native's internals.

Reviewed By: robhogan

Differential Revision: D43597007

fbshipit-source-id: 1460e9045cd7a0f5ef43144b10afb932172e223c
2023-03-21 09:52:50 -07:00
Shivam Shashank fdb2af5bf1 Support to enable/disable Fabric in ReactFragment (#36263)
Summary:
New Architecture Support missing in React Native Fragment, added same.

Changelog:
[Android] [Added] - Support to enable/disable Fabric in ReactFragment

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

Test Plan:
<details>
  <summary>Kotlin Code Snippet to test:</summary>
  <p>

```kotlin
supportFragmentManager
  .beginTransaction()
  .add(android.R.id.content,
     ReactFragment.Builder()
       .setComponentName("componentName")
       .setFabricEnabled(true)
       .build())
  .commit()
```

  </p>
</details>

Reviewed By: mdvacca

Differential Revision: D43701078

Pulled By: cortinico

fbshipit-source-id: 659ed2b4cf6619c6d64b803a198a93ff84b574fe
2023-03-21 06:30:55 -07:00
Rubén Norte d136c088ae React Native sync for revisions fccf3a9...3554c88
Summary:
This sync includes the following changes:
- **[3554c8852](https://github.com/facebook/react/commit/3554c8852 )**: Clean interface for public instances between React and React Native ([#26416](https://github.com/facebook/react/pull/26416)) //<Rubén Norte>//
- **[db281b3d9](https://github.com/facebook/react/commit/db281b3d9 )**: Feature: Suspend commit without blocking render ([#26398](https://github.com/facebook/react/pull/26398)) //<Andrew Clark>//
- **[55308554e](https://github.com/facebook/react/commit/55308554e )**: [www] enable enableFilterEmptyStringAttributesDOM flag ([#26410](https://github.com/facebook/react/pull/26410)) //<Jan Kassens>//
- **[163d86e19](https://github.com/facebook/react/commit/163d86e19 )**: Updated comment message ([#26158](https://github.com/facebook/react/pull/26158)) //<Ibrahim Amin>//
- **[108aed083](https://github.com/facebook/react/commit/108aed083 )**: Fix use of stale props in Fabric events ([#26408](https://github.com/facebook/react/pull/26408)) //<Rubén Norte>//
- **[8fa41ffa2](https://github.com/facebook/react/commit/8fa41ffa2 )**: Don't "fix up" mismatched text content with suppressedHydrationWarning ([#26391](https://github.com/facebook/react/pull/26391)) //<Sebastian Markbåge>//
- **[05777ffb0](https://github.com/facebook/react/commit/05777ffb0 )**: Setting transition pending flag shouldn't be part of a surrounding transition ([#26243](https://github.com/facebook/react/pull/26243)) //<Sophie Alpert>//
- **[99aa082be](https://github.com/facebook/react/commit/99aa082be )**: Remove unstable_flushControlled ([#26397](https://github.com/facebook/react/pull/26397)) //<Jan Kassens>//
- **[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...3554c88

jest_e2e[run_all_tests]
bypass-github-export-checks

@public

Fixes tests for current React version.

Reviewed By: sammy-SC

Differential Revision: D44216371

fbshipit-source-id: a569c9aeaf2d96d150219e148f06dcde9ba6f7cd
2023-03-21 06:13:42 -07:00
Rubén Norte 70a5d6fcd7 Prepare for next React Native sync with new instance format (v2)
Summary:
We made some changes to the new instance format, so need to adapt this again after D43980374.

The previous format was never synced so we don't need to keep compatibility.

Changelog: [internal]

Reviewed By: javache

Differential Revision: D44137324

fbshipit-source-id: bb08141674e2385934772f241acb863f9050b671
2023-03-21 06:13:42 -07:00
Nacho López d92cfd56f5 Only reset textAncesor when is a child of text (#36520)
Summary:
Text need to know if is a descendant of a text in order to proper render nested text. For this react-native uses the textAncestor provider https://github.com/facebook/react-native/pull/29736#issuecomment-681116943.

This provides a not so ideal DX when profiling/Debugging as the view is polluted with TextAncestor.provider on each view render (As is the main render piece this happens quite often).

The idea behind of this PR is to just reset the context when view is a descendant of a text (Not so common case) rather than resetting all the time.

| Before  | After |
| ------------- | ------------- |
| ![Screenshot 2023-03-08 at 23 06 12](https://user-images.githubusercontent.com/6432326/226111157-d8af7990-2584-46b6-8f02-8583a84c2994.png)  |  ![Screenshot 2023-03-08 at 23 07 11](https://user-images.githubusercontent.com/6432326/226111222-65e8ac86-8ac8-4499-a725-c2f5ed2a2c99.png)  |

From my understanding of how hooks works this shouldn't degrade the performance and didn't spot any diff profiling my app (For better or worse).

## Changelog

[INTERNAL] [CHANGED] - Only reset textAncesor when is a child of text

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

Test Plan: https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/Text/TextExample.ios.js

Reviewed By: necolas

Differential Revision: D44213843

Pulled By: javache

fbshipit-source-id: 246ac22557dc7794741fd9732d399fe8b9256f11
2023-03-21 04:47:39 -07:00
Alex Hunt 745cdb1335 Add @react-native/metro-config package (#36502)
Summary:
Changelog:
[General][Added] - Add `react-native/metro-config` package

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

## Context

### React Native Metro config → React Native repo (https://github.com/facebook/react-native/pull/36502)

We (the React Native team) are aiming to relocate the default Metro config for React Native out of `react-native-community/cli-plugin-metro` and **into the React Native repo + app template** as a new `react-native/metro-config` package.

This is the first (and minimum viable) phase we can ship to separate the release process of Metro from RN CLI in order to reduce coupling and iterate faster for our users.

**See full motivation, design, and test plan here: https://github.com/facebook/react-native/pull/36502**

## Changes

- This PR adds the new `react-native/metro-config` package, reproduces all static values previously defined in RN CLI. The values which remain in RN CLI are dynamic values derived from CLI options passed by the user.

{F906910591}

Reviewed By: cortinico

Differential Revision: D44099692

fbshipit-source-id: 672a67e19d866ac2c64fc84983b5d82c604918c6
2023-03-21 04:17:09 -07:00
Jiamin Zhu 6956d4f261 Remove dependency on use-sync-external-store
Summary:
Changelog: [Internal]

React Native requires React 18 which includes `useSyncExternalStore`, so we can remove the shim. It was only used in one place (`useColorScheme`).

Reviewed By: motiz88

Differential Revision: D44163914

fbshipit-source-id: 3a94466b3d5ae8aa43e9236acb8c92fbefd04180
2023-03-20 16:08:15 -07:00
Sharon Zheng 08d6718e5a pressability.js typo
Summary:
Changelog:
[General][Fixed] - Pressability.js comment typo

Reviewed By: yungsters

Differential Revision: D44181320

fbshipit-source-id: adc303665074ff19a9657846b689820379b7c4f2
2023-03-20 15:45:33 -07:00
Ruslan Lesiutin 9b6aaa731d RN [fix]: update template location in align-package-versions.js script
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D44218613

fbshipit-source-id: 505962b500821252679084a44e7d92e52c6fbf49
2023-03-20 15:41:42 -07:00
Samuel Susla 7b916be03f Patch setNativeProps in OSS build
Summary:
changelog: [internal]

`setNativeProps` have been implemented in Fabric but require a React change to be accessible from JavaScript components. For React sync to be imported in OSS builds, React needs to have have a new release in NPM.
To work around this limitation, I manually copied over lines of code that glue together setNativeProps to OSS build.

Reviewed By: cortinico, cipolleschi

Differential Revision: D44216496

fbshipit-source-id: b34b598c1a317bdc03cc5a4cadb3f7c610059709
2023-03-20 12:34:54 -07:00
David Vacca 8c01b56f12 Improve caching of Text per shadow Node
Summary:
This diff optimizes text measurement by adding a layer of caching per shadow node.
When ReactFeatureFlags.enableTextMeasureCachePerShadowNode is enabled, we will cache and reused measurements per shadow node.
This optimization showed a 2x improvement on text rendearing when a screen contains a big amount of text components.

Changelog: [Internal] Internal

Reviewed By: sammy-SC

Differential Revision: D44221170

fbshipit-source-id: c3e7ba1ad216929826a99585874981717c90e13b
2023-03-20 12:13:02 -07:00
Nick Gerleman a999f0d2f3 Cleanup RNTesterExampleFilter/RNTesterPage/RNTesterBlock Spacers
Summary:
Right now RNTestePage either adds a large spacer to the end of content, unless `noSpacer` is added. But with `noSpacer`, scrolling content may not be reachable because we are putting padding on the wrong container.

This fixes that and removes a few cases where we had multi hundred px empty space in favor of uniformly taking up the parent, and a 10px padding. This also moves the constant margin at the top of RNTesterBlock to the container, so that in the E2E container we can save the 30px.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D44197303

fbshipit-source-id: 8dc67f3588bc28316e2fee8d25a0bc59995f1728
2023-03-20 11:14:16 -07:00
Ruslan Shestopalyuk 9f948fc742 Fix potential use after move in Differentiator (#36537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36537

##Changelog:
[Internal] -

This popped up when I was landing D44172494.

Order of arguments evaluation to a function call in C++ is unspecified, therefore there was  a potential danger of use after move in two places in `Differentiator.cpp`

This diff fixes it.

Reviewed By: javache

Differential Revision: D44215210

fbshipit-source-id: 828ca379e2ba5a40506f1ff3136150af63ea1ff7
2023-03-20 09:58:09 -07:00
Samuel Susla 59243aa238 Enable NSTextStorage caching in OSS
Summary:
changelog: [internal]

Turn on NSTextStorage in OSS.

Reviewed By: cipolleschi

Differential Revision: D44216186

fbshipit-source-id: 7f08291dc0bc1237e72dd96235f76ed90361826b
2023-03-20 09:12:08 -07:00
Ruslan Lesiutin 9a711e2fd5 RN [fix]: fixed cwd for in publish-npm script
Summary:
Changelog: [Internal]

Accidentally trying to publish from root folders, was missed in monorepo changes initially

Reviewed By: cortinico

Differential Revision: D44217992

fbshipit-source-id: dc7c5728929429cece0edada55f525f100451d2f
2023-03-20 08:44:43 -07:00
Tarun Chauhan 221aacd72d Move getCommandOptions and getOptions to parsers commons (#36413)
Summary:
> [Codegen 92] The getCommandOptions function in parsers/typescript/components/options.js and parsers/flow/components/options.js is the same. move it in parser-commons and use it in the original files. If the file two options.js files are empty, delete them.

> [Codegen 93] The getOptions function in parsers/typescript/components/options.js and parsers/flow/components/options.js is the same. move it in parser-commons and use it in the original files. If the file two options.js files are empty, delete them.

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

## 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] - Move getCommandOptions and getOptions to parsers commons from parsers components options

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

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

Reviewed By: rshest

Differential Revision: D43957023

Pulled By: cipolleschi

fbshipit-source-id: 4f8bf6f8fe69b20d0fb976afee7da244ef634e12
2023-03-20 07:32:14 -07:00
Pranav Yadav 2f25261b88 Merge TS & Flow parsers' logic for Partial case to emitPartial fn & commonTypes cases into emitCommonTypes fn (#36450)
Summary:
> [Codegen 78 - Assigned to Pranav-yadav] It depends on [Codegen 75][Codegen 76][Codegen 77] Extract the logic that emits Partial values in an emitPartial function, which takes the Parsers as parameter.

>[Codegen 79 - Assigned to Pranav-yadav] It depends on [Codegen 78] Extract the basic cases logics (case Stringish, case Int32, case Double, ..., case Partial. `Flow` lines and `TypeScript` lines into a function emitCommonTypes in `parsers-primitives.js`. Make sure that the default case returns `null`. Call this function in the default: case `Flow`, `TypeScript` of the `index.js` file: if the function return something, return that from the default case; otherwise if the `emitCommonTypes` returns `null`, keep the current default implementation (throw the error).

### Changes

- merged TS & Flow parsers' logic for `Partial` case to `emitPatial` fn
- merged TS & Flow parsers' logic for below cases:
  - `Stringish`
  - `Int32`
  - `Double`
  - `Float`
  - `UnsafeObject`
  - `Object`
  - `Partial`
- into an `emitCommonTypes` fn into `parsers-primitives.js`
- add **_tests_** for `emitPartial` and `emitCommonTypes` fn's
- add `getAnnotatedElementProperties` fn to parser & impl to both TS & Flow parsers

## Changelog:

[INTERNAL] [CHANGED] - Merge TS & Flow parsers' logic for `Partial` case to `emitPatial` fn & `commonTypes` cases into `emitCommonTypes` fn

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

Test Plan: - `yarn lint && yarn run flow && yarn jest react-native` ⇒ �

Reviewed By: rshest

Differential Revision: D44132308

Pulled By: cipolleschi

fbshipit-source-id: f965e85ecc5d94e57ad85334ce565a55c512fde4
2023-03-20 07:32:14 -07:00
Ruslan Lesiutin 4b6b706680 Update paths in a new setup to fix nightlies (#36535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36535

Changelog: [Internal]

- We should be copying `/packages/react-native/package.json`, not root `package.json`
- Updating CircleCI config's target directory where hermes artifacts should be copied

Reviewed By: cortinico

Differential Revision: D44214309

fbshipit-source-id: af84897df3931c6a2d6a902b33c71b665c3fcefc
2023-03-20 07:05:52 -07:00
Ruslan Lesiutin c9db994696 fix: added missing InheritParentConfig: true to .clang-tidy configs (#36532)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36532

Changelog: [Internal]

added missing `InheritParentConfig: true` to .clang-tidy configs across `ReactAndroid` and `ReactCommon`

was initially flagged by linters in D43977381

Reviewed By: javache

Differential Revision: D44199124

fbshipit-source-id: eb319b60096742edf4da7b6408a4148049a82aa0
2023-03-20 07:05:52 -07:00
Ruslan Lesiutin c35675bbe0 fix[align-package-version]: fixed updating application dependencies for react-native package (#36534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36534

Changelog: [Internal]

- Added option to include react-native package in forEachPackage func
- Used this in align-package-versions.js

Reviewed By: cortinico

Differential Revision: D44152939

fbshipit-source-id: da173e78945d8185ae7e35e29d08926de1700fa4
2023-03-20 07:05:52 -07:00
Ruslan Lesiutin 9d18b4eaa8 refactor: move README.md in prepack, instead of having two copies (#36533)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36533

Changelog: [Internal]

Its better to have one source of truth, so we won't loose any changes if one of the files will be updated

Reviewed By: cortinico

Differential Revision: D44138311

fbshipit-source-id: 9bd938c1abe33ea1f791f7624efd57f1b37e813b
2023-03-20 07:05:52 -07:00
Ruslan Lesiutin dacb1593de RN: add @react-native/tester as a workspace to xplat/js/public (#36531)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36531

Changelog: [Internal]

In order to make `react-native/tester` imports work, adding this package to `xplat/js/public`

Also moving devDependecies from `react-native/tester/package.json` to root package json to avoid checking in dev dependencies in `xplat/js/public/node_modules`

Reviewed By: cortinico

Differential Revision: D44030539

fbshipit-source-id: b06e49869cdad6e511b1675d1063a1ceac56e3e6
2023-03-20 07:05:52 -07:00
Saad Najmi 65e61f3c88 Enable Address and Undefined Behavior Sanitizers (#36443)
Summary:
This change does two things:

1) Moves RNTester on iOS to use an `.xctestplan` to configure its tests. This moves the test configuration out of the `.xcscheme` file, and into a new json file that Xcode likes. It also allows you to run the same tests multiple times with different configurations. This was done by clicking the focused button below.

![image](https://user-images.githubusercontent.com/6722175/224447314-49d460e9-d2d6-4ec9-9767-64c2a1c449c0.png)

Note: this is partially me upstreaming a change from React Native macOS (https://github.com/microsoft/react-native-macos/pull/190/), though at some point our Xcode project got messed up and we were no longer referencing them ��.

2) Enables Address Sanitizer and Udefined Behavior Sanitizer through the xctestplan

This should help catch some extra vulnerabilities should they ever show up while our tests run.

Notably, I did not _also_ add a configuration to run Thread Sanitizer, because tests start failing with that enabled 😅.

## Changelog:

[IOS] [SECURITY] - Enable Address and Undefined Behavior Sanitizers on RNTester

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

Test Plan: CI should pass

Reviewed By: cortinico

Differential Revision: D44213517

Pulled By: cipolleschi

fbshipit-source-id: 0646174c4b416413a563e8178aa2cfca230b5e66
2023-03-20 06:03:51 -07:00
Rubén Norte cd65a324fe Add skeletons for ReadOnlyNode, ReadOnlyElement and ReactNativeElement
Summary:
This just creates the class structure for `ReadOnlyNode`, `ReadOnlyElement` and `ReactNativeElement`, with all methods throwing as unimplemented.

These classes will be gated behind a feature flag, so merging incomplete work is ok.

This doesn't add the future setters that will log warnings / throw errors when used.

See: https://github.com/react-native-community/discussions-and-proposals/pull/607
Changelog: [internal]

Reviewed By: rickhanlonii, yungsters

Differential Revision: D44060539

fbshipit-source-id: e489532fd365d9aa2bb8308847a35eb715d675e7
2023-03-20 06:01:25 -07:00
Rubén Norte a8b5ff8646 Implement basic version of DOMRectList
Summary:
This implements a basic version of DOMRectList that's close to the spec but diverges in some things (e.g.: methods could be called with an instance created through `Object.create`, etc.).

This will be used soon to implement `ReadOnlyelement.getClientRects()` (behind a flag).

See: https://github.com/react-native-community/discussions-and-proposals/pull/607

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D44060540

fbshipit-source-id: ad29b5c41f2778864e7dd7ece9223dcf73cd5d6c
2023-03-20 06:01:25 -07:00
Rubén Norte c4b84baf00 Implement basic version of NodeList
Summary:
This implements a basic version of NodeList that's close to the spec but diverges in some things (e.g.: methods could be called with an instance created through `Object.create`, etc.).

This will be used soon to implement `ReadOnlyNode.childNodes` (behind a flag).

See: https://github.com/react-native-community/discussions-and-proposals/pull/607

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D44055911

fbshipit-source-id: 10b435b06ea6f75eaead85f01c2703e05bb3bd37
2023-03-20 06:01:25 -07:00
Rubén Norte e4d83a14f5 Implement basic version of HTMLCollection
Summary:
This implements a basic version of HTMLCollection that's close to the spec but diverges in some things (e.g.: methods could be called with an instance created through `Object.create`, etc.).

This will be used soon to implement `ReadOnlyElement.children` (behind a flag).

See: https://github.com/react-native-community/discussions-and-proposals/pull/607

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D44055912

fbshipit-source-id: 37bcd7c12916b95a258e6b2e5717a642f478abdf
2023-03-20 06:01:25 -07:00
Rubén Norte 4ad5fe3c21 Define types for missing methods in nativeFabricUIManager
Summary:
These 3 methods are defined in the binding in native, but not in the type definition in JS.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D44139730

fbshipit-source-id: 5ce74c61a424ece8091046425b9cd5598f14bbf1
2023-03-20 06:01:25 -07:00
Rob Hogan a0fa3c736e Move Jest preprocessor up to workspace root, remove public metro-react-native-babel-transformer dep (#36523)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36523

`jest/private/preprocessor.js` is only used to run tests on the workspace itself, it's not part of our exported Jest preset and is specifically excluded from publication in the `react-native` package.

Now that we have the monorepo setup, this belongs at the workspace root.

 - `metro-react-native-babel-transformer` moved from RN `dependencies` to root `devDependencies` because it's only used by the preprocessor
 - `jest/create-cache-key-function` added to `devDependencies` - it's also used by the `assetTransformer` in the public preset.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D44197879

fbshipit-source-id: 0bbd9e2f500f53fa4f16562f05374dc601b67df6
2023-03-20 05:44:34 -07:00
Jerry 0c5c07fc9b fix: add missing lineBreakStrategyIOS types for Text, TextInput (#36526)
Summary:
I added missing type `lineBreakStrategyIOS` for Text and TextInput. ([Text docs](https://reactnative.dev/docs/text))

## Changelog

[GENERAL] [FIXED] - add `lineBreakStrategyIOS` prop type for Text and TextInput

<!-- 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
-->

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

Test Plan: Ran `yarn test-typescript` and `yarn test-typescript-offline` with no errors.

Reviewed By: jacdebug

Differential Revision: D44213791

Pulled By: javache

fbshipit-source-id: 8d0d44e2cdd1fa362c54935326e86dde88c5ba0b
2023-03-20 05:16:20 -07:00
Rob Hogan 0eff8d66c9 Support PNPM and workspace setups with pod install (#36485)
Summary:
With Metro symlink support coming soon, users will expect isolated `node_modules` resolution and hoisted `react-native` to work. Currently, we make some fragile assumptions in Ruby scripts about the location of `node_modules` packages - in particular `react-native` and `react-native-community/cli-platform-ios`.

This change invokes `node` to resolve those paths, which should allow these scripts to work in any Node JS-compliant setup.

There's a small (sub-second) performance penalty involved in invoking node, but two of these in the context of `pod install` seems reasonable. Also, these scripts [already invoke `node`](https://github.com/react-native-community/cli/blob/fb78fe8ea2fabe8e6d43f5042ecbb92e8e484e12/packages/cli-platform-ios/native_modules.rb#L26), so this isn't an additional dependency or point of failure.

*This is probably the first Ruby I've written in >10 years, review suggestions welcome!*

Changelog:
[iOS][Added] - Support workspace and isolated setups with `pod install`

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

Test Plan: `pod install` succeeds on a PNPM workspace setup where `react-native-community/cli` was not at the path previously expected by this script.

Reviewed By: cipolleschi

Differential Revision: D44097440

Pulled By: robhogan

fbshipit-source-id: 8300144888d8da019451b3f792b30eabc3a568cf
2023-03-20 03:27:55 -07:00
Ruslan Shestopalyuk b9c64f3651 Bulk detect/correct (most of the) typos and misspells in RN core code
Summary:
## Changelog:
[Internal] -

While merging a Contributor PR in D43816768, I got curious whether such things as detecting/fixing typos could be automated.

There is a tool called [typos](https://github.com/crate-ci/typos), which, as it turns out, works very well on source code files.

The amount of false positives was minimal, most of the suggestions were valid ones.

And the total amount of typos found and fixed was **more than 300**, which is... quite a bit :)

### Methodology

* Run `typos` separately on `ReactCommon`, `Libraries`, `React`, `ReactAndroid` and `scripts` folders inside `packages/react-native`, e.g.:
```
$ typos -w --config ~/tmp/_typos.toml ~/fbsource/xplat/js/react-native-github/packages/react-native/ReactAndroid
```

Contents of the `_typos.toml` config file:
```
[default.extend-words]
collapsable = "collapsable"
NDK = "NDK"
inout = "inout"
```

(yeah, it really didn't like the "collapsable" word, for some reason ;))
* Inspect all the changes manually and revert false positives (as mentioned, their amount was minimal)

Note that most of the changes are inside things like comments and error messages, however there are a few among identifier name fixes (`typos` is actually quite smart at understanding naming conventions in code) - I kept the suggestions in cases that are local and not part of a public API. There are also misspelled file name changes in a couple of cases.

Reviewed By: NickGerleman

Differential Revision: D44172494

fbshipit-source-id: 86e27edbbb99e09135e3cdd5d7cea8ffeb8307f4
2023-03-20 02:05:38 -07:00
Rob Hogan 96789004b6 Fix reference to old template/package.json path
Summary:
Nightly builds are broken at the moment - at least in the first instance this looks to be because a reference to `template/package.json` was missed in the monorepo PR. This repairs it.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D44205810

fbshipit-source-id: c810b7a211db7162569a67fca26771fce79d4f9d
2023-03-19 18:06:33 -07:00
Genki Kondo 0ae5e50e37 Support mixed props for components
Summary:
Changelog:
[Changed][General] - Support mixed props for components in codegen

Reviewed By: rickhanlonii

Differential Revision: D43894460

fbshipit-source-id: e5faf2f83e6829170cdce550e923c3c09ddff0b0
2023-03-19 16:47:22 -07:00
Rob Hogan e5b97f0f13 Don't register Babel in Jest preprocessor (#36522)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36522

We don't need to register Babel for internal tests, Jest takes care of hooking require. This resolves an internal require-clobbering issue.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D44197281

fbshipit-source-id: ee076d431b0c49ae4a2da609d964cdd66bca27f8
2023-03-18 13:46:58 -07:00
Intl Scheduler 4a05f680e1 translation auto-update for i18n/anna.config.json on master
Summary:
Chronos Job Instance ID: 1125907824975914
Sandcastle Job Instance ID: 22517999042723056
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D44193886

fbshipit-source-id: 0c093d45a198c9b4db628369520a07bcd3e8b9b9
2023-03-18 00:30:05 -07:00
Intl Scheduler 3116bfd427 translation auto-update for i18n/adsmanager.config.json on master
Summary:
Chronos Job Instance ID: 1125907824975914
Sandcastle Job Instance ID: 22517999042723056
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D44193882

fbshipit-source-id: d07f3fef9e54b2c92a0dde7ce3de9502ce91fda3
2023-03-18 00:30:05 -07:00
Intl Scheduler d4a0f606b1 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907824975914
Sandcastle Job Instance ID: 22517999042723056
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D44193881

fbshipit-source-id: 60ae352367124e6a05b84c24b7c622dd9a7eafd1
2023-03-18 00:30:05 -07:00
Intl Scheduler c19b1673ec translation auto-update for i18n/twilight.config.json on master
Summary:
Chronos Job Instance ID: 1125907824975914
Sandcastle Job Instance ID: 22517999042723056
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D44193891

fbshipit-source-id: 9a57e04fa2c275096bf56470cc9f2e3cbac86a81
2023-03-18 00:30:05 -07:00
Intl Scheduler ccaa3a6091 translation auto-update for i18n/instagram-sandbox.config.json on master
Summary:
Chronos Job Instance ID: 1125907824975914
Sandcastle Job Instance ID: 22517999042723056
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D44193889

fbshipit-source-id: 8e59dcb6237d2d3763650850666aeef8ef16b825
2023-03-18 00:30:05 -07:00
Evan Yeung cd048d4abf Deploy 0.202.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D44155581

fbshipit-source-id: 358df8c40395812216afef1c99f93c576a425b11
2023-03-17 15:46:25 -07:00
Vincent Riemer 728e8a0177 Ensure that pointercancel events have a zeroed location
Summary:
Changelog: [Internal] - Ensure pointercancel events have zeroed location properties

When looking at the pointercancel test the remaining assertion failures were from the expectation that pointercancel events should be reported at [0, 0]. This diff ensures this occurs.

Reviewed By: NickGerleman

Differential Revision: D43886424

fbshipit-source-id: dda37153bd077500599f35db99f114c1a0823120
2023-03-17 15:38:22 -07:00
Vincent Riemer bfee3d9d8d Ensure trailing leave/out events are fired after a cancel event
Summary:
Changelog: [Internal] - Ensure trailing leave/out pointer events are fired after a cancel event

The pointercancel test checks that pointerleave/pointerout events are fired after a pointercancel which preivously wasn't occuring so this added call ensures so.

Reviewed By: NickGerleman

Differential Revision: D43886121

fbshipit-source-id: 9ea801e8f5fcd5855832cfac973bda6ba905998d
2023-03-17 15:38:22 -07:00
Nicola Corti 346de2d16a Compile the GTest suite with CMake (#36477)
Summary:
That's a first step to make sure our C++ tests can effectively run.
Here I'm setting up the pipeline to at least compile those tests and make sure they can be executed on a Android Emulator

Changelog:
[Internal] [Changed] - Setup CMake to run the GTest suite

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

Test Plan: CI needs to be green.

Reviewed By: rshest

Differential Revision: D44066754

Pulled By: cortinico

fbshipit-source-id: f963e0d7d4d9473eada53d7feecfabc21f3c3196
2023-03-17 13:40:57 -07:00
baranga 790df10fa9 Fix check of "reduce motion" setting on android (#36508)
Summary:
On Android `AccessibilityInfo.isReduceMotionEnabled()` returns false even when "Disable Animations" is enabled. This fixes https://github.com/facebook/react-native/issues/31221.

## 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
-->
[ANDROID] [FIXED] - Fix check of "reduce motion" setting on android

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

Test Plan: Have some code logging the value of `AccessibilityInfo.isReduceMotionEnabled()` or using it to change the UI. Run that code on Android without and with "Disable Animations" enabled. See the value is always `false` without the fix, but changes to `true` when  "Disable Animations" is enabled with the fix.

Reviewed By: cortinico, rshest

Differential Revision: D44163583

Pulled By: javache

fbshipit-source-id: ad239454ea68b381e0c7f024df797b3646aeefd7
2023-03-17 11:42:54 -07:00
Nicola Corti b0c30ada21 Fix test_buck by using RuntimeEnvironment.application (#36515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36515

Buck is using a older version of Robolectric which doens't have
`RuntimeEnvironment.getApplication()`. Reverting to the older
accessor.

Changelog:
[Internal] [Changed] - Fix test_buck by using RuntimeEnvironment.application

Reviewed By: cipolleschi

Differential Revision: D44171240

fbshipit-source-id: d2b49e3b08ffd737bc70ea3e0cb6b291cc36425f
2023-03-17 10:26:34 -07:00
Nicola Corti d904164434 Make robolectric tests run in offline mode (#36510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36510

This sets up a small offline mirror for Robolectric tests
and allows to run them both on CircleCI and on the internal CI.

allow-large-files

Changelog:
[Internal] [Changed] - Make robolectric tests run in offline mode

Reviewed By: cipolleschi

Differential Revision: D44066692

fbshipit-source-id: 3974d92169ed5c8947f72c953e83a7bf6fadca54
2023-03-17 10:26:34 -07:00
Nicola Corti 5cbabe30d3 Use the default build task rather than buildAll
Summary:
We can now use the `build` lifecycle task rather than a custom buildAll.
This task will also run linters and other checks on our builds.

Speficially I realized we were missing some permission in the manifest of RN-Tester
which were missed once we bumped to SDK 33.

Changelog:
[Internal] [Changed] - Use the default `build` task rather than `buildAll`

Reviewed By: cipolleschi

Differential Revision: D44055845

fbshipit-source-id: c9adbbeaaaf7ab8a8000fc1dce84ec39427fb26e
2023-03-17 10:26:34 -07:00
Nicola Corti a389373442 Enable JVM Unit Tests for Gradle
Summary:
This makes sure all the tests are executed inside the `ReactAndroid/src/test` folder.
Currently, we're not executing those tests as they're broken. In this diff I took care of:
- Re-enabling them as much as I could
- Ignoring the ones that are ignored also on BUCK

Those tests will have to be entirely re-written as they're using PowerMock which is
unmaintained and not working well with JDK 17+ (that's also why I had to add
the `--illegal-access=permit` and the `--add-opens` directing to allow mocking).

In general, I believe this is a net positive change as it allows us to add new JUnit tests
that are effectively executed, while the current status is ignoring all of them.

Changelog:
[Internal] [Changed] - Enable JVM Unit Tests for Gradle

Reviewed By: cipolleschi

Differential Revision: D41523697

fbshipit-source-id: dc9f2c4c93d0e6b231e8240a583ca31220152d3f
2023-03-17 10:26:34 -07:00
Tim Gates 342c0beafa docs: Fix a few typos (#36372)
Summary:
##Changelog:
[Internal] -

There are small typos in:
- Libraries/Core/setUpTimers.js
- Libraries/LogBox/Data/LogBoxData.js
- Libraries/Pressability/Pressability.js
- Libraries/Renderer/implementations/ReactFabric-dev.js
- Libraries/Renderer/implementations/ReactNativeRenderer-dev.js
- ReactCommon/react/nativemodule/core/platform/ios/RCTBlockGuard.h

Fixes:
- Should read `snapshot` rather than `snapsho`.
- Should read `symbolication` rather than `sybolication`.
- Should read `polyfilled` rather than `polyfiled`.
- Should read `instance` rather than `instace`.
- Should read `gesture` rather than `gestute`.

Semi-automated pull request generated by
https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

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

Reviewed By: cortinico, cipolleschi

Differential Revision: D43816768

Pulled By: rshest

fbshipit-source-id: 1346cb3a26748c41d72a3c388d81713ddf2272ed
2023-03-17 09:35:21 -07:00