
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
react-native-dynamic-bundle
Advanced tools
Control which bundle is loaded from the Javascript side of your React Native app.
react-native-dynamic-bundle is a library, similar to react-native-auto-updater and CodePush, that allows you to change the React Native bundle loaded by an application without updating the application itself (i.e. through the App Store or Google Play). You could use this functionality to, for example:
react-native-dynamic-bundle differs from react-native-auto-updater and alternatives in that it does not attempt to be an end-to-end solution for updates or A/B testing, only providing the bare necessities for switching bundles and reloading the app. This means you will have to implement things like the update UI, a bundle downloader and fallback/safety mechanisms yourself.
$ npm install react-native-dynamic-bundle --save
or
$ yarn add react-native-dynamic-bundle
$ react-native link react-native-dynamic-bundle
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-dynamic-bundle
and add RNDynamicBundle.xcodeproj
libRNDynamicBundle.a
to your project's Build Phases
➜ Link Binary With Libraries
Cmd+R
)<android/app/src/main/java/[...]/MainActivity.java
import org.mauritsd.reactnativedynamicbundle.RNDynamicBundlePackage;
to the imports at the top of the filenew RNDynamicBundlePackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-dynamic-bundle'
project(':react-native-dynamic-bundle').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dynamic-bundle/android')
android/app/build.gradle
:
compile project(':react-native-dynamic-bundle')
import RNDynamicBundle from 'react-native-dynamic-bundle';
/* Register a bundle in the documents directory of the app. This could be
* pre-packaged in your app, downloaded over http, etc. Paths are relative
* to your documents directory.
*/
RNDynamicBundle.registerBundle('a_b_test', 'bundles/a_b_test.bundle');
/* Set the active bundle to a_b_test. This means that on the next load
* this bundle will be loaded instead of the default.
*/
RNDynamicBundle.setActiveBundle('a_b_test');
/* Unregister a bundle once you're done with it. Note that you will have to
* remove the file yourself.
*/
RNDynamicBundle.unregisterBundle('a_b_test');
/* In some circumstances (e.g. the user consents to an update) we want to
* force a bundle reload instead of waiting until the next app restart.
* Note that this will have to result in the destruction of the current
* RCTBridge and its recreation with the new bundle URL. It is therefore
* recommended to sync data and let actions complete before calling this.
*/
RNDynamicBundle.reloadBundle();
FAQs
Control which bundle is loaded from the Javascript side of your React Native app.
The npm package react-native-dynamic-bundle receives a total of 770 weekly downloads. As such, react-native-dynamic-bundle popularity was classified as not popular.
We found that react-native-dynamic-bundle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.