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

Add Windows 10 version of Electrino #11

Merged
merged 27 commits into from
Mar 12, 2020
Merged

Add Windows 10 version of Electrino #11

merged 27 commits into from
Mar 12, 2020

Conversation

tht13
Copy link
Contributor

@tht13 tht13 commented May 23, 2017

Moves source into macOS and win10 directories.

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

@tbodt
Copy link

tbodt commented May 23, 2017

That's quite something...

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

@ninjaprawn
Copy link

ninjaprawn commented May 24, 2017

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
Copy link
Contributor Author

tht13 commented May 24, 2017 via email

@styfle
Copy link

styfle commented May 24, 2017

If this lands, it will close #6

@styfle styfle mentioned this pull request May 24, 2017
@frankhale
Copy link
Contributor

frankhale commented May 25, 2017

@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
Copy link
Contributor

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
Copy link
Contributor

@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
Copy link
Contributor Author

tht13 commented May 27, 2017

@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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor Author

tht13 commented May 29, 2017

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

@frankhale
Copy link
Contributor

@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
Copy link
Contributor Author

tht13 commented May 30, 2017

@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.

tht13 added 3 commits May 31, 2017 19:44
Clean up JSBrowserWindowInstance constructor
Add require and os modules to the Render API
@amilajack
Copy link
Collaborator

@tht13 @frankhale is this ready to be merged?

@frankhale
Copy link
Contributor

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

@norman784
Copy link

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

@tht13
Copy link
Contributor Author

tht13 commented Jun 10, 2017

@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

  • require(id: string)
  • process
    • platform
    • arch
    • versions
      • electrino
  • console
    • log(...args: string[])

Modules

  • path
    • join(...args: string[])
  • url
    • format( {pathname: string, protocol : string} )
  • electrino
    • app
      • on(event: string, cb: Function) -- supported events: ready, window-all-closed
      • quit()
    • new BrowserWindow({ width?: number[800], height?: number[600] })
      • loadURL(url: string)
      • on(event: string, cb: Fucntion) -- no current events supported, but implementation is there

Browser APIs

Global

  • process
    • platform
    • arch
    • versions
      • electrino
  • require(id: string)

Modules

  • os
    • platform
    • release

@willnode
Copy link

willnode commented Jan 3, 2018

Hi, any updates on this?

@jscherer92
Copy link

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
Copy link

styfle commented Feb 28, 2018

@jscherer92

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

@skoshx
Copy link

skoshx commented Mar 12, 2018

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
Copy link

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
Copy link

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
Copy link

skoshx commented Mar 16, 2018

@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
Copy link

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
Copy link

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
Copy link

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
Copy link

siwalikm commented Dec 5, 2018

Is this PR waiting on something?

@styfle
Copy link

styfle commented Dec 5, 2018

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
Copy link
Contributor

@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
Copy link
Collaborator

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

@paramaggarwal
Copy link
Contributor

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

@mika76
Copy link

mika76 commented Sep 11, 2019

Ping 🏓

@davidenke
Copy link

@mika76
pong

@frankhale
Copy link
Contributor

frankhale commented Sep 11, 2019 via email

@davidenke
Copy link

@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.

@amilajack amilajack merged commit 26d95f4 into pojala:master Mar 12, 2020
@frankhale
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet