httpx

Collection of libs: http exceptions, dsn-parser...

MIT License

Downloads
67.2K
Stars
16
Committers
5

Bot releases are hidden (Show)

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Minor Changes

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 11 months ago

Minor Changes

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 12 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 12 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 12 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 12 months ago

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',
        },
      ],
    });
    
httpx - @httpx/[email protected]

Published by belgattitude 12 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 12 months ago

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
httpx - @httpx/[email protected]

Published by belgattitude 12 months ago

Patch Changes

httpx - @httpx/[email protected]

Published by belgattitude 12 months ago

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
    
    
httpx - @httpx/[email protected]

Published by belgattitude 12 months ago

Minor Changes