Summary:
Default behavior should be unchanged.
If we queue up a bunch of expensive tasks during an interaction, the default
`InteractionManager` behavior would execute them all in one synchronous loop at
the end the JS event loop via one `setImmediate` call, blocking the JS thread
the entire time.
The `setDeadline` addition in this diff enables an option to only execute tasks
until the `eventLoopRunningTime` is hit (added to MessageQueue/BatchedBridge),
allowing the queue execution to be paused if an interaction starts in between
tasks, making the app more responsive.
Additionally, if a task ends up generating a bunch of additional tasks
asynchronously, the previous implementation would execute these new tasks after
already scheduled tasks. This is often fine, but I want it to fully resolve
async tasks and all their dependencies before making progress in the rest of the
queue, so I added support for `type PromiseTask = {gen: () => Promise}` to do
just this. It works by building a stack of queues each time a `PromiseTask` is
started, and pops them off the stack once they are resolved and the queues are
processed.
I also pulled all of the actual queue logic out of `InteractionManager` and into
a new `TaskQueue` class to isolate concerns a bit.
public
Reviewed By: josephsavona
Differential Revision: D2754311
fb-gh-sync-id: bfd6d0c54e6410cb261aa1d2c5024dd91a3959e6
Summary:
Problem: https://github.com/facebook/react-native/issues/4708
Solution: Added a ColorPropType that validates the color used by the dev
Notes:
1) I'm working a Win8.1 machine and couldn't build the react-native using the github repo. As soon as I figure that out, I'll probably figure how to run the tests and how to add some for this feature.
2) It's my first pull request. Be gentle :)
Closes https://github.com/facebook/react-native/pull/4866
Reviewed By: bestander, svcscm
Differential Revision: D2783672
Pulled By: nicklockwood
fb-gh-sync-id: ca22aa3c0999188075681b5d20fff0631496e238
Summary:
This PR adds a contentInsetStart and a contentInsetEnd property to ToolbarAndroid, allowing offsetting Toolbar contents to different keylines
Closes https://github.com/facebook/react-native/pull/4699
Reviewed By: svcscm
Differential Revision: D2759294
Pulled By: mkonicek
fb-gh-sync-id: f22aa255f07929ad7a99ac7568981d35e848065b
Summary:
Here are some small fixes for issues we've encountered with very large RN projects (mostly huge dependency trees in `node_modules`).
cc amasad martinbigio
Closes https://github.com/facebook/react-native/pull/4880
Reviewed By: svcscm
Differential Revision: D2782834
Pulled By: mkonicek
fb-gh-sync-id: e316a62b84ba796b80ac819431414ebf27f7b566
Summary:
This PR makes the android dev menu consistent with iOS where toggling the inspector will update the button label accordingly.
Closes https://github.com/facebook/react-native/pull/4628
Reviewed By: svcscm
Differential Revision: D2740549
Pulled By: mkonicek
fb-gh-sync-id: 02458d09b84e1592dcf245290ee2bbfb2863060d
Summary:
public React allows excluding certain elements from touch handling by assigning `PointerEvents` filter to them, such as BOX_NONE - this element will not receive touch but its children will, BOX_ONLY - only this element will receive pointer event and not children, NONE - neither this element nor its children will receive pointer events, and AUTO - pointer events are allowed for both this element and its children.
This diff adds PointerEvents support to flat RCTView. Most of the implementation is copied from ReactViewManager/ReactViewGroup. One small change is made to TouchTargetHelper to ensure that it works correctly with virtual nodes when their parent has PointerEvents set to PointerEvents.BOX_NONE.
Reviewed By: ahmedre
Differential Revision: D2784208
fb-gh-sync-id: 4b831f9b1bfb8014a99d7b33534ae7ff7b4ab498
Summary:
public
Added JS wrappers for ImageStore(Manager) and ImageEditor(Manager) so they can be required in the normal way instead of accessed directly via NativeModules.
Reviewed By: dmmiller
Differential Revision: D2773822
fb-gh-sync-id: 6eeafd3f80a87b1b91a04a2aebad6e2fd31b0e98
Summary:
It wasn't in UIExplorerList.ios.js (only in UIExplorerList.js) so it was not being pulled in on the iOS UIExplorer.
Closes https://github.com/facebook/react-native/pull/2196
Reviewed By: majak
Differential Revision: D2780150
Pulled By: nicklockwood
fb-gh-sync-id: f111ec6e29465c4c7f22ca8faec8fc17a96a80cb
Summary:
fixes#3106
Having -1 would trigger callback one frame early causing it to be ignored on the next frame.
Closes https://github.com/facebook/react-native/pull/3190
Reviewed By: svcscm
Differential Revision: D2783700
Pulled By: mkonicek
fb-gh-sync-id: 02070f70915055aec3b1543a8d553f2680438611
Summary:
Having a base activity allows us to add new features and fixes without having to change the generated `MainActivity` file.
cc mkonicek arbesfeld
Closes https://github.com/facebook/react-native/pull/4827
Reviewed By: bestander
Differential Revision: D2783527
Pulled By: mkonicek
fb-gh-sync-id: 707b82839809ca2e1775f5d3ac022a6d00bcac5a
Summary:
Allows you to do:
```
var { RecyclerViewBackedScrollView } = require('react-native')
```
Rather than:
```
var RecyclerViewBackedScrollView = require('react-native/Libraries/Components/ScrollView/RecyclerViewBackedScrollView')
```
Also...
- Export `ScrollView` by default rather than `UnimplementedView` for `RecyclerViewBackedScrollView` on iOS -- this makes it easier on the user, so you don't have to always do a conditional for: `if IOS then use ScrollView else use RecyclerViewBackedScrollView`. I can't think of a case where this would lead to undesirable behaviour.
- Add `RecyclerViewBackedScrollView` to `MainReactPackage`
- Fix an issue with `MapView` that threw a red-screen when trying to access constants on Android because there is no `MapView` in open source and MapView.js doesn't have a platform extension.
Closes https://github.com/facebook/react-native/pull/4514
Reviewed By: svcscm
Differential Revision: D2753466
Pulled By: mkonicek
fb-gh-sync-id: 0b6e2133975c911d5117e7531cb9093faf314c52
Summary:
Support dashed and dotted border styles on iOS
public
Reviewed By: nicklockwood
Differential Revision: D2773579
fb-gh-sync-id: f4b99943f38e849602295a86bdb1780c0abbc8e8
Summary:
Some custom fonts don't return a UIFontWeightTrait that is representative of their actual weight. For example, "AktivGrotesk-Light" and "AktivGrotesk-Medium" both return UIFontWeightTrait 0. While this is of course an issue with the font files themselves, licensing issues can make it difficult to modify them directly. When using these fonts, specifying weights in JS has no effect. I propose that if no weight information is available, we inspect the name of the font for weighting.
Closes https://github.com/facebook/react-native/pull/2113
Reviewed By: svcscm
Differential Revision: D2783383
Pulled By: nicklockwood
fb-gh-sync-id: 2a9caf99b6af74b7013ecc85417322b56c2dea20
Summary:
This pull request adds an example to the Dimensions documentations. Specifically, it gives an example of how to get the height and width from the window.
I'm submitting this documentation because discovering this information cost me some time and my hope is to save other folks time by having this info right in the docs generated from the comments in this file.
Let me know if you need anything else.
Closes https://github.com/facebook/react-native/pull/4211
Reviewed By: svcscm
Differential Revision: D2719953
Pulled By: androidtrunkagent
fb-gh-sync-id: 86d18e3847066211a013a50ce2f2a3e2032f5052
Summary:
We weren't exposing a mock for the batched bridge, which resulted in the WebSocket test failure but only in the open source copy of react-native.
public
Reviewed By: voideanvalue, vjeux
Differential Revision: D2782151
fb-gh-sync-id: e896097dd6060bc26963bc4c23db87b7277b3eba
Summary:
Currently, the app server accepts `transformModulePath` which allows us to use different transformation variants. However, these options persist through the lifetime of the server. So we cannot conditionally transform a module differently for two bundles without restarting the server with different options.
`getTransformOptions` basically allows us to change the options to the transformer at runtime based on the bundle and module being transformed.
These options are also used as a cache key for the transformedSource to ensure that if a file is transformed with different options, caching doesn't cause any inconsistencies.
public
Reviewed By: martinbigio
Differential Revision: D2776399
fb-gh-sync-id: 1e0f34d8fa7f0377fcf81f23eb6f3236bd397d56
Summary:
This is a followup to PR #3850 but now separates min/max track images into different properties.
Closes#4476
Add examples for `minimumTrackTintColor`, `maximumTrackTintColor`, `minimumTrackImage`, `maximumTrackImage` to UIExplorer.
Closes https://github.com/facebook/react-native/pull/4586
Reviewed By: svcscm
Differential Revision: D2779193
Pulled By: nicklockwood
fb-gh-sync-id: 0510a0f496816baacdd0d4be0f3cd3a63a5a9865
Summary:
public
An option to create a different view based on passed in props is no longer necessary.
I'm removing it, since the idea of creating a view based on set of initial properies is a bit flawed, since we cannot change it to another view later when props are changed.
(This API really made sense mostly in case where some of the props on component were not meant to be changed later, which is a bit weird limitation on a prop.)
Reviewed By: nicklockwood
Differential Revision: D2769206
fb-gh-sync-id: 190a4f5f31ee84085b1ec945b5d99746f39e8e4b
Summary:
this is a recent regression because the error appeared in my app (from 0.16 to 0.17).
```
<Image source={{ uri: null }} />
```
will make an error:
```
[RCTConvert.m:55] Error setting property 'source' of RCTImageView with tag #317: JSON value '<null>' of type NSNull cannot be converted to NSString
```
The solution attached is to check that uri is a NSString and return nil if not (the same way nil is returned in case of invalid url).
Closes https://github.com/facebook/react-native/pull/4902
Reviewed By: svcscm
Differential Revision: D2779789
Pulled By: nicklockwood
fb-gh-sync-id: cfe429ec5e53e63b7b368c06e693424ca8aaa11e