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

Try to port js-ipfs-gateway to service-worker #12

Closed

Conversation

linonetwo
Copy link

@linonetwo linonetwo commented May 6, 2018

ipfs-browser-gateway

Given an IPFS multihash, print the content and try to render web page if the content is HTML.

Development

This is a "create-react-app" app, so just:

yarn && yarn start

Drawback

  1. The first visit is way slower than traditional HTTP page. Though http://ipfs.io/ipfs is slow too.
  2. Can't promise long-term cache, compared to a gateway running on a server, who can pin a file for a longer time.
  3. Don't work with AJAX likes fetch API.
  4. Loading dependencies by importScripts synchronously are slow (10s).

Road Map

  • Get it work...It's now working due to my not returning a Response.
  • Bundle all dependencies.

Reference

@linonetwo
Copy link
Author

Closing in favor of ipfs/service-worker-gateway#1

@linonetwo linonetwo closed this May 7, 2018
@vasco-santos
Copy link
Member

Hello @linonetwo

We appreciate your contribution to the service-worker-gateway.

At first, the codebase related to the service-worker implementation should be in the src directory, as its implementation is the purpose of the repo. Therefore, the example should be focused on the service worker usage.

Moreover, we prefere to provide more minimalist and barebone examples of the usage of our repos. Essentially, we intend to focus on the example instead of adding framework related code, which will turn the example more complex. As a result, we are looking for examples using standard JS with a simple web server, such as http-server.

Regarding this example, I tried to run it but unfortunately, I was not able to fetch any file (had errors of undefined Readable Stream, as well as the Response not being returned).

I saw that you have some work regarding the different views of que fetch (file, host site, dir list), which you can contribute to the new repo created for this project. I will be working on the gateway in the next days, feel free to join me in the service-worker-gateway

@vasco-santos
Copy link
Member

@linonetwo Let's discuss this in your new PR since we were writing at the same time.

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