The wait is over: after nine release candidate over a month and half, the Final Release of Angular 5.0.0, codename Pentagonal Donut, is finally out! The new version brings a lot of new features, performance improvements and (sadly) breaking changes since v4, but we're surely going to love it after all this wait.
Here's the full cumulative 5.x changelog, as it was released on the Angular official GitHub repository few hours ago: for further info regarding the previous release candidates, feel free to check this post (RC1 to RC7), this other post (RC8) and this last post (RC9) as well!
What more could we say? Just a couple uppercase words:
ABOUT TIME!
:)
5.0.0 pentagonal-donut (2017-11-01)
Features
- animations: allow @.disabled property to work without an expression (#18713) (2159342)
- animations: report errors when invalid CSS properties are detected (#18718) (409688f), closes #18701
- animations: support :increment and :decrement transition aliases (6f45519)
- animations: support negative query limit values (86ffacf), closes #19259
- common: accept object map for HttpClient headers & params (#18490) (1b1d5f1)
- common: add an empty DeprecatedI18NPipesModule module (#18737) (83713dd)
- common: drop use of the Intl API to improve browser support (#18284) (079d884), closes #10809 #9524 #7008 #9324#7590 #6724 #3429 #17576 #17478 #17319 #17200 #16838 #16624 #16625 #16591 #14131 #12632 #11376 #11187
- common: generate
closure-locale.tsto tree shake locale data (#18907) (4878936) - common: mark NgTemplateOutlet API as stable (0a73e8d)
- compiler-cli: add watch mode to
ngc(#18818) (06d01b2) - compiler-cli: lower metadata
useValueanddataliteral fields (#18905) (0e64261) - compiler: add representation of placeholders to xliff & xmb (b3085e9), closes #17345
- compiler: allow multiple exportAs names (#18723) (7ec28fe)
- compiler: deprecate i18n comments in favor of
ng-container(#18998) (66a5dab) - compiler: enabled strict checking of parameters to an
@Injectable(#19412) (dfb8d21) - compiler: make
.ngsummary.jsonfiles portable (2572bf5) - compiler: reuse the TypeScript typecheck for template typechecking. (#19152) (996c7c2)
- compiler: set
enableLegacyTemplateto false by default (#18756) (56238fe) - compiler: use typescript for resolving resource paths (43226cb)
- core: Create StaticInjector which does not depend on Reflect polyfill. (d9d00bd)
- core: add option to remove blank text nodes from compiled templates (#18823) (b8b551c)
- core: support for bootstrap with custom zone (#17672) (344a5ca)
- forms: add default updateOn values for groups and arrays (#18536) (ff5c58b)
- forms: add options arg to abstract controls (ebef5e6)
- forms: add status to
AbstractControlDirective(233ef93) - forms: add updateOn and ngFormOptions to NgForm (0d45828)
- forms: add updateOn blur option to FormControls (#18408) (333a708), closes #7113
- forms: add updateOn submit option to FormControls (#18514) (f69561b)
- forms: add updateOn support to ngModelOptions (1cfa79c)
- http: deprecate @angular/http in favor of @angular/common/http (#18906) (72c7b6e)
- platform-server: add an API to transfer state from server (#19134) (cfd9ca0)
- platform-server: provide a DOM implementation on the server (2f2d5f3), closes #14638
- platform-server: provide a way to hook into renderModule* (#19023) (8dfc3c3)
- router: add ActivationStart/End events (8f79150)
- router: add events tracking activation of individual routes (49cd851)
- service-worker: introduce the @angular/service-worker package (#19274) (d442b68)
- upgrade: propagate touched state of NgModelController (59c23c7)
- upgrade: support lazy-loading Angular module into AngularJS app (30e76fc)
- update angular to support TypeScript 2.4 (ca5aeba)
Performance Improvements
- animations: reduce size of bundle by removing AST classes (#19539) (d5c9c5f)
- compiler: don’t emit summaries for jit by default (b086891)
- compiler: fix perf issue in loading aot summaries in jit compiler (fbc9537)
- compiler: make the creation of
ts.Programfaster. (#19275) (edd5f5a) - compiler: only emit changed files for incremental compilation (745b59f)
- compiler: only type check input files when using bazel (#19581) (0b06ea1)
- compiler: only use tsickle if needed (#19275) (8f95b75)
- compiler: skip type check and emit in bazel in some cases. (#19646) (a22121d)
- compiler: speed up loading of summaries for bazel. (#19581) (81167d9)
- compiler: speed up watch mode (#19275) (6665d76)
- core: Remove decorator DSL which depends on Reflect (cac130e)
- core: add option to remove blank text nodes from compiled templates (d2c0d98)
- core: use native addEventListener for faster rendering. (#18107) (6279e50)
- latest tsickle to tree shake: abstract class methods & interfaces (#18236) (b7a6f52)
- switch angular to use StaticInjector instead of ReflectiveInjector (fcadbf4), closes #18496
BREAKING CHANGES
- compiler: The method
ngGetContentSelectors(), deprecated in Angular 4.0, has been removed. UseComponentFactory.ngContentSelectorsinstead. -
- the Angular compiler now requires TypeScript 2.4.x.
- router:
RouterOutletpropertieslocationInjectorandlocationFactoryResolverhave been removed as they were deprecated since v4. - compiler: the compiler option
enableLegacyTemplateis now disabled by default as the<template>element has been deprecated since v4. Use<ng-template>instead. The optionenableLegacyTemplateand the<template>element will both be removed in Angular v6. - core:
OpaqueTokenhas been removed as it was deprecated since v4. UseInjectionTokeninstead. platformXXXX()no longer accepts providers which depend on reflection. Specifically the method signature when fromProvider[]toStaticProvider[].
Example: Before:
|
1 2 3 4 5 6 |
[ MyClass, {provide: ClassA, useClass: SubClassA} ] |
After:
|
1 2 3 4 5 |
[ {provide: MyClass, deps: [Dep1,...]}, {provide: ClassA, useClass: SubClassA, deps: [Dep1,...]} ] |
NOTE: This only applies to platform creation and providers for the JIT compiler. It does not apply to @Component or @NgModuleprovides declarations.
Benchpress note: Previously Benchpress also supported reflective provides, which now require static providers.
I18n Changes (@angular/common)
Because of multiple bugs and browser inconsistencies, we have dropped the intl api in favor of data exported from the Unicode Common Locale Data Repository (CLDR). Unfortunately we had to change the i18n pipes (date, number, currency, percent) and there are some breaking changes.
I18n pipes:
- Breaking change:
- By default Angular now only contains locale data for the language
en-US, if you set the value ofLOCALE_IDto another locale, you will have to import new locale data for this language because we don't use the intl API anymore.
- By default Angular now only contains locale data for the language
- Features:
- you don't need to use the intl polyfill for Angular anymore.
- all i18n pipes now have an additional last parameter
localewhich allows you to use a specific locale instead of the one defined in the tokenLOCALE_ID(whose default value isen-US). - the new locale data extracted from CLDR are now available to developers as well and can be used through an API (which should be especially useful for library authors).
- you can still use the old pipes for now, but their names have been changed and they are no longer included in the
CommonModule. To use them, you will have to import theDeprecatedI18NPipesModuleafter theCommonModule(the order is important):
1234567891011<span class="pl-k">import</span> { <span class="pl-smi">NgModule</span> } <span class="pl-k">from</span> <span class="pl-s"><span class="pl-pds">'</span>@angular/core<span class="pl-pds">'</span></span>;<span class="pl-k">import</span> { <span class="pl-smi">CommonModule</span>, <span class="pl-smi">DeprecatedI18NPipesModule</span> } <span class="pl-k">from</span> <span class="pl-s"><span class="pl-pds">'</span>@angular/common<span class="pl-pds">'</span></span>;@<span class="pl-en">NgModule</span>({imports: [<span class="pl-smi">CommonModule</span>,<span class="pl-c">// import deprecated module after</span><span class="pl-smi">DeprecatedI18NPipesModule</span>]})<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-en">AppModule</span> { }Don't forget that you will still need to import the intl API polyfill if you want to use those deprecated pipes.
Date pipe
- Breaking changes:
- the predefined formats (
short,shortTime,shortDate,medium, ...) now use the patterns given by CLDR (like it was in AngularJS) instead of the ones from the intl API. You might notice some changes, e.g.shortDatewill be8/15/17instead of8/15/2017foren-US. - the narrow version of eras is now
GGGGGinstead ofG, the formatGis now similar toGGandGGG. - the narrow version of months is now
MMMMMinstead ofL, the formatLis now the short standalone version of months. - the narrow version of the week day is now
EEEEEinstead ofE, the formatEis now similar toEEandEEE. - the timezone
zwill now fallback toOand outputGMT+1instead of the complete zone name (e.g.Pacific Standard Time), this is because the quantity of data required to have all the zone names in all of the existing locales is too big. - the timezone
Zwill now output the ISO8601 basic format, e.g.+0100, you should now useZZZZto getGMT+01:00.
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 - the predefined formats (
- Features
- new predefined formats
long,full,longTime,fullTime. - the format
yyyis now supported, e.g. the year52will be052and the year2017will be2017. - standalone months are now supported with the formats
LtoLLLLL. - week of the year is now supported with the formats
wandww, e.g. weeks5and05. - week of the month is now supported with the format
W, e.g. week3. - fractional seconds are now supported with the format
StoSSS. - day periods for AM/PM now supports additional formats
aa,aaa,aaaaandaaaaa. The formatsatoaaaare similar, whileaaaais the wide version if available (e.g.ante meridiemforam), or equivalent toaotherwise, andaaaaais the narrow version (e.g.aforam). - extra day periods are now supported with the formats
btobbbbb(andBtoBBBBBfor the standalone equivalents), e.g.morning,noon,afternoon, .... - the short non-localized timezones are now available with the format
OtoOOOO. The formatsOtoOOOwill outputGMT+1while the formatOOOOwill beGMT+01:00. - the ISO8601 basic time zones are now available with the formats
ZtoZZZZZ. The formatsZtoZZZwill output+0100, while the formatZZZZwill beGMT+01:00andZZZZZwill be+01:00.
- new predefined formats
- Bug fixes
- the date pipe will now work exactly the same across all browsers, which will fix a lot of bugs for safari and IE.
- eras can now be used on their own without the date, e.g. the format
GGwill beADinstead of8 15, 2017 AD.
Currency pipe
- Breaking change:
- the default value for
symbolDisplayis nowsymbolinstead ofcode. This means that by default you will see$4.99foren-USinstead ofUSD4.99previously.
- the default value for
- Deprecation:
- the second parameter of the currency pipe (
symbolDisplay) is no longer a boolean, it now takes the valuescode,symbolorsymbol-narrow. A boolean value is still valid for now, but it is deprecated and it will print a warning message in the console.
- the second parameter of the currency pipe (
- Features:
- you can now choose between
code,symbolorsymbol-narrowwhich gives you access to more options for some currencies (e.g. the canadian dollar with the codeCADhas the symbolCA$and the symbol-narrow$).
- you can now choose between
Percent pipe
- Breaking change
- if you don't specify the number of digits to round to, the local format will be used (and it usually rounds numbers to 0 digits, instead of not rounding previously), e.g.
{{ 3.141592 | percent }}will output314%for the localeen-USinstead of314.1592%previously.
- if you don't specify the number of digits to round to, the local format will be used (and it usually rounds numbers to 0 digits, instead of not rounding previously), e.g.
Deprecated code
- router:
RouterOutletpropertieslocationInjectorandlocationFactoryResolverhave been removed as they were deprecated since v4. - common:
NgForhas been removed as it was deprecated since v4. UseNgForOfinstead. This does not impact the use of*ngForin your templates. - common:
NgTemplateOutlet#ngOutletContexthas been removed as it was deprecated since v4. UseNgTemplateOutlet#ngTemplateOutletContextinstead. - core:
Testability#findBindingshas been removed as it was deprecated since v4. UseTestability#findProvidersinstead. - core:
DebugNode#sourcehas been removed as it was deprecated since v4. - router: the values
true,false,legacy_enabledandlegacy_disabledfor the router parameterinitialNavigationhave been removed as they were deprecated. Useenabledordisabledinstead. - core:
DifferFactory.createno longer takes ChangeDetectionRef as a first argument as it was not used and deprecated since v4. - core:
TrackByFnhas been removed because it was deprecated since v4. UseTrackByFunctioninstead. - platform-webworker:
PRIMITIVEhas been removed as it was deprecated since v4. UseSerializerTypes.PRIMITIVEinstead. - platform-browser:
NgProbeTokenhas been removed from@angular/platform-browseras it was deprecated since v4. Import it from@angular/coreinstead. - core:
ErrorHandlerno longer takes a parameter as it was not used and deprecated since v4. - compiler: the option
useDebugfor the compiler has been removed as it had no effect and was deprecated since v4. - common: remove deprecated
NgFor(#18758) (ec56760) - common: remove deprecated
NgTemplateOutlet#ngOutletContext(#18780) (7522987) - compiler: remove option
useDebug(#18778) (499d05d) - compiler: split compiler and core (#18683) (0cc77b4)
- compiler: -
@angular/platform-servernow additionally depends on@angular/platform-browser-dynamicas a peer dependency. - core: remove deprecated
ChangeDetectionRefargument inDifferFactory#create(#18757) (be9713c) - core: remove deprecated
DebugNode#source(#18779) (d61b902) - core: remove deprecated
OpaqueToken(#18971) (3c4eef8) - core: remove deprecated
Testability#findBindings(#18782) (f2a2a6b) - core: remove deprecated
TrackByFn(#18757) (596e9f4) - core: remove deprecated parameter for
ErrorHandler(#18759) (8f41326) - platform-browser: remove deprecated
NgProbeToken(#18760) (d7f42bf) - platform-webworker: remove deprecated
PRIMITIVE(#18761) (a56468c) - router: remove deprecated
RouterOutletproperties (#18781) (d1c4a94) - router: remove deprecated
RouterOutletproperties (a9ef858) - router: remove deprecated
initialNavigationoptions (#18781) (d76761b)
ReflectiveInjectoris now deprecated as it will be remove. UseInjector.createas a replacement.
