Skip to content

@windyroad/[email protected]

Compare
Choose a tag to compare
@tompahoward tompahoward released this 07 Aug 09:09
· 65 commits to main since this release
69e76e6

Major Changes

  • d85098a: BREAKING CHANGE: We have had to modify the the template parameters for wrapFetch,
    decorateFetchResponse, adaptFetchInputs, addFragmentSupportToFetch, fetchFragment
    and fetchLink, replacing the FetchImpl parameter with and Arguments and ResponseType
    parameter. Originally the intention was to try and leverage Typescript's
    type inference and have it figure out the types based on the passed in fetch implementation,
    but we couldn't figure out how to make it work properly and we were getting lots of type
    errors. Replacing the FetchImpl parameter with the Arguments and ResponseType parameters solve those errors.

    fetchLink will now check if the link has a fragment and use that to return a fragment
    response instead of fetching the resource and getting the fragment from it. For iterating
    over items in a collection, this is orders of magnitude faster.

Minor Changes

  • 3e3ea6c: Links for JSON responses that have a fragment identifier now include the matched fragment.
    For collections, this provides an easy and fast way to iterate over the items on the
    collection. While it is possible to call fetchLink for each fragment link, that is much
    slower due to network overheads and the serialisation of the json into a Response.
  • 6169097: FragmentResponse now includes a reference to the related response, in an optional
    parent property, which can be used to access other fragments in the response

Patch Changes