zalmoxisus / crossbuilder

Building web, Electron, Cordova and Chrome apps, and cross-browser extensions with React, Redux and Webpack. "Write once, deploy everywhere" concept in practice.
MIT License
484 stars 50 forks source link

Proposal for electron-redux #22

Closed gurkerl83 closed 8 years ago

gurkerl83 commented 9 years ago

Hi, first of all browser-redux sounds like a working concept which allows state synchronisation throughout multiple sandboxed environments such as content and background scripts in the browser. Electron has a similar structure which separates main and render aspects. Unfortunately Electron does not support chrome API`s so a direct reuse of browser-redux and the underlying libraries such as crossmessaging is not possible. On the other hand Electron implements a nice IPC and remote - require concept which would allow a port of browser-redux. Note: N1 implements a action-bridge which is backed by Electron IPC allowing to dispatch Actions within a window, global and work environment scope.

https://github.com/nylas/N1/blob/master/src/flux/action-bridge.coffee

Thanks

jhen0409 commented 9 years ago

Great idea, but maybe you can first proposal to @chentsulin's electron-react-boilerplate. :D Although I think this is different purpose, maybe we need to create a new repo.

zalmoxisus commented 9 years ago

Hey, @gurkerl83. I plan to add support to Electron similarly to Chrome apps, and even tested that a bit. We use chrome messaging only for communicating with content (injected) script, which is the case only for extensions. We do not use it even fro Chrome apps. I do not see any problems for supporting Electron, we may even use a main store as for extensions and implement it through remote.getGlobal, though I'm still not sure we need it there unless we have several windows.

I'll look into the N1 example, the boilerplate suggested @jhen0409 is awesome, I played with it before.

zalmoxisus commented 8 years ago

Implemented in 0.6. Also, we have an example of building apps only.