Skip to content

Commit 32a1785

Browse files
committed
chore(release): releases
1 parent efd760b commit 32a1785

12 files changed

+97
-98
lines changed

.changeset/afraid-clouds-allow.md

-9
This file was deleted.

.changeset/angry-spies-sniff.md

-7
This file was deleted.

.changeset/gorgeous-flies-work.md

-9
This file was deleted.

.changeset/mighty-sheep-change.md

-22
This file was deleted.

.changeset/spotty-waves-juggle.md

-21
This file was deleted.

.changeset/tidy-days-flash.md

-16
This file was deleted.

.changeset/wet-ligers-tell.md

-7
This file was deleted.

.changeset/wicked-pears-burn.md

-5
This file was deleted.

packages/bentocache/CHANGELOG.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# bentocache
2+
3+
## 1.0.0
4+
5+
- eeb3c8c: BREAKING CHANGES:
6+
This commit changes the API of the `gracePeriod` option.
7+
- `gracePeriod` is now `grace` and should be either `false` or a `Duration`.
8+
- If you were using the `fallbackDuration` option, you should now use the `graceBackoff` option at the root level.
9+
- 82e9d6c: Previously, `suppressL2Errors` was automatically enabled even when we had just a L2 layer. Which can be confusing, because errors were filtered out.
10+
11+
Now `suppressL2Errors` is a bit more intelligent and will only be enabled if you have a L1 layer. Unless you explicitly set it to `true`.
12+
13+
- 716a423: BREAKING CHANGES :
14+
15+
`undefined` values are forbidden in the cache. If you are trying to cache `undefined`, you will now get an error. This is a breaking change because it was previously allowed.
16+
17+
If you want to cache something to represent the absence of a value, you can use `null` instead of `undefined`.
18+
19+
- 4478db6: BREAKING CHANGES
20+
21+
## API Changes for timeouts
22+
23+
The timeout options have changed APIs:
24+
`{ soft: '200ms', hard: '2s' }`
25+
26+
Becomes:
27+
28+
```ts
29+
getOrSet({ timeout: '200ms', hardTimeout: '2s' })
30+
```
31+
32+
You can now also use `0` for `timeout` which means that, if a stale value is available, then it will be returned immediately, and the factory will run in the background. SWR-like, in short.
33+
34+
## Default timeout
35+
36+
Now, the default timeout is `0`. As explained above, this enables the SWR-like behavior by default, which is a good default for most cases and what most people expect.
37+
38+
- 7ae55e2: Added an `onFactoryError` option that allows to catch errors that happen in factories, whether they are executed in background or not.
39+
40+
```ts
41+
const result = await cache.getOrSet({
42+
key: 'foo',
43+
grace: '5s',
44+
factory: () => {
45+
throw new MyError()
46+
},
47+
onFactoryError: (error) => {
48+
// error is an instance of errors.E_FACTORY_ERROR
49+
// error.cause is the original error thrown by the factory
50+
// you can also check if the factory was executed in background with error.isBackgroundFactory
51+
// and also get the key with error.key. Will be `foo` in this case
52+
},
53+
})
54+
```
55+
56+
- 27a295d: Keep only POJO syntax
57+
58+
This commit remove the "legacy" syntax and only keep the POJO syntax.
59+
For each method, the method signature is a full object, for example :
60+
61+
```ts
62+
bento.get({ key: 'foo ' })
63+
bento.getOrSet({
64+
key: 'foo',
65+
factory: () => getFromDb(),
66+
})
67+
```
68+
69+
- f0b1008: The memory driver can now accept `maxSize` and `maxEntrySize` in human format. For example, `maxSize: '1GB'` or `maxEntrySize: '1MB'`.
70+
71+
We use https://www.npmjs.com/package/bytes for parsing so make sure to respect the format accepted by this module.
72+
73+
- a8ac574: This commit adds a new custom behavior for handling GetSet operation when end-user is using a single L2 storage without L1 cache.

packages/bentocache/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bentocache",
33
"type": "module",
4-
"version": "1.0.0-beta.13",
4+
"version": "1.0.0",
55
"description": "Multi-tier cache module for Node.js. Redis, Upstash, CloudfareKV, File, in-memory and others drivers",
66
"author": "Julien Ripouteau <[email protected]>",
77
"license": "MIT",

packages/prometheus/CHANGELOG.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# @bentocache/plugin-prometheus
2+
3+
## 0.2.0
4+
5+
### Minor Changes
6+
7+
- eeb3c8c: BREAKING CHANGES:
8+
This commit changes the API of the `gracePeriod` option.
9+
- `gracePeriod` is now `grace` and should be either `false` or a `Duration`.
10+
- If you were using the `fallbackDuration` option, you should now use the `graceBackoff` option at the root level.
11+
12+
### Patch Changes
13+
14+
- Updated dependencies [eeb3c8c]
15+
- Updated dependencies [82e9d6c]
16+
- Updated dependencies [716a423]
17+
- Updated dependencies [4478db6]
18+
- Updated dependencies [7ae55e2]
19+
- Updated dependencies [27a295d]
20+
- Updated dependencies [f0b1008]
21+
- Updated dependencies [a8ac574]
22+

packages/prometheus/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@bentocache/plugin-prometheus",
33
"type": "module",
4-
"version": "0.1.0",
4+
"version": "0.2.0",
55
"description": "Prometheus plugin for Bentocache",
66
"author": "Julien Ripouteau <[email protected]>",
77
"license": "MIT",

0 commit comments

Comments
 (0)