SlideShare a Scribd company logo
Upgrading Angular
Chris Nicola
CTO @ WealthBar
• Much better architecture/design
compared with 1.x
• Performance improvements
• Still “Angular-like”, to keep much the same
code organization
Why are we doing this?‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ The Future…
What about React?
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ The Future…
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ The Future…
Would I pick Angular Again?
‣ Why A2?
‣ Experience
‣ ngForward
‣ ngUpgrade
‣ The Good
‣ The Bad
‣ Preparation
‣ Patterns
‣ The Future…
• Converted AngularD3 1.x -> 2.x (aka A2D3)
• Tested out ngForward and ngUpgrade
• Upgraded existing 1.x code using
ngUpgrade
• Proof of concept mobile apps with Ionic 2
and NativeScript
Experience So Far…
‣ Why A2?
‣ Experience
‣ ngForward
‣ ngUpgrade
‣ The Good
‣ The Bad
‣ Preparation
‣ Patterns
‣ The Future…
• Write Angular 1.x components with 2.x
syntax
• If you don’t want to include Angular 2.x yet
• Templates and core directives are still 1.x
syntax
• Personally I do not find this approach useful
‣ Why A2?
‣ Experience
‣ ngForward
‣ ngUpgrade
‣ The Good
‣ The Bad
‣ Preparation
‣ Patterns
‣ The Future…
• Upgrade Angular 1.x directives, components and
services to use with Angular 2.x
• Downgrade Angular 2.x directives, components and
services to use with Angular 1.x
• Does not work with Filters/Pipes (easy to
workaround)
• 100% Angular 2.x support
• My recommended approach to upgrading
‣ Why A2?
‣ Experience
‣ ngForward
‣ ngUpgrade
‣ The Good
‣ The Bad
‣ Preparation
‣ Patterns
‣ The Future…
• Glad to be rid of `ctrl.`,`$scope` and even
Controllers
• Reactive Programming with RxJS
• LifeCycle events
• One directional data by default
• ngUpgrade works surprisingly well
‣ Why A2?
‣ Experience
‣ ngForward
‣ ngUpgrade
‣ The Good
‣ The Bad
‣ Preparation
‣ Patterns
‣ The Future…
• Too Big! >100kb minified+gzip
• Beta is still unstable
• Error messages are still hopeless
• So. Much. Static. Typing. aka “React
Enterprise Edition”
‣ Why A2?
‣ Experience
‣ Preparation
‣ Webpack
‣ ES6 or TS
‣ Organize
‣ Refactor
‣ Patterns
‣ The Future…
• You’re going to need a module loader!
• Webpack is arguably best-in-class
• Wide support for assets TS, ES6, HTML,
CSS, images, etc., etc., etc.
• Flexible, extensible, relatively easy to use
‣ Why A2?
‣ Experience
‣ Preparation
‣ Webpack
‣ ES6 or TS
‣ Organize
‣ Refactor
‣ Patterns
‣ The Future…
• Use Babel or Typescript
• Better get used Types and annotations
• aka React Enterprise Edition™
• My recommendation: Typescript
‣ Why A2?
‣ Experience
‣ Preparation
‣ Webpack
‣ ES6 or TS
‣ Organize
‣ Refactor
‣ Patterns
‣ The Future…
• Angular Style Guide https://github.com/johnpapa/angular-
styleguide
• Organize by component/features
• /component/component-name
• index.(ts|js) is the component root
• Include templates, styles and component specific services
• Organize shared code under “core” or “lib”
• Core services (e.g. Data/API)
• Attribute Directives
• Filters/Pipes
‣ Why A2?
‣ Experience
‣ Preparation
‣ Webpack
‣ ES6 or TS
‣ Organize
‣ Refactor
‣ Patterns
‣ The Future…
- app
- index.ts
- services
- index.ts
- resources.ts
- geolocation.ts
- filters/pipes
- date.ts
- directives
- highlight.ts
- float_label.ts
- components
- calendar
- index.ts
- calendar.html
- calendar.scss
- calendar_service.ts
- calculator
- index.ts
- template.html
- styles.css
- calculation_engine.ts
‣ Why A2?
‣ Experience
‣ Preparation
‣ Webpack
‣ ES6 or TS
‣ Organize
‣ Refactor
‣ Patterns
‣ The Future…
• “Pre-Upgrade” components
• Prefer `module.component`
• Prefer element selectors
• Extract controller as an exported class and avoid linking functions
• Use getter/setters over `$scope.$watch`
• Identify “attribute directives”
• Template-less directives that often interact directly with the DOM
• Prefer attribute selectors
• “Pre-Upgrade” services
• Extract service code into an exported class
• Pass it to `module.service`
• Rewrite filters as Angular 2.x Pipes
• Use an Angular 2.x Pipe compatible interface and a Pipe class to inherit from it
• Use an instance (singleton) of the Pipe in a `module.filter` shim
Upgrade Angular 1.x Component‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ Adapter
‣ Components
‣ Providers
‣ Directives
‣ Pipes/Filters
‣ The Future…
Downgraded Angular 2.x Component
https://gist.github.com/chrisnicola/
ec0f45b2819f352c8100#file-
downgradedangular2component-ts
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ Upgrade
‣ Components
‣ Providers
‣ Directives
‣ Pipes/Filters
‣ The Future…
Downgraded Angular 2.x Service
https://gist.github.com/chrisnicola/
ec0f45b2819f352c8100#file-
downgradedangular2provider-ts
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ Adapter
‣ Components
‣ Providers
‣ Directives
‣ Pipes/Filters
‣ The Future…
Angular 2.x Attribute Directive
https://github.com/WealthBar/angular-d3/blob/
angular-2/src/angularD3/directives/bars.ts
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ Adapter
‣ Components
‣ Providers
‣ Directives
‣ Pipes/Filters
‣ The Future…
https://github.com/WealthBar/angular-d3/blob/
angular-2/src/app/app.html
Pipe/Filter Shim
https://gist.github.com/chrisnicola/
ec0f45b2819f352c8100#file-pipefiltershim-ts
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ Adapter
‣ Components
‣ Providers
‣ Directives
‣ Pipes/Filters
‣ Why A2?
‣ The Future…
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ The Future…
• Prefer converting 1.x services to 2.x
services and downgrade them (over
upgrading 1.x services)
• Refactor by component or route/page tree
• Adapters will temporarily support shared,
legacy or core dependencies
• Once you hit 80% 2.x code, freeze features
for a final push to remove remaining code.
More Tips
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ The Future…
‣ Impending
‣ “Soon”
‣ Maybe
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ The Future…
‣ Impending
‣ “Soon”
‣ Maybe
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ The Future…
‣ Impending
‣ “Soon”
‣ Maybe
• Much smaller size
• Improved error messages
• Animations
• i18n and l11n
• Ionic 2 and NativeScript
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ The Future…
‣ Impending
‣ “Soon”
‣ Maybe
• Isometric Support
• Hot code reloading
• Much more debugging tooling
‣ Why A2?
‣ Experience
‣ Preparation
‣ Patterns
‣ The Future…
‣ Impending
‣ “Soon”
‣ Maybe
• Isometric support for other framework
(Rails, Django, .NET)
• AngularJS Native
• Virtual DOM plugin (doubtful)
‣ 
• Official Docs https://angular.io/docs/ts/
latest/guide/upgrade.html
• Unofficial Guide http://
blog.thoughtram.io/angular/2015/10/24/
upgrading-apps-to-angular-2-using-
ngupgrade.html
Other Resources
Questions?
Thoughts?
Chris Nicola
CTO @ WealthBar

