[RNMobile][Monorepo] Make the native app customizable by a parent app#21332
Conversation
1e09ea8 to
ef169ed
Compare
|
Size Change: 0 B Total Size: 828 kB ℹ️ View Unchanged
|
4c2b6b2 to
2541642
Compare
…squash' into rnmobile/experiment-monorepo-new-setup
…ps from the parent app or not
57e7ad6 to
2cfee15
Compare
| import { cloneElement } from './react'; | ||
|
|
||
| const render = ( element, id ) => | ||
| AppRegistry.registerComponent( id, () => ( propsFromParent ) => { |
There was a problem hiding this comment.
Out of curiosity, why not to execute all this logic inside initializeEditor in the @wordpress/edit-post package?
Overriding React methods and adding WP hooks might have some performance implications but I guess it’s called only once.
There was a problem hiding this comment.
I think it's to be able to customize the editor from an outside package. In this case a repo that's importing Gutenberg as a submodule. Correct me if I'm wrong @Tug?
There was a problem hiding this comment.
No we could totally have this logic in @wordpress/edit-post (or in @wordpress/react-native-editor as it was the case in the monorepo branch before this PR).
The idea here is simply to get closer to having @wordpress/edit-post work as cross-platform package. If you look at edit-post/src/index.native.js
you'll see that the init code is much closer to the web one now.
Overriding React methods and adding WP hooks might have some performance implications but I guess it’s called only once.
We're not overriding anything though, the render function wasn't defined for native prior to this. And yes it's only rendered once on load.
There was a problem hiding this comment.
It probably doesn't matter as much then now, but I guess initializeEditor would be the best place to run all those side effects.
|
Will now merge with "Use merge commit" strategy and revert back to "squash/rebase strategy" right after. |
Description
This PR does multiple changes which allows external native apps to reuse and customize the native block editor.
The main repo which customizes WordPress apps for Android and iOS is still gutenberg-mobile.
Here is the related PR for this integration: wordpress-mobile/gutenberg-mobile#2172
List of changes:
rendermethod in react platform to mimick the web API. Update the code inedit-postto use this new methodrendermethod to customize root component props and run pre render initialization codepackages/react-native-bridge/android/build.gradleto make WPAndroid build (switch from yarn to npm, update paths...)packages/react-native-bridge/android/vendor/hermes-engineso we can build WPAndroid using jitpack and a jsbundle without runningnpm installHow has this been tested?
See Gutenberg mobile PR
Types of changes
React native changes
Checklist: