forked from MarcelRaschke/js-ipfs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from ipfs/master
[pull] master from ipfs:master
- Loading branch information
Showing
306 changed files
with
4,095 additions
and
2,472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"packages/interface-ipfs-core":"0.155.2","packages/ipfs":"0.63.5","packages/ipfs-cli":"0.13.5","packages/ipfs-client":"0.8.3","packages/ipfs-core":"0.15.4","packages/ipfs-core-config":"0.4.1","packages/ipfs-core-types":"0.11.1","packages/ipfs-core-utils":"0.15.1","packages/ipfs-daemon":"0.13.5","packages/ipfs-grpc-client":"0.10.2","packages/ipfs-grpc-protocol":"0.6.0","packages/ipfs-grpc-server":"0.9.4","packages/ipfs-http-client":"57.0.3","packages/ipfs-http-gateway":"0.10.4","packages/ipfs-http-response":"3.0.4","packages/ipfs-http-server":"0.12.5","packages/ipfs-message-port-client":"0.12.4","packages/ipfs-message-port-protocol":"0.12.1","packages/ipfs-message-port-server":"0.12.1"} | ||
{"packages/interface-ipfs-core":"0.157.0","packages/ipfs":"0.65.0","packages/ipfs-cli":"0.15.0","packages/ipfs-client":"0.9.2","packages/ipfs-core":"0.17.0","packages/ipfs-core-config":"0.6.0","packages/ipfs-core-types":"0.13.0","packages/ipfs-core-utils":"0.17.0","packages/ipfs-daemon":"0.15.0","packages/ipfs-grpc-client":"0.12.0","packages/ipfs-grpc-protocol":"0.7.0","packages/ipfs-grpc-server":"0.11.0","packages/ipfs-http-client":"59.0.0","packages/ipfs-http-gateway":"0.12.0","packages/ipfs-http-response":"5.0.0","packages/ipfs-http-server":"0.14.0","packages/ipfs-message-port-client":"0.14.0","packages/ipfs-message-port-protocol":"0.14.0","packages/ipfs-message-port-server":"0.14.0"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This project is dual licensed under MIT and Apache-2.0. | ||
|
||
MIT: https://www.opensource.org/licenses/mit | ||
Apache-2.0: https://www.apache.org/licenses/license-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<!--Specify versions for migration below--> | ||
# Migrating to [email protected] and [email protected] <!-- omit in toc --> | ||
|
||
> A migration guide for refactoring your application code from `ipfs@0.63.x` to `ipfs@0.64.x` | ||
> A migration guide for refactoring your application code from `ipfs@0.62.x` to `ipfs@0.63.x` | ||
## Table of Contents <!-- omit in toc --> | ||
|
||
- [ESM](#esm) | ||
- [[email protected]](#libp2p037x) | ||
- [TypeScript and ESM](#typescript-and-esm) | ||
- [`[email protected]`](#libp2p037x) | ||
- [PeerIds](#peerids) | ||
- [multiaddrs](#multiaddrs) | ||
|
||
|
@@ -34,11 +35,53 @@ async function loadIpfs () { | |
} | ||
``` | ||
|
||
### TypeScript and ESM | ||
|
||
When authoring typescript it can often look like you are writing ESM: | ||
|
||
```ts | ||
import { create } from 'ipfs-core' | ||
|
||
create() | ||
``` | ||
|
||
When this is transpiled to JavaScript the default settings will emit CJS which will fail at runtime: | ||
|
||
```js | ||
"use strict"; | ||
exports.__esModule = true; | ||
var ipfs_core_1 = require("ipfs-core"); | ||
(0, ipfs_core_1.create)(); | ||
``` | ||
|
||
You may also see errors about private identifiers: | ||
|
||
```console | ||
node_modules/@libp2p/interfaces/dist/src/events.d.ts:19:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher. | ||
|
||
19 #private; | ||
~~~~~~~~ | ||
``` | ||
|
||
To build correctly with ESM as a target, update your `tsconfig.json` to include the following: | ||
|
||
```js | ||
{ | ||
"module": "es2020", // ensures output is ESM | ||
"target": "es2020", // support modern features like private identifiers | ||
// other settings | ||
} | ||
``` | ||
|
||
They must both be set to `es2020` at least, more recent versions will also work. | ||
|
||
If in doubt, examine the JavaScript files `tsc` emits and ensure that any `ipfs` modules are being loaded with `import` and not `require`. | ||
|
||
## `[email protected]` | ||
|
||
`[email protected]` upgrades to `[email protected]`. This is a significant refactor that ports the entire stack to TypeScript and publishes all modules as ESM-only code. | ||
|
||
Please see the [libp2p 0.37.x upgrade guide](https://github.com/libp2p/js-libp2p/blob/master/doc/migrations/v0.36-v.037.md) for how this may affect your application. | ||
Please see the [libp2p 0.37.x upgrade guide](https://github.com/libp2p/js-libp2p/blob/master/doc/migrations/v0.36-v0.37.md) for how this may affect your application. | ||
|
||
## PeerIds | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!--Specify versions for migration below--> | ||
# Migrating to [email protected] and [email protected] <!-- omit in toc --> | ||
|
||
> A migration guide for refactoring your application code from `[email protected]` to `[email protected]` | ||
## Table of Contents <!-- omit in toc --> | ||
|
||
- [libp2p](#libp2p) | ||
|
||
## libp2p | ||
|
||
The upgrade to `[email protected]` incorporates an update to `[email protected]` but no API changes. | ||
|
||
If your application uses only the default libp2p config there is nothing to do. | ||
|
||
If you supply a custom `libp2p` instance to the `ipfs` factory function you should consult the [`[email protected]` upgrade guide](https://github.com/libp2p/js-libp2p/blob/master/doc/migrations/v0.37-v0.38.md) for any changes you need to make. |
Oops, something went wrong.