Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Phase 2 Tracking #14

Open
3 tasks done
oliveriosousa opened this issue Jun 14, 2021 · 5 comments
Open
3 tasks done

Phase 2 Tracking #14

oliveriosousa opened this issue Jun 14, 2021 · 5 comments

Comments

@oliveriosousa
Copy link
Contributor

oliveriosousa commented Jun 14, 2021

Tracking for Phase 2: Improve ergonomics

  • Update existing examples to be more concise (readme's, content itself, versions, etc)
  • Check if it actually works properly
  • Check if dependencies need to be updated
  • Check if the code can be made simpler
  • Check if the tooling (npm script, bundler configs, etc) can be made simpler
  • Add more examples
  • Web Frameworks/Libraries: svelte, angular
  • Bundlers: Vite, Rollup, snowpack
  • Deno
  • Fix current issues
  • browser-service-worker: Cannot run the example correctly #17

Current work:

New examples

Outside examples:

Cherry pick from old example repo

Move examples:

Waiting for discussion

In Progress

  • Vite:
  • Snowpack:
  • Microbundle:
  • SvelteKit
@oliveriosousa
Copy link
Contributor Author

oliveriosousa commented Jun 14, 2021

Hi team, @autonome @hugomrdias

  1. I noticed that a lot of commits in the examples are updates to the version of IPFS. It is possible to add tags to IPFS release? Or just target the latest release?

For example:
Stable, Beta, Next, Preview

  1. What should be the core for all examples ? (MFS API ?)
  2. Suggestions for more examples 😃

@hugomrdias
Copy link
Contributor

Hi team, @autonome @hugomrdias

  1. I noticed that a lot of commits in the examples are updates to the version of IPFS. It is possible to add tags to IPFS release? Or just target the latest release?

I don't see this has a problem, its just keeping the same history as the source.

  1. What should be the core for all examples ? (MFS API ?)

For new examples that focus only on new frameworks and bundlers it should just be similar to ipfs-101 i.e. ipfs.version(), ipfs.id(), ipfs.add(cid) and ipfs.cat(cid)

Perform bump version automatically

What do you mean by this ? We dont need versions in the examples.

The first task for phase 2 should be just, go through each example and make sure it's as easy as it can be.

  • Check if it actually works properly
  • Check if dependencies need to be updated
  • Check if the code can be made simpler
  • Check if the tooling (npm script, bundler configs, etc) can be made simpler

All of these should be made as PRs in the js-ipfs repo.
Updating the readme and making the examples look better should be done in Phase 4.

The second tasks looks good, if for some reason you can't make js-ipfs work with some new framework or bundler an issue should be created explaining why so the devs can look into it.

@hugomrdias
Copy link
Contributor

hugomrdias commented Jul 7, 2021

@oliveriosousa after talking with @autonome and @achingbrain we feel that the examples should be extracted from the js-ipfs monorepo and recreated in this org

The high level task should be:

  • Create ipfs-examples/js-ipfs-examples repo
  • Copy all the examples in js-ipfs to the above repo
  • The new repo should be a mono-repo using node 16, npm 7 workspaces
  • Each example should have tests using https://playwright.dev/docs/test-intro and the npm test script should run everything needed
  • The standalone repos should be updated to pull from this new mono-repo instead of js-ipfs repo
  • js-ipfs repo should be able to run tests for each example using the external testing setup that is already used for partners repos

@achingbrain
The PRs already opened in the js-ipfs should be ported over or can we merge them before creating the new examples mono.repo ?

@achingbrain
Copy link
Contributor

achingbrain commented Jul 7, 2021

The PRs already opened in the js-ipfs should be ported over or can we merge them before creating the new examples mono.repo ?

I think it would be less disruptive if they go straight into the new examples monorepo.

@oliveriosousa
Copy link
Contributor Author

oliveriosousa commented Jul 22, 2021

Current issues:

1. IPNS

Issue description

When publishing a IPFS hash it is being thrown an error running the following code:

const topic = `${namespace}${uint8ArrayToString(ipnsKeys.routingKey, 'base64url')}`;

Steps to reproduce the issue

  1. Install and run the example:
  • npm install
  • npm start
  1. Create and init an IPFS node (I used IPFS desktop)
  2. Add new address to handle WS connections
  3. In the browser (see image below)
  • Connect with the API
  • Connect via Websocket
  • IPFS Hash

What's the expected result?

  • Being able to publish an IPFS Hash to IPNS

What's the actual result?

  • See image below

Additional details / screenshot

Screenshot 2021-07-22 at 13 04 03


2. Service Worker

Issue description

Not able to run correctly the example, simply just can't replicate the expected behaviour

Steps to reproduce the issue

  1. Install and run the example:
  • npm install
  • npm start
  1. Perform all the steps described in the Readme file

What's the expected result?

  • Being able to see IPFS content locally using the URL

What's the actual result?

  • It is being displayed always the homepage

Additional details / screenshot

  • N/A

3. Exchange files

Issue description

Need some help improving the migrated test, it is very inconsistent.

Steps to reproduce the issue

npx playwright test tests --headed

What's the expected result?

-Run the test always with success :)

