stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
474 stars 181 forks source link

V19 - Rxjs backward compatibility (aka: get rid of the dependency on RxJS) #2077

Closed raphael22 closed 2 months ago

raphael22 commented 8 months ago

Using function from rxjs 7 introduce a compatiblity issue. https://github.com/stephanrauh/ngx-extended-pdf-viewer/blob/19.0.6/projects/ngx-extended-pdf-viewer/src/lib/pdf-notification-service.ts#L2

Error image

Version info

stephanrauh commented 8 months ago

What's stopping you from upgrading to RxJS 7?

stephanrauh commented 8 months ago

RxJS 7 has been release three years ago. The newest bug-fix release of RxJS 6 is also three years old. So I strongly recommend updating.

raphael22 commented 3 months ago

What's stopping you from upgrading to RxJS 7?

@stephanrauh Angular maintain compatibility, maybe your package should too ?

Migrate to rxjs7 can be a huge deal in a modular architect like module-federation.

stephanrauh commented 3 months ago

I hear your pain, and I feel it. However, this is a non-commercial project. I'm doing it in my leisure time, and there's never enough leisure time... so I'm afraid I can only support a limited range of versions.

Talking of which, if I was to offer commercial support, would you pay me for bringing back compatibility to RxJS 6?

raphael22 commented 3 months ago

I hear your pain too ^^ Rxjs is a tough topic and the two versions coexist since v12 and won't move any time soon I'm afraid (or relief ? :))

About commercial support, would love to, but I don't think my employer would go there, sorry.

stephanrauh commented 3 months ago

When I looked into the source code this evening, I was in for a surprise. First, the dependency on firstValueFrom() is gone. It seems I've addressed your issue but forgot to modify the declaration in the package.json. When you update to the next version 20.5.0, your issue is gone.

Second, I saw that I don't really need RxJS. There are only two events, one of them internal, and both of them can be replaced by signals. That works even in Angular 16, if I'm not mistaken. So I'll probably drop RxJS with version 21.

stephanrauh commented 3 months ago

Version 20.5.0-alpha.4 has landed. It reduces the required RxJS version to 6.0.

stephanrauh commented 3 months ago

To dos left:

stephanrauh commented 2 months ago

Version 21.0.0-alpha.5 removes the dependency on RxJS entirely. I'll probably publish it later today.

Enjoy! Stephan