From 0.82 to 0.85
One ordered checklist for an app that goes from better-supabase 0.82.0 to 0.85.0 in one step, with the shared cache tier on Next.js Cache Components and Vercel. It links to the 0.82 to 0.83 and 0.84 to 0.85 guides for each change.
This page is the order to do the work in when an app moves from 0.82.0 to 0.85.0 at once. 0.83.0 was never published, so 0.84.0 is the first release after 0.82.0 that carries the 0.83 changes. Each step links to the section of From 0.82 to 0.83 or From 0.84 to 0.85 that explains it; read those for the detail. The steps assume a Next.js 16 app with Cache Components on Vercel and an authorization provider that ships its own adapter.
Checklist
-
Bump the package. Set
better-supabaseto0.85.0and remove@supabase/pg-deltaand@supabase/pg-topofrom your ownpackage.json: the CLI installs them now (Direct dependencies). Then runpnpm install. -
Run the 0.83 codemods, in this order, and review the diff after each:
pnpm better-supabase codemod blocks-list pnpm better-supabase codemod config --prune pnpm better-supabase codemod record-types pnpm better-supabase codemod table-tags pnpm better-supabase codemod doctor-baseline -
Move the provider fields. Move permission keys and floors from the config to the provider (0.83 provider fields). To share cache entries per tenant later, have the provider declare
tablesand its hooksshareKey, and list a page function undersharedFunctions(0.85 provider fields). An authorizer that readscontext.enforcementmust treat an unset value as"definer"(The authorizer context). -
Upgrade and generate. Run
pnpm better-supabase upgrade, which moves thetasksmodule to version 7 and writes the trigger, function and table changes. Then runpnpm better-supabase gen,pnpm db:genandpnpm supabase:diff <name>, and apply the migration. Review the task coordination changes:claimNextnow picks only the caller's own tasks unless you setclaims.next: "any". -
Run doctor with
pnpm better-supabase doctor. The new rules from 0.83 (Doctor) and 0.85 (Doctor rules) report, among others, a provider value that disagrees with the config (BS427), a table with more than four policies for one command (BS641), a shared function that isn't security invoker (BS430) and a public kept entry on a tableanoncan't select (BS645). Runpnpm better-supabase gen --save-snapshotonce so an offline doctor has the function inventory. -
Fix the data changes. Add
search.columnsto every record type withsearch.from(Search source views), finish an import run only when every chunk is done and readresultinstead ofitems(Import chunks), and filterinvoice_open_itemsondocument_typeif you query it (Open items). Import batches need no code. -
Adopt
bsb.kept(). Pick the store increateNext, then move the reads that repeat across requests intobsb.kept()(Keep reads across requests and deploys). Useshare: "tenant"for a list every member with the same grant sees,functionsfor a page that loads in one RPC,share: "public"for data with no tenant, andshareGuard(ctx, db)around a service that builds its owndb. -
Warm the instance. Await
warm(bsb, { postgres: pool })frombetter-supabase/next/instrumentationinregister(), so the first request doesn't open the JWKS, PostgREST and pool connections itself (Server). -
Re-check the request stats. Turn on
debug: { budget }and compare the calls and waves of each page with the numbers from 0.82 (Budget). A kept hit counts no call, a fill counts the calls it made, and reads inside"use cache: private"count on the request that rendered them.
Which store needs the cache tables
postgresCacheSql() creates the entries, tags and leases tables and their
functions. Only postgresKeptStore(), postgresCacheHandler() and
postgresKeptLease() read them. An app that keeps its entries on the Vercel
Runtime Cache with vercelRuntimeCacheAdapter(getCache) and takes no
Postgres lease doesn't need postgresCacheSql() at all. Add it when you pass
lease: postgresKeptLease({ client }), which uses only the leases table and
its function, or when you move the entries to Postgres.
| Store | Needs postgresCacheSql() |
|---|---|
memoryKeptStore(), the default | No |
vercelRuntimeCacheAdapter(getCache) | No |
vercelRuntimeCacheAdapter(getCache, { lease: postgresKeptLease(...) }) | Yes, for the leases |
postgresKeptStore({ client }) | Yes |
What changed between 0.84.0 and 0.85.0 in this step
| Change | Before | After |
|---|---|---|
./next evaluation in a fresh Node process | 104.5 ms, 109 files, 256.8 KB | 93.1 ms, 89 files, 224.2 KB |
| Miss on four instances, Runtime Cache lock | 4 fills, p50 82.8 ms | 1 fill with postgresKeptLease, p50 103.0 ms |
A page RPC in a share: "tenant" fill | refused, kept per user | shared when the provider lists it |
A slow RPC inside "use cache: private" | counted | counted (now covered by a test) |
The lease numbers come from pnpm bench:lease on a Runtime Cache stand-in
whose writes reach other instances 25 ms later; the
caching page
explains the setup. The Vercel rows of the
0.85 measurements
are still pending a maintainer run of scripts/probe-vercel-tags.ts.
A kept read after a deploy is untested on Vercel. Nothing has yet shown that an entry one deployment writes to the Runtime Cache is there for the next deployment, nor that a tag expired before a deploy stays expired after it. Until the probe's "Entry from the previous deployment" row has a Vercel result, plan for a cold kept tier after every deploy: the first read of each entry fills it again, under the caller's RLS.
Last updated on
From 0.80 to 0.81
What to change when upgrading from better-supabase 0.80 to 0.81. eve 1.3, Workflow 5.7.1 and the ai 7.0.179 line, the workflow-sdk SQL module at version 9 with purge backstops, a new WorkflowMaintenance member, skipWorkers and custom skills on Supabase.
From 0.82 to 0.83
What to change when upgrading from better-supabase 0.82 to 0.83. Direct dependencies, the blocks list, project-level defaults, config the render already supplies, authorization facts that move into the provider, Supabase CLI 3.2.0, and the task coordination changes with the tasks module at version 7, claimNext picking only your own tasks by default, category stages, hold kinds, task reservations and before_task_close on every close.