Yakov Fain

Author
+ Follow
since Jan 26, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Yakov Fain

It's not necessary to know JavaScript if you're planning to learn TypeScript from scratch.  Understanding the JavaScript basic syntax is helpful though.
You can use TypeScript and write code and compile it to JavaScript that will be deployed on the Node.js.  In Part 2 of the book, we show how to do it.
Also, the creator of Node.js works on another server called Deno, which is a runtime for TypeScript so you don't even need to compile the code (see https://deno.land/std/manual.md).
1. Reports compile-time errors as you type
2. Excellent IDE support (Visual Studio Code, WebStorm, IDEA, etc)
3. It's standard based. As soon as a proposed ECMAScript language feature makes it to stage 3 (out of 4), it gets implemented in TypeScript. Two years after, the major browsers will implement it in their JavaScript engines.
'4. Very efficient compiler. It generates the human-readable JavaScript code  
5. Types are optional. You don't have to declare types for each and every variable. The TypeScript compiler infers type if they are not explicit.

See my video lessons at https://www.youtube.com/playlist?list=PLkKunJj_bZecSLIEeXEhUxD7e7aj7-fN3
I've been teaching many classes for enterprise clients across the USA. My typical audience was Java developers. They love TypeScript. They just get it. Lots of similar concepts: classes, interfaces, generics...

I started recording video lessons on TypeScript based on this book. Check them out: https://www.youtube.com/playlist?list=PLkKunJj_bZecSLIEeXEhUxD7e7aj7-fN3

That's right, any JavaScript library can be used in a TypeScript app. If you want to reap the benefits of strong typing and the IDE support, you need to install type definition files for the JS library that you're planning to use in your project. Currently, the type definition files (*.d.ts) for more than 2K of JS libraries (including the ones for D3) exist on npmjs.org. After running the command below, TypeScript compiler will warn you about the compilation errors and IDEs will offer the typeahead help.

As Bear said, Angular 2 is a completely different framework, and you don't need to learn AngularJS first. Start with learning TypeScript. Watch a couple of videos on Youtube. Go to the TypeScript playground (http://www.typescriptlang.org/play ) and try playing with different code snippets just to see how the TypeSrip compiler generates JavaScript. Then install Angular CLI and study the generated code.

If you decide to learn Angular with our book, Read the appendices first (ES6 and TypeScript), and then start reading the book from chapter 1.  For a large list of learning resources, visit this page: https://github.com/jmcunningham/AngularJS2-Learning

Regards
Yakov
Keeping the CSS, HTML, .ts, and test files in the same directory simplifies component's reusability.  If a component is needed in another app, just copy the content of the entire folder into another project. No need to go places and look for CSS that's required for this component.
In angular-cli.json you put global styles (you app's or from the third-party libraries). CSS of the components should be either inlined or placed in the css file right in the directory where the component is located.
Angular works with the Twitter's Bootstrap just fine. We use it in a sample online auction that we build in the book.  Take a look at the client of the Auction app here: https://github.com/Farata/angular2typescript/tree/master/chapter10/auction or in the Angular CLI version of this project: https://github.com/Farata/angular2typescript/tree/master/extras/auction

Angular seed projects were offering a quick way to get started without the need to create several config files manually. We also created a couple of seed while writing our book. The repo for the book code samples (https://github.com/Farata/angular2typescript) has one for SystemJS-based projects (chapter2) and another for the manually-configured Webpack-based project (chapter10).  Regardless of which seed project you use, you'll be following the author's view of how to develop with Angular.

But now Angiular CLI is a mature and standard way of jump-starting the project with all configurations and tools included. I don't see a need to use anyone's seen anymore. Go with Angular CLI. If you ever work on a really large project that requires fine tuning modularization or the bundling process, you'll invest time in learning the internals of Webpack or Rollup. But for most of the apps using Angular CLI works fine.

Regards
Yakov

Any project generated by Angular CLI uses Webpack under the hood. Currently, Angular CLI doesn't allow you to change the configuration of the Webpack. Angular CLI doesn't use Yeoman though (there is another code generator JHipster that uses Yeoman under the hood).

The TypeScript code is compiled by the tsc compiler that's the part of your project regardless if the build is done using Webpack or you use SystemJS loader. Webpack uses ts-loader under the hood that in turn uses tsc. SystemJS loader loads the entire TypeScript compiler into the browser and compiles it there. There is also a SystemJS Builder that I never used.

For most cases using npm scripts is enough for build automation and you don't need to use gulp.

Regards
Yakov
Good to be here!

So far I've answered 15 questions. Keep them coming!  

Regards
Yakov
Angular 2 is a framework while React is a library for rendering UI.
Actually, Angular 2 is more than a framework - it's a platform that includes various tool required for the cross-platform applications.
IMO, comparing Angular 2 and React is like comparing apples and oranges even though people do it.
From the pragmatic point of you, if you work in a typical team of developers, where not everyone is a genius, use Angular 2 that comes with everything you need for developing Web apps.

We don't compare Angular with other frameworks in the book, but we do explain what we like about Angular.

Regards
Yakov