SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
Angular (2)
A Story from the Trenches
Johannes Rudolph, MSc
Software Platform & Development @ Meshcloud
jrudolph@meshcloud.io
www.meshcloud.io
What is Meshcloud?
Cloud Platform Integration
Overview
MeshPanel
User Interface
Platform Modules
Service Modules
Identity Broker
MeshFed
Project Management
User Management
Cloud Platform Access
direct API access
Meshpanel
● Target Evergreen Browsers Only (Edge, FF, Safari, Chrome)
● SPA with Angular 2
● Angular-CLI (webpack2) for builds
● SCSS
● Bootstrap 4 (alpha!)
● yarn as package manager
Tech Stack
Meshpanel
● Concourse CI
● CloudFoundry
using Staticfile
Buildpack
Deployment
Angular (2)
● Announced at ng-Europe 09/2014
○ Complete rewrite
○ Embraces ES6 / TypeScript
○ Ahead-of-time Compiler for Component Templates
■ No more $scope, controllers
■ -> No generic change detector checking the whole $scope
■ -> Generates Monomorphic Change Detector Code
○ One-way data flow
○ Modular Framework: tree-shaking
● Beta in 12/2015
● 1.0 (ha! 2.0 of course) in 09/2016
A short recap of its turbulent history
Ohhh the Betas!
● Development started on RC.1
○ Multiple breaking changes
○ Complete rewrite for RC.6
● Angular CLI
○ Switched build system
(broccoli->webpack) midway
○ Broke multiple times
○ Performance was an issue (not
anymore)
● Bootstrap 4
○ Relatively painless, minor bugs remain
The price of living on the leading edge
Cliff Lookout by David Niblack. CC License
Angular
● Drastically simplified core concepts
○ Component (js+css+html) and Component Tree
○ Directive (attaches to DOM)
○ Service (injectable via DI)
○ Module (Lazy Loading + Tree Shaking)
● Semantic Versioning works
○ Upgrades v2.x.y painless so far
● Deep integration with RXJS
● Module Structure and Lazy Loading
The good Parts I
Demo Time
Angular CLI
Excursion: Lazy Loading
OS Module
Module Structure
Core (Sessions, Routing, ...)
Auth-Mesh Auth-Direct
OS Module CF Module
Nova Cinder ...
Projects Registration
BillingApps Services
Excursion: Lazy Loading
Full AOT and Tree Shaking for Production
Angular+libs
First bundle
Preloading
Feature
Modules
Excursion: Observables
● Has a learning curve
○ hot/cold Observables
○ complete/error/next
● Version confusion strikes again
○ https://github.com/Reactive-Extensions/RxJS v4 “legacy”
○ https://github.com/ReactiveX/rxjs => v5 and current
● Operations neatly composable
○ Error propagation just works
○ Avoids bugs
○ Can quickly implement complex behaviors
RXJS ftw!
Angular
The good Parts II
● TypeScript gives huge productivity boost
○ IntelliSense / Code Completion
○ Live type-checking in the Editor
● AOT Compilation + Tree Shaking
○ Great Performance
○ Type Checking of Module Dependencies
● Data-Bindings are Lintable
○ Type Checking at compile time with tslint/codelyzer
● Angular CLI
○ Generates scaffolding
○ Abstracts away webpack2
Angular + HATEOAS
● “Level 3” REST API
● No Client-Side Link Building
○ Server offers all Links
● Why?
○ “Discoverable API”
○ No URL fiddling in clients
○ Easy API Versioning
○ Enforcing API Consistency
● HAL Models
○ Hypertext Application
Language
Hypermedia as the Engine of Application State
Angular + HATEOAS
Use TypeScript 2.1 Tricks to encode HAL Models
Demo
Lessons Learned
● Module Boundaries not enforced
○ Angular Modules only relevant for AOT, DI and lazy loading
○ TS Files are still individual modules
● Dependency Injection
○ Singletons only, no Lifetime Scopes
● Debugging is difficult
○ Zone.js stacktraces hard to read and debug
○ Observable-chains are hard to debug
○ => Challenges are similar to async code
● Performance Debugging Tools
Angular Shortcomings
Lessons Learned
The pleasures of CORS
● REST APIs + CORS don’t mix
well
○ Nobody uses Cookies anyway
○ APIs are meant to be called
from multiple origins
● Server Setup is complex and
has lots of details
● Lots of misinformation floating
around the Internet
Links
● REST Maturity Model: https://martinfowler.com/articles/richardsonMaturityModel.html
● File-ext-switcher VSCode extension:
https://github.com/JohannesRudolph/vscode-file-ext-switcher
● Angular CLI https://github.com/angular/angular-cli
● HAL Models Gist:
https://gist.github.com/JohannesRudolph/55160d2503b2369444a529429ff8a746
● Monomorpic JS: http://mrale.ph/blog/2015/01/11/whats-up-with-monomorphism.html
Mentioned in this Talk
Thank you!
We are hiring, ask me ;-)
Johannes Rudolph
jrudolph@meshcloud.io
www.meshcloud.io
@meshstack
@meshstack

