React Native September 2017 (v0.49.0) released
v0.49.0 on GitHub (npm)
Breaking changes and deprecations
General
-
New projects have a single entry-point (
index.js
) from now on (6e99e31) - @fsonSummary:
Before
- When creating a new project with
react-native init
, generated template has two entry-points:index.ios.js
andindex.android.js
- Those two files were always identical
After
- When creating a new project, generated template has a single, shared entry-point:
index.js
Updating your code
When upgrading to this release with
react-native-git-upgrade
orreact-native upgrade
, be aware that these tools will automatically update your code to useindex.js
instead ofindex.ios.js
andindex.android.js
, as previously. However, they will not create anindex.js
file for you. This is a side-effect of thereact-native-git-upgrade
that has to be reverted. After running that tool, you have two options:- rename
index.ios.js
toindex.js
and removeindex.android.js
(providing that they were as generated byreact-native init
) - revert changes done by
react-native-git-upgrade
in order to keep separate entry files. That is, as soon as you upgrade, revert changes made toAppDelegate.m
,MainApplication.java
andbuild.gradle
.
- When creating a new project with
-
Yoga: Change aspect ratio behavior (67c160c) - @emilsjolander
Summary:
Before
- Aspect ratio would do its best to fit within it's parent constraints
- Aspect ratio would prioritize
alignItems: stretch
over other sizing properties.
After
- Aspect ratio is allowed to make a node grow past its parent constraints. This matches many other aspects of flexbox where parent constraints are not treated as hard constraints but rather as suggestions.
- Aspect ratio only takes
alignItems: stretch
into account if no other size definition is defined. This matches the interaction of other properties withalignItems: stretch
.
Updating your code
You probably don't need to do anything but in case something does break in your product it should be as easy as adding
{width: '100%', height: '100%', flexShrink: 1}
to the style declaring theaspectRatio
.
Android
- Rename module name to module path (5d4c6e5)
iOS
- Fix case sensitivity build warning in Xcode 8.3 (b050b69) - @rigdern
- Add deprecation warning to RCTBatchedBridge (f3feca9) - @javache
Android
Bugfixes
- Fix updating a view z-index on Android (b103903)
- Fix scroll events getting skipped on Android (29e5deb) - @janicduplessis
- Fix content appeared logging (091878a) - @bnham
- Retrieve correct content uri for videos (1748922)
- Separate window dimensions change from orientation (c9aeaf6) - @atsjenk
- Android Oreo (8.0) Support (6b39d64) - @AndrewJack
- Always set camera distance on transforms, to default 1280 if 0 (b2fe048) - @bartolkaruza
- Allow reactinstancemanager to set an initialization function (84e80eb)
- Fix getting correct video width and height metrics in Camera Roll (25f2938)
- Fix fetching video length in Camera Roll (4000202)
- Make ResourceDrawableIdHelper work with resource id (dc61f10) - @sriramramani
- Force original ime option when using multiline with blurOnSubmit (94a2ff9) - @reneweb
New features and enhancements
- Add --port option to run-android, defaults to 8081 (898790d)
- Add native Checkbox component (84b11dd)
- Expose offset parameters for ToastAndroid (546a43b)
- Refactor MemoryPressureListener to use Android levels (37754c5) - @cwdick
- Improve getCurrentPosition API (7e11bad) - @rigdern
- Do not send 'hot' parameter when requesting a bundle from Android (c2b3ee7) - @rafeca
- Allow whitelisting urls to bypass default webview loading (40a2885) - @fkgozali
- WebView: Show loading state when reloading (f95153e)
- Measure height of Android Text component based on includeFontPadding property (9f5bdd7)
- WebView: Only fire onLoadStart for toplevel page loads (ffbd3db) - @rigdern
- Support flash scroll indicators for android (2ceed95)
- Add perf marker that fires first time content is added to root view (d013ba3) - @bnham
- Add perf markers for reload and download (c080fe5) - @bnham
- Add more perf counters (caaf7fd) - @alexeylang
- Run onReactContextInitialized() on the UIThread (43ff9b4) - @AaaChiuuu
- Allow to fetch files over the network (b4f91be)
- Expose the ReactApplicationContext to createShadowNodeInstance() (64e9b24)
- Make JavaScriptExecutor.Factory a configurable property of ReactInstanceManager (73f1790) - @michalgr
- Remove appcompat dep from react/views/toolbar (c3b47e5)
- Reduce possible race condition on gc of catalyst instance (f0d9810)
- Report perf counters always when we call flushPendingBatches() (4aae843) - @alexeylang
- Expose method to set custom baseline function (9c2caaa)
- Download bundle atomically (d63cf13) - @bnham
- Remove v4 support library from RN deps (fe0d081)
iOS
Bugfixes
- Fix format specifier used in RCTCxxMethod (0e3117c) - @kastiglione
- Fix format specifier used in RCTUIManager (d81e549) - @kastiglione
- Fix infinite recursion in RCTSettingsManager init (b78b8cc) - @javache
- Apple TV: RCTTabBar selection controlled by native after render (fix #15081) (0e7375a)
- Fix flowtype errors for PushNotificationIOS (68bbccb)
- Fix registration for UIContentSizeCategoryDidChangeNotification (2b7cb46) - @rigdern
- RCTManagedPointer fix ups (77c11e8) - @fromcelticpark
- Fix TextInput numeric keyboard submit (d565bc3)
- Fix dev support calls made without an ifdef guard (14e67a3)
- Fix for Modal behavior when menu button pressed on Apple TV (Issue #15313) (0d3039f)
- Fix ENABLE_INSPECTOR ifdef not found during dev (edf60ce)
- Fix Yoga podspec casing (4535d52) - @javache
- Fix Image.getSize() according to image orientation (ccc11f2) - @doochik
- Fix fontWeight regression (0a31997) - @nihgwu
- Fix unrecognized selector error (aa0b2ad) - @giladno
- Fix crash when trying to load photo library assets with nil image url (6d64892) - @terribleben
- Report native warnings to YellowBox (e697ed7) - @javache
- Correctly handle the case where HEADER_SEARCH_PATHS is a single string (23f72a9) - @hramos
- Fixed issue with install third party script in directory with spaces (95d5d11) - @gabrielbull
- fishhook nwlog_legacy_v to avoid log spam on websocket reconnect (878b7e4) - @emilsjolander
- TextInput: Fix
onSubmitEditing
with disabledblurOnSubmit
(b06672e) - @shergin - ScrollView:
contentOffset
validatation now respectscontentInset
(950c2b2) - @shergin - Fixed issue with path containing spaces (743dc20)
New features and enhancements
- Expose didCloseWithCode in RCTReconnectingWebSocket (72dae51) - @cpluss
- Refactor memory management of RCTModuleMethod's arguments (2a6965d) - @fromcelticpark
- Show bundle download progress on iOS (ef23d2b)
- Introducing smart
RCTUnsafeExecuteOnMainQueueOnceSync()
and fixedRCTScreenScale()
(a7468a4) - @shergin - Do not send 'hot' parameter when requesting a bundle from iOS (6ad7e82) - @rafeca
- Adjust row height by font size in PickerIOS (28c1c88)
- Add
rootView
property toRCTShadowView
(6493a85) - @shergin - Expose barStyle for NavigatorIOS and TabBarIOS (b48149e) - @jacobp100
- Increase RCTTestRunner timeouts (dacb1fb) - @javache
- Geolocation: Allow skipping of permission prompts (6b7f10d) - @rigdern
- Expose webSocketDidOpen in RCTReconnectingWebSocket (bf67345) - @cpluss
- encapsulate JS source in RCTSource object (abe7a2a) - @bnham
- Allow hiding alert title on iOS (a646743) - @sterlingwes
- Change intValue -> integerValue in RCTMultipartStreamReader (f65b9e8) - @ide
- Improve RCTCxxBridge invalidation (af3e1d4) - @javache
- Add
pinchEnabled
prop to ScrollView (614dd07) - @jmurzy - Add support for Cxx objects as arguments to native modules (6783694) - @fromcelticpark
- Add notifications for dev reload (1ce7e4c) - @bnham
- Set alertTitle in UILocalNotification (ec74a96)
- Specialize JSCValueEncoder for id instead of NSArray (1cd276a) - @javache
- Allow native modules to customize the main-thread init behaviour (d42ccca) - @javache
- Configure requiresMainQueueSetup for core modules (220034c) - @javache
- Limit calls to SoLoader (5d79b26) - @javache
- Implement lazy discovery scaffolding for loading NativeModules on demand. (cf38b08)
- Call reloadImage less often when setting Image props (7542f3d) - @javache
General
Bugfixes
- VirtualizedList: Fix stale separator props and expose CellRenderer refs (ad21ad2) - @olegbl
- Fix TextInput autoGrow (7abce0b)
- Fix systrace section name (e16dd51) - @alexeylang
- Fix Unexpected token ) in babel-preset-react-native (f69638b)
- Yoga: Fix const declaration mismatch and double/float mix (95faccb)
- Fix stylesheet registery (68664ac) - @sahrens
- Fix HMR when adding/renaming assets (79fdb91) - @rafeca
- Fix panResponder nativeEvent.locationX and locationY values on touch move (1a262a7) - @newyankeecodeshop
- Add multi-client support for HMR (8b2975a) - @rafeca
- Add BlobModule native module mock to jest setup (1f85e21) - @timwangdev
- Make the CLI recognize CRNA projects (6f4025e) - @fson
- Make console work with JS engines which use print (de4e51b) - @dulinriley
- Unbreak touching in prod mode (460c5db) - @sophiebits
onAnimatedValueUpdate
should also include offset (d0669fc)- Avoid race condition for AppState.currentState (809f1e9)
- Don't assume JS integers are dynamic Ints (f6de2e4) - @mhorowitz
- Return meaningful error when no devices available (ad4aee7)
New features and enhancements
- Expose StatusBar height and fix StatusBar example - T13591448 (6f60f2b)
- RN local-cli: fix saveAsset scales filtering (b6e0f4a) - @jeanlauliac
- Add way for JS to query process-wide perf stats (f5f5ed5) - @bnham
- Add locking around calls from JSCExecuter (66a788f)
- RN babel preset: add import() syntax (ab9c788) - @jeanlauliac
- Move HelloWorld template to a single index.js entry point (6e99e31) - @fson
- Update default .gitignore to work with fastlane setups in sub-folders (aa9a40f) - @KrauseFx
- Export
Animated.Node
for ease of type checking (8d757e5) - @jamesreggio - Reject local-cli promises with Error objects (cc4de7a) - @zertosh
- Bring back React Stack support (3a031cc) - @alexeylang
- WebSocket API change to make room for other connection options (SSL pinning) (cd9d6e3) - @rh389
- Expose ModuleRegistry from Instance (1df198d) - @dulinriley
- AutoGrow for TextInput (21b1ed3) - @sumkit
- Gate more code with if (DEV) { } (f11f001) - @alexeylang
- Force the debugger to disconnect before a bundle reload (4150410)
- Allow to pass regular expressions to
buildRegExps
(475cf1a) - @davidaurelio - Expose "register devtools plugin" interface globally in React-Native (274f10f) - @Slava
- Use offset adjusted value in ModulusAnimatedNode (fedc002)
- metro-bundler: transform import() to basic require() (aaae99e) - @jeanlauliac
- Make gYGNodeDefaults const (f0f25c5) - @swolchok
- Disambiguate error messages in MethodCall (46f0a3b) - @javache
- Update systrace markers (c68bb6a) - @javache
- Stop CxxBridge run loop when bridge is invalidated (1f9fc0e) - @mmmulani
- Remove the restriction on importing bridge:cxxreact (de01f09) - @mhorowitz
- Gracefully handle any unrecognized stack frame format (9399379) - @adamjernst
- Refactor how symlinks are discovered in local-cli, support scoped modules (5d95e99) - @skevy
- Validate that JS and Native code versions match for RN releases (776bd34) - @janicduplessis