For some time now, the native mobile project has its own life in https://github.com/wordpress-mobile/gutenberg-mobile while still using the main Gutenberg code as a subproject (git submodule at the time of writing).
Rather recently, we had a basic integration back into the main Gutenberg repo by having the native mobile tests running as part of the main Travis jobs (#9883). Unfortunately, that effort drifted, become unmaintained and was forced to get reverted #11318.
The current state of affairs still creates extra effort to both sides, native mobile and web, to keep things moving forward but also in sync. It would be awesome if we pick up the integration again.
Let's lay a new plan.
Currently, to develop a feature on the native mobile app, one needs to open a PR on the web repo with the necessary changes, a PR on the mobile side make sure the git submodule references are kept up to date as the PRs progress and then juggle merging them close in time. Sometimes, it's not even clear which side to merge first. In every case, after merging, PRs have to get updated to point to the ref in masters or new PRs need to open to do that part.
Let's merge the two codebases and have to open single PRs.
Ideally, we'd like the teams to be able to be productive while the plan is executed. I'm thinking, a step-by-step plan that also allows some time to assess viability would be great.
Here's what I currently have in mind. Please, add your thoughts and suggestions so we can cross-check this can be made work for everyone:
gutenberg submodule itself), either by merging their code into the mobile repo (git subtree or just git adding their code) or by transforming them into simple npm package deps.gutenberg submodule which will get replaced in the next phase. While at this stage, the repo is still usable and devs can work as normal.git subtree the mobile repo into that.gutenberg submodule. Make sure mobile pipeline can use web's code directly to have hot-reloading enabled and working for fast turnaround times while developingyarn in favor of npm for the mobile build pipelinepackage.jsons to the extend the mobile app can be build from the root of the repoWhat do you think? Anything missing? Anything going down in the wrong direction? Any adjustments to make to the plan or the steps? Any thoughts on having the native mobile code as a npm package? How would that work? Any different plans?
As it stands, Phases C, D are the most "hazy" at the moment and would like to ask for help and ideas about expanding them.
Pinging some people here in particular to have their thoughts early on: @mtias , @youknowriad , @gziolo, @koke and CC @Tug to keep in the loop early on too.
I was wondering if we could speed it up by trying to integrate a scaffolded RN project into Gutenberg and then only repeat steps for Gutenberg mobile. To do so you would need to do the following
git clone [email protected]:WordPress/gutenberg.git
cd gutenberg
npm install -g react-native-cli
react-native init mobile
and try to set this project as a local private npm package controlled by Lerna.
react-native init mobile
Thanks @gziolo . BTW, that's what the current mobile repo and app is structured on. Besides, that scaffolded project will have zero integration with Gutenberg so, not sure what to add to it next to try the integration.
That said,
controlled by Lerna.
I have zero experience with Lerna so, can you expand what that will give us? Maybe we can do it directly to a a subtree'd mobile repo?
Opened #11533 with a proof of concept, I left my comments there.
Sounds like a very sane plan 馃憤
I think preparation could have a few more steps though to make the merge process a little bit easier.
We could start adopting gutenberg coding guidelines first, meaning:
bind inside render() but instead bind functions in the constructor as it's done in gutenberg.We could also switch to using the gutenberg store in gutenberg-mobile.
Or use npm instead of yarn before the merge.
Some things I did in #11533:
Something I could do:
@wordpress/element instead of react directlyThings we have to do later:
react-native, react-native-svg, etc.).I dropped Flow
Is that a hard requirement on Gutenberg-web's side? Like, does the pipeline break if Flow is enabled on the mobile code?
Is that a hard requirement on Gutenberg-web's side? Like, does the pipeline break if Flow is enabled on the mobile code?
I don't know if it breaks, but it would be nice to drop it for consistency.
I don't know if it breaks
Ok, cool.
but it would be nice to drop it for consistency
In principal yes and makes sense. In practice, as the mobile side team still tries to gain experience in the JS/RN and the ecosystem and RN projects seem to favor Flow and even Typescript, I'd prefer it if we try and keep it in for now, especially if it doesn't break anything.
@hypest and @koke - is is still going to happen? What's the current status.
@hypest and @koke - is is still going to happen? What's the current status.
馃憢 @gziolo . Yes, there is still the need to remove the chore of having 2 PRs opened for most of the work on mobile so, we should at least try to implement Phase A and B from the proposal on this ticket.
My impression is that we still need feedback from the web side of things on this plan. The attempt to dive directly to fully-merged projects was interesting but not usable for assessing Phase A and Phase B and this ticket overall.
So, the status of this ticket is: needs feedback from the web teams. Let's keep the ticket open for that reason.
To help make it more specific and hopefully more actionable, the proposal here can be simplified to: let's merge the repos but not the projects just yet and please, provide feedback on the steps on the ticket or share other proposals on how to accomplish that.
@Tug did some experiments in #17456. Do you have any feedback to share?
It has happened already 馃帀
If there鈥檚 anything left, let鈥檚 file individual more targeted issues. Great team work 馃憦
Most helpful comment
It has happened already 馃帀
If there鈥檚 anything left, let鈥檚 file individual more targeted issues. Great team work 馃憦