loopback-sdk-builder icon indicating copy to clipboard operation
loopback-sdk-builder copied to clipboard

HttpClient instead of Http

Open brain-kode opened this issue 7 years ago • 17 comments

What type of issue are you creating?

  • [ ] Bug
  • [ ] Enhancement
  • [x] Question

What version of this module are you using?

  • [ ] 2.0.10 (Stable)
  • [x] 2.1.0-rc.n (2.1 Release Candidate n)
  • [ ] Other

Write other if any:

Please add a description for your issue:

Is there any plan to use HttpClient instead of simple Http in order to intercept requests and responses?

https://angular.io/guide/http#intercepting-all-requests-or-responses

brain-kode avatar Sep 17 '17 19:09 brain-kode

Yeah, I was wondering the same.

pierfreeman avatar Sep 27 '17 09:09 pierfreeman

The hard part for this is that the builder supports older versions of Angular (2.X.X) which don't have the HttpClient module, so we would need to either creating a breaking release, or create a wrapper that can handle either of them.

Destreyf avatar Sep 27 '17 22:09 Destreyf

Now that Http module is deprecated in Angular5, is there any plan to move to HttpClient? Thank you for your wonderful work.

brain-kode avatar Nov 10 '17 09:11 brain-kode

I would love to see this aswel. Currently missing the possibility to intercept requests which comes in handy for a lot of features.

And as @camerlab mentioned, keep up the great work!

domvanrob avatar Nov 16 '17 07:11 domvanrob

@Destreyf do you have any plans for how long are you going support old versions? It seems that with every new angular release it will be harder to add new features and support old ones.

I thought that providing a new cli option like h for httpModule with options http or httpClient could resolve this issue. But in fact a lot of changes come with new http module: new interfaces, headers and params are now immutables and so on.

A new breaking release could be a good option, because supporting two versions will require a lot of changes across sdk and it seems hard to implement some monolithic wrapper to handle this (probably different templates for files like services/base.ejs).

nedzvedz avatar Dec 03 '17 12:12 nedzvedz

I've replaced HttpModule with HttpClientModule for my own project. Here is the branch. Probably I've missed something, but for now it seems to be working. Hopefully some implementation will be added to this project. (Would like to help with this if required.)

nedzvedz avatar Dec 09 '17 14:12 nedzvedz

@jonathan-casarrubias any chance to merge the branch from @nedzvedz?

pierfreeman avatar Jan 17 '18 14:01 pierfreeman

Any update on this request? With the deprecation of HttpModule the SDK builder will soon hit a wall in next Angular releases.

Nosfistis avatar Feb 04 '18 12:02 Nosfistis

Guys I won't be working on extending or improving this module, but if any of you send a PR and passes the CI tests I would be glad to integrate and deploy a new version.

I'm willing to provide updates from the community, so again if you get that patch into this repo I would be glad to publish a new version.

Actually, I have 3 more PRs so I can land those together if you send this ASAP.

Cheers Jon

jonathan-casarrubias avatar Feb 13 '18 19:02 jonathan-casarrubias

@jonathan-casarrubias is @nedzvedz 's branch functional or should a new branch be created to implement tests? Any contributing guidelines?

Nosfistis avatar Feb 14 '18 14:02 Nosfistis

@Miced I haven't verified, if he creates a Pull request from his branch to the development branch in this repo, the continuous integration will verify that all the current tests works, therefore... If those tests pass I'm willing to integrate and publish his changes.

But I need anyone to create a PR from that branch to the development branch in this repo.

Cheers Jon

jonathan-casarrubias avatar Feb 14 '18 16:02 jonathan-casarrubias

Hi guys, this branch is not ready for PR, since I was mainly focused on just making it working with angular 5 app. I can take a look at the weekends and update the tests.

nedzvedz avatar Feb 14 '18 18:02 nedzvedz

Ok cool @nedzvedz looking forward for a PR. I'll keep the current PRs open until next monday and if you got luck we would integrate everything together and publish a new version.

Cheers Jon

jonathan-casarrubias avatar Feb 16 '18 17:02 jonathan-casarrubias

@jonathan-casarrubias I've created a PR to develop. Just to mention, since HttpClientModule was released with @angular 4.3 version, you may want to release this changes as a major release (they aren't backward compatible with versions prior 4.3).

nedzvedz avatar Feb 17 '18 13:02 nedzvedz

Any news on this PR?

Nosfistis avatar Mar 24 '18 05:03 Nosfistis

Hello @Miced, this is already published under version 2.2.0

jonathan-casarrubias avatar Mar 24 '18 13:03 jonathan-casarrubias

@jonathan-casarrubias Hey, great news!

Any reason why there is no official release yet? Currently I'd have to sit on the master branch or a specific commit hash..

Cheers, Rob

domvanrob avatar Oct 16 '18 14:10 domvanrob