JavaScriptCore for Android (React Native)

250231.0.0 · active · verified Sun Apr 19

jsc-android provides pre-built versions of JavaScriptCore (JSC) for integration into React Native applications running on the Android platform. It is a critical native dependency for React Native's JavaScript runtime on Android, allowing developers to use a modern and optimized JavaScript engine. The project is actively maintained by the React Native community, with releases tied to WebKitGTK updates and React Native compatibility. Recent stable versions like `v294992.0.0` (as of its release) include updates to WebKitGTK and React Native compatibility. Its key differentiator is providing an up-to-date, performant JSC engine for Android, often replacing older system-provided WebView JavaScript engines. This approach allows for more frequent JSC updates on Android, aligning with how React Native on iOS utilizes the built-in, frequently updated JSC.

Common errors

Warnings

Install

Imports

Quickstart

This code illustrates a basic React Native application that implicitly uses `jsc-android` as its JavaScript runtime on Android. It highlights that no direct JavaScript/TypeScript imports are needed, as `jsc-android` is a native build dependency. The description also guides users to verify its inclusion via the Android project's `build.gradle` file.

import React from 'react';
import { View, Text, StyleSheet, SafeAreaView } from 'react-native';

const App = () => {
  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.content}>
        <Text style={styles.title}>Welcome to React Native!</Text>
        <Text style={styles.subtitle}>
          Your JavaScript code on Android is powered by{' '}
          <Text style={styles.highlight}>jsc-android</Text>.
        </Text>
        <Text style={styles.instruction}>
          jsc-android is implicitly included as a native dependency in most React Native projects.
          To verify the version used, check your Android project's `app/build.gradle` file for a
          dependency similar to `implementation "org.webkit:android-jsc-intl:+"`.
        </Text>
      </View>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#f5f5f5',
  },
  content: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    padding: 20,
  },
  title: {
    fontSize: 24,
    fontWeight: 'bold',
    marginBottom: 10,
    color: '#333',
  },
  subtitle: {
    fontSize: 18,
    textAlign: 'center',
    marginBottom: 20,
    color: '#555',
  },
  highlight: {
    fontWeight: 'bold',
    color: '#007bff',
  },
  instruction: {
    fontSize: 14,
    textAlign: 'center',
    color: '#777',
    marginTop: 15,
  },
});

export default App;

view raw JSON →