Collection of libs: http exceptions, dsn-parser...
MIT License
Bot releases are hidden (Show)
Published by belgattitude 11 months ago
4e2b795
Thanks @belgattitude! - Ensure compat for Chrome 96+, Firefox 90+, Edge 91+, Safari 15+ and Opera 77+Published by belgattitude 11 months ago
4e2b795
Thanks @belgattitude! - Ensure compat for Chrome 96+, Firefox 90+, Edge 19+, Safari 12+, Opera 77+Published by belgattitude 11 months ago
d76a2f9
]:
Published by belgattitude 11 months ago
d76a2f9
Thanks @belgattitude! - Reduce bundle size of createException (-20b)Published by belgattitude 11 months ago
def4ba2
Thanks @belgattitude! - Fix the documentation home pagePublished by belgattitude 11 months ago
8d02a2a
Thanks @belgattitude! - Optimize code thanks to eslint unicorn pluginPublished by belgattitude 11 months ago
#724 8d02a2a
Thanks @belgattitude! - Optimize code thanks to eslint unicorn plugin
Updated dependencies [8d02a2a
]:
Published by belgattitude 11 months ago
8d02a2a
Thanks @belgattitude! - Optimize code thanks to eslint unicorn pluginPublished by belgattitude 11 months ago
bae6ce0
Thanks @belgattitude! - Upgrade tsup to 7.3 and build with esbuild 0.19.3Published by belgattitude 11 months ago
bae6ce0
Thanks @belgattitude! - Move to esm first (dual esm/cjs) is still supported#719 bae6ce0
Thanks @belgattitude! - Upgrade tsup to 7.3 and build with esbuild 0.19.3
Updated dependencies [bae6ce0
]:
Published by belgattitude 11 months ago
#719 bae6ce0
Thanks @belgattitude! - Move to esm first (dual cjs/mjs is till supported in the mid-term)
#719 bae6ce0
Thanks @belgattitude! - Restore node 16 official support / ES2021 (was working anyway)
bae6ce0
Thanks @belgattitude! - Upgrade tsup to 7.3 and build with esbuild 0.19.3Published by belgattitude 12 months ago
92343d2
]:
Published by belgattitude 12 months ago
92343d2
Thanks @belgattitude! - Add tupleson tests and improve docsPublished by belgattitude 12 months ago
a6a63e1
, a6a63e1
]:
Published by belgattitude 12 months ago
#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);
#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',
},
],
});
Published by belgattitude 12 months ago
9d1d248
]:
Published by belgattitude 12 months ago
#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 |
Published by belgattitude 12 months ago
6872abb
, 6872abb
]:
Published by belgattitude 12 months ago
#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
Published by belgattitude 12 months ago
5d3be6a
Thanks @belgattitude! - Drop node 16 support, es2022, slight bundle size decrease