The Principal Dev – Masterclass for Tech Leads

The Principal Dev – Masterclass for Tech LeadsJuly 17-18

Join

logo

Native mobile apps, as easy as creating a website.

Intro

Hyperview is a new hypermedia format and React Native client for developing server-driven mobile apps.

See the Hyperview website for more information about Hyperview and Hyperview XML.

Hyperview XML

Hyperview React Native Client

CircleCI

This repo contains a React Native implementation of the Hyperview Client. It can either be integrated into an existing React Native app, or used to create a self-contained RN app.

Requirements

The Hyperview client only has the following required dependencies:

More importantly, the client is designed to be incorporated into an existing React Native project, and thus has the following peer dependencies:

Hyperview Demo App

This repo contains an example XML server that serves Hyperview XML to showcase the available features. It also contains a demo Expo project that can connect to the example XML server, or any other Hyperview endpoint.

1. Install dependencies

From the demo/ directory:

yarn

Note: you only need to run this step once.

2. Run the demo server

From the demo/ directory:

yarn server

This will start an HTTP server listening on port 8085.

3. Run the app

This step depends on whether you want to run the demo app in the iOS simulator, on an Android Virtual Device, or on a physical mobile device.

Running on the iOS simulator

From the demo/ directory:

yarn ios

This will open the iOS simulator and install the demo app in the simulator. It will then start the Expo development server to load the demo app.

Running on the Android emulator

From the demo/ directory:

adb reverse tcp:8085 tcp:8085
yarn android

This will open an Android Virtual Device (AVD) and install the demo app in the emulator. It will then start the Expo development server to load the demo app.

Running on a physical device

On your physical mobile device, install the Expo client

Make sure your mobile device and development machine are connected to the same Wi-Fi network.

From the demo/ directory:

cd demo
BASE_URL="http://X.X.X.X:8085" yarn start

[!NOTE] Replace X.X.X.X with the IP of your machine. This is needed in order for your physical device to be able to request the example XML files from your development machine.

This command will start an Expo development server and will display a QR code.

Developing Hyperview Core Features

As you're developing new features in the Hyperview library, you can use the demo app along with this special command to help you quickly test your changes:

From the demo/ directory (in a separate terminal):

yarn sync

This command will copy all the files from the hyperview/src directory, into the demo/node_modules/hyperview/src directory, and watch for any more changes.

You can also pass as an additional argument the root path of your own react-native app where you've installed hyperview to perform the same sync/watch operation. e.g.

yarn sync ../projects/my-cool-app

Tip

You may stop this with Ctrl + C

Troubleshooting

This version of the Expo app is out of date. Uninstall the app and run again to upgrade.

If you see this warning message on the Expo development server webpage, you need to uninstall the Expo app from the simulator or physical device and install the latest version. On a physical device, this means getting the latest version from an app store. In the simulator or AVD, this means uninstalling and re-running yarn ios or yarn android.

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.