@yamnai/bundle-loader
v1.54.0
Published
Swap JavaScript bundles at runtime
Readme
bundle-loader
Swap JavaScript bundles at runtime
Installation in managed Expo projects
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
Installation in bare React Native projects
For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.
Add the package to your npm dependencies
npm install @yamnai/bundle-loaderConfigure for Android
android.useAndroidX=true
newArchEnabled=true
hermesEnabled=true
fabricEnabled=trueMust be set in your project's gradle.properties before installing.
Configure for iOS
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => true,
:fabric_enabled => true
)
use_expo_modules!Must be set in your Podfile before installing the npm package.
Then run npx pod-install after installing.
Configure for Expo
{
"expo": {
"newArchEnabled": true,
"jsEngine": "hermes",
"fabricEnabled": true
}
}Must be set in your app.json.
The loadBundle() API requires an initialProps record to pass a callback for closeBundle().
You can add other props for your bundle's root component (i.e. moduleName) as well.
// initialProps:
{ onClose: () => closeBundle() }
// Root.tsx
export default function RootComponent({ onClose }) {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Button title="Exit Bundle" onPress={onClose} />
</View>
);
}Contributing
Contributions are very welcome! Please refer to guidelines described in the contributing guide.
