2. Bartłomiej Narożnik - Angular 5 2
Patch: 4.4.6
- No Features, No Breaking Changes
Minor: 4.4.0
- New Features, No Breaking Changes
Major: 5.0.0
- New Features, Potential Breaking Changes
3. Bartłomiej Narożnik - Angular 5 3
1. Marking parts of your application as pure.
2. Removing angular decorators from runtime code.
Enabled by default for CLI production build.
--no-build-optimizer
4. Bartłomiej Narożnik - Angular 5 4
Angular compiler as a TypeScript transform (TS 2.3)
40% faster builds
(95% for angular.io 40s -> <2s)
ng serve –aot
6. Bartłomiej Narożnik - Angular 5 6
• Support more DOM manipulations out of the box within server
side contexts
• Improved support for 3rd party JS and Component libraries
that aren’t server-side aware
11. Bartłomiej Narożnik - Angular 5 11
fullTemplateTypeCheck option
<div>{{ 11.1 | lowercase }}</div>
-> Argument of type '11.1' is not assignable to parameter of type 'string'
<input [(ngModel)]="book.title" required #bookCtrl="ngModel">
<div *ngIf="bookCtrl.hasEror('required')">Title required</div>
-> Property 'hasEror' does not exist on type 'NgModel'. Did you mean 'hasError'?
28. Bartłomiej Narożnik - Angular 5 28
• Angular now uses data from Common Locale Data Repository
(CLDR) instead.
• No need for intl polyfil
• Old pipes in DeprecatedI18NPipesModule
• Locale parameter in all i18n pipes
• Default locale en-US
30. Bartłomiej Narożnik - Angular 5 30
• New formats (long, longDate, longTime, full, fullDate, fullTime)
• Timezone support
• Locale support
<!-- common usage using pre-defined format string -->
<span>{{ d | date: 'shortDate' }}</span> <!-- en-US: 1/18/17 -->
<!-- specific locale -->
<span>{{ d | date: 'shortDate': null: 'pl' }}</span> <!-- pl-PL: 18/1/17 -->
<!-- custom format string -->
<span>{{ d | date: 'M/d/yy': null: 'pl' }}</span> <!-- pl-PL: 18/1/17 -->
31. Bartłomiej Narożnik - Angular 5 31
Field type Format Example value v4 v5
Eras Narrow A for AD G GGGGG
Months Narrow S for September L MMMMM
Week day Narrow M for Monday E EEEEE
Timezone Long location
Pacific Standard
Time
z Not available
Timezone Long GMT GMT+01:00 Z ZZZZ
40. Bartłomiej Narożnik - Angular 5 40
• Weekly patch version
• Monthly minor version
• Major version every 6 months (backwards compatible)
• Almost 9000 commits in total
• ~9 commits per day (1932 commits between versions 4 and
5)
During the Tree Shake portion of the AOT compilation, the application’s dependency graph is walked to determine what parts of the JavaScript code are unused. Thus, if a pure function’s result isn’t used, the function may be safely removed.
Because Decorators are consumed during the compilation process, after compilation, they may be removed to reduce code size.
TypeScript transforms were a new feature introduced as part of TypeScript 2.3 that allows to hook into the standard TypeScript compilation pipeline.
You can take advantage of this by running ng serve with the AOT flag turned on.
This will become the default in a future release of the CLI. There are some known speed issues with projects with more than a thousand components. Angular team wants to be sure projects of all sizes will experience these improvements.
It’s a CLI feature so can be turned on independently.
Angular Universal is a project focused on helping developers to perform server side rendering (SSR) of Angular applications.
By rendering on the server and then bootstrapping on top of the generated HTML, you can add support for scrapers and crawlers that don’t support JavaScript, and you increase the perceived performance of your application.
ServerTransferStateModule and BrowserTransferStateModule allows to generate information as part of rendering with platform-server, and then transfer to the client side.
So that this information does not need to be regenerated.
Useful for cases such as when your application fetches data over HTTP.
By transferring state from the server, this means developers do not need to make a second HTTP request once the application makes it to the client.
Documentation for state transfer is forthcoming in the next few weeks.
Angular Universal platform-server now works with Domino
Expression lowering in decorators for lambdas and the value of useValue, useFactory and data in object literals
Allows to use values that can only be calculated at runtime in decorators for expressions that are lowered.
Lambda can be used instead of a named function
Static injector no longer requires the Reflect polyfill, reducing application size for most developers.
Zones are used to automatically trigger change detections as a result of asynchronous operations.
Change detection is a separate mechanism – can work without zones.
Zones are faster by default, but it’s now possible to bypass zones for performance focused applications.
It can for example catch that a pipe is not used with the proper type.
It can also analyze the local variables referencing a directive in your templates.
Right now the default value of fullTemplateTypeCheck is false, but we can expect to see it become true in a future release.
(Side note: this feature is currently a bit flaky, and I ran into issues testing it. You might want to wait 5.0.x to try it!).
Angular 4.4.1 (September 18th)
Introduced in 4.3
Typed, synchronous response body access, including support for JSON body types
JSON is an assumed default and no longer needs to be explicitly parsed
Interceptors allow middleware logic to be inserted into the pipeline
Immutable request/response objects
Progress events for both request upload and response download
Post-request verification & flush based testing framework
An example of using these events to start/stop a spinner
It’s now possible to reload a page when the router receives a request to navigate to the same URL.
Until now it was ignoring such a request, making it impossible to build a “refresh” button.
It’s now configurable at the router level, using onSameUrlNavigation, which can receive either reload or ignore (currently the default).
No support in CLI yet. Planned for 1.6.
cache your static assets by default.
download only what has changed when you deploy a new version, allowing blazingly fast application start!
it can go further, allowing to cache external resources (like fonts, icons from a CDN…), route redirection and even dynamic content caching (like calls to your API), with different strategies possible (always fetch for fresh data, or always serve from cache for speed…).
Really smart network optimizations, requiring only some JSON configuration from us.
No support in CLI yet. Planned for 1.6.
We can subscribe to push notification as well as send them.
No support in CLI yet. Planned for 1.6.
download only what has changed when you deploy a new version, allowing blazingly fast application start!
The user workflow should not be interrupted by the unexpectedly updated application.
The app version in the opened browser tab will remain the same until the tab close.
NGSW should keep app integrity. If any single file in application distributive was updated, we treat the whole corresponding version as a new one.
The Intl API from @angular/common has been removed to improve browser support. Intl API is not needed anymore, we extract and use data from Common Locale Data Repository (CLDR) instead.
The Intl API from @angular/common has been removed to improve browser support. Intl API is not needed anymore, we extract and use data from Common Locale Data Repository (CLDR) instead.
Animation queries now support negative limits, in which case will be matching elements from the end rather than from the beginning.
Here’s an example showing limiting the last 3 elements with class “item”:
Let’s say you want to animate a carousel with 5 elements, with a nice animation based on the index of the element displayed.
You had to declare a transition like: transition('0 => 1, 1 => 2, 2 => 3, 3 => 4', ...).
With Angular 5, you can now use transition(':increment')!
These new operators eliminate the side effects and the code splitting / tree shaking problems that existed with the previous ‘patch’ method of importing operators.