
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
Instantly deliver JS and asset updates to your React Native apps. Know more about OTA Updates.
Integrate DOTA into your React Native app seamlessly:
Run the following command from your app's root directory:
# Yarn
yarn add @d11/dota
# NPM
npm install @d11/dota
Wrap your root component with codePush to enable OTA updates:
import codePush from "@d11/dota";
function MyApp() {
// Your app code here
}
export default codePush(MyApp);
Additionally, complete the platform-specific setup to ensure full integration:
By default, DOTA checks for updates every time the app starts. Updates download silently and apply on the next restart, ensuring a smooth experience. Mandatory updates install immediately to deliver critical updates promptly.
Check Frequency: Configure when to check for updates (e.g., on app start, button press).
User Notification: Decide how users will be notified about updates.
For more advanced configurations, consult the DOTA API reference.
This method effortlessly integrates DOTA and Hermes by automatically using the bundle generated during your app's build process.
Add to android/app/build.gradle. This ensures the bundle is copied to the .dota/android directory for processing.
apply from: "../../node_modules/@d11/dota/android/codepush.gradle"
To disable the default copying of the bundle, add the following in gradle.properties:
dotaCopyBundle=false
In your Podfile, add:
# Import at the top
require_relative '../node_modules/@d11/dota/ios/scripts/dota_pod_helpers.rb'
# Include in the `post_install` block:
post_install do |installer|
dota_post_install(installer, 'YourAppTarget', File.expand_path(__dir__))
end
To disable the bundle copy process, set the environment variable in the .xcode.env file or directly in the CLI:
export DOTA_COPY_BUNDLE=false
Run:
cd ios && pod install
This ensures the bundle is copied to the .dota/ios directory for processing.
Use this method if you need more control over the bundle generation process or need to generate bundles outside of the build process.
# For Android
yarn dota bundle --platform android
# For iOS
yarn dota bundle --platform ios
Customize with available options:
Options:
--platform <platform> Specify platform: android or ios (required)
--bundle-path <path> Directory to place the bundle in, default is .dota/<platform> (default: ".dota")
--assets-path <path> Directory to place assets in, default is .dota/<platform> (default: ".dota")
--sourcemap-path <path> Directory to place sourcemaps in, default is .dota/<platform> (default: ".dota")
--make-sourcemap Generate sourcemap (default: false)
--entry-file <file> Entry file (default: "index.ts")
--dev <boolean> Development mode (default: "false")
--base-bundle-path <path> Path to base bundle for Hermes bytecode optimization
-h, --help Display help for command
# Example with options
yarn dota bundle --platform android --bundle-path ./custom-path --make-sourcemap
You can export the JavaScript and assets for your expo app using Metro bundler by running:
npx expo export
For more information refer to the Expo documentation: https://docs.expo.dev/more/expo-cli/#exporting
Note: When generating a patch bundle using this script, ensure that the base bundle shipped with the APK is identical to the one generated here. Any discrepancy in flags, especially if additional flags are passed to React Native during bundle generation, may lead to patch application issues. If uncertain, follow the Automated Bundle Generation step to maintain consistency.
Base bytecode optimization is available starting from version 1.2.0.
Significantly reduce patch bundle size using base bytecode optimization. There are two ways to set this up, depending on your bundle generation method. For more details, see Understanding Base Bytecode Optimization below.
Ensure your automated bundle generation is configured, and set up your environment as follows:
Android: Use any of the following methods to specify the base bundle path:
./gradlew assembleRelease -PdotaBaseBundlePath=/path/to/base/bundle
export DOTA_BASE_BUNDLE_PATH=/path/to/base/bundle
./gradlew assembleRelease
gradle.properties file:
dotaBaseBundlePath=/path/to/base/bundle
iOS: To enable base bytecode optimization, you'll need to modify node_modules/react-native/scripts/react-native-xcode.sh. Since React Native doesn’t directly expose this feature, creating a patch is essential for implementing custom changes.
Patch Package Setup (Skip if already installed):
yarn add patch-package postinstall-postinstall --dev
{
"scripts": {
"postinstall": "patch-package"
}
}
Modify and Create Patch: Locate node_modules/react-native/scripts/react-native-xcode.sh and add support for base bytecode. Insert the following code before the Hermes CLI execution block:
# Inside react-native-xcode.sh
BASE_BYTECODE_PATH=""
if [[ ! -z $DOTA_BASE_BUNDLE_PATH ]]; then
if [[ -f $DOTA_BASE_BUNDLE_PATH ]]; then
BASE_BYTECODE_PATH="--base-bytecode $DOTA_BASE_BUNDLE_PATH"
echo "Using --base-bytecode with path: $DOTA_BASE_BUNDLE_PATH"
else
echo "Not using --base-bytecode, path: $DOTA_BASE_BUNDLE_PATH, file not found"
BASE_BYTECODE_PATH=""
fi
fi
"$HERMES_CLI_PATH" -emit-binary -max-diagnostic-width=80 $EXTRA_COMPILER_ARGS -out "$DEST/$BUNDLE_NAME.jsbundle" "$BUNDLE_FILE" $BASE_BYTECODE_PATH
Create the patch using:
yarn patch-package react-native
Environment Configuration: Configure the base bundle path through an environment variable:
In .xcode.env:
export DOTA_BASE_BUNDLE_PATH=/path/to/base.bundle
Or directly within a terminal session:
export DOTA_BASE_BUNDLE_PATH=/path/to/base.bundle && yarn ios --mode=Release
When using manual bundle generation, configure the CLI with the --base-bundle-path option:
yarn dota bundle --platform android --base-bundle-path .dota/android/index.android.bundle
Note: To opt-out of using the base bytecode optimization feature, ensure the DOTA_BASE_BUNDLE_PATH environment variable is not set. You can unset it by executing unset DOTA_BASE_BUNDLE_PATH. Alternatively, during manual bundle generation, simply omit the --base-bundle-path option.
Base bytecode optimization enables smaller patch bundles by utilizing the bytecode structure of a previously created base bundle. When you generate updates, this previous bundle acts as a reference, ensuring only changes are transmitted. This method enhances performance, reducing data usage and ensuring faster updates.
Once your app is configured and distributed to your users, and you have made some JS or asset changes, it's time to release them.
Before you start, generate your JS bundle and assets. See Creating the JavaScript bundle.
There are two ways to release OTA updates:
If you run into any issues, check out the troubleshooting details below.
NOTE: DOTA updates should be tested in modes other than Debug mode. In Debug mode, React Native app always downloads JS bundle generated by packager, so JS bundle downloaded by DOTA does not apply.
The sync method includes a lot of diagnostic logging out-of-the-box, so if you're encountering an issue when
using it, the best thing to try first is examining the output logs of your app. This will tell you whether the
app is configured correctly (like can the plugin find your deployment key?), if the app is able to reach the
server, if an available update is being discovered, if the update is being successfully downloaded/installed, etc.
Key statuses to watch:
installMode.See Sync API and SyncOptions for details.
We welcome contributions to improve FastImage! Please check out our contributing guide for guidelines on how to proceed.
This is a fork of react-native-code-push. All credit goes to the original author.
FAQs
React Native plugin for the CodePush service
The npm package @d11/dota receives a total of 238 weekly downloads. As such, @d11/dota popularity was classified as not popular.
We found that @d11/dota demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.