Skip to content

Commit

Permalink
chore: version packages
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and jmcdo29 committed Jan 19, 2023
1 parent 4803dda commit f8a1be2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 31 deletions.
30 changes: 0 additions & 30 deletions .changeset/violet-islands-compare.md

This file was deleted.

31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# [2.0.0](https://github.com/nestjs/throttler/compare/v1.2.1...v2.0.0) (2021-07-09)

## 4.0.0

### Major Changes

- 4803dda: Rewrite the storage service to better handle large numbers of operations

## Why

The initial behavior was that `getRecord()` returned an list of sorted TTL
timestamps, then if it didn't reach the limit, it will call `addRecord()`.
This change was made based on the use of the Redis storage community package
where it was found how to prevent this issue. It was found out that
[express-rate-limit](https://github.com/express-rate-limit/express-rate-limit)
is incrementing a single number and returning the information in a single
roundtrip, which is significantly faster than how NestJS throttler works by
called `getRecord()`, then `addRecord`.

## Breaking Changes

- removed `getRecord`
- `addRecord(key: string, ttl: number): Promise<number[]>;` changes to `increment(key: string, ttl: number): Promise<ThrottlerStorageRecord>;`

## How to Migrate

If you are just _using_ the throttler library, you're already covered. No
changes necessary to your code, version 4.0.0 will work as is.

If you are providing a custom storage, you will need to remove your current
service's `getRecord` method and rename `addRecord` to `incremenet` while
adhering to the new interface and returning an `ThrottlerStorageRecord` object

## 3.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nestjs/throttler",
"version": "3.1.0",
"version": "4.0.0",
"description": "A Rate-Limiting module for NestJS to work on Express, Fastify, Websockets, Socket.IO, and GraphQL, all rolled up into a simple package.",
"author": "Jay McDoniel <me@jaymcdoniel.dev>",
"contributors": [],
Expand Down

0 comments on commit f8a1be2

Please sign in to comment.