All notable changes to this project will be documented in this file.
5.0.0 (https://github.com/stalniy/casl/compare/@casl/react@4.0.0...@casl/react@5.0.0) (2025-01-05)
4.0.0 (https://github.com/stalniy/casl/compare/@casl/react@3.1.0...@casl/react@4.0.0) (2024-06-16)
* removes contextApiPatch.d.ts file from @casl/react to get rid of possible confusion in tools that can greedily include this file into compilation targets (7445a4b (https://github.com/stalniy/casl/commit/7445a4b95fe5ed1a22be91971fb6c70e599e6cee))
* removes contextApiPatch.d.ts file from @casl/react to get rid of possible confusion. The only affected apps are those which are based on React < 16.4.
3.1.0 (2022-08-28)
5.0.1 (2026-01-18)
3.0.1 (2022-07-25)
3.0.0 (2022-05-28)
- replaces StatelessComponent type with FunctionComponent (69336ea)
- package: add repository directory into package.json for all @casl/* packages (#560) (0ef534c)
-
removes deprecated things
- restrics
childrenprop of<Can>to support only single el - updates React to 18.x
- removes react@15 from peer deps
- restrics
2.3.0 (2021-05-12)
- adjusts package tags to improve discoverability (73e88b0)
2.2.2 (2021-01-14)
- react: updates react to v17
2.2.1 (2020-12-28)
2.2.0 (2020-12-26)
- angular: fixes sourcemap generation for the code built by ngc (7715263), closes #387 #382
- package: removes
enginesection that points to npm@6 (eecd12a), closes #417
- builder: improves typings for AbilityBuilder [skip release] (ebd4d17), closes #379
- esm: adds ESM support for latest Node.js through
exportsprop in package.json (cac2506), closes #331
-
builder: changes main generic parameter to be a class instead of instance and makes
defineAbilityto accept options as the 2nd argument.Before
import { AbilityBuilder, defineAbility, Ability } from '@casl/ability'; const resolveAction = (action: string) => {/* custom implementation */ }; const ability = defineAbility({ resolveAction }, (can) => can('read', 'Item')); const builder = new AbilityBuilder<Ability>(Ability);
After
import { AbilityBuilder, defineAbility, Ability } from '@casl/ability'; const resolveAction = (action: string) => {/* custom implementation */ }; const ability = defineAbility((can) => can('read', 'Item'), { resolveAction }); const builder = new AbilityBuilder(Ability); // first argument is now mandatory!
The 1st parameter to
AbilityBuilderis now madatory. This allows to infer generic parameters from it and makes AbilityType that is built to be explicit.
2.1.1 (2020-06-09)
2.1.0 (2020-04-18)
2.0.2 (2020-04-10)
- react: ensure that terser doesn't mangle reserved required props (08eb4f4)
2.0.1 (2020-04-09)
- react: adds support for casl/ability@4 in package.json (4367b43)
2.0.0 (2020-04-09)
- react: adds generics for Ability and related components [skip ci] (3102b6e), closes #256
- react: adds support for action only components (a2db577), closes #107
- vue: adds better generics typying for Vue (5cc7b60), closes #107
-
react: support for react v15 was loosen. If you use react v15 you will need to add
@casl/react/contextApiPatch.d.tsfile into your typings -
typescript: weak hand written declaration files are removed as
@casl/reacthas been completely rewritten to TypeScript. TypeScript now checks that you correctly use property aliases -
Can:
ofalias is removed and field was extracted to a separate propBefore
export default <Can I="read title" of="Post">...</Can>
After
export default <Can I="read" a="Post" field="title">...</Can>
@casl/react-v1.0.4 (2019-07-28)
- react: adds check if children array has length of 1 then render it without React.Fragment (655d08f), closes #211
@casl/react-v1.0.3 (2019-03-25)
@casl/react-v1.0.2 (2019-02-16)
@casl/react-v1.0.1 (2019-02-10)
@casl/react-v1.0.0 (2019-02-03)
@casl/react-v0.8.1 (2018-11-08)
@casl/react-v0.8.0 (2018-09-03)
- README: changes links to @casl/ability to point to npm package instead to git root [skip ci] (a74086b), closes #102
- react:can: adds
analias toonprop (748ea64) - react:can: adds
passThroughoption (045318c), closes #105 - react:can: adds support for multiple children (c022b32)
- react:can: updates typescript declarations (70953ed)
- react:can: updates typescript declarations (213dcde)
- react:can: moves prop type checks undef
if, so they can be removed for production builds (4bebf0b)
@casl/react-v0.7.2 (2018-07-29)
@casl/react-v0.7.1 (2018-07-02)
@casl/react-v0.7.0 (2018-06-15)
- react: adds ts defs for
notattribute (17f76a9) - react: contextual can don't respect 'not' prop (#74) (d727230)
@casl/react-v0.6.0 (2018-05-28)
- react: support for more readable component (1a8c1ec)