turtle dev

Rebuild only what changed.

Turtle uses Bun metafile inputs as the authoritative dependency graph, then atomically publishes revisioned server modules and browser updates.

Update classification

ChangeBuild workBrowser action
Client Component implementationBrowser + SSR; hot update moduleReact Refresh, state preserved
Server Component implementationRSC + request runtimeFlight refresh, client state preserved
Runtime dependencyAffected runtime graphAtomic server swap
Route shape, client exports, configRequired graphs and manifestsFull document reload
Application public fileNo framework graphFull document reload

Protocol

The dev server exposes an event stream at /__hmr. Successful builds publish revision, duration, optional hot-update URL, Flight-refresh flag, and reload flag. Build failures publish a safe message and leave the last good runtime active. Changes are debounced; edits arriving during a build queue another revision.

React Refresh

Development browser graphs install the React Refresh runtime. Turtle recompiles arbitrary directive-discovered Client Components, registers their exported component identities, imports the revisioned update, and calls performReactRefresh(). Server edits use the installed router's refresh() path instead.

Build outputs

dist/
  rsc/render-flight[-revision].js
  ssr/render-html[-revision].js
  runtime/handle-request[-revision].js
  manifests/{route-manifest,client-manifest}.json
  meta/{rsc,ssr,browser,runtime,assets}.json
public/assets/
  browser.js
  hot/refresh-revision.js

Verification

bun run check
bun run build
bun test ./tests
bun run verify

The conformance suite covers deterministic builds, server/client boundaries, filesystem routing, metadata, handlers, context isolation, assets, navigation, RSC and HTML first-byte streaming, graph-selective HMR, security headers, load, and production artifact leakage.

Bun 1.3.14 production minification and concurrent in-process graph builds are deliberately disabled after full-graph correctness failures. Turtle favors valid deterministic artifacts over speculative build speed.