pojala / electrino

Desktop runtime for apps built on web technologies, using the system's own web browser engine
MIT License
4.39k stars 101 forks source link

Add Windows 10 version of Electrino #11

Closed tht13 closed 4 years ago

tht13 commented 7 years ago

Moves source into macOS and win10 directories.

Adds win10 UWP implementation using Chakra JS engine. Matches original Hello World implementation for API features.

tbodt commented 7 years ago

That's quite something...

Is there any shared code between the Windows and the Mac version currently?

ninjaprawn commented 7 years ago

I'm currently working on a reliable solution with having shared code between platforms (a.k.a. making macOS allow C++ objects into JSC). From this PR, I don't believe so

tht13 commented 7 years ago

No, you can't run objective c in Windows unfortunately, the windows side is all c#.

On Wed, 24 May 2017, 00:00 Theodore Dubois, notifications@github.com wrote:

That's quite something...

Is there any shared code between the Windows and the Mac version currently?

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pojala/electrino/pull/11#issuecomment-303556467, or mute the thread https://github.com/notifications/unsubscribe-auth/AAx4cLEk6Vx4V1MJ21z9K4tZOzCrcD-4ks5r82UHgaJpZM4NkNO7 .

-- Regards, Thomas Townsend +47448960

styfle commented 7 years ago

If this lands, it will close #6

frankhale commented 7 years ago

@tht13, I noticed the object being passed into the BrowserWindow constructor in main.js is not currently being used on the C# side of the BrowserWindow class. I was trying to figure out how to convert from a JavaScriptValue to something usable in C# but am coming up empty. I've been digging into it for well over an hour. Do you have any tips you can provide in order to convert a JS object to a C# dictionary or something similar?

frankhale commented 7 years ago

Actually I'm good, found a way to convert the JS Object being passed into the BrowserWindow constructor. The following blog post has details on how to convert the JS Object: https://www.microsoft.com/reallifecode/2016/06/02/hybrid-apps-using-c-and-javascript-with-chakracore/

frankhale commented 7 years ago

@tht13, this is awesome. Thank you! Question, this code runs fine in debug mode but it fails in release and I have tried for hours to figure out what is failing but I'm at a loss as to what since there is almost no information available in Visual Studio to tell me why. I am pretty new to UWP apps so I may be missing something obvious. Do you know why this app is failing in release mode?

tht13 commented 7 years ago

@frankhale I've tried it myself now and am unsure why it will not work in release. Unfortunately console printing isn't available for UWP apps in release mode. Possibly it has to do with reading the main.js file but that is pure speculation right now.

frankhale commented 7 years ago

Okay I can get Release mode to work if I change the configuration and select "Define DEBUG constant". I'm trying to find the offending code that is causing the issue. I thought it might be all the Debug.WriteLine and Debug.Assert function calls but it still seems to fail somewhere in release mode.

define_debug_constant

frankhale commented 7 years ago

Okay I stand corrected. The reason why it works in Release when the Debug constant is defined is because of the Debug.WriteLine and Debug.Asserts. I took my time removing them this time and it will work in release mode without debug constant being defined if those are eliminated. =)

We probably need to put all the debug stuff behind conditionals so it won't get compiled in during release mode.

tht13 commented 7 years ago

The latest commit swaps asserts for exception throwing and wraps Debug.Writeline in compile conditionals.

frankhale commented 7 years ago

@tht13 will you turn on issues for your fork so I can ask some questions. I have another patch I'd like to submit but I'd rather discuss before I do.

tht13 commented 7 years ago

@frankhale I have enabled issues and added you as a collaborator so you can push to local branches rather than requiring a fork. I have made master protected though.

frankhale commented 7 years ago

Okay thank you. I'll formulate my thoughts and post a issue about a patch idea I have.

amilajack commented 7 years ago

@tht13 @frankhale is this ready to be merged?

frankhale commented 7 years ago

@amilajack @tht13 is really the one to ask here.

norman784 commented 7 years ago

@tht13 maybe you can ask @pojala to become collaborator for windows platform in this repo

tht13 commented 7 years ago

@amilajack If you guys are ok with the changes to the folder layout, under Electrino there is now a win10 and macOS folder. It does not have the API for dock icons which @pojala added yet but apart from that is feature equivalent.

Supported APIs:

Server Side

Global

Modules

Browser APIs

Global

Modules

willnode commented 6 years ago

Hi, any updates on this?

jscherer92 commented 6 years ago

