Reputation: 1
I am currently migrating my Angular application from version 15 to 16, and I've heard that Angular 16 introduces the "standalone components" feature, which allows components, directives, and pipes to be declared independently of Angular modules. While I understand the benefits of standalone components, I would prefer to continue using Angular modules and avoid the standalone feature for now.
Can anyone provide guidance on how to:
Disable or opt-out of standalone components when migrating to Angular 16? Ensure my project continues to work as it did in Angular 15 without using standalone components? Handle any related deprecation warnings or issues that might arise due to the migration while staying with the module-based approach? I’d appreciate any advice or steps to ensure a smooth migration while avoiding the standalone component feature.
"projects": {
"oto-link-dealer-admin-angular": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss",
"standalone": false
}
},
Upvotes: -1
Views: 83
Reputation: 8716
There won't be any problems migrating to Angular 16, even 18 since the standalone components are the default only from 19+ which just released a few days ago*. This means: you are very likely to be just fine when updating to never versions without any changes to your code. Use https://angular.dev/update-guide for (very) good guidance on how to update. It will tell you which changes are mandatory or optional.
*also updating to Angular 19+ will be easy (including module based components) but you will need to set standalone: false
to each one since the default is true
since v19.
My personal opinion: try to upgrade every few months - we have a quite large Angular codebase with automated dependency updates which only takes 1-2 hours of manual labor per major upgrade which is very cheap, especially compared to not updating anything for years and then having to basically rewrite the whole app.
Besides, standalone components really do improve application performance (load times) and simplify development. You can even opt-in to using standalone components if you need new components but leave the old ones as they are.
Upvotes: 1