Skip to content

Instantly share code, notes, and snippets.

@bryfox
Created April 25, 2018 13:53
Show Gist options
  • Save bryfox/52e0885deac0c281b85d72e49cda492c to your computer and use it in GitHub Desktop.
Save bryfox/52e0885deac0c281b85d72e49cda492c to your computer and use it in GitHub Desktop.
Notes on workflow, etc. for electron apps (Network Canvas)

Dev workflow

The approach I use is documented in the readme. I develop from electron, rather than standalone server + browser (though the latter is still supported for work not requiring IPC.) It's working well enough that I haven't rushed to implement webpack/livereload.

  • main is still copied, not webpacked.
    • Webpack + HMR is still on my TODO list. (It's possible, but I haven't finished. Though should be easier without a separate worker process now...)
  • ...So changes to main require restarting manually.
    • On the plus side, 'build' is effectively just a cp -R, and startup is reasonably fast
  • I haven't felt the need yet, but you can install react & redux devtools extensions in electron if desired. That's the only thing missing vs. browser dev, IMHO.

Security

Animation/UI

  • (probably not relevant to architect?) recharts doesn't really work inside a grid layout, I'm hoping they fix it before I get there.

Electron configuration (excl. Security issues)

  • I found working with native menus a lot easier than trying to build everything into the UI (a la NC) — keyboard shortcuts work automatically, for example
  • native D&D 'just works'; architect may be able to use it?
  • IPC is used in a few cases to coordinate native & web. If it gets any more involved, I'd consider reintroducing sockets to replace that part of it (but still haven't seen a use case for device API)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment