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
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
bdd5b1a
feat: migrate to vite
SgtPooki May 18, 2023
192b78d
fix: polyfills and other stuff
SgtPooki May 18, 2023
6ef54bd
feat: parsing of root XKCD and 1 child node works
SgtPooki May 19, 2023
b605881
feat: verify raw block, cache blocks in helia
SgtPooki May 19, 2023
227ef12
fix: cleanup get-codec-for-cid & ensure eth support
SgtPooki May 19, 2023
d44c4d5
fix: graph rendering
SgtPooki May 19, 2023
b9fd9e3
fix: verify blocks on the client side
SgtPooki May 22, 2023
0c8c69e
fix: dag-pb node navigation
SgtPooki May 22, 2023
6476a2a
fix: wikipedia explore works
SgtPooki May 22, 2023
8d784bb
feat: update start-exploring page with more examples
SgtPooki May 23, 2023
1dfa524
feat: add ipfs-geoip example
SgtPooki May 23, 2023
0669618
fix: dont split path in Path component
SgtPooki May 23, 2023
ea48ecc
fix: typings
SgtPooki May 23, 2023
f473f58
feat: remove multibase and multihashes deps
SgtPooki May 23, 2023
2d9a7cc
chore: cleanup explore bundle
SgtPooki May 23, 2023
15c1e06
chore: trying to get build working - get explore.ipld.io to work with…
SgtPooki May 23, 2023
577d09e
chore: trying to bundle with rollup
SgtPooki May 23, 2023
b7f44f7
tmp: messsssyyyy
SgtPooki May 24, 2023
24bdd9c
fix: build works (mostly) in explore.ipld.io
SgtPooki May 24, 2023
4c46175
chore: separate vite more
SgtPooki May 24, 2023
f11c1e2
fix: fix loading in ipld-explorer-components
SgtPooki May 24, 2023
0c6b597
tmp
SgtPooki May 24, 2023
ca0a50b
chore: cjs-esm-react-scripts-hell
SgtPooki May 24, 2023
2d3f441
Revert "chore: cjs-esm-react-scripts-hell"
SgtPooki May 24, 2023
7af56b9
fix: works in explore.ipld.io
SgtPooki May 25, 2023
c2ddb4c
fix: ethereum block and types
SgtPooki May 25, 2023
a8e2732
fix: ipld-eth dynamic imports
SgtPooki May 25, 2023
75461c2
fix: dependency in explore.ipld.io
SgtPooki May 25, 2023
09ab5e8
chore: update github workflows node-version
SgtPooki May 25, 2023
feccc1b
Update src/components/StartExploringPage.jsx
SgtPooki May 26, 2023
8db2f57
Update src/components/StartExploringPage.jsx
SgtPooki May 26, 2023
36ca66a
Update src/components/object-info/ObjectInfo.jsx
SgtPooki May 26, 2023
2979d32
Update src/components/object-info/ObjectInfo.jsx
SgtPooki May 26, 2023
d40e583
Update vite.config.ts
SgtPooki May 26, 2023
9438d2f
Update vite.config.ts
SgtPooki May 26, 2023
c9870eb
Update vite.config.ts
SgtPooki May 26, 2023
8a9cb00
Update vite.config.ts
SgtPooki May 26, 2023
ad301df
Update vite.config.ts
SgtPooki May 26, 2023
0040296
Update index.html
SgtPooki May 26, 2023
1cf10d1
chore: cleanup
SgtPooki May 26, 2023
36fd80a
fix: lint runs (currently failing)
SgtPooki May 26, 2023
ad1eb9f
fix: address some eslint rules
SgtPooki May 26, 2023
d38fe9b
fix: npm run dev works again
SgtPooki May 31, 2023
3289bed
fix: use header in devPage
SgtPooki May 31, 2023
588d82c
feat: fix car-import functionality
SgtPooki May 31, 2023
ad730de
fix: consolidate decodeCid function
SgtPooki May 31, 2023
46a03ca
fix: improve base-importer
SgtPooki May 31, 2023
2254ced
fix: lint problems
SgtPooki May 31, 2023
db85c2c
fix: one test for resolveIpldPath
SgtPooki May 31, 2023
45bc3f2
fix: all tests pass
SgtPooki Jun 1, 2023
72a6e81
fix: add stream-to-it types
SgtPooki Jun 1, 2023
3df5cf0
chore: lint before build
SgtPooki Jun 1, 2023
4e6dfa0
fix: vite from src instead of dist to get hot-reloading
SgtPooki Jun 1, 2023
5895c68
fix: dev and prod build work
SgtPooki Jun 1, 2023
d8d2507
fix: storybook works (#361)
SgtPooki Jun 2, 2023
ef01fc8
chore: remove ethereum example
SgtPooki Jun 2, 2023
896ad9b
chore: reorder explore examples
SgtPooki Jun 2, 2023
11fb006
feat: add dag-json example and load in helia on startup
SgtPooki Jun 2, 2023
95b50ba
fix: reduce networking overhead
SgtPooki Jun 2, 2023
dcee39b
fix: prefer trustless gateway
SgtPooki Jun 2, 2023
46618f4
chore: start libp2p by default until bug is fixed
SgtPooki Jun 2, 2023
4b74aa1
fix: networking improvements
SgtPooki Jun 2, 2023
82dd9e3
chore: remove unnecessary libp2p config for exploring
SgtPooki Jun 2, 2023
629dc9b
test: add test for failure case
SgtPooki Jun 2, 2023
a1bd438
test: fix loading of dag-cbor example cheese path
SgtPooki Jun 2, 2023
607889f
chore: cleanup vite index.html
SgtPooki Jun 2, 2023
5a261b9
chore: revert locales loadPath change
SgtPooki Jun 2, 2023
9948ac4
chore: address all code cleanup PR comments
SgtPooki Jun 2, 2023
72f6987
fix: remove blockcodec-to-ipld-format
SgtPooki Jun 3, 2023
eca2562
chore!: remove ipld-ethereum
SgtPooki Jun 3, 2023
87bfac1
fix: access dynamic import via default prop
SgtPooki Jun 3, 2023
1ce076a
fix: storybook issue
SgtPooki Jun 3, 2023
da70bfc
docs: update readme with redux-bundler description
SgtPooki Jun 6, 2023
b50935e
fix: change helia-bundle namespace
SgtPooki Jun 6, 2023
42cb36a
fix: node style selection and multicodec isolation
SgtPooki Jun 6, 2023
db31a53
fix: attempt to fetch block from kubo client directly
SgtPooki Jun 7, 2023
4ac823d
fix: toHex function in extract-info
SgtPooki Jun 7, 2023
a31c790
chore: address pr comments
SgtPooki Jun 7, 2023
82f3a4f
test: fix src/lib/resolve-ipld-path.test.js
SgtPooki Jun 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import {EsmExternalsPlugin} from '@esbuild-plugins/esm-externals'
// console.log(`EsmExternals: `, EsmExternals);

import pkgJson from './package.json' assert { type: 'json' }
const { dependencies, peerDependencies } = pkgJson

/** @type {import('aegir').PartialOptions} */
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
export default {
tsRepo: true,
release: {
build: false
},
dependencyCheck: {
input: [
'dist/**/*.js',
],
productionInput: [
'dist/**/*.js',
],
},
build: {
config: {
platform: 'browser',
format: 'esm',
// external: Object.keys(dependencies).concat(Object.keys(peerDependencies)),
outbase: 'src',
outdir: 'dist',
outfile: '',
loader: {
'.svg': 'text',
'.ts': 'ts',
'.js': 'js',
'.jsx': 'jsx',
},
entryPoints: [
'src/index.js',
'src/components/object-info/LinksTable.css',
'src/components/loader/Loader.css'
],
bundle: false,
plugins: [
EsmExternalsPlugin({ externals: ['react', 'react-dom'] }),
NodeModulesPolyfillPlugin(),
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
stream: true,
crypto: true,
}),
// NodeResolve({
// extensions: ['.ts', '.js'],
// onResolved: (resolved) => {
// if (resolved.includes('node_modules')) {
// return {
// external: true,
// }
// }
// return resolved
// },
// }),
],
}
},
test: {
build: false,
target: 'browser',
files: [
'src/**/*.test.js',
]
}
}
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
["@babel/preset-env", {
"modules": false
}],
["@babel/preset-typescript", {
"isTSX": true,
"allExtensions": true
}],
"@babel/preset-react"
],
"plugins": [
Expand Down
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ module.exports = {
extends: ['react-app', 'standard'],
plugins: ['jsx-a11y'],
}

4 changes: 2 additions & 2 deletions .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present build
- run: npm run --if-present storybook:build
Expand All @@ -33,7 +33,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
- uses: ipfs/aegir/actions/cache-node-modules@master
- uses: ipfs/aegir/actions/docker-login@master
with:
Expand Down
1 change: 1 addition & 0 deletions dev/devPage.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
49 changes: 49 additions & 0 deletions dev/devPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* globals globalThis */
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
import React, { useEffect } from 'react';
import { I18nextProvider } from 'react-i18next';
import { composeBundles, createRouteBundle } from 'redux-bundler';
import { Provider as ReduxStoreProvider, connect } from 'redux-bundler-react';
import ReactDOM from 'react-dom';
import i18n from '../dist/i18n';
import { exploreBundle, ExplorePage, StartExploringPage } from '../dist/index.js';
// import ipfsBundle from './bundles/ipfs'
import heliaBundle from '../dist/bundles/helia';
import { Buffer } from 'buffer';
import 'tachyons';
import 'ipfs-css';
import 'react-virtualized/styles.css';
import '../dist/components/object-info/LinksTable.css';
import '../dist/components/loader/Loader.css';
globalThis.Buffer = Buffer;
// import i18nDecorator from './i18n-decorator.js'
const routesBundle = createRouteBundle({
'/explore*': ExplorePage,
'/': StartExploringPage,
'': StartExploringPage
}, {
routeInfoSelector: 'selectHash'
});
const getStore = composeBundles(exploreBundle(), routesBundle,
// ipfsBundle,
heliaBundle);
const PageRenderer = connect('selectRoute', 'selectQueryObject', 'doUpdateUrl', 'doInitIpfs', (props) => {
console.log(`props: `, props);
const Page = props?.route;
console.log(`Page: `, Page);
const { embed } = props.queryObject;
console.log(`embed: `, embed);
useEffect(() => {
props.doInitIpfs();
}, []);
return (
// <span>test</span>
React.createElement("div", { style: { margin: '5vh 10vw' } },
React.createElement(Page, { embed: embed })));
});
const App = () => {
return (React.createElement(ReduxStoreProvider, { store: getStore() },
React.createElement(I18nextProvider, { i18n: i18n },
React.createElement(PageRenderer, null))));
};
ReactDOM.render(React.createElement(App, null), document.getElementById('root'));
// root.render(<App />);
75 changes: 75 additions & 0 deletions dev/devPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* globals globalThis */
import React, { useEffect } from 'react'
import { I18nextProvider } from 'react-i18next'
import { composeBundles, createRouteBundle } from 'redux-bundler'
import { Provider as ReduxStoreProvider, connect } from 'redux-bundler-react'
import ReactDOM from 'react-dom';
import i18n from '../dist/i18n'
import { exploreBundle, ExplorePage, StartExploringPage } from '../dist/index.js'
// import ipfsBundle from './bundles/ipfs'
import heliaBundle from '../dist/bundles/helia'

import { Buffer } from 'buffer'
import 'tachyons'
import 'ipfs-css'
import 'react-virtualized/styles.css'
import '../dist/components/object-info/LinksTable.css'
import '../dist/components/loader/Loader.css'

globalThis.Buffer = Buffer

// import i18nDecorator from './i18n-decorator.js'
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved

const routesBundle = createRouteBundle(
{
'/explore*': ExplorePage,
'/': StartExploringPage,
'': StartExploringPage
},
{
routeInfoSelector: 'selectHash'
}
)
const getStore = composeBundles(
exploreBundle(),
routesBundle,
// ipfsBundle,
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
heliaBundle,
)

const PageRenderer = connect(
'selectRoute',
'selectQueryObject',
'doUpdateUrl',
'doInitIpfs',
(props) => {
console.log(`props: `, props);
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
const Page = props?.route
console.log(`Page: `, Page);
const { embed } = props.queryObject
console.log(`embed: `, embed);
useEffect(() => {
props.doInitIpfs()
}, [])

return (
// <span>test</span>
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
<div style={{margin: '5vh 10vw'}}>
<Page embed={embed}/>
</div>
)
}
)

const App = () => {
return (
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
<ReduxStoreProvider store={getStore()}>
<I18nextProvider i18n={i18n}>
<PageRenderer />
</I18nextProvider>
</ReduxStoreProvider>
)
}

ReactDOM.render(<App />, document.getElementById('root'));
// root.render(<App />);
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
38 changes: 38 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<!-- <link rel="manifest" href="/manifest.json"> -->
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
<link rel="shortcut icon" href="/favicon.ico">
<!-- https://vitejs.dev/guide/build.html#library-mode -->
<title>Dev view for ipld-explorer-components only</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm run dev`
-->
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
<!--
Vite uses /dev/devPage.jsx which uses built dependencies in /dist, because vite has different requirements for
typescript & jsx than babel+typescript, which we're required to use to get our bundled assets working properly
for explore.ipld.io
-->
SgtPooki marked this conversation as resolved.
Show resolved Hide resolved
<script type="module" src="/dev/devPage.jsx"></script>
</body>

</html>
Loading