Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49102
Moves this script one level up. In the next diff, will be used to support execution of scripts themselves, as well as `packages/`.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D68960279
fbshipit-source-id: 7b62420c269dc1c1366ac9a827db078d34cb86c5
Summary:
Working on migrating some of the com.facebook.react.modules.network classes to Kotlin, I'm creating some test cases here for `CountingOutputStream` before migrating that class.
## Changelog:
[INTERNAL] - Add CountingOutputStream tests
Pull Request resolved: https://github.com/facebook/react-native/pull/49058
Test Plan:
```bash
yarn test-android
```
Reviewed By: cortinico
Differential Revision: D68903427
Pulled By: rshest
fbshipit-source-id: f71926cf526a65b2434aaa762007e0b4ca5dd1a4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49087
I'm moving the whole module to be in Kotlin and updating the BUCK file.
Those files also have 0 usages in OSS so not a breaking change.
Changelog:
[Internal] [Changed] -
Reviewed By: robhogan
Differential Revision: D68953731
fbshipit-source-id: d8238bf805661cbdd6fb070a60f3e32b44ec9832
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49079
The rule disallows using CommonJS exports in react-native and assets/registry package.
## Changelog:
[Internal] - Created a lint rule that prevents using CommonJS exports
Reviewed By: huntie
Differential Revision: D68951212
fbshipit-source-id: 1c9a1581af951d2a876b348981f0e5a81c99109a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49064
Update `public-api-test` to disregard all object/type members prefixed with an underscore (`_`). These are considered existing internal APIs.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D68895376
fbshipit-source-id: db581df7cc37802fa5f7d3aa4d7c07514223209a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49060
We want to hide private properties from JS public API interface. The stripPrivateProperties transform removes all private nodes of type ObjectTypeProperty, Property, PropertyDefinition and MethodDefinition. There is also a change in transforms reducer that incorporates `print` function from hermes-transform which modifies the code base on the transformed ast (transformed.mutatedCode seems to be a code before the transform operation).
## Changelog:
[Internal] - Added transform that strips private properties in build-types script
Reviewed By: huntie
Differential Revision: D68892853
fbshipit-source-id: 5035fd4339aa6294d972e7aff0eb563f48d4c3d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49062
Another round of cleanup for the `public` keyword that I found around.
Those are unnecessary here as those classes are `internal` and we should remove them.
Changelog:
[Internal] [Changed] -
Reviewed By: mdvacca
Differential Revision: D68894182
fbshipit-source-id: 6f7bac6051e17785a1bfb0d544950250429c71cb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49019
Removes the `JSInspector` class and its dependencies.
- This was related to the legacy `ReactCommon/inspector/` subsystem (D4021490) — which added a compat layer from JavaScriptCore to CDP for an earlier version of Chrome debugging.
- The JS components of this system (`JSInspector.js`, `NetworkAgent.js`) were added in D4021516.
`ReactCommon/inspector/` has since been deleted and these components are no longer load bearing.
- We intend to replace this logic (at least, the archaic `XHRInterceptor` behaviour, which worked at one point) with native debugger `Network` domain support in our C++ layer.
**Changes**
- Remove all modules under `Libraries/JSInspector/`.
- Remove all `XHRInterceptor` call sites.
- Remove the `JSInspector.registerAgent()` mount point in `setUpDeveloperTools.js`.
- Exclude `Libraries/Core/setUp*` from `public-api-test` (these are side-effect setup files with no exported API).
Changelog:
[General][Breaking] - Remove legacy Libraries/JSInspector modules
Reviewed By: christophpurrer
Differential Revision: D68780147
fbshipit-source-id: 3d11cc89886a91055e6b69ac6f0609c288965801
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49074
This used to not be noticeable when we were clipping the background even without a border, after fixing that, we got line when the width/height was 0
This is again not an issue with new Background and Border since they take a slightly different approach
Diff that caused the issue D68279400
ie.
{F1974794589}
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D68843649
fbshipit-source-id: a25ace46b604690e3385c49d6f4bb3a4163bc594
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49020
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates the `Libraries/EventEmitter/*.js` and `Libraries/Image/*.js` files to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/EventEmitter` and `Libraries/Image/*.js` with `require` syntax need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D68780876
fbshipit-source-id: bd8e702aba33878e38df6d9c89bec27e7c8df0ac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49065
Changelog: [internal]
Cleaning up the flag because it's no longer necessary.
Reviewed By: sammy-SC
Differential Revision: D68892995
fbshipit-source-id: 4e0290bfb11181dc388e6590af1b82581588b9ee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49063
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Updates react-native-codegen to generate ViewConfigs that are compatible with react-native both before and after the export syntax migration.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D68894819
fbshipit-source-id: fca46c1b91c15e22f1e1128ce8621c05341e2fe6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49012
Changelog: [internal]
(This is internal for now, until we rollout the DOM APIs in stable).
This refines the concept of root elements from the merged proposal for [DOM Traversal & Layout APIs](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0607-dom-traversal-and-layout-apis.md).
The original proposal included a reference to have the root node in the tree as `getRootNode()` and no other methods/accessors to access it.
This makes the following changes:
* The root node is a new abstraction in React Native implementing the concept of `Document` from Web. `node.getRootNode()`, as well as `node.ownerDocument` now return instances to this node (except when the node is detached, in which case `getRootNode` returns the node itself, aligning with the spec).
* The existing root node in the shadow tree is exposed as the `documentElement` of the new document instance. It would be the first and only child of the document instance, and the topmost parent of all the host nodes rendered in the tree.
In terms of APIs:
* Implements `getRootNode` correctly, according to the specified semantics.
* Adds `ownerDocument` to the `ReadOnlyNode` interface.
* Adds the `ReactNativeDocument` interface, which extends `ReadOnlyNode` (with no new methods on its own, which will be added in a following PR).
NOTE: This is currently gated under `ReactNativeFeatureFlags.enableDOMDocumentAPI` feature flag, which is disabled by default.
Reviewed By: yungsters
Differential Revision: D67526381
fbshipit-source-id: dff3645469e7ea2b2026dbbaa94d9fd0e00291be
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49011
Changelog: [internal]
This exposes the new `getPublicInstanceFromRoot` method from the React renderer in our RN façades, preparing for the new change to implement the document interface in RN.
Reviewed By: javache
Differential Revision: D68767143
fbshipit-source-id: 9a3403f9bc1612b402305695d084497a46ee4480
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49021
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates files in `Libraries/LayoutAnimation/*.js` and `Libraries/Linking/*.js` to use the `export` syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to modules inside `Libraries/LayoutAnimation` and `Libraries/Linking` with `require` syntax need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D68782429
fbshipit-source-id: c9ea4fadbc44587a165d311b054fcd03444842c8
Summary:
`dev-middleware` uses `invariant` but does not declare it as a dependency. Under certain hoisting scenarios, or when using pnpm, this will cause `dev-middleware` to fail while being loaded.
## Changelog:
[GENERAL] [FIXED] - add missing `invariant` dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/49047
Test Plan: n/a
Reviewed By: cortinico
Differential Revision: D68835789
Pulled By: huntie
fbshipit-source-id: 13718f4970ed55e6e062b7c2bd719be977abdd0c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49049
ReactBridge can be internalize, there are no usages in OSS
changelog: [internal] internal
Reviewed By: NickGerleman
Differential Revision: D68540710
fbshipit-source-id: ce7fe6ca52186414650dcc529c5891dc59cab51a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49050
Changelog: [internal]
We added support for feature flags that don't have a native module definition so we could handle cases where the JS changes progressed faster than native ones, but we recently saw that when native catches up, the API starts logging an error through `console.error` about the native module method not being available.
That's an expected result of this feature and it's when we can clean up the code in JS, so we shouldn't be logging errors in that case.
This removes the error for them specifically.
Reviewed By: elicwhite
Differential Revision: D68843247
fbshipit-source-id: 730f3eba8c26959825cd9c3897f055a02a5f9591
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49018
Changelog: [internal]
Migrates the mounting layer logs from C++ (640 lines of code) to Fantom (248 lines!!!).
This is 1:1 translation of the test.
Reviewed By: javache
Differential Revision: D67549200
fbshipit-source-id: 735fa3203cd04dd5b3b4b5174e0c96fdc2354993
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49017
Changelog: [internal]
The debug string for props doesn't log `nativeID` so we can't access it in Fantom. This fixes that to simply future tests.
Reviewed By: javache
Differential Revision: D68779903
fbshipit-source-id: 9800ef2b6d173e2fc8e21d3d910139a30ae91342
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49016
Changelog: [internal]
This replaces the existing string-based logs with something more structured, and increases the coverage to properly log all operations.
As part of this work I had to refactor how we record mutations so they would be done while applying the mutations, and not before/after where necessary metadata might not be available yet/anymore.
Reviewed By: sammy-SC
Differential Revision: D67549201
fbshipit-source-id: 0bcb1642a6b3d7e704f4ee24a550d4189c406aed
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49015
Changelog: [internal]
This name better reflects the fact that we're emptying the buffer when calling it.
Reviewed By: javache
Differential Revision: D67549202
fbshipit-source-id: 7523a130f26bced122acd4f50b45c2b61a39bba9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48930
Changelog: [internal]
This creates new versions of `XMLHttpRequest`, `FileReader` and `WebSocket` that extend the new built-in `EventTarget` implementation, instead of the implementation from the `event-target-shim` package.
It also sets up a test to choose between the 2 implementations at runtime to verify correctness and performance. This doesn't use the RN feature flags infra because we use this flag very early on startup, before we have a chance to set overrides. We could use a native feature flag instead but it'd slow down the rollout of the test.
Reviewed By: yungsters
Differential Revision: D68625226
fbshipit-source-id: bff715c43a237b65d5a02a3fdb56f3275689ea46
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49045
Changelog: [internal]
Making some objects read-only to reflect usage and allow callers to pass both read-only and writable objects.
Reviewed By: yungsters
Differential Revision: D68831136
fbshipit-source-id: e9a2d96ec0abd13f609d26d376e6da946f802011
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48928
Changelog: [internal]
Just a minor change to reduce the number of Flow errors we will get when we refactor XHR soon.
Reviewed By: javache
Differential Revision: D68625224
fbshipit-source-id: e952f3f52de8081a0773ef3a01e1259c3be67a92