next-evolve 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/react/region.js +2 -1
- package/docs/troubleshooting.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@ A/B tests and bandits for Next.js App Router sites. Variants are chosen on the s
|
|
|
6
6
|
|
|
7
7
|
**Requirements:** Next.js 15.5 or newer with the App Router, Node 22.12 or newer, a Postgres 14+ database, and a host that runs a Node server (not `output: "export"`).
|
|
8
8
|
|
|
9
|
-
## Quickstart (about
|
|
9
|
+
## Quickstart (about 15 minutes)
|
|
10
10
|
|
|
11
|
-
This gets you from an existing Next.js app to a running experiment in local development.
|
|
11
|
+
This gets you from an existing Next.js app to a running experiment in local development. A timed run on a fresh `create-next-app` reached a variant served, an exposure recorded and the visitor in the dashboard in under 6 minutes.
|
|
12
12
|
|
|
13
13
|
### 1. Create a site
|
|
14
14
|
|
|
@@ -19,7 +19,7 @@ Sign in at [app.evolveab.com](https://app.evolveab.com), enter a site name and c
|
|
|
19
19
|
Evolve writes events into its own `evolve` schema, so your app's existing database is fine. For local development, Docker works:
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
docker run -d --name evolve-pg -e POSTGRES_PASSWORD=postgres -p
|
|
22
|
+
docker run -d --name evolve-pg -e POSTGRES_PASSWORD=postgres -p 54320:5432 postgres:17
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
For production, any Postgres works (Neon, Supabase, RDS, your own). On serverless hosts use the pooled URL (for example Neon's `-pooler` host).
|
|
@@ -32,7 +32,7 @@ In your app's directory:
|
|
|
32
32
|
npx next-evolve init \
|
|
33
33
|
--key evk_live_… \
|
|
34
34
|
--webhook-secret whsec_… \
|
|
35
|
-
--db postgres://postgres:postgres@localhost:
|
|
35
|
+
--db postgres://postgres:postgres@localhost:54320/postgres \
|
|
36
36
|
--routes "/"
|
|
37
37
|
```
|
|
38
38
|
|
package/dist/react/region.js
CHANGED
|
@@ -8,7 +8,7 @@ import { CONTROL_CODE, decodeCode } from "@next-evolve/protocol";
|
|
|
8
8
|
import { createElement } from "react";
|
|
9
9
|
import { headers } from "next/headers";
|
|
10
10
|
import { unstable_rethrow } from "next/navigation";
|
|
11
|
-
import { after } from "next/server";
|
|
11
|
+
import { after, connection } from "next/server";
|
|
12
12
|
// src/react/region.tsx
|
|
13
13
|
let warnedNoContext = false;
|
|
14
14
|
async function currentCode() {
|
|
@@ -100,6 +100,7 @@ async function Optimizable({ id, component, props }) {
|
|
|
100
100
|
if (code === CONTROL_CODE) return control();
|
|
101
101
|
const pairs = decodeCode(code);
|
|
102
102
|
if (!pairs || pairs.length === 0) return control();
|
|
103
|
+
if (!requestContext().code) await connection();
|
|
103
104
|
let bundle = await getRenderBundle();
|
|
104
105
|
let hit = findPair(bundle, pairs, id);
|
|
105
106
|
const unknown = () => pairs.some((p) => !bundle?.variants[p.var]);
|
package/docs/troubleshooting.md
CHANGED
|
@@ -15,7 +15,7 @@ Start with `npx next-evolve doctor`. It checks the env, key, database, bundle, p
|
|
|
15
15
|
**`cacheComponents` errors.**
|
|
16
16
|
- `Route segment config "revalidate" is not compatible with nextConfig.cacheComponents`: the page was set up in static mode. Re-run `npx next-evolve init` with `next-evolve` 0.3.4 or newer (it uses dynamic mode with `cacheComponents`), or by hand: move the page back out of `app/[evolve]/`, remove the `withEvolve`/`evolveStaticParams`/`evolveMetadata` lines and set the route's mode to `"dynamic"`.
|
|
17
17
|
- `uncached or runtime data … accessed outside of <Suspense>` in `next build`: wrap `<Optimizable>` in `<Suspense>`.
|
|
18
|
-
- `encountered the unstable value Date.now()` in the dev overlay, pointing at `<Optimizable>`: upgrade to `next-evolve` 0.3.
|
|
18
|
+
- `encountered the unstable value Date.now()` in the dev overlay, pointing at `<Optimizable>`: upgrade to `next-evolve` 0.3.5 or newer.
|
|
19
19
|
|
|
20
20
|
**`doctor`: "Database: not migrated".** Run `npx next-evolve migrate`.
|
|
21
21
|
|