34
Contents
© 2017 Progress. All Rights Reserved.
Why JavaScript?
As the popular saying goes, JavaScript is the
assembly language of the web and its success is
clearly influencing the ASP.NET stack. Why should
you consider a Core JS Framework in ASP.NET
stack? Quite simply—reusability of established
frameworks and flexibility of client-side code.
Popular Core JS frameworks give you a lot out of
the box—easy data binding, separation of concerns
and well-oiled rendering engines. And all of this JS
tooling works right inside of Visual Studio for the
best of both worlds. A few major JS frameworks
to consider are Angular, React, Aurelia, Backbone,
Knockout, Durandal, etc.
Interestingly, NodeJS is also making its presence
felt in the ASP.NET stack. NodeJS is the V8-
based JavaScript runtime that is event driven and
performance optimized for non-blocking IO. This
makes NodeJS a great lightweight web host, and
ASP.NET developers may want to keep their hosting
options open, now that there’s Docker support in
ASP.NET. Visual Studio is a great IDE for NodeJS
development and even if not hosting, NodeJS plays
home to much of the tooling that makes your life
easier as an ASP.NET developer.
Don’t want to write JavaScript? No problem–you can
now leverage TypeScript in ASP.NET. Too much in
love with object-oriented concepts? Now you can
do all of that through TypeScript, a typed superset
of JS—everything simply gets compiled down to
plain JavaScript. With the Angular 2.0 endorsement,
TypeScript’s popularity is on the upswing and
it could be the perfect companion to your ASP.
NET client-side code. In fact, the bigger and more
complicated your business logic, the brighter
TypeScript shines.
ASP.NET Yeoman Generator
Want to get started with the new ASP.NET Core?
Irrespective of what development platform you are
one, one consistent CLI tool works everywhere—
Yeoman. This NodeJS-based tool gives you the
perfect scaffolding option for starting your ASP.NET
application from Command Line. How? Simply use
the popular ASP.NET Yeoman Generator.
Here are some steps in your beloved command
line:
• Make sure you have NodeJS installed. You
could do brew install node on MacOSX or choco
install nodejs on Windows.
• Get Yeoman - npm install –g yo
• Get Bower – npm install –g bower. Bower will
be used as a package manager by the Yeoman
generator to pull down some dependencies for
the scaffolded ASP.NET project.
• Get the ASP.NET Yeoman generator – npm
install –g generator-aspnet
• Once all requirements are in place, you could
simply type in – yo aspnet. This powers up the
Yeoman ASP.NET generator and provides you
scaffolding options, as below: