Gathering detailed insights and metrics for jsc-android
Gathering detailed insights and metrics for jsc-android
Gathering detailed insights and metrics for jsc-android
Gathering detailed insights and metrics for jsc-android
@kudo-ci/jsc-android
Pre-build version of JavaScriptCore to be used by React Native apps
jsc-safe-url
Utility functions for converting to and from URLs that encode query string data into URL paths
@config-plugins/android-jsc-intl
Config plugin for android-jsc-intl package
@ledgerhq/react-native-hw-transport-ble
Ledger Hardware Wallet Bluetooth BLE transport for React Native
Script for building JavaScriptCore for Android (for React Native but not only)
npm install jsc-android
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
1,056 Stars
325 Commits
97 Forks
35 Watching
14 Branches
76 Contributors
Updated on 26 Nov 2024
JavaScript (98.01%)
Shell (1.74%)
Java (0.2%)
CMake (0.04%)
Cumulative downloads
Total Downloads
Last day
-4.3%
449,429
Compared to previous day
Last week
3.5%
2,428,204
Compared to previous week
Last month
11.2%
9,892,673
Compared to previous month
Last year
45.5%
95,000,811
Compared to previous year
The aim of this project is to provide maintainable build scripts for the JavaScriptCore JavaScript engine and allow the React Native project to incorporate up-to-date releases of JSC into the framework on Android.
This project is based on facebook/android-jsc but instead of rewriting JSC's build scripts into BUCK files, it relies on CMake build scripts maintained in a GTK branch of WebKit maintained by the WebKitGTK team (great work btw!). Thanks to that, with just a small amount of work we should be able to build not only current but also future releases of JSC. An obvious benefit for everyone using React Native is that this will allow us to update JSC for React Native on Android much more often than before (note that facebook/android-jsc uses JSC version from Nov 2014), which is especially helpful since React Native on iOS uses the built-in copy of JSC that is updated with each major iOS release (see this as a reference).
brew install coreutils
brew install node
brew tap caskroom/versions && brew cask install java8
brew cask install android-sdk
sdkmanager --list
and install all platforms, tools, buildtool v28.0.3, cmake (android images are not needed)$ANDROID_HOME
to the correct path (in ~/.bashrc or similar)export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/bin
export ANDROID_NDK=/path/to/android-ndk-r19c
npm run clean
will clean everything (artifacts, downloaded sources)package.json
to the desired build configurationprintVersion
patch in jsc.patch)npm run download
: downloads all needed sourcesnpm run start
: builds jsc (this might take some time...)The zipfile containing the android-jsc AAR will be available at /dist
.
The library is packaged as a local Maven repository containing AAR files that include the binaries.
JSC library built using this project is distributed over npm: npm/jsc-android. The library is packaged as a local Maven repository containing AAR files that include the binaries. Please refer to the section below in order to learn how your app can consume this format.
On load, JSC prints the version out to logcat, under "JavaScriptCore.Version" tag.
Follow steps below in order for your React Native app to use new version of JSC VM on android:
jsc-android
:yarn add jsc-android
# Or if you would like to try latest version
# yarn add 'jsc-android@next'
jsc-android
:yarn add jsc-android
# Or if you would like to try latest version
# yarn add 'jsc-android@next'
android/build.gradle
file to add the new local maven repository packaged in the jsc-android
package to the search path:1allprojects { 2 repositories { 3 mavenLocal() 4 jcenter() 5 maven { 6 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 7 url "$rootDir/../node_modules/react-native/android" 8 } 9+ maven { 10+ // Local Maven repo containing AARs with JSC library built for Android 11+ url "$rootDir/../node_modules/jsc-android/dist" 12+ } 13 } 14}
build.gradle
file located in android/app/build.gradle
to add the JSC dependency. Please make sure the dependency is before the React Native dependency.1 2dependencies { 3+ // Make sure to put android-jsc at the top 4+ implementation "org.webkit:android-jsc:+" 5+ 6 compile fileTree(dir: "libs", include: ["*.jar"]) 7 implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" 8 implementation "com.facebook.react:react-native:+" // From node_modules 9}
build.gradle
file located in android/app/build.gradle
to use first matched JSC library.1android { 2 // ... 3+ packagingOptions { 4+ pickFirst '**/libjsc.so' 5+ pickFirst '**/libc++_shared.so' 6+ } 7}
jsc-android
:yarn add jsc-android
# Or if you would like to try latest version
# yarn add 'jsc-android@next'
android/build.gradle
file to add new local maven repository packaged in the jsc-android
package to the search path:1allprojects { 2 repositories { 3 mavenLocal() 4 jcenter() 5 maven { 6 // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 7 url "$rootDir/../node_modules/react-native/android" 8 } 9+ maven { 10+ // Local Maven repo containing AARs with JSC library built for Android 11+ url "$rootDir/../node_modules/jsc-android/dist" 12+ } 13 } 14}
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:1} 2 3+configurations.all { 4+ resolutionStrategy { 5+ force 'org.webkit:android-jsc:+' 6+ } 7+} 8 9dependencies { 10 compile fileTree(dir: "libs", include: ["*.jar"]) 11+ // ... 12+ implementation 'org.webkit:android-jsc-cppruntime:+' 13+ // For even older gradle 14+ // compile 'org.webkit:android-jsc-cppruntime:+'
International variant includes ICU i18n library and necessary data allowing to use e.g. Date.toLocaleString and String.localeCompare that give correct results when using with locales other than en-US. Note that this variant is about 6MiB larger per architecture than default.
To use this variant instead replace the third installation step with:
For React Native version 0.60 and newer, your build.gradle should have a flag to enable this feature.
1 /** 2 * Use the international variant of JavaScriptCore 3 * This variant includes the ICU i18n library to make APIs like `Date.toLocaleString` 4 * and `String.localeCompare` work when using with locales other than en-US. 5 * Note that this variant is about 6MiB larger per architecture than the default. 6 */ 7- def useIntlJsc = false 8+ def useIntlJsc = true
For React Native version 0.59, replace original artifact id with android-jsc-intl
1 2dependencies { 3+ // Make sure to put android-jsc at the the first 4+ implementation "org.webkit:android-jsc-intl:+" 5+ 6 compile fileTree(dir: "libs", include: ["*.jar"]) 7 implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" 8 implementation "com.facebook.react:react-native:+" // From node_modules 9}
For React Native version 0.58 below, replace original resolutionStrategy
with this.
1+configurations.all { 2+ resolutionStrategy { 3+ eachDependency { DependencyResolveDetails details -> 4+ if (details.requested.name == 'android-jsc') { 5+ details.useTarget group: details.requested.group, name: 'android-jsc-intl', version: 'r241213' 6+ } 7+ } 8+ } 9+}
See Measurements page that contains synthetic perf test results for the most notable versions of JSC we have tried.
Compile errors of the sort:
1More than one file was found with OS independent path 'lib/armeabi-v7a/libgnustl_shared.so'
Add the following to your app/build.gradle
, under android
:
1packagingOptions { 2 pickFirst '**/libgnustl_shared.so' 3}
Check the list of contributors here. This project is supported by:
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 2/7 approved changesets -- score normalized to 2
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
15 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More