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

Async/await in chakra #741

Closed
xgrommx opened this issue Dec 20, 2015 · 12 comments
Closed

Async/await in chakra #741

xgrommx opened this issue Dec 20, 2015 · 12 comments
Assignees
Labels

Comments

@xgrommx
Copy link

xgrommx commented Dec 20, 2015

Hello everyone. As I understood you have included chakra in jxcore. But I have some question about async/await. How can I use this one in my a sample project?

@karaxuna
Copy link
Member

Have you tried using JXcore with babel? Here is tutorial for that

@xgrommx
Copy link
Author

xgrommx commented Dec 20, 2015

No, I mean native support for async/await as in Edge browser from Microsoft.

@ktrzeciaknubisa
Copy link
Member

From what I read here: Asynchronous programming (scroll down to the bottom to "Asynchronous patterns in UWP using JavaScript") you're not going to use "async"/"wait" exactly. Instead you're going to use promises. However I'm not sure if they are available out-of-the-box in chakra embedded in JXcore, are they?

@xgrommx
Copy link
Author

xgrommx commented Dec 23, 2015

@ktrzeciaknubisa I have installed node from Microsoft with chakra and this version of node have almost all features from es2015 and also async/await.

@obastemur
Copy link
Member

I have installed node from Microsoft with chakra and this version of node have almost all features from es2015 and also async/await.

@xgrommx MS node and JXcore - chakra are exactly same when it comes to JS features. Can you elaborate on it ?

@obastemur
Copy link
Member

Chakra runtime needs to be initialized with JsRuntimeAttributeEnableExperimentalFeatures flag. Neither JXcore or Microsoft Node uses it at the moment. Once we are able to confirm the stability of the framework with the given flag, we will enable it. If you want to experiment, you might set it and compile manually.

See https://github.com/jxcore/jxcore/blob/master/deps/chakrashim/src/jsrtisolateshim.cc#L62 and replace or extend JsRuntimeAttributeAllowScriptInterrupt with JsRuntimeAttributeEnableExperimentalFeatures

@xgrommx
Copy link
Author

xgrommx commented Dec 29, 2015

@obastemur Is it means that jxcore will be to support some experimental features like a async/await?

@RReverser
Copy link

@xgrommx As far as I understand, yes.

Neither JXcore or Microsoft Node uses it at the moment.

@obastemur As far as I understand, @xgrommx got Microsoft Node working with experimental features (async/await) without any extra efforts, so probably they already use it...

@obastemur
Copy link
Member

Is it means that jxcore will be to support some experimental features like a async/await?

@DenysStoianov @xgrommx @RReverser Yes.

As far as I understand, @xgrommx got Microsoft Node working with experimental features (async/await) without any extra efforts, so probably they already use it...

AFAIK; Not possible. The only working Microsoft Node version was using previous WinSDK. Previous WinSDK doesn't have matching Chakra base for that particular experimental feature. AFAIK there is no Microsoft Node release working on updated 10.586 Windows. Although some weeks ago I made the commits to Microsoft Node for Windows Update, there is no new release on their end yet. (Don't know if they made anything last week, I wasn't around most of the time)

@xgrommx
Copy link
Author

xgrommx commented Dec 29, 2015

@obastemur @RReverser these is my steps for reproducing https://github.com/Microsoft/node/blob/chnext/IoT-Readme.md#step-1-set-up-your-pc I have installed nodejs tool for visual studio and it works out of the box.

@plika
Copy link
Contributor

plika commented Dec 30, 2015

@xgrommx that is for IoT only and it doesn't work on updated Windows IoT setup anyways.

This feature was enabled with 13.547 (After previous stable Windows Update).

https://blogs.windows.com/msedgedev/2015/09/30/asynchronous-code-gets-easier-with-es2016-async-function-support-in-chakra-and-microsoft-edge/

@obastemur I'm +1 on enabling it by default.

@obastemur
Copy link
Member

@plika I wouldn't surprise MSVS has that flag enabled hence @xgrommx was able to run though.

I've also made some additional tests and agree on enabling this flag for Chakra.

@obastemur obastemur self-assigned this Dec 30, 2015
obastemur added a commit that referenced this issue Jan 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants