SlideShare una empresa de Scribd logo
1 de 27
Challenges of
Angular in production
Tasos Bekos
Frontend Architect @ ZuluTrade
Tasos Bekos
Frontend Architect
ZuluTrade Angular-UI Bootstrapng-lightning
@tbekos
@bekos
Why Angular?
 Dependency Injection (DI)
 Template syntax
 Universal (SSR)
 Google Team/AngularJS
VS
Problems we faced
 Learning curve
 Training / Recruiting
 Breaking changes
 Missing libraries / resources
ng-lightning (https://github.com/ng-lightning/ng-lightning)
Angular components & directives for Salesforce's Lightning Design System.
 Stateless functional components
 Accessibility
Great for collaboration
 Declarative syntax
 Designer friendly
 Typescript
 Decorators
Application Architecture
 Maintainability
 Scalability
 Performance
“...decisions that are hard to change”
Martin Fowler
Maintainability
 Testability
 Karma
 Protractor
 Automation
 Build: Webpack / Gulp
 Deployment: Jenkins
 Pair programming / Code reviews
Scalability
 Redux (ngrx/store)
 Explicit update
 DevTools plugin
 Vertical separation of concerns
 Modules
 Typescript / Templates
 Horizontal separation of concerns
 Components
 Services
 API layer (Facade to backend services)
 Store layer (Reducers)
Pure UI Components (onPush)
Container UI components (async pipe)
Services
Store API services (Facade)Reducer
Stream of immutable state slices
ActionState Backend response
Function calls
Parameters
High level action/data flow
@Output@Input
Performance
 Startup
 Download time
 Parse and compile time
 Runtime
 Javascript / CSS calculations
Startup Performance
1. Measure and inspect
2. Reduce size
3. Optimize code & delivery
4. Lazy loading
Measure & inspect
 webpagetest.org
 Chrome Timeline
 Webpack Bundle Analyzer
Reduce size
 Do not overuse libraries
 You don't (may not) need Lodash
 Make use of native
 Replicate small stuff
 Reward good behaviour
 Polyfill.io
 Don’t overuse components
 Can we achieve the same result with HTML/CSS?
 Typescript helpers
 --importHelpers with --noEmitHelpers
import { Observable } from ‘rxjs/Rx';
import { find } from ‘lodash';
import { Observable } from ‘rxjs/Observable';
import find from ‘lodash-es/find'; // Just use ES6 find!!
Modular libraries
Optimize code & delivery
 Precompilation
 Ahead of Time compilation
 optimize-js
 Treeshaking
 Webpack 2
 Closure
 CDN
 publicPath: `https://mycdn.com/`
Lazy loading
 Code splitting
 Router
 System.import / import()
 Modals, Tabs, ...
 preload, prefetch
 preloadingStrategy: PreloadAllModules
 GoogleChrome/preload-webpack-plugin
 Timing 3rd party dependencies
 Wrap external libraries, take advantage of lifecycle hooks
const routes: Routes = [
...
{ path: 'trader', loadChildren: './trader/trader.module#ZlTraderModule?chunkName=trader' },
];
plugins = [
...
new HtmlWebpackPlugin(),
new PreloadWebpackPlugin({
rel: ‘prefetch’,
as: ‘script’
include: [‘trader’],
})
];
Runtime Performance
 enableProdMode
 Ahead of Time compilation (AoT)
 Change detection
 OnPush
 detach/reattach
 Τake advantage of Router
 Reduce DOM size
 NgZone: runOutsideAngular
 Pure pipes, trackBy…
Future
i18n during compilation time
Service workers
Server side rendering
Angular ^4
Closure compiler for AoT
Thank you!

Más contenido relacionado

La actualidad más candente

Host, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsHost, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsJose Javier Columbie
 
Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.John Dalziel
 
Introduction to blogging with Jekyll
Introduction to blogging with JekyllIntroduction to blogging with Jekyll
Introduction to blogging with JekyllEric Lathrop
 
UXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXUXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXStoian Dipchikov
 
Jekyll Presentation Slides
Jekyll Presentation SlidesJekyll Presentation Slides
Jekyll Presentation SlidesCurtis Miller
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQRest West
 
How to build a web application with Polymer
How to build a web application with PolymerHow to build a web application with Polymer
How to build a web application with PolymerSami Suo-Heikki
 
Polymer and web component
Polymer and web componentPolymer and web component
Polymer and web componentImam Raza
 
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi   SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi Sencha
 
Cloud browser testing with Gradle and Geb
Cloud browser testing with Gradle and GebCloud browser testing with Gradle and Geb
Cloud browser testing with Gradle and GebDavid Carr
 
Amazon.com's Web Services Opportunity
Amazon.com's Web Services OpportunityAmazon.com's Web Services Opportunity
Amazon.com's Web Services OpportunityTim O'Reilly
 
About Caching
About CachingAbout Caching
About CachingWeng Wei
 
Expert guide for PHP
Expert guide for PHPExpert guide for PHP
Expert guide for PHPSteve Fort
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business HeadsYash Mody
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its EvolutionDeepu S Nath
 

La actualidad más candente (20)

Host, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server AppsHost, deploy & scale Blazor Server Apps
Host, deploy & scale Blazor Server Apps
 
Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.Fast Slim Correct: The History and Evolution of JavaScript.
Fast Slim Correct: The History and Evolution of JavaScript.
 
Introduction to blogging with Jekyll
Introduction to blogging with JekyllIntroduction to blogging with Jekyll
Introduction to blogging with Jekyll
 
Jekyll, static websites generator
Jekyll, static websites generatorJekyll, static websites generator
Jekyll, static websites generator
 
UXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UXUXify 2015 - Front-end Developers' Checklist for Better UX
UXify 2015 - Front-end Developers' Checklist for Better UX
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
 
Jekyll Presentation Slides
Jekyll Presentation SlidesJekyll Presentation Slides
Jekyll Presentation Slides
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQ
 
How to build a web application with Polymer
How to build a web application with PolymerHow to build a web application with Polymer
How to build a web application with Polymer
 
Polymer and web component
Polymer and web componentPolymer and web component
Polymer and web component
 
T5 Oli Aro
T5 Oli AroT5 Oli Aro
T5 Oli Aro
 
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi   SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
SenchaCon 2016: The Modern Toolchain - Ross Gerbasi
 
Cloud browser testing with Gradle and Geb
Cloud browser testing with Gradle and GebCloud browser testing with Gradle and Geb
Cloud browser testing with Gradle and Geb
 
Ch. x web performance
Ch. x web performanceCh. x web performance
Ch. x web performance
 
Amazon.com's Web Services Opportunity
Amazon.com's Web Services OpportunityAmazon.com's Web Services Opportunity
Amazon.com's Web Services Opportunity
 
About Caching
About CachingAbout Caching
About Caching
 
Polymer
PolymerPolymer
Polymer
 
Expert guide for PHP
Expert guide for PHPExpert guide for PHP
Expert guide for PHP
 
Adobe AEM for Business Heads
Adobe AEM for Business HeadsAdobe AEM for Business Heads
Adobe AEM for Business Heads
 
Javascript Myths and its Evolution
Javascript Myths and its  EvolutionJavascript Myths and its  Evolution
Javascript Myths and its Evolution
 

Destacado

The case for HTTP/2
The case for HTTP/2The case for HTTP/2
The case for HTTP/2GreeceJS
 
Ellak JavaScript Day
Ellak JavaScript DayEllak JavaScript Day
Ellak JavaScript DayGreeceJS
 
The history of asynchronous JavaScript
The history of asynchronous JavaScriptThe history of asynchronous JavaScript
The history of asynchronous JavaScriptGreeceJS
 
The tools & technologies behind Resin.io
The tools & technologies behind Resin.ioThe tools & technologies behind Resin.io
The tools & technologies behind Resin.ioGreeceJS
 
GraphQL vs REST
GraphQL vs RESTGraphQL vs REST
GraphQL vs RESTGreeceJS
 
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7While42
 

Destacado (6)

The case for HTTP/2
The case for HTTP/2The case for HTTP/2
The case for HTTP/2
 
Ellak JavaScript Day
Ellak JavaScript DayEllak JavaScript Day
Ellak JavaScript Day
 
The history of asynchronous JavaScript
The history of asynchronous JavaScriptThe history of asynchronous JavaScript
The history of asynchronous JavaScript
 
The tools & technologies behind Resin.io
The tools & technologies behind Resin.ioThe tools & technologies behind Resin.io
The tools & technologies behind Resin.io
 
GraphQL vs REST
GraphQL vs RESTGraphQL vs REST
GraphQL vs REST
 
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
 

Similar a Challenges of angular in production (Tasos Bekos) - GreeceJS #17

Vue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrareVue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrareAndrea Campaci
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack DiscussionZaiyang Li
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedGil Fink
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Codemotion
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Matt Raible
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arpGary Pedretti
 
Leveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in GutenbergLeveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in GutenbergFelix Arntz
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on RailsViridians
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSAlberto Paro
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsScala Italy
 
ReactJS or Angular
ReactJS or AngularReactJS or Angular
ReactJS or Angularboyney123
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Lucas Jellema
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksSunil Patil
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworksSunil Patil
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang YoonJesang Yoon
 
My weekend startup: seocrawler.co
My weekend startup: seocrawler.coMy weekend startup: seocrawler.co
My weekend startup: seocrawler.coHrvoje Hudoletnjak
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildwebLeo Zhou
 
Brane.Storm
Brane.StormBrane.Storm
Brane.Stormkturgut
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...Andrei Sebastian Cîmpean
 

Similar a Challenges of angular in production (Tasos Bekos) - GreeceJS #17 (20)

Vue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrareVue3: nuove funzionalità, differenze e come migrare
Vue3: nuove funzionalità, differenze e come migrare
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
 
Leveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in GutenbergLeveraging the Power of Custom Elements in Gutenberg
Leveraging the Power of Custom Elements in Gutenberg
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on Rails
 
Scala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJSScala Italy 2015 - Hands On ScalaJS
Scala Italy 2015 - Hands On ScalaJS
 
Alberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.jsAlberto Paro - Hands on Scala.js
Alberto Paro - Hands on Scala.js
 
ReactJS or Angular
ReactJS or AngularReactJS or Angular
ReactJS or Angular
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
 
Sexy React Stack
Sexy React StackSexy React Stack
Sexy React Stack
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
My weekend startup: seocrawler.co
My weekend startup: seocrawler.coMy weekend startup: seocrawler.co
My weekend startup: seocrawler.co
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb
 
Brane.Storm
Brane.StormBrane.Storm
Brane.Storm
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...
 

Más de GreeceJS

Introduction to react-query. A Redux alternative? (Nikos Kleidis, Front End D...
Introduction to react-query. A Redux alternative? (Nikos Kleidis, Front End D...Introduction to react-query. A Redux alternative? (Nikos Kleidis, Front End D...
Introduction to react-query. A Redux alternative? (Nikos Kleidis, Front End D...GreeceJS
 
Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...
Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...
Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...GreeceJS
 
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...GreeceJS
 
Under the hood of RxJS (Dimitris Livas) - GreeceJS #27
Under the hood of RxJS (Dimitris Livas) - GreeceJS #27Under the hood of RxJS (Dimitris Livas) - GreeceJS #27
Under the hood of RxJS (Dimitris Livas) - GreeceJS #27GreeceJS
 
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...GreeceJS
 
Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...
Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...
Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...GreeceJS
 
TypeScript: JavaScript that scales (Kostas Stergiou) - GreeceJS #22
TypeScript: JavaScript that scales (Kostas Stergiou) - GreeceJS #22TypeScript: JavaScript that scales (Kostas Stergiou) - GreeceJS #22
TypeScript: JavaScript that scales (Kostas Stergiou) - GreeceJS #22GreeceJS
 
Migrating from Monolithic to Serverless (Kostas Katsikas) - GreeceJS #22
Migrating from Monolithic to Serverless (Kostas Katsikas) - GreeceJS #22Migrating from Monolithic to Serverless (Kostas Katsikas) - GreeceJS #22
Migrating from Monolithic to Serverless (Kostas Katsikas) - GreeceJS #22GreeceJS
 
Taming forms with React
Taming forms with ReactTaming forms with React
Taming forms with ReactGreeceJS
 
The JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumThe JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumGreeceJS
 
Modern web development and accessibility (Christina Papadimitriou, Nadia Mark...
Modern web development and accessibility (Christina Papadimitriou, Nadia Mark...Modern web development and accessibility (Christina Papadimitriou, Nadia Mark...
Modern web development and accessibility (Christina Papadimitriou, Nadia Mark...GreeceJS
 
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)GreeceJS
 
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15GreeceJS
 

Más de GreeceJS (13)

Introduction to react-query. A Redux alternative? (Nikos Kleidis, Front End D...
Introduction to react-query. A Redux alternative? (Nikos Kleidis, Front End D...Introduction to react-query. A Redux alternative? (Nikos Kleidis, Front End D...
Introduction to react-query. A Redux alternative? (Nikos Kleidis, Front End D...
 
Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...
Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...
Next.js and the pursuit of happiness (Dimitris Michalakos, Lead Developer at ...
 
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
An Emoji Introduction to React Native (Panagiotis Vourtsis, Senior Front End ...
 
Under the hood of RxJS (Dimitris Livas) - GreeceJS #27
Under the hood of RxJS (Dimitris Livas) - GreeceJS #27Under the hood of RxJS (Dimitris Livas) - GreeceJS #27
Under the hood of RxJS (Dimitris Livas) - GreeceJS #27
 
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
 
Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...
Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...
Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...
 
TypeScript: JavaScript that scales (Kostas Stergiou) - GreeceJS #22
TypeScript: JavaScript that scales (Kostas Stergiou) - GreeceJS #22TypeScript: JavaScript that scales (Kostas Stergiou) - GreeceJS #22
TypeScript: JavaScript that scales (Kostas Stergiou) - GreeceJS #22
 
Migrating from Monolithic to Serverless (Kostas Katsikas) - GreeceJS #22
Migrating from Monolithic to Serverless (Kostas Katsikas) - GreeceJS #22Migrating from Monolithic to Serverless (Kostas Katsikas) - GreeceJS #22
Migrating from Monolithic to Serverless (Kostas Katsikas) - GreeceJS #22
 
Taming forms with React
Taming forms with ReactTaming forms with React
Taming forms with React
 
The JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumThe JavaScript toolset for development on Ethereum
The JavaScript toolset for development on Ethereum
 
Modern web development and accessibility (Christina Papadimitriou, Nadia Mark...
Modern web development and accessibility (Christina Papadimitriou, Nadia Mark...Modern web development and accessibility (Christina Papadimitriou, Nadia Mark...
Modern web development and accessibility (Christina Papadimitriou, Nadia Mark...
 
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
 
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
 

Último

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Último (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

Challenges of angular in production (Tasos Bekos) - GreeceJS #17

  • 1. Challenges of Angular in production Tasos Bekos Frontend Architect @ ZuluTrade
  • 2. Tasos Bekos Frontend Architect ZuluTrade Angular-UI Bootstrapng-lightning @tbekos @bekos
  • 3. Why Angular?  Dependency Injection (DI)  Template syntax  Universal (SSR)  Google Team/AngularJS
  • 4. VS
  • 5. Problems we faced  Learning curve  Training / Recruiting  Breaking changes  Missing libraries / resources
  • 6. ng-lightning (https://github.com/ng-lightning/ng-lightning) Angular components & directives for Salesforce's Lightning Design System.  Stateless functional components  Accessibility
  • 7. Great for collaboration  Declarative syntax  Designer friendly  Typescript  Decorators
  • 8. Application Architecture  Maintainability  Scalability  Performance “...decisions that are hard to change” Martin Fowler
  • 9. Maintainability  Testability  Karma  Protractor  Automation  Build: Webpack / Gulp  Deployment: Jenkins  Pair programming / Code reviews
  • 10. Scalability  Redux (ngrx/store)  Explicit update  DevTools plugin  Vertical separation of concerns  Modules  Typescript / Templates  Horizontal separation of concerns  Components  Services  API layer (Facade to backend services)  Store layer (Reducers)
  • 11. Pure UI Components (onPush) Container UI components (async pipe) Services Store API services (Facade)Reducer Stream of immutable state slices ActionState Backend response Function calls Parameters High level action/data flow @Output@Input
  • 12. Performance  Startup  Download time  Parse and compile time  Runtime  Javascript / CSS calculations
  • 13.
  • 14. Startup Performance 1. Measure and inspect 2. Reduce size 3. Optimize code & delivery 4. Lazy loading
  • 15. Measure & inspect  webpagetest.org  Chrome Timeline  Webpack Bundle Analyzer
  • 16.
  • 17.
  • 18. Reduce size  Do not overuse libraries  You don't (may not) need Lodash  Make use of native  Replicate small stuff  Reward good behaviour  Polyfill.io  Don’t overuse components  Can we achieve the same result with HTML/CSS?  Typescript helpers  --importHelpers with --noEmitHelpers
  • 19. import { Observable } from ‘rxjs/Rx'; import { find } from ‘lodash'; import { Observable } from ‘rxjs/Observable'; import find from ‘lodash-es/find'; // Just use ES6 find!! Modular libraries
  • 20. Optimize code & delivery  Precompilation  Ahead of Time compilation  optimize-js  Treeshaking  Webpack 2  Closure  CDN  publicPath: `https://mycdn.com/`
  • 21. Lazy loading  Code splitting  Router  System.import / import()  Modals, Tabs, ...  preload, prefetch  preloadingStrategy: PreloadAllModules  GoogleChrome/preload-webpack-plugin  Timing 3rd party dependencies  Wrap external libraries, take advantage of lifecycle hooks
  • 22. const routes: Routes = [ ... { path: 'trader', loadChildren: './trader/trader.module#ZlTraderModule?chunkName=trader' }, ]; plugins = [ ... new HtmlWebpackPlugin(), new PreloadWebpackPlugin({ rel: ‘prefetch’, as: ‘script’ include: [‘trader’], }) ];
  • 23.
  • 24.
  • 25. Runtime Performance  enableProdMode  Ahead of Time compilation (AoT)  Change detection  OnPush  detach/reattach  Τake advantage of Router  Reduce DOM size  NgZone: runOutsideAngular  Pure pipes, trackBy…
  • 26. Future i18n during compilation time Service workers Server side rendering Angular ^4 Closure compiler for AoT

Notas del editor

  1. Ευχαριστω GreeceJS για φιλοξενία Περι τινος προκειται: Αποφαση με management για μοντερνο stack, απο .ΝΕΤ. Public εδω και λιγο καιρο. Δυσκολη συνύπαρξη. DISCLAIMER: Not framework comparison No Angular tutorial Personal experiences, has worked for us
  2. 3 χρονια Frontend Architect ZuluTrade. Opensource active NPM modules Angular UI Bootstrap και τελευταία εχουμε βγάλει opensource το ng-lightning, μια παρόμοια βιβλιοθήκη με UI components σε Angular 2, και βασισμένα στο SLDS και για την όποια θα μιλήσουμε λίγο πιο αναλυτικά και παρακάτω. **** Avatar
  3. Γιατι οχι React, Polymer κτλ Κοινα προβληματα για κάθε JS framework, πιο συγκεκριμένα πως τα αντιμετωπίζουμε εμεις στο Angular ecosystem. Πολυ νωρις η αποφαση, Alpha/Beta. Λιγες πληροφορίες. Επιτυχημενη προηγούμενη εμπειρια που είχαμε με το Angular 1. ALL IN ONE = better for enterprises, forms, router, animations, i18n …. DI = responsible to setup the application for you, you just define the dependencies of your service or component in the constructor, and Angular is going to take care of instantiating appropriate object. Βοηθαει στο mocking των dependencies στο testing. Ηδη πολυ ισχυρη, => πιο καθαρή. SSR, απο day 1, ...we care a lot about SEO! Socail trading platform!!! Universal was always lacking behind, has been rewritten several times, and now is migrating to core => ιt will be very easy to use. DOM dehydration? Preboot.js replays events. Ηδη επιτυχια .... Απλώς καλύτερο...Distilled all the best practices of Angular 1.x into Angular 2
  4. Give me an estimation! Documentation! Router!!! RC5 => NgModules
  5. Angular 1 !== Angular 2 Best practices from community RxJS Redux tsconfig Nα ξερουν ήδη ή να ενδιαφερονται να επενδυσουν σε μια βιβλιοθηκη που ήταν ακομα σε beta και ενω το react ηταν το πιο hot topping εκεινο τον καιρό :-) Ετσι, καταληξαμε στο οτι θα ήταν ευκολοτερο να κανουμε train developers εντος της εταιριας, που και αυτο είχε προβληματα δίοτι απασχολουταν ενας senior developer στο να κάνει train junior, αλλα και δεν εχουν ολοι οι developers το ιδιο skillset ωστε να κανουν adapt τοσο γρηγορα και τοσα πολλα πραγματα όσα απαιτουνται σε μια τετοια αλλαγη. Documentation UI βιβλιοθηκες Router εχει γραφτει 2-3 φορες from scratch, RC5 => NgModules χρειατηκαν πολλες ώρες. AoT Ψυχολογία!
  6. Living style guide. Flexbox => Not IE10 Learning resource! Advanced Angular.
  7. Tι δούλεψε καλά, και πως η επιλογή του Angular μας βοήθησε. (σε μεγαλο προτζεκτ), διαφορετικα skillset & level Templates => δηλωνουμε το τι θελουμε και αφηνουμε στο framework να αποφασίσει το πως θα το καταφέρει. 1ον λίγοτερη πιθανότητα για bugs 2ον μειώνεται ο χρονος που χρειαζεται να γίνει παραγωγικός. Xωρις coding skills. Πόσοι έχουν την τυχη να δουλευουν με designers που ξέρουν HTML/CSS :-) Developer που ασχολειται με το CSS/styling, ή το responsiveness Τοοls/IDE => autocompletion, navigation, refactoring σε μεγαλα code bases σχετικα ευκολα, και με τη βοηθεια των Languages services μπορουμε να εχουμε autocpmpletion και validation στα templates. Superset της ES6, νοιωθει πολυ “φυσικο” Type system ειναι τελειως optional, έχω παρατηρήσει οτι το προτιμαμε πια Declarative programming μεσα στην TS Γρηγορη κατανόση του σκοπου καθε κλάσης ή καθε property Μείωση του απαιτουμενου κώδικα σε καθε αρχειο.
  8. Πολυ high level, αλλα οταν σχεδιαζεις θες: Maintainability => #1 rule, don’t want to rewrite everything every 1 year!, = quality (ie readability, testability, reasoning, περηφανια) Scalability => people and code. If you want performance, you should PLAN for performance. Scale codebase Πρωτοκολλο για τους developers Που βαζω αυτο το κομματι κώδικα? Πως αλλαζω το στατε? Πως επικοινωνω με το backend?
  9. Works well with DI Starters/ CLI 1.0 If a senior dev is not mentoring/pairing with other devs, you're wasting critical business value. Eric Elliot ΚΟΣΤΟΣ/ΡΙΣΚΟ
  10. Angular provides a nice, declarative way to bind to observables using the async pipe: Separation of concerns => παραλληλη εργασια on different aspects of the same feature….velocity ομαδας Reduce bug leaking Reduce dependencies between Componentized approach…. Ολο UI αναπαρισταται απο δiaφoρα μικρα elements = components = black box, Den mas endiaferei pos einai sxediasmeno/ulopoiimeno eswterika alla μονο πως κανει interact με το εξωτερικο περιβαλλον
  11. High level architecture. Living thing...always changing, hope improving. Works for us, may not work for you. Observable.combineLatest(this.list$, this.loading$) It’s a micro library which provides a reactive state management inspired by redux and plays really well with Angular. In short, with @ngrx/store we can think of the redux’s store as a stream of immutable objects. Each time you emit an action which gets handled by a reducer, the new state will be emitted through a stream. The different streams can be filtered, merged, mapped, etc. in a very elegant way. On top of that,
  12. Start-up performance matters. A combination of slow parse, compile and execution times can be a real bottleneck for pages that wish to boot-up quickly. NOT minifying CSS, optimizing images, use svg sprites etc. reduce HTTP requests JS => MAIN reason for slowness. Θα δουμε πως μπορουμε να Measure και πως να γινει faster. This is about shipping less JS, or even ship the same JS in different way and/or timing, so we will offer tha same Size is a big factor, NOT the only one. Runtime => an event is happening, button is clicked, socket message, ποση ωρα κανουμε να δείξουμε την αλλαγή?
  13. Lazy loading: Spread the functionality of the entire application among: Main bundle which includes functionality used across the entire application. Feature bundles which capture functionality from separate “bounded contexts”.
  14. Be a benchmark maniac! Ουδετερος παρατηρητης, μπορεις να τρεξεις με τις ιδιες συνθηκες καθε φορα, πολλα metrics (time to interaction, first meaningful paint…) Works on your machine, suitable for development. See inside your bundles, alternative: source-map-explorer
  15. Be a benchmark maniac! Bundle of Doom!
  16. Polyfill.io maintained by financial times….It works via User-Agent sniffing to determine the browser being used, then loads the required polyfills. Chrome, Firefox: 1KB, IE11: 20KB, suggested solution for Intl in Safari Modular libraries…. Rxjs/Observable Smaller alternatives Drop Immutable, just Map. Typescript will generate helper code in every one file. This can be a problem when dealing with code coverage or payload size of you library/app
  17. Minification, Gzip is out of question  AoT => drop compiler, tree shakeable, template errors early. This reduces the size a bit (but on the other hand we get all the ngfactories). Warning: compilation generates a lot of code! Optimized code, 10x size, 3-4x size gzip, -5x evaluation time, 450KB ~ 50ms => greatest impact over the user experience. The Optimize JS lazy-parsing parens ‘hack’
  18. Declarative code splitting with Router per module. Manual code splitting, works well with libraries. Splitting opportunites…per modal, per tab Preload, prefetch => discover resources early, avoid idle times, server can send preload headers! Intercom is 1MB of JS Higharts, Socket…
  19. Extreme painting, animations, game? x5 Angular 1 => trading station!!! To avoid unnecessary DOM modifications, the router will reuse the components when the parameters of the corresponding routes change. ngIf, tabs