Skip to content

Instantly share code, notes, and snippets.

@takahser
Last active January 19, 2018 11:24
Show Gist options
  • Save takahser/cbb4f6421dda640cc835cc395bf6c749 to your computer and use it in GitHub Desktop.
Save takahser/cbb4f6421dda640cc835cc395bf6c749 to your computer and use it in GitHub Desktop.
Angular Upgrade from 4.4.5 => 5.2.1

Angular Upgrade from 4.4.5 => 5.2.1

Breaking Changes

  • Replace all HttpModule => HttpClientModule
  • Replace all Http => HttpClient

Upgrade npm packages

npm install @angular/animations@'^5.2.1' @angular/common@'^5.2.1' @angular/compiler@'^5.2.1' @angular/compiler-cli@'^5.2.1' @angular/core@'^5.2.1' @angular/forms@'^5.2.1' @angular/http@'^5.2.1' @angular/platform-browser@'^5.2.1' @angular/platform-browser-dynamic@'^5.2.1' @angular/platform-server@'^5.2.1' @angular/router@'^5.2.1' [email protected] rxjs@'^5.5.2'

npm install [email protected] --save-exact

Further resources

Changelog Summaries

  • [CLI Feature] Build Optimizer := tool for making bundles smaller
    • marks some parts as pure => improves tree shaking
    • removes angular decorator from runtime code
  • SSR (server-side rendering) support
    • Domino
    • server & client share state => less server calls neccessary
  • Compiler improvements
    • incremental AOT compilation => faster rebuilds
    • introduced preserveWhitespaces attribute for @Component's => if set, avoids whitespaces in compiled code
    • improved decorators support
  • internationalized pipes
  • introduced exportAs => multiple export aliases for components
  • introduced updateOn hooks for forms
    • avoid updating model on each input change
    • available hooks: updateOn: 'blur' and updateOn: 'submit'
  • RxJs upgrade to v5.5
    • nicer imports
    • no more side-effects
  • TypeScript 2.5 Support
  • Angular Material / CDK v5 release (no more beta!)
  • [CLI Feature] Service Worker Support
    • introduced @angular/service-worker which leverages service workers
    • improves performance (allows to make loading experience more like that of a natively installed app)
  • [CLI Feature] Improved Angular Universal (SSR) & App Shell Support
  • Improved decorator error messages
  • TypeScript 2.6 Support
  • type checking for templates
    • introduced fullTemplateTypeCheck as an angularCompilerOption (uses TypeScript to validate binding expressions in templates)
    • will be enabled on default in future releases
  • improved router param & data inheritance => allows child routes to access their anchestor's parameters and data

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment