Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monorepo] Merge to master #22714

Merged
merged 7,234 commits into from
Jun 23, 2020
Merged

[Monorepo] Merge to master #22714

merged 7,234 commits into from
Jun 23, 2020

Conversation

Tug
Copy link
Contributor

@Tug Tug commented May 28, 2020

*** To View Gutenberg-Mobile git history from before this merge, use the following fork: https://github.com/wordpress-mobile/gutenberg-rnmobile-monorepo-commit-history/

Description

This is the final PR that aims at merging the Monorepo effort in master.

What is Monorepo?

Monorepo is the name we gave to the project of merging gutenberg-mobile (the react-native version of gutenberg) and gutenberg together. Thus this PR contains all the commits from gutenberg-mobile plus some extra commits to make it work (see How has this been tested?).

With this PR comes a new flavour of the block editor: a native version that can run on both iOS and Android!

You can try the demo app from this branch by running npm run native start:reset followed by npm run android (or npm run ios) in a new terminal. You will need either the Android SDK or XCode installed on your machine (a docker based script should come later).

Why Monorepo?

Monorepo is a first step in making Gutenberg a cross-platform project. We’re not there yet as the project is still very much web in its direction. However, we have great hopes for developers to be able to create an amazing editing experience for both the web platform and native apps at the same time.

Many times we’ve seen changes to web code break the native build. This is because we were not able to fully convert gutenberg to native from day one so we had to make compromises and often duplicate features or components to have it working.

To address this issue we decided to simplify the gutenberg contributor’s journey in developing for mobile by providing all the necessary tools to run and test their code from within gutenberg. Moreover we would be adding back the mobile CI tests on every gutenberg PRs in order to spot regressions and help developers solve them.

What is going to change for web devs? #

This final merge PR has all the changes. Most of it are mobile build additions but it also has some minor changes web devs might want to be aware of:

  • We added 4 new CI jobs (as github actions) which will run on each PR for e2e testing of the mobile demo app.
  • We have added new dev dependencies such as appium, jest and metro (details here). Those were needed to have all our native scripts working.
  • Updates to tsconfig.base.json: we’re explicitly defining the types the web will load (see this discussion). We’re also excluding any files from the react-native packages.
  • Update to the check licenses script to exclude the react-native cli dependency.
  • Three new packages: react-native-aztec, react-native-bridge and react-native-editor
  • A new npm command npm run native to run native scripts in packages/react-native-editor/package.json

For a complete history of Monorepo please see the master PR.

What is going to change for mobile devs?

A bunch of new npm commands are now available:

New commands
Start the Metro server npm run native start
Reset cache and start the Metro server npm run native start:reset
Start the demo version for iOS npm run native ios
Start the demo version for Android npm run native android
Run native tests npm run native test
Run e2e tests locally for iOS npm run native test:e2e:ios:local
Run e2e tests locally for Android npm run native test:e2e:android:local

More details related to how to transition from a gutenberg-mobile setup to the this setup will be given on the gutenberg-mobile PR (note: add link when PR is ready)

How has this been tested?

This branch contains all the following approved PRs:

The last extra commits should only be updates to pull the latest changes from gutenberg-mobile develop and fix conflicts with gutenberg master.

Screenshots

Here are a few screenshots of the demo app which is part of this PR:

iOS

Simulator Screen Shot - iPhone 11 - 2020-06-05 at 18 08 44 Simulator Screen Shot - iPhone 11 - 2020-06-05 at 18 08 12 Simulator Screen Shot - iPhone 11 - 2020-06-05 at 18 09 03

Android

Screenshot_1591374224 Screenshot_1591374494 Screenshot_1591374518

Types of changes

Releasing a demo version of the react native block editor and improving the native dev experience.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

mchowning and others added 30 commits May 26, 2020 09:38
Allow writing custom HTML in HTML mode
…1.19.2

Update to official version of Aztec 1.19.2
…1.19.2

Update to official version of Aztec 1.19.2
This reverts commit 823d9bd.
@ceyhun ceyhun requested a review from gziolo June 23, 2020 10:24
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a quick set of fixes, thanks!

Congrats to the whole team for incredible work to make all that happen. I'm looking forward to even closer collaboration moving forward 🎉

@gziolo
Copy link
Member

gziolo commented Jun 23, 2020

We discussed with @hypest in a private chat what documentation should be improved as a follow-up. We identified:

For the web, there is also @wordpress/env package that offers a single command that fires a Docker image with a WordPress instance. It would be great to have something like that (in the future) to share between GitHub's actions and the local environment.

@gziolo
Copy link
Member

gziolo commented Jun 23, 2020

One more little thing, can you put .npmrc files in 3 new packages like this one:
like: https://github.com/WordPress/gutenberg/blob/feat/import-gutenberg-mobile-no-squash/packages/nux/.npmrc

This will prevent installing package-lock.json files inside them. It all should be handled from one lock file in the monorepo setup.

@ceyhun
Copy link
Member

ceyhun commented Jun 23, 2020

One more little thing, can you put .npmrc files in 3 new packages like this one:
like: /import-gutenberg-mobile-no-squash/packages/nux/.npmrc@feat

Sure 👍 Just added them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.