Más contenido relacionado

La actualidad más candente

Free the Functions with Fn project!
Free the Functions with Fn project!Free the Functions with Fn project!
Free the Functions with Fn project!J On The Beach
 
Lamba scaffold webinar
Lamba scaffold webinarLamba scaffold webinar
Lamba scaffold webinarMatt Billock
 
Go Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii ShapovalGo Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii ShapovalGlobalLogic Ukraine
 
Next Generation Automation in Ruckus Wireless
Next Generation Automation in Ruckus WirelessNext Generation Automation in Ruckus Wireless
Next Generation Automation in Ruckus WirelessDavid Ko
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...mfrancis
 
GDG Algiers DevFest 2013 Cool AndroidLibs
GDG Algiers DevFest 2013 Cool AndroidLibsGDG Algiers DevFest 2013 Cool AndroidLibs
GDG Algiers DevFest 2013 Cool AndroidLibsnhachicha
 
Clang compiler `
Clang compiler `Clang compiler `
Clang compiler `Rabin BK
 
Front end microservices: architectures and solution
Front end microservices: architectures and solutionFront end microservices: architectures and solution
Front end microservices: architectures and solutionMikhail Kuznetcov
 
Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Koombea
 
NE Scala 2016 roundup
NE Scala 2016 roundupNE Scala 2016 roundup
NE Scala 2016 roundupHung Lin
 
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
Waylandifying Chromium: From downstream to shipping (ELCE 2020)Waylandifying Chromium: From downstream to shipping (ELCE 2020)
Waylandifying Chromium: From downstream to shipping (ELCE 2020)Igalia
 
Clang Analyzer Tool Review
Clang Analyzer Tool ReviewClang Analyzer Tool Review
Clang Analyzer Tool ReviewDoug Schuster
 
A little nginx (1)
A little nginx (1)A little nginx (1)
A little nginx (1)yang bingwu
 

La actualidad más candente (18)

Laravel workshop
Laravel workshopLaravel workshop
Laravel workshop
 
Free the Functions with Fn project!
Free the Functions with Fn project!Free the Functions with Fn project!
Free the Functions with Fn project!
 
Rethinking React
Rethinking ReactRethinking React
Rethinking React
 
Lamba scaffold webinar
Lamba scaffold webinarLamba scaffold webinar
Lamba scaffold webinar
 
Go Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii ShapovalGo Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii Shapoval
 
Next Generation Automation in Ruckus Wireless
Next Generation Automation in Ruckus WirelessNext Generation Automation in Ruckus Wireless
Next Generation Automation in Ruckus Wireless
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
Web Assembly
Web AssemblyWeb Assembly
Web Assembly
 
GDG Algiers DevFest 2013 Cool AndroidLibs
GDG Algiers DevFest 2013 Cool AndroidLibsGDG Algiers DevFest 2013 Cool AndroidLibs
GDG Algiers DevFest 2013 Cool AndroidLibs
 
Clang compiler `
Clang compiler `Clang compiler `
Clang compiler `
 
Front end microservices: architectures and solution
Front end microservices: architectures and solutionFront end microservices: architectures and solution
Front end microservices: architectures and solution
 
Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?
 
NE Scala 2016 roundup
NE Scala 2016 roundupNE Scala 2016 roundup
NE Scala 2016 roundup
 
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
Waylandifying Chromium: From downstream to shipping (ELCE 2020)Waylandifying Chromium: From downstream to shipping (ELCE 2020)
Waylandifying Chromium: From downstream to shipping (ELCE 2020)
 
Engineering Frontends
Engineering FrontendsEngineering Frontends
Engineering Frontends
 
Clang Analyzer Tool Review
Clang Analyzer Tool ReviewClang Analyzer Tool Review
Clang Analyzer Tool Review
 
A little nginx (1)
A little nginx (1)A little nginx (1)
A little nginx (1)
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 

Destacado

Destacado (6)

Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
 
Introduction angular2 français
Introduction angular2 françaisIntroduction angular2 français
Introduction angular2 français
 
Angular2
Angular2Angular2
Angular2
 
Angular 2
Angular 2Angular 2
Angular 2
 
Angular2 workshop
Angular2 workshopAngular2 workshop
Angular2 workshop
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similar a Angular2 - A story from the trenches

Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraLINAGORA
 
CON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornCON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornMichel Graciano
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleDmytro Semenov
 
introduction to micro services
introduction to micro servicesintroduction to micro services
introduction to micro servicesSpyros Lambrinidis
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionJohn Archer
 
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...NETWAYS
 
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...NETWAYS
 
Building RESTtful services in MEAN
Building RESTtful services in MEANBuilding RESTtful services in MEAN
Building RESTtful services in MEANMadhukara Phatak
 
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]Leonardo Zanivan
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Giovanni Toraldo
 
The working architecture of NodeJs applications
The working architecture of NodeJs applicationsThe working architecture of NodeJs applications
The working architecture of NodeJs applicationsViktor Turskyi
 
Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015aspyker
 
Future of Microservices - Jakub Hadvig
Future of Microservices - Jakub HadvigFuture of Microservices - Jakub Hadvig
Future of Microservices - Jakub HadvigWEBtlak
 
The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)Oracle Developers
 
JS digest. November 2017
JS digest. November 2017JS digest. November 2017
JS digest. November 2017ElifTech
 
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020OdessaJS Conf
 

Similar a Angular2 - A story from the trenches (20)

Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
CON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornCON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project Nashorn
 
Node.js scaling in highload
Node.js scaling in highloadNode.js scaling in highload
Node.js scaling in highload
 
Node.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scaleNode.js Web Apps @ ebay scale
Node.js Web Apps @ ebay scale
 
introduction to micro services
introduction to micro servicesintroduction to micro services
introduction to micro services
 
Red Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus IntroductionRed Hat Java Update and Quarkus Introduction
Red Hat Java Update and Quarkus Introduction
 
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...
OSDC 2016 | rkt and Kubernetes: What’s new with Container Runtimes and Orches...
 
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
 
Building RESTtful services in MEAN
Building RESTtful services in MEANBuilding RESTtful services in MEAN
Building RESTtful services in MEAN
 
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
 
Cloud Native API Design and Management
Cloud Native API Design and ManagementCloud Native API Design and Management
Cloud Native API Design and Management
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)
 
The working architecture of NodeJs applications
The working architecture of NodeJs applicationsThe working architecture of NodeJs applications
The working architecture of NodeJs applications
 
Node.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniquesNode.js Course 2 of 2 - Advanced techniques
Node.js Course 2 of 2 - Advanced techniques
 
Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015
 
Future of Microservices - Jakub Hadvig
Future of Microservices - Jakub HadvigFuture of Microservices - Jakub Hadvig
Future of Microservices - Jakub Hadvig
 
Dust.js
Dust.jsDust.js
Dust.js
 
The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)The Fn Project: A Quick Introduction (December 2017)
The Fn Project: A Quick Introduction (December 2017)
 
JS digest. November 2017
JS digest. November 2017JS digest. November 2017
JS digest. November 2017
 
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
 

