Skip to content

whatwg-fetch,isomorphic-fetch: BodyInit should accept ArrayBuffer #9378

Closed

Activity

  1. changed the title [-]whatwg-fetch,isomorphic-fetch: BodyInit should accept arrayBuffer[/-] [+]whatwg-fetch,isomorphic-fetch: BodyInit should accept ArrayBuffer[/+] on May 17, 2016
  2. ryan-codingintrigue commented on May 18, 2016

    @ryan-codingintrigue
    Contributor

    Thanks for this, I've added BodyInit to the list of supported types. I'm pretty sure we should have URLSearchParams in there too, but not sure if this is part of any TypeScript definition yet.

  3. shaunluttin commented on Oct 9, 2016

    @shaunluttin
    Contributor

    The lack of URLSearchParams is a major pain point.

  4. toddlucas commented on Oct 10, 2016

    @toddlucas
    Contributor

    @shaunluttin Does it make sense for this to be part of the fetch typings or more general browser typings? I'm not sure myself. It is documented in the fetch spec, so maybe.

    I don't see that node-fetch supports it (the other half of the isomorphic-fetch implementation). It could be added for the browser half (whatwg-fetch), but users would need to be aware of the context that they're using it in.

    I'd be happy to add it if it makes sense. I've just been following what the whatwg-fetch folks have been doing (with consideration given for node-fetch concerns). Which implementation are you using? Does it conform to the interface documented in the fetch spec?

  5. shaunluttin commented on Oct 10, 2016

    @shaunluttin
    Contributor

    Does it make sense for this to be part of the fetch typings or more general browser typings?

    I don't know.

    Which implementation are you using? Does it conform to the interface documented in the fetch spec?

    The pain comes when using it with the aurelia-fetch-client. Maybe there is a way to rely on its types instead.

    Does it conform to the interface documented in the fetch spec?

    I don't know that answer to that either.

  6. toddlucas commented on Oct 10, 2016

    @toddlucas
    Contributor

    @saschanaz, @ryan-codingintrigue Do you have thoughts about where URISearchParams should live? Seems like it might better fit in a browser API typing. But if it's not anywhere, yet, maybe we add it to whatwg-fetch and isomorphic-fetch. What do you think?

  7. saschanaz commented on Oct 11, 2016

    @saschanaz
    Contributor

    I think we should add a new URLSearchParams definition file and then add a reference on this fetch definition.

  8. ryan-codingintrigue commented on Oct 11, 2016

    @ryan-codingintrigue
    Contributor

    URLSearchParams is not defined within the Fetch standard, it is part of the URL Standard, but Fetch is the only specification to actually use the interface right now.

    AFAIK, global definitions like this should be in TypeScript's lib.d.ts definition
    (See https://github.com/Microsoft/TypeScript/blob/master/src/lib/dom.generated.d.ts#L11759)

    But they only go into that once Microsoft Edge supports the feature and at present, URLSearchParams is not present in Edge.

    As for adding it, technically it's possible & I'm happy to do so, but I can't think of where it fits into the DefinitelyTyped structure. Maybe add typings for this polyfill: https://github.com/WebReflection/url-search-params?

  9. saschanaz commented on Oct 11, 2016

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions