Guide/guides
Upgrading Guren
Use this guide for minor-to-minor upgrades.
Upgrading Guren
Use this guide for minor-to-minor upgrades.
Upgrade Workflow (Required)
- Read
CHANGELOG.mdand release notes. - Check
docs/en/guides/release-policy.mdcompatibility matrix. - Update dependencies and regenerate artifacts:
bun install
bunx guren codegen
- Run validations:
bun run build
bun run typecheck
bun run test
- Apply migration notes for your source/target versions.
Migration Notes
rc → 1.0.0
Strict mass assignment
- What changed: Models that define
fillablenow throw aMassAssignmentExceptionwhencreate()/update()receives a field outside the allowlist. Previously, extra fields were silently discarded. - Who is affected: Any code that passes unfiltered objects (spread request bodies, merged defaults) to
create()/update(). - How to migrate: Pass only allowlisted fields, or use
forceCreate()/forceUpdate()for trusted server-side data such as seeders and system records. To restore the old discard behavior on a specific model, setstatic strictFillable = false.
// Before: authorId silently dropped when not in fillable
await Post.create({ ...data, authorId: user.id })
// After: either add authorId to fillable, or use forceCreate for trusted data
await Post.forceCreate({ ...validated, authorId: user.id })
Sanitized auth user records
- What changed:
auth.user()no longer contains the password column, the remember-token column, or fields listed in the model'sstatic hidden. - Who is affected: Code that read those fields off the authenticated user object.
- How to migrate: Load the model explicitly (e.g.
User.findOrFail(user.id)) in the rare server-side flows that need the raw record.
SSE broadcasting
- What changed:
private-/presence-channels without a registered authorizer are now denied by default, and subscribing requires theclientIddelivered in the SSEconnectedevent. - Who is affected: Apps using the SSE broadcasting endpoints.
- How to migrate: Register authorizers with
broadcast.privateChannel()/broadcast.presenceChannel(), capture theclientIdfrom theconnectedevent, and send it inPOST /broadcasting/authto authorize and subscribe in one call. See the Broadcasting guide.
Verify the upgrade:
bun run typecheck && bun run test
Breaking Change Template (for future releases)
For each breaking item, document:
- What changed
- Why
- Who is affected
- Before/After code examples
- One-command verification