sciencefair
sciencefair copied to clipboard
Browserify all the things
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/
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 (:
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!
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.