You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`react-native-multinstance` is a library for running multiple, isolated React Native instances within a single application. This allows you to embed third-party or feature-specific "micro-apps" in a sandboxed environment, preventing uncontrolled interference with the main app by providing a clear API for communication (`postMessage`/`onMessage`).
20
+
`react-native-sandbox` is a library for running multiple, isolated React Native instances within a single application. This allows you to embed third-party or feature-specific "micro-apps" in a sandboxed environment, preventing uncontrolled interference with the main app by providing a clear API for communication (`postMessage`/`onMessage`).
21
21
22
22
## 💡 Project Overview
23
23
@@ -29,11 +29,11 @@ This project was born from the need to safely run third-party code within a reac
29
29
30
30
> Note that `postMessage` only supports serializable data (similar to [`Window.postMessage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#message) in web browsers), meaning no functions, native state, or non-serializable objects can be passed.
31
31
32
-
`react-native-multinstance` provides the API to create these sandboxed React Native instances with a simple component-based API, requiring no native code to be written by the consumer.
32
+
`react-native-sandbox` provides the API to create these sandboxed React Native instances with a simple component-based API, requiring no native code to be written by the consumer.
33
33
34
34
This project is structured as a monorepo.
35
35
36
-
-[`packages/react-native-multinstance`](./packages/react-native-multinstance/): the core library.
36
+
-[`packages/react-native-sandbox`](./packages/react-native-sandbox/): the core library.
37
37
-[`apps/side-by-side`](./apps/side-by-side/README.md): An example application with two sandbox instances.
38
38
-[`apps/recursive`](./apps/recursive/README.md): An example application with few nested sandbox instances.
39
39
@@ -65,7 +65,7 @@ Here is a brief overview of how to use the library.
65
65
```tsx
66
66
import React, { useRef } from 'react';
67
67
import { View, Button } from 'react-native';
68
-
import SandboxReactNativeView, { SandboxReactNativeViewRef } from 'react-native-multinstance';
68
+
import SandboxReactNativeView, { SandboxReactNativeViewRef } from 'react-native-sandbox';
We're actively working on expanding the capabilities of `react-native-multinstance`. Here's what's planned:
134
+
We're actively working on expanding the capabilities of `react-native-sandbox`. Here's what's planned:
135
135
136
136
- [ ] **Android Support** - Full cross-platform compatibility
137
137
- [ ] **Inter-Sandbox Communication** - Secure communication between sandbox instances
@@ -149,7 +149,7 @@ We're actively working on expanding the capabilities of `react-native-multinstan
149
149
- Secure file system access controls
150
150
- [ ] **Developer Tools** - Enhanced debugging and development experience
151
151
152
-
Contributions and feedback on these roadmap items are welcome! Please check our [issues](https://github.com/your-org/react-native-multinstance/issues) for detailed discussions on each feature.
152
+
Contributions and feedback on these roadmap items are welcome! Please check our [issues](https://github.com/callstackincubator/react-native-sandbox/issues) for detailed discussions on each feature.
153
153
154
154
## 🔒 Security Considerations
155
155
@@ -161,7 +161,7 @@ A primary security concern when running multiple React Native instances is the p
161
161
- **Data Leakage:** One sandbox could use a shared TurboModule to store data, which could then be read by another sandbox or the host. This breaks the isolation model.
162
162
- **Unintended Side-Effects:** A sandbox could call a method on a shared module that changes its state, affecting the behavior of the host or other sandboxes in unpredictable ways.
163
163
164
-
To address this, `react-native-multinstance` allows you to provide a **whitelist of allowed TurboModules** for each sandbox instance via the `allowedTurboModules` prop. Only the modules specified in this list will be accessible from within the sandbox, significantly reducing the attack surface. It is critical to only whitelist modules that are stateless or are explicitly designed to be shared safely.
164
+
To address this, `react-native-sandbox` allows you to provide a **whitelist of allowed TurboModules** for each sandbox instance via the `allowedTurboModules` prop. Only the modules specified in this list will be accessible from within the sandbox, significantly reducing the attack surface. It is critical to only whitelist modules that are stateless or are explicitly designed to be shared safely.
165
165
166
166
**Default Whitelist:** By default, only `NativeMicrotasksCxx` is whitelisted. Modules like `NativePerformanceCxx`, `PlatformConstants`, `DevSettings`, `LogBox`, and other third-party modules are *not* whitelisted.
This example demonstrates the capability of `react-native-multinstance` to create and manage nested React Native instances. The application recursively renders `SandboxReactNativeView` components, each encapsulating another instance of the same application, up to a predefined maximum depth.
5
+
This example demonstrates the capability of `react-native-sandbox` to create and manage nested React Native instances. The application recursively renders `SandboxReactNativeView` components, each encapsulating another instance of the same application, up to a predefined maximum depth.
0 commit comments