Angular 10, an important upgrade to the popular web development framework, has reached the release candidate stage. As of June 9, 2020, three release candidates were released. The upgrade to the TypeScript-based framework developed by Google focuses more on improvements in the ecosystem than on improvements in new features.
Angular 10 is smaller than previous versions of Angular. A target date for an Angular 10 production version has yet to be set. Angular 9.0 became generally available on February 6, 2020, followed by Angular 9.1 on March 25, 2020. Angular 8.0 arrived on May 28, 2019.
Where can I download the Angular 10 release candidate?
You can find preliminary versions of Angular 10 on GitHub.
New features in Angular 10
Key features of Angular 10 include:
A compiler interface has been added that encloses the actual ngtsc compiler. The language service-specific compiler manages several type check files via the project interface and creates script information if required.
Namespaces for property reads and method calls have been added for the compiler.
EntryPointFinder, a program-based entry point finder, has been added that can be created from the imports in a program specified in a tsjconfig.json file. This is expected to be faster than the DirectoryWalkerEntryPointFinder if the active program imports only a small part of the installed entry points.
In a groundbreaking change, ModuleWithProviders was made generic. A generic type parameter was required for the ModuleWithProviders pattern to work with the Ivy compilation and rendering pipeline. Before this commit, however, View Engine allowed the generic type to be omitted. If a developer uses ModuleWithProviders without a generic type, the code is updated through a version 10 migration. However, if a developer uses View Engine and depends on a library that omits the generic type, a build error is thrown. In this case, ngcc does not help and the migration only covers the application code. The library author should be contacted to repair his library. To work around this problem, skipLibChecks can be set to false in tsconfig or an app can be updated to use only Ivy.
TypeScript 3.9 is now available, with support for TypeScript 3.8 removed. This is a groundbreaking change. TypeScript 3.6 and TypeScript 3.7 are also no longer supported.
Performance improvements in type testing have been made to the compiler CLI.
To improve performance, basePaths computation has been delayed so that work is only done in TargetedEntryPointFinder when needed. Previously, basePaths were always calculated when the Finder was instantiated. This was a waste of effort when the goal entry point was already processed.
Merging multiple translation files is supported. So far, only one translation file was allowed per locale. Now users can specify multiple files per locale, and transactions from each file are merged based on the message ID.
Time limits for asynchronous locks can be configured. This supports the ngcc.config.js file for setting the retryAttempts and retryDelay options for the AsyncLocker. An integration test adds a new timeout check and uses the ngcc.config.js file to reduce the timeout time and prevent the test from taking too long.
When changed, warnings about unknown elements are now logged as errors. While this doesn't damage an app, it can trigger tools that are expected to not log anything through console.error.
If another change is made, any resolver that returns EMPTY will stop navigating. In order for navigation to continue, developers must update the resolvers to update a specific value, e.g. B. Standard! Empty.
Adding dependency information and ng-content selectors to metadata. This proposed compiler function would provide additional metadata useful for tools such as the Angular Language Service and the ability to provide suggestions for instructions / components defined in libraries.
Performance improvements achieved by reducing the size of the entry point manifest and a caching technique in the manifest. In addition, dependency caching is performed in and read from the entry point manifest, instead of being calculated each time. Even if an entry point did not need to be processed, ngcc (Angular Ivy Compatibility Compiler) parsed the entry point files to calculate dependencies, which took a long time for large_node modules.
To improve ngcc performance, immediate reporting of an outdated lock file is now allowed. It also stores a cached copy of an analyzed tsconfig file that can be reused if the tsconfig path is the same.
In a groundbreaking change, the logic for formatting daytime periods that exceed midnight has been updated. When formatting a time with the format code b or B, day periods spanning days were not processed correctly in the rendered string. Instead, the logic reverted to the standard case of AM. This logic has been updated to match times within a daytime period that extends past midnight. Therefore, the correct output is now reproduced, e.g. B. at night in the case of English. Applications that use either formatDate () or DatePipe or format codes b and B are affected by this change.
CanLoad protection can now return Urltree for the router. A CanLoad guard who returns Urltree cancels the current navigation and redirects. This corresponds to the current behavior of the CanActivate guards, which has also been added. This has no effect on the preload. CanLoad protection blocks any preloading. Routes with a CanLoad guard are not preloaded and the guards are not executed as part of the preload.
Passing the correct range of values in an expression binding of a microsyntax expression to ParsedProperty, which in turn would pass the spread to the template ASTs (both VE and Ivy). This suggestion also applies to the compiler.
Correcting the kernel would add logic to the undecorated class migration to decorate derived classes of undecorated classes that use Angular features.
When changed, the type of Urlmatcher changes so that it can always return zero.
A correction was made for the service employee for a situation where there was a possibility that the service employee would never register if there was a long-running task or a recurring time limit.
A number of bug fixes have been made, including the compiler that avoids undefined expressions in a holey array and the kernel that avoids migration errors when importing a nonexistent symbol. There is also a workaround in the core for the Terser inlining error. Another fix correctly identifies modules that are affected by overrides in TestBed.
Angular NPM no longer contains specific jsdoc comments to support the advanced optimizations of the Closure Compiler. This is a groundbreaking change. Support for closure compilers in packages is experimental and has been interrupted for some time. Anyone using Closure Compiler is probably better off consuming Angular packages created directly from sources than versions released on NPM. As a temporary workaround, users can consider using their current build pipeline with the –compilation_level = SIMPLE closure flag. This flag ensures that the build pipeline creates buildable, executable artifacts, which increases payload by disabling advanced optimizations.
Copyright © 2020 IDG Communications, Inc.