-
Notifications
You must be signed in to change notification settings - Fork 37
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
Update Fetch API #30
Comments
Experiments here https://github.com/tinymce/rescript-webapi/compare/fetch-newapi (this will contain all changes until the core Fetch PR is merged) |
Perhaps we can take some inspiration from the work @Kingdutch has done: It's gone in the direction of |
Request from @ka-work in #33 - generalise This isn't specifically fetch related, but it's fairly close and I think the opportunity for a breaking change is a good time to do it. |
I guess that make sense we would have to make some bindings for FileReader that I think takes both Files and Blobs for example. The createObjectUrl takes a media source though that isn't a subclass but that could be it's own function createObjectUrlFromMediaSource or something. |
The new fetch API is just a copy of
bs-fetch
with a bit of re-arranging to separate out the inner modules (this aids tree shaking).There are far better ways to do most of this in ReScript now; the API would benefit a lot from records-as-objects and polymorphic-variants-as-strings. Unfortunately, to a tree-shaking benefit from this the old Functor approach has to be removed.
As much as I'd like to update the API, there are over 1300 repositories depending on
bs-fetch
. Now that I know ReScript 10 will break their code, I want to start by making migration as seamless as possible for them.So I'm tagging it as release 2.0 for now. If we have time for both the API update and a migration guide before ReScript 10 is released we can consider merging it in the 1.0 release.
The text was updated successfully, but these errors were encountered: