Skip to content

Examples

Choose the boundary your application owns, then compare how that ecosystem creates, exposes, and disposes a scope. Each group mirrors one directory in examples/.

Start Here

Read examples/_shared/container.ts first. Most server-side examples import this builder so their files can focus on framework wiring.

GroupWhat to compare
JavaScript usageNode ESM, Node CommonJS, and browser bundler usage
Backend frameworksFastify, Hono, Koa, Express, and Elysia request-scope adapters
API layerstRPC, Apollo Server, and GraphQL Yoga request-scope boundaries
Full-stack frameworksNext.js App Router and Remix loader/action scopes
Runtimes and edge platformsNode HTTP, Bun, Deno, Cloudflare Workers, Vercel Edge, Deno Deploy, and Supabase Edge
Frontend frameworksReact, React Native, Vue, and Svelte feature scopes
Bots, queues, and CLITelegraf, Grammy, BullMQ, Commander, and Yargs operation scopes

How to Read the Groups

Use examples/_shared/container.ts as the application graph for server-side examples. The group pages focus on lifecycle ownership: where a scope is created, where it is exposed, and where it is disposed.

For server-side and worker examples, compare the framework/platform lifecycle hooks. For frontend examples, compare the mount and unmount boundaries.

Reference snippets

pnpm run examples:typecheck checks examples/_shared/container.ts and examples/_shared/testing.ts. It does not typecheck every framework snippet because the root workspace does not install every framework dependency. Copy the relevant pattern into your application, install its dependencies, and adapt the shared graph to your types.