-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: asCID property self reference #18
Conversation
Looks good to me! I also have sketched what we discussed in the call here |
Is it confusing to use the same property name for the instance and static class method? |
I don't think so, as property is mostly for static method to recognize CID. That being said I really could not care less about property or static method name. Mostly went with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so ... it's pretty user-hostile though to be doing this in toJSON()
, what does that look like if someone's using JSON.stringify()
on a parent object for debugging?
That’s a good point. Maybe we leave it out of |
Should this be merged or do we need resolution on toJSON? It's been approved and sitting for a while. |
Also, is the plan to replace the |
I’ll be returning to it eventually, other priorities have been getting in the way. I started this PR to fully consider the interface and I don’t feel like I’ve really had the time to do that yet.
Yes, some day, but not today :) For I’ll join the IPFS implementations call on Monday to discuss these changes in more detail. |
I'm strongly against breaking |
Ya, we won’t be, if this lands it’ll land without the toJSON() break. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give the commit message a better header and a bit more context.
This came up in a conversation I had with @Gozala
This feature is nice for a few reasons.
However, if we take this change it will require some updates to our codecs. In both
dag-cbor
and indag-json
we do anisCircular
check before encoding an object and that runs through a relatively naive third party library that will now throw. But it’s already in my mental backlog to get rid ofis-circular
so it’s probably fine.