Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48927
changelog: [internal]
Remove explicit calls to root.destroy() in favour of automated system that will call it and check for memory leaks.
Reviewed By: rubennorte
Differential Revision: D68624917
fbshipit-source-id: 44be1dee9a56ec31bea5a9eefdda086a4cb4248f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48889
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates files in `Libraries/Core` to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections
- Appends `.default` to requires of the changed files.
- Changed `* as ExceptionsManager` to `ExceptionsManager` in import statements throughout product code.
- Updates test files.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/Core` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
[General][Breaking] - `Libraries/Core/ExceptionsManager` now exports a default `ExceptionsManager` object, and `SyntheticError` as a secondary export.
Reviewed By: huntie
Differential Revision: D68553694
fbshipit-source-id: 51c9a404b2762cb1cdb5f56cae3a683ccdfffc7f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48854
Changelog: [internal]
Moves the internals to access instance handle and shadow node from public instances from `ReadOnlyNode` to `NodeInternals` so it's more obvious when people are reaching into internal APIs/state.
Reviewed By: javache
Differential Revision: D67654404
fbshipit-source-id: 1063bc9451eeacb79af34614df3be02466f93fa3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48795
# Changelog: [Internal]
Splitting `PerformanceTracer::stopTracingAndCollectEvents()` into 2 separate methods.
Once we add logic for starting and stopping tracing on `InstanceAgent`:
- We would need to stop tracing everywhere synchronously
- Populate data sources in `PerformanceTracer`, like JavaScript samples
- Collect all events from different data sources in one payload via `PerformanceTracer::collectEvents()`
Reviewed By: huntie
Differential Revision: D68331485
fbshipit-source-id: 0d6b21a522d841f7f734e2fad2e0fc533097fdee
Summary:
On older Android versions clipping doesn't have anti-aliasing by default which means that clipping with no border will always make the background not have anti-aliasing.
This is fixed by default on new Background and Border drawables since rendering logic is separated
Moving the clipping logic so it only runs when we have a border.
https://github.com/facebook/react-native/issues/41226
Changelog: [Android] [Fixed] - Fixed anti-aliasing not showing on older Android versions
Reviewed By: javache
Differential Revision: D68279400
fbshipit-source-id: e2383c71bd1ca89f66f42630b3712bb4cc5cd7ac
Summary:
This was causing links to not ellipsize and be scrollable. Gonna revert while I see if I can workaround
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D68596950
fbshipit-source-id: 432a059d0b10acbb45d34e0c98763680d280937b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48872
enableDeletionOfUnmountedViews feature flag has been enabled for 4 months with no errors on production, also it's been enabled in OSS since 0.76.
This diff removes the feature flag and fully rollout this fix
bypass-github-export-checks
changelog: [internal] internal
Reviewed By: sammy-SC
Differential Revision: D68511227
fbshipit-source-id: a42481c57aaab2e8c45b952af5e044bf60740df3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48843
Adds support for hsl() and hsla() funtions. This supports more modern syntax options than normalize-color, like number components, optional alpha, and fills in missing support for angle units. The underlying math was lifted pretty much directly from normalize-color though.
An aside, std::remainder for these is not guaranteed to be constexpr, but Clang is still okay with rgb function parsing to be contexpr because we never try to evaluate non-constexpr function?
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68473990
fbshipit-source-id: 2a71d8367b22f9d1ba6a66598d40ef2683847704
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48842
This is a result of inlining isinf previously but we can never be negative infinity because we can never be less than zero.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68474836
fbshipit-source-id: bfce78c4bd269ff2afac99c03250ede676ee1029
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48841
Right now during parsing we can ask for a next component value, with a delimeter, and even if we don't have a component value to consume, we will consume the delimeter.
This is kind of awkward since e.g. trailing comma can be consumed, then we think syntax is valid. Let's try changing this.
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68474739
fbshipit-source-id: 47a942681bc8472ca28470eba821d4d95306ae5d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48839
In the last diff I mixed and matched `<legacy-rgb-syntax>` and `<modern-rgb-syntax>` a bit to keep compatiblity with `normalze-color`.
Spec noncompliant values have only been allowed since https://github.com/facebook/react-native/pull/34600 with the main issue being that legacy syntax rgb functions are allowed to use the `/` based alpha syntax, and commas can be mixed with whitespace. This seems like an exceedingly rare real-world scenario (there are currently zero usages of slash syntax in RKJSModules validated by `rgb\([^\)]*/`), so I'm going to instead just follow the spec for more sanity.
Another bit that I missed was that modern RGB functions allow individual components to be `<percentage>` or `<number>` compared to legacy functions which only allow the full function to accept one or the other (`normalize-color` doesn't support `<percentage>` at all), so I fixed that as well.
I started sharing a little bit more of the logic here, to make things more readable when adding more functions.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D68468275
fbshipit-source-id: f1dfab51b91a3f64436c2559daa3d1e8891db889
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48828
1. Rename `CSSComponentValueDelimeter` to `CSSDelimeter` bc the names are getting way too long.
2. Make the distinction between `Whitespace` and `OptionalWhitespace`. Note that for property values, and function blocks, the value parser will already remove trailing/leading whitespace, but it's weird that whitespace unlike others was not required to be present
3. Add `CSSDelimeter::CommaOrWhitespaceOrSolidus` for simpler parsing in the common pattern of alpha values, and move CSSColor function parsing to use that
Changelog: [Internal]
Reviewed By: lenaic
Differential Revision: D68461968
fbshipit-source-id: 388056e47dfe6ca6003b44e82e00fe416706330b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48835
D65907786 ended up regressing a bit of the performance gains from new Background and Border Drawables. changing back to the previous approach.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D68354292
fbshipit-source-id: f2db6d7ad5c1590d5d4d8261d76281f3592f488a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48891
changelog: [internal]
add two tests covering onScroll: one for the case where onScroll is triggered multiple times during one UI tick and one where it is triggered once per UI tick.
Reviewed By: rubennorte
Differential Revision: D68499566
fbshipit-source-id: ee25227b620569e3a43038575f04b0a325e5e38b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48801
changelog: [internal]
Adds isUnique option to Fantom.dispatchNativeEvent.
isUnique controls whether only the last event of the same type and target is dispatched to JavaScript or all events are queued and dispatched.
Reviewed By: rubennorte
Differential Revision: D68416157
fbshipit-source-id: 415e7db7d258d60a6bc510d929091153bfdccb3f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48888
We have a report from OSS where Images are not displayed properly in case they are saved on disk with no extension.
We previously had a fix attempt iwith [this pr](https://github.com/facebook/react-native/pull/46971), but this was breaking some internal apps.
This second attempt should work for both cases.
## Changelog:
[iOS][Fixed] - Load images even when the extension is implicit
Reviewed By: cortinico
Differential Revision: D68555813
fbshipit-source-id: bc25970aafe3e6e5284163b663d36e00b3df3d82
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48896
This comment is not exact and should be updated.
Changelog:
[Internal] [Changed] -
Reviewed By: yungsters
Differential Revision: D68556425
fbshipit-source-id: 67427ff325809907fdeba1c6a90b84b97713bf5e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48894
## Motivation
In our efforts to migrate the RN codebase to modern Flow (to enable ingestion by modern Flow tooling) I stumbled upon the `AnimatedWeb.js` file, which does not seems to be imported anywhere throughout the monorepo.
Searching on GitHub for imports to this file in OSS projects returned no results.
In case this file has actual uses outside of Meta (e.g. in OSS), I'll abandon the diff 🙌
## This diff
- Removes `Libraries/Animated/AnimatedWeb.js` file
Changelog:
[General][Breaking] Removed `Libraries/Animated/AnimatedWeb.js` file.
Reviewed By: cortinico
Differential Revision: D68558237
fbshipit-source-id: 319b5e59eb83e518cd123b9f74642e90f0003a4a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48648
# Changelog: [Internal]
This is the pre-requisite before adding a formatter for conversion from Hermes format-agnostic API for JavaScript samples to Trace Events.
This struct will probably be used a lot around this module and big enough for a separate header.
Reviewed By: huntie
Differential Revision: D68104202
fbshipit-source-id: 93f2816de5a87471c5f7761468ccc52a34a895d6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48882
Changelog: [internal]
The current hint for benchmarks is that the test body contains `unstable_benchmark` calls, but some benchmarks that need to use feature flags define their test bodies in a separate file, so the file containing the call to `unstable_benchmark` isn't the `-itest.js` one.
This adds a new hint to opt into optimized builds that uses the name of the test instead of its contents. If it contains `-benchmark` then we consider it a benchmark and do the opt in.
Reviewed By: andrewdacenko
Differential Revision: D68102300
fbshipit-source-id: 4c0909969f76b8a7d563959cccf686aefaef700d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48808
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
- `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot *(intented breaking change)*
- Synchronizes `GoodwillVideoEditorCandidateImage.js` with www, as it was using `require`s that would result in invalid code after this Diff's changes. Added `ReactNativeImage` shim.
Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: yungsters
Differential Revision: D68436611
fbshipit-source-id: 14f33e375e60429ea2340fb49ddf9dc6eb79594f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48884
## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.
## This diff
- Updates files in `Libraries/WebSocket` to use `export` syntax
- Appends `.default` to requires of the changed files.
- Updates mocks.
- Updates the public API snapshot (intented breaking change)
Changelog:
[General][Breaking] - Files inside `Libraries/WebSocket` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
Reviewed By: cortinico
Differential Revision: D68554260
fbshipit-source-id: 90a660fe9e76b255171189101819253521354fda
Summary:
Found this while I was trying to make my own react native info for CI. For android Podfile.lock is being read instead of gradle.properties
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[INTERNAL][FIXED] - Fixed React native info where Podfile.lock was being read for android
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/48876
Reviewed By: blakef
Differential Revision: D68553964
Pulled By: cortinico
fbshipit-source-id: 7d6391195dab0c2230fe86fb465de6d3f94ccbef
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48815
In an effort to reduce the responsibility of Cocoapods in React Native, we are moving the generation of the Reactcodegen podspec from Cocoapods itself to the codegen infrastructure.
This reduce the responsibility of Cocoapods and allow us to migrate away from it with more ease.
## Changelog:
[iOS][Changed] - Generate the ReactCodegen.podspec as part of codegen instead of as part of pod install.
Reviewed By: cortinico
Differential Revision: D68418268
fbshipit-source-id: 004ac5b6b3563bf96cc38942f2b48b6f269541c3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48855
changelog: [internal]
add event category argument to Fantom.dispatchNativeEvent.
This gives tests option to control whether an event is continuous, discrete etc.
Reviewed By: rubennorte
Differential Revision: D68413879
fbshipit-source-id: f0c365df505a325440693ca7c3408dd612614946
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48871
# Changelog: [Internal]
Forward-fixing D68380665.
Requirements:
- `setUpReactDevTools` should be called before `setUpErrorHandling` to avoid React DevTools mutating `console.error` call arguments.
- `setUpReactDevTools` should be called after `setUpTimers`, because it is using `queueMicrotask`, see https://fb.workplace.com/groups/rn.panelapps/permalink/1120810879540337/.
- `setUpTimers` should be called after `polyfillPromise`, because it uses on `global.Promise`.
I went over bundles, which are not using `InitializeCore` and using either `setUpErrorHandling` or `setUpDeveloperTools` and updated their order of initialization accordingly.
Reviewed By: javache
Differential Revision: D68510100
fbshipit-source-id: 4331dcc7a7cb1dc438ca2ed5ccae49e736c41b2a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48773
This diff contains 2 fixes with regards to clickable text accessibility on Android.
1. It allows nested `Text` links to be accessible via keyboard. The accessibility here is a bit unique. The clickable text is not focused in the classical since that Android provides on `View`s (after all, the part being focused is not even a `TextView`. Its a `Span` in a `TextView`). However, it is [selected](https://developer.android.com/reference/android/widget/TextView#setSelected(boolean)), and pressing enter while it is selected will press the text, so for all intents and purposes it is focused. Some quirks here, though, are that you cannot press tab to cycle through the links in text, you have to use arrow keys. And the arrow keys no longer let you move around to the next item (as they are stuck being used to navigate the links). I *could* override this behavior but I do not see much of a point as long as one can actually get to everything on screen in a semi-logical way. Anyway, the fix here is using [`LinkMovementMethod`](https://developer.android.com/reference/android/text/method/LinkMovementMethod) to navigate between clickable spans, which is exactly what that class exists for. Note that I override this class so that touching the links does not actually highlight them like you see in the videos.
2. In the case we state update and remove the "click-ability" of the text, this diff makes it so that Explore By Touch no longer can focus on the link. The code was in the same area so I decided to just lump that together :P
Changelog: [Android] [Fixed] - Allow text links to be navigable via keyboard by default
Reviewed By: javache
Differential Revision: D68306316
fbshipit-source-id: a72145f6b60caf2a8077e1bd2ca987bdde0b82ab
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48794
changelog: [internal]
Add payload argument to Fantom.dispatchNativeEvent. For example, in `TextInput.onChange` event, new value of input field must be present in the event payload.
Reviewed By: rubennorte
Differential Revision: D68410469
fbshipit-source-id: eb915f9f961efdfe9902f060173072c6259b7eea
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48840
MSVC unicode handling is causing our windows test to fail. To fix,
simply replace the special characters with the their explicit UTF-16
encoding.
Changelog: [Internal]
Reviewed By: neildhar
Differential Revision: D68466808
fbshipit-source-id: 1bfc689972e1e5862fe6525bc48d5ebc508a95da