Skip to content

wordpress-mobile/GutenbergKit

Repository files navigation

GutenbergKit

An experimental Gutenberg block editor for native iOS and Android apps relying upon web technologies.

GutenbergKit running on an iPhone

Development

Preqrequisites

The following tools are must be installed on your development machine to build GutenbergKit:

Web App

Install the GutenbergKit dependencies and start the development server by running the following command in your terminal:

make dev-server

Once finished, the web app can now be accessed in your browser by visiting the URL logged in your terminal. However, it is recommended to use a native host app for testing the changes made to the editor for a more realistic experience. A demo app is included in the GutenbergKit package, along with instructions on how to use it below.

Demo App

This demo app is useful for quickly testing changes made to the editor. By default, the demo app uses a production build of the web app bundled with the GutenbergKit package—i.e., the output of the project's make build command. During development, however, it is more useful to run the web app with a server and provide the server URL as an environment variable for the demo app, so that changes are displayed in the app immediately.

iOS

  1. Start the development server by running make dev-server.
  2. Launch Xcode and open the ios/Demo-iOS/GutenbergKit.xcodeproj project.
  3. Select the Gutenberg target.
  4. Navigate to ProductSchemeEdit Scheme.
  5. Add an environment variable named GUTENBERG_EDITOR_URL with the URL of the development server.
  6. Run the app.
Example Xcode environment variable Example Xcode environment variable

Android

  1. Start the development server by running make dev-server.
  2. Launch Android Studio and open the android project.
  3. Modify the android/local.properties file to include an environment variable named GUTENBERG_EDITOR_URL with the URL of the development server.
  4. Run the app.
Example Android local.properties
GUTENBERG_EDITOR_URL=http://<YOUR_LOCAL_IP>:5173/

Production

To build GutenbergKit for production run the following command in your terminal:

make build

Once finished, the Swift and Kotlin packages are ready to publish. Consuming iOS or Android host apps can then include the GutenbergKit package as a dependency.