Summary:
As discussed with huntie, this is not a breaking change.
Changelog:
[Internal] [Changed] -
bypass-github-export-checks
Reviewed By: huntie
Differential Revision: D71201094
fbshipit-source-id: 3a27e621ac7718e4574c7981e5d64802e36e74cd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50035
changelog: [internal]
to make it easier to write JSDocs, let's export functions directly from index.js instead of using proxy object.
Reviewed By: rubennorte
Differential Revision: D71200977
fbshipit-source-id: 0b53c0d3f73577c19253537b9e884459a4920643
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50022
RCTHostTests.mm calls `makeHermesRuntime`, which is from `hermes.h`. Explicitly include the header so that RCTHostTests isn't getting it indirectly.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D71146426
fbshipit-source-id: 5a5f5a466e1920797c4531773ca23f53eb1203b7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50033
changelog: [internal]
All public APIs should be covered with tests, this diff adds tests for Fantom.scheduleTask.
Reviewed By: rubennorte
Differential Revision: D71195921
fbshipit-source-id: dc7f0f889b9633b1e641dc8887fd506bc4753fe5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50013
The diff incorporates event-target-shim types that will be referenced by generated TS types to make sure that the public API does not change unexpectedly. The generated tsconfig contains path property which tells Typescript to use copied types instead of the downloaded event-target-shims types.
Changelog:
[internal] - Moved event-target-shim types to react-native package.
Reviewed By: huntie
Differential Revision: D71044389
fbshipit-source-id: b2837cc880a2161f7ff716470fd6eb4644d514e2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50019
Changelog: [internal]
This adds some basic tests for the API to show that it's working correctly.
This was in response to https://github.com/facebook/react-native/issues/49684. If there are use cases that we think are incorrectly handled, we should add them to this test.
Reviewed By: cortinico
Differential Revision: D71128943
fbshipit-source-id: 73876ba514c23ec8f829723500fa408512b90222
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49942
iOS flushes NativeAnimated operations to the UI thread in one of two ways:
1. Some operations flush immediately when the operation is queued, namely startAnimation, stopAnimation, and setValue.
2. Other operations rely on flushing from one of the previous operation types, or a UIManager mount callback.
This behavior leads to non-determinism in flushing of some operations like `setOffset` or `startListeningToAnimatedNodeValue`, where if these operations are created, out-of-band from "flushed" operations, they will not take affect until the next React commit.
This change wires up the `animatedShouldSignalBatch` feature flag to queue operations on the JS thread, and flush them after `NativeAnimated.finishOperationBatch` is called.
## Changelog
[Internal]
Reviewed By: javache
Differential Revision: D70904592
fbshipit-source-id: 6bc7a8614cbe5e275d4d7bf5310da9f0090c0e10
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49989
Changelog: [internal]
This experiment didn't yield any significant wins and there are some failing e2e tests which seem suspicious, so better be safe and keep the current version.
Reviewed By: javache
Differential Revision: D71050517
fbshipit-source-id: da14fdd49e8d39cdcdc1dd579a50af3bf894d08a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50014
This was unintentionally made public during the Kotlin migration (D67791375), revert back to internal visibility, and update some of the deprecation comments.
Changelog: [Android][Removed] TouchesHelper is no longer part of the public API
Reviewed By: Abbondanzo
Differential Revision: D71114176
fbshipit-source-id: 2bd8882039fb972e1c2632a503292080c56a2f22
Summary:
If you use this preset to create library code, it is often helpful to be able to still read the transpiled code, even when sourcemaps are available.
This change adds a compact option which allows for disabling the default behavior that removes whitespace from the transpiled files.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[GENERAL] [ADDED] - Add `compact` option to `react-native/babel-preset` to allow disabling whitespace removal
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/49979
Reviewed By: rshest
Differential Revision: D71109024
Pulled By: robhogan
fbshipit-source-id: ab205cca2a82b56955d1e1c55e288dcbe7754f8f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50002
Creates a new feature flag, `avoidAnimatedRefInvalidation`, to experiment with changing `useAnimatedProps`, so that the returned ref callback is no longer invalidated when `props` changes.
When we introduced `useAnimatedPropsMemo` and stabilized `AnimatedProps` (which is only invalidated when `AnimatedValue` and shallow `AnimatedEvent` instances are changed in an update), we should have also made this change. It was an oversight that we did not do this.
Avoiding unnecessary invalidation of the ref callback is important to reduce extra work and unpredictable semantics associated with unnecessary detaching and re-attaching of refs.
Changelog:
[Internal]
Reviewed By: lunaleaps, jbrown215
Differential Revision: D71074781
fbshipit-source-id: 82386a79b8e9bed0b74d9b85978af66f453a7ad0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49991
This change adds nightly support for prebuilds.
t works the same way hermes works: if the react native version contains nightly, we try to use that version to download the right tarball.
To work, it needs to use the `RCT_USE_RN_DEP` env variable.
## Changelog
[Internal] - Add Nightly support to consume ReactNativeDependencies
Reviewed By: cortinico
Differential Revision: D71050926
fbshipit-source-id: 9f461b5f17fde960d92b4082bc60f76959e82cdf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49978
This change connects the RNDependencies we prebuild in CI with the other iOS jobs we have.
By doing so, we aim to speed up the build time in CI, saving time and money.
## Changelog:
[Internal] - Connect the ReactNativeDependencies in CI
Reviewed By: cortinico
Differential Revision: D71034587
fbshipit-source-id: 14f1237f4fb57ee103a80be1718042d66ff7b0d7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49970
This change add supports to pass a tarball from a local file to the ReactNativeDependencies podspec, so that we can build React Native using a local copy or the RNDependencies and we can use it also in CI.
## Changelog:
[INTERNAL] - Add support for local tarballs
Reviewed By: cortinico
Differential Revision: D71032641
fbshipit-source-id: d83c96c8c12f3add45f8f5ea15fa0eac06d0bedf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49968
Updates all the core podspec to use the new `ReactNativeDependencies` podspec
## Changelog:
[INTERNAL] - Updates Modules in core to use the new dependencies.
Test Plan:
✅ Run Rn-Tester and verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities
Reviewed By: cortinico
Differential Revision: D71032639
Pulled By: cipolleschi
fbshipit-source-id: e53179a8c1b47ee2b945f5cb5dfaf3f6f2755af2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49971
Updated the Cocoapods infrastructure to use the new the `ReactNativeDependencies.podspec`
## Changelog:
[INTERNAL] - Configured the Cocoapods infra to use the new `ReactNativeDependencies.podspec`
Test Plan:
✅ Run Rn-Tester and verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities
Reviewed By: javache, cortinico
Differential Revision: D71032638
Pulled By: cipolleschi
fbshipit-source-id: 154c8891d5b8b4b84952274c169479122a4800b1
Summary:
There are two environment variables that is related to ReactNativeDependencies:
- `RCT_USE_DEP_PREBUILD `: If set to 1, ReactNativeDependencies will be built from source.
- `RCT_DEPS_VERSION`: If set to 1, it will override the version of ReactNativeDependencies to be used.
bypass-github-export-checks
## Changelog:
[INTERNAL] - Introduced functions to configure ReactNativeDependencies in Cocoapods
Pull Request resolved: https://github.com/facebook/react-native/pull/49812
Test Plan:
✅ Run Rn-Tester and verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities
Reviewed By: javache
Differential Revision: D70968672
Pulled By: cipolleschi
fbshipit-source-id: bb93e763bd71cec7314565b5a751b226735b404e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49969
Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.
## Changelog:
[INTERNAL] - Configure folly in a prepare step
Test Plan:
✅ Run Rn-Tester and verify that it works as expected both building deps from source and using prebuilt tarballs
✅ Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities
Reviewed By: javache
Differential Revision: D71032640
Pulled By: cipolleschi
fbshipit-source-id: a34a9b38fa5d5b37a0a193a73659f0d45dd3d660
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50008
The diff adds extraction of triple-slash directives using regex to match and retrieve following reference.
Changelog:
[internal] - Added support for triple-slash directives in generated .d.ts files
Reviewed By: huntie
Differential Revision: D71113674
fbshipit-source-id: 2207d5b455515c44ba585ffecc063914e0818e58
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50011
changelog: [internal]
Majority of time, you want to simply scroll. This diff introduces a convenience method Fantom.scrollTo.
Previously, you would have to write:
```
Fantom.runOnUIThread(() => {
Fantom.enqueueScrollEvent(element, {
x: 0,
y: 60,
});
});
Fantom.runWorkLoop();
```
Now, you can just do:
```
Fantom.scrollTo(element, {
x: 0,
y: 60,
});
```
Reviewed By: rubennorte
Differential Revision: D71113680
fbshipit-source-id: aed49a2f12be8ab30be549235cc7a2b3e35faadb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50009
changelog: [internal]
rename method `scrollTo` to `enqueueOnScrollEvent` to make it obvious that event is only enqueued and not executed.
Reviewed By: rubennorte
Differential Revision: D71027761
fbshipit-source-id: 8a22babc2f5e86196c0b0af75ab65d539048dc72
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49975
Removes the "Plugins" category from the non-structural grouping of exports in `index.js`, `index.js.flow`, aligning these with the "APIs" and "Components" categories in our docs.
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D71033295
fbshipit-source-id: bd39bb6ff5e30c1ed0a8d56d1ed61d52120fb776
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49990
Changelog: [internal]
This cleans up the flag and makes the Document API essentially part of the DOM APIs flag, after we've verified this is stable in a production experiment.
Reviewed By: sammy-SC
Differential Revision: D68772174
fbshipit-source-id: 3b3d0c4369a648faab3dc7caed8eec2c95fa05b3
Summary:
Android's onAnimationEnd callback is lossy and ocasionally just does not fire. However the LayoutAnimationController maintains a sparse array of animations (with Strong View refs) that is only cleaned when the onAnimationEnd callback is invoked. This results in a leak of Android View objects over time.
To avoid this, the Strong View refs are migrated to WeakReference's and the associated sparse array is cleaned of any invalid layout animations in response to the reset() call.
This closes two leaks:
1. Unbound growth in LayoutAnimationController::mLayoutHandlers
2. Pinning View objects into memory as the sole remaining GC root
## Changelog:
1. Made OpacityAnimation and PositionAndSizeAnimation classes hold weak refs to views only
2. Added a method to LayoutHandlingAnimation to surface if their view ref is gone
3. Added cleanup for Animation with bad view refs
Pick one each for the category and type tags:
[ANDROID] [Fixed]- Fixes memory leak
Pull Request resolved: https://github.com/facebook/react-native/pull/49959
Test Plan: * Primarily code inspection and regression given the intermittent nature of Android's failure to execute the callback.
Reviewed By: alanleedev
Differential Revision: D71037262
Pulled By: javache
fbshipit-source-id: 1fa4eaa2ca839f347a55cb37e2648db972748586
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50001
Updates `react-native/.flowconfig` with the following option:
```
react.runtime=automatic
```
This adjusts Flow to model the current behavior of React and JSX, relaxing the requirement that JSX elements have `React` within scope.
Changelog:
[General][Changed] - Changed Flow for the React Native monorepo, so that `React` no longer has to be in scope when using JSX.
Reviewed By: javache
Differential Revision: D71096283
fbshipit-source-id: 65762ac39206c682b7be5d3f512b2b83f7eb1b49
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50000
This adds some tests that verify that controlled textinput, via text prop, or children creating attributedstring, does not jumble text, so long as JS side does not mutate underlying text content.
The rewriting/max length example does still run into problems here.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D71076703
fbshipit-source-id: 85995e8cc087533b1115f158ba5dad67ed008289
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49999
Changelog: [Internal]
Early initialize call to RCTScreenSize which is used by Modal and will read screen size off the UI Thread to avoid main thread deadlocks
Reviewed By: sammy-SC
Differential Revision: D70999156
fbshipit-source-id: 47fb8666c3330ee67cbcb430060f0cec37ec3c7c
Summary:
We were missing some null checks that could cause a crash.
There seems to be some cases where either the parent or the currently focused View are present on Android's hierarchy but not present on the Shadow Tree, in this cases we can just return a nullptr to fall back to default focusing behavior on Android.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D71050870
fbshipit-source-id: a4b4e533c4e9a59c53190feb4b23db4b436b8ae9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49987
I went through the whole changelog for 0.79 and applied categories to all the entries + did some significant cleanup (remove some entries that were actually internals, grouped and sorted various items)..
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D71003373
fbshipit-source-id: 5a95e619f1cf2ffc84263b92104efee16fd74e53
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49941
This diff introduces annotations into the ios codegen config!
## Before
In the new architecture, people can declare module/component codegen config in [package.json](https://reactnative.dev/docs/the-new-architecture/using-codegen#configuring-codegen)
This config contains the following maps:
- modulesConformingToProtocol
- modulesProvider
- componentProvider
```
"codegenConfig": {
"name": "HelloWorldSampleModule",
"type": "all",
"jsSrcsDir": "specs",
"android": {
"javaPackageName": "com.helloworld"
},
"ios": {
"modulesConformingToProtocol": {
"RCTImageURLLoader": [
"RCTHelloWorldImageURLLoader"
],
"RCTURLRequestHandler": [
"RCTHelloWorldURLRequestHandler"
],
"RCTImageDataDecoder": [
"RCTHelloWorldImageDataDecoder"
]
},
"modulesProvider": {
"HelloWorldImageURLLoader": "RCTHelloWorldImageURLLoader",
"HelloWorldURLRequestHandler": "RCTHelloWorldURLRequestHandler",
"HelloWorldImageDataDecoder": "RCTHelloWorldImageDataDecoder"
},
"componentProvider": {
"FooComponent": "RCTFooComponentClass"
}
}
```
## After
This information is a little bit easier to understand if we group it by module/component (into **annotations**):
(that's what this diff does!)
```
"codegenConfig": {
"name": "HelloWorldSampleModule",
"type": "all",
"jsSrcsDir": "specs",
"android": {
"javaPackageName": "com.helloworld"
},
"ios": {
"modules": {
"HelloWorldImageURLLoader": {
"conformsToProtocols": ["RCTImageURLLoader"],
"className": "RCTHelloWorldImageURLLoader"
},
"HelloWorldURLRequestHandler": {
"conformsToProtocols": ["RCTURLRequestHandler"],
"className": "RCTHelloWorldURLRequestHandler"
},
"HelloWorldImageDataDecoder": {
"conformsToProtocols": ["RCTImageDataDecoder"],
"className": "RCTHelloWorldImageDataDecoder"
}
},
"components": {
"FooComponent": {
"className": "RCTFooComponent"
}
},
}
```
## Migration
The old way is still supported (for now). We will deprecate it soon, and eventually remove it from react native!
Changelog: [iOS][Added] - Codegen: Introduce module/component annotations inside package.json
Reviewed By: mdvacca
Differential Revision: D70822061
fbshipit-source-id: 87ec5664a551c54b9300ba92987f237a601ccfbf
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49940
This will just make sure that we don't unintentionally break this script.
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D70919549
fbshipit-source-id: 6d9f2acca46486f1c920afed69609c70f53e6b18
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49992
changelog: [internal]
View culling does not play along with view flattening/unflattening. This diff adds a test case for it + fix. Previously, view culling would crash.
There are still untested branches of view flattening/unflattening where I am trying to come up with test cases.
Reviewed By: rubennorte
Differential Revision: D71047032
fbshipit-source-id: 9f52473743755e49e4bfda0783803cb79591ca27
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49908
There are various batching mechanisms across react-native platforms. The NativeAnimated startOperationBatch and finishOperationBatch methods are a useful way to signal that complete animation graphs are established for atomic flushes to the UI thread.
Setting up this feature flag for use across non-Android React Native platforms.
## Changelog
[Internal]
Reviewed By: javache
Differential Revision: D70827938
fbshipit-source-id: 4c4a74e9a11f75090152637d6195092f5af866a0