Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a non ancient version of JSC #10245

Closed
arv opened this issue Oct 5, 2016 · 8 comments
Closed

Use a non ancient version of JSC #10245

arv opened this issue Oct 5, 2016 · 8 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@arv
Copy link
Contributor

arv commented Oct 5, 2016

Issue Description

The current version of JSC is really old. It is missing almost all of ES6 which requires a lot of transformations with runtime functions as well as a lot of polyfills which really hurt startup as well as runtime performance.

I can see how this might be contentious if we want iOS8 to be the lowest common denominator but maybe we could make that configurable. I don't want my app to be slow on Android just because of iOS8 (which we might not want to support anyway).

Steps to Reproduce / Code Snippets

Change to the latest JSC. iOS 10 gets 100% on Kangax ES6 tests (which do not include modules) https://kangax.github.io/compat-table/es6/ With that we can remove a lot of transformations and polyfills.

Expected Results

Able to use modern JS features without slow polyfills and transformation passes.

Additional Information

  • React Native version: v0.34.1
  • Platform(s): Android
@ide
Copy link
Contributor

ide commented Oct 5, 2016

This is actually a pretty big undertaking and from what I've heard this is not a priority for Facebook right now, maybe someone can sponsor this work? I don't think it is a very contentious upgrade (though that could change once we get into the weeds), but I learned it's a considerable amount of work after talking to the person who originally did the bulk of the work getting it to run.

Regarding performance, upgrading to a newer version of JSC actually makes things slower but one hypothesis is that Apple's been benchmarking with clang instead of gcc and currently RN uses gcc. The good news is that moving forward Google is supporting clang and dropping gcc so that will line us up with Apple's setup.

@lacker
Copy link
Contributor

lacker commented Feb 9, 2017

I think the conclusion here is that this is not that straightforward of an improvement, and we are trying to keep the issues focused on bugs, so I feel like I should close this issue. My suspicion is that this is a huge PITA, but one day someone at Facebook will likely have to make this improvement for some reason, and will then spend all the unrewarding work doing it. So I think we should just punt on this for a while anyway. Thanks for bringing this up!

@lacker lacker closed this as completed Feb 9, 2017
@arv
Copy link
Contributor Author

arv commented Feb 9, 2017

One thing is that since the current version of JSC does not have an API for TypedArrays there is a lot of bugs related to XHR/fetch/WebSocket regarding binary data. Not only is a lot of code to maintain it is also a lot slower to have to convert back and forth to base64.

Also, having to transform all the js to es3 makes development slower and debugging significantly harder.

Seems strange to close a bug just because no one is able to work at it at the moment though?

@lacker
Copy link
Contributor

lacker commented Feb 9, 2017

Well, I wouldn't consider it a bug, I would consider it a feature request. We are tracking feature requests over at https://productpains.com/product/react-native so you can file something there. I just wanted to convey some of the complexity and painfulness so as to not get anyone's hopes up that someone will do this soon.

@ide
Copy link
Contributor

ide commented Feb 9, 2017

I wholeheartedly agree with the benefits of modern primitives and reduced compiling (aside, I've been trying out native async/await and it's much better to use the native debugging facilities on uncompiled code).

The best path I can think of now to accelerating this is to contract the person who did most of the work (no longer at FB). If this is something Attic and Facebook and a couple other cos are interested in sponsoring, we will do our best to coordinate the logistics.

@alexanderkjeldaas
Copy link

This bug was highlighted as a reason for Airbnb to sunset React Native. Reopen?
https://medium.com/airbnb-engineering/react-native-at-airbnb-the-technology-dafd0b43838

@codetalks-new
Copy link

codetalks-new commented Jun 20, 2018

Well, I'm new to RN, and hard to believe that RN haven't update its JSC to a newer version.

-- also come from https://medium.com/airbnb-engineering/react-native-at-airbnb-the-technology-dafd0b43838

@newyankeecodeshop
Copy link
Contributor

See #19737 for the issue tracking this

@facebook facebook locked as resolved and limited conversation to collaborators Jul 19, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants