29. Build
ng build
New Project
ng new PROJECT_NAME
cd PROJECT_NAME
ng serve (http://localhost:4200/)
Unit test, end-to-end test
ng test
ng e2e
deploy via GitHub
ng github-pages:deploy --message "Optional commit message"
CLI 사용 방법
29
46. new change detection : zone.js
smoother virtual scrolling
smoother view transition
lazy loading
server-side rendering
첫 로딩은 2.5배
리렌더링은 4.2배
성능 개선 후 언제나 5배 이상
?
Angular 1 대비
46
공식적인 Angular 지원 언어는 TypeScript, JavaScript, Dart
JavaScript의 SuperSet이라고는 하지만…
Dart… 얘는 또 뭔데….
<script type="application/dart" src="app.dart"></script>
<script type="text/javascript" src="packages/browser/dart.js"></script>
Dart 전담부서 2016. 6. 21 공식 발표
http://angularjs.blogspot.kr/2016/07/a-dedicated-team-for-angulardart.html
Angular 2 처음 시작은 AtScript
https://youtu.be/QHulaj5ZxbI?list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7
Angular 2 발표 당시 AtScript와 TypeScript의 차이
TypeScript 1.5 버전으로 흡수
2016. 8. 30 TypeScript 1.5.0
2016. 9. 22 TypeScript 2.0.3
http://stackoverflow.com/questions/21055756/what-is-the-difference-between-angularjs-and-angulardart
Angular 1를 만든 Misko Hevery도 Dart 프로젝트의 진행을 언급하고 있음
Google에서도 Angular 2는 TypeScript와 Dart로 병렬 진행중
Angular 2의 검색과 함께 일단은 TypeScript도 같이 올라가는 중
TypeScript가 간단하긴 하다….
Dart 는 TypeScript랑 비슷
Mike Brocchi, Architect at CEI (ceiamerica.com)
(https://www.linkedin.com/in/mikebrocchi)
from ng-conf 2016
환경설정, 폴더 관리의 문제 => CLI가 개선할 수 있음
Other Interests : 다른 framework 를 사용
https://cli.angular.io/
https://github.com/angular/angular-cli
Command Line Interface for building Angular 2 applications2016/5/2 Angular 2.0.0-rc.0 에서 처음 발표
npm 기준 v1.0.0-beta.19-3
프로젝트 생성부터 개발, 테스트, 빌드까지 전부 수행할 수 있음
CLI가 다루는 영역은 기본 틀부터 빌드, 테스트, 배포까지 전 단계
IDE : Integrated Development Environment
CLI 사용 방법
사용방법
ng new 결과물
ng serve 결과물
서버 띄우기까지 명령어 하나로 수행
make new project
ng serve
make components
CLI roadmap
by Mike Brocchi
Directive 는 없어지지 않았다
하지만 문법이 달라졌음
Angular 2 data binding
https://angular.io/docs/ts/latest/guide/template-syntax.html#!#binding-syntax
일부 build-in directive 에서는 * 사용
“template 안에서 *로 시작하는 directive를 사용”
http://angularjs.blogspot.kr/2016/08/angular-2-rc5-ngmodules-lazy-loading.html
Angular 2 안에서의 큰 변화, ngModule
Angular 2 RC5 에 등장 (2016. 8. 9)
기존 @Component 구현 방식을 보완
components, directives, pipes 반복 로딩을 대체
AoT(Ahead of Time, build step) => lazy loading
대체 -> 원문 RC5 deprecations
we’ve deprecated and will remove for 2.0.0-final the need to declare directives, pipes and components in individual components, in favor of doing so at the NgModule level.
NgModule 페이지 마지막 예제 참고
ngModule이 들어오면서 개발 방식이 변화
애초에 Angular 2가 관심을 끌었던 이유는 완성물의 동작 속도
ng-conf 2015에서 보여준 데모로는 Angular + React 보다 Angular 2가 많이 빨라 보인다
Angular 2 정식 발표 전 데모
응답시간 설정 오류
응답시간이 동일한 비교
Angular 2가 살짝 빠름
1대비 빠르긴 하지만 어느 정도인지는 말하기 애매함
1.x도 개선중, Angular 1.4 (2015. 5. 28) 에서 1.3 대비 최고 25% 빨라짐
https://youtu.be/XQM0K6YG18s
Angular 1.4 release note
http://angularjs.blogspot.kr/2015/05/angular-140-jaracimrman-existence.html
ng-conf 2016, Zackary Chapple
github : heimdallr(Performance monitoring for Angular), ng-table
Page loading x20 test
from ng-conf 2015 (2015. 2. 26)
Virtual Scrolling Table : 화면에 보이는 위치의 DOM 만 구현하여 속도 향상
https://youtu.be/QHulaj5ZxbI?list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7
JavaScript 프레임워크 비교
http://www.stefankrause.net/wp/?p=316
Angular 1, 2, VanillaJS만 요약 (React 추가)
Angular 1보다 빠르긴 하다
http://www.stefankrause.net/wp/?p=316
js framework benchmark : https://auth0.com/blog/more-benchmarks-virtual-dom-vs-angular-12-vs-mithril-js-vs-the-rest/
server side rendering : https://youtu.be/0wvZ7gakqV4
Angular2 Universal Starter Kit : https://github.com/alexpods/angular2-universal-starter
http://blog.angular-university.io/introduction-to-angular2-the-main-goals/
이런 방향으로 가고 있음
최신 트렌드를 반영하고 체계적인 프로젝트 관리를 지향
https://augury.angular.io/
개발을 도와주는 Angular 2 디버깅 툴의 등장
Augury 설명
Vanessa Yuen (Canada, Full Stack JavaScript Software Developer)
현 상황에서 Angular 2를 써야할까
현재로서는 아직. 아직도 계속 바뀌고 있고 사용자들의 사용 경험 부족
많은 삽질이 예상됨
하지만 Angular 2를 계속 주목해야 하는 이유는
프로젝트 관리에 체계적인 방식을 계속 도입하고 있음
Angular 1에서 보여준 탄탄한 구조를 Angular 2에 적용할 수 있을지가 문제
체계적인 프로젝트 관리 : CLI를 이용한 통일된 폴더 구조, 빌드, 테스트, 배포
최신 기술의 자연스러운 도입 : lazy loading, server rendering, Reactive Programming, Web Component, Service Worker
Object Oriented Programming
결론
Angular usage in Google (etc : https://builtwith.angularjs.org/)
Double Click For Advertiser
YouTube for PS3
Google Cloud Developers Console
Google Cast
민중을 이끄는 자유의 여신
지금 시작하면 Angular 2의 선구자가 될 수 있다
다만 삽질은 여러분의 몫