/tools/peepless/docs/migrating/Appendix F of FMoving to 1.0Daybook of peepless 1.0.0-rc.2Days kept in UTC
F
Appendix F · rendered from docs/migrating.mddocs/migrating.md on GitHub

Moving from 0.x to 1.0

Every breaking change since 0.1, in one place. If your app is on 0.1 or later, work down the list; most apps need only the first two steps. Nothing in your database changes: no counter name was renamed and the table is the same, so old rows and new ones add up.

1. Node 20 or later (0.4)

engines.node is >=20. Node 18 is past end of life.

2. Imports that were never meant to be public (0.2)

peepless no longer exports routeOf, blocked, readIgnoreParam, ignored, DEFAULT_ENDPOINT or DEFAULT_IGNORE_PARAM, and peepless/server no longer exports checkProjects, EVENT or utcDay.

You used Use instead
ignored() isOptedOut()
blocked(host) start(...).reason, which is null while counting
checkProjects(projects) createHandler({ projects, store }): it throws on the same mistakes
the others copy them; they were a few lines each

What start returns (Peepless) also gained counting and reason in 0.2, so a hand-written mock of it needs both.

3. More page views, on purpose (0.2)

  • history.replaceState to a new path now counts a page view, as pushState does: Next.js router.replace and React Router's navigate(to, { replace: true }) were being missed. A replaceState that only changes the query or hash still counts nothing.

  • A page restored from the back/forward cache counts a page view (not a visit).

  • (0.5) The engaged-visit state is kept per project, so two apps on one origin no longer share it, and human may rise for an app that shares its origin with another.

So pageview (and on a shared origin, human) may rise a little after upgrading, with no change in traffic.

4. The localhost hint (0.2)

The console line on localhost names the reason by its code (not-live) and suggests debug: true. If a test matched its old wording, match the code instead.

5. Starters pin peepless@1 (1.0)

From 1.0.0, the Supabase Edge Function starters import npm:peepless@1/server (the release candidate still says @0, because @1 doesn't match a prerelease). Edit the import in a copied function the next time you deploy it.

Worth turning on while you're here

None of these is needed, but each arrived in 0.x:

  • readCounts, summarize and createStatsHandler (0.3), or npx peepless report, to read the numbers back.
  • campaigns for ?ref= links (0.4), on both the client and the server project.
  • address on createHandler (0.4) if your host passes x-forwarded-for through from the client (on Cloudflare, (req) => req.headers.get('cf-connecting-ip')).
  • postgresStore or d1Store (0.4) if you'd rather not use Supabase.