Seed project for Angular 2 apps
with statically typed build
Slide 13
Slide 13 text
Seed project for Angular 2 apps
with statically typed build
Slide 14
Slide 14 text
Seed project…
• Development and production builds
• TypeScript transpilation
• BrowserSync support
• Karma with Jasmine integration
• e2e testing with protractor
• Test coverage
• Follows best practices
• ng2lint
Slide 15
Slide 15 text
Seed project…
• Development and production builds
• TypeScript transpilation
• BrowserSync support
• Karma with Jasmine integration
• e2e testing with protractor
• Test coverage
• Follows best practices
• ng2lint
Slide 16
Slide 16 text
Seed project…
• Development and production builds
• TypeScript transpilation
• BrowserSync support
• Karma with Jasmine integration
• e2e testing with protractor
• Test coverage
• Follows best practices
• ng2lint
Slide 17
Slide 17 text
Seed project…
• Development and production builds
• TypeScript transpilation
• BrowserSync support
• Karma with Jasmine integration
• e2e testing with protractor
• Test coverage
• Follows best practices
• ng2lint
Slide 18
Slide 18 text
Seed project…
• Development and production builds
• TypeScript transpilation
• BrowserSync support
• Karma with Jasmine integration
• e2e testing with protractor
• Test coverage
• Follows best practices
• ng2lint
Slide 19
Slide 19 text
Seed project…
• Development and production builds
• TypeScript transpilation
• BrowserSync support
• Karma with Jasmine integration
• e2e testing with protractor
• Test coverage
• Follows best practices
• ng2lint
Slide 20
Slide 20 text
Seed project…
• Development and production builds
• TypeScript transpilation
• BrowserSync support
• Karma with Jasmine integration
• e2e testing with protractor
• Test coverage
• Follows best practices
• ng2lint
Slide 21
Slide 21 text
No content
Slide 22
Slide 22 text
No content
Slide 23
Slide 23 text
Introducing
Best Practices
Slide 24
Slide 24 text
Section agenda
• Use common style & best practices
• Angular 2 (will) have great IDE support
• Use static code analysis for less bugs
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
No content
Slide 27
Slide 27 text
No content
Slide 28
Slide 28 text
Angular 2 has
“runtime-type checking”
Slide 29
Slide 29 text
No content
Slide 30
Slide 30 text
Why not
build-time
Slide 31
Slide 31 text
No content
Slide 32
Slide 32 text
No content
Slide 33
Slide 33 text
No content
Slide 34
Slide 34 text
ng2lint
Slide 35
Slide 35 text
“ng2lint is a project which aims to
enforce common style and verify
correctness of your program”
Slide 36
Slide 36 text
Angular in
Web Workers
Slide 37
Slide 37 text
– MDN
“Web Workers provide a simple means for web
content to run scripts in background threads.
The worker thread can perform tasks without
interfering with the user interface.”
Slide 38
Slide 38 text
– MDN
“Web Workers provide a simple means for web
content to run scripts in background threads.
The worker thread can perform tasks without
interfering with the user interface.”
Slide 39
Slide 39 text
Angular 2 is
platform agnostic
Slide 40
Slide 40 text
Angular 2 can run…
• In the browser
• On the server
• In WebWorkers
• In native mobile apps
Slide 41
Slide 41 text
Angular 2 can run…
• In the browser
• On the server
• In WebWorkers
• In native mobile apps
Slide 42
Slide 42 text
Angular 2 can run…
• In the browser
• On the server
• In WebWorkers
• In native mobile apps
Slide 43
Slide 43 text
Angular 2 can run…
• In the browser
• On the server
• In WebWorkers
• In native mobile apps
Slide 44
Slide 44 text
Angular 2 can run…
• In the browser
• On the server
• In WebWorkers
• In native mobile apps
Slide 45
Slide 45 text
WebWorker
UI thread
App
Change Detection
Web Worker renderer
…
UI Renderer
Do whatever you want
Slide 46
Slide 46 text
JSON
WebWorker
UI thread
App
Change Detection
Web Worker renderer
…
UI Renderer
Do whatever you want
Slide 47
Slide 47 text
…but
Slide 48
Slide 48 text
Can’t touch
DOM
Slide 49
Slide 49 text
What about?
document.body.style
.backgroundImage = 'url(background.png)';
Slide 50
Slide 50 text
No content
Slide 51
Slide 51 text
…at least…?
document.querySelectorAll('.foo');
Slide 52
Slide 52 text
No content
Slide 53
Slide 53 text
WebWorkers recap
• Angular is platform agnostic
• Running apps in background
• WebWorkers can’t touch the DOM
Slide 54
Slide 54 text
angular/offline
Slide 55
Slide 55 text
angular/offline:
• Offline access to static content
• Notifications for new versions
• Efficient download of deltas
• Support off push notifications
Slide 56
Slide 56 text
angular/offline:
• Offline access to static content
• Notifications for new versions
• Efficient download of deltas
• Support off push notifications
Slide 57
Slide 57 text
angular/offline:
• Offline access to static content
• Notifications for new versions
• Efficient download of deltas
• Support off push notifications
Slide 58
Slide 58 text
angular/offline:
• Offline access to static content
• Notifications for new versions
• Efficient download of deltas
• Support off push notifications
Slide 59
Slide 59 text
angular/offline:
• Offline access to static content
• Notifications for new versions
• Efficient download of deltas
• Support of push notifications
Slide 60
Slide 60 text
angular/offline:
• Offline access to static content
• Notifications for new versions
• Efficient download of deltas
• Support of push notifications
Slide 61
Slide 61 text
No content
Slide 62
Slide 62 text
– MDN
“Service workers essentially act as proxy
servers that sit between web
applications, and the browser and
network (when available)....”
Slide 63
Slide 63 text
No content
Slide 64
Slide 64 text
– MDN
“HTML5 provides an application caching
mechanism that lets web-based
applications run offline. Developers can
use the Application Cache...”
Slide 65
Slide 65 text
AppCache
Service Workers AppCache
Service Workers
=
~91.8%