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

fix(deps): update dependency @httpx/exception to v2.6.4 #638

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 2, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@httpx/exception (source) 2.1.0 -> 2.6.4 age adoption passing confidence

Release Notes

belgattitude/httpx (@​httpx/exception)

v2.6.4

Compare Source

Patch Changes

v2.6.3

Compare Source

Patch Changes

v2.6.2

Compare Source

Patch Changes

v2.6.1

Compare Source

Patch Changes

v2.6.0

Compare Source

Minor Changes
  • #​815 77cd15b Thanks @​belgattitude! - Deprecate the type HttpStatusCode, use HttpErrorStatusCode instead

    HttpErrorStatusCode is less ambiguous ad HttpStatusCode could be understood
    as HttpStatusCode could represent all http statuses. The type is exported
    but there's very few chances an regular user would be impacted.

  • #​815 77cd15b Thanks @​belgattitude! - Add new types: HttpErrorStatusCode and HttpErrorStatusCodeOrNumber

    Improves the typescript experience by allowing typescript to suggest assigned
    status codes in createException and HttpException, HttpClientException,
    HttpServerException constructors. Arbitray numbers can still be used.

  • #​815 77cd15b Thanks @​belgattitude! - Add new typeguards: isErrorWithErrorStatusCode and isObjectWithErrorStatusCode

    Those typeguards can be used in specific circumstances when an originating
    error has a statusCode field which indicates by convention the preferred status
    to send.

    import {
      isErrorWithErrorStatusCode,
      createHttpException,
    } from "@​httpx/exception";
    
    try {
      throw new (class extends Error {
        statusCode = 400;
      })();
    } catch (e) {
      if (isErrorWithErrorStatusCode(e)) {
        throw createException(e.statusCode, "Something wrong happened");
      }
    }
    const noSuchUser = {
      statusCode: 404,
    } satisfies ObjectWithStatusCode;
    
    class NoSuchItem extends DomainError implements ObjectWithStatusCode {
      statusCode: 404;
    }
    
    if (isObjectWithErrorStatusCode(noSuchUser)) {
      throw createException(e.statusCode, "Nothing");
    }

v2.5.7

Compare Source

Patch Changes

v2.5.6

Compare Source

Patch Changes

v2.5.5

Compare Source

Patch Changes

v2.5.4

Compare Source

Patch Changes

v2.5.3

Compare Source

Patch Changes

v2.5.2

Compare Source

Patch Changes

v2.5.1

Compare Source

Patch Changes

v2.5.0

Compare Source

Minor Changes
  • #​675 a6a63e1 Thanks @​belgattitude! - Add support for HttpUnprocessableEntity.issues in serializer.

    import { fromJson, toJson } from "@​httpx/exception/serializer";
    
    const e422 = new HttpUnprocessableEntity({
      message: "Validation failed",
      issues: [
        {
          message: "Invalid address",
          path: ["addresses", 0, "line1"],
          code: "empty_string",
        },
      ],
    });
    
    const json = toJson(e422);
    const js = fromJson(json);
    
    expect((js as HttpUnprocessableEntity).issues).toStrictEqual(e422.issues);
    expect(js).toStrictEqual(e422);
Patch Changes
  • #​675 a6a63e1 Thanks @​belgattitude! - Fix createHttpException that wasn't allowing issues on HttpUnprocessableEntity

    const e422 = createHttpException(422, {
      message: "Validation failed",
      issues: [
        {
          message: "Invalid address",
          path: ["addresses", 0, "line1"],
          code: "empty_string",
        },
      ],
    });

v2.4.0

Compare Source

Minor Changes
  • #​672 9d1d248 Thanks @​belgattitude! - Reduce bundle size by using class names rather than strings

    Importing all exceptions (excluding utilities, typeguards...) now top at 1Kb

    Example based on ESM (min+gzip)

    Scenario Size
    one exception ~ 450b
    all exceptions < 1kb
    everything (typeguards,...) 1.7kb

v2.3.0

Compare Source

Minor Changes
  • #​667 6872abb Thanks @​belgattitude! - Minimum node version is 18.12. Move to es2022.

  • #​667 6872abb Thanks @​belgattitude! - Reduce drastically bundle size (use es2022)

    Importing a single exception starts at 377 bytes, subsequent ones will add less than 50 bytes in average.
    Importing all exceptions (excluding typeguards...) will top at 1400 bytes.

    Code should be faster too.

    PS: if you use exceptions outside of nodejs and need to support legacy browsers
    a lot of frameworks allows to transpile modules (ie nextjs).

    ✔ Adding to empty webpack project
    
      ESM (import everything *)
      Package size is 395 B less than limit
      Size limit: 2.46 kB
      Size:       2.06 kB with all dependencies, minified and gzipped
    
      ESM (only HttpNotFound exception)
      Package size is 965 B less than limit
      Size limit: 1.42 kB
      Size:       450 B   with all dependencies, minified and gzipped
    
      ESM (two exceptions: HttpNotFound + HttpInternalServerError)
      Package size is 935 B less than limit
      Size limit: 1.44 kB
      Size:       505 B   with all dependencies, minified and gzipped
    
      ESM (only isHttpException)
      Package size is 1.03 kB less than limit
      Size limit: 1.41 kB
      Size:       377 B   with all dependencies, minified and gzipped
    
      ESM (only createHttpException)
      Package size is 571 B less than limit
      Size limit: 2 kB
      Size:       1.43 kB with all dependencies, minified and gzipped
    
      ESM ({ toJson })
      Package size is 1.11 kB less than limit
      Size limit: 1.89 kB
      Size:       779 B   with all dependencies, minified and gzipped
    
      ESM ({ fromJson })
      Package size is 607 B less than limit
      Size limit: 2.5 kB
      Size:       1.89 kB with all dependencies, minified and gzipped
    
      CJS (require everything *)
      Package size is 416 B less than limit
      Size limit: 3.05 kB
      Size:       2.63 kB with all dependencies, minified and gzipped
    
      CJS (only isHttpException)
      Package size is 598 B less than limit
      Size limit: 2.5 kB
      Size:       1.9 kB with all dependencies, minified and gzipped
    
    

v2.2.0

Compare Source

Minor Changes
  • 81311de Thanks @​belgattitude! - Deprecate ValidationError type in favour of HttpValidationIssue

    // @&#8203;deprecated errors
    // const errors: ValidationError[] = [
    
    // becomes
    const issues: HttpValidationIssue[] = [
      {
        message: "Invalid email",
        path: "email",
        code: "invalid_email",
      },
      {
        message: "Invalid address",
        path: ["addresses", 0, "line1"],
        code: "empty_string",
      },
    ];
    
    const e422 = new HttpUnprocessableEntity({
      // @&#8203;deprecated name
      // errors: errors,
    
      // becomes issues
      issues: [],
    });

v2.1.1

Compare Source

Patch Changes

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot enabled auto-merge (rebase) February 2, 2024 14:18
Copy link

vercel bot commented Feb 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-starter-tpl-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 2:35pm
next-starter-tpl-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 2:35pm
next-starter-tpl-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 2:35pm

Copy link

changeset-bot bot commented Feb 2, 2024

⚠️ No Changeset found

Latest commit: 919d551

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (779ed1d) 7.75% compared to head (919d551) 7.75%.
Report is 212 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #638   +/-   ##
======================================
  Coverage    7.75%   7.75%           
======================================
  Files          32      32           
  Lines         245     245           
  Branches       36      37    +1     
======================================
  Hits           19      19           
  Misses        226     226           
Flag Coverage Δ
web 7.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

0 participants