Angular Release 14.2.0-rc.0 Version.

Angular Release 14.2.0-rc.0 Version

Angular Release 14.2.0-rc.0 (pre-release) version with great features like:
feat:

  • NgOptimizedImage directive
  • support TypeScript 4.8
  • APIs using Router without RouterModule
  • improve RouterLink boolean inputs

fix:

  • infinite loop in parser assignment expression with invalid left-hand expression
  • Correctly infer FormBuilder types involving [value, validators] shorthand in more cases.

NgOptimizedImage:

Angular NgOptimizedImage Directive that improves image loading performance by enforcing best practices. To get the detailed knowlegde about this topic please check this link here Angular NgOptimizedImage Directive.

importing the NgOptimizedImage directive.

import { NgOptimizedImage } from '@angular/common';

// Include it into the necessary NgModule
@NgModule({
  imports: [NgOptimizedImage],
})
class AppModule {}

// ... or a standalone Component
@Component({
  standalone: true
  imports: [NgOptimizedImage],
})
class MyStandaloneComponent {}

configure a loader.
To use the default loader: The URL returned by the loader will always match the value of “src” and esource URL and the value of the rawSrc attribute will be used as is.
update <img> tags in templates to use rawSrc instead of src.

<img rawSrc="logo.png" width="200" height="100">

TypeScript 4.8 Support

Angular 14.2.0-rc.0 now support TypeScript 4.8 which resolves the `decorators` and `modifiers` properties issues with TS 4.6 and 4.7 until v15

{
    ....
    ....
    "dependencies": {
        ....
        ....
        "typescript": "4.8.1-rc",
    }
}

APIs using Router without RouterModule:

creates and exposes the APIs required to use the Angular Router without importing RouterModule.

const appRoutes: Routes = [];
bootstrapApplication(AppComponent,
  {
    providers: [
      provideRouter(appRoutes,
        withDebugTracing(),     // enables debug tracing feature
        withInMemoryScrolling() // enables scrolling feature
    ]
  }
);

Improve RouterLink boolean inputs:

Add wider typings to setter of preserveFragment, skipLocationChange and replaceUrl inputs of routerLink directives and coerce them to boolean

preserveFragment:

set preserveFragment(preserveFragment: boolean | string | null | undefined);

get preserveFragment(): boolean;

skipLocationChange:

set skipLocationChange(skipLocationChange: boolean | string | null | undefined);

get skipLocationChange(): boolean;

replaceUrl:

set replaceUrl(replaceUrl: boolean | string | null | undefined);

get replaceUrl(): boolean;

Now the complete list of the Angular Release 14.2.0-rc.0 Released updates:

Common
add a density cap for image srcsets (#47082)
add built-in Imgix loader (#47082)
add cloudflare loader (#47082)
add Image directive skeleton (#45627) (#47082)
Add image lazy loading and fetchpriority (#47082)
add loaders for cloudinary & imagekit (#47082)
add loading attr to NgOptimizedImage (#47082)
add warnings re: image distortion (#47082)
define public API surface for NgOptimizedImage directive (#47082)
detect LCP images inNgOptimizedImageand assert ifpriorityis set (#47082)
explain why width/height is required (#47082)
provide an ability to exclude origins from preconnect checks in NgOptimizedImage (#47082)
support custom srcset attributes in NgOptimizedImage (#47082)
verify that priority images have preconnect links (#47082)
warn if rendered size is much smaller than intrinsic (#47082)
detectdata:andblob:inputs inNgOptimizedImage directive (#47082)
remove default for image width (#47082)
sanitizerawSrcandrawSrcsetvalues in NgOptimizedImage directive (#47082)
set bound width and height onto host element (#47082)
throw if srcset is used with rawSrc (#47082)
monitor LCP only for images withoutpriorityattribute (#47082)
compiler
infinite loop in parser assignment expression with invalid left-hand expression (#47151)
Core
support TypeScript 4.8 () (#47038)
forms
Correctly inferFormBuildertypes involving[value, validators]shorthand in more cases. (#47034)
Router
Create APIs for using Router without RouterModule (#47010)
improve typings for RouterLink boolean inputs (#47101)

To get to know more about other Angular topics, you can check these articles too.

Please follow and like us:

Related Posts

Leave a Reply

Share