Último

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Último (20)

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Angular2 - A story from the trenches

  • 1. Angular (2) A Story from the Trenches Johannes Rudolph, MSc Software Platform & Development @ Meshcloud jrudolph@meshcloud.io www.meshcloud.io
  • 3. Cloud Platform Integration Overview MeshPanel User Interface Platform Modules Service Modules Identity Broker MeshFed Project Management User Management Cloud Platform Access direct API access
  • 4. Meshpanel ● Target Evergreen Browsers Only (Edge, FF, Safari, Chrome) ● SPA with Angular 2 ● Angular-CLI (webpack2) for builds ● SCSS ● Bootstrap 4 (alpha!) ● yarn as package manager Tech Stack
  • 5. Meshpanel ● Concourse CI ● CloudFoundry using Staticfile Buildpack Deployment
  • 6. Angular (2) ● Announced at ng-Europe 09/2014 ○ Complete rewrite ○ Embraces ES6 / TypeScript ○ Ahead-of-time Compiler for Component Templates ■ No more $scope, controllers ■ -> No generic change detector checking the whole $scope ■ -> Generates Monomorphic Change Detector Code ○ One-way data flow ○ Modular Framework: tree-shaking ● Beta in 12/2015 ● 1.0 (ha! 2.0 of course) in 09/2016 A short recap of its turbulent history
  • 7. Ohhh the Betas! ● Development started on RC.1 ○ Multiple breaking changes ○ Complete rewrite for RC.6 ● Angular CLI ○ Switched build system (broccoli->webpack) midway ○ Broke multiple times ○ Performance was an issue (not anymore) ● Bootstrap 4 ○ Relatively painless, minor bugs remain The price of living on the leading edge Cliff Lookout by David Niblack. CC License
  • 8. Angular ● Drastically simplified core concepts ○ Component (js+css+html) and Component Tree ○ Directive (attaches to DOM) ○ Service (injectable via DI) ○ Module (Lazy Loading + Tree Shaking) ● Semantic Versioning works ○ Upgrades v2.x.y painless so far ● Deep integration with RXJS ● Module Structure and Lazy Loading The good Parts I
  • 10. Excursion: Lazy Loading OS Module Module Structure Core (Sessions, Routing, ...) Auth-Mesh Auth-Direct OS Module CF Module Nova Cinder ... Projects Registration BillingApps Services
  • 11. Excursion: Lazy Loading Full AOT and Tree Shaking for Production Angular+libs First bundle Preloading Feature Modules
  • 12. Excursion: Observables ● Has a learning curve ○ hot/cold Observables ○ complete/error/next ● Version confusion strikes again ○ https://github.com/Reactive-Extensions/RxJS v4 “legacy” ○ https://github.com/ReactiveX/rxjs => v5 and current ● Operations neatly composable ○ Error propagation just works ○ Avoids bugs ○ Can quickly implement complex behaviors RXJS ftw!
  • 13. Angular The good Parts II ● TypeScript gives huge productivity boost ○ IntelliSense / Code Completion ○ Live type-checking in the Editor ● AOT Compilation + Tree Shaking ○ Great Performance ○ Type Checking of Module Dependencies ● Data-Bindings are Lintable ○ Type Checking at compile time with tslint/codelyzer ● Angular CLI ○ Generates scaffolding ○ Abstracts away webpack2
  • 14. Angular + HATEOAS ● “Level 3” REST API ● No Client-Side Link Building ○ Server offers all Links ● Why? ○ “Discoverable API” ○ No URL fiddling in clients ○ Easy API Versioning ○ Enforcing API Consistency ● HAL Models ○ Hypertext Application Language Hypermedia as the Engine of Application State
  • 15. Angular + HATEOAS Use TypeScript 2.1 Tricks to encode HAL Models Demo
  • 16. Lessons Learned ● Module Boundaries not enforced ○ Angular Modules only relevant for AOT, DI and lazy loading ○ TS Files are still individual modules ● Dependency Injection ○ Singletons only, no Lifetime Scopes ● Debugging is difficult ○ Zone.js stacktraces hard to read and debug ○ Observable-chains are hard to debug ○ => Challenges are similar to async code ● Performance Debugging Tools Angular Shortcomings
  • 17. Lessons Learned The pleasures of CORS ● REST APIs + CORS don’t mix well ○ Nobody uses Cookies anyway ○ APIs are meant to be called from multiple origins ● Server Setup is complex and has lots of details ● Lots of misinformation floating around the Internet
  • 18. Links ● REST Maturity Model: https://martinfowler.com/articles/richardsonMaturityModel.html ● File-ext-switcher VSCode extension: https://github.com/JohannesRudolph/vscode-file-ext-switcher ● Angular CLI https://github.com/angular/angular-cli ● HAL Models Gist: https://gist.github.com/JohannesRudolph/55160d2503b2369444a529429ff8a746 ● Monomorpic JS: http://mrale.ph/blog/2015/01/11/whats-up-with-monomorphism.html Mentioned in this Talk
  • 19. Thank you! We are hiring, ask me ;-) Johannes Rudolph jrudolph@meshcloud.io www.meshcloud.io @meshstack @meshstack