Angular 18 — New Features(Beta)
A Detailed Look at the New Features Coming in Angular 18
1. TypeScript 4.7 Support
Angular 18 will fully support TypeScript 4.7, which includes a number of new features and improvements. This means that Angular developers will be able to take advantage of the latest TypeScript features, such as:
- Template Literal Types: Allow developers to more precisely define the types of templates and catch errors early.
- Improved
readonly
Support: Provides a more consistent and safe way to use thereadonly
keyword. - New Import Types: Help to make code more modular and organized.
2. Improved Performance with Ivy
Angular 18 will further improve the performance of Angular applications by making optimizations to the Ivy compiler. These optimizations will result in:
- Faster startup times
- Smaller bundle sizes
- Better overall performance
3. New ng-template
API
Angular 18 will introduce a new ng-template
API that will make it easier to create and use templates. The new API will provide:
- More flexibility and power
- The ability to create reusable and maintainable templates
4. Enhanced Forms API
Angular 18 will also include a number of enhancements to the forms API that will make it easier to create and validate forms, and provide more control over the form validation process:
- Easier to define form objects and validation rules
- Ability to manage more complex validation scenarios
5. Improved Debugging Tools
Angular 18 will include a number of improvements to the debugging tools that will make it easier to debug Angular applications and provide more information about the application state:
- Debugging with source maps
- Visualizing the component tree and data bindings
- Performance profiles
6. Other Features and Improvements
In addition to the features listed above, Angular 18 will also include:
- Web Components support
- Improved internationalization support
- A new router API
- And much more
Conclusion:
Angular 18 is a major release that includes a number of new features and improvements that will make Angular applications faster, more powerful, and easier to develop. Angular developers can look forward to the official release of Angular 18.
Note: This information is based on the current state of Angular 18 as of 2023–12–02. The Angular team may add or change features before the final release.
Further Information:
- Angular 18 blog post: https://blog.angular.io/
- Angular 18 documentation: https://angular.io/docs
I hope this information helps you to get a more detailed understanding of the new features coming in Angular 18.
New updates based on the commits on the Angular core project.
Router:
- More flexibility for
Route.redirectTo
: It can now be a function returning a string orUrlTree
. - Guards can leverage
RedirectCommand
for redirects alongsideUrlTree
.
Compiler:
- Requires TypeScript 5.4 or newer. Versions older than 5.4 are no longer supported.
Core:
- OnPush views at the application root need manual dirty marking for host binding updates.
ComponentFixture.autoDetect
won't refresh the host view for OnPush components unless marked dirty.- Event delegation libraries can queue and replay events when the application is ready.
Platform-browser-dynamic:
- Removal of
RESOURCE_CACHE_PROVIDER
APIs.
Platform-server:
- Deprecated
platformDynamicServer
is removed. UseplatformServer
with@angular/compiler
import instead. - Deprecated
ServerTransferStateModule
is removed.TransferState
works without this module.
Angular Package Format (APF):
- FESM2015 format is removed.
- ES2020 support is replaced with ES2022.
HttpClient:
- The deprecated
XhrFactory
export from@angular/common/http
is removed. Use the one from@angular/common
.
Note: Angular 18 is in beta, and these are potential changes. Refer to official release documentation for confirmed updates.