15.0.0 (2022-11-16)
Breaking Changes
compiler
-
Keyframes names are now prefixed with the component's "scope name".
For example, the following keyframes rule in a component definition,
whose "scope name" is host-my-cmp:@Keyframes foo { ... }
will become:
@Keyframes host-my-cmp_foo { ... }
Any TypeScript/JavaScript code which relied on the names of keyframes rules
will no longer match.The recommended solutions in this case are to either:
- change the component's view encapsulation to the
None
orShadowDom
- define keyframes rules in global stylesheets (e.g styles.css)
- define keyframes rules programmatically in code.
- change the component's view encapsulation to the
compiler-cli
-
Invalid constructors for DI may now report compilation errors
When a class inherits its constructor from a base class, the compiler may now
report an error when that constructor cannot be used for DI purposes. This may
either be because the base class is missing an Angular decorator such as
@Injectable()
or@Directive()
, or because the constructor contains parameters
which do not have an associated token (such as primitive types likestring
).
These situations used to behave unexpectedly at runtime, where the class may be
constructed without any of its constructor parameters, so this is now reported
as an error during compilation.Any new errors that may be reported because of this change can be resolved either
by decorating the base class from which the constructor is inherited, or by adding
an explicit constructor to the class for which the error is reported. -
Angular compiler option
enableIvy
has been removed as Ivy is the only rendering engine.
core
- Angular no longer supports Node.js versions
14.[15-19].x
and16.[10-12].x
. Current supported versions of Node.js are14.20.x
,16.13.x
and18.10.x
. - TypeScript versions older than 4.8 are no longer supported.
- Existing iframe usages may have security-sensitive attributes applied as an attribute or property binding in a template or via host bindings in a directive. Such usages would require an update to ensure compliance with the new stricter rules around iframe bindings.
- Existing iframe usages may have
src
orsrcdoc
preceding other attributes. Such usages may need to be updated to ensure compliance with the new stricter rules around iframe bindings.
forms
- setDisabledState will always be called when a
ControlValueAccessor
is attached. You can opt-out withFormsModule.withConfig
orReactiveFormsModule.withConfig
.
localize
-
canParse
method has been removed from all translation parsers in@angular/localize/tools
.analyze
should be used instead.- the
hint
parameter in theparse
methods is now mandatory.
router
- Previously, the
RouterOutlet
would immediately
instantiate the component being activated during navigation. Now the
component is not instantiated until the change detection runs. This
could affect tests which do not trigger change detection after a router
navigation. In rarer cases, this can affect production code that relies
on the exact timing of component availability. - The title property is now required on ActivatedRouteSnapshot
relativeLinkResolution
is no longer configurable in
the Router. This option was used as a means to opt out of a bug fix.
Deprecations
common
- The
DATE_PIPE_DEFAULT_TIMEZONE
token is now deprecated in favor
of theDATE_PIPE_DEFAULT_OPTIONS
token, which accepts an object
as a value and the timezone can be defined as a field (calledtimezone
)
on that object.
core
-
- The ability to pass an
NgModule
to theprovidedIn
option for
@Injectable
andInjectionToken
is now deprecated.
providedIn: NgModule
was intended to be a tree-shakable alternative to
NgModule providers. It does not have wide usage, and in most cases is used
incorrectly, in circumstances whereprovidedIn: 'root'
should be
preferred. If providers should truly be scoped to a specific NgModule, use
NgModule.providers
instead.- The ability to set
providedIn: 'any'
for an@Injectable
or
InjectionToken
is now deprecated.
providedIn: 'any'
is an option with confusing semantics and is almost
never used apart from a handful of esoteric cases internal to the framework. - The ability to pass an
-
The bit field signature of
Injector.get()
has been deprecated, in favor of the new options object. -
The bit field signature of
TestBed.inject()
has been deprecated, in favor of the new options object.
router
- The
RouterLinkWithHref
directive is deprecated, use theRouterLink
directive instead. TheRouterLink
contains the code from theRouterLinkWithHref
to handle elements withhref
attributes.
common
Commit | Description |
---|---|
add provideLocationMocks() function to provide Location mocks (#47674)
| |
add preload tag on server for priority img (#47343) | |
Add automatic srcset generation to ngOptimizedImage (#47547) | |
Add fill mode to NgOptimizedImage (#47738) | |
add injection token for default DatePipe configuration (#47157) | |
Add fetchpriority to ngOptimizedImage preloads (#48010) | |
don't generate srcset if noopImageLoader is used (#47804) | |
Don't warn about image distortion is fill mode is enabled (#47824) | |
export the IMAGE_CONFIG token (#48051) | |
fix formatting on oversized image error (#47188) | |
rename rawSrc -> ngSrc in NgOptimizedImage directive (#47362)
| |
support density descriptors with 2+ decimals (#47197) | |
update size error to mention 'fill' mode (#47797) | |
warn if using supported CDN but not built-in loader (#47330) | |
Warn on fill ngOptimizedImage without height (#48036) |
compiler
Commit | Description |
---|---|
scope css keyframes in emulated view encapsulation (#42608) | |
update element schema (#47552) | |
update element schema (#47552) |
compiler-cli
Commit | Description |
---|---|
exclude abstract classes from strictInjectionParameters requirement (#44615)
| |
implement more host directive validations as diagnostics (#47768) | |
support hasInvalidatedResolutions. (#47585) | |
use @ts-ignore. (#47636) | |
cache source file for reporting type-checking diagnostics (#47471) | |
remove enableIvy options (#47346)
|
core
Commit | Description |
---|---|
deprecate providedIn: NgModule and providedIn: 'any' (#47616)
| |
add support for Node.js version 18 (#47730) | |
drop support for TypeScript 4.6 and 4.7 (#47690) | |
enable the new directive composition API (#47642) | |
introduce EnvironmentProviders wrapper type (#47669) | |
support object-based DI flags in Injector.get() (#46761) | |
support object-based DI flags in TestBed.inject() (#46761) | |
allow readonly arrays for standalone imports (#47851) | |
hardening attribute and property binding rules for <iframe> elements (#47964) | |
hardening rules related to the attribute order on iframe elements (#47935) | |
update isDevMode to rely on ngDevMode (#47475)
|
forms
Commit | Description |
---|---|
export forms utility functions: isFormArray, isFormGroup… (#47718) | |
call setDisabledState on ControlValueAcessor when control is enabled (#47576)
| |
don't mutate validators array (#47830) | |
Improve a very commonly viewed error message by adding a guide. (#47969) | |
Runtime error pages must begin with leading zero (#47991) |
http
Commit | Description |
---|---|
allow for child HttpClient s to request via parents (#47502)
| |
introduce provideHttpClientTesting provider function (#47502)
| |
introduce functional interceptors (#47502) | |
introduce the provideHttpClient() API (#47502)
| |
better handle unexpected undefined XSRF tokens (#47683)
| |
rename withLegacyInterceptors to withInterceptorsFromDi (#47901)
|
language-service
Commit | Description |
---|---|
Quick fix to import a component when its selector is used (#47088) | |
support to fix invalid banana in box (#47393) |
localize
Commit | Description |
---|---|
add polyfill in polyfills array instead of polyfills.ts (#47569) | |
update ng add schematic to support Angular CLI version 15 (#47763) | |
remove deprecated canParse method from TranslationParsers (#47275)
|
platform-server
Commit | Description |
---|---|
align server renderer interface with base renderer (#47868) |
router
Commit | Description |
---|---|
add a migration to remove relativeLinkResolution usages (#47604)
| |
Add UrlTree constructor to public API (#47186) | |
auto-unwrap default exports when lazy loading (#47586) | |
make RouterOutlet name an Input so it can be set dynamically (#46569) | |
merge RouterLinkWithHref into RouterLink (#47630)
| |
migrate RouterLinkWithHref references to RouterLink (#47599)
| |
prevent provideRouter() from usage in @component (#47669)
| |
Delay router scroll event until navigated components have rendered (#47563) | |
Ensure ActivatedRouteSnapshot#title has correct value (#47481) | |
Remove deprecated relativeLinkResolution (#47623) |
Special Thanks
Alan Agius, AleksanderBodurri, Alex Castle, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Charles Lyding, Dylan Hunn, Ferdinand Malcher, George Kalpakas, Jeremy Elbourn, Jessica Janiuk, JiaLiPassion, Joey Perrott, JoostK, Kara Erickson, Kristiyan Kostadinov, Martin Probst, Matthias Weiß, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Sabareesh Kappagantu, WD Snoeijer, angular-robot[bot], arturovt, ced, dario-piotrowicz, ivanwonder and jaybell