More Related Content

What's hot

The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
Matt Raible
 
Hadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoopHadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoop
Wisely chen
 
Comparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End TestingComparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End Testing
Katie Chin
 
Continuous Integration for Spark Apps by Sean McIntyre
Continuous Integration for Spark Apps by Sean McIntyreContinuous Integration for Spark Apps by Sean McIntyre
Continuous Integration for Spark Apps by Sean McIntyre
Spark Summit
 
What's New in JHipsterLand - Devoxx US 2017
What's New in JHipsterLand - Devoxx US 2017What's New in JHipsterLand - Devoxx US 2017
What's New in JHipsterLand - Devoxx US 2017
Matt Raible
 
Continuous delivery of your legacy application
Continuous delivery of your legacy applicationContinuous delivery of your legacy application
Continuous delivery of your legacy application
ColdFusionConference
 
Glance at Visual Studio 2013 ASP.NET and Web tools 2013
Glance at Visual Studio 2013  ASP.NET and Web tools 2013Glance at Visual Studio 2013  ASP.NET and Web tools 2013
Glance at Visual Studio 2013 ASP.NET and Web tools 2013
Shravan Kumar Kasagoni
 
Azug BE Session Nov 2018 Wim Van den Broeck
Azug BE Session Nov 2018 Wim Van den BroeckAzug BE Session Nov 2018 Wim Van den Broeck
Azug BE Session Nov 2018 Wim Van den Broeck
Wim Van den Broeck
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
toddbr
 
