Remove axios from DataProviderApi
base class and refactor axios error handling
#1694
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, I'm finally removing the
cancellableFetchValue
method from theDataProviderApi
base class. This method made little sense ever since the arrival of h5wasm, which doesn't require making HTTP requests at all.This should get rid of
axios
from consumer bundles that useH5WasmBufferProvider
orH5WasmLocalFileProvider
. It also means that if we exposeDataProviderApi
in the future, consumers may be able to develop their own network-based provider without having to useaxios
as the fetching library.So it's now up to
H5GroveProvider
andHsdsProvider
to initialise and use their own axios client. I had to refactor axios error handling a bit to make this a bit more palatable, but overall I find the result less convoluted than before. I especially like that theDataProviderApi
base class no longer has any method implementations.