react-native-community / jsc-android-buildscripts

Script for building JavaScriptCore for Android (for React Native but not only)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Docs] Can't locale "useIntlJsc" in RN 0.64

dlebedynskyi opened this issue · comments

Issue Description

Documentation say

International variant
For React Native version 0.60 and newer, your build.gradle should have a flag to enable this feature.
....
-  def useIntlJsc = false
+  def useIntlJsc = true

I'm not seeing any useIntlJsc in default RN 0.64 release.
Used - https://github.com/facebook/react-native/releases/tag/v0.64.0-rc.1
Template created as npx react-native init RN064 --version 0.64.0-rc.1

I do however see following

// android/app/build.gradle


/**
 * The preferred build flavor of JavaScriptCore.
 *
 * For example, to use the international variant, you can use:
 * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
 *
 * The 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.
 */
def jscFlavor = 'org.webkit:android-jsc:+' // 

Is documentation just incorrect or is there some other place that requires update?

@dlebedynskyi Does the release version crash for you too?
RN 0.63.4 with Hermes enabled -> ok
RN 064 --version 0.64.0-rc.2 with Hermes enabled -> ko
RN 064 --version 0.64.0-rc.2 with Hermes disabled -> ok

@lorenzoangelini apologies for later reply.
I think this is a docs issue.
I was able to use org.webkit:android-jsc:+ and Intl worked fine

I had to add/update def jscFlavor = 'org.webkit:android-jsc-intl:+' in the file android/app/build.gradle for me to be able to use functions like Intl.NumberFormat on Android. I'm using RN 0.66.