From 49b2c5f84ae52176a9ade7d36b098da15d9ef95a Mon Sep 17 00:00:00 2001 From: artus9033 Date: Mon, 19 Jan 2026 15:06:59 +0100 Subject: [PATCH 1/4] docs: update docs for newest support of local file system bundles introduced in #200 --- docs/docs/docs/api-reference/java.mdx | 2 +- docs/docs/docs/api-reference/kotlin.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/docs/api-reference/java.mdx b/docs/docs/docs/api-reference/java.mdx index 6ae9bd15..5ed373e1 100644 --- a/docs/docs/docs/api-reference/java.mdx +++ b/docs/docs/docs/api-reference/java.mdx @@ -69,7 +69,7 @@ A function used to initialize a React Native Brownfield singleton. Keep in mind - `useDeveloperSupport`: `Boolean` - Flag to use dev support. - `packages`: `List` - List of your React Native Native modules. - `mainModuleName`: `String` - Path to react native entry file (when loading from Metro). -- `bundleAssetPath`: `String` - Path to react native bundle asset file (when loading from app assets), appended to `asset://`. +- `bundleAssetPath`: `String` - Path to react native bundle asset file (when loading from app assets), appended to `asset://`; if this path starts with `file://`, the JS bundle will be loaded from a local file, not from app's assets. **Examples:** diff --git a/docs/docs/docs/api-reference/kotlin.mdx b/docs/docs/docs/api-reference/kotlin.mdx index 931d72bb..8eb9c4d4 100644 --- a/docs/docs/docs/api-reference/kotlin.mdx +++ b/docs/docs/docs/api-reference/kotlin.mdx @@ -52,7 +52,7 @@ A function used to initialize a React Native Brownfield singleton. Keep in mind - `useDeveloperSupport`: `Boolean` - Flag to use dev support. - `packages`: `List` - List of your React Native Native modules. - `mainModuleName`: `String` - Path to react native entry file (when loading from Metro). -- `bundleAssetPath`: `String` - Path to react native bundle asset file (when loading from app assets), appended to `asset://`. +- `bundleAssetPath`: `String` - Path to react native bundle asset file (when loading from app assets), appended to `asset://`; if this path starts with `file://`, the JS bundle will be loaded from a local file, not from app's assets. **Examples:** From cc91366d69ea59c4558d7cdcd52ecc901ef341d9 Mon Sep 17 00:00:00 2001 From: artus9033 Date: Mon, 19 Jan 2026 15:07:25 +0100 Subject: [PATCH 2/4] chore: added changeset --- .changeset/cool-parts-guess.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/cool-parts-guess.md diff --git a/.changeset/cool-parts-guess.md b/.changeset/cool-parts-guess.md new file mode 100644 index 00000000..dd03cd3f --- /dev/null +++ b/.changeset/cool-parts-guess.md @@ -0,0 +1,5 @@ +--- +'@callstack/react-native-brownfield': patch +--- + +feat(android): allow bundle file path From c07598cf8db67124b30ef4affd7f9ab6542b3bed Mon Sep 17 00:00:00 2001 From: artus9033 Date: Mon, 19 Jan 2026 15:25:26 +0100 Subject: [PATCH 3/4] refactor: alter the Android API for loading JS bundle from disk to support a separate option --- docs/docs/docs/api-reference/java.mdx | 3 ++- docs/docs/docs/api-reference/kotlin.mdx | 3 ++- .../reactnativebrownfield/ReactNativeBrownfield.kt | 7 ++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/docs/docs/api-reference/java.mdx b/docs/docs/docs/api-reference/java.mdx index 5ed373e1..0bc8720f 100644 --- a/docs/docs/docs/api-reference/java.mdx +++ b/docs/docs/docs/api-reference/java.mdx @@ -69,7 +69,8 @@ A function used to initialize a React Native Brownfield singleton. Keep in mind - `useDeveloperSupport`: `Boolean` - Flag to use dev support. - `packages`: `List` - List of your React Native Native modules. - `mainModuleName`: `String` - Path to react native entry file (when loading from Metro). -- `bundleAssetPath`: `String` - Path to react native bundle asset file (when loading from app assets), appended to `asset://`; if this path starts with `file://`, the JS bundle will be loaded from a local file, not from app's assets. +- `bundleAssetPath`: `String` - Path to react native bundle asset file (when loading from app assets), appended to `asset://` +- `bundleFilePath`: `String` - Optional, should start with `file://`, in which case the JS bundle will be loaded from a local file; alternatively, can start with `asset://`, in which case it is equivalent to `bundleAssetPath` passed the value without the `asset://` prefix. This value has precedence over `bundleAssetPath`, if passed. **Examples:** diff --git a/docs/docs/docs/api-reference/kotlin.mdx b/docs/docs/docs/api-reference/kotlin.mdx index 8eb9c4d4..86cec8aa 100644 --- a/docs/docs/docs/api-reference/kotlin.mdx +++ b/docs/docs/docs/api-reference/kotlin.mdx @@ -52,7 +52,8 @@ A function used to initialize a React Native Brownfield singleton. Keep in mind - `useDeveloperSupport`: `Boolean` - Flag to use dev support. - `packages`: `List` - List of your React Native Native modules. - `mainModuleName`: `String` - Path to react native entry file (when loading from Metro). -- `bundleAssetPath`: `String` - Path to react native bundle asset file (when loading from app assets), appended to `asset://`; if this path starts with `file://`, the JS bundle will be loaded from a local file, not from app's assets. +- `bundleAssetPath`: `String` - Path to react native bundle asset file (when loading from app assets), appended to `asset://` +- `bundleFilePath`: `String` - Optional, should start with `file://`, in which case the JS bundle will be loaded from a local file; alternatively, can start with `asset://`, in which case it is equivalent to `bundleAssetPath` passed the value without the `asset://` prefix. This value has precedence over `bundleAssetPath`, if passed. **Examples:** diff --git a/packages/react-native-brownfield/android/src/main/java/com/callstack/reactnativebrownfield/ReactNativeBrownfield.kt b/packages/react-native-brownfield/android/src/main/java/com/callstack/reactnativebrownfield/ReactNativeBrownfield.kt index 2045209a..8bc44c4a 100644 --- a/packages/react-native-brownfield/android/src/main/java/com/callstack/reactnativebrownfield/ReactNativeBrownfield.kt +++ b/packages/react-native-brownfield/android/src/main/java/com/callstack/reactnativebrownfield/ReactNativeBrownfield.kt @@ -72,16 +72,13 @@ class ReactNativeBrownfield private constructor(val reactHost: ReactHost) { onJSBundleLoaded: OnJSBundleLoaded? = null ) { val reactHost: ReactHost by lazy { - val bundlePath = options["bundleAssetPath"] as? String ?: "index.android.bundle" - val isFilePath = bundlePath.startsWith("/") || bundlePath.startsWith("file://") || bundlePath.startsWith("assets://") - getDefaultReactHost( context = application, packageList = (options["packages"] as? List<*> ?: emptyList()) .filterIsInstance(), jsMainModulePath = options["mainModuleName"] as? String ?: "index", - jsBundleAssetPath = bundlePath, - jsBundleFilePath = if (isFilePath) bundlePath else null, + jsBundleAssetPath = options["bundleAssetPath"] as? String ?: "index.android.bundle", + jsBundleFilePath = options["bundleFilePath"] as? String, useDevSupport = options["useDeveloperSupport"] as? Boolean ?: ReactBuildConfig.DEBUG, jsRuntimeFactory = null From cdffde151bb33e7e79dca9bd2be41a3b74d7f4e4 Mon Sep 17 00:00:00 2001 From: artus9033 Date: Mon, 19 Jan 2026 16:16:43 +0100 Subject: [PATCH 4/4] chore: update changeset to bump up the minor component --- .changeset/cool-parts-guess.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/cool-parts-guess.md b/.changeset/cool-parts-guess.md index dd03cd3f..f54e298b 100644 --- a/.changeset/cool-parts-guess.md +++ b/.changeset/cool-parts-guess.md @@ -1,5 +1,5 @@ --- -'@callstack/react-native-brownfield': patch +'@callstack/react-native-brownfield': minor --- feat(android): allow bundle file path