Sorry, new here but wouldn't instead of writing these systems in two possibly three separate languages for each platform, why don't we use a modern language like Go or Rust? I would be happy to create a PoC of using one of these that would run on both platforms.

I might just do it for fun but I think this may be a better approach for reusability plus common code base

styfle commented 6 years ago

@jscherer92

This project is basically unmaintained but the demand for a solution remains. If you can build it, they will come.

skoshx commented 6 years ago

Is @pojala still working on this? Or why isn't he merging this pull request?

The need for a more lightweight alternative for Electron is super high, and so it would be a shame to see a project like Electrino halt development.

norman784 commented 6 years ago

my thoughts are that @pojala is not interested in the project anymore, because he isn't replaying anything, so I think will be better that someone that is really interested in the project fork it and then leave a commend somewhere to redirect to the users to his fork.

jscherer92 commented 6 years ago

I'm currently looking into trying to attach to the ChakraCore without using C#. I would like to see cross platform code written instead of this language used for this platform and another used for another. I am also working on a couple other projects so if anyone else is interested should probably pick it up.

But, I'll still keep pressing forward with my research on this.

skoshx commented 6 years ago

@jscherer92 Interesting stuff. You should fork this repo so others could also contribute to development. I have also been thinking about implementing Electrino using a cross-platform language like Python but I haven't looked into that so much so I'm not at all sure if it's doable... Would like to see your fork tho :D

norman784 commented 6 years ago

I think C or C++ will be better for cross platform development, also C and C++ are compatible with C#, Swift, Obj-C and vice versa, so you could end using the official sdks of each platform.

jscherer92 commented 6 years ago

So not to hijack this thread but I have been working the past couple days to wrap my head around the windows side of things. This weekend I plan on getting the windows side in a very basic state.

I agree on using C/c++. I was trying to use Rust but even trying to use bindgen was a pain because of the windows headers being fairly hard to get to and understand. I will either fork this project or start up a new one and use concepts from this one and another that I found

I am relatively new to the GitHub community so bear with me while I get acquainted with everything but I may make a final thread linking the new project by the end of the weekend.

jscherer92 commented 6 years ago

So final hijack of this thread, but I have started on the new project. Currently it just initializes a window and prints hello world from a Chakra instance run script. Doesn't look like much but I'll be maintaining it. Https://GitHub.com/jscherer92/Quark

Thanks and I hope to see some of you there!.

siwalikm commented 5 years ago

Is this PR waiting on something?

styfle commented 5 years ago

Is this PR waiting on something?

Yes, its waiting on an active maintainer who is willing to engage with the community.

You might try an alternative project here: https://github.com/styfle/awesome-desktop-js

frankhale commented 5 years ago

@styfle Muon should also be added to your list. It's a fork of Electron that the Brave browser uses:

https://github.com/brave/muon

amilajack commented 5 years ago

If this PR is ready, I can merge it. Sorry for the delay on this

paramaggarwal commented 5 years ago

@amilajack Please merge it. Any further fixes can be taken up as separate PRs. Right now this project needs momentum.

mika76 commented 5 years ago

Ping πŸ“

davidenke commented 5 years ago

@mika76 pong

frankhale commented 5 years ago

With Edge moving to Chromium I think it’d be hard to make a case for this over Electron.

Also one may want to look at Carlo for a lightweight Chromium rendering solution.

On Wed, Sep 11, 2019 at 04:05 David Enke notifications@github.com wrote:

@mika76 https://github.com/mika76 [image: pong] https://camo.githubusercontent.com/60c350b904400676333895678838e4ea424df2d5/68747470733a2f2f7374617469632e7370696365776f726b732e636f6d2f7368617265642f706f73742f303032322f353934322f466f727265737425323047756d70253230706f6e672e676966

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pojala/electrino/pull/11?email_source=notifications&email_token=AABONSRULLPPYOHG2G2EJYDQJCRE3A5CNFSM4DMQ2O52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6NUPKA#issuecomment-530270120, or mute the thread https://github.com/notifications/unsubscribe-auth/AABONSXS3CCB7UPUENNYII3QJCRE3ANCNFSM4DMQ2O5Q .

davidenke commented 5 years ago

@frankhale yes, but if the adoption rate from Edge to Edgium is the same as from IE to Edge, the features of this PR would last for decades. Besides that Carlo requires Chrome only locally and does not target Firefox or other minor vendors.

frankhale commented 4 years ago

People might want to look at Web Window as well https://github.com/SteveSandersonMS/WebWindow