multiformats / js-cid

CID implementation in JavaScript
MIT License
97 stars 39 forks source link

Deprecate `.codec` property with a warning #119

Open Gozala opened 4 years ago

Gozala commented 4 years ago

We should emit a warning first time .codec property is accessed, that provides link to the instructions for migration from .codec to .code. Current plan is to have it indefinitely, that is until we ipfs ecosystem migrates to js-multiformats.

The reason we want warnings is because users usually get CID e.g. by calling const { cid } = await ipfs.add(...), so this could provide room for migration instead of clean break.

Gozala commented 4 years ago

@mikeal do you mind creating a markdown file in the repo that warning could point at. I think you have much clear understanding of this than anyone else.

mikeal commented 4 years ago

We have this https://github.com/multiformats/js-multiformats#cid, we can extend it to handle this with an example like we talked about or do you feel strongly about having a markdown file in this repo?