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>()insrc/cg/mod.rs, and the alias doesn't clash with an existing one - [ ]
METHODSlists only methods that really are for the browser; the other arms of thematchareunreachable! - [ ] 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
argskeys it needs and validates type, length and range; numbers accept both strings (FormData) and numbers - [ ] Methods taking an id load it with
find_or_failand 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_ACTIONSor theAction::newchecks) 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 picksparamsexplicitly 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; noHtml::raw/|safeon 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'sdata-linker-ref-allowopens only plain-textdata-*/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 withoff()
Tests
- [ ] New Linker methods have tests covering success, validation failure and no permission
- [ ] New components, or components whose HTML changed, have a matching
php_paritytest - [ ]
cargo test --workspacepasses
Deployment
- [ ] Every machine shares the same
APP_KEY, cache store and session store - [ ] Production runs with
APP_DEBUG=false