Skip to content

Upgrade ACL generation and runtime to CASL 7 - #106

Merged
urbankrepel-povio merged 1 commit into
mainfrom
codex/casl-7-upgrade
Nov 3, 2026
Merged

urbankrepel-povio merged 1 commit into
mainfrom
codex/casl-7-upgrade

Conversation

@urbankrepel-povio

Copy link
Copy Markdown
Collaborator

CASL 7 consumers cannot compile the generated AppAbility or import the ACL runtime because they reference removed PureAbility and CASL React context APIs. Upgrade @casl/ability to 7.1.1 and @casl/react to 7.1.0, migrate both JavaScript and native ACL templates to Ability, and adapt the runtime to AbilityProvider while preserving AbilityContext.Consumer, the Can tuple API, and its (isAllowed, ability) callback.

This raises the optional CASL peer requirements to version 7. Consumers should regenerate their client and migrate handwritten PureAbility types. The README documents the new peer ranges and CASL 7's empty-condition behavior.

Validation on macOS with Bun 1.4.4:

  • Frozen Bun install, type-check, lint, formatting, TypeScript build, and built ACL entry import passed.
  • bun run test:ts: 1,331 passed, 13 skipped.
  • bun run test:native: 1,331 passed, 13 skipped.
  • New regressions compile and execute generated ACL files in both modes, verify native template use, and exercise conditional permissions, packed rules, empty conditions, subscriptions, and Can rendering/callbacks.

Local native validation used the existing OPENAPI_NATIVE_FAST_BUILD=1 development build. The release build compiled successfully, but its binary failed to load on this macOS host with mis-aligned LINKEDIT string pool; release-binary runtime validation remains for CI. No build configuration changes are included.

@urbankrepel-povio
urbankrepel-povio merged commit 8b1468b into main Nov 3, 2026
6 checks passed
@urbankrepel-povio
urbankrepel-povio deleted the codex/casl-7-upgrade branch November 3, 2026 09:13
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.

3 participants