klarna / electron-redux

Use redux in the main and browser processes in electron
MIT License
743 stars 94 forks source link

Does not work with electron 14+ anymore #317

Open Treverix opened 2 years ago

Treverix commented 2 years ago

The module can't be used with electron 14 or higher. Electron 14 has no remote module anymore, we need to use @electron/remote instead, but the library still depends on the existance of electron.remote.

The alpha version also seems to be affected, at least I can't find @electron/remote listed in the package.json.

Uncaught TypeError: Cannot read properties of undefined (reading 'getGlobal')
    at getInitialStateRenderer (C:\...\node_modules\electron-redux\dist\helpers\getInitialStateRenderer.js:11)
Treverix commented 2 years ago

https://github.com/klarna/electron-redux/pull/314 seems to fix it. The ipc channel name there should probably be changed to some UUID or get-redux-state-<shortuuid> to further reduce the risk of channel name clashes, just in case a user has a channel with the same name already (also electron will report an error, if a channel is created twice for the same name)

seanmacisaac commented 2 years ago

We use electron-redux and would like to move Electron >= 14, any update on this issue?

Treverix commented 2 years ago

@seanmacisaac - it works with the 2.x version. I migrated my project and I'm on electron 14 since a while (with electron-redux)

caligo-erik commented 2 years ago

@seanmacisaac - it works with the 2.x version. I migrated my project and I'm on electron 14 since a while (with electron-redux)

Does the electron-redux usage change? I tried to upgrade to version 2 (alpha), and none of the usual functions can be found:

matmalkowski commented 2 years ago

Yes, the API has changed (hence this is breaking version update) - You can see examples how to use new api in the examples / tests

caligo-erik commented 2 years ago

Yes, the API has changed (hence this is breaking version update) - You can see examples how to use new api in the examples / tests

Thanks! I did check the examples and tests at first, but I had forgotten to change the branch from master to alpha. :D I'll look into this tonight.

vitordino commented 9 months ago

hey, i was also interested on react-redux but the fact that it wasn’t being maintained nor compatible with latest electron versions motivated me to write a really thin library that could replace it (started from scratch, so it didn’t made much sense to back-port it to here)

it’s called reduxtron and i’ve just wrote a blog post about the journey and my motivations behind it

caligo-erik commented 9 months ago

hey, i was also interested on react-redux but the fact that it wasn’t being maintained nor compatible with latest electron versions motivated me to write a really thin library that could replace it (started from scratch, so it didn’t made much sense to back-port it to here)

it’s called reduxtron and i’ve just wrote a blog post about the journey and my motivations behind it

I will definitely check it out.