Run Fast, Try Not to Break S**t
Run Fast, Try Not to Break S**tRun Fast, Try Not to Break S**t
Run Fast, Try Not to Break S**t
Michael Schmidt
 
Angular TS(typescript)
Angular TS(typescript)Angular TS(typescript)
Angular TS(typescript)
Ivan Stepić
 
Digital Success Stack for DCBKK 2018
Digital Success Stack for DCBKK 2018Digital Success Stack for DCBKK 2018
Digital Success Stack for DCBKK 2018
Kyvio
 
Branching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by AbstractionBranching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by Abstraction
Chris Birchall
 
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
🎤 Hanno Embregts 🎸
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
Niels Frydenholm
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based development
go_oh
 
Prototyping Office AddIns using ScriptLab
Prototyping Office AddIns using ScriptLabPrototyping Office AddIns using ScriptLab
Prototyping Office AddIns using ScriptLab
Riwut Libinuko
 
From 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testingFrom 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testing
Henning Muszynski
 
Webpack and angularjs
Webpack and angularjsWebpack and angularjs
Webpack and angularjs
Nir Kaufman
 
An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...
ulfmansson
 

What's hot (20)

The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
 
Hadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoopHadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoop
 
Comparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End TestingComparing Agile QA Approaches to End-to-End Testing
Comparing Agile QA Approaches to End-to-End Testing
 
Continuous Integration for Spark Apps by Sean McIntyre
Continuous Integration for Spark Apps by Sean McIntyreContinuous Integration for Spark Apps by Sean McIntyre
Continuous Integration for Spark Apps by Sean McIntyre
 
What's New in JHipsterLand - Devoxx US 2017
What's New in JHipsterLand - Devoxx US 2017What's New in JHipsterLand - Devoxx US 2017
What's New in JHipsterLand - Devoxx US 2017
 
Continuous delivery of your legacy application
Continuous delivery of your legacy applicationContinuous delivery of your legacy application
Continuous delivery of your legacy application
 
Glance at Visual Studio 2013 ASP.NET and Web tools 2013
Glance at Visual Studio 2013  ASP.NET and Web tools 2013Glance at Visual Studio 2013  ASP.NET and Web tools 2013
Glance at Visual Studio 2013 ASP.NET and Web tools 2013
 
Azug BE Session Nov 2018 Wim Van den Broeck
Azug BE Session Nov 2018 Wim Van den BroeckAzug BE Session Nov 2018 Wim Van den Broeck
Azug BE Session Nov 2018 Wim Van den Broeck
 
Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
Run Fast, Try Not to Break S**t
Run Fast, Try Not to Break S**tRun Fast, Try Not to Break S**t
Run Fast, Try Not to Break S**t
 
