browser-acl icon indicating copy to clipboard operation
browser-acl copied to clipboard

feat: support async rules

Open mblarsen opened this issue 3 years ago • 3 comments

mblarsen avatar Nov 13 '20 11:11 mblarsen

Thanks for implementing that feature Changes and tests are OK but what you're going to do regarding existing applications?

let's say an application expects boolean to be returned from a can() call. If we change it to async it will return a Promise and can break the existing application.

Are you going to release a separate breaking version?

yudikubota avatar Nov 13 '20 11:11 yudikubota

let's say an application expects boolean to be returned from a can() call. If we change it to async it will return a Promise and can break the existing application.

Are you going to release a separate breaking version?

Yeah, that's my concern. I was thinking making a v2.0

I also considered creating a can + canSync version ala the way node fs package works. But that would still require a v2 and I'm not sure it is worth to maintain the extra complexity.

mblarsen avatar Nov 13 '20 12:11 mblarsen

FYI, I made an earlier version where there were no changes to can (except I remove the Boolean() calls). That way only some, every was promise based.

The advantage of that is that it wouldn't break any apps. But you, as a user, would have to write checks on the return type. Not interested in that either.

mblarsen avatar Nov 13 '20 12:11 mblarsen