Knowledge engineering: from people to machines and back
B4UConference_Sexy Angular Stack
1. HIGH TECH
HIGH CODE QUALITY
HIGH PERFORMANCE
HIGH SCALABILITY
HIGH MAINTAINABILITY
Single
Page
App
2. SE XY A N G U L A R STA CK
C U R I O U S C A S E S
by @ c u o n g t r u o n g
3. Hello!
I am Cuong Truong
FEArchitect/Scrum Master at #ITCGroup
I am here because I love to share knowledge
You can contact me via
cuongtruong.info@gmail.com
6. #Framework for building SPA
Uni-directional data flow
Across all platforms
Server-side rendering
Modern, Smaller & Faster
#Cheat Sheet
ANGULAR
7. Do events
Repaint the
DOMDo layout
Recalculate
the CSS
Every time DOM changes, browser needs to
TAKESTIME
TRADITIONAL WAY
8. Modifies DOM when MODEL changed
ANGULAR WAY
1
USE “1-WAY”
Unidirectional Data
Flow
BATCH
Update bindings,
execute all changes
COMPUTE
minimal set of changes
cause DOM to be updated
RUN
change detection on
the Model
2
34
BETTER PERFORMANCE
9. No controllers
No models
No directives
No global eventlisteners
Everything is <Component/>
#Thinking in Angular
12. A solution for concurrent
data modification by
multiple actors
A client containerfor
temporary UI state.e.g.
A client cache for
avoiding excessive HTTP
requests
If you need
HOW TOMANAGE
FRONTEND
LOGIC or
wizard, shopping cart, … APPLICATION
STATE EFFECTIVELY?
17. Static type checker for JS
strong/statically typed advantages
Strong tool for LARGE app
covers 100% of code
catches incorrect assumptions
e.g. numbers represented as strings
Provides advanced
autocompletion / intellisense
navigation
safe refactoring
TypeScript
#WhyTypeScript
18. My Recommendation
project does not live for long
project is really simple
people enter or leave your team frequently
there is a chance you will need to refactor the thing
system is very important or even crucial for the success
of company
19. discovers problems
with TypeScript code
without executing it
Coding conventions
Readability
Maintainability
Functionality errors
TSLint/ESLint
#TSLint #ESLint
20. FAKER
Some other mocking/
#faking data/api calls
ISTANBUL
JS #code coverage tool
SINON
Test #spies, stubs &
mocks for JavaScript
Front-end Unit Test
KARMA
Spectacular #test
runner for JavaScript
MOCHA
Feature-rich JavaScript
#test framework
CHAI
BBD/TDD
#assertion library
#Protractor
27. Pros
One framework to rule them all
Full control/easy to manage coding flow
Building reusable code/components
Testable
Readable
Maintainable
Performance
Developer experience/community
Server-side rendering => SEO
Size is smaller after each release
28. Cons
Learning curve
Need to keepconventions/boilerplate
Need to care aboutperformance
All in One framework for small app
29. My Recommendation
People are a part of solution
Keep conventions / commitments
Strategies for managing dependencies
Take care about architecture and configurations
Write small & pure functions as much as possible
Write meaningful unit test as much as possible
Don’t USE if you don’t NEED or UNDERSTAND it