jonsamwell / ngx-http-batcher

Angular (2+) HTTP batching module to reduce the number of HTTP requests and increase performance
MIT License
4 stars 1 forks source link

Can we have angular 5 support? #2

Open harryy2510 opened 6 years ago

harryy2510 commented 6 years ago

Hi, Since http is deprecated and now it is httpClient, Can we have support for angular 5?

jonsamwell commented 6 years ago

@harryy2510 yeah I have been meaning to do this since Angular 5 was release I just haven't had time. The architecture of the new HttpClient is fairly different to that of the old Http so it'll need some thinking about. I will endeavor to do it in the next few weeks.

Evgen14 commented 6 years ago

Hi, when you can expect support for angular 5?

jonsamwell commented 6 years ago

@Evgen14 Sorry I have been so busy lately. The current version (v1.10) works with Angular 5 albeit with the now depricated http module. I need to investigate how to do this with the new HttpClient as I think it might be best to do it via an interceptor. Any ideas welcome.

harryy2510 commented 6 years ago

I've tried porting your batcher to angular6. Do you mind looking at it once and adding a few features?

Tiberriver256 commented 6 years ago

I would be excited to see that!

jonsamwell commented 6 years ago

@harryy2510 @Tiberriver256 I do need to get around to porting to Angular 6. I have some idea around just using an interceptor now. @harryy2510 I would be very interested to see your ideas.

harryy2510 commented 6 years ago

Here's the link.

Stackblitz

srikrsna commented 6 years ago

batcher.zip

Here's the Batcher Using Angular Interceptors with customisable Options.

idrisfl commented 6 years ago

I am looking forward to Angular 5 support for this

timbyng commented 6 years ago

@srikrsna @harryy2510 Thanks for providing your Angular 6 solutions. @srikrsna, do you have an example on how the BatcherConfigService can be used?

srikrsna commented 6 years ago

@timby You can extend the class and override any and all of the methods to create a custom configuration. Once extended you can provide your extension through DI using Angular's useClass semantics.

JosePFs commented 5 years ago

Thanks @srikrsna @harryy2510 @timby I've modified interceptor to work with this symfony bundle: https://github.com/IdeasoftLabs/http-batch-bundle that implements this draft https://tools.ietf.org/id/draft-snell-http-batch-00.html

Working in Angular 7, making requests array with forkjoin (tested) batch.zip

Thanks and regards

ytilis commented 4 years ago

I've made a new package based heavily on the work by @srikrsna

You can find it here: https://www.npmjs.com/package/ngx-batch-requests

It's configurable via a provider token in AppModule, and I cleaned up and fixed some issues I found in the previous solutions posted in this thread.

Let me know if anyone wants any additional configurations, you spot any bugs, etc.