greenheartgames / greenworks

a node.js plugin to integrate nw.js/electron games with steamworks
MIT License
1.49k stars 154 forks source link

Loading non-context-aware native module in renderer #264

Open latenightgames opened 4 years ago

latenightgames commented 4 years ago

Hi there,

It's generating this on load now:

(node:6644) Electron: Loading non-context-aware native module in renderer: '\node_modules\greenworks\lib\greenworks-win64.node'. This is deprecated, see [https://github.com/electron/electron/issues/18397].

Not a problem yet, but I guess it will be in future? Judging by the info on the Electron issue link, this might be a really easy fix? Or might not? I'm really not sure.

latenightgames commented 4 years ago

Having had a bit of a look at the code, and judging by this example, getting Greenworks to be context aware shouldn't be too hard? It still works in the current version of Electron by explicitly setting allowRendererProcessReuse=false but that probably won't be true for long.

https://github.com/atom/node-keytar/pull/182/files

framerate commented 2 years ago

@Kruithne this seems breaking, any chance I can get admin access on this project? I can help maintain it since my game depends on it...

latenightgames commented 2 years ago

I realised that this isn't actually a problem, because you shouldn't be loading it in a render process anyway. It's much better to load it in the main process and communicate with it from any renderers with IPC.

framerate commented 2 years ago

That makes it a little better! I'm doing a big upgrade of all of my dependencies right now so I haven't got to fixing it over to use IPC.

That being sad, my offer to help maintain this project still stands! I've been using it about 5 years!

On Mon, Jun 13, 2022, 7:52 PM latenightgames @.***> wrote:

I realised that this isn't actually a problem, because you shouldn't be loading it in a render process anyway. It's much better to load it in the main process and communicate with it from any renderers with IPC.

— Reply to this email directly, view it on GitHub https://github.com/greenheartgames/greenworks/issues/264#issuecomment-1154652133, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAASEM5KRSPLPKDA63SW2HDVO7XXLANCNFSM4NZXTBLA . You are receiving this because you commented.Message ID: @.***>

patrickklug commented 2 years ago

Sorry if I misread this post but do you mean maintain greenworks itself?

There's been a long discussion with some other folks who wanted to reboot/take over greenworks here: https://github.com/greenheartgames/greenworks/issues/306

They setup a new repo here but it seems like it didn't get past the kick off talk:

https://github.com/greenworksjs/greenworks/issues/1

ceifa commented 2 years ago

Yes, it's better not to use node libraries inside the renderer process, but is also a pain to use the IPC api. If you want you can take a look at my project (steamworks.js) which is context-aware and still mantained.

latenightgames commented 2 years ago

I was just about to mention your project too ;) Although I don't find IPC any real hassle to use.

Kruithne commented 2 years ago

@Kruithne this seems breaking, any chance I can get admin access on this project? I can help maintain it since my game depends on it...

Why did you tag me for this? 👀

framerate commented 2 years ago

@Kruithne you were the most active dev on this and the PR linked is ~2 years old. I was hoping to get it merged/closed and you seemed like the most likely contributor to help (or to give me access to help).

Plus the new community fork wasn't linked anywhere I saw so I wasn't aware of it!

Thanks @patrickklug for the heads up, I'll take a look over there soon and see if I can help! Not sure if they need more help but more than willing to assist where I can!