
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
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 a complete solution, only providing the bare necessities for switching bundles and reloading the app. This requires you to implement the logic to download and keep track of the bundles yourself, but does give you complete freedom in how you implement your updater or A/B testing logic.
$ 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 {
setActiveBundle,
registerBundle,
unregisterBundle,
reloadBundle
} 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.
*/
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.
*/
setActiveBundle('a_b_test');
/* Unregister a bundle once you're done with it. Note that you will have to
* remove the file yourself.
*/
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.
*/
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 420 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.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.