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

@xtreamsrl/react-native-incremental-cli

v0.1.2

Published

React Native CLI that caches native builds and speedup your development and release cycle

Downloads

8

Readme

React Native Incremental CLI

The native build of a React Native project is the slowest part of the build process. It's an expensive operation, especially compared with the JS bundle, and it's not uncommon for it to take 5-10 minutes to complete. But most of the time the native build is not necessary. For example, if you are only changing the JavaScript code (and when you app reaches a stable point this is the most common situation), there is no need to rebuild the native code. This is where this CLI tool comes in. This project is a meant as drop in replacement fo the react-native CLI tool that caches the native build and only rebuilds it when necessary. This can save a lot of time during development.

The release is even more expensive than the debug build. Thi cli tool can also cache the release build and only repack it with the new JS bundle.

For now, the developers should choose if the native build should be forced or not. In the future, the cli tool may add some heuristics to decide when to force the native build.

Run android with build cached

Disclaimer

There are many configurations for native builds, and it's possible that this CLI does not support your specific configuration. If you encounter any issues, please feel free to file an issue or submit a pull request.

Credits

This project is highly inspired by the React Native architecture articles by Wix and the related repo.

Requirements

For more detailed information on setting up your development environment for Android and iOS, refer to the official React Native documentation.

Android

  • Java Development Kit
  • Android Studio
  • Android SDK
  • Environment variables
    • JAVA_HOME
    • ANDROID_HOME
    • ANDROID_SDK_ROOT

iOS

  • A macOS machine with Xcode.
  • CocoaPods.
  • Xcode command line tools

Installation

npm install --save-dev @xtream/react-native-incremental-cli

Usage

Run

The run command launches the app on the emulator. It will first check if the native build is present in the cache folder. If it is, it will use it. If it is not, it will build it and then run the app.

The target device can be selected directly from the command line.

The cli handles also metro bundler. If it is not running, it will start it.

npx rn-incremental run [-a|-i] [-f|--flavor flavor] [--force-build]

Options

  • -i/--ios: run on iOS
  • -a/--android: run on Android
  • -f/--flavor: specify the flavor/schema
  • --force-build: force a native build

Build

The build command builds the app for the specified platform. It's an explicit build, so it will override the cache folder for the specified platform and flavor/scheme, unless the --incremental option is used.

rn-incremental build [-i/--ios] [-a/--android] [-f/--flavor] [--release] [-I/--incremental] [--force-build]

Options

  • -i/--ios: build for iOS
  • -a/--android: build for Android
  • -f/--flavor: specify the flavor/schema
  • --release: build a release version
  • -I/--incremental: build an incremental version

Supported features and platforms

The cli supports macOS for now. Windows support is coming soon for android.

✅ - Supported, 🚧 - In progress, ❌ - Not supported

| Feature | Android | iOS | |-------------------------------------|:-------:|:---:| | Run on emulator | ✅ | ✅ | | Run on device | 🚧 | 🚧 | | Debug build | ✅ | ✅ | | Build flavor/schema | ✅ | ✅ | | Release build | ✅ | 🚧 | | Incremental build | 🚧 | 🚧 | | Resign of incremental build | 🚧 | 🚧 | | Re-versioning of incremental builds | 🚧 | 🚧 |

How it works

Cache folder

The CLI creates a .rn-incremental folder in the root of the project that is used as cache for the native builds. This is what makes the builds so fast, as it reuses the native build if it is present while running a project. You can force a rebuild with the --force-build option.

Incremental builds

Incremental builds are a way to speed up the release build. The idea is to reuse the native build of a previous release and only repack it with the new JS bundle and assets.

It just executes the following steps:

  • extract the native build from the previous release
  • rebuild JS bundle and assets
  • repack the native build with the new JS bundle and assets
  • resign the app if necessary

Who we are