Fireship · @fireship

Build a Desktop App with Electron... But Should You?

Uploaded March 4, 2020 · Length 11:12

Build a Desktop App with Electron... But Should You?

Summary

Build a desktop app with Electron, weighing its pros and cons, and creating a simple screen recorder.

  • electron desktop app
  • electron pros and cons
  • electron screen recorder
  • electron tutorial
  • desktop app development

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    today's video is a practical beginners

  2. 0:02

    guide to building desktop apps with

  3. 0:03

    electron by the end of this video you

  4. 0:05

    will built a desktop app that's

  5. 0:06

    installable on Mac OS Windows and Linux

  6. 0:08

    using nothing but HTML CSS and

  7. 0:10

    JavaScript you'll learn how to combine

  8. 0:12

    api's from the web no js' and electron

  9. 0:15

    to build a desktop screen capture it

  10. 0:17

    created some native menus captures a

  11. 0:19

    video stream from your system and can

  12. 0:21

    write the raw video file to your

  13. 0:23

    filesystem now if you have no idea how

  14. 0:24

    electron works make sure to check out my

  15. 0:26

    100 seconds of code video on that topic

  16. 0:28

    if you're new you're like and subscribe

  17. 0:29

    and grab the full source code for this

  18. 0:31

    project on fire ship IO now Before we

  19. 0:33

    jump into the code and turn you into an

  20. 0:35

    electron developer there is one thing

  21. 0:36

    you should know a lot of people like to

  22. 0:38

    talk [ __ ] about electron and to be

  23. 0:40

    honest a lot of the criticism is valid

  24. 0:42

    electron apps bundle chromium and nodejs

  25. 0:44

    out of the gate and that tends to lead

  26. 0:46

    to a very large app size even for a

  27. 0:48

    simple app on top of that running

  28. 0:49

    chromium can be a resource intensive so

  29. 0:51

    your app will probably use more CPU and

  30. 0:53

    RAM than a comparable app and

  31. 0:54

    objective-c or a c-sharp but here's the

  32. 0:57

    thing these drawbacks don't matter very

  33. 0:58

    much for most developers when it comes

  34. 1:00

    to the big picture

  35. 1:01

    is fun fun I do bad things if you're a

  36. 1:04

    web or nodejs developer electron offers

  37. 1:06

    an amazing developer experience and it

  38. 1:08

    makes desktop apps a practical business

  39. 1:09

    decision for companies that would

  40. 1:11

    otherwise not consider them even big

  41. 1:13

    companies with tons of talent and cash

  42. 1:14

    still choose electron because it makes

  43. 1:16

    more business sense at the end of the

  44. 1:18

    day the only thing that matters is that

  45. 1:19

    you build an awesome user experience

  46. 1:21

    which you can absolutely do with

  47. 1:22

    electron and your users don't know or

  48. 1:24

    care what technology you use to build

  49. 1:26

    the app I think Winston Churchill said

  50. 1:27

    it best electron is the worst desktop

  51. 1:29

    architecture except for all the others

  52. 1:31

    we've tried now that we have that out of

  53. 1:33

    the way

  54. 1:33

    let's take a closer look at the desktop

  55. 1:35

    app we're building today it's a simple

  56. 1:37

    screen recorder it takes one of the

  57. 1:38

    windows that you have opened on your

  58. 1:40

    desktop and turns it into a video stream

  59. 1:42

    and then we preview that video stream in

  60. 1:43

    our electron app when we click the

  61. 1:45

    record button it will turn the stream

  62. 1:47

    into an actual raw video file when you

  63. 1:49

    click stop it will open another native

  64. 1:51

    menu this time asking where you want to

  65. 1:52

    save the file output and lastly it

  66. 1:54

    writes the raw file to your system so

  67. 1:56

    this will be a really fun project

  68. 1:57

    because you'll need to use node.js for

  69. 1:59

    certain things web technologies for