Skip to content

Commit f6f7594

Browse files
committed
Readme
1 parent 642256a commit f6f7594

File tree

3 files changed

+99
-93
lines changed

3 files changed

+99
-93
lines changed

README.md

Lines changed: 6 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -7,96 +7,8 @@ Starting from version `2.0.0`, this package no longer depends on `@neshca/cache-
77

88
## Migration
99

10-
### 1.x.x → 2.x.x
11-
12-
> **Note:** Starting in `2.0.0`, `@neshca/cache-handler` is no longer a dependency.
13-
14-
**Requirements:**
15-
16-
- Next.js `>=15.2.4`
17-
- Redis `>=5.5.6`
18-
19-
If you're only using the Redis client:
20-
21-
```json
22-
"next": ">=15.2.4",
23-
"@redis/client": ">=5.5.6"
24-
```
25-
26-
If you need the full Redis package:
27-
28-
```json
29-
"next": ">=15.2.4",
30-
"redis": ">=5.5.6"
31-
```
32-
33-
#### Code changes
34-
35-
**Before (1.x.x):**
36-
37-
```js
38-
const {
39-
Next15CacheHandler,
40-
} = require("@fortedigital/nextjs-cache-handler/next-15-cache-handler");
41-
module.exports = new Next15CacheHandler();
42-
```
43-
44-
**After (2.x.x+):**
45-
46-
```js
47-
const { CacheHandler } = require("@fortedigital/nextjs-cache-handler");
48-
module.exports = CacheHandler;
49-
```
50-
51-
`createBufferStringHandler` is integrated into `redis-strings` and no longer required separately for Next 15+.
52-
53-
---
54-
55-
### 1.2.x → ^1.3.x
56-
57-
#### Cache Handler
58-
59-
**Before:**
60-
61-
```js
62-
const {
63-
Next15CacheHandler,
64-
} = require("@fortedigital/nextjs-cache-handler/next-15-cache-handler");
65-
module.exports = new Next15CacheHandler();
66-
```
67-
68-
**After:**
69-
70-
```js
71-
const { Next15CacheHandler } = require("@fortedigital/nextjs-cache-handler");
72-
module.exports = Next15CacheHandler;
73-
```
74-
75-
#### Instrumentation
76-
77-
**Before:**
78-
79-
```js
80-
if (process.env.NEXT_RUNTIME === "nodejs") {
81-
const { registerInitialCache } = await import(
82-
"@neshca/cache-handler/instrumentation"
83-
);
84-
const CacheHandler = (await import("./cache-handler.js")).default;
85-
await registerInitialCache(CacheHandler);
86-
}
87-
```
88-
89-
**After:**
90-
91-
```js
92-
if (process.env.NEXT_RUNTIME === "nodejs") {
93-
const { registerInitialCache } = await import(
94-
"@fortedigital/nextjs-cache-handler/instrumentation"
95-
);
96-
const CacheHandler = (await import("./cache-handler.js")).default;
97-
await registerInitialCache(CacheHandler);
98-
}
99-
```
10+
- [1.x.x → ^2.x.x](docs\migration\1_x_x__2_x_x.md)
11+
- [1.2.x -> ^1.3.x](docs\migration\1_2_x__1_3_x.md)
10012

10113
---
10214

@@ -108,8 +20,9 @@ If upgrading from Next 14 or earlier, **flush your Redis cache**. Cache formats
10820

10921
## Next 15 Support
11022

111-
`@neshca/cache-handler` does not support Next.js 15+. Prior to 2.0.0, this package provided wrappers and enhancements.
23+
`@neshca/cache-handler` does not support Next.js 15. Prior to 2.0.0, this package provided wrappers and enhancements.
11224
From version 2.0.0 onward, `@fortedigital/nextjs-cache-handler` is a standalone solution with no dependency on `@neshca/cache-handler`.
25+
`@fortedigital/nextjs-cache-handler` is fully compatible with Next.js 15 and [redis 5](https://www.npmjs.com/package/redis).
11326

11427
We aim to keep up with new Next.js releases and will introduce major changes with appropriate version bumps.
11528

@@ -249,7 +162,7 @@ const compositeHandler = createCompositeHandler({
249162
250163
---
251164
252-
### ⚠️ `buffer-string-decorator` | **REMOVED IN 2.0.0!** - integrated into the core package ⚠️
165+
### ⚠️ `buffer-string-decorator` | **REMOVED IN 2.0.0!** - integrated into the core package
253166
254167
#### Features:
255168
@@ -280,7 +193,7 @@ const bufferStringDecorator =
280193
281194
#### Full example
282195
283-
`./examples/redis-minimal`
196+
[Example project](./examples/redis-minimal)
284197
285198
#### Example `cache-handler.js`.
286199

docs/migration/1_2_x__1_3_x.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Migration
2+
3+
## 1.2.x → ^1.3.x
4+
5+
## Cache Handler
6+
7+
**Before:**
8+
9+
```js
10+
const {
11+
Next15CacheHandler,
12+
} = require("@fortedigital/nextjs-cache-handler/next-15-cache-handler");
13+
module.exports = new Next15CacheHandler();
14+
```
15+
16+
**After:**
17+
18+
```js
19+
const { Next15CacheHandler } = require("@fortedigital/nextjs-cache-handler");
20+
module.exports = Next15CacheHandler;
21+
```
22+
23+
## Instrumentation
24+
25+
**Before:**
26+
27+
```js
28+
if (process.env.NEXT_RUNTIME === "nodejs") {
29+
const { registerInitialCache } = await import(
30+
"@neshca/cache-handler/instrumentation"
31+
);
32+
const CacheHandler = (await import("./cache-handler.js")).default;
33+
await registerInitialCache(CacheHandler);
34+
}
35+
```
36+
37+
**After:**
38+
39+
```js
40+
if (process.env.NEXT_RUNTIME === "nodejs") {
41+
const { registerInitialCache } = await import(
42+
"@fortedigital/nextjs-cache-handler/instrumentation"
43+
);
44+
const CacheHandler = (await import("./cache-handler.js")).default;
45+
await registerInitialCache(CacheHandler);
46+
}
47+
```

docs/migration/1_x_x__2_x_x.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Migration
2+
3+
## 1.x.x → 2.x.x
4+
5+
> **Note:** Starting in `2.0.0`, `@neshca/cache-handler` is no longer a dependency.
6+
7+
**Requirements:**
8+
9+
- Next.js `>=15.2.4`
10+
- Redis `>=5.5.6`
11+
12+
If you're only using the Redis client:
13+
14+
```json
15+
"next": ">=15.2.4",
16+
"@redis/client": ">=5.5.6"
17+
```
18+
19+
If you need the full Redis package:
20+
21+
```json
22+
"next": ">=15.2.4",
23+
"redis": ">=5.5.6"
24+
```
25+
26+
## Code changes
27+
28+
**Before (1.x.x):**
29+
30+
```js
31+
const {
32+
Next15CacheHandler,
33+
} = require("@fortedigital/nextjs-cache-handler/next-15-cache-handler");
34+
module.exports = new Next15CacheHandler();
35+
```
36+
37+
**After (2.x.x+):**
38+
39+
```js
40+
const { CacheHandler } = require("@fortedigital/nextjs-cache-handler");
41+
module.exports = CacheHandler;
42+
```
43+
44+
`createBufferStringHandler` is integrated into `redis-strings` and no longer required separately for Next 15+.
45+
46+
---

0 commit comments

Comments
 (0)