loopback-sdk-builder
loopback-sdk-builder copied to clipboard
HttpClient instead of Http
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
Yeah, I was wondering the same.
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.
Now that Http module is deprecated in Angular5, is there any plan to move to HttpClient? Thank you for your wonderful work.
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!
@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
).
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.)
@jonathan-casarrubias any chance to merge the branch from @nedzvedz?
Any update on this request? With the deprecation of HttpModule the SDK builder will soon hit a wall in next Angular releases.
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 is @nedzvedz 's branch functional or should a new branch be created to implement tests? Any contributing guidelines?
@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
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.
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 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).
Any news on this PR?
Hello @Miced, this is already published under version 2.2.0
@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