Angular TS(typescript)
Angular TS(typescript)Angular TS(typescript)
Angular TS(typescript)
 
Digital Success Stack for DCBKK 2018
Digital Success Stack for DCBKK 2018Digital Success Stack for DCBKK 2018
Digital Success Stack for DCBKK 2018
 
Branching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by AbstractionBranching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by Abstraction
 
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)Building a Spring Boot Application - Ask the Audience!  (from JavaLand 2017)
Building a Spring Boot Application - Ask the Audience! (from JavaLand 2017)
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
 
Trunk based development
Trunk based developmentTrunk based development
Trunk based development
 
Prototyping Office AddIns using ScriptLab
Prototyping Office AddIns using ScriptLabPrototyping Office AddIns using ScriptLab
Prototyping Office AddIns using ScriptLab
 
From 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testingFrom 0 to 100: How we jump-started our frontend testing
From 0 to 100: How we jump-started our frontend testing
 
Webpack and angularjs
Webpack and angularjsWebpack and angularjs
Webpack and angularjs
 
An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...An almost complete continuous delivery pipeline including configuration manag...
An almost complete continuous delivery pipeline including configuration manag...
 

Similar to Angular2 Upgrade

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
LINAGORA
 
Angular 2
Angular 2Angular 2
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
GlobalLogic Ukraine
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
WebStackAcademy
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)
Igor Talevski
 
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
AzovDevMeetup 2016 | Angular 2: обзор | Александр ШевнинAzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
JSC “Arcadia Inc”
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves rails
Michael He
 
Dust.js
Dust.jsDust.js
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
Yi-Ting Cheng
 
Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010
Pursuit Consulting
 
CI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page AppsCI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page Apps
Mike North
 
Angular Owin Katana TypeScript
Angular Owin Katana TypeScriptAngular Owin Katana TypeScript
Angular Owin Katana TypeScript
Justin Wendlandt
 
Angular, the New Angular JS
Angular, the New Angular JSAngular, the New Angular JS
Angular, the New Angular JS
Kenzan
 
Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete Guide
Sam Dias
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
SSW
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life
DevOps.com
 
Next Generation Architecture Showcase July 2019
Next Generation Architecture Showcase July 2019Next Generation Architecture Showcase July 2019
Next Generation Architecture Showcase July 2019
Alan Pearson Mathews
 
Continuous delivery from the trenches
Continuous delivery from the trenchesContinuous delivery from the trenches
Continuous delivery from the trenches
Michael Medin
 
Titanium Alloy Tutorial
Titanium Alloy TutorialTitanium Alloy Tutorial
Titanium Alloy Tutorial
Fokke Zandbergen
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319
Bibby Chung
 

Similar to Angular2 Upgrade (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
 
Angular 2
Angular 2Angular 2
Angular 2
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
Angular - Chapter 1 - Introduction
 Angular - Chapter 1 - Introduction Angular - Chapter 1 - Introduction
Angular - Chapter 1 - Introduction
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)
 
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
AzovDevMeetup 2016 | Angular 2: обзор | Александр ШевнинAzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves rails
 
Dust.js
Dust.jsDust.js
Dust.js
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
 
Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010Distributed Versioning Tools, BeJUG 2010
Distributed Versioning Tools, BeJUG 2010
 
CI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page AppsCI/CD and Asset Serving for Single Page Apps
CI/CD and Asset Serving for Single Page Apps
 
Angular Owin Katana TypeScript
Angular Owin Katana TypeScriptAngular Owin Katana TypeScript
Angular Owin Katana TypeScript
 
Angular, the New Angular JS
Angular, the New Angular JSAngular, the New Angular JS
Angular, the New Angular JS
 
Angular 6 - The Complete Guide
Angular 6 - The Complete GuideAngular 6 - The Complete Guide
Angular 6 - The Complete Guide
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life
 
