ucan-wg / ts-ucan

Auth tokens for a distributed, user-controlled world
https://www.npmjs.com/package/ucans
Apache License 2.0
102 stars 12 forks source link

Remove `chained.ts` #78

Closed matheus23 closed 2 years ago

matheus23 commented 2 years ago

I'm re-working the public API. The main goal of this is to reduce & streamline the public API surface again. The first thing on the chopping block is the Chained type. It had a couple of problems:

Now that Chained is gone, some things suck a little more. Some functions became async because they can't take the pre-processed Chained type again, but need to actually do the processing themselves, which is async. It's most awkward in the delegateCapability function in the builder, which is now async. But don't worry! I have a plan on how to get it sync again! (and remove the awkwardness).

The whole API rework is probably going to be split into two PRs, this one and another one based on this. I'm hoping this will make it easier to review them independently.

matheus23 commented 2 years ago

Closing in favor of #79. This shouldn't be release on its own, so why make it a separate PR?

@dholms I really recommend checking out #79 instead. And I'm sorry that it's a 1.5k lines diff. I did some reworking :sweat_smile:

I tried to keep the diffs smaller by splitting the PRs up, but it's hard to meaningfully split them up. I wouldn't want this version of the chopped public API published, but I would want the other version of the public API published :+1:

dholms commented 2 years ago

kk makes sense. i'll take a look 👀