TYPESCRIPT FOR NODE.JS "Tame your JavaScript" JEREMY - - PowerPoint PPT Presentation

typescript for node js
SMART_READER_LITE
LIVE PREVIEW

TYPESCRIPT FOR NODE.JS "Tame your JavaScript" JEREMY - - PowerPoint PPT Presentation

TYPESCRIPT FOR NODE.JS "Tame your JavaScript" JEREMY LIKNESS Cloud Developer Advocate for Microso 20 Years Professional Developer Author of books and articles, both online and print Prolific speaker 100% plant-based diet and


slide-1
SLIDE 1

TYPESCRIPT FOR NODE.JS

"Tame your JavaScript"

slide-2
SLIDE 2

JEREMY LIKNESS

20 Years Professional Developer Author of books and articles, both online and print Prolific speaker 100% plant-based diet and CrossFit Cloud Developer Advocate for Microso

slide-3
SLIDE 3

WAT?!

Wat?

[]+1 ...

slide-4
SLIDE 4

EVOLUTION

slide-5
SLIDE 5

HARMONY? ECMASCRIPT 2015? BABEL?

Popular options. Includes: classes, lexical scope, lambda... Lacks … Interfaces Dynamic module affinity (System.js, Require.js, etc.) External library definitions Generics

slide-6
SLIDE 6

REAL WORLD

DISCOVERY

Intent is clearer with types and interfaces.

slide-7
SLIDE 7

REAL WORLD

DOCUMENTATION

Libraries make it easier to discover and learn how to use APIs.

slide-8
SLIDE 8

REAL WORLD

DEVELOPMENT TIME SECURITY

Less "fat-finger", catch bugs earlier in the cycle.

slide-9
SLIDE 9

REAL WORLD

SCOPE SAFETY

Modules, Classes, and Lambdas take care of this.

slide-10
SLIDE 10

REAL WORLD

TEAM SCALE

Easier for multiple teams and members to work in parallel.

slide-11
SLIDE 11

REAL WORLD

INCREASED VELOCITY

Team had 4x velocity with TypeScript vs. just

  • JavaScript. Oh, and the Angular team uses it, for

goodness' sake!

slide-12
SLIDE 12

DEMO TIME!

slide-13
SLIDE 13

TYPESCRIPT AND NODE.JS

First class support IDE integration Libraries (and automatic generation) Configurable options

slide-14
SLIDE 14

GETTING STARTED

npm init -y npm i typescript --save-dev npm i @types/node --save- dev node tsc --init

slide-15
SLIDE 15

DEMO

Examining tsconfig.json.

slide-16
SLIDE 16

THE APP

Edit tsconfig.json Add "main": "lib/main" and "types": "lib/main" to package.json Create src directory Add code Build and run!

slide-17
SLIDE 17

DEMO

First app.

slide-18
SLIDE 18

DEMO

Full enchilada. https://github.com/JeremyLikness/micro-locator

slide-19
SLIDE 19

QUESTIONS?

@JeremyLikness https://blog.jeremylikness.com/ https://github.com/JeremyLikness/typescript-for- node