Next Generation Architecture Showcase July 2019
Next Generation Architecture Showcase July 2019Next Generation Architecture Showcase July 2019
Next Generation Architecture Showcase July 2019
 
Continuous delivery from the trenches
Continuous delivery from the trenchesContinuous delivery from the trenches
Continuous delivery from the trenches
 
Titanium Alloy Tutorial
Titanium Alloy TutorialTitanium Alloy Tutorial
Titanium Alloy Tutorial
 
Angular2.0@Shanghai0319
Angular2.0@Shanghai0319Angular2.0@Shanghai0319
Angular2.0@Shanghai0319
 

Recently uploaded

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 

Recently uploaded (20)

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 

Angular2 Upgrade

  • 2.
  • 3. • Much better architecture/design compared with 1.x • Performance improvements • Still “Angular-like”, to keep much the same code organization Why are we doing this?‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ The Future…
  • 4. What about React? ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ The Future…
  • 5. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ The Future… Would I pick Angular Again?
  • 6. ‣ Why A2? ‣ Experience ‣ ngForward ‣ ngUpgrade ‣ The Good ‣ The Bad ‣ Preparation ‣ Patterns ‣ The Future… • Converted AngularD3 1.x -> 2.x (aka A2D3) • Tested out ngForward and ngUpgrade • Upgraded existing 1.x code using ngUpgrade • Proof of concept mobile apps with Ionic 2 and NativeScript Experience So Far…
  • 7. ‣ Why A2? ‣ Experience ‣ ngForward ‣ ngUpgrade ‣ The Good ‣ The Bad ‣ Preparation ‣ Patterns ‣ The Future… • Write Angular 1.x components with 2.x syntax • If you don’t want to include Angular 2.x yet • Templates and core directives are still 1.x syntax • Personally I do not find this approach useful
  • 8. ‣ Why A2? ‣ Experience ‣ ngForward ‣ ngUpgrade ‣ The Good ‣ The Bad ‣ Preparation ‣ Patterns ‣ The Future… • Upgrade Angular 1.x directives, components and services to use with Angular 2.x • Downgrade Angular 2.x directives, components and services to use with Angular 1.x • Does not work with Filters/Pipes (easy to workaround) • 100% Angular 2.x support • My recommended approach to upgrading
  • 9. ‣ Why A2? ‣ Experience ‣ ngForward ‣ ngUpgrade ‣ The Good ‣ The Bad ‣ Preparation ‣ Patterns ‣ The Future… • Glad to be rid of `ctrl.`,`$scope` and even Controllers • Reactive Programming with RxJS • LifeCycle events • One directional data by default • ngUpgrade works surprisingly well
  • 10. ‣ Why A2? ‣ Experience ‣ ngForward ‣ ngUpgrade ‣ The Good ‣ The Bad ‣ Preparation ‣ Patterns ‣ The Future… • Too Big! >100kb minified+gzip • Beta is still unstable • Error messages are still hopeless • So. Much. Static. Typing. aka “React Enterprise Edition”
  • 11. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Webpack ‣ ES6 or TS ‣ Organize ‣ Refactor ‣ Patterns ‣ The Future… • You’re going to need a module loader! • Webpack is arguably best-in-class • Wide support for assets TS, ES6, HTML, CSS, images, etc., etc., etc. • Flexible, extensible, relatively easy to use
  • 12. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Webpack ‣ ES6 or TS ‣ Organize ‣ Refactor ‣ Patterns ‣ The Future… • Use Babel or Typescript • Better get used Types and annotations • aka React Enterprise Edition™ • My recommendation: Typescript
  • 13. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Webpack ‣ ES6 or TS ‣ Organize ‣ Refactor ‣ Patterns ‣ The Future… • Angular Style Guide https://github.com/johnpapa/angular- styleguide • Organize by component/features • /component/component-name • index.(ts|js) is the component root • Include templates, styles and component specific services • Organize shared code under “core” or “lib” • Core services (e.g. Data/API) • Attribute Directives • Filters/Pipes
  • 14. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Webpack ‣ ES6 or TS ‣ Organize ‣ Refactor ‣ Patterns ‣ The Future… - app - index.ts - services - index.ts - resources.ts - geolocation.ts - filters/pipes - date.ts - directives - highlight.ts - float_label.ts - components - calendar - index.ts - calendar.html - calendar.scss - calendar_service.ts - calculator - index.ts - template.html - styles.css - calculation_engine.ts
  • 15. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Webpack ‣ ES6 or TS ‣ Organize ‣ Refactor ‣ Patterns ‣ The Future… • “Pre-Upgrade” components • Prefer `module.component` • Prefer element selectors • Extract controller as an exported class and avoid linking functions • Use getter/setters over `$scope.$watch` • Identify “attribute directives” • Template-less directives that often interact directly with the DOM • Prefer attribute selectors • “Pre-Upgrade” services • Extract service code into an exported class • Pass it to `module.service` • Rewrite filters as Angular 2.x Pipes • Use an Angular 2.x Pipe compatible interface and a Pipe class to inherit from it • Use an instance (singleton) of the Pipe in a `module.filter` shim
  • 16. Upgrade Angular 1.x Component‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ Adapter ‣ Components ‣ Providers ‣ Directives ‣ Pipes/Filters ‣ The Future…
  • 17. Downgraded Angular 2.x Component https://gist.github.com/chrisnicola/ ec0f45b2819f352c8100#file- downgradedangular2component-ts ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ Upgrade ‣ Components ‣ Providers ‣ Directives ‣ Pipes/Filters ‣ The Future…
  • 18. Downgraded Angular 2.x Service https://gist.github.com/chrisnicola/ ec0f45b2819f352c8100#file- downgradedangular2provider-ts ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ Adapter ‣ Components ‣ Providers ‣ Directives ‣ Pipes/Filters ‣ The Future…
  • 19. Angular 2.x Attribute Directive https://github.com/WealthBar/angular-d3/blob/ angular-2/src/angularD3/directives/bars.ts ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ Adapter ‣ Components ‣ Providers ‣ Directives ‣ Pipes/Filters ‣ The Future… https://github.com/WealthBar/angular-d3/blob/ angular-2/src/app/app.html
  • 20. Pipe/Filter Shim https://gist.github.com/chrisnicola/ ec0f45b2819f352c8100#file-pipefiltershim-ts ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ Adapter ‣ Components ‣ Providers ‣ Directives ‣ Pipes/Filters ‣ Why A2? ‣ The Future…
  • 21. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ The Future… • Prefer converting 1.x services to 2.x services and downgrade them (over upgrading 1.x services) • Refactor by component or route/page tree • Adapters will temporarily support shared, legacy or core dependencies • Once you hit 80% 2.x code, freeze features for a final push to remove remaining code. More Tips
  • 22. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ The Future… ‣ Impending ‣ “Soon” ‣ Maybe
  • 23. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ The Future… ‣ Impending ‣ “Soon” ‣ Maybe
  • 24. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ The Future… ‣ Impending ‣ “Soon” ‣ Maybe • Much smaller size • Improved error messages • Animations • i18n and l11n • Ionic 2 and NativeScript
  • 25. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ The Future… ‣ Impending ‣ “Soon” ‣ Maybe • Isometric Support • Hot code reloading • Much more debugging tooling
  • 26. ‣ Why A2? ‣ Experience ‣ Preparation ‣ Patterns ‣ The Future… ‣ Impending ‣ “Soon” ‣ Maybe • Isometric support for other framework (Rails, Django, .NET) • AngularJS Native • Virtual DOM plugin (doubtful)
  • 27. ‣ • Official Docs https://angular.io/docs/ts/ latest/guide/upgrade.html • Unofficial Guide http:// blog.thoughtram.io/angular/2015/10/24/ upgrading-apps-to-angular-2-using- ngupgrade.html Other Resources