feat: precached webui works in offline mode#782
Merged
Conversation
lidel
commented
Oct 9, 2019
| Swarm: [ | ||
| // optional ws-star signaling provides a backup for non-LAN peer discovery | ||
| // (this will be removed when autorelay and DHT are stable in js-ipfs) | ||
| '/dns4/ws-star1.par.dwebops.pub.com/tcp/443/wss/p2p-websocket-star', |
Member
Author
There was a problem hiding this comment.
I believe this was just a dev alias for ws-star.discovery.libp2p.io
ba37975 to
15f2be7
Compare
For now we add a TAR with Web UI as a PoC. Next step is to make it more generic. There should be a list of CIDs that should be recursively precached and added to node during the boot.
- async import of TAR archives - streaming where possible - makes webui open instantly in Chromium Known Issue: /api/v0/add does not work with latest js-ipfs, needs to be addressed before merging this to master.
15f2be7 to
073f058
Compare
ce27b0a to
e5572f8
Compare
6aac086 to
625a826
Compare
5 tasks
hugomrdias
approved these changes
Oct 16, 2019
|
🎉🌈🍧⛄️
…On Thu, Oct 17, 2019 at 3:21 PM Marcin Rataj ***@***.***> wrote:
Merged #782 <#782>
into master.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#782>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAMHN2VSMBVZNSE5ANRW6TQPDQPVANCNFSM4I5UNB3A>
.
|
This file contains hidden or 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
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 PR adds precache logic for Web UI which is executed when IPFS API client (or full node) starts.
The main purpose is to make Web UI load instantly in Brave and work in offline environments.
closes #765, closes #682, part of #716 🦁
How does it work?
During the build .tar archives are placed in
add-on/dist/precache.This makes them available to fetch over
*-extension://{extension-id}/dist/precache/*URLs.Right now we have only one archive: a 22MB file with release version of Web UI.
When IPFS client starts, preache logic is executed:
*-extension://{extension-id}/dist/precache/*.tarChecklist
(keeps a single place to update instead of two)
Known Issues
/api/v0/adddoes not work with latest js-ipfs (and we can't use older version due to gc-lock bug breaking precache process)