Skip to content

docs: add guard concept page#167

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/add-guard-md-to-docs
Draft

docs: add guard concept page#167
Copilot wants to merge 1 commit intomainfrom
copilot/add-guard-md-to-docs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

No conceptual overview existed explaining guards as a unified system — how they work, where to use them, and how to build a reusable guard library.

Added docs/concepts/guard.md

  • Core concepts — the three guard results (pass, hidden, redirectTo), sequential evaluation, and short-circuit behavior
  • Usage locations — route guards (defineModule/defineResource) vs component guards (WithGuard), and what each affects (sidebar visibility, URL access, DOM rendering)
  • Context data — typing contextData via AppShellRegister for fully typed guard functions
  • Common patterns — auth checks, RBAC, permission strings, feature flags, async API checks, tenant tiers
  • Reusable guard library — how to define guards once in a shared guards.ts and reuse across both routes and components
  • Comparison table — route guards vs WithGuard across key dimensions (redirect support, navigation hiding, URL blocking, async)
  • Cross-links — to modules-and-resources.md, with-guard.md, and the guards API reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants