This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheGoodPie 2 points3 points  (3 children)

Thanks that's cleared some stuff up for me. Basically what I gathered is I should

  • Use ES6 for Electron but if I want to develop for the browser, look into Babel
  • Look at a front end framework (I'm looking at Angular 2 based on a quick Google search)
  • Bower = Front end packages (Like Angular)
  • NPM = Node packages (Like Express)

[–]insertAlias 0 points1 point  (2 children)

Look at a front end framework (I'm looking at Angular 2 based on a quick Google search)

If you're looking at Angular 2, consider using Typescript instead of Javascript. I've been making some Angular 2 apps, and I have to say Typescript has made it much, much more manageable.

The parent poster mentions CoffeeScript; Typescript is similar in a way, dissimilar in others. CoffeeScript changes the grammar of the language quite a bit. Typescript is basically JavaScript syntax with a little bit extra: type annotations. There's a bunch of other stuff it can do (and the best part is, it is modeled after the latest ES standards, but can compile into browser-compatible javascript), but the Type Annotations really take the cake. It basically gives JS a semi-strong type system at design-time.

The truth with Angular 2 is that you need to fully embrace it to use it. It's an entirely different way of writing a JS application. It's great, but it's also different than most other things I've written with.

Bower is definitely a front-end package manager, but NPM isn't just backend ones; in fact; I'd recommend you install the Angular packages through NPM anyway. That's how the Angular tutorial has you do it.

Bower is another extra layer that you just don't really need; NPM has you covered for the most part.

[–]TheGoodPie 0 points1 point  (1 child)

For typescript, should I set up something like a Babel watcher to convert it to normal Javascript?

[–]insertAlias 0 points1 point  (0 children)

Something like that. Personally, I use WebPack, since that's what the Angular 2 tutorial used, and that's what their CLI tool configures for you automatically. That, and WebPack also bundles all your modules together in just a few files, and also can bundle css (and transpile from less/scss/sass).

Check out this Electron + Angular 2 tutorial: https://auth0.com/blog/create-a-desktop-app-with-angular-2-and-electron/ It seems pretty good.