Skip to content

Commit

Permalink
feat!: roll-up semver-major bump
Browse files Browse the repository at this point in the history
The following commit message is mostly copied from cea9063:

feat!: named exports instead of default exports

It also removes the `Codec` class and exports a plain object
instead. This has consequences for imports.

BREAKING CHANGE:

Only use names exports as default exports don't play well with
CommonJS + Typescript typing.

This means that when you use ESM imports, e.g. the raw codec is
no longer imported as

```js
import raw from 'multiformats/codecs/raw'
```

but as

```js
import * as raw from 'multiformats/codecs/raw'
```

The CJS import for codecs don't change, it's still `const raw = require('multiformats/codecs/raw`.

Though other imports change, so

```js
import CID from 'multiformats/cid'
const CID = require('multiformats/cid')
```

is now

```js
import { CID } from 'multiformats/cid'
const { CID } = require ('multiformats/cid')
```
  • Loading branch information
rvagg committed Mar 31, 2021
1 parent daacea6 commit 6d3bb8a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,3 @@ Licensed under either of
### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

0 comments on commit 6d3bb8a

Please sign in to comment.