briebug / ngrx-auto-entity

NgRx Auto-Entity: Simplifying Reactive State
https://briebug.gitbook.io/ngrx-auto-entity/
Other
66 stars 12 forks source link

Angular 15 #237

Closed Inexad closed 1 year ago

Inexad commented 1 year ago

Hi,

Is it possible to get briebug to support ng15? Maybe i can change some dependency versions or similar? I don't think there is much changes from 14 to 15.

npm ERR!
npm ERR! While resolving: @briebug/ngrx-auto-entity@14.0.0-beta.1
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"13 - 14" from @briebug/ngrx-auto-entity@14.0.0-beta.1
npm ERR! node_modules/@briebug/ngrx-auto-entity
npm ERR!   @briebug/ngrx-auto-entity@"14.0.0-beta.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/common@14.2.12
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@"13 - 14" from @briebug/ngrx-auto-entity@14.0.0-beta.1
npm ERR!   node_modules/@briebug/ngrx-auto-entity
npm ERR!     @briebug/ngrx-auto-entity@"14.0.0-beta.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
jrista commented 1 year ago

@Inexad Yes, this is an issue that we don't really know how to resolve. According to Angular's documentation on Ivy, to support as many versions of Angular as possible, we need to do two things:

  1. Build our library code with partial ivy support
  2. Build our library for the "oldest" version of angular we want to support, and version support is "forward" (rather than backward...its very odd!)

We have currently released a version of auto-entity built for Angular 13. This should, as far as we can tell, support Angular 14 and theoretically 15 as well (we've done a bit of testing, and so far both seem to work, but we haven't tested every aspect of auto-entity yet).

This is kind of a sad state of affairs for Angular right now. They do not really have good support for library developers like us, and they have shifted a LOT of burden of supporting each angular version onto us library devs. We are actively seeking ways around this issue, but so far, we have not found one that we like.

ATM, there IS one solution. It works, and its relatively benign: Just use the --legacy-peer-deps or --force options, to install the package anyway. The peer dependency versions won't match, however, auto-entity IS built properly, according to the angular documentation, to support newer versions of Angular (so long as they don't make any breaking changes to the ivy instructions for parts of angular we use). When Angular DOES make breaking changes to the ivy instructions for parts of angular auto-entity uses, then we will have to cut a new release supporting that version of angular "and newer."

If you do try this, and you do find any issues building the app, let us know. We will look into creating an Angular 15 build as well. Sadly, this will be making it trickier for us to handle releases in the future, as we may have to manage updates to multiple versions of auto-entity concurrently. This is an area we are actively researching, and will be trying to find ways to handle in a more automated fashion, so that adding features and generating builds for many versions of angular is easier.

Inexad commented 1 year ago

Thanks for a quick and detailed explanation of this. We will continue using the library with "--force" command.

Regards.