Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39277
When we were reworking the Build logic in CI, we thought that the `test_ios` job and the `test_ios_rntester` jobs were the same. But, actually, they aren't.
So, now, we are seeing failures in the `test_ios` because its caches are not updated.
This changes remove the duplication of the two jobs, making sure that they use the same job, adding the possibility to run tests directly in rntester.
## Changelog:
[Internal] - Reuse test_ios_rntester to run iOS tests
Reviewed By: motiz88
Differential Revision: D48950096
fbshipit-source-id: e297d77fbd18f03873ed7a16a595e186d0e2453a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39306
This broke on Android platforms where `ReactFeatureFlags.enableViewRecycling` is enabled, as `setTransform` no longer directly mutates the transform properties, but instead goes through `setTransformProperty`
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D49008194
fbshipit-source-id: 7e5543b8ce79caaaf380f20010bdde69f6e212b1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39311
## Changelog:
[Internal] -
Follow up to https://github.com/facebook/react-native/pull/39284 (D48960815), which landed and broke one of the build clauses on CircleCI tests (treating unused parameters as errors, even though they are expected to be unused).
Reviewed By: hoxyq
Differential Revision: D49010472
fbshipit-source-id: 469bf3a9923b85e465d4574e69e9372c16fbc125
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39307
Make it explicit that the second arg for the State update constructor is the old State object, which we use to increment the revision.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D49008431
fbshipit-source-id: 649bdd136a4a6eb25858d8bfb7c41b725e593685
Summary:
We're well past a minimum iOS 10 / macOS 10.11 version. Let's remove these ifdefs that seemed to have been added for backwards compatibility around the use of [ArrayBuffers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
## Changelog:
[IOS] [REMOVED] - Remove redundant ifdefs for ArrayBuffer backwards compatibility
Pull Request resolved: https://github.com/facebook/react-native/pull/39302
Test Plan: CI should pass.
Reviewed By: rshest
Differential Revision: D49007666
Pulled By: javache
fbshipit-source-id: 03ebe303eda45ce043e3c2f9e2a5165ba798b15c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39300
Changelog: [Internal]
`ReactCommon/hermes/inspector` and `ReactCommon/jsinspector` are unused in the React Native repo as of D48897203 and D48966244, respectively. Now that we've removed the last remaining references to them from internal Meta code, we can safely delete them from React Native.
Reviewed By: christophpurrer
Differential Revision: D48983212
fbshipit-source-id: 9a70178b19fb461c00a2304697b647b7bebe74c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39288
Forks `ReactCommon/jsinspector` → `ReactCommon/jsinspector-modern`.
The Gradle, CocoaPods and Buck builds of React Native have been updated to use `jsinspector` everywhere (outside of `ReactCommon/hermes/inspector`, which is itself dead code as of D48897203). The code in `ReactCommon/jsinspector` is thus deprecated and unused in the open source build, and will be deleted in an upcoming diff (likely before the 0.73 cut).
Changelog: [Internal]
Reviewed By: blakef
Differential Revision: D48966244
fbshipit-source-id: db81739da83ef9be73690d95d010065e3b3441c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39298
Previously, switches were being announced using Talkback in this order: [state][role][label] but they should be announced as [state][label][role].
Reviewed By: NickGerleman
Differential Revision: D48807314
fbshipit-source-id: e827b9ca6d3b61b5bd2884f0f0ce6ddae00bb7df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39293
This QE is meant to change behavior to not throttle if `scrollEventThrottle` isn't set, but it's actually disabling throttling entirely.
This changes the gating to instead change the initialization path to set `_scrollEventThrottle = 0` when the QE is set.
`_scrollEventThrottle` is already set to zero when the `scrollEventThrottle` prop is removed/set to null, as the default value in ScrollViewProps.
Changelog: [internal]
Reviewed By: sammy-SC
Differential Revision: D48968754
fbshipit-source-id: c46c7f5093a60e326267c2e5f2f86dc2d545ac7f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39195
X-link: https://github.com/facebook/yoga/pull/1352
## This diff
This splits out all of the logic under `YGNodeCalculateLayout` to a couple of different files, does some mechanical renaming, and starts to split up the implementation a tiny bit. After this, core layout functions are all C++ convention and namespaced.
Each new file is marked as a move for the sake of blame history. It means Phabricator has a very inaccurate count of lines removed though.
## This stack
The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers
This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes
This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.
These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.
Reviewed By: rshest
Differential Revision: D48770478
fbshipit-source-id: 2a74b86441c3352de03ae193c98fc3a3573047ed
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39262
The use_hermes condition in React core was imprecise as using hermes is the default now. So, if USE_HERMES is not defined, then we are using hermes.
## Changelog:
[iOS][Fixed] - Use the right condition in React-Core for USE_HERMES.
Reviewed By: dmytrorykun
Differential Revision: D48907854
fbshipit-source-id: daeaa1782f23e0ab3992240e70f49ff0b2fd75de
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39261
This change allow us to control whether we want to install flipper or not in RNTester using an env var.
This is just a simple quality of life change to speed up local testing.
## Changelog:
[Internal] - Allow to control whether to install Flipper or not from an env variable
Reviewed By: dmytrorykun
Differential Revision: D48907743
fbshipit-source-id: ef0f9362890e2d66be55018622f9b3bf9620bd95
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39227
Changelog: [Internal]
1. Adds an `unstable_experiments` option to `createDevMiddleware` in `react-native/dev-middleware`.
2. Adds `enableCustomDebuggerFrontend` (default `false` for now) as an experiment flag controlling whether the new debugger frontend (D48680624, D48682302) is in use. We plan to enable this by default in RN 0.73 after additional testing.
If enabled, the new debugger frontend will only be used for the `/open-debugger` flow
Reviewed By: huntie
Differential Revision: D48602725
fbshipit-source-id: 598865b559478df1f19420daf3633ee6c233362a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39201
X-link: https://github.com/facebook/yoga/pull/1353
## This diff
This moves and renames `YGAssert`, and removes it from the public API, since external users should not need to call into internal Yoga assert functions, and the current API prevents us from making this a macro later to include the condition in the message.
## This stack
The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers
This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes
This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.
These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.
Reviewed By: rshest
Differential Revision: D48769809
fbshipit-source-id: b5480ac54781bc01b00c158b07d2d751fac87d37
Summary:
X-link: https://github.com/facebook/yoga/pull/1355
Pull Request resolved: https://github.com/facebook/react-native/pull/39198
## This diff
This splits up `Yoga-internal.h` which has become a grab bag. The actual header is left, with the purpose of being a private C ABI for bindings, but everything else is moved to a place more appropriate or removed.
A few notes:
1. `yoga::isUndefined` is replaced with `std::isnan` to avoid a layer of indirection (we will never be able to change its representation anyway). Internal usages of `YGFloatIsUndefined` are also replaced with `std::isnan` since the previous being at a library boundary means I'm not sure it can be inlined/.
2. `leading`, `trailing` arrays are factored into proper functions
3. `Values` is replaced entirely with `std::array`, since most of it was unused.
## This stack
The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers
This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes
This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.
These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.
Reviewed By: rshest
Differential Revision: D48769241
fbshipit-source-id: 5b8e2192309539e7c133c3b3b29b445b59dd5835
Summary:
This changes Clang format config to enforce left pointer alignment instead of right, in accordance with https://www.internalfb.com/intern/wiki/Cpp/CppStyle/
Changelog: [Internal]
bypass-github-export-checks
Reviewed By: sammy-SC
Differential Revision: D48952040
fbshipit-source-id: 108329b2f11d2041a31dee3334c7801d69a3f1ad
Summary:
Currently Android fails to build on Windows, because CMake cannot work with
native Windows paths that are passed to it as build arguments. This change
converts the input paths to the CMake format.
## Changelog:
[Android] [Fixed] - Fix building Android on Windows.
Pull Request resolved: https://github.com/facebook/react-native/pull/39190
Test Plan: Build the React Native Android project on Windows. It should complete successfully.
Reviewed By: NickGerleman
Differential Revision: D48948140
Pulled By: cortinico
fbshipit-source-id: 6d584c2a10e683cdb6df0dd6dcd5875da7e06e2b
Summary:
I've seen that this throws a warning:
```
<ImageBackground source={{ uri: undefined }}>
```
But this is properly working, without a warning, thus, I believe the code is allowing it:
```
<ImageBackground source={isLoading ? undefined : { uri: 'https://....' }}>
```
## Changelog:
[GENERAL] [CHANGED] - Fixed `source` in `Image` type
Pull Request resolved: https://github.com/facebook/react-native/pull/39230
Test Plan: Not necessary. It's just a DOC change
Reviewed By: rshest
Differential Revision: D48939824
Pulled By: NickGerleman
fbshipit-source-id: fca2e07b7b4d4b947e365bb9d82fcf4cea484951
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39253
X-link: https://github.com/facebook/hermes/pull/1112
Changelog: [Internal]
Forks `ReactCommon/hermes/inspector` → `ReactCommon/hermes/inspector-modern`. More changes to `inspector-modern` will come in subsequent diffs.
The Gradle, CocoaPods and Buck builds of React Native have been updated to use `inspector-modern` everywhere. The code in `ReactCommon/hermes/inspector` is thus **deprecated** and unused in the open source build, and will be deleted in an upcoming diff (likely before the 0.73 cut).
NOTE: The reason we're not immediately deleting `ReactCommon/hermes/inspector` is that there are a handful of references to it in Meta's internal monorepo (*outside of React Native*) that we are in the process of migrating away. Once we've deleted the existing `ReactCommon/hermes/inspector`, we *may* rename `inspector-modern` back to `inspector`.
Reviewed By: blakef
Differential Revision: D48897203
fbshipit-source-id: 13682747d280a3231b7f6bce560f25ad174304e9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39264
X-link: https://github.com/facebook/hermes/pull/1113
Since C++20, the type of a `u8"..."` string literal is `const char8_t[N]` whereas prior to C++20 the type is `const char[N]`. `char8_t` has the same size, alignment, and signedness as `unsigned char` but is a different type from `unsigned char`, as well as being a different type from `signed char` and from `char`.
In context, the uses of the `u8"..."` expect `const char*` (to which `const char[N]` decays) and not `const char8_t*` (to which `const char8_t[N]` decays). To fit the string to the context since C++20, we must `reinterpret_cast` to `const char*`; this is a type-level no-op prior to C++20.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D48908076
fbshipit-source-id: e68d8fc4ff9dfb9528846901e37e2775c2b98866
Summary:
Previously, when you tried to create some styles using `StyleSheet.create`, you can create styles with invalid styles:
```ts
const styles = StyleSheet.create({
container: {
marginLeft: 1,
magrinRight: 1, // This is a typo, but would not cause typecheck errors
},
});
```
The root cause is that Typescript uses a looser [Excess Property Checks](https://www.typescriptlang.org/docs/handbook/2/objects.html#excess-property-checks) if we're using template types rather than using the actual specific types in the function signature.
- https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/62481
## Changelog:
[INTERNAL] [FIXED] - Make StyleSheet.create better check property keys for typos
Pull Request resolved: https://github.com/facebook/react-native/pull/39225
Test Plan: Added a test in __typeTests__, which should get run by CI.
Reviewed By: rshest
Differential Revision: D48859679
Pulled By: NickGerleman
fbshipit-source-id: 43aa69cf85cd69353d053b782dba73ab2027eb64
Summary:
This PR adds transform-origin support for android to make it easier to review. https://github.com/facebook/react-native/pull/37606#pullrequestreview-1513082850 by javache. I'll answer feedback from javache below.
## Changelog:
[Android] [ADDED] - Transform origin
<!-- 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/38558
Test Plan: Run iOS RNTester app in old architecture and test transform-origin example in `TransformExample.js`.
Reviewed By: NickGerleman
Differential Revision: D48528339
Pulled By: javache
fbshipit-source-id: e255a7f364e57396dada60b2c69c724cec406f51
Summary:
This PR adds transform-origin support for iOS fabric. This PR also incorporates feedback/changes suggested by javache in the original [PR.](https://github.com/facebook/react-native/pull/37606)
## Changelog:
[IOS] [ADDED] - Fabric Transform origin
<!-- 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/38559
Test Plan: Run iOS RNTester app in old architecture and test transform-origin example in `TransformExample.js`.
Reviewed By: NickGerleman
Differential Revision: D48528363
Pulled By: javache
fbshipit-source-id: 347b7c5896ad19ad24278de81b0e055e4cb01016
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39239
We can avoid static guards and heap allocation memory by forcing a default initialized shared_ptr (which is constexpr), and telling the compiler to not bother with registering a destructor, as these shared_ptr will never hold a value.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D48867013
fbshipit-source-id: c31f535bb19382878c9f21d7145188bd91b63265
Summary:
Seems to be invalid given the other jsi import
Pull Request resolved: https://github.com/facebook/react-native/pull/39247
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D47380384
fbshipit-source-id: 226a3e213176e50b4c882b5ea3f10c57130bd494
Summary:
https://github.com/facebook/react-native/pull/38963 introduced a regression that breaks downloading hermes tarball for nightlies. It fails with the following error when running `pod install`:
```
Fetching podspec for `hermes-engine` from `../../../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`
[!] Failed to load 'hermes-engine' podspec:
[!] Invalid `hermes-engine.podspec` file: undefined local variable or method `react_native_path' for Pod:Module
Did you mean? react_native_post_install.
```
The root cause is that the `download_nightly_hermes` method was just not implemented.
## Changelog:
[IOS] [FIXED] - Fixed downloading hermes tarball for nightlies
Pull Request resolved: https://github.com/facebook/react-native/pull/39243
Test Plan: After applying these changes, `pod install` in my project no longer fails and downloads the tarball correctly.
Reviewed By: dmytrorykun
Differential Revision: D48897925
Pulled By: cipolleschi
fbshipit-source-id: a504f01b739862bd092f22bca1f240f6df3a6df8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39251
As `react-native/babel-preset` is extended to include parts of codegen (written in Flow) via `react-native/babel-plugin-codegen`, we need to register Babel (with a Node JS config) in order to load the `react-native/babel-transformer` that Jest needs to transform RN code when running from source.
(This is *only* relevant to running from source, ie internally at Meta or when developing on a clone of the OSS repo)
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D48871440
fbshipit-source-id: 2f206b2380d67007e37782f211a6e831b35291f8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39246
Appears to no longer be used
Reviewed By: boxinYang
Differential Revision: D48872901
fbshipit-source-id: 3fd376b30304a1dc643ef77ffa503376dbbab7e7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39202
This diff adds `PerformanceStatsHistory.kt` which is used to track performance stat in buckets with resolution (in ms) and size. This is to help group perf stats in a time series data structure that we can adapt to any visualization in the future.
Changelog:
[Internal] - Performance monitoring overlay improvements
Reviewed By: rshest
Differential Revision: D48657874
fbshipit-source-id: 3e3fe7c50db6672b1eff117a36f0de72a774fc96
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39242
Reverts external behaviour of https://github.com/facebook/react-native/pull/39122.
- `/json/list` once again returns the built-in `devtools://devtools/bundled/js_app.html` URL — effectively freezing the current experience in Flipper.
- `/open-debugger` continues to use the *new* frontend via `getDevToolsFrontendUrl`.
- *Eventually*, we'll want to align this as the returned `devtoolsFrontendUrl` value once Flipper is out of the picture.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D48868767
fbshipit-source-id: 088ecebffa6ce45cb9bed44e3b02df4b7b471068
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39238
This does nothing useful. Let's get rid of it.
Changelog: [Internal]
Reviewed By: philIip
Differential Revision: D48833211
fbshipit-source-id: 0b6937f83148bb2ddc66212d2669e72887430364
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39226
Changelog: [Internal]
Syncs a custom build of the Chrome DevTools frontend (performed using the script in D48680624) into the `react-native/debugger-frontend` package. **The package is not used anywhere yet.** In a subsequent diff, it will be integrated into `react-native/dev-middleware`.
Review the `BUILD_INFO` file for information about the source revision and build settings that were used to generate this diff.
Reviewed By: huntie
Differential Revision: D48682302
fbshipit-source-id: 50ea532f45d8c751c141d5f4253afe080af31559