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(schema): fix custom error message set through .Error() nested decorator #2699

Merged
merged 3 commits into from May 27, 2024

Conversation

Romakita
Copy link
Collaborator

@Romakita Romakita commented May 7, 2024

Closes: #2696

Information

Type Breaking change
fix No

Todos

  • Tests
  • Coverage
  • Example
  • Documentation

@Romakita Romakita force-pushed the fix-2696-ajv-errors-message branch 2 times, most recently from 0eb4730 to 9384b6a Compare May 8, 2024 08:22
@Romakita Romakita force-pushed the fix-2696-ajv-errors-message branch 3 times, most recently from 0f9654d to 4fef967 Compare May 8, 2024 18:22
Copy link

github-actions bot commented May 8, 2024

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v18.20.2
  • Run: Wed May 08 2024 18:31:38 GMT+0000 (Coordinated Universal Time)
  • Method: autocannon -c 100 -d 10 -p 10 localhost:3000 (two rounds; one to warm-up, one to measure)
Version Router Requests/s Latency Throughput/Mb
koa 2.13.4 33603.6 29.23 5.99
tsed-koa 7.69.0 11803.3 83.93 9.99
express 4.19.2 10329.8 95.97 1.84
nest 8.4.3 9882.6 100.26 2.38
express-injector 4.19.2 9361.6 105.75 2.13
tsed-express 7.69.0 8489.8 116.80 1.55
express-morgan 4.19.2 5571.5 177.53 0.99
fastify-big-json 3.29.4 N/A N/A N/A
fastify-injector 3.29.4 N/A N/A N/A
fastify 3.29.4 N/A N/A N/A
nest-fastify 8.4.3 N/A N/A N/A

Explanation

The benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance.

For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary.
It also initializes the elements necessary for monitoring requests in a log manager.

All this at a necessary cost that reflects the reality of a production application ;)

Copy link

github-actions bot commented May 8, 2024

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v18.20.2
  • Run: Wed May 08 2024 18:33:49 GMT+0000 (Coordinated Universal Time)
  • Method: autocannon -c 100 -d 10 -p 10 localhost:3000 (two rounds; one to warm-up, one to measure)
Version Router Requests/s Latency Throughput/Mb
koa 2.13.4 33672.8 29.14 6.01
tsed-koa 7.69.0 11840.0 83.67 10.03
express 4.19.2 10454.7 94.86 1.86
nest 8.4.3 9751.6 101.68 2.34
express-injector 4.19.2 9515.5 104.22 2.17
tsed-express 7.69.0 8574.4 115.56 1.57
express-morgan 4.19.2 5530.7 179.00 0.99
fastify-big-json 3.29.4 N/A N/A N/A
fastify-injector 3.29.4 N/A N/A N/A
fastify 3.29.4 N/A N/A N/A
nest-fastify 8.4.3 N/A N/A N/A

Explanation

The benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance.

For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary.
It also initializes the elements necessary for monitoring requests in a log manager.

All this at a necessary cost that reflects the reality of a production application ;)

@Romakita
Copy link
Collaborator Author

Romakita commented May 8, 2024

@ktalebian Can review this PR. I need your review over the AJV response error ;)
Thanks a lot!

@Romakita Romakita force-pushed the fix-2696-ajv-errors-message branch from 4fef967 to b9e1b87 Compare May 8, 2024 18:39
Copy link

github-actions bot commented May 8, 2024

Benchmarks

  • Machine: linux x64 | 4 vCPUs | 15.6GB Mem
  • Node: v18.20.2
  • Run: Wed May 08 2024 18:51:10 GMT+0000 (Coordinated Universal Time)
  • Method: autocannon -c 100 -d 10 -p 10 localhost:3000 (two rounds; one to warm-up, one to measure)
Version Router Requests/s Latency Throughput/Mb
koa 2.13.4 33112.7 29.66 5.91
tsed-koa 7.69.0 12027.2 82.40 10.18
express 4.19.2 10002.5 99.02 1.78
nest 8.4.3 9762.4 101.45 2.35
express-injector 4.19.2 9314.0 106.51 2.12
tsed-express 7.69.0 8397.1 118.11 1.54
express-morgan 4.19.2 5589.6 177.03 1.00
fastify-big-json 3.29.4 N/A N/A N/A
fastify-injector 3.29.4 N/A N/A N/A
fastify 3.29.4 N/A N/A N/A
nest-fastify 8.4.3 N/A N/A N/A

Explanation

The benchmark shows a performance difference between the frameworks. We note that Ts.ED is often last. In fact, Ts.ED uses features useful to a production application which reduce its performance.

For example, Ts.ED initializes a sandbox (async_hook) for each request in order to work in an isolated context if necessary.
It also initializes the elements necessary for monitoring requests in a log manager.

All this at a necessary cost that reflects the reality of a production application ;)

@Romakita Romakita merged commit b0891cb into production May 27, 2024
15 checks passed
@Romakita Romakita deleted the fix-2696-ajv-errors-message branch May 27, 2024 15:15
@Romakita
Copy link
Collaborator Author

🎉 This PR is included in version 7.70.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

[BUG] Custom .Error does not work on schemas other than @Required
2 participants