$30 off During Our Annual Pro Sale. View Details »

Evolution of Electron - NodeFest 2016

Cheng Zhao
November 13, 2016

Evolution of Electron - NodeFest 2016

Cheng Zhao

November 13, 2016
Tweet

More Decks by Cheng Zhao

Other Decks in Programming

Transcript

  1. EVOLUTION OF ELECTRON
    NODEFEST 2016

    View Slide

  2. EVOLUTION OF ELECTRON
    WHO AM I
    ▸ 摼౮ / Cheng Zhao / υϰη̴ώδЀ
    ▸ Creator of Electron framework
    ▸ Working at GitHub
    ▸ GitHub: https://github.com/zcbenz

    View Slide

  3. EVOLUTION OF ELECTRON
    Electron was born because of Atom editor.

    View Slide

  4. EVOLUTION OF ELECTRON
    FIRST EDITION OF ATOM EDITOR
    ▸ A simple Cocoa app with embedded webview
    ▸ Only works on Mac OS X
    ▸ Native abilities were provided by writing bindings to Cocoa webview

    View Slide

  5. EVOLUTION OF ELECTRON
    CEF BASED ATOM EDITOR
    ▸ The native layer was rewritten with CEF (Chromium Embedded Framework)
    ▸ Native abilities were provided by writing V8 bindings
    ▸ Used Chromium for rendering
    ▸ Possibility to run on all platforms

    View Slide

  6. EVOLUTION OF ELECTRON
    Then Node.js was getting popular.

    View Slide

  7. EVOLUTION OF ELECTRON
    PORT ATOM EDITOR TO NODE-WEBKIT
    ▸ Use Node.js and node-webkit APIs in
    Atom editor
    ▸ Port custom bindings to Node.js native
    modules
    ▸ This try failed

    View Slide

  8. EVOLUTION OF ELECTRON
    WHY THE TRY TO USE NODE-WEBKIT FAILED
    ▸ node-webkit crashed a lot
    ▸ It was hard to convert all of Atom’s code at once
    ▸ node-webkit lacked lots of features

    View Slide

  9. EVOLUTION OF ELECTRON
    WHY THE TRY TO USE NODE-WEBKIT FAILED
    ▸ node-webkit crashed a lot
    ▸ It was hard to convert all of Atom’s code at once
    ▸ node-webkit lacked lots of features
    SOLUTION:
    ▸ Hire the maintainer (me) to improve node-webkit
    ‣ Use a more progressive way to port Atom to node-webkit.

    View Slide

  10. EVOLUTION OF ELECTRON
    NEW PLAN FOR MIGRATING ATOM TO NODE-WEBKIT
    CEF-based Atom Editor
    Add Node.js integration to CEF
    Atom Editor using Node.js
    Migrate Atom to use Node.js APIs
    Improve node-webkit
    Atom Editor running on node-webkit

    View Slide

  11. EVOLUTION OF ELECTRON
    WHEN TRYING TO IMPROVE NODE-WEBKIT
    ▸ The architecture of node-webkit was not suitable for multi-windows apps
    ▸ The node-webkit project was more personal project than organization

    View Slide

  12. EVOLUTION OF ELECTRON
    We need to rewrite node-webkit.

    View Slide

  13. EVOLUTION OF ELECTRON
    NEW PLAN FOR MIGRATING ATOM TO NODE-WEBKIT
    CEF-based Atom Editor Atom Editor using Node.js
    Improve node-webkit
    Atom Editor running on node-webkit
    Write atom-shell
    atom-shell
    ATOM-SHELL
    Add Node.js integration to CEF Migrate Atom to use Node.js APIs

    View Slide

  14. EVOLUTION OF ELECTRON
    THE DIFFERENCES BETWEEN ATOM-SHELL AND NODE-WEBKIT
    ▸ Allows running JavaScript in the main process
    ▸ No longer requires a powerful machine to build
    ▸ Changes node integration implementation to improve stability

    View Slide

  15. EVOLUTION OF ELECTRON
    THE DIFFERENCES BETWEEN ATOM-SHELL AND NODE-WEBKIT
    ▸ Allows running JavaScript in the main process
    ▸ No longer requires a powerful machine to build
    ▸ Changes node integration implementation to improve stability
    IN SUMMARY:
    ▸ Better design
    ‣ Friendly to contributors

    View Slide

  16. EVOLUTION OF ELECTRON
    ATOM-SHELL / ELECTRON TIMELINE
    2013 atom-shell started 2014 atom-shell open sourced 2015 renamed to Electron 2016 Electron 1.0

    View Slide

  17. EVOLUTION OF ELECTRON
    STARS ON GITHUB (0 TO 37607)

    View Slide

  18. EVOLUTION OF ELECTRON
    WE HAVE LOTS OF CONTRIBUTORS
    ▸ 25 community maintainers
    ▸ 492 contributors
    ▸ Half of the changes in recent releases were from contributors
    ▸ (by Nov 6, 2016)

    View Slide

  19. EVOLUTION OF ELECTRON
    ELECTRON TEAM GROWS

    View Slide

  20. EVOLUTION OF ELECTRON
    HOW ELECTRON GROWS
    One major developer
    More users
    More maintainers
    More contributors

    View Slide

  21. EVOLUTION OF ELECTRON
    HOW ELECTRON GROWS
    One major developer
    More users
    More maintainers
    More contributors
    Key for growth More contributors

    View Slide

  22. EVOLUTION OF ELECTRON
    KEEP ATTRACTING CONTRIBUTORS
    ▸ Being responsive to issues and pull requests
    ▸ isitmaintained.com
    ▸ Make development easier
    ▸ bootstrap script
    ▸ Code review
    ▸ Refactor code for better readability
    ▸ …

    View Slide

  23. THANK YOU

    View Slide