← Recipe: add typed navigation

6. Understand and extend

luastra/navigation · checked parameters · about 15 minutes
definitions → compiler → router → render

The compiler owns path rules; the router owns the current stack; render reads it; handle requests checked mutations.

When to use it

Read this after the unmodified route sequence works once.

  • Inspect each mutation result before assuming the route changed in product code.
  • Persist router.encode() with State and Host storage only when navigation must survive restart.
  • Use Host.historyPushLocation and navigation.history when browser Back and the visible URL must mirror Luau state.
  • Never concatenate untrusted path fragments when a compiled route can validate and encode them.

Complete inventory

View all pages in Recipe: add typed navigation
← Previous: 5. Check and run