SpoonX/aurelia-api

Config coupled to aurelia-fetch-client

Closed this issue · 4 comments

Hey guys,

I am currently trying to test my app using the aurelia-http-client-mock. Therefore, I register the Mock for HttpClient. However, the aurelia-api Config is currently coupled to aurelia-fetch-client and, therefore, I can't replace the HTTP client.

Are there any reasons this is coupled at the moment? Any plans to change this?

Best Regards

I was playing a little bit around and it would be possible to get rid of new HttpClient() with a factory for this. However, this requires registering the client as transient (i.e. by the user to don't couple it again in this plugin).

But atm, it seems like the mock lib is for the non-fetch version only.

@MarcScheib No reason. It started with support for one, and then added the other with BC. We're open to PRs :)

it's not only the config which is coupled. allowing old-stlye http request would double the code without much gain. hence i dont think it'll be a good idea

Closing this for now. If this is still relevant, feel free to reopen the issue.

Note: this is a copy-paste comment to clean up the issues. It's not personal, and I didn't review the issue before posting this. They're all outdated and I need a way to figure out what's still relevant.

Thank you for understanding :)