jsc-android
Advanced tools
Comparing version 241213.0.0 to 241213.1.0
{ | ||
"name": "jsc-android", | ||
"version": "241213.0.0", | ||
"version": "241213.1.0", | ||
"description": "Pre-build version of JavaScriptCore to be used by React Native apps", | ||
@@ -5,0 +5,0 @@ "repository": { |
105
README.md
@@ -48,2 +48,18 @@ [![npm version](https://badge.fury.io/js/jsc-android.svg)](https://badge.fury.io/js/jsc-android) | ||
### For React Native version 0.60 and newer | ||
1. Update `jsc-android`: | ||
``` | ||
yarn add jsc-android | ||
# Or if you would like to try latest version | ||
# yarn add 'jsc-android@canary` | ||
``` | ||
2. You're done, rebuild your app and enjoy updated version of JSC on android! | ||
### For React Native version 0.59 | ||
1. Add `jsc-android` to the "dependencies" section in your `package.json`: | ||
@@ -75,2 +91,58 @@ ```diff | ||
3. Update your app's `build.gradle` file located in `android/app/build.gradle` to add the JSC dependencey. Please make sure the dependency should put before React Native dependency. | ||
```diff | ||
dependencies { | ||
+ // Make sure to put android-jsc at the the first | ||
+ implementation "org.webkit:android-jsc:r241213" | ||
+ | ||
compile fileTree(dir: "libs", include: ["*.jar"]) | ||
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" | ||
implementation "com.facebook.react:react-native:+" // From node_modules | ||
} | ||
``` | ||
4. Update your app's `build.gradle` file located in `android/app/build.gradle` to use first matched JSC library. | ||
```diff | ||
android { | ||
// ... | ||
+ packagingOptions { | ||
+ pickFirst '**/libjsc.so' | ||
+ pickFirst '**/libc++_shared.so' | ||
+ } | ||
} | ||
``` | ||
5. You're done, rebuild your app and enjoy updated version of JSC on android! | ||
### For React Native version 0.58 below | ||
1. Add `jsc-android` to the "dependencies" section in your `package.json`: | ||
```diff | ||
dependencies { | ||
+ "jsc-android": "241213.x.x", | ||
``` | ||
then run `npm install` or `yarn` (depending which npm client you use) in order for the new dependency to be installed in `node_modules` | ||
2. Modify `android/build.gradle` file to add new local maven repository packaged in the `jsc-android` package to the search path: | ||
```diff | ||
allprojects { | ||
repositories { | ||
mavenLocal() | ||
jcenter() | ||
maven { | ||
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | ||
url "$rootDir/../node_modules/react-native/android" | ||
} | ||
+ maven { | ||
+ // Local Maven repo containing AARs with JSC library built for Android | ||
+ url "$rootDir/../node_modules/jsc-android/dist" | ||
+ } | ||
} | ||
} | ||
``` | ||
3. Update your app's `build.gradle` file located in `android/app/build.gradle` to force app builds to use new version of the JSC library as opposed to the version specified in [react-native gradle module as a dependency](https://github.com/facebook/react-native/blob/e8df8d9fd579ff14224cacdb816f9ff07eef978d/ReactAndroid/build.gradle#L289): | ||
@@ -89,2 +161,6 @@ | ||
compile fileTree(dir: "libs", include: ["*.jar"]) | ||
+ // ... | ||
+ implementation 'org.webkit:android-jsc-cppruntime:+' | ||
+ // For even older gradle | ||
+ // compile 'org.webkit:android-jsc-cppruntime:+' | ||
``` | ||
@@ -99,3 +175,32 @@ | ||
For React Native version 0.60 and newer, your build.gradle should have a flag to enable this feature. | ||
```diff | ||
/** | ||
* Use the international variant of JavaScriptCore | ||
* This variant includes the ICU i18n library to make APIs like `Date.toLocaleString` | ||
* and `String.localeCompare` work when using with locales other than en-US. | ||
* Note that this variant is about 6MiB larger per architecture than the default. | ||
*/ | ||
- def useIntlJsc = false | ||
+ def useIntlJsc = true | ||
``` | ||
For React Native version 0.59, replace original artifact id with `android-jsc-intl` | ||
```diff | ||
dependencies { | ||
+ // Make sure to put android-jsc at the the first | ||
+ implementation "org.webkit:android-jsc-intl:r241213" | ||
+ | ||
compile fileTree(dir: "libs", include: ["*.jar"]) | ||
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" | ||
implementation "com.facebook.react:react-native:+" // From node_modules | ||
} | ||
``` | ||
For React Native version 0.58 below, replace original `resolutionStrategy` with this. | ||
```diff | ||
+configurations.all { | ||
@@ -102,0 +207,0 @@ + resolutionStrategy { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81
253
47312977