OzzyRMOzzyRMDocs
React

Watch & HMR

Keep schema docs in sync while you develop in any React app.

Editing .prisma or .sql files sits outside most bundler module graphs, so browser HMR is not automatic unless you opt in.

Behavior

ModeSetupBehavior
RefreshloadCatalog(config) + dynamic server renderReload catalog on full page refresh
Config editsimport ozzyrm.config.tsBundler HMR when the config module changes
Schema file HMRwatch.hot: true + ozzyrm watchstamp bridge invalidates the docs module

Enable watch

TypeScript
export default defineProject({
  schemas: [
    /* ... */
  ],
  watch: {
    enabled: true,
    debounceMs: 200,
    generateOnStart: true,
    hot: true,
  },
});

Run the watcher beside your React app:

Terminal
npx ozzyrm watch   # terminal 1
# terminal 2: vite / next dev / remix vite / your React server

watch: false disables the CLI watcher. Production loadCatalog ignores watch options.

Without the watcher, refresh the page after schema edits.

Framework notes

  • Any React app: pair ozzyrm watch with your existing dev script
  • RSC hosts (including Next.js App Router): OzzyRMDocsFromConfig can import the stamp when hot: true
  • Client-only hosts: regenerate catalog (or call handle.update) after watch writes new JSON

Full option reference: Watch options.

On this page