Skip to content

Review checklist ​

When a pull request touches Linker, render fragments or template attributes, go through these.

Linker components ​

  • [ ] New components are registered with linker::register::<C>() in src/cg/mod.rs, and the alias doesn't clash with an existing one
  • [ ] METHODS lists only methods that really are for the browser; the other arms of the match are unreachable!
  • [ ] Every method loads the user and checks permissions (user.authorize(...) or your own helper), without relying on page route middleware
  • [ ] Every method reads only the args keys it needs and validates type, length and range; numbers accept both strings (FormData) and numbers
  • [ ] Methods taking an id load it with find_or_fail and authorize against that record
  • [ ] Amounts, permissions and flow steps are computed by the server or read from self, never trusted from the browser
  • [ ] Multi-step database writes use a transaction; Stateless writes have unique constraints / idempotency
  • [ ] Any cache keys you add include context.user
  • [ ] New fields on state structs have #[serde(default)], so old instances can be read
  • [ ] No leftover eprintln! / dbg! printing sensitive data

Actions ​

  • [ ] New actions exist on both sides: Rust (BUILTIN_ACTIONS or the Action::new checks) and JS (registerLinkerAction)
  • [ ] Actions don't execute arbitrary strings (no JS, HTML or code fragments other than selectors)
  • [ ] The action audit passes

Render fragments ​

  • [ ] Fragment names are registered with render::register, and the function picks params explicitly and validates them
  • [ ] Fragments don't draw content that depends on the user (fragment functions can't see the user)
  • [ ] When building HTML yourself, every interpolated value goes through escape; no Html::raw / |safe on user data
  • [ ] Fragments contain no inline <script> with user data
  • [ ] The params sent are picked explicitly, not the whole state

Templates ​

  • [ ] Every block using data-state-* / render fragments is inside a render object (runtime::render_object)
  • [ ] Allow lists are least-privilege (read-only blocks don't get Allow::StateWrite)
  • [ ] The Linker mount point is on an outer element that isn't redrawn
  • [ ] Irreversible actions like delete have data-linker-confirm-danger
  • [ ] dom.repeat's data-linker-ref-allow opens only plain-text data-* / aria-* attributes
  • [ ] Seed JSON escapes < > &

Client state ​

  • [ ] No passwords, tokens, amounts, permissions or Files
  • [ ] The successful save path has Action::state_clear
  • [ ] Hand-written subscribe() calls are cleaned up with off()

Tests ​

  • [ ] New Linker methods have tests covering success, validation failure and no permission
  • [ ] New components, or components whose HTML changed, have a matching php_parity test
  • [ ] cargo test --workspace passes

Deployment ​

  • [ ] Every machine shares the same APP_KEY, cache store and session store
  • [ ] Production runs with APP_DEBUG=false