+ All Categories
Home > Documents > Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software...

Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software...

Date post: 20-Jun-2020
Category:
Upload: others
View: 19 times
Download: 0 times
Share this document with a friend
28
@elanathellama Migrating from AngularJS to Angular Elana Olson @elanathellama
Transcript
Page 1: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Migrating from AngularJS to Angular

Elana Olson@elanathellama

Page 2: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama@elanathellama

Elana Olson

● Studying software engineering● Traveling around the world

Developer Relations Intern

Page 3: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama@elanathellama

Angular is the name for the Angular of today and tomorrow.

AngularJS is the name for all 1.x versions of Angular.

Page 4: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Page 5: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

ngMigration AssistantFinding the right migration approach for your app

Page 6: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama@elanathellama

https://github.com/angular/angular-phonecat/tree/step-14

Page 7: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Criteria

\ * Complexity

* App size and amount of files/folders

* AngularJS patterns

* Preparation necessary for migration

Page 8: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

AngularJS Patterns● JavaScript

● $rootScope

● $compile

● Controllers

● Component Directives

Page 9: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

App Statistics

\ * Complexity:

2 controllers,

1 AngularJS component,

6 JavaScript files,

0 TypeScript files

* App size: 18224 lines of code

* File count: 20 total files, 11 relevant files

Page 10: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Recommendation

\Please follow these preparation steps in the files

identified before migrating with ngUpgrade.

* App contains $rootScope, refactor into services

* App contains 6 JavaScript files, convert to TypeScript

* App contains 2 controllers, convert to AngularJS

component directives

Page 11: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Files to Prepare

\../ajs-app/src/app/docs.js

→ Patterns found:

$rootScope,

JavaScript,

controller

Page 12: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Desktop AppGreater accessibility for all

Page 13: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

ng-src="{{mv.url}}" [src]="mv.url"

Automated Template ConversionSyntactically transform AngularJS html templates to Angular

Page 14: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Enhanced Analysis

AST parsing improves accuracy

of analysis with enhanced

search criteria and

recommendation reporting.

Page 15: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Page 16: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

What’s next for ngMigration Assistant?You tell us!

Page 17: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Angular is fast, simple, and built on the modern web

Page 18: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

TypeScriptComponents

Page 19: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama@elanathellama

Components● Standardized● Simpler● Rule of One● Component directives

Components TypeScript

Page 20: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Page 21: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Transitioning to Components

Markers on DOM elements that are compiled to manipulate HTML elements and its children.

Directive →

Special directives that define their own templates, controllers, and i/o bindings.

Defines a class associated with an HTML template that defines a view to be displayed in the UI.

Component Directive → Component

Page 22: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama@elanathellama

● *.js → *.ts ● Enhanced error reporting● Reduced runtime errors● Faster time to market

TypeScript

Components TypeScript

Page 23: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

ngMigration ForumA community hub for learning about migrating

Page 24: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Incremental Migration

● Hybrid Application

● Convert old AngularJS features

● Add new Angular features

● Large apps

Page 25: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Page 26: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Big Bang Migration

● Fresh start

● Begin using Angular now

● Try new techniques

● Small apps

Page 27: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama

Page 28: Migrating from AngularJS to Angular... · Migrating from AngularJS to Angular ... Studying software engineering Traveling around the world Developer Relations Intern. @elanathellama

@elanathellama@elanathellama

https://github.com/angular/ngMigration-Forum

Thank You!Elana Olson@elanathellama


Recommended