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

Initialization and webpack #10

Closed
wants to merge 2 commits into from
Closed

Initialization and webpack #10

wants to merge 2 commits into from

Conversation

mitra42
Copy link

@mitra42 mitra42 commented Mar 22, 2018

This fixes the issues raised in #9 specifically.

  • Some notes on how to get something running that is testable (this was surprisingly difficult)
  • Upgrade to webpack 4.x and js-ipfs 0.28.2
  • Fix a key problem where on the second run, the service worker fails to initialize node to IPFS (according to docs I found you can't rely on Service Workers retaining state between calls). Instead I reconnect to the repository if required on each call.

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

@mitra42 As I wrote in the issue, I was not able to run this implementation as expected.

* Clone the repo from here
* cd to ipfs-service-worker
* npm install
* cd examples
Copy link
Member

Choose a reason for hiding this comment

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

I think you intended to write examples/use-from-another-page

Copy link
Author

Choose a reason for hiding this comment

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

I think you are correct

* cd to ipfs-service-worker
* npm install
* cd examples
* npm run build
Copy link
Member

Choose a reason for hiding this comment

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

It is necessary a npm install previously, in order to install webpack

Copy link
Author

@mitra42 mitra42 Apr 20, 2018

Choose a reason for hiding this comment

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

I don't understand this, I am running npm install prior to the build, in the ipfs-service-worker.

To be honest, I think this example is much too complicated to be useful, though it helped me figure out how to do it myself. The example is completely unclear what "use-from-another-page" means and in my own implementation I've simplified it significantly to a single package.json, and a single webpack.config.js at the same level which builds the bundles in the dist directory.

I can't post that as a PR since its launching our own code (which includes IPFS) as the SW, rather than just IPFS.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with you that the example is pretty unclear.

I believe it may be considered as an independent project, with its own dependencies. In this PR, there are still 2 package.json. This way, with the implementation in this PR, it needs the npm install.

@mitra42
Copy link
Author

mitra42 commented Apr 20, 2018

Should I close this Pull request, or is there something useful here you want to use?

@vasco-santos
Copy link
Member

@diasdavid what do you think?

@daviddias
Copy link
Member

@vasco-santos your call, if there are things here useful for #11 then pick those, if not, no need to merge it. Thanks @mitra42 for checking and testing this :)

@vasco-santos
Copy link
Member

@diasdavid I think that we can close this issue. It has some important aspects that I will pick later

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.

3 participants