Context
@btst/stack 3.0.0 is the breaking release landing the Refine-inspired core simplification (upstream: better-stack-ai/better-stack#127, #128, #129, #130, #131, #132, #133, #136, #137).
This migration assumes 3.0.0 is published to npm and all upstream phases are finished. One migration PR against the final API — no 2.x compat.
This repo is the template third-party plugin authors start from, so the bar is higher than "it builds": every file should demonstrate the canonical 3.0.0 pattern, because whatever this template does will be copied. The 2.x boilerplate this template currently teaches (hand-written query keys, error helpers, per-plugin navigation overrides, manual page-handler glue) no longer exists upstream.
Migration checklist
packages/plugin — the todo plugin (the actual teaching material)
examples/nextjs — the consumer example
Repo docs
Acceptance criteria
- Builds, type-checks, and E2E passes against published
@btst/stack 3.0.0
- Zero references to removed 2.x surfaces (grep-verified)
- The template demonstrates each major 3.0.0 primitive at least once:
defineRoutes, createResource, useForm with field errors, useNotify, t(), <CanAccess>, entry factories, top-level providers
- A plugin author following only this template produces an idiomatic 3.0.0 plugin
Context
@btst/stack3.0.0 is the breaking release landing the Refine-inspired core simplification (upstream: better-stack-ai/better-stack#127, #128, #129, #130, #131, #132, #133, #136, #137).This migration assumes 3.0.0 is published to npm and all upstream phases are finished. One migration PR against the final API — no 2.x compat.
This repo is the template third-party plugin authors start from, so the bar is higher than "it builds": every file should demonstrate the canonical 3.0.0 pattern, because whatever this template does will be copied. The 2.x boilerplate this template currently teaches (hand-written query keys, error helpers, per-plugin navigation overrides, manual page-handler glue) no longer exists upstream.
Migration checklist
packages/plugin— the todo plugin (the actual teaching material)@btst/stackto>=3.0.0(catalog) and any@btst/yarreferences to>=1.3.0defineRoute/defineRoutes; parameterized routepageComponentsoverrides receive route context ({ params }) as propscreateResource; public hooks (useTodos, etc.) become one-liners over the factoryuseForm(create lifecycle, invalidation,successMessage,redirect), demonstrating field-levelStackErrormapping with a server-side Zod validation exampleuseNotify()instead of direct toast importst("todos.…", "Default")so the template demonstrates translatable plugins<CanAccess>and/or a route permission declaration on one route (e.g. gate deleting todos) so plugin authors see the patternuseListStateoverrides.tscontains only genuinely plugin-specific overrides — noLink/navigate/refresh/apiBaseURLfields (removed upstream)examples/nextjs— the consumer examplecreateNextPage; API route viatoNextRouteHandlers(entry factories) — each file ≤5 linesStackProvider:router={nextRouter()},api, and (where demonstrated)auth/notify/i18n— no per-plugin navigation wiringonBefore*PageRenderedcallbacks, manual identity props) — verify by grepRepo docs
createResource,defineRoutes,useForm, providers) so new plugin authors never see 2.x patternsAcceptance criteria
@btst/stack3.0.0defineRoutes,createResource,useFormwith field errors,useNotify,t(),<CanAccess>, entry factories, top-level providers