What's the actual result?

  • Fails a lot of times

Additional details / screenshot

  • N/A

4. Explore Ethereum Blockchain

UPDATE: was removed 4 days ago


5. Custom IPFS Repo

Issue description

After this commit ( feat: upgrade to the new multiformats (#3556) ) the test started to fail

Steps to reproduce the issue

npm run test:example

What's the expected result?

-Run the test always with success :)

What's the actual result?

Swarm listening on /ip4/127.0.0.1/tcp/4002/p2p/QmQwLBDzt1amc8mSxRCznsPuEx9yr8Jafj6wAPByXyLk16
Swarm listening on /ip4/192.168.1.86/tcp/4002/p2p/QmQwLBDzt1amc8mSxRCznsPuEx9yr8Jafj6wAPByXyLk16
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/p2p/QmQwLBDzt1amc8mSxRCznsPuEx9yr8Jafj6wAPByXyLk16
/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/blockstore-datastore-adapter/src/index.js:22
throw errcode(new Error('Not a valid cid'), 'ERR_INVALID_CID')
^
Error: Not a valid cid
at cidToKey (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/blockstore-datastore-adapter/src/index.js:22:19)
at BlockstoreDatastoreAdapter.get (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/blockstore-datastore-adapter/src/index.js:187:27)
at Object.get (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-repo/src/pinned-blockstore.js:46:20)
at Object.get (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-repo/src/idstore.js:50:20)
at loadOrFetchFromNetwork (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-bitswap/src/index.js:246:45)
at Bitswap.get (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-bitswap/src/index.js:279:7)
at BlockService.get (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-block-service/src/index.js:97:28)
at IPLDResolver.get (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipld/src/index.js:155:33)
at unixFsResolver (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/index.js:48:27)
at resolve (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-unixfs-exporter/src/resolvers/index.js:34:10) {
code: 'ERR_INVALID_CID'
}


6. Custom IPLD format

Issue description

After this commit ( feat: upgrade to the new multiformats (#3556) ) the test started to fail

Steps to reproduce the issue

npm run test:example

What's the expected result?

-Run the test always with success :)

What's the actual result?

Testing in-process node
Swarm listening on /ip4/127.0.0.1/tcp/4002/p2p/QmdJHXdL4heVQof5sibvmY5QyVU9F7PVj3bVLuMPuBchL1
Swarm listening on /ip4/192.168.1.86/tcp/4002/p2p/QmdJHXdL4heVQof5sibvmY5QyVU9F7PVj3bVLuMPuBchL1
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/p2p/QmdJHXdL4heVQof5sibvmY5QyVU9F7PVj3bVLuMPuBchL1
Error: Codec "dag-test" not found
at Object.getCodeFromName (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/multicodec/src/index.js:90:11)
at nameToCodec (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-core/src/components/dag/put.js:18:40)
at encodingCodes (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-core/src/components/dag/put.js:98:40)
at readEncodingOptions (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-core/src/components/dag/put.js:81:7)
at put (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-core/src/components/dag/put.js:37:45)
at DagAPI.put (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/ipfs-core-utils/src/with-timeout-option.js:21:46)
at main (/Users/oliveriosousa/Projects/PL/js-ipfs-examples/examples/custom-ipld-formats/in-process-node.js:28:30)
/Users/oliveriosousa/Projects/PL/js-ipfs-examples/node_modules/execa/lib/error.js:60
error = new Error(message);


7. Create-React-App and Vue

Issue description

When using npm workspaces to install all the necessary dependencies it is not possible to build the projects, but if installed them in the package it works.

Maybe this packages are not properly build to work with monorepos and some dependencies are not being installed...

Steps to reproduce the issue

npm install (in the root project)
npm run test:example OR npm run build

What's the expected result?

-Run the build with success using npm workspaces

What's the actual result?

Build fails with:

[email protected] test:example
npm run build && playwright test tests

[email protected] build
react-scripts build

Creating an optimized production build...
Failed to compile.
Cannot read property 'includes' of undefined

@hugomrdias hugomrdias transferred this issue from ipfs-examples/example-template Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants