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
Summary:
It turns out the ImageLoader native module has different method signatures on iOS than on Android, so the JS spec we currently have won't work for ANdroid. In this diff I'm splitting up the spec for NativeImageLoader into an Android & iOS versions (similar to PlatformConstants), and updating the Android spec to match the native implementation. I'm also changing `RCTImageLoader` to use the new generated spec, and updating the JS callers (`Image.android.js` and `Image.ios.js`) to use the right one for the platform (instead of importing the untyped `ImageLoader` native module from `react-native`, like we were on Android :-/).
This will be a breaking change for anyone who's directly using `NativeImageLoader.js`, but I think most callsites should be using the `Image` component instead.
Changelog: [General] [Changed] Split NativeImageLoader into NativeImageLoaderAndroid and NativeImageLoaderIOS
Reviewed By: RSNara
Differential Revision: D18439538
fbshipit-source-id: 94c796d3fd27800ea17053e963bee51aca921718
Summary:
This diff increases the hit slop for the close button to dismiss the notifications.
Changelog: [Internal]
Differential Revision: D18438192
fbshipit-source-id: e671ec06c69f52f83c7dda87118ca1d2426e993b
Summary:
This diff makes minor style improvements and refactors to stack frame displays, primarily:
- Adding brackets around react components
- Uses a monospace font for the code
- Changing section titles to "Components" and "Call stack"
- Refactors the section headers to a single component and reduces the text size of headings
- Removes the query string from unsymbolicated stacks
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18433487
fbshipit-source-id: 7914b5810a4303e9a0d52def92e524b9e72f79ed
Summary:
This diff adds the ability to set a custom warning filter function.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18422114
fbshipit-source-id: a2949a013f478093a2fabc003c496353b8fdbc3a
Summary:
This diff add proper optimistic symbolication loading to fatal errors that are popped open, improving both raw performance and perceived performance of fatal logboxes.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18421259
fbshipit-source-id: 2c96a96522d6d199fecd828144799c96437c3d28
Summary:
This diff makes a few changes to how errors and warnings are handled in LogBox:
- Soft errors continue to notify the user collapsed.
- Fatal errors pop up full screen over the content, but are dismissible.
- Syntax errors pop up full screen, and are **not** dismissible.
- Removed the "Reload" button on fatals, and added back the dismiss/close.
- Removed all buttons from syntax errors so users are encouraged to fix it and safe without reloading.
To do this we needed to:
- Move the selectedLogIndex state out of the component and up to the rest of the log state.
- Change the way popping a log works, it's now done by setting selectedLogIndex at log time instead of deriving it at render time, that means `selectedLogIndex` is now the sole state value for deciding if the log inspector is open or not
- Whenever the state is updated, find a syntax error if it's there, instead of doing this at render time
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18421089
fbshipit-source-id: d2c4937f666f1302ed1a7b1b9c6679b0509136c5
Summary:
sans-serif doesn't exist on iOS. Using a different font as an example
Changelog:
[Internal]
Reviewed By: JoshuaGross
Differential Revision: D18435314
fbshipit-source-id: bd86291c8e858f62b3946b7d4b04df4fb3f969f2
Summary:
This version is needed to correctly generate inexact flow object type
annotations.
Keeping the upgrade minimal to reduce exposure to runtime code generation and avoiding a full babel upgrade.
Changelog: [Internal]
Reviewed By: jbrown215
Differential Revision: D18429751
fbshipit-source-id: d83621ed773566005a4dcdd4f99ded5101dc74b4
Summary:
Easy replace of int -> Tag type in Binding
changelog: [internal]
Reviewed By: JoshuaGross
Differential Revision: D18429188
fbshipit-source-id: 08a19dff60bd90585f59a284be0e46ee7f381bcc
Summary:
Fabric doesn't support setNativeProps, so we have to use commands instead to set the value of the native component.
Changelog: [Android] [Added] - Add setNativeSelectedPosition command to ReactPickerManager
Reviewed By: mdvacca
Differential Revision: D18007791
fbshipit-source-id: dfa26792205189a336ab43b1c51f43f8f57c8e72
Summary:
This was added to the flow type and example in D18275225 but not added to the prop-type
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D18431253
fbshipit-source-id: ffe4eaa8bd9dd22bf7c1487873c9fbdb7b226e3d
Summary:
This is the second half of https://github.com/facebook/react-native/issues/26976 (the CocoaPods update did not make it to `master`).
RSNara hramos fkgozali PeteTheHeat - Please take a quick look and comment if there are any known issues with using the latest stable version of CocoaPods. Thanks! 🙏
It seems like the older version of CocoaPods has a bug that _lowercases_ the spec repo url, even in the unfortunate case that the repo maintainers use upper case characters. This would essentially revert what was fixed in https://github.com/facebook/react-native/issues/26976.
## Changelog
[General] [Changed] - Update RNTester CocoaPods to 1.8.4
Pull Request resolved: https://github.com/facebook/react-native/pull/27173
Test Plan:
```
cd RNTester
bundle install
bundle exec pod install
```
Reviewed By: RSNara
Differential Revision: D18413420
Pulled By: mdvacca
fbshipit-source-id: 9c8794054f6e831a4a41ca96944767240c1462bf
Summary:
Changing PanResponderExample to use React state instead of setNativeProps. Fabric likely won't have setNativeProps so this is a conversion in that direction. This is probably one of the most complicated usages of setNativeProps and it feels *okay* with React state. I'm sure it is worse on lower end devices though.
In general we know that going to JS for an animation is not the correct approach so this getting worse in Fabric is probably fine for that reason too. Staying in native with something like react-native-gesture-handler is probably more aligned with the future.
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D18258130
fbshipit-source-id: eed6a8eb839c6607463f3140191945ea753a697b
Summary:
In this diff we integrate the Picker component on Android in Fabric. Since both AndroidDropdownPickerNativeComponent and AndroidDialogPickerNativeComponent use `style?: ?TextStyleProp`, which is not supported by the JS codegen, I had to handwrite the C++ files and check them in.
The component is not fully functional yet because `setNativeProps` is not supported in Fabric. I will fix this in the next diff.
Changelog:
[Android] [Added] - Integrate Picker into Fabric on Android
Reviewed By: mdvacca
Differential Revision: D17954435
fbshipit-source-id: 6b7b029ab0c84c27a48c7dddd66878c9dea324bf
Summary:
Code frame columns are returned 0 based but displayed in editors 1 based, this diff bumps the column we display by one to match.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18426163
fbshipit-source-id: 2c6aefb6fe7ce161cd768b6748b7739d486ed438
Summary:
Changelog: [internal]
if you called `ContextContainer.insert("key", <value>)` and then again `ContextContainer.insert("key", <new_value>)`, the old value will remain in `ContextContainer`. This seems to be by design however it causes crash when reloading surface that uses `ComponentDescriptorRegistry_DO_NOT_USE_PRETTY_PLEASE`.
We fix it by erasing `ComponentDescriptorRegistry_DO_NOT_USE_PRETTY_PLEASE` in Scheduler before inserting a new one.
Reviewed By: shergin
Differential Revision: D18421153
fbshipit-source-id: a01e5f6ac864fd641674d84e97d447f8cb9114be
Summary:
Changelog: [internal] Fixes fabric specific crash
`_viewRegistry` is not thread safe and accessing it on another thread can cause a crash.
Calling it inside `RCTUnsafeExecuteOnMainQueueSync` shouldn't degrade performance because it is only used as a fallback.
Changelog: [Internal]
Reviewed By: rickhanlonii
Differential Revision: D18421789
fbshipit-source-id: 2adff434afe0a3c19318c95b051ee91ccf6293e5
Summary:
This pull request migrates the animated flip example in `TransformExample` to using React Hooks.
## Changelog
[General] [Changed] - RNTester: Migrate TransformExample to hooks
Pull Request resolved: https://github.com/facebook/react-native/pull/27181
Test Plan: The animation works exactly as it did as when it was a class component
Differential Revision: D18418200
Pulled By: mdvacca
fbshipit-source-id: 129298319dbf1774d06fe5c6e5ab60cd028449bb
Summary:
ScrollView isn't using codegen, therefore we need to manually write commands interface. I also typed commands so it uses `Double` instead of `number`.
Changelog: [Internal]
Reviewed By: TheSavior
Differential Revision: D18371887
fbshipit-source-id: 3bd11b9969b80ce6d2302e2f0da28884e9221b7e
Summary:
This pull request adds a missing key attribute to an array of elements in the example for `NewAppScreen`. This results in the "missing key" warning no longer appearing when viewing this example.
## Changelog
[General] [Fixed] - RNTester: Add missing key attribute in NewAppScreen example
Pull Request resolved: https://github.com/facebook/react-native/pull/27180
Test Plan: When viewing this example in RNTester, this warning is no longer printed.
Differential Revision: D18418198
Pulled By: mdvacca
fbshipit-source-id: 8fbe51da7b714e3e94fd2186ea8cc4e3606d9f95
Summary:
This diff fixes the algorithm that collapses mutation instructions in Fabric Android
The problem was that we were always relying on the fact that the oldShadowNode is present as part of the mutation instruction (which is not correct for mutation instructions of type CREATE)
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D18411360
fbshipit-source-id: 36f5e75f792db87003fcaef2ddcd9452415a0ad6
Summary:
With this diff (and maybe other coming in the future), we are enforcing a model where Fabric Core actively/architecturally prevents `jsi::Object` to overlive `UIManager`. That never was a promise that but I think it's achievable; it should help to eliminate the whole class of possible crashes (application layer still must ensure that Scheduler is deallocated before `jsi::Runtime`).
Clearing all pointers to `ShadowNode`s in `MountingCoordinator` prevents from extending the lifetime of ShadowNodes stored inside revoked `MountingCoordinator` (the lifetime of `MountingCoordinator` is up to application layer).
That should help prevent crashes (not all of them!) caused by `jsi::Object`s overliving `jsi::Runtime`.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D18333708
fbshipit-source-id: 4391998b8f805563cfaff834fc56e85b98bc4d68
Summary:
This diff updates the configuration of collapsing of mounting instructions to be disabled by default (in case the user didn't get any value from the server)
Changelog: [internal]
Reviewed By: JoshuaGross
Differential Revision: D18411934
fbshipit-source-id: 21f9ca525c28134800e929407c5a1e29a84de68e
Summary:
We are going to be switching event target and current target from being a reactTag to being a host instance.
This doesn't actually change what the actual type of this key is, but is split out like this to make diffs smaller and easier to review. Actual behavior changes will be coming and tested in a future diff.
These are the only callsites I found that use target outside of the React renderers.
The other approach this change could take would be to make all the downstream callsites take both a tag or a HostComponent. That felt too difficult to do at the same time so I'm instead introducing these `findNodeHandle` calls temporarily.
The main thing we need to do is be able to change the callsites in the renderer to start sending the instance. Once everything is passing the instance instead of the tag then we can clean all these up cleanly.
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D18384435
fbshipit-source-id: b3a7e6a2778cb7dd9cdfe451cf869cd99641b167
Summary:
We are going to be switching event target and current target from being a reactTag to being a host instance.
This doesn't actually change what the actual type of this key is, but is split out like this to make diffs smaller and easier to review. Actual behavior changes will be coming and tested in a future diff.
These are the only callsites I found that use `currentTarget` outside of the React renderers.
Changelog:
[Internal]
Reviewed By: zackargyle, yungsters
Differential Revision: D18382470
fbshipit-source-id: 23add5498b38dc109b154479826f701c8a1920b9
Summary:
There's a Wilde OOM. We suspect that RCTTiming's conversion to TurboModule could be the cause. There could be a memory leak in the TurboModule system that RCTTiming exposes, or RCTTiming itself could have a memory leak. Therefore, I'm making RCTTiming a regular NativeModule for now.
Changelog:
[iOS][Changed] - Make RCTTiming a regular NativeModule
Reviewed By: fkgozali
Differential Revision: D18410788
fbshipit-source-id: 29567f899dcb82988bc265242e98cc35e878e749
Summary:
`mem` package vulnerability found.
> In nodejs-mem before version 4.0.0 there is a memory leak due to old results not being removed from the cache despite reaching maxAge. Exploitation of this can lead to exhaustion of memory and subsequent denial of service.
ref: da4e4398cb
`relay-compiler` depends on that.
```
relay-compiler@6.0.0
└─┬ yargs@9.0.1
└─┬ os-locale@2.1.0
└── mem@1.1.0
```
Pull Request resolved: https://github.com/facebook/relay/pull/2934
Test Plan:
- Tested the Relay compiler briefly on the open source examples project, seems like yargs doesn't error
- `js1 build relay --project facebook`
- `js1 jest`
Reviewed By: alunyov
Differential Revision: D18397131
Pulled By: kassens
fbshipit-source-id: 8b7fc5e237c7b4ce14ff3809cdd59d243e7c4523
Summary:
In D17880909 I migrated `[bridge reload]` to RCTReloadCommand.
One thing I didn't consider too much is the plethora of things which trigger a reload, and the `RCTAssertMainQueue()` constraint. I'd rather use locking (to protect listeners list) than requiring reloads be called from main thread.
Changelog: [iOS][Fixed] Fix potential assert firing in RCTReloadCommand
Reviewed By: rodrigos-facebook
Differential Revision: D18353156
fbshipit-source-id: d20b851fc5fe6c3518dfa3db8f1fc075cf7edee9
Summary:
These NativeModules aren't necessary. So, instead of making them TurboModule-compatible, I'm deleting them.
Changelog:
[General][Removed] - Remove Sample and CrashyCrash
Reviewed By: fkgozali
Differential Revision: D18361526
fbshipit-source-id: 3217130a5fb32bec9db78d53c5429bae7ed7b66c
Summary:
PushNotificationiOS wasn't used by anything in ReactInternal, so I just removed it from the target.
## Codemod
Everywhere we required `ReactInternal`, we now also require `RCTPushNotification`:
```
> xbgr -f 'BUCK$' 'ReactInternal"' -l | xargs -I {} sed -i '' $'s|ReactInternal",|ReactInternal",\"fbsource//xplat/js:RCTPushNotification",|g' $HOME/{}
> xbgr -f 'BUCK$' 'ReactInternalApple"' -l | xargs -I {} sed -i '' $'s|ReactInternalApple",|ReactInternalApple",\"fbsource//xplat/js:RCTPushNotificationApple",|g' $HOME/{}
> arc f
```
Changelog:
[Internal] - Separate RCTPushNotification from ReactInternal
Reviewed By: PeteTheHeat
Differential Revision: D18363643
fbshipit-source-id: b8d123f40741c6d200dc9e736e64e885c2572e15
Summary:
None of the code inside `ReactInternal` depended on the `RCTLinkingManager` NativeModule. So I extracted `RCTLinking` into its own BUCK target. This will make it easier to make `RCTLinkingManager` TurboModule-compatible.
## Codemod
Everywhere we required `ReactInternal`, we now also require `RCTLinking`:
```
> xbgr -f 'BUCK$' 'ReactInternal"' -l | xargs -I {} sed -i '' $'s|ReactInternal",|ReactInternal",\"fbsource//xplat/js:RCTLinking",|g' $HOME/{}
> xbgr -f 'BUCK$' 'ReactInternalApple"' -l | xargs -I {} sed -i '' $'s|ReactInternalApple",|ReactInternalApple",\"fbsource//xplat/js:RCTLinkingApple",|g' $HOME/{}
> arc f
```
Changelog:
[Internal] - Separate RCTLinking from ReactInternal
Reviewed By: fkgozali
Differential Revision: D18314747
fbshipit-source-id: d9b5f536a6e93a0aca8721801a2ee5d446e0d4a6
Summary:
Changelog: [Internal]
Reverting the import to the previous local module style since importing from react-native seems to introduce some perf regression. We'll revisit this later in the future.
Reviewed By: yungsters
Differential Revision: D18383893
fbshipit-source-id: f11d46a4545768f39199fd6fd22fcf14905d0a74