-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking Change introduced with change to throwError usage in #3312 #3702
Labels
Comments
3 tasks
timdeschryver
added
bug
Accepting PRs
Good First Issue
Good issue for first-time contributor
labels
Dec 21, 2022
markostanimirovic
added a commit
to markostanimirovic/platform
that referenced
this issue
Dec 21, 2022
3 tasks
brandonroberts
pushed a commit
that referenced
this issue
Dec 21, 2022
markonyango
added a commit
to markonyango/platform
that referenced
this issue
Dec 30, 2022
This reverts commit <3a9e1da4ad78ceedbf00a2088613848e8bbce353>. Closes ngrx#3702
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which @ngrx/* package(s) are the source of the bug?
component-store, component, data, effects
Minimal reproduction of the bug/regression with instructions
https://ngrx-seed-jt4hej.stackblitz.io
Switch between rxjs version 6.5.5 and 7.0.0 to see the issue.
Minimal reproduction of the bug/regression with instructions
Prior to refactoring (3a9e1da) usage of throwError the error handler function from e.g. a call to service.getByKey('xxx') would yield the DataServiceError and by accessing the error property the underlying HttpErrorResponse object.
Since throwError now also supports passing functions as parameter (ReactiveX/rxjs@dad270a), a refactoring in several ngrx modules (data, component-store, effect) was undertaken to change instances of
throwError(error)
tothrowError(() => error
.While this works with any rxjs versions 7+ this breaks compatibility with version rxjs 6.5.x as throwError due to the anonymous function (i.e. () => error) not being called prior to returning the error.
ngrx/{data, component-store, effect} v14+ all have peer dependencies to rxjs in the form of
"rxjs": "^6.5.3 || ^7.5.0"
indicating both version in the minor and major semver range to be compatible. Not updating rxjs will however break code relying onerror
to not be a function but the error instance itself.Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)
Ngrx/data@14+
Ngrx/component-store@14+
Ngrx/component@14+
Ngrx/effect@14+
Other information
I would be willing to submit a PR to fix this issue but would argue that removing [email protected] as peer dependency should communicate this breaking change to every developer much better.
HOWEVER, that might retro-actively breaking current implementations. I'd like to discuss best viable options prior to submitting a PR.
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: