React Native September 2018 (v0.57.0) released
v0.57.0 on GitHub (npm)
Changelog
Welcome to the 0.57 release of React Native! This release addresses a number of issues and has some exciting improvements. We again skipped a monthly release, focused on quality by extending the release candidate phase, and let some upstream packages reach stable for inclusion.
This release includes 599 commits by 73 different contributors! In response to feedback, we've prepared a changelog that contains only user-impacting changes. Please share your input and let us know how we can make this even more useful, and as always let us know if you have any feedback on this process.
Highlights
New features
- Accessibility APIs now support accessibility hints, inverted colors, and easier usage of defining the element's role and states; read more at @ziqichen6's excellent blog post
- On iOS,
WKWebView
can now be used within theWebView
component; read more at @rsnara's awesome blog post - Better support for out-of-tree platforms. For details, please refer to the discussion that the community used to get this up and running (there will be a new page in the docs dedicated to it too) - huge props to @empyrical for working on this!
Tooling updates
- Android tooling has been updated to match newer configuration requirements (SDK 27, gradle 4.4, and support library 27); building with Android plugin 3.2 doesn't work due to the gradle scripts, so please stay on Android Studio 3.1 for now
- Support Babel 7 stable landed! Be sure to read here about using TypeScript and check out the Babel 7 migration guide for help migrating.
- Metro has been upgraded (with Babel 7 and better transformer support), and in the next major release we plan on having two new features (ram bundles and inline requires) optional for you all to use - you can read how it will happen here; moreover, if you have a custom packager config, we recommend you read also the "updating to this version" section.
- Flow, React, and related packages have also been updated; this includes working support for the React Profiler.
The Slimmening is happening
As mentioned a few times in the past, the core team is reviewing the repository to trim it to the base React Native features in order to make the whole ecosystem more maintainable (by using a dividi-et-impera approach, the community will move faster and enable pull requests to be reviewed and merged quicker). This change requires extracting some components into their own separate repos and removing old, unused code (details here).
0.57 is not directly effected by any changes, but we want you to know that:
WebView
will be moved to its own repo at react-native-community/react-native-webview. There is already a base implementation there. Help us out by giving that a try, and expect thatWebView
will be deprecated soonNavigatorIOS
will be fully removed from the main codebase starting 0.58.0 (via this commit); it is now deprecated
Updating to this version
-
Upgrade the version of React Native in the
package.json
from0.56.0
to0.57.0
, and the React version to16.5
-
Change the babel-preset dependency from
"babel-preset-react-native": "^5",
to"metro-react-native-babel-preset": "^0.45.0",
, then change the.babelrc
configuration to:JSON { "presets": ["module:metro-react-native-babel-preset"] }
-
Ensure that you have all the babel dependencies to version
^7.0.0
(you may also need to addbabel-core": "7.0.0-bridge.0"
as a yarn resolution to ensure retro-compatibility) -
If you have a custom packager configuration via
rn-cli.config.js
, you probably need to update it to work with the updated Metro configuration structure (for full detail refer to Metro's documentation); here are some commonly encountered changes torn-cli.config.js
:```diff -const blacklist = require('metro/src/blacklist') +const blacklist = require('metro-config/src/defaults/blacklist')
// ...
module.exports = {
- watchFolders: alternateRoots,
- resolver: {
- blacklistRE: blacklist
- },
- transformer: {
- babelTransformerPath: require.resolve('./scripts/transformer.js'),
- },
- getProjectRoots() {
- return [
- path.resolve(__dirname),
- ].concat(alternateRoots)
- },
- getBlacklistRE() {
- return blacklist;
- },
- transformModulePath: require.resolve('./scripts/transformer.js'), } ```
-
Run
yarn
to ensure that all the new dependencies have been installed
Added: new features
- Add .nvmrc and ensure node version required is compatible with ESLint 5 (30b9d81 by @slorber)
- Major improvements to accessibility features (9f01e4c, b5b704d, c36e8b3, 40f6998, c1d0ccd, 679bff2, 10b603f, d9eeae9, 3cfa7ae, 5acb721, 5741f77, d0b86ec, e739143, c27b495, 5aa040d, 03036f7, 3bedc78, ca01290, 121e2e5, 1bc5226, 48b3d13, ef3d8b2, 5f8b44f, 50e4001, and f39d092 by @ziqichen6)
- Add
YogaNodeProperties
implementation based onByteBuffer
(0c97e75 and 23657cc by @davidaurelio) - Add
FlatList
andSectionList
to Animated exports (daa7c78 by @yunyu) - Adding new styling props to
FlatList
/VirtualizedList
forListHeaderComponent
andListFooterComponent
(a2675ce) - Added more info to Module Registry systraces (c7fdd27 by @axe-fb)
- Added support for out-of-tree platform plugins via a new
haste
field inpackage.json
; read more in the docs entry (6bcd51a by @empyrical) - Added
snapToOffsets
toScrollView
and made a number of fixes tosnapToInterval
as well (ef7e99c by @olegbl)
Android specific additions
- Allow registering custom packager command handlers (b3ef1c3 by @fkgozali)
- Implement
AccessibilityInfo.setAccessibilityFocus
for Android (be715ec by @draperunner) - Add Support for
overflow
style property (b81c8b5 and bbdc12eby @yungsters)
iOS specific additions
WebView
can now useWKWebView
internally if you passuseWebKit={true}
(e90d9ca, 9b3a6ec, f7f9d01, 94560ca, 06cce04, 1c3af59, 5662598, 1984f4b, 1b73e76, d0b5a38, 0fa5bd8, 527792a, ee971a7, d29c253, 0009d09, 078799f, f46dbc2, 262d286, 959aacf, and e0df3a1 by @rsnara)- Add
accessibilityHint
for iOS (253b29d by @draperunner)
Changes: existing functionality that is now different
- [BREAKING] In the CLI,
unbundle
is nowram-bundle
(ebf5aea by @jeanlauliac) - Bump minimum Node version to 8.3 (#20236) (e64e13f by @hramos)
- Updated React (70913a4, b7bb25f, and 0b30129 by @acdlite, @hramos, and @yungsters)
- Upgrade Flow to v0.76.0 (eac34e3 by @gabelevi)
- Upgrade jest to 23.4.1 (51cf9eb by @rafeca)
- Upgrade babel-eslint to v9.0.0-beta.2 with better support for Flow (abf1188 by @rubennorte)
- Upgrade ESLint to 5.1.0 (0f2f0ca by @rubennorte)
- Upgrade Babel to v7.0.0 (b9d1c83, 724c749 by Peter van der Zee, and 9f83fcc by @rubennorte and @rafeca)
- Metro is now at v0.45.0 (169d683, bda84a3, 5288656, 1bfa422, 96939ad by @CompuIves and @rafeca)
- Hide pre-bundled notification when not on dev mode (edf7100 by @yancouto)
- Refined
StyleSheet.compose
Flow Type (50a481d by @yungsters) - Catch JS bundle load failure and prevent calls to JS after that (201ba8c by @fkgozali)
- Use new Metro configuration in react-native cli (a32620d and aaf797a by @CompuIves)
- Whitelist
react-native-dom
in haste/cli config defaults (c4bcca6 by @vincentriemer) - In the CLI, don't override
metro.config.js
settings (3afe711 by @rozele)
Android specific changes
Image
source without a uri now returns null (28c7ccf by @himabindugadupudi)targetSdkVersion
is 26 (bfb68c0 by @dulmandakh)- Upgrade NDK to r17b (6117a6c by @dulmandakh)
- Upgrade NDK toolchain to 4.9 (ccdd450 by @dulmandakh)
- Upgrade Android Support Library to version 27.1.1 and set compileSdkVersion to 27; buildToolsVersion comes along for the ride, too (d9868f7 and 5992f8d by @dulmandakh)
- Upgrade Android gradle plugin to 3.1.4, Gradle wrapper to 4.4 (6eac2d4 and 33d20da by @gengjiawen and @dulmandakh)
- Upgrade to soloader 0.5.1 (b6f2aad by @gengjiawen)
- Upgrade mockito to 2.19.1 (3ea803a by @dulmandakh)
- Upgrade glog to 0.3.5 (b5fca80 by @dulmandakh)
Fixed: bugs that have been resolved
- Fixed builds on Windows machines (3ac86c3 by @rafeca)
- Fixed building tvOS (1f1ddd0)
- Fixed
TextInputState
'scurrentlyFocusedField()
(b4b594c by @janicduplessis) <VirtualizedList>
fix for jumpy content wheninitialScrollIndex
specified (e0c7363 by @rbrosboel)- Fix local-cli assetRegistryPath and middlewares (f05943d by @janicduplessis)
- Fix issue with when all are
flexGrow
andflexShrink
set to 0 except for one (90a408e by @priteshrnandgaonkar) - Fix react-native CLI's debugger UI path and metro host/port arg usage (5067540 by @Kureev)
- Hotfix to include
react-native-windows
in hasteImpl accepted paths (5494274 by @rubennorte) - Fix some classes of incorrect Flow errors for
Animated
(db2159d by @yunyu) - Fixed a typo in DockerTests.md (c1831d5 by @kant)
- Fix invalid use of destructuring in jest preprocessor (9d5bd50 by @umairda)
- Fixed a CLI crash when using old versions of node (9a4c21f by @keksipurkki)
Android specific fixes
- Fix issue with AsyncStorage not behaving properly on Android 7+ (1b09bd7)
- Fixed extreme
<TextInput>
slowness (5017b86 by @gnprice) - Fixed
<TextInput>
placeholder not being completely visible (8402232 and 86f24cc by @jainkuniya) - Fix Horizontal
<ScrollView>
's scroll position during layout changes with RTL content (de57327) - Fix Horizontal
<ScrollView>
overflow issue (d5465a9) - Fixing crash on SDK 15 on ReactTextInputLocalData (1bb2bea)
- Fix Drawing Rect for ReactScrollView (6a16bec by @yungsters)
- Fixed NoSuchKeyException Thrown From ReadableNativeMap bysafely unwrapping ReadableMap by defaulting to 0 if key not present (1a6666a by @Bhavik-P)
- Fixed runAndroid to enable the use of a package on port <> 8081 for Windows (3cd0737 by @ihenshaw)
- Don't crash on upload retry when trying to fetch on a varying quality network (7a246e4 by @dryganets)
iOS specific fixes
- Fix
TextInput.clear()
andTextInput.setNativeProps({text: ''})
to work (057d3ef by @magicien) - Correct fishhook import in RCTReconnectingWebSocket (75a0273)
- Change in RCTImagePickerManager to handle crashes if height/width is nil (82af7c9 by @abhi06276)
- Fix controlled
<TextInput>
on iOS when inputting in Chinese/Japanese (892212b by @mmmulani) - Fixed
<ScrollView>
bug encountered with brownfield apps (fab5fff by @PeteTheHeat) - Fixed missing selection indicator lines on
<PickerIOS>
(e592d6f by @VSchlattinger) - Fix crash in RCTImagePicker on iOS (934c50f by @mmmulani)
- Fix
undefined_arch
error received when building in Xcode 10 beta (e131fff by @futuun) - Add support for connecting to the Packager when running the iOS app on device when using custom Debug configuration (079bf3f)
- Fixed RCTAnimation import for integrating with cocoapods (7525f38 by @LukeDurrant)
Removed: features that have been removed; these are breaking
- [BREAKING] Removed
ScrollView.propTypes
; use flow or typescript for verifying correct prop usage instead (5b6ff01 by @sahrens)