679 points · by alanfranz · 10y ago · 393 comments
Our early prototypes of Nylas N1 were built on Angular in the browser, and then Adobe Brackets, but we couldn't really get it to a level that felt great and worked offline. It wasn't until we decided to fork Atom (the previous base of Electron) that we started breaking past the "uncanny valley" of wrapped webviews and discovered an application stack that allowed quick cross-platform deployment alongside native code modules.
After building on Electron/AtomShell for 18 months and seeing the community grow, I can definitely say there is something really special here. We've still got a lot of work to do on N1 (email is hard!) but we're confident Electron is the right platform for this type of extensible app.
A secondary reason we open sourced N1 was to serve as a reference implementation of a large Electron app. There still isn't a great resource for "best practices" when creating complex Electron apps with lots of moving parts. Now that we've hit 1.0, I think it's time to change that!
If you have a free afternoon, I definitely recommend playing around with Electron. It will likely change your outlook on the future of desktop software. :)
Can i use it as a basic Mail.app/Thunderbird alternative, without leaking my personal data to your cloud?
This allows the client to be thin, since it's only using the APIs and is shielded from the intricacies of dealing with mail protocols like IMAP and SMTP. It also allows Nylas to offer a single API that works across all your email.
https://support.nylas.com/hc/en-us/articles/217518207-Why-do...
Slow, with a 100MB node runtime eating up an entire CPU, piling hacks on hacks on React on top of the DOM, being dependant on Google's will to develop V8, written in JavaScript? That sounds like a pretty damn bleak future to me.
It's not ideal for some apps, but it's completely serviceable for most apps.
* Office being a behemoth doesn't give a right to other apps to be whales.
* 100MB is just the runtime. Then you've got your application running on top of that, using whatever memory you want. The C/C++ runtime is not 100MB.
* Those 7GB probably include examples, layouts, whatever. Actual content. As opposed to Electron apps which are rarely more than just pretty interfaces making requests to a server. (With some high profile exceptions, like Atom, VSCode, ... Although they do send data to outside servers anyways :^))
* The Office suite is infinitely more complicated than anything done with Electron. That means features, technical debt, everything.
* Office isn't running in fucking Javascript
You get 2 window bars, and 2 toolbars, nested in each other.
http://i.imgur.com/2C769ex.png
It might be "best practices" on Mac, maybe even on Windows, but it definitely looks out of place on Linux. Especially when compared to native Qt apps.
[1] https://github.com/nylas/N1/issues?utf8=%E2%9C%93&q=is%3Aiss...
Maybe detect the platform and use native icon packs when available?
Anyways it's amazing how good Linux have become that we could complain of such minor things ;)
Even Swing and JavaFX manage to make better looking, faster running, easier to code UI apps, which can be distributed smaller (the Java Runtime, thanks to Jigsaw, is smaller than the node+Chrome runtime of electron)
Incidentally, nice looking desktop! Which distribution is that, if I may ask?
The wallpaper is from http://imgur.com/gallery/dbELn
Thanks for the work you are doing here, I feel that Email is one area that could use a lot of work.
And you can read our blog post about announcing the pricing: https://nylas.com/blog/nylas-pro/
We haven't yet shipped the version which allows you to upgrade, but it's coming shortly.
Might be worth having a Pricing link/button next to download, and from the Free column, to the download screen.
Also, since the data is all in your cloud, would be nice to have a "web" version, so that I could use the app without needing to install. That would be ideal for me, a web-mail app that I can manage all my accounts from anywhere, even when I'm not on my home computer.
Just a few thoughts.
Electron is the cancer that is killing desktop computing.
It all started years ago with Firefox, whose interface itself was built using web technologies, in a "brilliant stroke." DOM, CSS, Javascript... maybe not HTML per se, but an XML substitute, and so on. I dare anybody say that Firefox's interface has ever felt as fast as IE, Chrome, Opera, or Safari (on Mac.) It never did and still does not.
Then someone at GitHub had the bright idea to take this "winning" concept and apply it to a developer's text editor, of all things! I still cannot fathom how Atom can have more than 3 users. Every time I've tried it, I've ditched it after 30 seconds. Slooooooooooow!
Fast-forward to 2016: now I see new Electron apps popping up every other day. Even something as simple as a text-only WhatsApp IM client, which could be written in a dozen of C++ files, is a bloated monstrosity that eats RAM for breakfast and contains an entire Node.js interpreter and a Webkit layout engine.
Cancer, I say!
Kill it with fire!
Perhaps the cancer is the fact the desktop development community has had decades to settle on a decent cross-platform 'native' toolkit and completely failed.
Perhaps the cancer is 'native' developers spouting 'native is better' hyperbole, ignorant of the fact these supposedly better 'native' toolkits have been web-influenced for a long time.
- XAML from C#/WPF land being strongly influenced by HTML and CSS.
- Android XML being strongly influenced by HTML and CSS.
- Qt Quick being strongly influenced by JS and CSS.
- GTK+ embracing JS and CSS3.
- Everything else being awful procedural C++. Good luck maintaining that.
And all have massively inferior developer tools than Chrome devtools and/or far worse abstractions for the scene-graph/tree of elements than the much-derided yet very powerful DOM.
Native desktop is a mess. I'm glad we're seeing Electron expose it for the joke that it is.
You can hate web dev tech, but you can't claim that native desktop options are better. I won't be building apps 3 times or using any of these useless 'cross-platform' dev kits anytime soon, when I can build the same thing in Electron in a fraction of the time, and leverage the undeniably huge JS and CSS communities.
Also very tired of seeing devs use weasel-words like 'bloat' and neglect to put it into any context, like the fact that on the desktop 1. it ain't bloat if filesize is cheap, and 2. said filesize is comparable to the most capable cross-plat options you're supposedly arguing for (see Qt Quick).
Edit: Softened, expanded.
HTML/CSS, and Chrome tools, are definitely the better part of the web. The really terrible stuff are the JavaScript APIs. Of course there's JavaScript itself, which is gross. But there's no APIs for basic questions: where is the mouse pointer now? And is the mouse button down? How many screens does the user have? What is the width and height of this text? [1] Or anything Unicode-related. Or any sort of precise, pixel-accurate drawing. Web programming means resorting to terrible hacks all the time.
Maybe Electron has its own JS APIs that fix those issues, I don't know. But compared to making a traditional web app, it's a relief to use a real desktop API that actually has coverage of desktop capabilities.
[1] See the ridiculous lengths Atom went to just to figure out how wide a character is: http://blog.atom.io/2015/10/29/atom-1-1-is-out.html
That may be true for WinRT, but I did not mention WinRT. XAML/WPF were around a long time before that.
> Same with the HTML/CSS-style toolkits.
Not sure what you're referring to but no, I don't believe that's true for the projects I mentioned.
Your complaints with JS APIs are warranted, but won't apply to 90+% of apps. Still seems like an overall win to use Electron/NW.js over any other option currently.
Probably you are underestimating how complex is to build a GUI for different platforms and also underestimating how much browser technologies have been improved integrating zillion of years of experience.
Also, you can't compare how easy is to develop a desktop UI with Windows Forms in Visual Studio to how difficult is to build an HTML UI.
Presumably you're getting at platform-specific differences. I'd suggest these are no longer as important as once deemed. Pretty much all desktop platforms are currently looking dated with respect to their mobile counterparts. So anything that looks 'modern' across all of them (e.g. good design + Electron) actually feels like sweet relief.
(If you meant something else, please correct me).
>> ... and also underestimating how much browser technologies have been improved integrating zillion of years of experience.
No, that's absolutely the point that I'm making. I'm suggesting browser tech is superior, largely due to the insane amount of engineering effort piled into it by Google et al.
>> Also, you can't compare how easy is to develop a desktop UI with Windows Forms in Visual Studio to how difficult is to build an HTML UI.
Yes I can, having done both :)
As it stands, it's not a great use case for many types of applications, but I would say that it's good enough for most of them. Beyond this, people are building useful things with it quickly. Far more quickly than they would be able to if they were targeting a custom UI platform, or with a lower level language like C/C++ etc. All this with the ability to relatively easily build for Windows, OSX and Linux deployments.
I don't mind people using XML based UI composition, as it works pretty well. Flex, XAML, and many other UI builders are XML based, simply because the structure corresponds well to the rendering hierarchy of components, and allows for easier understanding of their relative interactions.
I am half surprised there isn't a path towards a ReactNative for Desktop (OSX, Windows, Linix) at this point, that is similar to Electron, Node/V8 core, but with a common/reduced component set that just works.
It's worth mentioning that the underlying platform is C/C++ based with a very flexible UI kit (HTML) and a DSL (JavaScript + DOM) that is also flexible.
Not official though, but it's getting some use out there.
And then a user pointed out that Acrobat Reader can actually do that already [1].
HTML has been great to make the web great without microsoft attempt to monopolize it, but markup languages are useless as a file format you send across the internet.
Why? Because parsing text is, and will ALWAYS be slow. So either pre-parse html and put this in an OPEN binary file format, or burn it with fire.
Why can't investors and other developer take a damn hint that there is a reason smartphones use applications instead of web apps: html, dom, js, css all those things are slow and totally not well designed ! If you want to know more, start with that video that talks about the messy process that was HTML standardization https://www.youtube.com/watch?v=RH0o-QjnwDg
HTML is not a strict language, meaning it's EVEN SLOWER to parse.
Wake up sheeple (sorry that was unnecessary)
Native apps have a better foothold currently because mobile platforms had better support for their own native languages, than for sophisticated web runtimes like V8 at release.
If AT LEAST html would be a strict language like xml is, maybe that'd be better. But XML is not even human readable. YAML is.
i have not done so because i actually agree with you that desktop apps built on a browser are a pretty sad end-user experience, but the lure of honest-to-goodness "write once, deploy anywhere" is hard to deny.
It's fast as hell.
If not Electron, how should one build a desktop app for Windows today? It seems the correct way is to use .NET and WPF if you want to take Microsoft's word for it. I've done this and it's installed on on 100k+ machines. In my experience, WPF is horrifically slow for users and uses just as much or more memory than Electron.
With that in mind, I don't really see how Electron has any downsides at least on Windows, and has plenty of upsides: build apps that respond to input much faster using a more familiar set of tools (JS, HTML, CSS). No .NET dependency that makes the install process a nightmare. No need for a custom update component (always very complicated, even for a super simple one) since Electron can just load remote resources. No need to worry about Admin privileges. Better support for monitor densities. Much better text rendering. So many things. I think Electron is saving Windows desktop app development, not killing it.
All of that said, even WPF has been superseded by the Universal Windows Platform. If all I planned to target was desktop apps on Windows 10+ I'd use the UWP these days. UWP has very similar advantages to Electron. (I really like Electron, though.) You can use familiar sets of tools, whether it's HTML/JS/CSS or XAML/C# or even XAML/C++. (UWP XAML is somewhat faster than WPF, but still just as sensitive to making sure you have your application properly threaded.)
If you can take advantage of the Windows Store or the Windows Store for Business (yes, that is a thing for enterprises to take advantage of) you get incredibly easy installation and upgrade.
Even if you can't use either sort of Windows Store, since the Windows 10 November Update, installs and updates are simply a matter of double-clicking an app package (.appx file). Users get a UAC-like prompt about the install, but don't need Admin privileges.
UWP has really good support for monitor densities and text rendering as it's meant to support nearly every combination of monitor densities you can possibly imagine, including the "Continuum" example of running an application on one's mobile device, miracasting the mobile device to a nearby screen to get a "full desktop" and moving the app to that screen.
The present of Windows desktop app development is the UWP. I'd still use Electron for cross-platform apps, but as a developer I like the UWP too. (My Electron apps I'm building for code sharing with Cordova hosts as well, so in essence I'm in a "Why not both?" situation and expecting to release both Electron and UWP options. I could even see encouraging people to use the UWP app on Windows over Electron. That said, I'd love a little better convergence between Electron and Cordova and could even see a more Electron-like API for UWP JS...)
desktop is hell. if I have to choose between wasting your memory or giving in to apple or android excruciating and closed developtment cycle, I will kil your memory anytime.
A shared browser engine could replace all of Electron apps (wink wink Chrome desktop apps) only if we had it right when we started.
Burn them all down BURRRRRRRNNNNNN!!!
/s
Also, unbelievably faster in terms of developer time.
I think, because I spend a lot of time staring at text editor/terminal I really want it to look satisfying and pleasant to my eye. It is not main thing that decides, but definitely is up there.
On the Mac: Can an Electron app be scripted with AppleScript? Can it hand off to a mobile app using the Handoff API? How is the accessibility?
Windows has similar things with COM and Continuity. Can an Electron app play nice with these technologies?
In the peculiar Windows case, you can share much of your JS code with a "proper" UWP app as JS is a supported platform choice. With a bit of shim work you could even support almost all of the Electron API directly on top of the UWP.
I imagine that supporting AppleScript, etc, is a lot more common amongst developers that focus on MacOS vs developers that develop an application for three platforms.
Looks like it: https://github.com/electron/electron/pull/5352
I tried both Atom (ditched it after 30 seconds) and VS Code (tried to use it for a few days) but they cannot compete with a well-written native app.
However, it seems weird that when talking about mobile apps, the PhoneGap/Cardova "web wrapper" concept is derided as awful compared to native code or maybe cross-plat frameworks. From my anecdotal experience, those same people tend to think that Electron or NW.js are the greatest thing since sliced bread.
Electron is PhoneGap for the desktop. That's not necessarily a bad thing or a good thing, it's just a thing that makes sense in certain use cases and not others. The fact that web wrappers have different levels of "street cred" across mobile/desktop contexts feels more subjective than objective.
I suspect it's simply a matter of the younger crowd having more exposure to native mobile development, and little or no experience with native desktop development... so this discrepancy reflects those different comfort levels.
Yes, but mobile and desktop are quite different. For one, desktop has a lot more power - one of the biggest issues with PhoneGap etc. is that it's just slow, and, particularly, single threaded. That doesn't matter so much on desktop.
Also the other complaint is that PhoneGap doesn't use native UI components. Desktop has a huge variety in UI compared to mobile (think Microsoft Word vs Photoshop) - another "not native" format isn't quite as notable.
More importantly, though, is that developers hate PhoneGap and the experience it provides. I'd be interested to see the results of a survey where normal users are given a PhoneGap app and asked to point out what's wrong with it. I suspect many would think it's just fine. Not great, but fine. Similarly, if you asked anyone about the Slack desktop app I suspect they'd say it's fine.
Especially the latter is really puzzling to me.
Chrome (technically not Electron but it includes all the same problems) and Spotify gobble down enough power that I make a point of not using them if I'm away from my power cord.
Here I thought the gradual year-over-year percentage increases in battery technology were going to get us better battery life, but it turns out we'd rather just write shittier software.
There are also native modules for Electron/Node which can work in background processes.
In the end, for the most part, in most applications, there isn't much logic that actually takes advantage of multiple concurrent threads for logic, and I/O is already multi-threaded.
I agree with you with regards to multithreading, though. It seems like that is actually important on both the desktop and mobile for compute intensive tasks.
Electron is not native, and beyond that, there are too many variables cross platform for anything to look truly native everywhere even for a compiled C++ app without a lot of work. That said, you can definitely style to a platform more appropriately (again, there is work to that).
Precisely this.
Mobile devs care about their artisanal/bespoke/authentic Objective-C or Swift code, while no-one really cares about Qt, GTK or wxWidgets in quite the same way.
There's social cachet to be gained by coming out in favour of native mobile development, while the same is not true for native desktop development.
I do enjoy Visual Studio Code, Atom, Slack, and other apps built with Electron. Yes, people also use it to build horrible apps, but Electron has proven that it's capable of powering apps people love. I have yet to see a Cordova app people love.
TL;DR: I love various Electron apps. If I see an amazing Cordova app, I will reconsider my position towards Cordova.
This was already a ton of work. I shudder at the thought of having to have done this with 2 seperate native versions instead. I would have never shipped.
Electron has been the basis for several great applications though, just looking at their website[0] you can see a good number of apps that look and run great. Discord[1] and Gitkraken[2] among them, for starters.
The most relevant use case is getting away from different browsers.
You doing your web-app, make it responsive and give people who are like "We want to use IE5" an electron wrapper for the web-page.
Currently I am using Visual Studio Code, because it is one of the best IDE experiences for when I need to play around with Rust.
And being pragmatic, I rather enjoy the productivity of VS Code for Rust than being religious about it and losing the said experience.
Coming from native Mac OS X development, Electron is an breath of fresh air. There's an incredible amount of energy and momentum in the web development community these days, and things like Flexbox, ES2016, React, and ESLint make it possible to ship fast and iterate quickly. Who would have thought JavaScript would be achieving what Java/Swing set out to do in the 90's?
I've had a chance to work with the core team on a handful of bug fixes and new features, and they've been incredibly kind and welcoming. I think Electron will go far as an open source project, and I'm excited that GitHub is growing it beyond Atom.
If you're in the SF Bay Area and interested in learning more about Electron, there's a meet-up coming up later this month! http://www.meetup.com/Bay-Area-Electron-User-Group/
The energy and "momentum" in the web community is something that has been discussed extensively on HN and elsewhere, so I won't comment on that. Suffice it to say that motion is not always the same thing as progress.
For instance, I downloaded Atom and after starting it, it wanted to connect to atom.io and then Google analytics. Now Google not only knows which web pages one visits, but also which apps one uses. Electron is win/win - for web developers and Google, of course.
You practically have a window frame inside a window frame even! http://i.imgur.com/2C769ex.png
(Speed differences, the theming (dark theme for the whole UI, except for some electron apps?), etc are also issues.
I think lpsz said it best, "It's cool for developers. It's not cool for the users". I'd qualify that with "It's cool for web developers".
Neither is a text editor that can't show letters as fast as a person types.
* JavaScript-heavy Spotify now vs. Spotify a few years ago
* Atom vs. something like Sublime Text
* Or, Slack that takes the cake especially if you log in to multiple Slacks.
It's cool for developers. It's not cool for the users.
Electron apps don't appear to play nice with the underlying API.
Take Spotify and Slack, for example. It makes sense that it should expose its API via AppleScript (on Mac), COM (on Windows), and DBUS (on Linux). These let you do neat things like, for example, use a PowerShell (or bash or AppleScript) script to update your Slack status to the name of the track that's playing.
Whether you'd WANT that specific functionality or not is beside the point, the fact that the functionality exists means that people will do cool things with it. More importantly, it means that people will do things the developer never thought of.
Looking at Atom's API docs, for example, tells me that there's a very rich API that doesn't appear to be exposed in any way that's native to the underlying platform.
No, you're not. In fact, every time any link shows up on the Hacker News front page that has to do with using HTML/JS/CSS to build native applications the comments on it are usually dominated by people who are "unhappy with the trend toward web-wrapper applications".
> It's cool for developers. It's not cool for the users.
Here's the thing, if it's not cool for developers, then it might not even get built, and that's really not cool for the users. So if I had to choose between less performant code but more software options for users and more performant code but some software people really want or need not being developed, I'd choose the former.
There's a really high chance that you had another browser process open that was dedicated to writing your comment. Mobile included as the HA app is a Cordova-based solution.
But you feel compelled to say that thing that you used to accomplish your reading and commenting task was somehow slower and hogged your battery.
It got the job done didn't it?
Further, what's the #1 tech that some really smart people are focused on optimizing because of its usage. Yeah, again, the browser.
Show me another standards-based general UI stack that has had as much man hours dedicated to optimization... AWT/Swing/JavaFX? laugh. WPF, also really slow. WinForms? Not a lot of dev going on there at the moment.
So I get what you're saying, but the worst case is that your browser will do the same thing for each tab.
Software like Excel which will spawn a different instance of Excel for each workbook, even though it could theoretically be a single process... so it's not like native apps are a panacea in your argument.
Now we're talking about writing applications with web technologies for high specialized skill and high effort tasks, e.g., code editors, photoshop clones, etc... Which is what a lot of us are skeptical of. These "professional" applications are designed to reward a huge investment in muscle memory, if you are putting so much effort into learning an application, you don't want the return on that investment to be stunted by limitations in the technology the tool is built with.
How much emphasis is being placed on JavaFX/Swing/AWT these days. Not so much. WPF? Microsoft has said that "...we are not investing in any major changes to WPF"
There is so much effort being placed in HTML/JS optimizations by WK, Blink, Edge folks that it's hard to find another framework with as much emphasis placed on it.
List one that is MIT licensed...
Like Whatsapp App on Desktop you literally have a 60MB download and 200MB install just for a screen that is EXACTLY the same as the Web Version of Whatsapp.
While I dont expect all the apps are like CCleaner or the old uTorrent which is only a few MB in size, 200MB is just redicously large.
Ideally it should be run through webpack/etc and only a bundled, minimized version of the app is shipped. In practice some modules may have native compiled addons.
I'm working on an app right now and it ships at 247MB which is way too big.
release/darwin-x64/PlaySPLOM-darwin-x64/PlaySPLOM.app/Contents
107M ./Frameworks
12K ./MacOS
81M ./Resources
52M ./Resources/app/node_modules
a node module should be just runtime required code and LICENSE
Also, before packaging your Electron app use something like gulp to exclude problematic files like .md and anything else unnecessary.
There are other common tools like browserify that can still be leveraged.
EDIT - Ok, sorry, it seems quite a few people do have pretty horrendous bandwidth issues.
Also, Electron's size means more power draw. When I want enough battery life to do some work and still watch a long video afterwards, I habitually close Slack because it makes a worthwhile energy difference. The app's size reduces my engagement with the app after install. I'm aware my behavior is unusual, but developers do need to keep this in mind, especially as Windows and OSX make app energy use more transparent.
How do you make the link between app size and power draw (as opposed to some other aspect of Electron causing draw)? And, what are you comparing Electron's power draw to?
I think the following is a great narrative on why it can matter though: http://blog.chriszacharias.com/page-weight-matters
I agree on page weight, but somehow I'm more sympathetic to downloading apps, perhaps because it's just downloading in the background, rather than me waiting to read the content.
What does the order of magnitude really gain the end user? A slower, less powerful GUI system?
For non-web developers, there are already well-suited technologies to develop desktop applications: Swing, Qt, Cocoa, GTK, WPF/WinRT, and so on. Maybe theses technologies seem less sexy but there are here from the beginning to do that kind of job.
Please, use the right tool for the right job.
I don't see anything wrong with that statement, Electron really lowered the barrier of entry by allowing using HTML, CSS and Javascript to build cross platform apps, before you had to learn a new language to make it happen (Swift, QT etc).
> "Please, use the right tool for the right job."
I would rather use a tool that I know and build something functional fast, than spending many months learning new language just to make my app cross platform and losing interest because of that.
Electron tries to break the same barrier WebForms did but in the opposite direction. Hopefully it turns out better and doesn't result in a bunch of shitty desktop apps like WebForms resulted in a bunch of shitty web sites.
If you build something functional fast with your favorite tool (not suited for the job), then you will probably spend many months maintaining/hacking your codebase to keep it functional and well designed.
At first glance, Electron apps should be more maintainable, not less, because it's one toolset for multiple platforms, which should translate to faster development time and less total cost of maintenance at the tradeoff of app performance and size.
Also, whether an app is difficult to maintain ought owe more whether (1) you have multiple diverse codebases and toolchains to maintain, and (2) that you have a disciplined engineering strategy.
Again, whether or not Electron is the right tool for the job is a business decision based on business constraints.
Using web technologies to develop a GUI has been so much easier than learning a new toolkit, or even language. For one thing, some of the options you mentioned are OS specific. There are benefits to OS-native toolkits, but as a one-man team with a small project, the benefits are small and the time investment large. With Electron, I can build on Linux and release for Win/Mac without any concerns.
Qt is the best option of those you mentioned, and I considered it. But I was never great with C++, and learning a whole new markup language (or being tied to Qt Creator) for the UI was an extra barrier for entry. And I've often found that Qt programs don't look or feel right outside of Linux.
Personally, I find developing a UI on HTML/CSS/JS much easier than any desktop UI toolkit I've tried in the past. Updating the UI from the code, and calling code from the UI is s simple, because that's what it was designed to do. And having a browser console makes debugging and trying things so much easier.
I was never a fan of using JS for anything but websites before, but I decided to give Electron a try and I'm a convert. Perhaps there's enough of a speed difference between JS and native code that it would matter for more complex programs, but for my uses I don't notice a difference, thanks to the speed of JS engines now.
Maybe from someone that's starting with no coding knowledge would find Qt and C++ just as easy to pick up as HTML and JS, and certainly a C++ developer would find Qt a better choice. And sure, I don't expect anyone to be able to build Photoshop on top of Electron. But there are plenty of programs that aren't that complex.
While in theory I agree with not using the "new sexy technologies" for the sake of it, and "using the right tool for the job", I don't think that applies here. It works both ways, don't stick with old technologies just because that's what you're used to. What specific benefits do you get from using one of those toolkits for a simple desktop program?
The real reason you're seeing apps based on Electron these days is that it's easy to hire HTML/CSS developers. That doesn't mean these are good platforms though. I remember when the bulk of apps were being written in Visual Basic because it was easy to hire VB devs (lots of people learned VBA via MS Office).
You're right. They need to catch up to using 5.8 GB for Visual Studio and 480MB for IntellJ to start. :)
What about applications like Photoshop, Premiere, Cubase, Logic? Basically anything that does more than show a couple of editor panes. I'd love to see these kinds of things built in Electron but as far as I can tell this has not happened yet. In these areas languages like C++ and frameworks like Qt are still really really popular. Not to mention embedded development, of course.
That's the difference between toys and tools. Most of the popular applications are toys, and this saddens me a lot personally, because humanity is wasting the potential it has with all that cheap computing available.
> I'd love to see these kinds of things built in Electron but as far as I can tell this has not happened yet.
I don't see it happening any time soon. Web is not meant for serious tools. Compare Microsoft Office and Google's butt office suite. One is a tool, other is a toy that looks nice for simple documents, but is utterly unusable when your document/spreadsheet grows beyond more than a couple of pages.
I've seen many complaints about Spotify on e.g. Reddit - specifically about the fact that it's no longer native. Seen also many complaints about bloat and slowness in Atom & VScode.
I understand why this toolkit is chosen, but companies can only push so much before the customers also push back against the decrease in qulity.
Everybody can yell that Qt/Gtk or even the MS stuff is the better tool for desktop apps, it won't change anything.
There's 0 objectivity in the choice. The young boys just think in HTML/JS, so we'd better adapt :-)
It's not at all about how sexy a technology or framework is. I just think I can do a better job in a framework that's adapted to my skillset, instead of adapting myself to a new framework.
You used to be able to use Delphi or VB6 to make working desktop apps in very short times. I'm sure other will reminisce about other older desktop techs that were a breeze to use.
MS severely dropped the ball with WPF by making it have a very high learning curve just when javascript was really exploding. So not only was it easier to distribute web apps, they were cross platform and it was easier to make them too (although the massive pain of SPAs has changed that).
There was also Adobe Flash Builder that very briefly looked like it would be a competitor when Balsamiq was a big new thing, but it never really took off (only other thing I've seen use it is salesforce's SOQL tool). At that point everyone hated Adobe though, so it didn't have much chance.
Though interface builders help a lot, I've always had a problem building more dynamic interfaces through any of the native tools. React, for example, makes that a lot easier.
Try to stay at least a little bit realistic...
One thing is that React is the newest iteration of production-quality declarative UI management. Angular, Backbone, a lot of stuff came bdfore. And all that contributes to a mature understanding
That being said, I forgot about QT quick. That is also pretty powerful stuff. Though the web influence seems there ( correct me if the causality is wrong).
I ask because I quite like JavaFX. The developer/documentation website is fusty and old-fashioned looking, but the tech itself is just really solid. You can tell it's been made by people who have spent their whole careers doing UI toolkits.
Which part of Electron makes it wrong?
With Qt, just watch this 30 minutes presentation about Qt and HiDPI, while ok there are some parts which unnecessarily complicate matters: https://www.youtube.com/watch?v=2XPpp4yD_M4
The counter point to this is that ownership of the developer brand and distribution channel is which will always drive sales. I'm not sure which aspect is more important when planning a technology platform and revenue model...
One of the benefits of Electron is the updater system, which allows you to release updates pretty frequently. You could tie that to the paid user account and just innovate faster than people cloning your app!
Electron also uses a specific binary packing system (ASAR) to ship app code, so cloning is also a bit harder than just copying a bunch of JS files. https://github.com/electron/electron/blob/master/docs/tutori...
I know you can do that to some extent by minifying your JS code and I also know that no obfuscation or compilation technique is going to 100% prevent derivative works, but it helps a lot and it's a feature that many wish the Electron team would look into.
NW.js has it, but it's super hacky as it uses (abuses) the V8 snapshot feature to deliver the functionality, seriously degrading performance in the process.
We used Electron (well still called Atom-shell back when we started) for building Spectrum (https://www.devspectrum.com) which we charge per seat and it's been a great development experience and it's certainly performant enough to handle tons of local logging capture/filtering.
From what I am aware, in lower level (C++) development there are some definite strategies to "deter" piracy even at a technical level. Stuff that Urs (developer of u-He software synthesizers) talks about here, eg:
https://www.kvraudio.com/forum/viewtopic.php?f=4&t=400768&st...
Basically: A) Make the protective schemes as non-obvious as possible in a disassembler (obfuscation, making the copy protection part of some core routines etc.) B) Provide a few obvious "sweeteners" that "pretend crack" the software for a period, but then show a "whoops your copy is pirated here's a offer to purchase it" later. (EG: a time bomb.) This allows the crackers to get their 0 day warez thrillz, without actually truly cracking the program.
Of course, none of this is 100% insurmountable. That's not the point of this exercise. The goal is to basically make cracking the software a chore more beyond usual, and therefore, not worth the typical cracker's time.
I am not sure how one would approach this with managed software or web-wrapped software (although if you can run the copy protection in a native module, that would be the way to go.)
I have been going back and forth with Slack over their desktop client; on Windows when signed into 5 groups it uses 1GB RAM. For a rich-chat client.
And if you're thinking "But RAM is cheap these days" -- well yes it is, but by the time you've got 15 Chrome tabs open, a Jetbrains IDE and 3 VMs, plus assorted other software running, 16GB disappears very fast...
(Case in point - Windows Vista :P )
Just the other day someone had detailed that they have a business based on Delphi with some ancient database. Can't be rewritten, but it brings in revenue.
And quality-wise it's probably better than any alternative "cloud-based" solution they could buy these days.
Instead, please, can any investor just hire any computer science PhD (who eventually specialized in compiler engineering), and tell him to work on PREPARSED or COMPILED HTML, and make a browser module out of it, for the sake of speed and memory footprint?
PLEASE. I BEG YOU. DON'T EVEN TAKE CREDITS FROM ME. IT IS SO WE CAN SAVE THE WORLD.
Yes, there are a lot of tools like Swing, Qt, Cocoa, GTK, WPF/WinRT, but their development communities are much smaller than the javascript/web ecosystem. They also create enormous portability problems, particularly in an environment (especially in the business world) so heavily dominated by Windows machines.
This community is acutely aware of what happens when the barrier to entry is lowered and the development tooling improved. The tooling that Electron provides via Chromium is also something that should not be understated. Chromium's dev tools are remarkable and improving every day. Few other ecosystems, especially old desktop ones, have debugging environments as rich. The painting performance / profiling tools alone go to great lengths to keeping everything running at 60fps. Furthermore modern CSS layout engines like FlexBox give you an enormous head start on a notoriously difficult problem and is a joy to work with when you don't have to worry about browser compatibility.
I will admit, the getting-started cost of Electron is high. Shipping all of Chromium and Node is no small feat and frankly probably not suited for a minor utility. However once an app crosses even a modest level of sophistication the benefits of this environment are definitely worth it. There are also several specialized tasks that Node probably isn't suited for. Luckily, since you have full process control and the ability to compile native modules any additional specialized task can be run on the side.
The past 18 months working with Electron at Nylas have been some of the most enjoyable development experiences of my life. Much of the crap that frustrates people out of web development (compatibility issues) go away. Being able to build an app at the core of people's day-long experiences is deeply satisfying and something I'm indebted to the Electron team for.
If you're in the Bay Area and still have questions or are just curious, come join us at the Electron Meetup on Wed May 25: http://www.meetup.com/Bay-Area-Electron-User-Group/events/23...
I have to restart my computer every now and then in order to keep using Slack and Atom, because otherwise it lags so much. I don't know, I think I prefer UWP apps instead.
Maybe it's more of a memory leak thing that TypeScript doesn't have.
Here's the grunt task for Mac DMGs. The parent directory has a similar script for Windows and Linux (and lots of other utilities too). https://github.com/nylas/N1/blob/master/build/tasks/mkdmg-ta...
* Your can now make your web devs (HTML/CSS/JS etc) do your application development as well
* General popularity of web development is exploding
* There's no comparable free, permissive native framework. The closest thing is Qt and its LGPL. No one wants to touch the GPL.
No other language is in such a unique situation, so its wise for Electron to be JS centric moving towards the future.
So I think there are very good social reasons why JS "won out." Perhaps it was the weakness of the language itself that made it possible. It didn't seem like a threat in 2008.
tl;dr: Ubiquity is a feature. Implementation simplicity enables ubiquity by making it easy to port and easy to bring new people on board. Implementation simplicity also frequently results in technical inferiority, but it doesn't matter, because users would rather have substandard software that runs quickly on all devices they target than excellent software that is either slow or unavailable.
JS is a dynamically typed functional language. Not unlike Scheme or Clojure. It's long history has made the standard library be a mix of programming styles, but I usually make heavy use of Ramda or Lodash and other functional wrappers to get a coherent interface nowadays.
What was a mistake was including `this` keyword though. Never use it, just like you would never do so in Scheme or Clojure. Carthago delenda est.
The holy grail of web development has always been the ability to write web apps that can run across all popular browsers. I think many have been waiting for JS to be the language it should have been for so long now. Its seems the time has finally arrived and BAM! JS explosion.
JS is not bad at all (JS now that is), its an incredibly flexible language. This obviously annoys many as there are no hard and fast rules for development (framework hell anyone?) but as a language you can apply it to most any environment.
My first use case for it was making a dedicated Amazon Video client for my wife's laptop (although Nativefier doesn't have one of the necessary plugins) so we can have our regular Amazon accounts separate without switching credentials all the time. But I can think of a bunch more for this
https://blogs.s-osg.org/servo-the-embeddable-browser-engine/
The number of developers with the skills to build a native-quality interface using the web platform is hundreds of times the number of developers who ever learned XUL.
Using HTML and CSS for desktop UIs is a proven pattern now. Even Apple used WebKit views for iMessage on OS X.
1. Electron is not necessarily the best choice if all you want to do is "put your website in the Dock." In Electron, JavaScript on the page can do anything native code could do, like write to the filesystem unless you explicitly disable node integration. Just loading up your website inside an Electron window could be a disastrous security hole.
2. Electron apps run at least 50MB, and take at least 100MB of RAM. (Equivalent to one tab in Chromium)
3. JavaScript is single threaded. Node's event-driven / async design makes is a good fit for most things, but considers all work equal. You have to bend over backwards to do things that a nice threading abstraction would make easy (like Regexp find/replace in a huge directory tree. Atom actually spawns a separate process to do it so it doesn't consume the JavaScript process.)
Same example, 142MB is the footprint for VS Code. VLC is bigger.
Where is this "extensive resource usage" that people seem to be concerned about even apply to Electron? Metrics?
A similar paradigm would be to create a Chrome Packaged App, but you're going to still have the same resource utilization as another browser tab.
Is there an equivalent to this but with Python or C# ?
QT seems to be the other major cross-platform framework, but I've never seen one that looks good IMO.
Would be very curious if any fellow HNers could point to good alternatives (preferably C++ based, but as I allude to, I'd compromise by using something like Javascript if it meant a better real world outcome for the user).
Some of the imperfections I notice are:
* The options dialog has a lot of things that just look "different". The controls are native, but the way they're positioned, etc, clearly isn't. The Mac has a lot of common things, like which order the Yes/No/Cancel buttons would appear in a dialog box, that aren't done the same in AfterShot.
* Being a photo management/editing application, it naturally uses a dark theme that looks out of place everywhere. Adobe Lightroom and Apple's now-discontinued Aperture both do this. It seems to be a normal thing with this type of application.
* On Linux, the window decorations come from AfterShot, not from the window manager. It also has the Windows close/minimize/maximize buttons.
* On an old-enough Mac, the integrated GPU doesn't provide the OpenCL stuff that AfterShot requires. This causes it to crash at startup, whereas a real Mac application would tell the OS to fire up the discrete GPU.
* I seriously doubt that it exposes any of its API to AppleScript/COM/DBUS, but I haven't checked. I know that it doesn't register itself as a source for the system-wide photo browser on the Mac (as an example, Insert > Pictures > Photo Browser in Microsoft Word on the Mac will show your Aperture, Photos, and iPhoto libraries as whatever structure they have in that application, not just as files on disk).
www.meetup.com/Bay-Area-Electron-User-Group/
It always used to be argued (and maybe still is) that using the UI framework of the platform is preferable, but IMO the results of Electron apps I've seen look great, and I don't find them confusing to use.
The reverse seems to be true on mobile platforms, where people seem to be preferring native UI widgets and behaviour.
https://www.manning.com/books/cross-platform-desktop-applica...
Having built apps in both, my view is that if you want the tool that fits best with Node.js' conventions, Electron is closer to that philosophy. I say this because of the way that the Node.js contexts of the main (backend) process and the renderer (front-end) process are kept separate. This is different to the way that NW.js has managed to blend the Javascript contexts of both into one, which can lead to odd behaviour when it comes to apps that run with multiple windows.
In terms of momentum, Electron is definitely capturing the most attention and it looks like it will eventually become the goto framework for cross-platform desktop applications over NW.js, which is a shame because NW.js has been around for a while now and was the pioneer of being able to build desktop applications with Node.js.
Other than that, features pretty similar.
"The Slack Desktop apps are built using diverse technologies such as Electron, node.js, ES6, RxJS, C#, and Objective-C,"
We've been excitingly using Electron at Wagon to build SQL analytics tools. We're using Haskell + React + Electron as our primary technologies: wagonhq.com/blog/electron
The thing is, you won't notice how bad the situation actually is until your code base has grown. Performance can seem acceptable at first, when there's very little code to load and run. When your codebase inevitably grows, you'll start noticing slow start up times (> 10 seconds) and a laggy UI.
If you have to do any computationally intensive operation, you'll have to resort to cordova plugins because JS running in the UI thread is a non-starter.
In fact, _why released Shoes around 2007 and disappeared in 2009. To put this in perspective, Google Chrome and the 1st iPhone were released in 2008. The web standard mess (JS in particular) was only beginning to be untangled back in 2007. Maybe today's _why would have preferred to try and make Javascript more approachable rather than choose a simple language like Ruby and make it more powerful. I don't know.
At any rate, the trend for things like Electron is to become increasingly complicated to the point where it merits a mention in developers' CVs — as it happened with Rails and Node and countless other frameworks before. Hopefully at this point there are players with stakes high enough at making things accessible to push for an entry-level version of Electron. Maybe Codecademy or one of its cousins.