Chakracore: Exposing new features by replacing chakra.dll with a ChakraCore build ?

Created on 23 Feb 2021  Â·  17Comments  Â·  Source: chakra-core/ChakraCore

I've got a special question:
Is it possible to build ChakraCore and replace chakra.dll on Windows to expose new features to PWA (and Edge Legacy)?
I've read there are only a fiew differences between Chakra and ChakraCore?
If it is: How could it be done?

Answered Question

All 17 comments

Certainly not with Edge. I don't know what PWA is.

To clarify on the difference between Chakra and ChakraCore:

ChakraCore is an open source javascript engine - previously developed and maintained by microsoft, now maintained by a small group of open source contributors.

Chakra was a closed source MS product it used to be built by taking ChakraCore and:

  • removing (via #ifdef) new/experimental APIs
  • adding (via #ifdef) various hooks for tying in directly with Edge and other windows Apps
  • adding additional private code (not in this repository and never open sourced) to do with connecting to the Windows runtime

I think the last version of Chakra was linked to ChakraCore 1.11. In theory a newer version of ChakraCore from our master branch could be built into Chakra with the right build flags BUT you'd need the additional private code or it's not going to run - as Microsoft never open sourced that I doubt you could get hold of it.

Well, thank you fore you quick response!
With PWA (Progressive Web Apps) I meant the js and EdgeHTML powered apps from Windows Store.
It's sad to hear that this will likely never be possible…

I suppose we could ask MS if they'd be willing to publish the private components of Chakra - I'd be surprised if they did AND they definitely wouldn't support it.

I think it would be worth a try!
It seems that MS is throwing away Edge Legacy completely and in my opinion it’s only a matter of time until they also replace EdgeHTML in PWAs completely with WebView2 (Chromium).
So this code wouldn’t have any use in not so fare future!

  • adding (via #ifdef) various hooks for tying in directly with Edge and other windows Apps

Do you know which constants lead to an activation of those else necessary components?

  • adding (via #ifdef) various hooks for tying in directly with Edge and other windows Apps

Do you know which constants lead to an activation of those else necessary components?

Anything behind NTBUILD including some stuff I deleted in these commits:
https://github.com/chakra-core/ChakraCore/commit/d1ae883b04bd1701f775e66414fb32f70a0a6f9b
https://github.com/chakra-core/ChakraCore/commit/befa2b30b8526ca0f36a63c3e229f965235db8d1
https://github.com/chakra-core/ChakraCore/commit/34092e04f74943fce0b1e033c75dceef4c3a858f

BUT it's useless without the private MS code and whilst we can ask, I think the odds of MS giving that out are quite low

CC @LouisLaf and @digitalinfinity

AFAIK, there has never been any movement toward open-sourcing chakra.dll, and I don't expect there to be any at this point. The way forward for MSFT to support new JS features will most likely be V8.

The biggest difference between Chakra.dll and ChakraCore.dll is that we removed the API between Chakra.dll and the rest of the browser (relics from IE days), because we wanted the ChakraCore JS API to be the public way to interface with Chakra. So there is no way to get ChakraCore.dll and EdgeHTML to work together...

Well, that’s what I „feared“.
Using API Monitor, I saw that practically every public API function (from chakra.dll) that was not starting with JS wasn’t available in a recent ChakraCore build…

Well, that’s what I „feared“.
Using API Monitor, I saw that practically every public API function (from chakra.dll) that was not starting with JS wasn’t available in a recent ChakraCore build…

The bulk of the underlying logic is there, but the build config is different and as mentioned there are private components we don't have. Without microsoft deciding to publish/open source the remainder of chakra this is a dead end - and it sounds like the answer is a "probably not" to that question.

Is this question asking specifically about trying to use ChakraCore in Legacy Edge? Or is it just in the interest of running ChakraCore in a web browser in general?

In first place, it's about giving EdgeHTML new features in sence of JS.
But the second proposed question would olso be very interesting: Is the remaining Api powerful and performant enough to power a modern web browser? (except the missing new JS specifications (es...))

Well, EdgeHTML isn't going anywhere from what we know. It'd be interesting to see how much work would be needed to drop ChakraCore in to replace KJS in KHTML (yes, old, but open and provably can be extended into a modern browser).

But the second proposed question would olso be very interesting: Is the remaining Api powerful and performant enough to power a modern web browser? (except the missing new JS specifications (es...))

ChakraCore should have most of what you need to run with modern browser. I did a quick hacky prototype that shim's v8 API (similar to the shim that enables node-chakra) and able to run Chromium with pretty good perf. Most of the additional code to wire up with any HTML engines deals with projecting the DOM into the JS context and memory management between the two sides.

Well, EdgeHTML isn't going anywhere from what we know. It'd be interesting to see how much work would be needed to drop ChakraCore in to replace KJS in KHTML (yes, old, but open and provably can be extended into a modern browser).

I'd love to see a project like this go ahead, I wouldn't have the time to contribute much (if at all) but would be happy to advise on how to work with the CC API as needed.

I would be very interested in this project, at the very least because it exposes the engine to more important JS use cases.

@curtisman would you be able to share your solution? Also, were there any attempts like this with WebKit?

Was this page helpful?
0 / 5 - 0 ratings