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

Proposal for improvements of electron-edge-js #70

Open
Hammster opened this issue Nov 15, 2019 · 3 comments
Open

Proposal for improvements of electron-edge-js #70

Hammster opened this issue Nov 15, 2019 · 3 comments

Comments

@Hammster
Copy link

Hammster commented Nov 15, 2019

Hi,

I've been working with @peter-sabath on creating a new Pull Request with a list of improvements and bugfixes. and we had a few discussions about how to improve electron-edge-js and edge-js

Proposal

  • Merge electron-edge-js and edge-js into one library
  • Setup a CI (via github actions) and make use of prebuilds that are only distributed in the needed version currently you have to get all versions Packaging for Windows from Mac or Linux #20 Prebuild #64
  • Improve the code quality
    • Most scripts in /Tools are MS only and/or are outdated/not-working
    • Currently tabs/spaces, semicolons, quotes are over the place 🙂

Optional Proposal

  • Change the current JS codebase to TypeScript
  • Make the edge-{langname} compiler optional
    • Currently the package always pull in edge-cs as a dependency and this could be opt-in
  • Create some kind of chat channel discord/slack for the users and also to make it easier for users and contributors to communicate 😄

List of the changes we made:

  • BigInt Support [CLRnative/Mono]
  • Faster Marshalling [CLRnative/Mono]
  • Optional Object Converter Interface for [CLRnative/Mono]
  • Fixed Object/Field/Property visibility for [Mono]
  • Type Information Cache [Mono]
  • Fix for struct/property/field access [Mono]
  • Fixed Linting [JS]
  • ES6-ified the script [JS]
@Hammster Hammster changed the title Proposal for Proposal for improvement of electron-edge-js Nov 15, 2019
@Hammster Hammster changed the title Proposal for improvement of electron-edge-js Proposal for improvements of electron-edge-js Nov 15, 2019
@yongjias
Copy link

sounds great

@Hammster
Copy link
Author

Also, to boil down the actually code differences (Excluding scripts) from electron-edge-js and edge-js

It's these lines:

Probably just never got updated to .serialize() instead of toString()

Also appears to be a missing update

// needed because we *must* load the edgedll from the original location else we'll freeze up.
edgeDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(typeof(Edge)).Location);

This one should not be a issue after using prebuild

var versionMap = [
[ /^6\./, '6.5.0' ],
[ /^7.4\./, '7.4.0' ],
[ /^7.9\./, '7.9.0' ],
[ /^7\./, '7.9.0' ],
[ /^8.2\./, '8.2.1' ],
[ /^8.9\./, '8.9.3' ],
[ /^8\./, '8.9.3' ],
[ /^10.2\./, '10.2.0' ],
[ /^10.11\./, '10.11.0' ],
[ /^10\./, '10.11.0' ],
[ /^12.0\./, '12.0.0' ],
[ /^12.4\./, '12.4.0' ],
];

And this one seams to do nothing at all, there is no further checking and it would be forced into a not found issue when not set.

if (process.versions['electron'] || process.versions['atom-shell'] || process.env.ELECTRON_RUN_AS_NODE) {
edge = require(edgeNative);
}

@agracio
Copy link
Owner

agracio commented Dec 2, 2019

@peter-sabath @Hammster
First wanted to thank you guys for making this project better!
Have a few comments in no particular order or importance.

  • Not convinced about merging the code, electron-edge-js can be very finicky when using on with different Electron versions and systems, would be easier to troubleshoot.
  • Code cleanup is always welcome.
  • There is very little JS code in the project, don't think it should be moved to TypeScript (and I myself use Typescript exclusively) there is no need to add complexity.
  • Removing edge-cs dependency will disable C# support don't see how it could be an opt-in.
  • This line is actually very important for Electron process to work, although I cannot remember why right now.
    if (process.versions['electron'] || process.versions['atom-shell'] || process.env.ELECTRON_RUN_AS_NODE) {
    edge = require(edgeNative);
    }
  • There is already a Slack room for Edje.js it's on top of the original Edje.js README ;)
    Edge.js is now on Slack at https://edgejs.slack.com. Join here.

These are just a few random comments without going in depth.

Here is the most serious issue that I see with Edge.js in its current state: it is written as synchronous node native module making it impossible (at least to my knowledge) to make an async call to it from Node app. This results in complete UI freezes when using Electron app or running server side tasks in edge-js. From my point of view this is the top priority item that needs to be addressed but is very complex. Let me know if you have any ideas how it can be converted into asynchronous node module.

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

No branches or pull requests

3 participants