Skip to content

Releases: elbywan/wretch

2.3.2

11 Jan 13:24
Compare
Choose a tag to compare

2.3.2 (2023-01-11)

🐛 Bug fix(es)

Allows defining global error catchers using resolvers:

const request = wretch(baseURL)
  .errorType("json")
  .resolve((response) => {
    return (
      response
        .error("Error", (error) => {
          console.log("global catch (Error class)");
        })
        .error("TypeError", (error) => {
          console.log("global type error catch (TypeError class)");
        })
    );
  });

await request
  .get(`/carts/v3/${cartId}/payment/modes`)
  // Will override the global catcher now thanks to this fix.
  .notFound((error) => {
    console.log("not found");
  })
  .json();

2.3.1

07 Jan 21:45
Compare
Choose a tag to compare

2.3.1 (2023-01-07)

🐛 Bug fix(es)

  • Fix middlewares and addons subpath exports (bfd2542), closes #160

📝 Documentation update(s)

  • Add limitations section to the readme (ad0a102), closes #159

2.3.0

12 Dec 20:41
Compare
Choose a tag to compare

2.3.0 (2022-12-12)

🏭 New feature(s)

  • Add url property to WretchError (a1f6ac6), closes #157

2.2.3

09 Dec 07:09
Compare
Choose a tag to compare

2.2.3 (2022-12-09)

🐛 Bug fix(es)

  • Better error catching precedence (107fc71), closes #155

2.2.2

03 Dec 14:53
Compare
Choose a tag to compare

2.2.2 (2022-12-03)

🐛 Bug fix(es)

  • Fix compatibility issue between the perfs and progress addons (b70e8cd)

2.2.1

03 Dec 10:36
Compare
Choose a tag to compare

2.2.1 (2022-12-03)

🐛 Bug fix(es)

  • Add missing export for the progress addon (ebb0577)
  • Add missing progress addon rollup config (bd6c89b)
  • Register the progress addon in the .all entry point (b01e03d)

2.2.0

03 Dec 10:24
Compare
Choose a tag to compare

2.2.0 (2022-12-03)

🏭 New feature(s)

Add progress addon (2bae524), closes #154

Wretch now accepts a callback to monitor download progress.

🔗 Documentation.

import ProgressAddon from "wretch/addons/progress"
 
wretch("some_url")
  // Register the addon
  .addon(ProgressAddon())
  .get()
  // Log the progress as a percentage of completion
  .progress((loaded, total) => console.log(`${(loaded / total * 100).toFixed(0)}%`))

⬆️ Version update(s)

  • Bump dependencies including outdated rollup plugins (bcbcdc5)
  • Bump engine.io from 6.2.0 to 6.2.1 (6a93854)
  • Bump fastify from 4.9.2 to 4.10.2 (8ae9122)

🎨 Code improvement(s)

🐛 Bug fix(es)

  • Fix a minor Wretch type issue in addons (23ba7b1)

2.1.5

15 Oct 08:48
Compare
Choose a tag to compare

2.1.5 (2022-10-15)

⬆️ Version update(s)

  • Bump dependencies (6043c75)
  • Bump fastify from 4.3.0 to 4.8.1 (130ccc2)

🐛 Bug fix(es)

  • Query addon should strip undefined values (ce395b5), closes #148

📝 Documentation update(s)

  • Add timeout code sample in the readme (beb51c8)
  • Fix outdated code comments (d4c546d)
  • Fix unpkg url in the readme (07d4a00)

2.1.4

28 Sep 21:03
Compare
Choose a tag to compare

2.1.4 (2022-09-28)

🐛 Bug fix(es)

  • Relax the typechecker when using resolve within defer (9e052c8), closes #146

2.1.3

28 Sep 06:31
Compare
Choose a tag to compare

2.1.3 (2022-09-28)

🐛 Bug fix(es)

  • Fix the retry middleware crashing on network errors (95cbad5), closes #145