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

Convert from ContT and Ajax FFI to Aff and Affjax #179

Closed
milesfrain opened this issue May 27, 2020 · 9 comments
Closed

Convert from ContT and Ajax FFI to Aff and Affjax #179

milesfrain opened this issue May 27, 2020 · 9 comments

Comments

@milesfrain
Copy link
Contributor

I'm looking into fixing #118 and wondering if it would be good to replace some of the ajax FFI code with the Affjax library.

It's also tempting to write an Affjax replacement that uses fetch instead, although I assume the caniuse numbers for that feature (95%) aren't high enough for TryPurescript.

For reference, there's fetch-api, which uses node-fetch, but there could be an even lighter-weight and dependency-free wrapper for just browsers which uses built-in window.fetch.

@thomashoneyman
Copy link
Member

As far as fetch goes, there are bindings in the purescript-web-fetch repository.

@milesfrain
Copy link
Contributor Author

Excellent. I'm so glad I asked. I searched pursuit for fetch, but it doesn't look like web-fetch is tracked there yet.

@hdgarrood
Copy link
Collaborator

Using fetch sounds good to me, especially if we can polyfill it for browsers which don't have it yet.

@hdgarrood
Copy link
Collaborator

I'd also like to use Aff instead of ContT + Effect

@natefaubion
Copy link
Contributor

natefaubion commented May 27, 2020

I think if you're going to switch to Aff, what's wrong with using Affjax? I don't really see an advantage to using fetch, if it's also going to require a polyfill.

@hdgarrood
Copy link
Collaborator

Oh yeah of course, that does make more sense. I guess I would usually default to fetch over affjax because in my experience it seems to work better in node (can't remember the details), but in this case we only need it to work in the browser, so that's irrelevant.

@milesfrain
Copy link
Contributor Author

Affjax seems like the easiest path to success, so I'll go with that.

@thomashoneyman thomashoneyman changed the title Convert from ajax FFI to Affjax Convert from ContT and Ajax FFI to Aff and Affjax Aug 23, 2020
@milesfrain
Copy link
Contributor Author

For reference, the Affjax changes exist in #192. Here are the relevant files for copy-pasting:

@thomashoneyman
Copy link
Member

This was fixed in #208.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants