#electron

    Deploying Electron
    February 23, 2016 | Matt DeLand

    Electron makes it easy to write cross-platform desktop apps using web technology— but how do you build and deploy these hybrid apps in production?

    At January’s Bay Area Electron Meetup, we presented how Wagon builds and delivers new updates to our users. This talk covers both standard and custom Electron usage for background updating, uninterrupted usage, helper processes, cross-platform builds, OS notifications, and the occasional hotfix.


    Thanks to Ben Gotow at Nylas for organizing!

    Electron meetup at Microsoft
    November 06, 2015 | Jeff Weinstein

    Electron has momentum. The open source project for building cross platform desktop apps with web technologies now has 6000+ commits from 200+ contributors, a 3500+ person Slack room, and now it’s 4th meetup with 90+ RSVPs (the 1st was a few of us at a bar).

    On Monday, the Bay Area Electron group met at Microsoft Reactor, an event space in San Francisco. A few members of Microsoft’s open source team were in town to hear how people are using Electron to build Windows apps. The team is dedicated to helping projects run well with Microsoft platforms. It’s also exciting to see that Visual Studio Code is using Electron. Two of the five talks were Windows related:


    Kevin Sawicki from GitHub spoke about how to test Electron apps using ChromeDriver and his project Spectron. Try this in your next project.


    Felix Rieseberg from Microsoft’s open source team gave us walkthrough of WinJS. It seems like a great way to make Electron apps look native on Windows 10. Here are the slides.


    John Haley from Axosoft’s GitKraken team talked about how they handle task scheduling in their Electron apps. This strategy seems like a new standard way to handle both UI and processing intensive applications.


    Wagon’s Matt DeLand presented a few tips and tricks for developing, building, and deploying on Windows along with a demo of our latest version. Sign up for early access to try Wagon on Windows.


    Edgar Aroutiounian gave a quick demo of how he used OCaml to build an Electron app. Checkout the example project here.


    Special thanks to Microsoft for hosting. We’re excited the Electron community is growing and that large companies are adopting and supporting this platform. See you at the next event!

    Electron's first meetup
    August 28, 2015 | Jeff Weinstein

    The Electron community is positively charged! The project, formerly known as Atom-Shell, is a great way to build cross-platform desktop apps using web technologies. Given the 2200 people in the Electron Slack channel, the nearly five thousand commits, and the active discussion board, we figured it’s about time the project had a meetup in real life.

    The community seems to agree: we hosted more than 50 people for the inaugural Bay Area Electron Meetup for four great talks and a big pile of pizza. Engineers from GitHub, Slack, Wagon, and Nylas spoke about building polished apps across Mac, Windows, and Linux using the Electron framework.

    1. The History of Electron by Kevin Sawicki (Github)
    2. Integrating with Native Code by Paul Betts (Slack)
    3. Electron, React, and Haskell. Oh my! by Mike Craig (Wagon)
    4. Making a web app feel native by Ben Gotow (Nylas)

    The History of Electron by Kevin Sawicki (Engineer at GitHub)

    Why Electron was built, what makes it special, how it differs from similar frameworks, and where it is going.

    The History of electron


    Integrating with Native Code by Paul Betts (Engineer at Slack)

    How Slack’s Desktop app calls native operating system and library methods on OS X, Windows, and Linux, via Node Native Modules, node-ffi, and edge.js.

    Native Modules in Electron


    Electron, React, and Haskell. Oh my! by Mike Craig (CTO at Wagon)

    How Wagon is building a hybrid desktop/web data analytics app using Electron, React, and Haskell to solve engineering challenges that aren’t possible with the browser alone.

    Electron, React, and Haskell Oh My!


    Making a web app feel native by Ben Gotow (Engineer at Nylas)

    A dive into some JavaScript and CSS tricks the Nylas team uses to make their Electron-based mail app feel native across Mac, Windows, and Linux.

    Building Native Experiences with Electron


    If you’d like to come to the next one, join the Electron meetup group and we’ll see you soon.

    Electron at Wagon
    July 15, 2015 | Mark Daly

    While building Wagon, we’ve encountered a few engineering challenges that aren’t easily solved in the browser. Our users want Wagon to connect securely to their database and analyze large amounts of data, while being easy to setup and always up to date. Unfortunately, browsers can’t connect directly to databases and aren’t optimized for processing millions of data results. The standard web browser won’t suffice, so what should we do?

    As many companies are discovering, mixing web and native technologies is very compelling. Early adopters including Slack, Atom, Quip, Visual Studio, Spotify, MapBox, Front, and Nylas have found ways to weave these once unrelated approaches.

    At Wagon, we’re using Github’s Electron (previously “Atom-Shell”) as our underlying app framework. Electron was carved out of the Atom editor project and lets us deploy web UIs to the desktop. Our CTO Mike described Wagon’s technical architecture: a Javascript application for user experience along with a native process for database connections and streaming data computation. We want a capable desktop application with the ease of developing for the web.


    Electron


    The earliest alpha of Wagon was a command line program that powered a browser app available at localhost. We soon shipped our first Mac app: a download-able, double-click-able version using MacGap. As more people used Wagon, we wanted to update the code silently in the background, deploy to Windows and Linux, and move away from WebKit (we <3 Chromium’s dev tools!). We frequently ship new versions of both the JS and compiled Haskell, and it was painful for our users to manually download and reinstall the application. We briefly considered Mac-specific update mechanisms but it became clear we needed to replace MacGap. In searching for a full-featured, cross-platform web-view container, we found Electron.


    Wagon's Electron architecture diagram
    Wagon uses Electron to bundle native and web technologies


    Electron is based on Chromium, runs on multiple platforms, and comes packaged with useful features like desktop notifications, custom keyboard shortcuts, and native menus. Auto-update, which originally motivated us to try Electron, is easy to set up and simplifies shipping new versions. Electron is evolving quickly and openly, supported by its vibrant community, active development, public Slack room, and commercial backing.

    Migrating from MacGap to Electron was straightforward, as Electron’s excellent documentation has instructions on rebranding, packaging, and distribution–we got a prototype up and running on a Friday afternoon. Electron differs from other web-view containers by using Node.js (via io.js) as its entry point: when an Electron app starts, execution begins in a JS program included in the app bundle, which can open windows and interact with the host OS. Node’s and Electron’s rich JS APIs made porting from MacGap easy, and we’ve added features that would otherwise only be possible in a native application (like custom menus and dialogs).

    Our static assets are hosted on CloudFront, so we can update the UI without requiring users to redownload the whole application. However, it can take a few seconds for these assets to load and we want an immediate cue that Wagon is working. Here’s how Wagon ensures a smooth app launch experience:

    1. On app start, the main Node process runs our JS App Loader. It loads configuration files, starts background tasks, and opens a renderer to load the latest UI.
    2. The renderer immediately displays a splash.html page that is shipped with the Wagon.app bundle.
    3. The splash page uses Electron’s <webview> tag to load our remote assets and start the JS app in the background while the Wagon logo rolls (some say dances!) on screen.
    4. Once the UI is ready, it notifies the splash page via Electron’s IPC API.
    5. The splash page swaps its content for the UI, creating a seamless transition into the full application.

    When we’re ready to roll out a new version of Wagon.app, we use an automated deployment approach built on GitHub and CircleCI. When we merge a pull request into the master or production branches of our repos, CircleCI automatically builds the application bundle. The components are dropped into the Electron app structure, code-signed, and uploaded to S3. CircleCI also updates a configuration file that our auto-updater API endpoint reads, which lets us notify running instances of Wagon that a new version is available. The update is automatically downloaded in the background, installed, and triggers a desktop notification for the user.

    We believe that great software should run in the browser, on phones, and on the desktop. If building across these platforms sounds exciting, check out our open positions, and email us or tweet @WagonHQ. Gogogo!