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

Make client work in the browser #76

Merged
merged 10 commits into from
Oct 23, 2021
Merged

Make client work in the browser #76

merged 10 commits into from
Oct 23, 2021

Conversation

cblgh
Copy link
Member

@cblgh cblgh commented Apr 26, 2021

This has not been super thoroughly tested yet (e.g. against any client) but I did just manage to get it all to compile & output a lil herlo world.

edit: it's more tested nao :3

image

This PR depends on cabal-club/cabal-core#104, and also cabal-club/cabal-core#105
6947bS7

cblgh added 4 commits June 1, 2021 20:33
this solved dat-dns issues that made themselves known once browserfied
&& running in the browser. CORS errors would otherwise occur for when
trying to resolve pure cabal keys (cabal://<64ch hex>).

the browser would try to make a DNS request to https://<64ch hex> and
then complain about a CORS request error
@nikolaiwarner
Copy link
Member

nikolaiwarner commented Jun 23, 2021

+1 😉

package.json Outdated Show resolved Hide resolved
cblgh added a commit to cabal-club/cabal-core that referenced this pull request Oct 18, 2021
this dependency is used when cabal-core is part of a browserify pipeline
and is essential for cabal-client to work in the web
cabal-club/cabal-client#76
cblgh added 4 commits October 18, 2021 11:11
src/storage-browser.js returns a configured random-access-web function,
which is lastly consumed by ´multifeed` as the passed-in storage
function. this allows us to easily support browsers using a browserified
version of cabal-client, without forcing those clients to implement
their own storage function. that is, it brings down the barrier to
getting started a bit. if not browserified, we just return a string
(which is consumed by multifeed to setup up an instance of random-access-file)

this does not use polyraf by dominic because
1. when polyraf is run, it doesn't return the storage function (it
returns a random-access-file/web instance—this is not compatible with
what e.g. multifeed expects
2.  polyraf lacks a maintainer (but mainly it is because of 1.)

i also wanted to avoid putting polyraf as a dependency inside multifeed
(which would have worked), when we could just implement it this way
@cblgh cblgh merged commit 3f7b9d3 into master Oct 23, 2021
@cblgh cblgh deleted the cabal-web branch October 23, 2021 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants