p5.js-editor icon indicating copy to clipboard operation
p5.js-editor copied to clipboard

Possibly move from NW to Electron

Open brysonian opened this issue 9 years ago • 7 comments

I'd love to hear some input on the idea of moving the IDE over from nw to electron I'm by no means an expert on this, but i get the feeling that NW is falling behind a bit, and electron is really getting put through its paces between atom and stack that maybe it'll make things a bit easier down the line. Also to be clear, this is motivated by some tests to build a tool to wrap a p5 app into a native shell for distribution and it seems that whatever we use to do that should be the same as what is used to build the IDE.

brysonian avatar May 31 '15 04:05 brysonian

Hi - totally open to the idea, and agree that electron has more momentum right now. When I started the project nw was more mature than electron (which was called atom shell at that point). Not totally sure how hard it would be to port over but it's definitely worth investigating.

antiboredom avatar May 31 '15 17:05 antiboredom

+1 for putting this in the long-term plan. Seems like electron will be more future-proof, and much better documented! I'm finding that I have to do quite a bit of source-code digging just to figure out some basic stuff in NW.

andyinabox avatar Jun 17 '15 11:06 andyinabox

I love Atom, easy to use, easy to add packaes, loots of cool features.. it would be a killer p5 companion.

GiorgioMartini avatar Oct 28 '15 09:10 GiorgioMartini

Hi,

I set myself the task of making an app in Electron over the Summer and this seemed like a good project to work on with a head start in the logic so I've been working on a port to Electron.

I thought it would be pretty painless but turned out to be quite complicated given the completely different architecture of Electron and the process model.

Anyway I've taken a stab and I think the core functionality is pretty much there. The branch is here: https://github.com/davejm/p5.js-editor/tree/electron-port and there are some notes on the conversion here: https://github.com/davejm/p5.js-editor/blob/electron-port/nw-to-electron-conversion-notes.md.

I based it off an electron vue boilerplate which is linked in the notes. Currently, I'm going to have to take a break from it but it'd be great to finish!

I'm happy to answer any questions and hopefully it can be of some use to the p5js editor project if you want to head in the Electron direction.

Thanks @antiboredom @lmccart

davejm avatar Jun 17 '16 14:06 davejm

So I thought about looking into this as well. For example there's already an atom HTML panel which works to some degree

p5+atom

It would be relatively easy to fork one of autocompletors and make one specific to p5. (I think that already exists actually)

Serving folders from atom/electron for assets etc is literally like 5 lines of code, at least to get started.

const express = require('express');
const app = express();

app.use(express.static(pathToFolderOfFilesToServe));
app.listen(3000, function () {});

which really means the question is what do really want the UX to be? Atom is a powerful editor but that power might also be intimidating. Lots and lots of options unrelated to p5

greggman avatar Jun 19 '16 14:06 greggman

@greggman I see, so you're not talking about Electron but Atom's pugins? I think an atom/sublime plugin would be pretty cool - could include a build system script, auto-complete etc. Although I think having a separate IDE has its benefits for simplicity.

davejm avatar Jun 19 '16 14:06 davejm

Either way. It seems like it would be easier to take a full fledged editor and then hack it to be your IDE than to start with nothing and try to build an editor.

So I'm not suggesting taking Atom as is, rather it might be a good place to start to create a p5 IDE. In fact it might be as simple as just taking Atom, adding a few existing plugins and then adding one more custom plugins to remove/hide any features unrelated to p5 and add a few simpler p5 menus.

greggman avatar Jun 19 '16 16:06 greggman