WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.32k stars 4.12k forks source link

Migrate to React Native's New Architecture #53360

Open dcalhoun opened 1 year ago

dcalhoun commented 1 year ago

This issues tracks various tasks to upgrade third-party dependencies for the native mobile editor. The following tasks could likely be addressed individually as miniature projects.

What problem does this address?

React Native’s New Architecture could provide performance benefits (e.g. JSI) and may eventually be required for future React Native upgrades or compatibility with third-party dependencies.

What is your proposed solution?

Some prerequisite items may already have been completed (but have not been verified as complete), while some items may require a significant amount of work. If you can verify that an item is complete or would like to tackle an item, feel free to assign yourself and mark it off the list.

Prerequisites for Supporting the New Architecture in JavaScript

Enabling in an Android Library

Enabling in an iOS Library

Prerequisites for WPiOS

Prerequisites for WPAndroid

Third-Party Dependencies

Each third-party dependency will need to be upgraded to a version with New Architecture support or replaced entirely in this project.

The following table represents the status of each third-party dependency's support for the new React Native architecture.

Dependency Support Status Notes
react-native-get-random-values 🔴 Not Started Issue, PR
react-native-safe-area-context 🟢 Completed v4.1.2
react-native-screens 🟢 Completed 3.12.0
react-native-svg 🟢 Completed v13.0.0
react-native-webview 🟢 Completed v12.0.0
@react-native-masked-view/masked-view 🟡 In Progress Issue
@react-native-clipboard/clipboard 🟢 Completed v1.13.0
react-native-reanimated 🟢 Completed 3.0.0
react-native-gesture-handler 🟢 Completed 2.3.0
react-native-linear-gradient 🟢 Completed Forked
react-native-prompt-android Removed
react-native-video 🔴 Not Started No lead, blocked by v6
@react-native-community/slider 🟢 Completed v4.3.0
react-native-safe-area 🔴 Not Started Inactive
react-native-fast-image 🟡 In Progress Issue, PR
react-native-blur 🟢 Complete v4.3.0
dcalhoun commented 1 year ago

Noting that react-native-prompt-android was removed in https://github.com/WordPress/gutenberg/pull/54096.

fluiddot commented 9 months ago

Regarding the dependencies not supporting yet the new architecture, starting in RN 0.72 we could use the feature New Renderer Interop Layer as a workaround.

TL;DR: With React Native 0.72, we are releasing an interop layer for both Android and iOS to use non-migrated libraries on New Architecture apps.

JerakRus commented 7 months ago

react-native-safe-area I would recommend replacing it with https://github.com/th3rdwave/react-native-safe-area-context