Commit Graph

11 Commits

Author SHA1 Message Date
Rubén Norte 559c6029fd Refactor Performance and PerformanceObserver internals (#46693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46693

Changelog: [internal]

This unifies the native modules for `Performance` and `PerformanceObserver` in the same module. Keeping them separate is artificial and introduces unnecessary duplication. These APIs are very closely related so it makes sense to unify

Reviewed By: javache

Differential Revision: D63471855

fbshipit-source-id: fa8c5dc7b7c68954fc11867f68909d2c6c2ee85c
2024-10-02 03:13:24 -07:00
Riccardo Cipolleschi 120558c0cd Bump main to 0.77
Summary:
This change bumps the React Native version in main to 0.77

bypass-github-export-checks

## Changelog:
[General][Changed] - Bump main to 0.77-main

## Facebook:
generated by running `js1 publish react-native 0.77.0-main`

Reviewed By: cortinico

Differential Revision: D62575939

fbshipit-source-id: 6d239fca2eed6cfe51f8c37f78d8dc8730c18b8c
2024-09-12 09:23:23 -07:00
Vitali Zaidman b37101486b update babel and fix tests accordingly (#46295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46295

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

Updated all **babel** packages in all `package.json` across the repo and ran `npx yarn-deduplicate yarn.lock --scopes babel`. Afterwards, fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically):
### (D61336392) updated jest snapshot tests failing
### (D61336393) updated babel types and corrected typings accordingly
The latest babel 7 introduces the following features we need to adjust our types to:
* `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](https://github.com/babel/babel/pull/16421))
  * `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense.
* Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](https://github.com/babel/babel/pull/15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings.
  * Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later.

### Added a new metro ENV ignore
`BROWSERSLIST_ROOT_PATH` is set to `""` explicitly in `xplat/js/BUCK`
and then ignored in
`js/tools/metro-buck-transform-worker/src/EnvVarAllowList.js`

Reviewed By: robhogan

Differential Revision: D61543660

fbshipit-source-id: abbcab72642cf6dc03eed5142eb78dbcc7f63a86
2024-09-05 07:11:17 -07:00
Sam Zhou 77154c64f0 Eliminate exact React.Element types in react-native codebase
Summary: Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D61389820

fbshipit-source-id: 566a4904c570e24f5beb965734020f8b9c1ed819
2024-08-16 07:30:09 -07:00
Alex Hunt ebf1a7b79b Bump packages for next major release (#45015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45015

Set package versions to `0.76.0-main` (`0.75-stable` branch was cut).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58687399

fbshipit-source-id: 27ed987e4557705845d57d64e7547cddbd982a03
2024-06-26 07:59:49 -07:00
Alex Hunt f57be12977 Bump packages for next major release (#43132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43132

Command run:

```
node scripts/releases/set-version 0.75.0-main --skip-react-native-version
```

Changelog: [Internal]

Reviewed By: lunaleaps, cipolleschi

Differential Revision: D54006327

fbshipit-source-id: 7afe9e7ca3020faf399fdba2221fab8a102c56c7
2024-03-04 07:54:37 -08:00
Jack Pope 8da1da2e73 Add findAll base query method (#42829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42829

This is the base query method that we can wrap to use specific matchers like `findByTestID` or `findByRole`

Changelog: [internal]

Reviewed By: noahlemen

Differential Revision: D53359005

fbshipit-source-id: d1ac9c503b05d479567b6ced71d4517d5bc55b0b
2024-02-06 13:32:28 -08:00
Jack Pope 41045a1486 Refactor toJSON (#42828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42828

Updates to toJSON:
- return object tree instead of formatted snapshot string. Applying the `'react.test.json'` symbol lets Jest do the formatting work for us
- Source props from `pendingProps` on `instanceHandle`. This adds props such as `pointerEvents` and `style` which were present on RTR's snapshots but don't get included in the node's `props` collection
- Render text node as text value, instead of RCTRawText like `<RCTRawText text="Hello" />`

Changelog: [internal]

Reviewed By: kassens

Differential Revision: D53321821

fbshipit-source-id: 033637b9152441c318c9c797aa9223ff15768873
2024-02-02 14:34:43 -08:00
Jack Pope 48ec680b04 Run RNTR against simple product test (#42827)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42827

This is a simple snapshot test using ReactTestRender's toJSON. We have almost the same functionality in RNTR already, so let's see if we can support tests like this.

Merging the new setup and environment with the existing configuration (https://fburl.com/code/s85sma77) still causes issues so here we add unmocking and new setup inline. Added task T177114228 to track following up on this

Note that some formatting is changed and props are dropped on the snapshot. This is resolved with refactor in next diff

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D53321823

fbshipit-source-id: a20f77c29fefb9172f8a8189bd821dd202b2ff02
2024-02-02 14:34:43 -08:00
Jack Pope bdc88c3fad Allow package to be imported by tests in xplat (#42826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42826

yungsters debugged the failing test library import and found that we don't yet support package exports. Switching this to main with an index file allows us to import the library in other places.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D53240712

fbshipit-source-id: 046a7d1678cbca181e4a4de607a9c0e7490ef047
2024-02-02 14:34:43 -08:00
Jack Pope c7479b07ae Add react-native-test-renderer package (#42644)
Summary:
The goal is to provide testing utilities that use Fabric and concurrent rendering by default to support the new RN architecture. Currently most testing is done through ReactTestRenderer, which is an overly-simplified rendering environment, non-concurrent by default, and over exposes internals. A dedicated RN environment in JS can allow for more realistic test execution.

This is the initial commit to create the `react-native-test-renderer` package. It currently only offers a simple toJSON() method on the root of a test, which is used for snapshot unit tests. We will be iterating here to add a query interface, event handling, and more.

## Changelog:
[GENERAL] [ADDED] - Added react-native-test-renderer package for Fabric rendered integration tests

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

Test Plan:
```
$> cd packages/react-native-test-renderer
$> yarn jest
```

Output:

```
 PASS  src/renderer/__tests__/render-test.js
  render
    toJSON
      ✓ returns expected JSON output based on renderer component (7 ms)

Test Suites: 1 passed, 1 total
1 passed, 1 total
Snapshots:   1 passed, 1 total
Time:        2.869 s
```

Reviewed By: yungsters

Differential Revision: D53183101

Pulled By: jackpope

fbshipit-source-id: 8e29ba35f55f6c4eb2613ab106bc669d72f33d1d
2024-01-30 12:54:26 -08:00