sciencefair icon indicating copy to clipboard operation
sciencefair copied to clipboard

Browserify all the things

Open blahah opened this issue 7 years ago • 3 comments

If we browserify the code before running it in electron we get the benefit of being able to greatly reduce the final distribution filesizes, as well as increase performance using things like https://github.com/shama/yo-yoify.

Someone has walked this path successfully with electron apps before: http://maxgfeller.com/blog/2016/08/30/electron-browserify/

blahah avatar Mar 26 '17 17:03 blahah

We tried this with dat-desktop and stuff like require('fs') doesn't have a good time. Instead we're thinking of perhaps using the Electron shared object to init the choo state so we can bridge the event emitter + state from the window to the server process. This way it's possible to only browserify the client code which will lead to way less bugs. But yeah still need to try this out (:

yoshuawuyts avatar May 09 '17 15:05 yoshuawuyts

would be good to stay in sync on this so we don't duplicate too much - one option is to selectively browserify to get the optimisations and minification but keep whatever necessary referring to node/electron core. Assuming there's a way to do that!

blahah avatar May 09 '17 15:05 blahah

I think I've got the render process browserification mostly figured out (using @yoshuawuyts' ideas) - transform here https://github.com/blahah/electron-renderify.

Ideally though we can get this all simplified to the point where we can use bankai for it.

blahah avatar Oct 22 '17 19:10 blahah