Skip to content
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!: remove all old deps #360

Merged
merged 79 commits into from Jun 8, 2023
Merged

feat!: remove all old deps #360

merged 79 commits into from Jun 8, 2023

Conversation

SgtPooki
Copy link
Member

@SgtPooki SgtPooki commented May 25, 2023

When will this PR be removed from Draft/WIP?


This PR was mainly intended to address #359, but in the process, we were able to solve a number of longstanding issues.

Preview of these changes in explore.ipld.io are available at https://bafybeici5vqsnnrggriwslm5m6ztoyedcumk2imy62ywwjficn5qt6fw6u.on.fleek.co/

This PR has the following changes:

  1. Dev environment makes testing code changes in this repo really easy (via vite), instead of needing to always consume by explore.ipld.io or ipfs-webui in order to test changes
  2. Creates and exports a helia bundle that is used instead of needing to define that bundle inside consuming packages
    • The original intent to allow custom ipfs was sound, but has been changed for ease of maintenance. If users need to override, they can look at the bundle provided here and copy/modify as necessary in their appropriate implementations.
  3. uses trustless gateway fetching, in a race with helia in src/lib/get-raw-block.ts (see
    const rawBlock = await Promise.any([helia.blockstore.get(cid, { signal: abortController.signal }), getBlockFromAnyGateway(cid, abortController.signal)])
    )
  4. uses helia to cache blocks (making loading MUCH faster)
    • delegatedPeerRouting+delegatedContentRouting uses 'node3.delegate.ipfs.io' AND provided local node via kubo-rpc-client. Meaning helia manages fetching content when a gateway can't
  5. removes react-scripts
  6. removes old dependencies and updates all ipfs-ecosystem libraries to latest (/ipld|helia|ipfs/)

fixes #359
fixes #279
fixes #311
fixes #335
fixes #355

This is a large win for work required from ipfs/ipfs-webui#1965

related to explore.ipld.io changes at ipld/explore.ipld.io#119


Demo Video:

explore.ipld.io-2023-05-25-update.mp4

url is localhost:port/#/explore/bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze

based on latest hash from https://github.com/ipfs/distributed-wikipedia-mirror/blob/1aa50702fc6d8e2be106e37d4c68dc2ca5b94f20/snapshot-hashes.yml#LL13C10-L13C69
@SgtPooki SgtPooki changed the title [WIP] feat!: remove all old deps feat!: remove all old deps Jun 6, 2023
@SgtPooki SgtPooki self-assigned this Jun 6, 2023
@SgtPooki SgtPooki marked this pull request as ready for review June 6, 2023 19:50
@SgtPooki SgtPooki requested a review from a team as a code owner June 6, 2023 19:50
@SgtPooki SgtPooki requested review from lidel and whizzzkid June 6, 2023 19:50
Copy link
Collaborator

@whizzzkid whizzzkid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first pass looks good, any meaningful way to break this dowm?

.babelrc Show resolved Hide resolved
.storybook/main.ts Show resolved Hide resolved
.storybook/main.ts Show resolved Hide resolved
import 'react-virtualized/styles.css'
import { composeBundles, createRouteBundle } from 'redux-bundler'
import { Provider as ReduxStoreProvider, connect } from 'redux-bundler-react'
import 'tachyons'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we sort/organize imports across?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure what that means. see .eslintrc.js 'import/order'.groups

dev/devPage.jsx Outdated Show resolved Hide resolved
src/bundles/explore.js Outdated Show resolved Hide resolved
error: null
}

function getUserOpts (key: string): Record<string, unknown> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why unknown?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause it can be anything.. it's localStorage

src/bundles/helia.ts Outdated Show resolved Hide resolved
<div>
<div className='f5 sans-serif fw5 ma0 pv2 truncate navy'>
{cid}
</div>
<div className='red fw2 ma0 f7'>{cidErr.message}</div>
</div>
)}
)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks werid.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's using standard style for formatting, so it should be correct. build runs lint which runs standard, so it would fail if it werent correct.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already a pretty large change, I'm trying not to modify any of the horrendous jsx or ternary statements that already existed before I got here. we can do a pass later

Copy link
Collaborator

@whizzzkid whizzzkid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in principle, not seeing any major ⛳️

@SgtPooki SgtPooki merged commit 9fbaf6b into master Jun 8, 2023
4 checks passed
@SgtPooki SgtPooki deleted the remove-js-ipfs branch June 8, 2023 19:31
@SgtPooki SgtPooki mentioned this pull request Jun 8, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants