Skip to content

fix: add diffs #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 21, 2025
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