-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
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 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
+1 😉 |
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
This PR depends on cabal-club/cabal-core#104, and also cabal-club/cabal-core#105