React Native January 2019 (v0.58.x) released
v0.58.0 on GitHub (npm)
Changelog
Welcome to the January 2019 release of React Native. There are a number of significant changes in this version, and we'd like to especially call your attention to:
- Modernizing and stengthening flow types for core components
- Break changes to
ScrollView
,CameraRollView
, andSwipeableRow
that make it no longer bound to the component instance in certain methods - Support for mutual TLS in WebKit
- Asset serving from directories besides
/assets
- Numerous crash fixes and resolutions for unexpected behavior
Thanks to those who gave feedback on our release candidates. If you're interested in helping evaluate our next release, check you our tracking issue here.
Added
- Add support for
publicPath
to enable serving static assets from different locations (0b31496 by @gdborton)
Android specific
- Bundler server host can now be set using Android System Properties, making for easier debugging across multiple apps or app installs
adb shell setprop metro.host
(e02a154 by @stepanhruda) - Native Modules can now reject a promise with an additional
WritableMap
arg for extra properties (userInfo
). See the interface defined inPromise.java
for available methods. This is accessible in JavaScript asError.userInfo
. This is to match iOS's existingError.userInfo
behaviour. See PR for examples. (#20940 by @Salakar) - Native Modules now expose a
nativeStackAndroid
property to promises rejected with an Exception/Throwable - making native error stacks available inside Javascript:Error.nativeStackAndroid
. This is to match iOS's existingError.nativeStackIOS
support. See PR for examples. (#20940 by @Salakar)
iOS specific
- Add
moduleForName: lazilyLoadIfNecessary
to RCTBridge.h to lookup modules by name and force load them, plus various improvements to LazyLoading (d7a0c44, 6534718, d7865eb, 04ea976, 1f394fa, 80f92ad, and 81b74ec by @dshahidehpour, @fkgozali, and @mmmulani) - Add ability for WebView to
setClientAuthenticationCredential
whenuseWebKit={true}
for mutual TLS authentication (8911353 by @mjhu)
Changed
- Major improvements to Flow types for Core Components (499c195, fbc5a4f, f9050e0, 6476151, c03fc40, 69213ee, 136dfc8, 3c0211b, c127000, 636e146, 6fa997d, 35a65cd, 7927497, 45c5183, a97d104, fb4825a, 84c5416, 3649a50 by @mottox2, @saitoxu, @RSNara, @watanabeyu, @Tnarita0000, @exced, @nd-02110114, @flowkraD)
- Many public components were converted to ES6 classes (ScrollView by @thymikee, CameraRollView, SwipeableRow and ProgressBarAndroid by @exceed, ProgressViewIOS by @empyrical, SegmentedControlIOS, ToolbarAndroid by @nd-02110114
- Flow dependency is now at v0.86.0 (8fb228f by @panagosg7)
- metro dependency is now at v0.49.1 (f867db3, 8888295, 31bb551, de60e86, and a525941 by @alexkirsz and @rafeca)
- jest dependency is now at v24.0.0-alpha.6 (1b4fd64, 66aba09, and 06c13b3 by @rafeca and @rubennorte)
- fbjs-scripts dependency is now at v1.0.0 (#21880) (cdbf719 by @jmheik)
- folly dependency is now at v2018.10.22.00 (a316dc6, 19a7ecc, and a70625a by @Kudo and @radko93)
- React sync for revisions 4773fdf...6bf5e85 (0cb59b5 and e54d1e2 by @yungsters)
- Clearer error messages when hot reloading (c787866 by @alexkirsz)
- Allow CxxModules to implement functions which take two callbacks (8826d8b by @acoates-ms)
Breaking Changes
- Public methods of components converted to ES6 classes are no longer bound to their component instance. For
ScrollView
, the affected methods aresetNativeProps
,getScrollResponder
,getScrollableNode
,getInnerViewNode
,scrollTo
,scrollToEnd
,scrollWithoutAnimationTo
, andflashScrollIndicators
. ForCameraRollView
, the affected methods are:rendererChanged
. ForSwipeableRow
, the affected methods are:close
. Therefore, it is no longer safe to pass these method by reference as callbacks to functions. Auto-binding methods to component instances was a behaviour ofcreateReactClass
that we decided to not preserve when switching over to ES6 classes.
Android specific
- Optimize
PlatformConstants.ServerHost
,PlatformConstants.isTesting
, andPlatformConstants.androidID
for performance (2bf0d54, 339d9d3, and 9f9390d by @stepanhruda, @fkgozali, and @axe-fb)
iOS specific
Removed
Fixed
- Fix potential UI thread stalling scenario from Yoga JNI bindings (2a8f6c3 by @davidaurelio)
- Fix crash happening due to race condition around bridge cxx module registry (6770b53, 1c31919, and 188cbb0 by @PeteTheHeat)
- Fix View and Text's displayName; show the specific name rather than generic "Component" (7a914fc by @rajivshah3)
- Fix
react-native init --help
so that it doesn't returnundefined
(58732a8 by @ignacioola) - Fix
react-native --sourceExts
(ce86080 by @elyalvarado) - Fix accidental showing of Modal when
visible
prop is undefined or null (cc13a73 by @MateusAndrade) - Fix crash during VirtualizedList pagination (5803772)
- Fix scenario where removing a module with remote debugging and Delta bundles may cause incorrect stack traces (bea57d8 by @alexkirsz)
Android specific
- Fix crash when removing root nodes (b649fa9 by @ayc1)
- Fix various ReactInstanceManager deadlocks and race conditions (df7e8c6, 309f85a, and be282b5 by @ayc1)
- Fix IllegalArgumentException when dismissing ReactModalHostView and DialogManager (e57ad4e and 38e01a2by @mdvacca)
- Fix incorrect merged asset path with flavor for Android Gradle Plugin 3.2 (e90319e by @yatatsu)
- Fix HTTP connection ontimeout callback (a508134)
- Fix websocket properly closing when remote server initiates close (2e465bc by @syaau)
- Fix compatibility issue for Android 16 device (5939d07, f22473e, and d4d457b by @gengjiawen)
- Fix issue where
Image.resizeMode
isn't respected while source is loading, resulting in unexpected padding (673ef39 by @dulmandakh) - Fix Android 28's inverted ScrollView so that momentum is in the proper direction (b971c5b by @mandrigin)
iOS specific
- Fix case where content of inline views didn't get relaid out (798517a by @rigdern)
- Fix issue with ImagePickerIOS's inconsistent image when using the front-facing camera (4aeea4d)
- Fix race condition and crash around shutdown of the JSC for iOS 11 and earlier (bf2500e by @mhorowitz)
- Fix crash in NetInfo's _firstTimeReachability (eebc8e2 by @mmmulani)
- Fix case where inline view is visible even though it should have been truncated (70826db by @rigdern)
- Fix crash with ScrollView related to content offsets (f6566c7 by @shergin)