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

Ship the new WebUI #590

Merged
merged 8 commits into from
Oct 5, 2018
Merged

Ship the new WebUI #590

merged 8 commits into from
Oct 5, 2018

Conversation

lidel
Copy link
Member

@lidel lidel commented Sep 20, 2018

This PR aims to replace old Web UI with the bundled one.
It is important to get this right, as we will use similar approach for ipfs-share-files.

Remaining work:

Nice to have, but can be separate PR:

Screenshot (check location bar)

screenshot

@lidel lidel requested a review from olizilla September 20, 2018 12:43
@lidel
Copy link
Member Author

lidel commented Sep 20, 2018

@olizilla any quick thoughts on how to improve the bundling process?
So far I would really like to keep webui "a black box" and ideally just include pre-built release version.
But perhaps there is a better way I missed?

@lidel lidel added this to the 2018-Q4 milestone Sep 20, 2018
@lidel lidel added the status/in-progress In progress label Sep 22, 2018
@lidel lidel changed the title [WIP] Switch to the new WebUI [WIP] Ship the new WebUI Sep 24, 2018
This is an initial stab at bundling.

This PoC is very crude: we just do regular
build in `node_modules/`  and copy artifacts.

Refinements will be introduced in following commits.
WebUI would notice issue eventually, but this gives user an instant
fix and results in better UX.
@lidel lidel force-pushed the feat/bundle-webui branch 12 times, most recently from 5a6e2be to b3d12ff Compare October 3, 2018 00:14
No longer requires local build.
Tries to fetch it from IPFS, then fallbacks to HTTP.
Should work on all platforms.
@lidel
Copy link
Member Author

lidel commented Oct 3, 2018

I created some orchestration for fetching prebuilt webui from IPFS:

https://github.com/ipfs-shipyard/ipfs-companion/blob/b170b221dd3c628eb33f34a967797dcdad32609d/package.json#L26-L31

  • It tries to fetch it via ipfs but if command is not on the path or yields error, fallback will fetch CID from public gateway
  • removes source maps
  • It works on windows ;)

This ensures webui is not stuck with dead API object, which improves UX.
}
}
}

function _isWebuiTab (url) {
const bundled = !url.startsWith('http') && url.includes('/webui/index.html#/')
const ipns = url.includes('/webui.ipfs.io/#/')
Copy link
Member Author

@lidel lidel Oct 4, 2018

Choose a reason for hiding this comment

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

@olizilla FYI this is part of #590. It will detect webui loaded from:

  • https://webui.ipfs.io
  • http://127.0.0.1:8080/ipns/webui.ipfs.io

And reload it when companion API state changes (on/off/port change etc)

Copy link
Member

Choose a reason for hiding this comment

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

#/ will only be added by the app after the initial bundle has loaded (unless the user has bookmarked it explicitly)...

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that was on purpose to remove false-positive matches on random websites and avoid double-reload when quickly switching between backends.

@lidel lidel changed the title [WIP] Ship the new WebUI Ship the new WebUI Oct 5, 2018
@lidel
Copy link
Member Author

lidel commented Oct 5, 2018

Looks stable enough to ship to Beta. Let's smoke-test it there.

@lidel lidel merged commit 99b910d into master Oct 5, 2018
@lidel lidel deleted the feat/bundle-webui branch October 5, 2018 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants