Skip to content

Latest commit

 

History

History
333 lines (163 loc) · 14.3 KB

File metadata and controls

333 lines (163 loc) · 14.3 KB

Change Log

All notable changes to this project will be documented in this file.

BREAKING CHANGES

  • update react and removes old react and casl/ability support (major) (#998) (44d3f40)

Code Refactoring

* 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))

BREAKING CHANGES

* 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)

Features

  • exports types to support TS ES6 modules (c818b1a), closes #668

5.0.1 (2026-01-18)

Bug Fixes

  • deps: update dependency @types/jest to v30 (#1133) (12c59ce)

3.0.1 (2022-07-25)

3.0.0 (2022-05-28)

Bug Fixes

  • replaces StatelessComponent type with FunctionComponent (69336ea)
  • package: add repository directory into package.json for all @casl/* packages (#560) (0ef534c)

BREAKING CHANGES

  • removes deprecated things

    • restrics children prop of <Can> to support only single el
    • updates React to 18.x
    • removes react@15 from peer deps

2.3.0 (2021-05-12)

Bug Fixes

  • adjusts package tags to improve discoverability (73e88b0)

2.2.2 (2021-01-14)

Features

  • react: updates react to v17

2.2.1 (2020-12-28)

Bug Fixes

  • dist: adds separate tsconfig.build.json to every completementary project (87742ce), closes #419

2.2.0 (2020-12-26)

Bug Fixes

  • angular: fixes sourcemap generation for the code built by ngc (7715263), closes #387 #382
  • package: removes engine section that points to npm@6 (eecd12a), closes #417

Features

  • builder: improves typings for AbilityBuilder [skip release] (ebd4d17), closes #379
  • esm: adds ESM support for latest Node.js through exports prop in package.json (cac2506), closes #331

BREAKING CHANGES

  • builder: changes main generic parameter to be a class instead of instance and makes defineAbility to 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 AbilityBuilder is 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)

Bug Fixes

  • docs: ensure README and docs for all packages are in sync (8df3684), closes #338

2.1.0 (2020-04-18)

Features

2.0.2 (2020-04-10)

Bug Fixes

  • react: ensure that terser doesn't mangle reserved required props (08eb4f4)

2.0.1 (2020-04-09)

Bug Fixes

  • react: adds support for casl/ability@4 in package.json (4367b43)

2.0.0 (2020-04-09)

Bug Fixes

  • react: makes sure Can infers types for props from provided Ability (5813b25), closes #248

Features

  • 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

BREAKING CHANGES

  • react: support for react v15 was loosen. If you use react v15 you will need to add @casl/react/contextApiPatch.d.ts file into your typings

  • typescript: weak hand written declaration files are removed as @casl/react has been completely rewritten to TypeScript. TypeScript now checks that you correctly use property aliases

  • Can: of alias is removed and field was extracted to a separate prop

    Before

    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)

Performance Improvements

  • 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)

Bug Fixes

  • react: handles an prop as subject name (608c99b), closes #169

@casl/react-v1.0.2 (2019-02-16)

Performance Improvements

  • react: checks whether ability changed before unsubsribing (d865fa8), closes #159

@casl/react-v1.0.1 (2019-02-10)

Bug Fixes

@casl/react-v1.0.0 (2019-02-03)

Breaking Changes

@casl/react-v0.8.1 (2018-11-08)

Bug Fixes

  • react: moves this.connectToAbility to the setState callback (#129) (9d0c839), closes #128

@casl/react-v0.8.0 (2018-09-03)

Bug Fixes

  • README: changes links to @casl/ability to point to npm package instead to git root [skip ci] (a74086b), closes #102

Features

  • react:can: adds an alias to on prop (748ea64)
  • react:can: adds passThrough option (045318c), closes #105
  • react:can: adds support for multiple children (c022b32)
  • react:can: updates typescript declarations (70953ed)
  • react:can: updates typescript declarations (213dcde)

Performance Improvements

  • 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)

Bug Fixes

  • react: makes not prop to be optional (8f841bf), closes #95

@casl/react-v0.7.1 (2018-07-02)

Bug Fixes

  • package: changes location of ES5M modules (2b1ad4e), closes #89

@casl/react-v0.7.0 (2018-06-15)

Bug Fixes

  • react: adds ts defs for not attribute (17f76a9)
  • react: contextual can don't respect 'not' prop (#74) (d727230)

Features

@casl/react-v0.6.0 (2018-05-28)

Bug Fixes

  • react: adds I, a, of, this aliases in types (a412868), closes #65

Features

  • react: adds not attribute (94ef6d4), by @emilbruckner in #66

0.5.0 (2018-05-14)

Features

  • react: support for more readable component (1a8c1ec)

0.4.0 (2018-04-23)

Bug Fixes

  • react: rechecks abilities in Can on props update (e08db1e), closes #55

0.3.0 (2018-04-20)

Bug Fixes

  • react: fixes support for React 15.x (8e17738)
  • react: fixes typings for react 15.x & 16.x (f147a8a), closes #38

0.2.0 (2018-04-20)

Features

  • react: adds typescript definition for package @casl/react (37718fe), closes #54

0.1.0 (2018-03-23)

Features

  • component: adds Can component, relates to #23
  • integration: adds createContextualCan function which allows to work with new React Context API, relates to #23
  • integration: adds createCanBoundTo function which allows to bind ability to component, relates to #23