Skip to content

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

Closed

Description

@milesfrain

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.

Activity

  1. thomashoneyman commented on May 27, 2020

    @thomashoneyman
    Member

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

  2. milesfrain commented on May 27, 2020

    @milesfrain
    ContributorAuthor

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

  3. hdgarrood commented on May 27, 2020

    @hdgarrood
    Collaborator

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

  4. hdgarrood commented on May 27, 2020

    @hdgarrood
    Collaborator

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

  5. natefaubion commented on May 27, 2020

    @natefaubion
    Contributor

    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.

  6. hdgarrood commented on May 27, 2020

    @hdgarrood
    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.

  7. milesfrain commented on May 27, 2020

    @milesfrain
    ContributorAuthor

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

  8. changed the title [-]Convert from ajax FFI to Affjax[/-] [+]Convert from ContT and Ajax FFI to Aff and Affjax[/+] on Aug 23, 2020
  9. milesfrain commented on Aug 23, 2020

    @milesfrain
    ContributorAuthor

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

  10. thomashoneyman commented on Mar 27, 2021

    @thomashoneyman
    Member

    This was fixed in #208.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions