【0.45】React Native 中文更新日誌

Marno發表於2019-02-20
  • 本文為 Marno 原創,轉載必須保留出處!
  • 公眾號【 aMarno 】,關注後回覆 RN 加入交流群
  • React Native 優秀開源專案大全:www.marno.cn

一、重大變化


  • 移除從 ‘react-native’ 中匯入 React 的錯誤警告

    從 ‘react-native’ 中匯入 react 模組早在 0.25 的版本中被比標記為過期,現在如果再繼續這樣匯入會直接報錯。

  • 更新 podspecs ,使其支援並且預設使用 C++ bridge(iOS)

    如果你正在使用 Cocoapods, 你必須更新你的 Podfile ,給其中的 React subspec 新增 ‘BatchedBridge’ 或 ‘CxxBridge’ 的依賴。

二、新特性


Android平臺

  • 在 YOGA 中向 java 提供 setPointScaleFactor() 方法
  • 向 Java 提供列印方法
  • 在 CameraRoll 中允許顯示手機中的視訊
  • 在 DevServerHelper 中新增 symbolication 支援
  • 將 openStackFrameCall 新增到 DevServerHelper
  • 在 ReactRootView 新增 appProperty
  • 在啟動期間提高 RN 執行緒的優先順序
  • 如果 UIBackground 執行緒可用,則在 UIBackground 執行緒中進行斷言
  • 新增標記用來測試在 native 模組執行緒以外的獨立執行緒中執行 BG UI 操作
  • 新增明確的錯誤資訊當 e.getMessage 為空時
  • 重構 interfaces
  • 提供了建立後臺 UI 執行緒的能力
  • 新增了更多的 systraces
  • 用 try/finally 將 CREATE_MODULE 和 INITIALIZE_MODULE markers 包裹起來
  • 不在 UI 執行緒執行 setupReactContext()
  • 在使用完 DraweeControllerBuilder 後進行清除
  • 啟動從 ASyncTask 到 Thread 的轉換
  • 降低 native 模組和 JS 執行緒的執行緒優先順序

iOS平臺

  • 使用 CameraRoll 可以顯示手機中的視訊了
  • 在 iOS 中會提示更多的 verbose 級別的錯誤資訊
  • 新增重置 CxxModuleWrapper's 模組指標的 API
  • 從樹中移除 RCTBatchedBridge rule 以及所有的使用
  • Split off websocket related items to RCTPackagerConnection
  • 從 RCTRootView 初始化時立即觸發 renderApplication 方法
  • Native 動畫 - 在 iOS 上支援 decay 動畫
  • Port perf metrics used in RCTBatchedBridge
  • 在 iOS 的 native 模組中新增了對同步方法的支援
  • 在 RCTShadowView 中採用 Yoga's YGConfig
  • 清除 Xcode 專案中對 UIExplorer 的引用
  • 將 Merge RCTPackagerClient 合併到 RCTPackagerConnection 中
  • 從 Xcode 專案中移除對 RCTPackagerClientResponder 的引用
  • 引入 RCTAssertUIManagerQueue()
  • 引入 RCTUIManagerObserverCoordinator ,一種新方式訂閱來自 UIManager 的粒度通知
  • 當載入指令碼失敗時丟擲異常
  • 從 NetworkingModule 中移除對 WebWorker 的支援
  • 從 Timers 中移除對 WebWorker 的支援
  • 放棄對 WebWorkers 的支援
  • 避免在正在關閉的 view controller 上顯示其他控制元件(Alert 和 Modal 的問題)
  • 在 Redbox 中提示列表巢狀異常
  • 對 Apple TV 的支援: 為 ART library 新增在 tvOS 上的構建支援
  • 通過 bridge 暴露 shake-to-show dev menu 設定
  • 在 tvOS 模擬器中啟用 dev menu

iOS / Android 通用

  • 當元件元件解除安裝時需要將 TouchableHighlight 的 _isMounted 設定為 false
  • 自定義 build 配置: 移動 transform 配置到自己的屬性中
  • 修復誤報 isMounted() 方法過期的警告
  • CLI: Stronger typing for transformers
  • CLI: Disable no-alert eslint rule for node code
  • CLI:去掉 Config 中的 FBism
  • CLI: 在 callsite 中解析路徑而不是在 Config.loadFile 中
  • CLI: 修復 Promise 解決回掉錯誤
  • 修復 元件多行模式時候預設佔位文字的顏色
  • Allow calling NativeViewHierarchyManager.addRootView() off the UI thread
  • FlatList: 使用 $ReadOnlyArray 來代替 SectionList 中的 Array 來儲存 SectionItemT
  • FlatList: 將 section key 變為可選引數
  • FlatList: 多項改進
  • FlatList: 優化 VirtualizedList 進行更新的觸發機制
  • FlatList: 將 getItem 和 getItemCount 設定為必須屬性 (VirtualizedList)
  • FlatList: 新增 ListEmptyComponent 屬性
  • FlatList: 修改 separators.updateProps 屬性的前 / 後順序
  • FindNodeHandle properly handles ReactCurrentOwner current Fiber type
  • 將 React 版本從 16-alpha6 同步為 16-alpha12
  • Open in editor fix, show tip instead of error
  • 解決 parseFloat 錯誤使用 "radix" 的問題
  • 在 processColor.js 新增 flow
  • YellowBox 中新增可以忽略警告的方法
  • 重構 MessageQueue
  • 將 bundle 中的 module 按照路徑進行排序

