Summary:
As part of improving the API and Component reference docs #8154 this pull request adds the following:
- jsdoc support for API docs. See the AlertIOS changes as an example.
- type definitions support and added to both API and Component docs. This is supported via react-docgen and jsdoc.
- better formatting of method properties (now shown in a table).
FYI, API and Component docs were previously generated in two different ways. Components were using react-docgen and that basically remains as-is. APIs were using custom parsing code and that's been switched to use a jsdoc parser + react-docgen as an option for typedefs (it could also use the jsdoc parser).
Two docs have been updated to showcase how we'd like the new docs to look:
- AlertIOS (API): showing method parameters, examples, typedefs, more details overall.
- Statusbar (Component): showing method parameters, typedefs, more details overall.
**Note**: To convert new API docs to use the new format, add `jsdoc` to the initial file comment. C
Closes https://github.com/facebook/react-native/pull/8196
Differential Revision: D3465037
Pulled By: lacker
fbshipit-source-id: 78415d44bc5be02db802f5b1f7a0b249689abdf7
Summary: This shall make it convenient to handle transition changes.
Reviewed By: ericvicenti
Differential Revision: D3442291
fbshipit-source-id: aee0ffe18ada40ef133484b4a4999f282c66c181
Summary: https://github.com/facebook/react-native/pull/8071 introduced a bug where jumping to the same navigator route would show a blank screen since the `index` check is not catching cases where the `transitionQueue` is empty.
Reviewed By: ericvicenti
Differential Revision: D3464697
fbshipit-source-id: 494527d1fb0ac5aea394abd3231dd19c56596549
Summary:
This diff translates implementation of transform matrix decomposition from JS to java. This is to support offloading animations of transform property, in which case it is required that we can calculate decomposed transform in the UI thread.
Since the matrix decomposition code is not being used for other platform I went ahead and deleted parts that are no longer being used.
**Test plan**
Run UIExplorer Transform example before and after - compare the results
Closes https://github.com/facebook/react-native/pull/7916
Reviewed By: ritzau
Differential Revision: D3398393
Pulled By: astreet
fbshipit-source-id: 9881c3f565e2050e415849b0f76a0cefe11c6afb
Summary:
With accessibility prop set to true, it is not possible to access
childern elements. This makes it impossible to test Components with
appium and releatives. This commit adds support to change accessiblity
property on Touchable elements to overcome the aforementioned issue.
Closes https://github.com/facebook/react-native/pull/8243
Differential Revision: D3462949
Pulled By: javache
fbshipit-source-id: 65ce6507a1619218ab5b527c970a74af197ef462
Summary:
It seems it's a common problem people trying to register for push notifications in their simulator, and not understanding why the "register" event never works.
I've wasted a few hours myself on this issue.
This commit simply logs any failures with push registration, preventing confusion.
Closes https://github.com/facebook/react-native/pull/8046
Differential Revision: D3454922
Pulled By: javache
fbshipit-source-id: a96896d97d97cfe1bd319e6490750838dfaad3cd
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
(You can skip this if you're fixing a typo or adding an app to the Showcase.)
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
Make sure tests pass on both Travis and Circle CI.
**Code formatting**
Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).
For more info, see the ["Pull Requests" section of our "Contributing" guidelines](https://github.com/facebook/react-native/blob/mas
Closes https://github.com/facebook/react-native/pull/8071
Differential Revision: D3453372
Pulled By: ericvicenti
fbshipit-source-id: 3494faee1a83574c3937a6545b246713ec38e0d0
Summary:
Currently, every warning triggers a packager request to symbolicate the stack trace. If there happens to be a lot of warnings or if the packager or device are pretty busy (or low powered), this can cause a significant delay in responsiveness (and development velocity).
This fixes the issue by only symbolicating warnings when users inspect them.
Reviewed By: sahrens
Differential Revision: D3448032
fbshipit-source-id: d6154f336ed34c15f99170da013ae3ff1f1ef075
Summary:
Notable changes (excluding DOM-only things):
- Improved warning messages for propTypes and key warnings
- Production error codes
- Improved performance in DEV mode
- More accurate data in ReactPerf instrumentation
- Experimental JSON test renderer
- Minor bug fixes
Full changelog: fef495942a...c66f40f749.
Reviewed By: AaaChiuuu
Differential Revision: D3442002
fbshipit-source-id: 940fc65ba5d0b742417bbe2fcbd36eb9dc7443e1
Summary: I noticed sometimes the swipeable row prioritizes the list view's vertical scroll too much, or returns to closed position if swiped a little distance but at high velocity. These new thresholds help both cases.
Reviewed By: hedgerwang
Differential Revision: D3441994
fbshipit-source-id: 84a9fdf63a33b3047a9a0205e87d8c489e9a6631
Summary: the default child alignment of 'stretch' is not compatible with flexWrap:'wrap'. By aligning children to the start of the container we fix this.
Reviewed By: jingc
Differential Revision: D3436864
fbshipit-source-id: ead5a5765ed0c336ed6e727af2970d4e6d7ff34f
Summary:
Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android.
DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector.
For reference, [the relevant issue on react-devtools](https://github.com/facebook/react-devtools/issues/229).
Closes https://github.com/facebook/react-native/pull/8095
Reviewed By: bestander
Differential Revision: D3430206
Pulled By: javache
fbshipit-source-id: 76f19407271a3779e12bd244f1bc31ef3a8659c7
Summary:
Currently, DevTools only work under ios (although this is undocumented!), because the JavaScriptEngine initialization process skips setupDevTools() on android.
DevTools work fine with Android, as tested on 0.26, 0.27, and 0.28 using Nuclide's inspector.
For reference, [the relevant issue on react-devtools](https://github.com/facebook/react-devtools/issues/229).
Closes https://github.com/facebook/react-native/pull/8095
Reviewed By: bestander
Differential Revision: D3430206
Pulled By: javache
fbshipit-source-id: 826f0252fff3f0ec2c843149540a0109e34d1d18
Summary:
This defines the generic function prop `render(props: NavigationTransitionProps)`
to NavigationTransitioner, which enables developer to render scenes, header, overlay,
underlay...etc.
Differential Revision: D3431478
fbshipit-source-id: 93dbc7da23ad8c95565b01f7865d1e8dfd4401f7
Summary:
We're seeing sporadic "CGContext...: invalid context 0x..." error messages during snapshot runs of our product build. This also seems to happen sometimes when building RN, see for instance: https://www.google.nl/search?q=site%3Atravis-ci.org%2Ffacebook%2Freact-native%20CGContextSaveGState%20invalid%20context
Our guess is that at some point, the CGContextRef is autoreleased. We tried retaining the ref first, but eventually settled for pushing/popping the context as it never fails in our tests (retaining still causes seemingly unrelated failures).
We're not sure if we can provide a testplan for this change, as the FBSnapshotTestController is not tested separately.
Closes https://github.com/facebook/react-native/pull/8098
Differential Revision: D3431043
fbshipit-source-id: 61b9a7a849a020f6b8671d63781eed9418d409dc
Summary:
**Motivation:**
Lots of examples on the web still have the old way to import React APIs from React Native. Also when someone upgrades to latest version of React Native without reading the release notes can get confused. This PR adds getters for `createClass` and `Component` and throws an error with a better error message when they are accessed.
![screenshot_20160614-125622](https://cloud.githubusercontent.com/assets/1174278/16034600/47c70222-3230-11e6-9fe4-1a3493708829.png)
**Test plan:**
Trying to use `ReactNative.createClass` or `ReactNative.Component` will throw an error with this error message.
There's currently a bug in `symbolicateStackTrace` which actually crashes the app after showing the error due to the `stack` being null when updating the stack trace. But that's a separate issue which should be fixed separately. For now, to prevent the crash, we need to add the following before the return statement here - https://github.com/facebook/react-native/blob/master/Libraries/JavaScriptAppEn
Closes https://github.com/facebook/react-native/pull/8099
Differential Revision: D3430468
Pulled By: javache
fbshipit-source-id: c098e51e1f2c276d87eca6da3bd91a457d7840c5
Summary:
This replaces ActivityIndicatorIOS and indeterminate ProgressBar that were deprecated recently with ActivityIndicator across the codebase and examples and a few other cleanups.
This also make a small tweak to ActivityIndicator so it uses the Android theme color instead of gray when no color is specified.
Use Slider instead of SliderIOS in CameraRoll example.
Remove the line about unifying ActivityIndicator and ProgressBar.
**Test plan**
Tested the affected components in UIExplorer on iOS and Android, tested the changes made in Movies example on iOS and Android.
Closes https://github.com/facebook/react-native/pull/8082
Differential Revision: D3429770
fbshipit-source-id: 3b2e1196a8b9fe00d47a7aa1bbc079b094796421
Summary:
`polyfillLazyGlobal` used a top level this which get stripped by babel `transform-es2015-modules-commonjs` with the default config. This is mainly an issues for people not using the react native babel preset.
This also replaces a few GLOBAL with global for consistency with the rest of the file.
**Test plan**
Tested that there was an error when using `['transform-es2015-modules-commonjs', { strict: true, allowTopLevelThis: false }]` in the babel config and that it was fixed after applying my changes.
Fixes#7700
Closes https://github.com/facebook/react-native/pull/7971
Differential Revision: D3427675
Pulled By: javache
fbshipit-source-id: 48f258b0db1bf21185193bd56df453ced9242e64
Summary:
This adds support for specifying multiple sources for an image component, so that native can choose the best one based on the flexbox-computed size of the image.
The API is as follows: the image component receives in the `source` prop an array of objects of the type `{uri, width, height}`. On the native side, the native component will wait for the layout pass to receive the width and height of the image, and then parse the array to find the best fitting one. For now, this does not support local resources, but it will be added soon.
To see how this works and play with it, there's an example called `MultipleSourcesExample` under `ImageExample` In UIExplorer.
Reviewed By: foghina
Differential Revision: D3364550
fbshipit-source-id: 66c5aeb2794f2ffeff8da39a9c0b95155fb2d41f
Summary: Expose the ability to provide extra information to Systrace events from JS. This is specifically useful for instrumenting generic recursive method that are defined completely through their params.
Reviewed By: tadeuzagallo
Differential Revision: D3423595
fbshipit-source-id: 7f2dedf02bf901401a6b391b85b1a0bb6782349c
Summary:
Submitting PR for adding textAlignment to the placeholder of textView so that it matches the alignment of the actual value text
Closes https://github.com/facebook/react-native/pull/7429
Differential Revision: D3422007
fbshipit-source-id: e255c2d86dbaa0e197328a56ec81cbab2735c53d
Summary: Slower bounce during mount and right swipe, so it feels less jarring to users.
Reviewed By: hedgerwang
Differential Revision: D3420169
fbshipit-source-id: d5da87c4a64eecf478edd626c96f5541ab94b56e
Summary:
Currently if an RN app is started in response to a remote notification, that notification's data is available on startup via `PushNotificationIOS.popInitialNotification()`. However, if the app is started in response to a "local" notification, that information is never passed in. This PR modifies the `popInitialNotification` behavior so it will return the notification used to launch the app, no matter if it was local or remote.
I've tested this change in my app and ensured that when the app is woken up with a `localNotification` it's passed in to `PushNotificationIOS.popInitialNotification`. I've also tested that the `localNotification` event continues working as before.
Closes https://github.com/facebook/react-native/pull/7765
Differential Revision: D3417267
Pulled By: nicklockwood
fbshipit-source-id: 0b5b432e9a75dda7d3c50289a3bf0f1c1ffcf061