RN 版本更新

作者: 鸢尾嵌宇 | 来源:发表于2019-07-04 16:10 被阅读0次

    RN升级注意事项

    0.59.10 (当前使用react-native upgrade 无法升级到此版本)
    主要是解决了android 三星机型的崩溃问题。

    0.59.9

    1. release 简述
      (1)提供了大量新的组件,但是不推荐使用
      (2)主要是支持了gradle 5.4.1 & 3.4.0 和 xcode 11,特别是android针对应用程序兼容性QoL的改进
      2、详解
      (1)Hooks are here. 官方建议之后使用hooks替代Class
      (2)android上,更新JSC,性能提升、64-bit支持
      (3)更快的app启动性能,按需加载资源,metro懒加载。更新到0.59后,需要一个metro.config.js文件。详细见 [内联引用](https://reactnative.cn/docs/performance/#内联引用)
    为啥我按照内联引用,懒加载模块,首次加载的模块和之前一模一样
    

    (4)核心化,迁移了一些组件(主要在存储部分)(AsyncStorage
    ImageStore | ImageStore |
    MaskedViewIOS
    NetInfo
    Slider
    、[ViewPagerAndroid]@react-native-community/react-native-viewpager

    (5)CLI的接入使用
    例子:0.59后,更新需要使用 react-native upgrade
    (6)安卓注意:!!!We recommend updating your project's AndroidManifest.xml file, making sure that the android:theme value is an AppCompat theme (such as @style/Theme.AppCompat.Light.NoActionBar).

    0.59

    ——

    0.58.5
    1、improve Android Network Security config(https://github.com/facebook/react-native/commit/fbd31c5)

    0.58

    ——

    相应版本

    metro dependency is now at v0.49.1

    jest dependency is now at v24.0.0-alpha.6

    fbjs-scripts dependency is now at v1.0.0

    folly dependency is now at v2018.10.22.00

    React is set to 16.6.3

    ——

    1、iOS,升级时需要手动链接javascriptcore框架;

    2、android,SDK 27支持,28还在研究 (最新版本支持)

    Android专属

    1、android系统属性设置bundler服务器主机,从而使跨多个应用程序的调试更加容易,或者安装adb shell setprop metro主机(https://github.com/facebook/react-native/commit/e02a154

    2、Native Modules can now reject a promise with an additional WritableMap arg for extra properties (userInfo). See the interface defined in Promise.java for available methods. ——nativeStackAndroid

    3、Optimize PlatformConstants.ServerHost, PlatformConstants.isTesting, and PlatformConstants.androidID for performance

    iOS专属

    1、Add moduleForName: lazilyLoadIfNecessary to RCTBridge.h

    2、Add ability for WebView to setClientAuthenticationCredential when useWebKit={true} for mutual TLS authentication

    可能会遇到的资源版本不对应问题

    您应该尝试将Android/Build Gradle文件中,生成工具版本更新为buildtoolsversion=“28.0.2”。

    相关文章

      网友评论

        本文标题:RN 版本更新

        本文链接:https://www.haomeiwen.com/subject/fxjthctx.html