jsc-android-buildscripts
jsc-android-buildscripts copied to clipboard
Upgrade JSC past 260345
Issue Description
Unfortunately, many crypto apps rely on BigInt
in JS. But WebKit didn't enable BigInt
support until this changeset, which is almost a year after the currently released JSC version (i.e. 250230) was initially released.
The current version WebKitGTK 2.26.1 is from 2019. Is it possible to upgrade JSC to a more recent version?
I spoke with @Kudo and apparently he tried to update it to WebKitGTK 2.30.5, which was released in early 2021. That didn't work because:
"there was a breaking change that jsc removed the Intl toggle. so we probably would have to ship only the Intl variant and increase apk size."
Is there a way to get this to work, or alternatively to use an earlier version of WebKitGTK that doesn't have this breaking change, e.g. late 2020? Not sure when that change was introduced.
Thank you! This would be huge for the crypto space.
Version, config, any additional info
Bump, I'm wondering if this is possible, thanks!
Bump
Have you considered using Hermes instead? Would that address your specific problem?
It looks like Hermes doesn't support BigInt
yet either.
https://github.com/facebook/hermes/issues/510
It looks like Hermes doesn't support
BigInt
yet either. facebook/hermes#510
I see your point. I guess your best bet would be to reach out to someone at Expo and try to prioritize the whole BigInt
support.
The ICU library has a build tool to reduce the size of the ICU data file, and make smaller libraries for embedded use cases. https://unicode-org.github.io/icu/userguide/icu_data/buildtool.html#overview-what-is-in-the-icu-data-file Maybe this can be added to this project to make a smaller library for the "non-intl" build of JSC? @Kudo what do you think?
https://unicode-org.github.io/icu/userguide/icu_data/buildtool.html#overview-what-is-in-the-icu-data-file
Yeah I would use Hermes if it supported:
- BigInt
- WebAssembly
That's my only blocker. Can you explain why Expo would need to prioritize BigInt
support? I thought Facebook was maintaining the Hermes engine. Thanks.
The ICU library has a build tool to reduce the size of the ICU data file, and make smaller libraries for embedded use cases. https://unicode-org.github.io/icu/userguide/icu_data/buildtool.html#overview-what-is-in-the-icu-data-file Maybe this can be added to this project to make a smaller library for the "non-intl" build of JSC? @Kudo what do you think?
@ls-andrew-goodale there're still some difference in the non-intl variant, e.g. typeof(Intl) === 'undefined'
. i still think about to ship intl variant only. maybe we can do that after hermes be the default vm in react-native.
An updated jsc runtime would be very much appreciated by current rn/expo web3 developers, given that jsc/hermes are hardcoded in some important deps, which makes it really difficult to adopt the juicy v8
What about releasing it as a pre-release or simply not bump the dependency in React Native? Hermes is missing some pretty basic JS features like block scoping and classes and Meta is consistently rejecting those as valid use cases, making it a non-viable option for us. It would be great to make use of the latest improvements to JSC on an opt-in basis.
i can publish a new release on npm, just not to bump the version in react-native.
@sunnylqm i've seen you have a version already. do you mind to send us a pr?
@Kudo I tried with webkitgtk version 2.27, 2.28 with some patches commented out, but unfortunately there are some crash seen in production app.
With almost zero knowledge on c/c++, i am not capable and lucky enough to build version above 2.28.4 😂
well, i can try to do the upgrade. no promise yet because i'm super busy these two months.
https://github.com/react-native-community/jsc-android-buildscripts/pull/168
enable bigint support for the current jsc. it kinda works if you do not require much features.
close via #169. jsc-android@next
, please note that there're some breaking changes from this version. let me know whether it works for you. thanks!
Was #169 supposed to add support for bigint? @Kudo
I tried with a fresh install of react-native 0.69.10 and setting following resolution to my package.json.
"resolutions": {
"jsc-android": "294992.0.0"
},
But the android version still doesn't work with bigint for me.
Stumbled upon this comment, https://github.com/facebook/react-native/issues/35504#issuecomment-1331803148 and it made it work for me.