stalniy/casl

Unable to import `reactiveAbility` from casl/vue

Waqar-SE opened this issue · 7 comments

Describe the bug
Unable to import reactiveAbility

To Reproduce
Steps to reproduce the behavior:
Try to import reactiveAbility and it will fail as index.js doesn't provide it.

Expected behavior
Successful import of reactiveAbility

CASL Version
@casl/vue - v

Environment:

Node 20, Vue 3

I has never been a part of public interface. Could you please explain why do you need it?

For me the usecase is providing abilities to render function when testing the components.

in this case it's an improvement not a bug. Why cannot you use plugin or provide/inject in tests?

To be able to provide the ability I need to build it, that's where the reactive ability is needed, to build the ability.

You don’t need it because it’s hidden inside provideAbility and abilitiesPlugin

build ability in any way you like, casl/vue will make it reactive when you provide it. See the code:

https://github.com/stalniy/casl/blob/master/packages/casl-vue/src/useAbility.ts#L17

Close as stale. Feel free to provide more details