Yoga

  • 給 Java 提供 setPointScaleFactor 方法
  • 給 Java 提供 print 方法
  • 將測量的 nodes 大小作為四捨五入時的最小約束
  • 在 RN 中禁止 yoga 進行四捨五入
  • 從實驗性特徵中移除四捨五入的特徵
  • Move reset into yoga node and don’t set overflow as it has no effect
  • 通過簡化呼叫來修復 useLegacyStretchBehaviour 標記
  • Fix flex-wrap with max constraint
  • Fix sizing of non stretch items
  • 使測量方式更像 web 中的測量方式
  • 將 YGLogger 移入 YGConfig 中並且把 YGNodeRef 與 log events 相關聯
  • New round-to-pixel-grid algorithm that fixes possible subpixel gaps between sibling nodes
  • Assertion on attempt to get layout metrics from dirtied Yoga node
  • 新增 YGConfigCopy

Packager

  • 將 node-haste 下的 index 重新命名為 DependencyGraph
  • Packager - 修復在 windows 中的 symbolicate
  • 不在啟動時連線 websocket ,也不在停止時斷開 websocket 連線
  • 當關閉 socket 時呼叫 onDisconnected() 而不是 onConnected()
  • 移除沒有用到的 hash
  • 將 packager 的 inspector 超時時間從 5s 增加到 30s
  • ModuleGraph: 包括所有可能的 asset 型別
  • 優化 assets' JS
  • Worker-farm: 隔離 stdout / stderr
  • 正確處理 babel 忽略的檔案,只返回內容
  • Force 'default' transform variant to be present
  • 使構建 bundle 的函式為非同步執行
  • 從 Bundler 中抽取可複用的邏輯
  • Separate node polyfills from runtime transforms
  • 統一 source map 型別
  • 修改 postprocessing hook 使其能在 ModuleTransport 例項上執行
  • Inline plugin: type options
  • 使 test 從 side effects 獨立出來
  • 從 cache key 中移除不相關的選項
  • Stronger typing for transform options / remove duplication
  • 修復 module system 和 polyfills 的路徑
  • 修正對 haste packages 的支援
  • Fix release / minified bundle builds
  • 更快的 terminal 反應
  • Fork local version of worker-farm
  • ResolutionRequest: keep option object as it is
  • Buck worker: output assets
  • Buck worker:更好的型別
  • Worker:強化 TransformOptions
  • AssetPathUtils: @flow
  • GlobalTransformCache: throat() 檔案讀取方法
  • 移除最後使用的 declareOpts 的部分並用 Flow 型別代替
  • TransformCache: 儲存最後一次進行快取的時間
  • TransformCache: 包含 UID + 不再使用 base64
  • 更新 jest-runtime 到 19.0.3 版本
  • Buck library: expose asset content
  • Buck library: aggregate assets
  • AssetServer: @flow
  • getAssetDataFromName: @flow
  • GlobalTransformCache: 將 transform 配置摘要進行快取
  • GlobalTransformCache: 修復無約束函式
  • Add support for relative files with custom extensions
  • 正確轉換 assets 以避免字串
  • worker-farm/lib/fork.js: cleanup
  • worker-farm: 傳遞明確的 execArgv 給 workers

三、修復 Bug


Android平臺

  • 修復當點選設定中的“Comments”時導致的奔潰
  • 修復設定了 z-index 屬性的元件觸控目標不準確的問題
  • 修復 Inspector 中 Page 建構函式提示 NoSuchMethodError 的問題
  • Fix Nodes not having correct view managers externally
  • 修復在使用 時造成狀態列顏色加深的問題

iOS平臺

  • 修復當在 cli 引數中明確了 scheme 時執行 run-ios 命令出現的問題
  • 修復 RCTMultipartDataTask 中的記憶體洩露
  • 修復在 RCTTouchEvent 中由 NaN 值引發的奔潰
  • 修復 RCTAnimation 中標頭檔案的問題
  • 在 npm package 配置中新增 third-party-podspecs
  • 修復在使用 react-native-tooltip 時出現的自動新增 “Cpoy” 選項的問題

iOS / Android 通用

  • 將 XMLHttpRequest 中的 withCredentials 預設值改為 true
  • 在公開的 API 中提供 findNodeHandle() 方法
  • 修復 TouchableHighlight 中的警告

【0.45】React Native 中文更新日誌

相關文章