npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-embryo

v0.1.0

Published

- [x] Bugfree Xcode & Android setups for multiple build flavors - [x] [React Native Navigation](https://github.com/wix/react-native-navigation) - [x] [MobX](https://github.com/mobxjs/mobx) - [x] Friendly exception handling (no crash :dizzy_face:) - [x] Ce

Downloads

69

Readme

React Native Embryo

  • [x] Bugfree Xcode & Android setups for multiple build flavors
  • [x] React Native Navigation
  • [x] MobX
  • [x] Friendly exception handling (no crash :dizzy_face:)
  • [x] Centralized versioning - one script to bump’em all
  • [x] Flow-typed & eslint for quality code

Get

git clone [email protected]:aino/react-native-embryo.git <APP_NAME>
cd <APP_NAME>
yarn start

At first glance

The footprint is small by design! Minimal dependencies and zero UI modules.

  • src/config.js config file in JSON that also imports the env variable.
  • src/index.js starting point for ios & android. It contains a basic wrapper around react-native-navigation
  • src/screens/index.js is where you define each screen for routing
  • src/screens/* is where all your screens are
  • src/stores/* contains MobX stores. The only one provided by default is the exception class for error handling
  • src/components/ErrorBoundary catches and displays custom errors (modify as you wish)

Building

There are ~~6~~ 5 commands for building from command line:

yarn run ios              # run ios app for development
yarn run ios:release      # run ios app for release (PROD)
yarn run android          # run android app for development
yarn run android:staging  # compile apk for staging
yarn run android:release  # compile apk for release

Note: Ios Staging must currently be built from within Xcode. Just select Staging scheme and press play. You can also build other archives from Xcode or Android Studio.

Each build flavor will have it’s own bundle ID so you can have all 3 builds on the same device.

The display names of Staging and Debug will have (S) and (D) in it’s name (you can also add custom app icons for each flavor).

Environments & configuration

The PROD and DEV environment variables are imported into the config.js file, you can use that to write environment-specific code, f.ex if (config.DEV) { // do DEV specific things }

Versioning

Versions should follow the semver pattern major.minor.patch+build (f.ex 1.8.2+62) for best compability.

Use yarn run v to automatically bump or apply new versions on all platforms and package.json.

Linting & static types

Use yarn run flow to type-check using flow. To code flow, add // @flow at the top of the source code. Flow is also used as a pre-commit script.

Exceptions & logging

Use 3 levels of exceptions from the stores/exception store:

import exception from 'stores/exception'

/*
 * USAGE:
 * error is an error object, context is an optional string that will be logged & reported
 *
 * exception.raise(error, context?)
 * exception.warn(error, context?)
 * exception.info(error, context?)
 *
 */

// fatal error:
exception.raise(new Error('Epic Fail'))

// promise error with warning:
fetch(url).then(success).catch(exception.warn)

// silent error:
exception.info(new Error('User entered 4 digits'), 'login form')

You can customize how these errors will be shown for the user in PROD by editing components/ErrorBoundary. We added some simple Modals as a default.

In DEV, we use the built-in standard red screen for errors, a slightly customized warnings list and nice logs in the console.

Bonus: use exception.todo(task) when developing to save time!

The Aino rules

  • Never use undefined or NaN as a type, payload or parameter
  • Use constants.js for string definitions
  • Be smart

Coding styles

Follow https://github.com/airbnb/javascript/tree/master/react standards (except we use .js instead of .jsx suffix)