Summary:
`JSDevSupport.onSuccess` is called in `JSDevSupportModule.getJSHierarchy`:
```
const JSDevSupportModule = {
getJSHierarchy: function(tag: number) {
try {
const {
computeComponentStackForErrorReporting,
} = ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
const componentStack = computeComponentStackForErrorReporting(tag);
if (!componentStack) {
JSDevSupport.onFailure(
JSDevSupport.ERROR_CODE_VIEW_NOT_FOUND,
"Component stack doesn't exist for tag " + tag,
);
} else {
JSDevSupport.onSuccess(componentStack);
}
} catch (e) {
JSDevSupport.onFailure(JSDevSupport.ERROR_CODE_EXCEPTION, e.message);
}
},
};
```
If you look at the implementation of `computeComponentStackForErrorReporting`, it returns a `string`. The Java NativeModule also accepts a `String` for the argument to `JSDevSupport.onSuccess`. So, I've changed the `NativeJSDevSupport.onSuccess` method signature to match the native implementation (i.e: accept a string).
Changelog:
[General] [Fixed] - Correct argument types of NativeJSDevSupport.onSuccess
Reviewed By: fkgozali
Differential Revision: D18908306
fbshipit-source-id: 1c9a5c6fe5b3a81b25baed520e586ebf7e2514f8
Summary:
This diff fixes an issue where symbolicated logs were getting stuck in a "pending" state if the timeout occurred before symbolication finished.
Changelog: [Internal]
Reviewed By: sahrens
Differential Revision: D18894154
fbshipit-source-id: ed225962468f67aef40e430aa798f8d426d31027
Summary:
This diff adds a new `unstable_enableLogBox` function to opt-into the new LogBox experience. If LogBox is not enabled early enough, we show an error with instructions.
With this, LogBox can be enabled with:
```
require('react-native').unstable_enableLogBox();
```
Changelog: [General] [Adds] unstable_enableLogBox
Reviewed By: zackargyle, rubennorte
Differential Revision: D18808940
fbshipit-source-id: 4b0234ddc4d1646515bf63110d5b02133780512e
Summary:
Apologies for the large diff, it was difficult to break down.
This diff is a major refactor of LogBox that:
- Separates LogBoxNotification and LogBoxInspector
- Moves them each to their own container
- Updates AppContainer to only render the notification
- Updates the native logbox root to render the inspector
- Adds withSubscription HOC to manage subscribing to LogBoxData
- Simplifies LogBox to export an object instead of a component
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D18750011
fbshipit-source-id: 639885d29e55e125892d1c2b6bbf2826f27d78db
Summary:
This diff adds a NativeLogBox module implementation on iOS to manage rendering LogBox the way we render RedBox, except rendering a React Native component instead of a native view.
The strategy here is:
- initialize: will create a hidden window (the way redbox does) and render the LogBox to it
- show: will show the window
- hide: will hide the window
Most of this is copied from the way RedBox works, the difference here is that we eagerly initialize the window with the `initialize` function so that it's warm by the time LogBox needs to render.
Changelog: [Internal]
Reviewed By: RSNara
Differential Revision: D18750008
fbshipit-source-id: 013e55ded55c8572bb08e0219ff4cd0060ebe0da
Summary:
This diff stubs out registering LogBox as a renderable component. In later diffs, we'll render this component on the native side.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D18750005
fbshipit-source-id: 4db082ca2104731641d2d10de1ba83a318ab44fb
Summary:
NativeComponent as a type isn't needed now that we have HostComponent
Changelog:
[Internal]
Reviewed By: zackargyle, rickhanlonii
Differential Revision: D18873494
fbshipit-source-id: 5ba3fa25537f8249c80c2303dcdb380e3b6b0ac5
Summary:
Introduced 2 helper functions to toggle image instrumentation/logging (not in this diff) so that gating check is more efficient and easy to access across RN iOS core.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D18597208
fbshipit-source-id: 0b22031802ab020b16d6fb63e52461cf80a37ab5
Summary:
This component no longer has any internal callsites and was never exposed in the public API!
Changelog:
[General][Removed] Removing experimental IncrementalPresenter component
Reviewed By: rickhanlonii
Differential Revision: D18828704
fbshipit-source-id: 931254c4328b93b946a7995e7d9d44cb5aeb6a7b
Summary:
Changelog: [Internal] Remove groupCollapsed from list of unsupported polyfills
`console.groupCollapsed` was always replaced with `originalConsole`'s implementation, but
the right behavior is to have it be a proxy (call both `console` and `originalConsole`).
So remove this key from a list of unsupported functions.
Reviewed By: yungsters
Differential Revision: D18820158
fbshipit-source-id: d83cffbc7e7939c2654fad2e0d681da7c3b5196a
Summary:
By depending on react-native, these files can't be flow strict until index.js is flow strict. By depending on the internals directly they can be flow strict as soon as their dependents are flow strict.
Changelog:
[Internal] Refactoring some core file imports to depend on internals directly
Reviewed By: zackargyle
Differential Revision: D18828324
fbshipit-source-id: 2a347c4e234a64edbb3e6f0ef6387ef1ce78badc
Summary:
The flow team is rolling out exact-by-default object types to xplat/js. In order to do that, we need to take all inexact objects `{}` and turn them into explicitly inexact objects `{...}`.
This codemod does not change any type checking behavior. Prettier was run on all of the modified files with `format`.
drop-conflicts
Changelog: [Internal]
Reviewed By: zackargyle
Differential Revision: D18785076
fbshipit-source-id: c89c7fcc9eabe69859c8a488e03185fba5d06f80
Summary:
Code document incorrectly indicates that the `title` property is supported in both iOS and Android.
https://github.com/facebook/react-native/issues/27306
## Changelog
[iOS] [Changed] - Changed doc.
Pull Request resolved: https://github.com/facebook/react-native/pull/27351
Test Plan: NA - Only code comments have been changed.
Differential Revision: D18770026
Pulled By: hramos
fbshipit-source-id: af51c0b08bdf534d5e2c861b10e22d969d6f80f9
Summary:
The following pull-requests adds test for the `processColorArray` function. This ensures that the mapping is respected even in the `processColor` file changes. It also ensures that the mapping follows the basic expected functionality
## Changelog
[General] [Added] - Add test for the `processColorArray` to make sure it maps correctly
Pull Request resolved: https://github.com/facebook/react-native/pull/27344
Test Plan:
- Run `npm run test Libraries/StyleSheet/__tests__/processColorArray-test.js` to ensure tests pass
- Run `npm run lint` to make sure there are no styling conflicts.
<img width="454" alt="Screen Shot 2019-11-26 at 3 24 44 PM" src="https://user-images.githubusercontent.com/31664059/69680816-e8641780-1060-11ea-89ca-336c5534eb16.png">
Differential Revision: D18770069
Pulled By: hramos
fbshipit-source-id: 1a8647931818360b9912dc6fb50c339a91b9d4ea
Summary:
Right now we use `BatchedBridge.registerLazyCallableModule` for all JS modules except for `HMRClient`, which uses `registerCallableModule` instead (takes the module itself instead of a function that returns it). I'm standardizing on `registerLazyCallableModule` so that it will be easier to swap out the implementation later for bridgeless mode.
The only reason I could think why we wouldn't want to do this is if we're relying on some side effect of `require('HMRClient')` when setting up JS, but there don't seem to be any side effects in that module that I can see.
Changelog: [Internal]
Reviewed By: rickhanlonii
Differential Revision: D18798870
fbshipit-source-id: a5c950bdbfd998bb12e4843ee28ece08a26c84bf
Summary:
The former implementations of `TouchableHighlight` used `defaultProps` for `underlayColor`. However, the newly landed implementations use `??` which falls back to the default behavior if the prop is `null`.
This restores the former behavior so that, for example, supplying `underlayColor={null}` to `TouchableHighlight` will not fallback to black. (It probably should always have, but the intention of my rewrite was not to introduce a breaking change.)
Changelog:
[General] [Fixed] - Restore behavior for `underlayColor={null}` in `TouchableHighlight`.
Reviewed By: zackargyle
Differential Revision: D18806494
fbshipit-source-id: 4d33810e2f754f980385d76d81dc0f34006f4337
Summary:
Originally, normalizeColor.js was in Library/Color/ however, I noticed that its tests were in a completely different directly (Library/StyleSheet/__tests__) which was confusing. The other files such as processColor.js, setNormalizedAlphaColor.js had their tests in Library/StyleSheet/__tests__ as well.
## Changelog
[Internal] [Changed] - Moved normalizeColor.js to a more appropriate directory where its tests live.
Pull Request resolved: https://github.com/facebook/react-native/pull/27372
Test Plan: I simply moved a file and changed dependencies. The code should still function as is.
Reviewed By: rickhanlonii, mdvacca
Differential Revision: D18760210
Pulled By: yungsters
fbshipit-source-id: 4c2400acabab35ccbb2533faa5c1d6487c9bf48e
Summary:
## Step 1
I'm going to make every Java NativeModule type-safe and TurboModule-compatible. The first step is to make sure that every type-unsafe NativeModule has a dependency on its spec's codegen target.
## Input
Module -> owner(Module): P123320255
Module -> name(Module): P123320256
Module -> owner(spec(name(Module))): P123320257
### Excluded NativeModules
NativeModules without Specs: P123320644
Java only NativeModules: P123320645
Changelog:
[Internal] - Add buck dependencies for NativeModule specs
Reviewed By: mdvacca
Differential Revision: D18781629
fbshipit-source-id: 89f39017b8224355d9d7b43bf6c162b0957760ee
Summary:
Add a method to get the underlying host component of `FlatList`. Fix flow types in `FlatList` and `VirtualizedList`. Add test cases to test the behavior of the new function in all cases.
Changelog: [General] [Added] - Add getNativeScrollRef method to FlatList component
Reviewed By: TheSavior
Differential Revision: D18302202
fbshipit-source-id: 7005a2bc1dab207434be3f1f4d8fde0b11b3bb4d
Summary:
Changelog:
[iOS] [Fixed] - Slider is now disabled properly on iOS if the disabled prop is set.
Reviewed By: yungsters
Differential Revision: D18758835
fbshipit-source-id: 4850ebf05380f241d49d40107de61fd840049779
Summary:
Fixes a bug where we were skewing some stack traces by sending 1-based column numbers to the Metro symbolication endpoint, which expects them to be 0-based. This is achieved by subtracting 1 from the column numbers we find in textual stack traces, which are almost universally 1-based in current JS engines.
The bug is only noticeable in *some* cases, namely where the column immediately following the correct one is in a different function.
NOTE: The behaviour under Hermes was fixed separately, in a previous commit. This fix applies to other engines (e.g. JSC).
Changelog: [General] [Fixed] - Fix stack traces showing the wrong function name in some cases
Reviewed By: cpojer
Differential Revision: D18628230
fbshipit-source-id: 5677803500e45a41c1005496d19c150526af2d07
Summary:
Makes stack trace parsing return a consistent representation of column numbers when using Hermes, whether we're executing bytecode (in prod) or source code (in dev). This is achieved by creating a new full-fidelity stack trace parser for Hermes.
NOTE: We still use the `stacktrace-parser` package for other engines, so this fix applies only to Hermes and not to JSC - that will be fixed separately in an upcoming diff.
This fixes a bug where we were skewing some stack traces by sending 1-based column numbers to the Metro symbolication endpoint, which expects them to be 0-based. The bug is only noticeable in *some* cases, namely where the column immediately following the correct one is in a different function.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18627930
fbshipit-source-id: abd80846f00f24428670b2c92153564fb4bb2aff
Summary:
This is a more feature-full replacement for `textInputShouldChangeTextInRange:replacementText:` that allows implementing things like limiting text input content length without hacks and compromising the order of events. The new version of the TextInput will rely on that. The existing TextInput will use that as exacly like the previous version (because the new API is a superset of the the old one).
Changelog: [Internal] Fabric-specific internal change.
Reviewed By: sammy-SC
Differential Revision: D18670792
fbshipit-source-id: 0c434b351dfc8ab42404eb9aea0ede70bedaa9dc
Summary:
In AndroidTextInput, support codegen'd ViewCommands in native and add three commands that will eventually replace usage of setNativeProps on Android.
TextInput will use these commands in a future diff.
Changelog: [Internal]
Reviewed By: TheSavior
Differential Revision: D18612150
fbshipit-source-id: 5d427040686e8c5ab504dd845bc8ef863f558c35
Summary:
## Overview
This diff adds handling for syntax errors created using `buildCodeFrameError` which have a slightly different format than syntax errors thrown during transforms.
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D18658502
fbshipit-source-id: 0836f2c16cdd57c10ed1e03dc7345d8e1ccf53f3
Summary:
This diff switches LogBox over to use a Modal component so that the log inspector is always full screen.
In order to do that, it needed to add an `internal_excludeLogBox` flag to AppContainer so that it's not recursively rendered as: AppContainer -> LogBox -> Modal -> AppContainer. Not thrilled about the prop but it's necessary for now until this is rendered as it's own root (which we're working on next).
Changelog: [Internal]
Reviewed By: rubennorte
Differential Revision: D18461394
fbshipit-source-id: e1a80dfffbbe6c5467ac6f8d3c445a3280829020
Summary:
Changes `TouchableWithoutFeedback` so that `Props` is no longer exported as a Flow type.
Instead, other modules should use `React.ElementConfig<typeof TouchableWithoutFeedback>`.
Changelog:
[General] [Removed] - TouchableWithoutFeedback no longer exports Props. Use React.ElementConfig, instead.
Reviewed By: zackargyle, TheSavior
Differential Revision: D18718131
fbshipit-source-id: 0bd63123c49564fdab160d5fc8e7f1bf86da1fbe
Summary:
The experimentation code for `Touchable` is no longer necessary. Clean up all the injection points.
Changelog:
[Internal]
Reviewed By: TheSavior
Differential Revision: D18715851
fbshipit-source-id: 15fe59e218d89f222ae2183a1452718e460048cb
Summary:
Launches a new implementation of `TouchableBounce`.
It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.
Changelog:
[Internal]
Reviewed By: TheSavior
Differential Revision: D18715856
fbshipit-source-id: df2300600a8f0f07fc669c1e28183a0ef3a6f695
Summary:
Launches a new implementation of `TouchableHighlight`.
It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.
Changelog:
[General] [Changed] - TouchableHighlight overhauled as a class without propTypes.
Reviewed By: TheSavior
Differential Revision: D18715854
fbshipit-source-id: d4ea6ebd2ca9aef2af93ffad2fe75a96424514e5
Summary:
Launches a new implementation of `TouchableNativeFeedback`.
It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.
Furthermore, `TouchableNativeFeedback` now behaves similar to `TouchableWithoutFeedback` on iOS (instead of rendering an error message).
Changelog:
[General] [Changed] - TouchableNativeFeedback overhauled as a class without propTypes. Also, replaced iOS error renderer.
Reviewed By: TheSavior
Differential Revision: D18715857
fbshipit-source-id: aa42c7547ac94340fde0ef30641cab7eb48ea81b
Summary:
Launches a new implementation of `TouchableOpacity`.
It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.
Changelog:
[General] [Changed] - TouchableOpacity overhauled as a class without propTypes.
Reviewed By: TheSavior
Differential Revision: D18715858
fbshipit-source-id: 06ba5fc7eaacdbb7dc12d1564cc5d04e1a991229
Summary:
Launches a new implementation of `TouchableWithoutFeedback`.
It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.
Changelog:
[General] [Changed] - TouchableWithoutFeedback overhauled as a class without propTypes.
Reviewed By: TheSavior
Differential Revision: D18715852
fbshipit-source-id: f2eb28e3b8500bfcd8db44fc6bdbc0476193723a
Summary:
Makes `Pressability` available the open source `react-native` repository.
This abstraction is intended to replace `Touchable.Mixin` and enable us to finally stop depending on `createReactClass` (et al).
Changelog:
[Internal]
Reviewed By: TheSavior
Differential Revision: D18715853
fbshipit-source-id: 21af8652cfb4557c60babd31b2776bcaeaed8447
Summary:
The following accessibility properties was added for view but not for Touchables - importantForAccessibility, accessibilityLiveRegion, accessibilityViewIsModal and accessibilityElementsHidden. This PR is to extend the support for all touchables.
## Changelog
[General] [Added] - Add missing accessibility props on Touchables
Pull Request resolved: https://github.com/facebook/react-native/pull/27293
Test Plan: Tested in RNTester app.
Differential Revision: D18650884
Pulled By: yungsters
fbshipit-source-id: 2172ac55a8c8803d7d923511f43b2598593ea1d2
Summary:
The class `RCTUITextView` is designed to be a home for workarounds. In Fabric we will use it as well, so we need to have all workarounds there.
That's just a move of some code between clases, it does not really affect how the workarounds work.
Changelog: [Internal] Fabric-specific internal change.
Reviewed By: sammy-SC
Differential Revision: D18607833
fbshipit-source-id: 1ba0e8c5cd928f3bf6fe1d2727325ecfc1dbf684
Summary:
When using `react-native-screen` which uses native view controller animations for navigation `TextInput` with `autoFocus` causes a weird animation glitch.
Removing the requestAnimationFrame will cause the focus command to be sent in the same batch as starting screen transitions which fixes the issue.
It is unclear why the rAF was added in the first place as it was part of the initial RN open source commit. If someone at facebook has more context that would be great to make sure it doesn't cause unintended side effects.
Credits to kmagiera for figuring out this
## Changelog
[General] [Fixed] - Remove requestAnimationFrame when focusing input on mount
Pull Request resolved: https://github.com/facebook/react-native/pull/27217
Test Plan:
- Tested in an app using react-native-screen to make sure the animation glitch is fixed
- Tested in RNTester to make sure it doesn't cause other issues when not using react-native-screens
Before:
![1](https://user-images.githubusercontent.com/2677334/68799447-2ce5c100-0626-11ea-8310-a9ac9e9419b6.gif)
After:
![2](https://user-images.githubusercontent.com/2677334/68799450-2fe0b180-0626-11ea-865f-ef88f7307831.gif)
Differential Revision: D18666991
Pulled By: TheSavior
fbshipit-source-id: 66664c89e06c9ae65074ddcc4688dc5109fc9c72
Summary:
This removes common whitespace from a code frame to show more code. This is especially useful for heavily intended code that may not even be visible in the small window.
I am not 100% confident I wrote the right code because I'm under time pressure but it seems to work. I'm an intern and it's my last day.
Changelog: [Internal]
(Note: this ignores all push blocking failures!)
Reviewed By: rickhanlonii
Differential Revision: D18657572
fbshipit-source-id: 6b93999c4482891f2123d67005843ce5db0d2976
Summary:
This vertical bar doesn't really add any value. This diff removes it. At first I tried to use regex but ansi codes make that hard. We can just use the structured data and rely on the fact that the second item is always the one with the vertical bar.
(Note: this ignores all push blocking failures!)
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D18656911
fbshipit-source-id: b72d4c93d0008c7da54647d072a4c4eb7646b694
Summary:
This diff adds syntax highlighting to LogBox CodeFrames. It works by turning Ansi codes into "JSON" (it's actually just a JS object but the third-party API uses JSON as terminology) and then turning that into `<Text>` elements.
The syntax theme is called Afterglow and I took it from https://iterm2colorschemes.com/. Happy for anyone who wants to further tweak it! I installed this into iTerm and extracted the colors from there as it has a color picker and the labels directly map to the color classes exposed by the `anser` package.
Changelog: [Internal]
(Note: this ignores all push blocking failures!)
Reviewed By: rickhanlonii
Differential Revision: D18618897
fbshipit-source-id: 64815619fc482e08b5671f492dabda8c8c0ceca5
Summary:
This diff fixes an exception thrown when using fast refresh when a log is opened.
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D18656859
fbshipit-source-id: 707f71f627daa172a4f9e02e3ff5d05b6174eb63
Summary:
Adds handling for reference errors so when we throw them in the next diff they're handled as syntax errors.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18644642
fbshipit-source-id: 2b751578c616c27d5b1ec6255aca56063bfd9d16
Summary:
Original commit changeset: d982163fe3f5
Landing the original but with the feature flag disabled. *doh*
Changelog:
[General][Changed] Partial React Sync from 6cff70a74...bb1853f73
Reviewed By: mdvacca
Differential Revision: D18649739
fbshipit-source-id: c9a15f511595fe0ae76dd49db7a7097d1bfa3853
Summary:
Modernizing this code a bit more, converting it to hooks.
Changelog:
[General][Changed] Converted TextInput to use React hooks
[General][Fixed] TextInput now properly sends native the end selection location on change
(Note: this ignores all push blocking failures!)
Reviewed By: JoshuaGross
Differential Revision: D18581712
fbshipit-source-id: 62d6ea8489fa019ddf941c520930365f2c4887d8
Summary:
We are rolling out exact-by-default syntax to xplat/js.
I had to manually move around some comments to preserve proper placement.
Changelog: [Internal]
Reviewed By: jbrown215
Differential Revision: D18633611
fbshipit-source-id: 48f7468dcc55b1d00985419d035a61c6820b3abe
Summary:
Changelog: [Internal]
Fixing a red screen on the RN picker.
Looks like the picker gets confused when for unknown reasons a native value is undefined. In that case we stick to the JS value as it is specified in the comment.
https://fb.workplace.com/groups/rn.support/permalink/2997783536936908/
NOTE : Native fix was landed, this add an extra layer on the JS side
Reviewed By: mmmulani
Differential Revision: D18443005
fbshipit-source-id: 9511ac90f2d9e6186c6c0de3b673cc535cdb9fa6
Summary:
This variable is never set and only ever removed
Changelog: [Internal]
Reviewed By: yungsters
Differential Revision: D18537317
fbshipit-source-id: bbb084e2ea5408fc59ef3853b2ec74bf22afbe21
Summary:
These tests need to be consistent with every test so a helper makes more sense.
Changelog: [Internal]
Reviewed By: rickhanlonii
Differential Revision: D18500439
fbshipit-source-id: de535156d370102bad88e556ad3d2a0d5443e4e2
Summary:
LogBox tends to take a bit of time to open after tapping a log banner. This is very noticeable on Android where it takes multiple seconds.
When looking at React DevTools, the Stack Frame code can be responsible for two thirds of total LogBox rendering time. With this diff, the time is reduced from about 46ms to 25ms, and the total time spent rendering LogBox is reduced by one third.
This diff makes a few micro-optimizations but primarily it gets rid of an unnecessary View and collapses multiple text components into a single one as they are all rendered the same. Note that this also fixes an issue in the case where a line number may be missing but a column was provided. While I can't think of a case where that would actually happen, previously it would print the column (which could be mistaken for the lineNumber in that case) but now it prints the column only if the line Number is also present.
Changelog: [Internal]
Reviewed By: rickhanlonii
Differential Revision: D18613899
fbshipit-source-id: 5c6a3b65b749d5f95058b34ded6cc12531d91c38
Summary:
RCTDevLoadingView wasn't hooked up to the codegen. This diff makes RCTDevLoadingView type-safe and also makes it TurboModule-compatible.
Changelog:
[iOS][Added] - Make RCTDevLoadingView TurboModule-compatible
Reviewed By: PeteTheHeat
Differential Revision: D16969764
fbshipit-source-id: 47e6682eea3fc49d3f0448c636b5f616d5bce220
Summary:
This diff makes a few improvements to the call stack / symbolication process:
- Removes button from unsymbolicated stack frames
- Adds a warning message for missing features without symbolication
- Reduces symbolication requests (we were re-requesting stacks when they were pending)
- Speeds up opening unsymbolicated logs (because we were re-requesting them, the components were updating a lot)
Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D18577288
fbshipit-source-id: 6de322b4755895e2d1599b06100a61e64f7ec023
Summary:
Based on feedback we're going to clear all logs on fast refresh 👍
Changelog: [Internal]
Reviewed By: gaearon
Differential Revision: D18614230
fbshipit-source-id: 119a09e8ffea9d86137583d8da435338833f910c
Summary:
pretty-format library is not available on some JSC which causes the app to crash while trying to log a warning. This change defaults to just stringify the error if formatter is not available. The behavior on platforms where it already works fine isn't changed.
Changelog: Don't crash the app while formatting a warning for console if pretty-format is not available.
Reviewed By: PeteTheHeat
Differential Revision: D18403456
fbshipit-source-id: 73226f1a4e3f38c8d7c4e5ace909dd494e1da298
Summary:
Generating this diff was difficult. We _will_ fix the issues with jscodeshift, but i don't want to block the syntax change on that.
To get this diff, I first codemodded all of xplat to use exact-by-default. Then i turned on implicit-inexact-object:error enforcement to get a list of errors showing places that violated the lint. With that, I used this to generate a list of `sed` commands to add `...`:
```
flow --json | jq '.errors | .[] | .message | .[] | .loc | {source, "line": .end."line", "column": .end."column"} | "\(.column),\(.line),\(.source)"' | sort -n -r | sed 's/"//g' | while read -r line; do echo $line; awk -F',' "{ print \"sed -i '\"\$2\"s/./...&/\"\$1\"' \" \$3 }"; done
```
Then I ran prettier, reverted generated files, and manually fixed up suppressions that got messed up.
Changelog: [Internal]
Reviewed By: gkz
Differential Revision: D18516431
fbshipit-source-id: 6cf940dce411fb179e7ebaff764bd5113a07989f
Summary:
Changelog: [Internal]
Introduce native command `setNativeRefreshing`, it has the word Native in order to avoid name conflict with setRefreshing in Android implementation. Even this component is iOS only, it would make it easier to merge them in the future.
Introduce `RCTRefreshableProtocol` and make `RCTRefreshControl` and `RCTPullToRefreshViewComponentView` to conform to the protocol so view manager can forward command to both, Paper and Fabric component.
Reviewed By: mmmulani
Differential Revision: D18475804
fbshipit-source-id: 4c19225784efc931b7b8f2d2671cc839bce429bf
Summary:
This diff adds a new API `setAppInfo` to add app version and engine to LogBox and changes the way they're displayed so that they're more subtle and visible for screenshots.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18592992
fbshipit-source-id: 1c57b21fa9dca93029ffc92acf1287f3ee247f4d
Summary:
This is the first diff in the series. It removes Flow types for this feature to verify that we actually do not have any usages. After it lands, we will remove actual support on the native side.
There are several reasons why removing it is a good idea:
* There is no any evidence that this feature is actually useful. That was discussed several times (e.g. see T7936714) during RN lifetime and the overall consensus is: We need something else, something like sync `onChange` event instead of it.
* Supporting the previous point, it's not used (at least inside Facebook). I searched hard and I could find only one place where it's used: in the TextInput Example.
* To deliver more functionality we should lean towards W3C specs, this one is not W3C compliant.
* Supporting this Feature in Fabric is quite challenging, so I want to do it sooner than later.
* This feature was never documented.
Changelog: [Breaking] `<TextInput>::onTextInput` event was removed
Reviewed By: TheSavior
Differential Revision: D18456175
fbshipit-source-id: c7a8ed7a86b33ecc01d45497645fe249556fdf96
Summary:
There was already a ImageViewNativeComponent used on Android, so I changed `Image.ios.js` to use it as well, and then switched that component to use `codegenNativeComponent` instead of `requireNativeComponent` so that it gets the view config from JS instead of the UIManager.
I'm gating this change behind `RN$Bridgeless` so this only affects bridgeless mode.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D18575533
fbshipit-source-id: aa71beb6be65dbb48ad2e1ca748f2cccd72a0e73
Summary:
Currently `RCTBridgingToOptionalBool` and `RCTBridgingToOptionalDouble` will crash if passed an `NSNull` value. This diff changes these functions to instead treat it as equivalent to a missing value.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D18532044
fbshipit-source-id: fa822dcacb49697dd8a4f7b579bcfc029e0cdf41
Summary:
Removes the use of `parseErrorStack` in `_allocateCallback`, which was used to determine which timer API was allocating the callback (for Systrace purposes). Instead, we now use the already-existing `type` argument, which achieves the exact same thing but is much faster than parsing the stack trace.
Changelog: [General] [Fixed] - Reduce overhead of setting up timers in DEV
Reviewed By: yinghuitan
Differential Revision: D18233182
fbshipit-source-id: 190c0ffad8734cd889b790248e5a77cfb147454b
Summary:
Changelog: [Internal]
For image loading, the loader may need to inspect the imageView itself, so let's pass its reactTag. This only works pre-Fabric.
Reviewed By: sammy-SC
Differential Revision: D18522073
fbshipit-source-id: 400fc7e04b8d7852f6ecef941dd446fbff423c88
Summary:
Changelog: [Internal]
The main use-case here is to get the rootTag off RCTImageView, for image loading instrumentation. The fact is, each RCTView subclass already has `reactTag` attached today. We already have the `rootTag` when the view is created by the UIManager, so why not just attach it like reactTag? If we don't, looking up the rootTag from the native component is non-trivial and extremely inefficient (have to jump to shadow queue, back to main queue, etc).
Reviewed By: sammy-SC
Differential Revision: D18497002
fbshipit-source-id: 8409e3a1c95e09accedd959592cbf178fab0b2c3
Summary:
Changelog: [iOS] [Changed] - New internal image attribution support, but files importing RCTImageLoader.h must be converted to ObjC++
This new interface is the same as RCTImageURLLoader, but with additional support to pass in optional attribution information. The attribution info is not strictly defined (we may do so in the future though), and it's up to the hosting application and RCTImageURLLoader classes to handle it.
Reviewed By: sammy-SC
Differential Revision: D18492882
fbshipit-source-id: c3870c60e6c2e7c65758fc3235ebf5db369e07dc
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:
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:
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:
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:
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: 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:
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:
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:
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:
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:
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:
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:
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
Summary:
This diff changes the LogBox to show the code frame for the first non-collapsed stack frame. Let me know what you think about this change!
Changelog: [Internal] LogBox changes
Reviewed By: rickhanlonii
Differential Revision: D18372456
fbshipit-source-id: ddf6d6c53ab28d11d8355f4cb1cb071a00a7366e
Summary:
This diff adds error handling to logbox so that if there is an error either when parsing logs or when rendering LogBox, we show a native redbox with the error that was thrown and a message explaining that it's an internal React Native error.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18394788
fbshipit-source-id: 5d74d58e4b28ef6d863079e83677fb23ef4ccb34
Summary:
This diff adds the ability to press the file name of a code frame to open the file in your editor.
Note: I re-worked the frame location to extract the frame row and column at parse time so that we don't need to do any clowny regexes down stream.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18358283
fbshipit-source-id: 705e07d229c66ecfd225a8fb65ef2f78b5034c9c
Summary:
This diff adds more information to the meta area so it doesn't look so empty and dims the text so it doesn't jump out so much.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18360434
fbshipit-source-id: d460ffd59ef032d89879f88e309ac81e6d862c30
Summary:
Based on feedback "minimize" wasn't clear and "close" is more common so it should be on the right
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18353907
fbshipit-source-id: bccfc9be6c225a9adb31ef11d6a91330a7d4e008
Summary:
This diff lowers the intensity of the shadow on the fatal button based on user feedback that it's weird.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18353498
fbshipit-source-id: 9133aae02e5609e181a55289f349ea6a9e9fdaf6
Summary:
It's nice to be able to still see which stack frames are collapsed even when they're expanded.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18352700
fbshipit-source-id: f76086574677ea58c6b19b3300597681a17a96ae
Summary:
The previous diff mistakenly landed an old version
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18358917
fbshipit-source-id: 284dd6754c4aea3814e5f45dae6f68ed2c261b6a
Summary:
Fixes the comical level of padding at the end of the scroll container.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18351352
fbshipit-source-id: 5482fb81d0e385f0ce36530491b407c03ad87f3e
Summary:
Previously the background for the LogBox inspector footer buttons bleed into the background behind them. This change gives them more distinct on press backgrounds.
Changelog: [Internal]
Reviewed By: cpojer
Differential Revision: D18337437
fbshipit-source-id: c0cefd4464d94dc23316208135a9bf922fb510cb
Summary:
Some feedback for logbox is that the count wasn't centered on certain devices (e.g. Nexus 6 but not Pixel 3), and that the white badge count color for warnings was hard to read. This diff fixes both issues.
Changelog: [Internal]
Differential Revision: D18336681
fbshipit-source-id: 8200bcf04dcea9a6bbcaa1555fbab000c78c0a4f
Summary:
When messages are collapsed, showing a different style for the string substitutions for interpolated strings is jarring, so let's show the plaintext instead.
Changelog: [Internal]
Differential Revision: D18335295
fbshipit-source-id: f718469ac3206fd7a934a26495ebf8b1850fb674
Summary:
This diff updates the handling for `console.disableLogBox` so that:
- It does not disable fatals and syntax errors
- When there is a fatal or syntax error, the hidden logs are still shown and browsable
Changelog: [Internal]
Differential Revision: D18339684
fbshipit-source-id: 906122cc19ce50b3a21a42ae455206796953bcf3
Summary:
Add handwritten view config for AndroidHorizontalScrollContentView. Same as RCTScrollContentView, this native component has no props of its own other than what View accepts. It's simply used as a container for the horizontal ScrollView on Android.
Changelog: [Internal]
Reviewed By: rickhanlonii
Differential Revision: D18284673
fbshipit-source-id: 8cd6282a3b2e5c9876da5cc0e068b12dd56acfd8
Summary:
Adding a handwritten view config for AndroidHorizontalScrollView, the native component that's used with `<ScrollView horizontal={true} />` on Android. Native props are the same as `RCTScrollView`, so I'm reusing the type for that.
Changelog: [Internal]
Reviewed By: rickhanlonii
Differential Revision: D18284517
fbshipit-source-id: 7c81f72440b93d611f9574ad2c01a96530d07bf7
Summary:
Adding a handwritten view config for RCTScrollContentView. This host component doesn't actually have any props of its own separate from View; it's just a container for a ScrollView.
Changelog: [Internal]
Reviewed By: rickhanlonii
Differential Revision: D18283792
fbshipit-source-id: db95e981f54bef7c068b907c5d1fa52774dad147
Summary:
Adding a handwritten view config for RCTScrollView, to be used in DEV only (for now).
Changelog: [Internal]
Reviewed By: rickhanlonii
Differential Revision: D18263203
fbshipit-source-id: 975499f030c7caed9851bcde0be42c5058911ad5
Summary:
still some generated files in www that need to land before we can release 0.111 here.
drop-conflicts
Changelog: [Internal]
(Note: this ignores all push blocking failures!)
Reviewed By: dsainati1
Differential Revision: D18278838
fbshipit-source-id: b20c3fefb3aab7c5fb614b33d846c7548184f49a
Summary:
Changelog: DatePicker now uses commands instead of `setNativeProps`
We are moving away from `setNativeProps` in favour of commands API.
Reviewed By: shergin
Differential Revision: D17787870
fbshipit-source-id: aa532cbb7bfb3031c085e5122ab808522c437901
Summary:
`fatalIndex` is never null, we switched it to go to -1 when it's not set
Changelog: [Internal}
Reviewed By: cpojer
Differential Revision: D18324666
fbshipit-source-id: 04d4cca9923af2a91ceec03f8314dead4681e526
Summary:
When you write platform-specific code using [file extensions](https://facebook.github.io/react-native/docs/platform-specific-code#platform-specific-extensions), you can specify `.ios.js`, `.android.js`, or the catch-all `.native.js` when you are sharing code with a web project.
This `native` shortcut is missing for the `Platform.select` method, and this PR is adding support for that.
## Changelog
[General] [Added] - Platform.select now supports native as an option.
Pull Request resolved: https://github.com/facebook/react-native/pull/26966
Test Plan: Added relevant passing unit tests for Platform module.
Differential Revision: D18323670
Pulled By: cpojer
fbshipit-source-id: 7524c1914beab4f86041dcf8e60875380ebf7e02
Summary:
Changelog: [Internal]
Moved the imports for `TurboModuleRegistry` and `TurboModule` from `react-native`. This was a jscodeshift with the script: P120688078
Reviewed By: yungsters
Differential Revision: D18262538
fbshipit-source-id: 48fac15229c897408928511c5ecbb42f17ec7b42
Summary:
Changelog: [Internal]
* The original intention was to export both `get()` and `getEnforcing()` from TurboModuleRegistry.js, so define export default there
* Exposes `TurboModule` type on the top-level `'react-native'` import
* Tried this out on `NativeSegmentFetcher`
Reviewed By: yungsters
Differential Revision: D18262535
fbshipit-source-id: a46f2b8b6147531998efac8aa3b8259885224902
Summary:
There are two implementations of `RCTConvertVecToArray`. The first implementation:
```
template<typename ContainerT>
NSArray *RCTConvertVecToArray(const ContainerT &vec, id (^convertor)(typename ContainerT::value_type element))
{
NSMutableArray *array = [NSMutableArray new];
for (size_t i = 0, size = vec.size(); i < size; ++i) {
id object = convertor(vec[i]);
array[i] = object ?: (id)kCFNull;
}
return array;
}
```
The purpose of the second implementation is to default the convertor function to the identify function:
```
template<typename ContainerT>
NSArray *RCTConvertVecToArray(const ContainerT &vec)
{
return RCTConvertVecToArray(vec, ^id(typename ContainerT::value_type element) { return element; });
}
```
Meanwhile, there's only one implementation of `RCTConvertOptionalVecToArray`:
```
template<typename ContainerT>
NSArray *RCTConvertOptionalVecToArray(const folly::Optional<ContainerT> &vec, id (^convertor)(typename ContainerT::value_type element))
{
return vec.hasValue() ? RCTConvertVecToArray(vec.value(), convertor) : nil;
}
```
In this diff, I overload `RCTConvertOptionalVecToArray` to default the convertor to the identify function.
Changelog:
[iOS][Added] - Added RCTConvertOptionalVecToArray with default converter
Reviewed By: PeteTheHeat
Differential Revision: D18148891
fbshipit-source-id: d7d5f05cda06c9fa5374334ec4e9dbbd8b6d2eba