I've created several Angular libraries using version 14. I'm interested in incorporating them into applications built with Angular versions 12 or 17. However, I'm encountering errors during this process. Could you please clarify the compatibility between these versions and provide guidance on addressing the errors I'm facing?
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Greetings!
According to Angular's official documentation, applications must have at least the same version as the library.
Version 14 had some major changes, like Typed Forms. If your library has form related components (which is usually true for multi-components libraries), v12 or v13 apps won't be able to finish the library's partial compilation, since their Angular packages won't have the necessary artifacts.
Now, although the docs say:
There are mutiple challenges when you have apps with a greater major version than your libraries. You have to make sure the libraries aren't using any Angular feature that had a breaking change in the app's Angular version.
Things become even more complicated if your library depends on a third-party Angular library. A common example: if one of your libraries use Angular Material v14 and an application is in a greater major version, you gotta take into account the major breaking change that happened in Angular Material v15, which changed most of the CSS classes across the whole codebase. Although there are ways to mitigate some of the breaking changes, it's still something that could break your apps if left unchecked.
There's no easy way to handle this scenario. You need to check the pros and cons of the possible choices:
Sorry for the long (and mostly without a final solution) reply hahahahh