Slide 1

Slide 1 text

Co nowego w TypeScript i dlaczego go nie używasz? Michał Michalczuk .Net Developer |

Slide 2

Slide 2 text

?

Slide 3

Slide 3 text

Zmiany podano do stołu TypeScript 1.4 TypeScript 1.7

Slide 4

Slide 4 text

Poprzednie podejście - v. 1.4 Ręczne linkowanie referencji dla kompilatora bardziej alias niż import

Slide 5

Slide 5 text

Poprzednie podejście - v. 1.4 Import. Dosyć Python Brak ręcznego deklarowania referencji

Slide 6

Slide 6 text

Konfiguracja projektu tsconfig.json { "compilerOptions": {...}, "filesGlob": [...], "files": [...], "atom": { "rewriteTsconfig": true } } [show example]

Slide 7

Slide 7 text

Kompilacja ECMAScript 5 ECMAScript 6 "target": "es5", [show example]

Slide 8

Slide 8 text

Kompilacja AMD CommonJS "module": "commonjs",

Slide 9

Slide 9 text

Zarządzanie modułami Module Namespace require vs module require.js

Slide 10

Slide 10 text

Typings Definetely Typed tsd

Slide 11

Slide 11 text

Typings

Slide 12

Slide 12 text

Typings fragment Q.d.ts

Slide 13

Slide 13 text

Typings { "version": "v4", "repo": "borisyankov/DefinitelyTyped", "ref": "master", "path": "typings", "bundle": "typings/tsd.d.ts", "installed": { "node/node.d.ts": { "commit": "6a6ad7068..." }, "mocha/mocha.d.ts": { "commit": "e57df787f..." }, … } [show example]

Slide 14

Slide 14 text

Typings /// /// /// Jeden plik … w końcu automatycznie [show example]

Slide 15

Slide 15 text

Nowe formy Nowy syntax Nowe elementy Obiektowo tak bardzo

Slide 16

Slide 16 text

Nowe formy | Klasy abstrakcyjne Wait .. what? [show example]

Slide 17

Slide 17 text

Nowe formy | Annotacje Gdzieś już to widziałem... @Component({ selector: 'tabs' }) export class Tabs { ... } @View({ template: `
  • Tab 1
  • Tab 2
’ })

Slide 18

Slide 18 text

Nowe formy | Annotacje

Slide 19

Slide 19 text

Nowe formy | Dekoratory [show example] Nie tak dawno temu był sobie adapter do klienta redis-a...

Slide 20

Slide 20 text

Stare formy | Wiele konstruktorów

Slide 21

Slide 21 text

Nowe formy | Promises Tak, od 1.7 Ale inaczej

Slide 22

Slide 22 text

Nowe formy | Promises Async / Await === new Promise(...) [show example]

Slide 23

Slide 23 text

Nowe formy | Class expressions [show example]

Slide 24

Slide 24 text

Wsparcie narzędzi | IDE i edytory WebStorm Atom + Atom-Typescript Visual Studio Visual Studio Code

Slide 25

Slide 25 text

Wsparcie narzędzi | Budowanie gulp-typescript gulp-tsd gulp-tslint odpowiedniki w grunt wiele paczek na yeoman ma wybór

Slide 26

Slide 26 text

Wsparcie narzędzi | Budowanie ❤ gulp-typescript

Slide 27

Slide 27 text

Wsparcie narzędzi | Typings in JS ❤ WebStorm

Slide 28

Slide 28 text

Fakty i mity | Tylko .net nie tylko .net developers friendly

Slide 29

Slide 29 text

Fakty i mity | Albo TS albo nic Migruj się stopniowo [show example]

Slide 30

Slide 30 text

Słowem podsumowania

Slide 31

Slide 31 text

Pytania? michalczukm