Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ useThirdPartyJSC=true

Open AppDelegate.swift and overwrite `createJSRuntimeFactory` method:

```swift
```diff
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
import UIKit
import RCTRuntime
+import RCTRuntime

// AppDelegate code

Expand All @@ -63,19 +63,19 @@ class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
#endif
}

override func createJSRuntimeFactory() -> JSRuntimeFactory {
jsrt_create_jsc_factory() // Use JavaScriptCore runtime
}
+ override func createJSRuntimeFactory() -> JSRuntimeFactory {
+ jsrt_create_jsc_factory() // Use JavaScriptCore runtime
+ }
}
```

### Android

Open `MainApplication.java` and overwrite `getJavaScriptExecutorFactory` method:

```java
import io.github.reactnativecommunity.javascriptcore.JSCExecutorFactory
import io.github.reactnativecommunity.javascriptcore.JSCRuntimeFactory
```diff
+import io.github.reactnativecommunity.javascriptcore.JSCExecutorFactory
+import io.github.reactnativecommunity.javascriptcore.JSCRuntimeFactory

class MainApplication : Application(), ReactApplication {

Expand All @@ -94,12 +94,12 @@ class MainApplication : Application(), ReactApplication {
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED

override fun getJavaScriptExecutorFactory(): JavaScriptExecutorFactory =
JSCExecutorFactory(packageName, AndroidInfoHelpers.getFriendlyDeviceName())
+ override fun getJavaScriptExecutorFactory(): JavaScriptExecutorFactory =
+ JSCExecutorFactory(packageName, AndroidInfoHelpers.getFriendlyDeviceName())
}

override val reactHost: ReactHost
get() = getDefaultReactHost(applicationContext, reactNativeHost, JSCRuntimeFactory())
+ override val reactHost: ReactHost
+ get() = getDefaultReactHost(applicationContext, reactNativeHost, JSCRuntimeFactory())

override fun onCreate() {
super.onCreate()
Expand All @@ -116,6 +116,15 @@ class MainApplication : Application(), ReactApplication {

This library is maintained by [Callstack](https://callstack.com/) a Total Software Engineering Consultancy that transforms organizations and teams through transformative apps.

### Special Thanks

Special thanks to the team who worked on the initial extraction of JavaScriptCore from core react-native:

- [Riccardo Cipolleschi](https://github.com/cipolleschi)
- [Nicola Corti](https://github.com/cortinico)
- [Kudo Chien](https://github.com/Kudo)
- [Oskar Kwaśniewski](https://github.com/okwasniewski)

## License

Everything inside this repository is [MIT licensed](./LICENSE).
Expand Down