Summary:
Document which methods can be called on UI thread or ANY thread.
In the future we should see if we can use only `ThreadConfined` or the AndroidX annotations instead of using both / choosing between them at each site.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D18532542
fbshipit-source-id: 3b5406ea5035615a0ebf83484bf8ec0747a6b6f7
Summary:
TextInput now acts as a host component and can be passed directly to our new APIs that require a host component. Callsites no longer need to call
```
inputRef.getNativeRef()
```
We mutate the ref to the host component adding the imperative methods of the TextInput so you can still call `inputRef.clear` and `inputRef.isFocused`.
Changelog:
[General][Changed] TextInput now uses `forwardRef` allowing it to be used directly by new APIs requiring a host component.
Reviewed By: yungsters
Differential Revision: D18458408
fbshipit-source-id: 1f149fd575210d702fa0fdf3d05bb2162436a773
Summary:
When the TextInput class is exported directly Flow complains about some definitions because they don't properly define the export type. This change adds those types but still doesn't export the TextInput directly as there are more things that still need to get fixed.
Changelog:
[Internal]
Reviewed By: JoshuaGross
Differential Revision: D18444096
fbshipit-source-id: 18c88bbf1de5504f350681a71ea21d7e41876e49
Summary:
In order to make this more flow typed and modern we need to get it off of createReactClass. This change converts the class as is with no intended behavior changes to an ES6 class.
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D18443018
fbshipit-source-id: 831921976e9de8e965180cdefd1c4a154f04bfea
Summary:
We need to get rid of NativeMethodsMixin. Normally we'd use forwardRef to the HostComponent, however we can't do this here because TextInput has its own imperative methods. I want to refactor this into a class and after that will revisit how to get rid of these methods.
Changelog:
[Internal]
Reviewed By: JoshuaGross
Differential Revision: D18436162
fbshipit-source-id: 0c81fa8b31b3248cbab8680ff680dd09c61c76e2
Summary:
Reordering the methds in TextInput to be a bit more consistent.
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D18435732
fbshipit-source-id: 05a1d9d2c70a4b5fa00a3dc6be0520a216a24106
Summary:
We don't need a local mutable copy of props.
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D18435731
fbshipit-source-id: 13ec1a78ca26b1372a4aed484a821204a93b6437
Summary:
The TouchableWithoutFeedback is almost exactly the same between both branches.
The responderReject prop was added in https://github.com/facebook/react-native/pull/16755.
The PR seems to say that it is the default behavior on Android. I don't want to make risky changes in this refactor so I'm not doing anything special about that prop for now.
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D18435733
fbshipit-source-id: 372d17d8e67884930409a6a863757944cec4737e
Summary:
These functions are quite similar and I'm going to refactor out the shared pieces. To make it easy to review this change just inlines those two functions with no other changes.
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D18435734
fbshipit-source-id: 826f510359358427856993b536d41054ddf8c792
Summary:
This diff extends ThemeReactContext class to store the surfaceID field
The getSurfaceID method is being exposed as a public method
Changelog: [internal]
Reviewed By: JoshuaGross
Differential Revision: D18474015
fbshipit-source-id: ee1f859a802d36c51dec537fa91d90022523e88d
Summary:
This interface is used from ReactImageManager to customize the CallerContext object associated with each instance of ReactImageView.
CallerContext are used on Fresco to customize Debug and logs
Changelog: Introduce ReactCallerContextFactory interface, this interface is intended to customize Debug and logging on Fresco
Reviewed By: JoshuaGross
Differential Revision: D18474017
fbshipit-source-id: eda0fc9d3f64bbcc23ee1b7f5d779b441da1fe6c
Summary:
We want completely remove usages of Bitfield as it uses templates which bloats binary size
This stack will reduce 2.2 Kb in binary size bringing it down to 61.3KB on armv7
In this diff we are removing usage of template while updating styles.
## Changelog:
[Internal][Yoga] : Not using templates for updating styles
Reviewed By: astreet
Differential Revision: D18519570
fbshipit-source-id: 2324088b8c63154f818b1da1edf24c0533e10082
Summary:
Upgrading CLI to latest. It's likely not yet compatible with master, because we depend on Metro 0.56, and master is on 0.57. This diff is intended to be cherry-picked to 0.61 and 0.62.
cc grabbou
## Changelog
[Internal] [Changed] - Bump CLI to ^3.0.0
Pull Request resolved: https://github.com/facebook/react-native/pull/27235
Test Plan: None
Differential Revision: D18527709
Pulled By: cpojer
fbshipit-source-id: 44448058c48a66d22a1d71abdc908f532f5aa547
Summary:
Changes the Fast Refresh message for when metro disconnects to remove "Reload to reconnect.". The most common use case for this happening is when Metro is stopped, and reloading will not reconnect to a stopped metro server.
Long term we should reconnect to Metro automatically and then this message would be followed up with a "Reconnected to Metro" message, never needing a reload.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18527705
fbshipit-source-id: 40768ce1089348b612e9d86638f07169d2a34b67
Summary:
Feedback from multiple people has been that the "see more" is hard to discover and that it should be at the bottom left, so this diff moves it there.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18487041
fbshipit-source-id: 1543c54e1de5fa16fa5b2e427812b6e72977bfb2
Summary:
The margin and padding are resolved incorrectly for leaf nodes (nodes with measure function set) if margin and padding are used in percentages.
Here we were using node's width instead of container width to calculate the margin and padding.
Fixed this to use container's width.
## Changelog:
[General][Yoga] : Fixed an issue where margin and padding were resolved incorrectly for leaf nodes (nodes with measure function set) if margin and padding are used in percentages.
Reviewed By: alickbass
Differential Revision: D17130520
fbshipit-source-id: ac904d432f121973e7739debd9136909b5ca1427
Summary:
Fixes T54997838 by preventing any view mutations during `onMeasure` calls.
There might still be places where this is possible, but this is where I'm seeing all the crashes currently.
See comments in ReactRootView for why views were mutated during onMeasure.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D18518591
fbshipit-source-id: 1406af8a6b0bfcc86f4cc5b451b3967f312dfd85
Summary:
This change is not only more correct, it's also fixes the modal in the the next diff.
It's more accurate because in the previous location, the redbox dismissal was done as a hack in order to hide non-syntax errors so that the syntax error would be visible when it fired. This is unnecessary for LogBox because it always puts syntax errors on top of any other error.
The main motivation for changing this, however, is that this strategy is broken when switching to the Modal component because the Modal component does not work well with quickly unmounting and remounting. With the old strategy, the inspector would flicker and then collapse even though there was a syntax error.
Changelog: [Internal]
Reviewed By: cpojer, gaearon
Differential Revision: D18461431
fbshipit-source-id: e8ed83e3d2b002e5d45cc13dc9533ed841ed5cae
Summary:
Fixes an issue where unhandled exceptions would unmount the app and LogBox, hiding the exception and leaving the user stuck. This is a temporary solution until we either decide to provide an error boundary by default or move this to a separate root.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18504346
fbshipit-source-id: 4bca8693e63c367bf3070f12606a50824aa4cc23
Summary:
`ReactFeatureFlags.useTurboModules` can be written to and read from any number of threads. We should use `volatile` to make sure that all threads read/write this data straight from/to memory.
Changelog:
[Android][Fixed] - Make ReactFeatureFlags.useTurboModules volatile
Reviewed By: fkgozali
Differential Revision: D18505673
fbshipit-source-id: 0b2527b8cb95c1e1aedc6b03b12a6b1e6a6cdaa4
Summary:
Now that the networking module is a TurboModule request handlers need to be passed at module creation. The code was missing for RNTester.
## Changelog
[Internal] [Fixed] - Fix RNTester networking conversion to TurboModule
Pull Request resolved: https://github.com/facebook/react-native/pull/27218
Test Plan: Tested that RNTester XMLHttpRequest example now works on iOS
Differential Revision: D18506038
Pulled By: RSNara
fbshipit-source-id: cd88319e386c7b7b6e11cfb920f2ceb761a4136a
Summary:
Why crash in production if we can make potential bug not compile?
Changelog: [INTERNAL]
Reviewed By: sammy-SC
Differential Revision: D18499813
fbshipit-source-id: dc2d7ac12b8a2ae27d1e6b832fccc1555cab3b75
Summary:
Extracts a new `RCTFormatStackTrace` function from `RCTFormatError`.
Changelog: [Internal]
Reviewed By: shergin
Differential Revision: D18114387
fbshipit-source-id: 4466f52d75d9da3a257cd1cc7067492a0c19a7d5
Summary:
This diff makes number of improvements to stack frames:
- Adds padding around stack frame pressables
- Fixed wrapping for the closing bracket on component stacks
- Adds passing around "see more" buttons
- Fixed the count for "Show x more frames" when it's 0 and otherwise
- Add more cases for the count text
- Switches button back to minimize (snuck this in here)
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18495331
fbshipit-source-id: 8b9efa88c4205b23e734893d8db6deccce88344c
Summary:
## Changelog:
[General] [Yoga] - Use vanilla jni instead of fbjni for all the jni communication
Reviewed By: astreet
Differential Revision: D17808005
fbshipit-source-id: 5e9a1ed73978f519c71c248774a28e5a294e7c7f
Summary:
The original implementation had an incorrect order of fields in the struct wich causes bugs with border drowing.
Changelog: [Internal] Fabric-specific internal change.
Reviewed By: sammy-SC
Differential Revision: D18444733
fbshipit-source-id: e4611e6e90eee85e7cdebcee3c5bb6886417aa26
Summary:
We already have the exact same function in RCTConvertions.h, why have a copy of it here?
Changelog: [Internal] Fabric-specific internal change.
Reviewed By: sammy-SC
Differential Revision: D18444731
fbshipit-source-id: ba1ebd538f92145c2ec0c30e0f7d14f1d05b381c
Summary:
We will use it soon for `EdgeInsets`
Changelog: [Internal] Fabric-specific internal change.
Reviewed By: sammy-SC
Differential Revision: D18444732
fbshipit-source-id: f03aa2a8889d426095a954d88f9cb6172c3e376e
Summary:
The moved code fragment is a workaround for a bug in UITextField in iOS 8. There is no need to have this code in a general base class that serves both UITextField- and UITextView-based components. Especially for such workarounds like that, we have a dedicated class RCTUITextField. This diff moves that there.
Read more about the bug:
https://stackoverflow.com/questions/14220187/uitextfield-has-trailing-whitespace-after-securetextentry-toggle/22537788#22537788
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D18444734
fbshipit-source-id: a3764c19f562231ba3fa3d4c0ad7de069ea04d98
Summary:
This diff changes LogBox to say "Render Error" instead of "Fatal Error" for errors thrown in render.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18466237
fbshipit-source-id: 737759f3febb937f70698dae5f1b1617e233fc98
Summary:
This diff adds `isRenderError` to the Log data, and refactors the LogBoxLog object to accept an object in the constructor instead of adding the 7th argument. No visual updates as those are in the next diff.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18466192
fbshipit-source-id: e38ef9032b8074abbc7b40cbe7a84d45285944c4
Summary:
The React team wants exceptions thrown during render to pop over the screen as fatals.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D18439258
fbshipit-source-id: dded7b9d93271c1a4eff682be521c7567dfe7d7e
Summary:
As a part of the migration from `setNativeProps` in Fabric and Paper, we are replacing it by view commands in the RefreshControl component on Android.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D18475428
fbshipit-source-id: f2e978d88e34c74771f8582247ecc82b2b942557
Summary:
As a part of the migration from `setNativeProps` in Fabric and Paper, we are replacing it by view commands in the Checkbox component on Android.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D18451524
fbshipit-source-id: 566f3574b85a1ae97f78b2fb95548b8529c0c92f
Summary:
Fixes an issue where the icon for failed source maps would spin like the pending icon.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18479027
fbshipit-source-id: 07c428239122f3f4a8a58dcd8faf09e54170d45b
Summary:
LogBox should be on top of the inspector so that you can dismiss and view errors without the inspector getting in the way.
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D18462490
fbshipit-source-id: 0da2819158c3bc2602a63695222c1601dcf79183
Summary:
If the keyboard is open when the inspector pops open, dismiss it.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18468221
fbshipit-source-id: 0d51fa90824ed8bef6a3b6e813013fa3c2a4bbda
Summary:
In Yoga, margin is not calculated correctly when defined in terms of percentage at one place.
According to CSS docs , margin percentage should be calculated according to width of container's block in case of horizontal writing mode. (https://fburl.com/5imus0it)
We were using height of container causing some issues in both android and iOS.
## Changelog:
[Yoga] [Fixed] - margin if defined in percentage should use container's width in horizontal writing mode
Reviewed By: alickbass
Differential Revision: D18395285
fbshipit-source-id: 87ebd013e3cba36da45f6548e4dff1bce69cce9b
Summary:
setBreakpoint differs from the existing setBreakpointByUrl in that you
can specify a scriptId directly. This was not really possible before
now, since scriptIds were mapped via filenames rather than to
RuntimeModules.
When (re)loading files with the same name, this call can be used to set
breakpoints in a specific one, rather than just the latest version.
Changelog: [Internal]
Reviewed By: bestander
Differential Revision: D18362054
fbshipit-source-id: 6ff1e736c79a4e75dc424316675d426ce9902f5f
Summary:
We were calling `sendErrorToClient` on error, but this function only
returns a closure that we threw away. Change to actually send an error
response.
Changelog: [Internal]
Reviewed By: bestander
Differential Revision: D18362055
fbshipit-source-id: 2ff1750ffd2c32a9291d3ed74fa0aaecd76c64c6
Summary:
When a filename (potentially with changes) is loaded multiple times, we keep
multiple instances around but fail to alert the attached debugger about this.
By coupling ScriptIDs to RuntimeModules rather than filenames, we can track
multiple instances of the same name instead.
Changelog: [Internal]
Reviewed By: bestander
Differential Revision: D18362052
fbshipit-source-id: 2147af32bc48c5fd2a2b080ea09dfa4133de7cf5
Summary: We suspect that RCTNativeAnimatedModule's conversion to TurboModule could be the cause. There could be a memory leak in the TurboModule system that RCTNativeAnimatedModule exposes, or RCTNativeAnimatedModule itself could have a memory leak. Therefore, I'm making RCTNativeAnimatedModule a regular NativeModule for now.
Reviewed By: fkgozali
Differential Revision: D18410852
fbshipit-source-id: dd714fe0fb0267fe5e1a94a26d47a82199b6f2c7
Summary:
This diff migrates ReactViewPagerManager to use the generated delegate for setting its properties.
Changelog: [Android] [Added] - Use generated Java delegate for setting properties on ReactViewPagerManager
Reviewed By: mdvacca
Differential Revision: D18298049
fbshipit-source-id: f989bedb16e3cabe6a9a8e4238a2b74515041d23
Summary:
There's some incompatibilities which need to be fixed for real,
but this is a temporary fix to make the build work again.
Changelog: [Internal]
Reviewed By: willholen
Differential Revision: D18364011
fbshipit-source-id: c168e6496a504f9b00da0b9d758c50e2c6f314a4