Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use window-fetch for loading content #5

Closed
5 tasks
RangerMauve opened this issue Jun 7, 2019 · 0 comments · Fixed by #6
Closed
5 tasks

Use window-fetch for loading content #5

RangerMauve opened this issue Jun 7, 2019 · 0 comments · Fixed by #6

Comments

@RangerMauve
Copy link
Collaborator

It'd be nice to consolidate all our resource loading in one place.
As such, we should get rid of the resource loading code from this module and have it use window-fetch.

We should have it require window-fetch by default, and have an option for specifying the fetch implementation for custom stuff.

We'll be making a tradeoff by getting rid of cancellation. We'll still have it act like it's cancelled the request, but fetch will still resolve in the background. This could be addressed later if we introduce the cancellation signal API to window-fetch.
We might also be missing out on exceptions that would normally be thrown inside open for invalid protocols and URLs.

Steps:

  • Convert between formdata and fetch body
  • Find mappings between status codes and stuff between xhr and fetch
  • Replace file/HTTP handling inside open() with call to fetch()
  • Implement abort() which sets the aborted status, but doesn't cancel the fetch call
  • Test that it works!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant