Closed techninja closed 9 years ago
FWIW: Found this in my travels regarding node-serialport & Electron -- https://gist.github.com/jedthehumanoid/a7f8278e0a37d259adca
Continuing on this front:
node
in the window context. Their detection logic never seems to consider that we could have both a window object, AND a module.exports.Proof:
This single stroke image will happily kill 0.9.5, AND the current draft of 0.9.6 in decidedly different ways, yet the Electron version after a day of work surpasses them both and prints it with gusto.
For us to switch from nw.js to Electron I think we need to:
Using Electron looks very promising and from what @techninja has said it seems much easier to develop with and has more features and better developed features than nw.js. I think switching to Electron will let us implement some features that are harder to implement using nw.js and are better implemented than nw.js.
Remember, you can make multi-level bullets by adding more spaces in front of them.
Responses:
gui
controls over, found a "close/closed" bug, somewhat blocking conversion, though I'd imagine I should probably just move back to a previous version, though the fix has been merged, so could likely wait for the next release. node-pre-gyp
can't handle the electron version headers, even though node-gyp
happily makes a headers folder for em, so you just trade out the stock io.js
headers for the electron headers that were downloaded by just renaming the folder and re-running npm install serialport
. This is very hackish, but works great on all systems so far. The bad news is you must remember to swap these headers BACK, or all your node-gyp builds are going to be for electron, and likely not usable on the console. After this, I'm going to place my priority on working in my polygonal shape buffering to once and for all handle smooth buffering by handing the work to another processor via web workers. And then at the same time probably bugging @docprofsky and @rogerfachini to see if they're still alive...
w00t!
Building:
Menus & Extras:
Installers (It gets complicated):
wine
for it, but I managed to hack the icon in after the main windows package build is complete.PATH
addition bits we don't need.app.getAppPath()
api call which fixes the fatal relative path issue all over the app, also it doesn't seem to need a new native build, so that's a BIG plus. Built apps now work wonderfully on Linux and Windows. I still don't have a Mac to run on as Sylvia is using the only one in the house. :cry: win_delay_load_hook.c : fatal error C1083: Cannot open source file: '..\..\..\..\..\..\..\..\..\..\..\..\..\Program Files\iojs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c': No such file or directory
I'm very happy either way on the installer front. Please go whichever way feels (easier + better) to you.
Cool. Will keep running with Squirrel then. If anything it tends to aim towards some very modern trends that learn from the last 20+ years of app installation that I believe have been sorely lacking in any improvement for quite some time.
Figured out the build issue (should have Googled it), fixed in the latest node-gyp 2.0.2 released 6 days ago. Gah, this bleeding edge stuff is crazy. Glad most of the rest of the community if getting on board! Will keep you posted as things keep moving :hamburger:
Awesome. :cat2:
Sigh, blocked again on windows installer builds, but that's fine, still lots more to do :) See https://github.com/atom/grunt-electron-installer/issues/39 for progress.
@oskay What should the app description be in the various app stores? This is the big flop of text on the app download page next to the screenshots.
Ubuntu Software Center is likely first step. I've got it under the "Graphics" category, with the tags "Arts" & "SVG"
I'm not sure that we're anywhere near ready for app stores yet...
DEB & RPM packages have the description as a minimum recommendation. This is what I have right now:
Software for drawing robots, and your friendly painting robot kit, the WaterColorBot!
See more about the WaterColorBot @ http://watercolorbot.com or
Fork & improve the project @ https://github.com/evil-mad/robopaint
I've mostly given up on the Linux package builds for now. Not only is it extra for us at this point, it's not setup cleanly for our current build structure, and very very little of the process is either documented, or easy to follow. I will push my work so far
Windows installer build update:
grunt build-mac
from the terminal, and everything else should be taken care of.codesign
and it can happen automatically as well, see config options here.window.parent
, which kinda works. Good news is we don't use node very much in modes though...With a bit more testing (ignore printing performance for now), getting windows install builds sussed, I'm going to call this issue closed and will submit a PR for both repos!
More good news: I spent maybe 30-40 minutes with @rogerfachini and we got him completely setup for builds on his Linux machine, and tested said builds with the bot plugged in on his Windows machine! Very good stuff, and proof positive we've got a good thing going.
I can (presumably) generate and sign code on my computer-- I'm less sure about my ability to hand off signing to other people. :P
You wouldn't, obviously. We would simply either put the public identity in the file and let the local signature authorize it (the codesigning would fail for anyone other than you), or we set everything up with environment variables. It kind of looks like Atom does this like that... with some other bits thrown in...
You tried the build above yet?
No, haven't run it. It turns out to not be simple enough for me to understand. There are additional unstated prerequisites for this to work.
Edit: I've spent ~1.5 hours trying to figure out how to build this, without hint of success. This is not the best way for me to spend my time on the project. If you seriously need me to compile this, please provide instructions.
Edit: Make that 2 hours. And whoever wrote the grunt instructions should be ashamed of themselves.
Hour number 3: success.
@oskay Oh dear, no no no. Crossed wires. I meant, I built the application for you to try :arrow_right: [Robo Paint Mac WIP Electron_v0.9.6.dmg [47.4MB] ](http://robopaint.tn42.com/RoboPaintMacWIPElectron v0.9.6.dmg)
Will follow up with clearer actual build instructions.
I admire your dedication, but you likely should have scoffed at my lack of documentation to make the build and walked away, or asked for clarity. :P
I'm not sure how required any of these things are, but this ensure a clean and proper build as far as I can tell (for Mac):
npm install -g grunt-cli node-gyp
(shouldn't require sudo as previous versions did, saves in user space)which grunt
and it'll tell you.git clone https://github.com/evil-mad/robopaint-build.git
, then cd robopaint-build
, git checkout electron
npm install
grunt build-mac
in that same placeout/Robopaint-darwin-x64
, and a (almost) final dmg in out/RoboPaintMac_v0.9.6.dmg
Pretty straightforward, I think. I mean, you did eventually figure it out? :P
I did figure it out eventually. However, using node not io.js.
Really not working now, after switching over, trying those instructions. npm install is throwing buckets of errors at me.
Feh. Removing node may NOT have been clean, I have yet to do that on a mac. Paste in some of your errors, should give me a clue as to what's up.
$ npm install
> fs-xattr@0.1.6 install /Users/oskay/Documents/DIY/Project_WaterColorBot/RoboPaint_Release/electron/robopaint-build/node_modules/grunt-appdmg/node_modules/appdmg/node_modules/fs-xattr
> node-gyp rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 response downloading https://nodejs.org/dist/v2.4.0/node-v2.4.0.tar.gz
gyp ERR! stack at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:251:14)
[...]
I've rolled back to node, and it's working again.
The 2.4.0 version is io.js, not node, which is why that's failing. My guess is it's not easy to uninstall node on mac. I guess running it on node is fine, though I've been told it's "not recommended", I suppose it doesn't matter unless you're upgrading the native modules :P
So!
build-mac
grunt task really just runs these three tasks in order pre-build
(gets the files), electron:macbuild
(packages the app) & appdmg
(puts it all in the DMG with icon and background and such), so if you need to you can do you own thing in between.So far as I can tell, I did manage to uninstall and unlink node, and then install and link io.js, and started with a fresh copy of the repository, too. Still, something is very screwy.
DMG looks nice. It launches OK, but I haven't had a chance to try much-- too busy wrestling with the other stuff. I may get a chance later tonight.
I appear to have figured out what needs to happen to make the Squirrel Windows installer actually compile. It involves some very crazy rejiggering of how node works, but it's automated and after the build, so I'm not too concerned. Will update their issue queue and move on to the final phase of this ticket: Testing for electron specific bugs!
It should be noted that the current electron app for Mac is currently programmed to not close the application when the window is closed, "to better act like every other mac application", but I'm beginning to feel that since this is a single window app, this doesn't quite make sense.
@oskay do you think we need something better than just a quit menu item for mac for next release? or should we just avoid the extra work?
A "first class" Mac app should only use the mac menu bar for its functions, never internal menu bars.
That said, it would be good to add:
Launch and context-switching are both MUCH faster in the new version.
I do not know what stage signing has to take place at. In previous builds, I've signed before packaging in the DMG.
I never said anything about internal menu bars, I was referencing my earlier comment about Electron's over the top menu API and it's capability to handle basically anything we need... They can even be dynamic to the given mode. I'm sure that's a feature issue of its own of course.
I'll add the minimum menus given with default shortcuts and we should be in good shape. Bonus for this build system: as I update the electron branch, you can build locally and test any code branch as long as it's pushed :)
@oskay Forgot to ask... do we want to do Windows code and installer signing? Big benefits so says the Atom team. Might cost money. >> https://msdn.microsoft.com/en-us/library/windows/hardware/hh801887.aspx
EDIT: In addition, new to Electron, we have 32 and 64 bit builds, meaning that my Windows builds are by default 64bit. Do we want to offer both? All new Windows machines are shipped as 64bit, though that's likely only in the last 5yrs or so. Good news it should be relatively easy to extract the native build file, and the rest is another few lines of grunt config :)
I'm not sure that I understand the different "dashboard service" options mean, but I'm pretty sure we're not doing LSA or UEFI, which means that a standard certificate about $90/year would work. We could do that.
From what I can tell, even windows 10 (yet to be released!) supports 32-bit. We... probably should as well. :(
Just rolled the native builds for 32bit (thx VirtualBox!), and integrated it into the build scripts, and successfully used the installer and ran the app from the 32bit VM! Apart from code signing, looks like it's small bug mop-up from here on out.
Everything else that's wrong appears to simply be things that were already wrong. So that's.. good. Fills are "broken" as they use the "nextTick()" solution, that very successfully BLOCKS anything else from working while they're filling the buffer. This will be fixed first thing after Electron is done.
With that, I'm going to submit the PRs, and unless anything else comes up, will merge these into master (with updated contrib readmes) sometime in the next few days! WOot.
Awesome-- I've scheduled some time for basic tests on Monday morning.
Bug in 0.9.6 (as built by me two days ago): The "park" block (in Scratch) does not seem to function.
It does work in 0.9.5, and the Park function within RoboPaint does work.
Snap shows an error when you try to run the park function (screenshot attached).
Wacky. :pineapple: Will take a look at it after Pancake work tonight.
Yea, totally missed that one! I haven't written automated tests for use as a node module (as RoboPaint does) yet, it slightly changes the interaction "surface" to work better/faster, but obviously still a few bits to be tested. this should be fixed now, just rebuild and it should grab a brand new copy of cncserver and park will work.
Alrighty, this seems done with. We're merged and pretty happy, now on to the real problems :)
Over the past year and a bit our dear glorious foundry of free source control hosting Github created a code editor, Atom, intended to be a desktop application for all to use, while still using web technologies to render it! Sound familiar?
Anyways, they experimented with nw.js (node-webkit), tossed it, tried some other things, then made their own thing the called "Atom-shell", which eventually became the aptly named Electron.
It claims to come stock with:
Which is a lot more than nw.js seems to go for, not to mention it's got backing from Github, and a number of platforms have already jumped on the boat (Spark, Microsoft, Atom (obviously), etc.).
Now it's not all sunshine and rainbows: It does work differently, and would likely require some code changes, but other than that It's likely 99% of the codebase could remain untouched, and might even get numerous speed boosts. What's good for Atom is good for github, and in turn, good for anyone on the shell platform. Intel is apparently the one funding the show over at NW.js, and suffice to say, though they've been gaining a version a month, I've not seen stability or speed do much more than waver.
So, perhaps I put it to a vote? Is it worth it to skip out on NW for big backers, better native support and automatic updates without a whole lot of extra work? This is the discussion thread.