@callstack/react-native-brownfield 2.2.0 → 3.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReactBrownfield.podspec +4 -0
- package/ios/BrownfieldBundlePathResolver.swift +21 -0
- package/ios/ExpoHostRuntime.swift +140 -0
- package/ios/JSBundleLoadObserver.swift +38 -0
- package/ios/Notification+Brownfield.swift +12 -0
- package/ios/ReactNativeBrownfield.swift +78 -112
- package/ios/ReactNativeHostRuntime.swift +138 -0
- package/lib/commonjs/expo-config-plugin/android/constants.js +2 -0
- package/lib/commonjs/expo-config-plugin/android/constants.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/android/gradleHelpers.js +2 -0
- package/lib/commonjs/expo-config-plugin/android/gradleHelpers.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/android/index.js +2 -0
- package/lib/commonjs/expo-config-plugin/android/index.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js +2 -0
- package/lib/commonjs/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js +2 -0
- package/lib/commonjs/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/app.plugin.js +2 -0
- package/lib/commonjs/expo-config-plugin/app.plugin.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/errors/SourceModificationError.js +2 -0
- package/lib/commonjs/expo-config-plugin/errors/SourceModificationError.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/index.js +2 -0
- package/lib/commonjs/expo-config-plugin/index.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/ios/index.js +2 -0
- package/lib/commonjs/expo-config-plugin/ios/index.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js +8 -0
- package/lib/commonjs/expo-config-plugin/ios/podfileHelpers.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js +2 -0
- package/lib/commonjs/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/ios/withIosFrameworkFiles.js +2 -0
- package/lib/commonjs/expo-config-plugin/ios/withIosFrameworkFiles.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/ios/xcodeHelpers.js +2 -0
- package/lib/commonjs/expo-config-plugin/ios/xcodeHelpers.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/logging.js +2 -0
- package/lib/commonjs/expo-config-plugin/logging.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/template/android/AndroidManifest.xml +4 -0
- package/lib/commonjs/expo-config-plugin/template/android/ReactNativeHostManager.kt +54 -0
- package/lib/commonjs/expo-config-plugin/template/android/build.gradle.kts +90 -0
- package/lib/commonjs/expo-config-plugin/template/android/consumer-rules.pro +0 -0
- package/lib/commonjs/expo-config-plugin/template/android/gradle.properties +8 -0
- package/lib/commonjs/expo-config-plugin/template/android/proguard-rules.pro +21 -0
- package/lib/commonjs/expo-config-plugin/template/engine.js +2 -0
- package/lib/commonjs/expo-config-plugin/template/engine.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/template/ios/FrameworkInterface.swift +13 -0
- package/lib/commonjs/expo-config-plugin/template/ios/Info.plist +22 -0
- package/lib/commonjs/expo-config-plugin/template/ios/PodfileTargetBlock.rb +5 -0
- package/lib/commonjs/expo-config-plugin/template/ios/patchExpoPre55.sh +20 -0
- package/lib/commonjs/expo-config-plugin/types/BrownfieldPluginConfig.js +2 -0
- package/lib/commonjs/expo-config-plugin/types/BrownfieldPluginConfig.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/types/RenderedTemplateFile.js +2 -0
- package/lib/commonjs/expo-config-plugin/types/RenderedTemplateFile.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.js +2 -0
- package/lib/commonjs/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/types/index.js +2 -0
- package/lib/commonjs/expo-config-plugin/types/index.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.js +2 -0
- package/lib/commonjs/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.js.map +1 -0
- package/lib/commonjs/expo-config-plugin/withBrownfield.js +2 -0
- package/lib/commonjs/expo-config-plugin/withBrownfield.js.map +1 -0
- package/lib/commonjs/scripts/brownfield.js +0 -0
- package/lib/module/expo-config-plugin/android/constants.js +2 -0
- package/lib/module/expo-config-plugin/android/constants.js.map +1 -0
- package/lib/module/expo-config-plugin/android/gradleHelpers.js +2 -0
- package/lib/module/expo-config-plugin/android/gradleHelpers.js.map +1 -0
- package/lib/module/expo-config-plugin/android/index.js +2 -0
- package/lib/module/expo-config-plugin/android/index.js.map +1 -0
- package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js +2 -0
- package/lib/module/expo-config-plugin/android/withAndroidModuleFiles.js.map +1 -0
- package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js +2 -0
- package/lib/module/expo-config-plugin/android/withBrownfieldAndroid.js.map +1 -0
- package/lib/module/expo-config-plugin/app.plugin.js +2 -0
- package/lib/module/expo-config-plugin/app.plugin.js.map +1 -0
- package/lib/module/expo-config-plugin/errors/SourceModificationError.js +2 -0
- package/lib/module/expo-config-plugin/errors/SourceModificationError.js.map +1 -0
- package/lib/module/expo-config-plugin/index.js +2 -0
- package/lib/module/expo-config-plugin/index.js.map +1 -0
- package/lib/module/expo-config-plugin/ios/index.js +2 -0
- package/lib/module/expo-config-plugin/ios/index.js.map +1 -0
- package/lib/module/expo-config-plugin/ios/podfileHelpers.js +8 -0
- package/lib/module/expo-config-plugin/ios/podfileHelpers.js.map +1 -0
- package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js +2 -0
- package/lib/module/expo-config-plugin/ios/withBrownfieldIos.js.map +1 -0
- package/lib/module/expo-config-plugin/ios/withIosFrameworkFiles.js +2 -0
- package/lib/module/expo-config-plugin/ios/withIosFrameworkFiles.js.map +1 -0
- package/lib/module/expo-config-plugin/ios/xcodeHelpers.js +2 -0
- package/lib/module/expo-config-plugin/ios/xcodeHelpers.js.map +1 -0
- package/lib/module/expo-config-plugin/logging.js +2 -0
- package/lib/module/expo-config-plugin/logging.js.map +1 -0
- package/lib/module/expo-config-plugin/template/android/AndroidManifest.xml +4 -0
- package/lib/module/expo-config-plugin/template/android/ReactNativeHostManager.kt +54 -0
- package/lib/module/expo-config-plugin/template/android/build.gradle.kts +90 -0
- package/lib/module/expo-config-plugin/template/android/consumer-rules.pro +0 -0
- package/lib/module/expo-config-plugin/template/android/gradle.properties +8 -0
- package/lib/module/expo-config-plugin/template/android/proguard-rules.pro +21 -0
- package/lib/module/expo-config-plugin/template/engine.js +2 -0
- package/lib/module/expo-config-plugin/template/engine.js.map +1 -0
- package/lib/module/expo-config-plugin/template/ios/FrameworkInterface.swift +13 -0
- package/lib/module/expo-config-plugin/template/ios/Info.plist +22 -0
- package/lib/module/expo-config-plugin/template/ios/PodfileTargetBlock.rb +5 -0
- package/lib/module/expo-config-plugin/template/ios/patchExpoPre55.sh +20 -0
- package/lib/module/expo-config-plugin/types/BrownfieldPluginConfig.js +2 -0
- package/lib/module/expo-config-plugin/types/BrownfieldPluginConfig.js.map +1 -0
- package/lib/module/expo-config-plugin/types/RenderedTemplateFile.js +2 -0
- package/lib/module/expo-config-plugin/types/RenderedTemplateFile.js.map +1 -0
- package/lib/module/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.js +2 -0
- package/lib/module/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.js.map +1 -0
- package/lib/module/expo-config-plugin/types/index.js +2 -0
- package/lib/module/expo-config-plugin/types/index.js.map +1 -0
- package/lib/module/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.js +2 -0
- package/lib/module/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.js.map +1 -0
- package/lib/module/expo-config-plugin/withBrownfield.js +2 -0
- package/lib/module/expo-config-plugin/withBrownfield.js.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/constants.d.ts +3 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/gradleHelpers.d.ts +14 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/gradleHelpers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +24 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts +13 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/app.plugin.d.ts +9 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/app.plugin.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/errors/SourceModificationError.d.ts +3 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/errors/SourceModificationError.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/index.d.ts +7 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/podfileHelpers.d.ts +8 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/withBrownfieldIos.d.ts +14 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/withIosFrameworkFiles.d.ts +19 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/withIosFrameworkFiles.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/xcodeHelpers.d.ts +33 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/xcodeHelpers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/logging.d.ts +9 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/logging.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/template/engine.d.ts +9 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/template/engine.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/BrownfieldPluginConfig.d.ts +53 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/BrownfieldPluginConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/RenderedTemplateFile.d.ts +5 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/RenderedTemplateFile.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +50 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts +36 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/withBrownfield.d.ts +5 -0
- package/lib/typescript/commonjs/src/expo-config-plugin/withBrownfield.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/android/constants.d.ts +3 -0
- package/lib/typescript/module/src/expo-config-plugin/android/constants.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/android/gradleHelpers.d.ts +14 -0
- package/lib/typescript/module/src/expo-config-plugin/android/gradleHelpers.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/android/index.d.ts +4 -0
- package/lib/typescript/module/src/expo-config-plugin/android/index.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts +24 -0
- package/lib/typescript/module/src/expo-config-plugin/android/withAndroidModuleFiles.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts +13 -0
- package/lib/typescript/module/src/expo-config-plugin/android/withBrownfieldAndroid.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/app.plugin.d.ts +9 -0
- package/lib/typescript/module/src/expo-config-plugin/app.plugin.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/errors/SourceModificationError.d.ts +3 -0
- package/lib/typescript/module/src/expo-config-plugin/errors/SourceModificationError.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/index.d.ts +7 -0
- package/lib/typescript/module/src/expo-config-plugin/index.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/index.d.ts +5 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/index.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/podfileHelpers.d.ts +8 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/podfileHelpers.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/withBrownfieldIos.d.ts +14 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/withBrownfieldIos.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/withIosFrameworkFiles.d.ts +19 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/withIosFrameworkFiles.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/xcodeHelpers.d.ts +33 -0
- package/lib/typescript/module/src/expo-config-plugin/ios/xcodeHelpers.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/logging.d.ts +9 -0
- package/lib/typescript/module/src/expo-config-plugin/logging.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/template/engine.d.ts +9 -0
- package/lib/typescript/module/src/expo-config-plugin/template/engine.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/types/BrownfieldPluginConfig.d.ts +53 -0
- package/lib/typescript/module/src/expo-config-plugin/types/BrownfieldPluginConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/types/RenderedTemplateFile.d.ts +5 -0
- package/lib/typescript/module/src/expo-config-plugin/types/RenderedTemplateFile.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts +50 -0
- package/lib/typescript/module/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/types/index.d.ts +5 -0
- package/lib/typescript/module/src/expo-config-plugin/types/index.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts +36 -0
- package/lib/typescript/module/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/expo-config-plugin/withBrownfield.d.ts +5 -0
- package/lib/typescript/module/src/expo-config-plugin/withBrownfield.d.ts.map +1 -0
- package/package.json +20 -7
- package/scripts/react_native_brownfield_post_integrate.rb +22 -0
- package/src/expo-config-plugin/android/constants.ts +2 -0
- package/src/expo-config-plugin/android/gradleHelpers.ts +72 -0
- package/src/expo-config-plugin/android/index.ts +6 -0
- package/src/expo-config-plugin/android/withAndroidModuleFiles.ts +139 -0
- package/src/expo-config-plugin/android/withBrownfieldAndroid.ts +48 -0
- package/src/expo-config-plugin/app.plugin.ts +10 -0
- package/src/expo-config-plugin/errors/SourceModificationError.ts +1 -0
- package/src/expo-config-plugin/index.ts +8 -0
- package/src/expo-config-plugin/ios/index.ts +7 -0
- package/src/expo-config-plugin/ios/podfileHelpers.ts +107 -0
- package/src/expo-config-plugin/ios/withBrownfieldIos.ts +94 -0
- package/src/expo-config-plugin/ios/withIosFrameworkFiles.ts +91 -0
- package/src/expo-config-plugin/ios/xcodeHelpers.ts +433 -0
- package/src/expo-config-plugin/logging.ts +29 -0
- package/src/expo-config-plugin/template/android/AndroidManifest.xml +4 -0
- package/src/expo-config-plugin/template/android/ReactNativeHostManager.kt +54 -0
- package/src/expo-config-plugin/template/android/build.gradle.kts +90 -0
- package/src/expo-config-plugin/template/android/consumer-rules.pro +0 -0
- package/src/expo-config-plugin/template/android/gradle.properties +8 -0
- package/src/expo-config-plugin/template/android/proguard-rules.pro +21 -0
- package/src/expo-config-plugin/template/engine.ts +26 -0
- package/src/expo-config-plugin/template/ios/FrameworkInterface.swift +13 -0
- package/src/expo-config-plugin/template/ios/Info.plist +22 -0
- package/src/expo-config-plugin/template/ios/PodfileTargetBlock.rb +5 -0
- package/src/expo-config-plugin/template/ios/patchExpoPre55.sh +20 -0
- package/src/expo-config-plugin/types/BrownfieldPluginConfig.ts +67 -0
- package/src/expo-config-plugin/types/RenderedTemplateFile.ts +4 -0
- package/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts +58 -0
- package/src/expo-config-plugin/types/index.ts +6 -0
- package/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.ts +41 -0
- package/src/expo-config-plugin/withBrownfield.ts +112 -0
- package/CHANGELOG.md +0 -41
package/ReactBrownfield.podspec
CHANGED
|
@@ -22,6 +22,10 @@ Pod::Spec.new do |spec|
|
|
|
22
22
|
|
|
23
23
|
spec.dependency 'ReactAppDependencyProvider'
|
|
24
24
|
add_dependency(spec, "React-RCTAppDelegate")
|
|
25
|
+
|
|
26
|
+
if ENV['REACT_NATIVE_BROWNFIELD_USE_EXPO_HOST'] == '1'
|
|
27
|
+
spec.dependency 'Expo'
|
|
28
|
+
end
|
|
25
29
|
|
|
26
30
|
install_modules_dependencies(spec)
|
|
27
31
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
enum BrownfieldBundlePathResolver {
|
|
4
|
+
enum Error: Swift.Error {
|
|
5
|
+
case invalidBundlePath(String)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static func resourceComponents(from bundlePath: String) throws -> (
|
|
9
|
+
resourceName: String,
|
|
10
|
+
fileExtension: String
|
|
11
|
+
) {
|
|
12
|
+
let fileExtension = (bundlePath as NSString).pathExtension
|
|
13
|
+
let resourceName = (bundlePath as NSString).deletingPathExtension
|
|
14
|
+
|
|
15
|
+
guard !fileExtension.isEmpty, !resourceName.isEmpty else {
|
|
16
|
+
throw Error.invalidBundlePath(bundlePath)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (resourceName, fileExtension)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import UIKit
|
|
2
|
+
internal import React
|
|
3
|
+
internal import React_RCTAppDelegate
|
|
4
|
+
internal import ReactAppDependencyProvider
|
|
5
|
+
|
|
6
|
+
#if canImport(Expo)
|
|
7
|
+
internal import Expo
|
|
8
|
+
|
|
9
|
+
final class ExpoHostRuntime {
|
|
10
|
+
static let shared = ExpoHostRuntime()
|
|
11
|
+
|
|
12
|
+
private let jsBundleLoadObserver = JSBundleLoadObserver()
|
|
13
|
+
private var delegate = ExpoHostRuntimeDelegate()
|
|
14
|
+
private var reactNativeFactory: RCTReactNativeFactory?
|
|
15
|
+
private var expoDelegate: ExpoAppDelegate?
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Starts React Native with default parameters.
|
|
19
|
+
*/
|
|
20
|
+
public func startReactNative() {
|
|
21
|
+
startReactNative(onBundleLoaded: nil)
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Starts React Native with optional callback when bundle is loaded.
|
|
25
|
+
*
|
|
26
|
+
* @param onBundleLoaded Optional callback invoked after JS bundle is fully loaded.
|
|
27
|
+
*/
|
|
28
|
+
public func startReactNative(onBundleLoaded: (() -> Void)?) {
|
|
29
|
+
guard reactNativeFactory == nil else { return }
|
|
30
|
+
|
|
31
|
+
let factory = ExpoReactNativeFactory(delegate: delegate)
|
|
32
|
+
delegate.dependencyProvider = RCTAppDependencyProvider()
|
|
33
|
+
|
|
34
|
+
reactNativeFactory = factory
|
|
35
|
+
|
|
36
|
+
let appDelegate = ExpoAppDelegate()
|
|
37
|
+
appDelegate.bindReactNativeFactory(factory)
|
|
38
|
+
expoDelegate = appDelegate
|
|
39
|
+
|
|
40
|
+
if let onBundleLoaded {
|
|
41
|
+
jsBundleLoadObserver.observeOnce(onBundleLoaded: onBundleLoaded)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Path to JavaScript root.
|
|
47
|
+
* Default value: ".expo/.virtual-metro-entry"
|
|
48
|
+
*/
|
|
49
|
+
public var entryFile: String = ".expo/.virtual-metro-entry" {
|
|
50
|
+
didSet {
|
|
51
|
+
delegate.entryFile = entryFile
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Path to JavaScript bundle file.
|
|
57
|
+
* Default value: "main.jsbundle"
|
|
58
|
+
*/
|
|
59
|
+
public var bundlePath: String = "main.jsbundle" {
|
|
60
|
+
didSet {
|
|
61
|
+
delegate.bundlePath = bundlePath
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Bundle instance to lookup the JavaScript bundle.
|
|
66
|
+
* Default value: Bundle.main
|
|
67
|
+
*/
|
|
68
|
+
public var bundle: Bundle = Bundle.main {
|
|
69
|
+
didSet {
|
|
70
|
+
delegate.bundle = bundle
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Dynamic bundle URL provider called on every bundle load.
|
|
75
|
+
* When set, this overrides the default bundleURL() behavior in the delegate.
|
|
76
|
+
* Returns a URL to load a custom bundle, or nil to use default behavior.
|
|
77
|
+
* Default value: nil
|
|
78
|
+
*/
|
|
79
|
+
public var bundleURLOverride: (() -> URL?)? = nil {
|
|
80
|
+
didSet {
|
|
81
|
+
delegate.bundleURLOverride = bundleURLOverride
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
func application(
|
|
86
|
+
_ application: UIApplication,
|
|
87
|
+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
88
|
+
) -> Bool {
|
|
89
|
+
return expoDelegate?.application(
|
|
90
|
+
application,
|
|
91
|
+
didFinishLaunchingWithOptions: launchOptions
|
|
92
|
+
) != nil
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
func view(
|
|
96
|
+
moduleName: String,
|
|
97
|
+
initialProps: [AnyHashable: Any]?,
|
|
98
|
+
launchOptions: [AnyHashable: Any]?
|
|
99
|
+
) -> UIView? {
|
|
100
|
+
let bundleURL = delegate.bundleURL()
|
|
101
|
+
|
|
102
|
+
return expoDelegate?.recreateRootView(
|
|
103
|
+
withBundleURL: bundleURL,
|
|
104
|
+
moduleName: moduleName,
|
|
105
|
+
initialProps: initialProps,
|
|
106
|
+
launchOptions: launchOptions
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
class ExpoHostRuntimeDelegate: ExpoReactNativeFactoryDelegate {
|
|
112
|
+
var entryFile = ".expo/.virtual-metro-entry"
|
|
113
|
+
var bundlePath = "main.jsbundle"
|
|
114
|
+
var bundle = Bundle.main
|
|
115
|
+
var bundleURLOverride: (() -> URL?)? = nil
|
|
116
|
+
|
|
117
|
+
override func sourceURL(for bridge: RCTBridge) -> URL? {
|
|
118
|
+
// needed to return the correct URL for expo-dev-client.
|
|
119
|
+
bridge.bundleURL ?? bundleURL()
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
override func bundleURL() -> URL? {
|
|
123
|
+
if let bundleURLProvider = bundleURLOverride { return bundleURLProvider() }
|
|
124
|
+
#if DEBUG
|
|
125
|
+
return RCTBundleURLProvider.sharedSettings().jsBundleURL(
|
|
126
|
+
forBundleRoot: entryFile)
|
|
127
|
+
#else
|
|
128
|
+
do {
|
|
129
|
+
let (resourceName, fileExtension) = try BrownfieldBundlePathResolver.resourceComponents(
|
|
130
|
+
from: bundlePath
|
|
131
|
+
)
|
|
132
|
+
return bundle.url(forResource: resourceName, withExtension: fileExtension)
|
|
133
|
+
} catch {
|
|
134
|
+
assertionFailure("Invalid bundlePath '\(bundlePath)': \(error)")
|
|
135
|
+
return nil
|
|
136
|
+
}
|
|
137
|
+
#endif
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
#endif
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
internal import React
|
|
3
|
+
|
|
4
|
+
final class JSBundleLoadObserver {
|
|
5
|
+
private var onBundleLoaded: (() -> Void)?
|
|
6
|
+
private var observerToken: NSObjectProtocol?
|
|
7
|
+
|
|
8
|
+
func observeOnce(onBundleLoaded: @escaping () -> Void) {
|
|
9
|
+
removeObserverIfNeeded()
|
|
10
|
+
self.onBundleLoaded = onBundleLoaded
|
|
11
|
+
|
|
12
|
+
observerToken = NotificationCenter.default.addObserver(
|
|
13
|
+
forName: NSNotification.Name("RCTInstanceDidLoadBundle"),
|
|
14
|
+
object: nil,
|
|
15
|
+
queue: nil
|
|
16
|
+
) { [weak self] _ in
|
|
17
|
+
self?.notifyAndClear()
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
deinit {
|
|
22
|
+
removeObserverIfNeeded()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private func notifyAndClear() {
|
|
26
|
+
let callback = onBundleLoaded
|
|
27
|
+
onBundleLoaded = nil
|
|
28
|
+
removeObserverIfNeeded()
|
|
29
|
+
callback?()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private func removeObserverIfNeeded() {
|
|
33
|
+
if let observerToken {
|
|
34
|
+
NotificationCenter.default.removeObserver(observerToken)
|
|
35
|
+
self.observerToken = nil
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
extension Notification.Name {
|
|
4
|
+
/**
|
|
5
|
+
* Notification sent when React Native wants to navigate back to native screen.
|
|
6
|
+
*/
|
|
7
|
+
public static let popToNative = Notification.Name("PopToNativeNotification")
|
|
8
|
+
/**
|
|
9
|
+
* Notification sent to enable/disable the pop gesture recognizer.
|
|
10
|
+
*/
|
|
11
|
+
public static let togglePopGestureRecognizer = Notification.Name("TogglePopGestureRecognizerNotification")
|
|
12
|
+
}
|
|
@@ -1,74 +1,60 @@
|
|
|
1
1
|
import UIKit
|
|
2
|
-
internal import React
|
|
3
|
-
internal import React_RCTAppDelegate
|
|
4
|
-
internal import ReactAppDependencyProvider
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var bundlePath = "main.jsbundle"
|
|
9
|
-
var bundle = Bundle.main
|
|
10
|
-
var bundleURLOverride: (() -> URL?)? = nil
|
|
11
|
-
// MARK: - RCTReactNativeFactoryDelegate Methods
|
|
12
|
-
|
|
13
|
-
override func sourceURL(for bridge: RCTBridge) -> URL? {
|
|
14
|
-
return bundleURL()
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
public override func bundleURL() -> URL? {
|
|
18
|
-
if let bundleURLProvider = bundleURLOverride {
|
|
19
|
-
return bundleURLProvider()
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
#if DEBUG
|
|
23
|
-
return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: entryFile)
|
|
24
|
-
#else
|
|
25
|
-
let resourceURLComponents = bundlePath.components(separatedBy: ".")
|
|
26
|
-
let withoutLast = resourceURLComponents[..<(resourceURLComponents.count - 1)]
|
|
27
|
-
let resourceName = withoutLast.joined()
|
|
28
|
-
let fileExtension = resourceURLComponents.last ?? ""
|
|
29
|
-
|
|
30
|
-
return bundle.url(forResource: resourceName, withExtension: fileExtension)
|
|
3
|
+
#if canImport(Expo)
|
|
4
|
+
internal import Expo
|
|
31
5
|
#endif
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
6
|
|
|
35
7
|
@objc public class ReactNativeBrownfield: NSObject {
|
|
36
8
|
public static let shared = ReactNativeBrownfield()
|
|
37
|
-
|
|
38
|
-
private var delegate = ReactNativeBrownfieldDelegate()
|
|
39
|
-
|
|
9
|
+
|
|
40
10
|
/**
|
|
41
11
|
* Path to JavaScript root.
|
|
42
|
-
* Default value: "index"
|
|
12
|
+
* Default value: "index" for bare React Native, ".expo/.virtual-metro-entry" when built with Expo.
|
|
43
13
|
*/
|
|
44
|
-
@objc public var entryFile: String =
|
|
14
|
+
@objc public var entryFile: String = {
|
|
15
|
+
#if canImport(Expo)
|
|
16
|
+
return ".expo/.virtual-metro-entry"
|
|
17
|
+
#else
|
|
18
|
+
return "index"
|
|
19
|
+
#endif
|
|
20
|
+
}() {
|
|
45
21
|
didSet {
|
|
46
|
-
|
|
22
|
+
#if canImport(Expo)
|
|
23
|
+
ExpoHostRuntime.shared.entryFile = entryFile
|
|
24
|
+
#else
|
|
25
|
+
ReactNativeHostRuntime.shared.entryFile = entryFile
|
|
26
|
+
#endif
|
|
47
27
|
}
|
|
48
28
|
}
|
|
49
|
-
|
|
50
|
-
* Path to bundle fallback resource.
|
|
51
|
-
* Default value: nil
|
|
52
|
-
*/
|
|
53
|
-
@objc public var fallbackResource: String? = nil
|
|
29
|
+
|
|
54
30
|
/**
|
|
55
31
|
* Path to JavaScript bundle file.
|
|
56
32
|
* Default value: "main.jsbundle"
|
|
57
33
|
*/
|
|
58
34
|
@objc public var bundlePath: String = "main.jsbundle" {
|
|
59
35
|
didSet {
|
|
60
|
-
|
|
36
|
+
#if canImport(Expo)
|
|
37
|
+
ExpoHostRuntime.shared.bundlePath = bundlePath
|
|
38
|
+
#else
|
|
39
|
+
ReactNativeHostRuntime.shared.bundlePath = bundlePath
|
|
40
|
+
#endif
|
|
61
41
|
}
|
|
62
42
|
}
|
|
43
|
+
|
|
63
44
|
/**
|
|
64
45
|
* Bundle instance to lookup the JavaScript bundle.
|
|
65
46
|
* Default value: Bundle.main
|
|
66
47
|
*/
|
|
67
|
-
@objc public var bundle: Bundle =
|
|
48
|
+
@objc public var bundle: Bundle = .main {
|
|
68
49
|
didSet {
|
|
69
|
-
|
|
50
|
+
#if canImport(Expo)
|
|
51
|
+
ExpoHostRuntime.shared.bundle = bundle
|
|
52
|
+
#else
|
|
53
|
+
ReactNativeHostRuntime.shared.bundle = bundle
|
|
54
|
+
#endif
|
|
70
55
|
}
|
|
71
56
|
}
|
|
57
|
+
|
|
72
58
|
/**
|
|
73
59
|
* Dynamic bundle URL provider called on every bundle load.
|
|
74
60
|
* When set, this overrides the default bundleURL() behavior in the delegate.
|
|
@@ -77,95 +63,75 @@ class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
|
|
|
77
63
|
*/
|
|
78
64
|
@objc public var bundleURLOverride: (() -> URL?)? = nil {
|
|
79
65
|
didSet {
|
|
80
|
-
|
|
66
|
+
#if canImport(Expo)
|
|
67
|
+
ExpoHostRuntime.shared.bundleURLOverride = bundleURLOverride
|
|
68
|
+
#else
|
|
69
|
+
ReactNativeHostRuntime.shared.bundleURLOverride = bundleURLOverride
|
|
70
|
+
#endif
|
|
81
71
|
}
|
|
82
72
|
}
|
|
83
|
-
|
|
84
|
-
* React Native factory instance created when starting React Native.
|
|
85
|
-
* Default value: nil
|
|
86
|
-
*/
|
|
87
|
-
private var reactNativeFactory: RCTReactNativeFactory? = nil
|
|
88
|
-
/**
|
|
89
|
-
* Root view factory used to create React Native views.
|
|
90
|
-
*/
|
|
91
|
-
lazy private var rootViewFactory: RCTRootViewFactory? = {
|
|
92
|
-
return reactNativeFactory?.rootViewFactory
|
|
93
|
-
}()
|
|
94
|
-
|
|
73
|
+
|
|
95
74
|
/**
|
|
96
75
|
* Starts React Native with default parameters.
|
|
97
76
|
*/
|
|
98
77
|
@objc public func startReactNative() {
|
|
99
|
-
|
|
78
|
+
#if canImport(Expo)
|
|
79
|
+
ExpoHostRuntime.shared.startReactNative()
|
|
80
|
+
#else
|
|
81
|
+
ReactNativeHostRuntime.shared.startReactNative()
|
|
82
|
+
#endif
|
|
100
83
|
}
|
|
101
|
-
|
|
84
|
+
|
|
102
85
|
@objc public func view(
|
|
103
86
|
moduleName: String,
|
|
104
87
|
initialProps: [AnyHashable: Any]?,
|
|
105
88
|
launchOptions: [AnyHashable: Any]? = nil
|
|
106
89
|
) -> UIView? {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
90
|
+
#if canImport(Expo)
|
|
91
|
+
ExpoHostRuntime.shared.view(
|
|
92
|
+
moduleName: moduleName,
|
|
93
|
+
initialProps: initialProps,
|
|
94
|
+
launchOptions: launchOptions
|
|
95
|
+
)
|
|
96
|
+
#else
|
|
97
|
+
ReactNativeHostRuntime.shared.view(
|
|
98
|
+
moduleName: moduleName,
|
|
99
|
+
initialProps: initialProps,
|
|
110
100
|
launchOptions: launchOptions
|
|
111
101
|
)
|
|
102
|
+
#endif
|
|
112
103
|
}
|
|
113
|
-
|
|
104
|
+
|
|
114
105
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* @param onBundleLoaded Optional callback invoked after JS bundle is fully loaded.
|
|
106
|
+
* Mirrors the host runtime app delegate API, forwarding to Expo or bare React Native as appropriate.
|
|
118
107
|
*/
|
|
119
|
-
@objc public func
|
|
120
|
-
|
|
108
|
+
@objc public func application(
|
|
109
|
+
_ application: UIApplication,
|
|
110
|
+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
111
|
+
) -> Bool {
|
|
112
|
+
#if canImport(Expo)
|
|
113
|
+
return ExpoHostRuntime.shared.application(
|
|
114
|
+
application,
|
|
115
|
+
didFinishLaunchingWithOptions: launchOptions
|
|
116
|
+
)
|
|
117
|
+
#else
|
|
118
|
+
return ReactNativeHostRuntime.shared.application(
|
|
119
|
+
application,
|
|
120
|
+
didFinishLaunchingWithOptions: launchOptions
|
|
121
|
+
)
|
|
122
|
+
#endif
|
|
121
123
|
}
|
|
122
|
-
|
|
124
|
+
|
|
123
125
|
/**
|
|
124
|
-
* Starts React Native with optional callback
|
|
126
|
+
* Starts React Native with optional callback when bundle is loaded.
|
|
125
127
|
*
|
|
126
128
|
* @param onBundleLoaded Optional callback invoked after JS bundle is fully loaded.
|
|
127
|
-
* @param launchOptions Launch options, typically passed from AppDelegate.
|
|
128
129
|
*/
|
|
129
|
-
@objc public func startReactNative(onBundleLoaded: (() -> Void)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if let onBundleLoaded {
|
|
136
|
-
self.onBundleLoaded = onBundleLoaded
|
|
137
|
-
if RCTIsNewArchEnabled() {
|
|
138
|
-
NotificationCenter.default.addObserver(
|
|
139
|
-
self,
|
|
140
|
-
selector: #selector(jsLoaded),
|
|
141
|
-
name: NSNotification.Name("RCTInstanceDidLoadBundle"),
|
|
142
|
-
object: nil
|
|
143
|
-
)
|
|
144
|
-
} else {
|
|
145
|
-
NotificationCenter.default.addObserver(
|
|
146
|
-
self,
|
|
147
|
-
selector: #selector(jsLoaded),
|
|
148
|
-
name: NSNotification.Name("RCTJavaScriptDidLoadNotification"),
|
|
149
|
-
object: nil
|
|
150
|
-
)
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
@objc private func jsLoaded(_ notification: Notification) {
|
|
156
|
-
onBundleLoaded?()
|
|
157
|
-
onBundleLoaded = nil
|
|
158
|
-
NotificationCenter.default.removeObserver(self)
|
|
130
|
+
@objc public func startReactNative(onBundleLoaded: (() -> Void)?) {
|
|
131
|
+
#if canImport(Expo)
|
|
132
|
+
ExpoHostRuntime.shared.startReactNative(onBundleLoaded: onBundleLoaded)
|
|
133
|
+
#else
|
|
134
|
+
ReactNativeHostRuntime.shared.startReactNative(onBundleLoaded: onBundleLoaded)
|
|
135
|
+
#endif
|
|
159
136
|
}
|
|
160
137
|
}
|
|
161
|
-
|
|
162
|
-
extension Notification.Name {
|
|
163
|
-
/**
|
|
164
|
-
* Notification sent when React Native wants to navigate back to native screen.
|
|
165
|
-
*/
|
|
166
|
-
public static let popToNative = Notification.Name("PopToNativeNotification")
|
|
167
|
-
/**
|
|
168
|
-
* Notification sent to enable/disable the pop gesture recognizer.
|
|
169
|
-
*/
|
|
170
|
-
public static let togglePopGestureRecognizer = Notification.Name("TogglePopGestureRecognizerNotification")
|
|
171
|
-
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import UIKit
|
|
2
|
+
internal import React
|
|
3
|
+
internal import React_RCTAppDelegate
|
|
4
|
+
internal import ReactAppDependencyProvider
|
|
5
|
+
|
|
6
|
+
class ReactNativeBrownfieldDelegate: RCTDefaultReactNativeFactoryDelegate {
|
|
7
|
+
var entryFile = "index"
|
|
8
|
+
var bundlePath = "main.jsbundle"
|
|
9
|
+
var bundle = Bundle.main
|
|
10
|
+
var bundleURLOverride: (() -> URL?)? = nil
|
|
11
|
+
// MARK: - RCTReactNativeFactoryDelegate Methods
|
|
12
|
+
|
|
13
|
+
override func sourceURL(for bridge: RCTBridge) -> URL? {
|
|
14
|
+
return bundleURL()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public override func bundleURL() -> URL? {
|
|
18
|
+
if let bundleURLProvider = bundleURLOverride {
|
|
19
|
+
return bundleURLProvider()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#if DEBUG
|
|
23
|
+
return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: entryFile)
|
|
24
|
+
#else
|
|
25
|
+
do {
|
|
26
|
+
let (resourceName, fileExtension) = try BrownfieldBundlePathResolver.resourceComponents(
|
|
27
|
+
from: bundlePath
|
|
28
|
+
)
|
|
29
|
+
return bundle.url(forResource: resourceName, withExtension: fileExtension)
|
|
30
|
+
} catch {
|
|
31
|
+
assertionFailure("Invalid bundlePath '\(bundlePath)': \(error)")
|
|
32
|
+
return nil
|
|
33
|
+
}
|
|
34
|
+
#endif
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
final class ReactNativeHostRuntime {
|
|
39
|
+
public static let shared = ReactNativeHostRuntime()
|
|
40
|
+
private let jsBundleLoadObserver = JSBundleLoadObserver()
|
|
41
|
+
private var delegate = ReactNativeBrownfieldDelegate()
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Path to JavaScript root.
|
|
45
|
+
* Default value: "index"
|
|
46
|
+
*/
|
|
47
|
+
public var entryFile: String = "index" {
|
|
48
|
+
didSet {
|
|
49
|
+
delegate.entryFile = entryFile
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Path to JavaScript bundle file.
|
|
55
|
+
* Default value: "main.jsbundle"
|
|
56
|
+
*/
|
|
57
|
+
public var bundlePath: String = "main.jsbundle" {
|
|
58
|
+
didSet {
|
|
59
|
+
delegate.bundlePath = bundlePath
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Bundle instance to lookup the JavaScript bundle.
|
|
64
|
+
* Default value: Bundle.main
|
|
65
|
+
*/
|
|
66
|
+
public var bundle: Bundle = Bundle.main {
|
|
67
|
+
didSet {
|
|
68
|
+
delegate.bundle = bundle
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Dynamic bundle URL provider called on every bundle load.
|
|
73
|
+
* When set, this overrides the default bundleURL() behavior in the delegate.
|
|
74
|
+
* Returns a URL to load a custom bundle, or nil to use default behavior.
|
|
75
|
+
* Default value: nil
|
|
76
|
+
*/
|
|
77
|
+
public var bundleURLOverride: (() -> URL?)? = nil {
|
|
78
|
+
didSet {
|
|
79
|
+
delegate.bundleURLOverride = bundleURLOverride
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* React Native factory instance created when starting React Native.
|
|
84
|
+
* Default value: nil
|
|
85
|
+
*/
|
|
86
|
+
private var reactNativeFactory: RCTReactNativeFactory? = nil
|
|
87
|
+
/**
|
|
88
|
+
* Root view factory used to create React Native views.
|
|
89
|
+
*/
|
|
90
|
+
lazy private var rootViewFactory: RCTRootViewFactory? = {
|
|
91
|
+
return reactNativeFactory?.rootViewFactory
|
|
92
|
+
}()
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Starts React Native with default parameters.
|
|
96
|
+
*/
|
|
97
|
+
public func startReactNative() {
|
|
98
|
+
startReactNative(onBundleLoaded: nil)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public func view(
|
|
102
|
+
moduleName: String,
|
|
103
|
+
initialProps: [AnyHashable: Any]?,
|
|
104
|
+
launchOptions: [AnyHashable: Any]? = nil
|
|
105
|
+
) -> UIView? {
|
|
106
|
+
rootViewFactory?.view(
|
|
107
|
+
withModuleName: moduleName,
|
|
108
|
+
initialProperties: initialProps,
|
|
109
|
+
launchOptions: launchOptions
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Mirrors host manager app delegate API for bare React Native.
|
|
115
|
+
*/
|
|
116
|
+
public func application(
|
|
117
|
+
_ application: UIApplication,
|
|
118
|
+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
|
119
|
+
) -> Bool {
|
|
120
|
+
return true
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Starts React Native with optional callback when bundle is loaded.
|
|
125
|
+
*
|
|
126
|
+
* @param onBundleLoaded Optional callback invoked after JS bundle is fully loaded.
|
|
127
|
+
*/
|
|
128
|
+
public func startReactNative(onBundleLoaded: (() -> Void)?) {
|
|
129
|
+
guard reactNativeFactory == nil else { return }
|
|
130
|
+
|
|
131
|
+
delegate.dependencyProvider = RCTAppDependencyProvider()
|
|
132
|
+
self.reactNativeFactory = RCTReactNativeFactory(delegate: delegate)
|
|
133
|
+
|
|
134
|
+
if let onBundleLoaded {
|
|
135
|
+
jsBundleLoadObserver.observeOnce(onBundleLoaded: onBundleLoaded)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.brownfieldGradlePluginDependency=exports.BROWNFIELD_PLUGIN_VERSION=void 0;var BROWNFIELD_PLUGIN_VERSION=exports.BROWNFIELD_PLUGIN_VERSION='1.0.0';var brownfieldGradlePluginDependency=exports.brownfieldGradlePluginDependency=`classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
|
|
2
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BROWNFIELD_PLUGIN_VERSION","exports","brownfieldGradlePluginDependency"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/constants.ts"],"mappings":"2IAAO,GAAM,CAAAA,yBAAyB,CAAAC,OAAA,CAAAD,yBAAA,CAAG,OAAO,CACzC,GAAM,CAAAE,gCAAgC,CAAAD,OAAA,CAAAC,gCAAA,CAAG,2DAA2DF,yBAAyB,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.modifyRootBuildGradle=modifyRootBuildGradle;exports.modifySettingsGradle=modifySettingsGradle;var _constants=require("./constants");var _logging=require("../logging");function modifyRootBuildGradle(contents){if(contents.includes('brownfield-gradle-plugin')){_logging.Logger.logDebug('Brownfield Gradle plugin already in root build.gradle, skipping');return contents;}_logging.Logger.logDebug(`Modifying root build.gradle to add the Gradle Brownfield plugin`);var buildscriptDepsRegex=/(buildscript\s*\{[\s\S]*?dependencies\s*\{[\s\S]*?)(})/m;var match=contents.match(buildscriptDepsRegex);if(!match){throw new Error('Could not locate buildscript block in root build.gradle');}var insertion=`\t${_constants.brownfieldGradlePluginDependency}\n\t`;var modifiedContents=contents.replace(buildscriptDepsRegex,`$1${insertion}$2`);_logging.Logger.logDebug('Added Brownfield Gradle plugin to root build.gradle');return modifiedContents;}function modifySettingsGradle(contents,moduleName){var includeStatement=`include ':${moduleName}'`;if(contents.includes(includeStatement)){_logging.Logger.logDebug(`Module "${moduleName}" already in settings.gradle, skipping`);return contents;}_logging.Logger.logDebug(`Modifying settings.gradle to include module "${moduleName}"`);var modifiedContents=contents+`\n${includeStatement}\n`;_logging.Logger.logDebug(`Added module "${moduleName}" to settings.gradle`);return modifiedContents;}
|
|
2
|
+
//# sourceMappingURL=gradleHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_constants","require","_logging","modifyRootBuildGradle","contents","includes","Logger","logDebug","buildscriptDepsRegex","match","Error","insertion","brownfieldGradlePluginDependency","modifiedContents","replace","modifySettingsGradle","moduleName","includeStatement"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/gradleHelpers.ts"],"mappings":"+JAAA,IAAAA,UAAA,CAAAC,OAAA,gBACA,IAAAC,QAAA,CAAAD,OAAA,eAOO,QAAS,CAAAE,qBAAqBA,CAACC,QAAgB,CAAU,CAE9D,GAAIA,QAAQ,CAACC,QAAQ,CAAC,0BAA0B,CAAC,CAAE,CACjDC,eAAM,CAACC,QAAQ,CACb,iEACF,CAAC,CACD,MAAO,CAAAH,QAAQ,CACjB,CAEAE,eAAM,CAACC,QAAQ,CACb,iEACF,CAAC,CAGD,GAAM,CAAAC,oBAAoB,CACxB,yDAAyD,CAC3D,GAAM,CAAAC,KAAK,CAAGL,QAAQ,CAACK,KAAK,CAACD,oBAAoB,CAAC,CAElD,GAAI,CAACC,KAAK,CAAE,CACV,KAAM,IAAI,CAAAC,KAAK,CAAC,yDAAyD,CAAC,CAC5E,CAGA,GAAM,CAAAC,SAAS,CAAG,KAAKC,2CAAgC,MAAM,CAC7D,GAAM,CAAAC,gBAAgB,CAAGT,QAAQ,CAACU,OAAO,CACvCN,oBAAoB,CACpB,KAAKG,SAAS,IAChB,CAAC,CAEDL,eAAM,CAACC,QAAQ,CAAC,qDAAqD,CAAC,CACtE,MAAO,CAAAM,gBAAgB,CACzB,CAQO,QAAS,CAAAE,oBAAoBA,CAClCX,QAAgB,CAChBY,UAAkB,CACV,CACR,GAAM,CAAAC,gBAAgB,CAAG,aAAaD,UAAU,GAAG,CAGnD,GAAIZ,QAAQ,CAACC,QAAQ,CAACY,gBAAgB,CAAC,CAAE,CACvCX,eAAM,CAACC,QAAQ,CACb,WAAWS,UAAU,wCACvB,CAAC,CACD,MAAO,CAAAZ,QAAQ,CACjB,CAEAE,eAAM,CAACC,QAAQ,CACb,gDAAgDS,UAAU,GAC5D,CAAC,CAGD,GAAM,CAAAH,gBAAgB,CAAGT,QAAQ,CAAG,KAAKa,gBAAgB,IAAI,CAE7DX,eAAM,CAACC,QAAQ,CAAC,iBAAiBS,UAAU,sBAAsB,CAAC,CAElE,MAAO,CAAAH,gBAAgB,CACzB","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"createAndroidModule",{enumerable:true,get:function get(){return _withAndroidModuleFiles.createAndroidModule;}});Object.defineProperty(exports,"modifyRootBuildGradle",{enumerable:true,get:function get(){return _gradleHelpers.modifyRootBuildGradle;}});Object.defineProperty(exports,"modifySettingsGradle",{enumerable:true,get:function get(){return _gradleHelpers.modifySettingsGradle;}});Object.defineProperty(exports,"withAndroidModuleFiles",{enumerable:true,get:function get(){return _withAndroidModuleFiles.withAndroidModuleFiles;}});Object.defineProperty(exports,"withBrownfieldAndroid",{enumerable:true,get:function get(){return _withBrownfieldAndroid.withBrownfieldAndroid;}});var _withBrownfieldAndroid=require("./withBrownfieldAndroid");var _withAndroidModuleFiles=require("./withAndroidModuleFiles");var _gradleHelpers=require("./gradleHelpers");
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_withBrownfieldAndroid","require","_withAndroidModuleFiles","_gradleHelpers"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/index.ts"],"mappings":"iwBAAA,IAAAA,sBAAA,CAAAC,OAAA,4BACA,IAAAC,uBAAA,CAAAD,OAAA,6BAIA,IAAAE,cAAA,CAAAF,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.createAndroidModule=createAndroidModule;exports.withAndroidModuleFiles=void 0;var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var fs=_interopRequireWildcard(require("node:fs"));var path=_interopRequireWildcard(require("node:path"));var _configPlugins=require("@expo/config-plugins");var _logging=require("../logging");var _engine=require("../template/engine");function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}function createAndroidModule(_ref){var androidDir=_ref.androidDir,config=_ref.config,rnVersion=_ref.rnVersion;var android=config.android;var moduleDir=path.join(androidDir,android.moduleName);_logging.Logger.logDebug(`Creating Android module in: ${androidDir}`);var files=[{relativePath:'build.gradle.kts',content:(0,_engine.renderTemplate)('android','build.gradle.kts',{'{{PACKAGE_NAME}}':android.packageName,'{{MIN_SDK_VERSION}}':android.minSdkVersion.toString(),'{{COMPILE_SDK_VERSION}}':android.compileSdkVersion.toString(),'{{GROUP_ID}}':android.groupId,'{{ARTIFACT_ID}}':android.artifactId,'{{ARTIFACT_VERSION}}':android.version,'{{RN_VERSION}}':rnVersion})},{relativePath:'gradle.properties',content:(0,_engine.renderTemplate)('android','gradle.properties',{})},{relativePath:'src/main/AndroidManifest.xml',content:(0,_engine.renderTemplate)('android','AndroidManifest.xml',{})},{relativePath:`src/main/java/${config.android.packageName.replace(/\./g,'/')}/ReactNativeHostManager.kt`,content:(0,_engine.renderTemplate)('android','ReactNativeHostManager.kt',{'{{PACKAGE_NAME}}':android.packageName})},{relativePath:'consumer-rules.pro',content:(0,_engine.renderTemplate)('android','consumer-rules.pro',{})},{relativePath:'proguard-rules.pro',content:(0,_engine.renderTemplate)('android','proguard-rules.pro',{})}];for(var file of files){var filePath=path.join(moduleDir,file.relativePath);var fileDir=path.dirname(filePath);if(!fs.existsSync(fileDir)){fs.mkdirSync(fileDir,{recursive:true});}fs.writeFileSync(filePath,file.content,'utf8');_logging.Logger.logDebug(`Created file: ${filePath}`);}_logging.Logger.logDebug(`Android module "${android.moduleName}" created at ${moduleDir}`);}var withAndroidModuleFiles=exports.withAndroidModuleFiles=function withAndroidModuleFiles(config,props){return(0,_configPlugins.withDangerousMod)(config,['android',(function(){var _ref2=(0,_asyncToGenerator2.default)(function*(dangerousConfig){var androidDir=path.join(dangerousConfig.modRequest.projectRoot,'android');var rnVersion;try{var rnPkgPath=require.resolve('react-native/package.json',{paths:[dangerousConfig.modRequest.projectRoot]});var rnPkg=require(rnPkgPath);rnVersion=rnPkg.version;_logging.Logger.logDebug(`Resolved react-native version: ${rnVersion}`);}catch(_unused){throw new Error('Could not resolve react-native package version. Please ensure you have installed dependencies.');}createAndroidModule({androidDir:androidDir,config:props,rnVersion:rnVersion});return dangerousConfig;});return function(_x){return _ref2.apply(this,arguments);};}())]);};
|
|
2
|
+
//# sourceMappingURL=withAndroidModuleFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fs","_interopRequireWildcard","require","path","_configPlugins","_logging","_engine","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","createAndroidModule","_ref","androidDir","config","rnVersion","android","moduleDir","join","moduleName","Logger","logDebug","files","relativePath","content","renderTemplate","packageName","minSdkVersion","toString","compileSdkVersion","groupId","artifactId","version","replace","file","filePath","fileDir","dirname","existsSync","mkdirSync","recursive","writeFileSync","withAndroidModuleFiles","exports","props","withDangerousMod","_ref2","_asyncToGenerator2","dangerousConfig","modRequest","projectRoot","rnPkgPath","resolve","paths","rnPkg","_unused","Error","_x","apply","arguments"],"sourceRoot":"../../../../src","sources":["expo-config-plugin/android/withAndroidModuleFiles.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.withBrownfieldAndroid=void 0;var _configPlugins=require("@expo/config-plugins");var _gradleHelpers=require("./gradleHelpers");var _withAndroidModuleFiles=require("./withAndroidModuleFiles");var withBrownfieldAndroid=exports.withBrownfieldAndroid=function withBrownfieldAndroid(config,props){var androidConfig=props.android;config=(0,_configPlugins.withProjectBuildGradle)(config,function(gradleConfig){gradleConfig.modResults.contents=(0,_gradleHelpers.modifyRootBuildGradle)(gradleConfig.modResults.contents);return gradleConfig;});config=(0,_configPlugins.withSettingsGradle)(config,function(settingsConfig){settingsConfig.modResults.contents=(0,_gradleHelpers.modifySettingsGradle)(settingsConfig.modResults.contents,androidConfig.moduleName);return settingsConfig;});config=(0,_withAndroidModuleFiles.withAndroidModuleFiles)(config,props);return config;};
|
|
2
|
+
//# sourceMappingURL=withBrownfieldAndroid.js.map
|