Skip to content

Commit

Permalink
Changelog: structuring the notes for 19.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail committed May 8, 2024
1 parent 9cc3ec7 commit 3bc36a2
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,32 @@

### v19.0.0

- Minimum supported versions:
- Node: 18.18.0 or 20.9.0,
- `zod`: 3.23.0.
- The deprecated ~~`withMeta()`~~ is removed:
- See the changes to [v18.5.0](#v1850) on details.
- Several public methods and properties exposing arrays from class instances made readonly and frozen:
- On `Endpoint`: `.getMethods()`, `.getMimeTypes()`, `.getResponses()`, `.getScopes()`, `.getTags()`,
- On `DependsOnMethod`: `.pairs`, `.siblingMethods`.
- The config option `server.upload.beforeUpload` changed:
- The assigned function now accepts `request` instead of `app` and being called only for eligible requests;
- Restricting upload can be achieved now by throwing an error from within.
- Request logging now reflects the actual path requested rather than the configured route:
- It is also placed in front of parsing.
- Featuring selective parsers with child loggers:
- There are three types of endpoints depending on their input schema: those with upload, those with raw, and others;
- Depending on the type, only the parsers needed for certain endpoint are processed;
- This reverts changes on muting uploader logs related to non-eligible requests made in v18.5.2 (all eligible now).
- **Breaking changes**:
- Increased minimum supported versions:
- Node: 18.18.0 or 20.9.0;
- `zod`: 3.23.0.
- Removed the deprecated ~~`withMeta()`~~ is removed (see [v18.5.0](#v1850) for details);
- Freezed the arrays returned by the following methods or exposed by properties that supposed to be readonly:
- For `Endpoint` class: `getMethods()`, `getMimeTypes()`, `getResponses()`, `getScopes()`, `getTags()`;
- For `DependsOnMethod` class: `pairs`, `siblingMethods`.
- Changed the `ServerConfig` option `server.upload.beforeUpload`:
- The assigned function now accepts `request` instead of `app` and being called only for eligible requests;
- Restricting the upload can be achieved now by throwing an error from within.
- Features:
- Selective parsers equipped with a child logger:
- There are 3 types of endpoints depending on their input schema: having `ez.upload()`, having `ez.raw()`, others;
- Depending on that type, only the parsers needed for certain endpoint are processed;
- This makes all requests eligible for the assigned parsers and reverts changes made in [v18.5.2](#v1852).
- Non-breaking significant changes:
- Request logging reflects the actual path instead of the configured route, and it's placed in front of parsing.
- How to migrate confidently:
- Upgrade Node to latest version of 18.x, 20.x or 22.x;
- Upgrade `zod` to its latest version of 3.x;
- Avoid mutating the readonly arrays;
- If you're using ~~`withMeta()`~~:
- Remove it and unwrap your schemas.
- If you're using `beforeUpload` in your config:
- Adjust the implementation according to the example below.

```ts
import createHttpError from "http-errors";
Expand Down

0 comments on commit 3bc36a2

Please sign in to comment.