shurcooL / Go-Package-Store

An app that displays updates for the Go packages in your GOPATH.
MIT License
900 stars 29 forks source link

Render HTML on frontend, add "Update All" button. #71

Closed dmitshur closed 7 years ago

dmitshur commented 7 years ago

This is a large change that primarily moves HTML rendering and display logic from backend to frontend (#67).

Previously, the HTML for displaying updates was rendered on backend and streamed to browser. This worked surprisingly well and got me far, but in order to be able to have more fine grained control over frontend details, it was no longer viable to keep doing that. Now, the HTML is fully rendered on frontend, and most of the logic resides on the frontend. The backend provides services to the frontend. See issue #67 for full rationale why this is desired.

Implement a long-standing feature request of having an "Update All" button (#6). This is both made possible and easy thanks to the frontend HTML rendering.

This change partially helps #63, but also enables potential future changes to help it even more.

In general, the move to frontend HTML rendering will help potentially achieve some of enhancements described in #8.

Close #66 by removing the popup altogether. It wasn't well implemented, so it's better to remove. In the future, a better replacement implementation of the notification (without the modal popup) can be considered.

Screenshot

image

dmitshur commented 7 years ago

This currently relies on support for frontend HTTP streaming via fetch API, in order to display updates as they come in. I know latest stable Chrome supports that, but the latest stable Safari does not. On browsers that don't support it, all updates will show up at once at the end.

See http://caniuse.com/#feat=fetch.

It's possible to rewrite it to avoid relying on HTTP streaming, so I'll need to think about whether that's a blocker for this going in.

dmitshur commented 7 years ago

Safari 10.1 includes support for Fetch API (it's actually the first feature listed), see its release notes. It should ship with next macOS 10.12.4, which is going to be happen relatively soon.

dmitshur commented 7 years ago

Apple has officially released macOS 10.12.4 today. It ships with Safari 10.1, which supports Fetch API.

So, this PR is no longer blocked on that.

dmitshur commented 7 years ago

I've merged this now.

There's still room for optimization, improvement, and cleaning up code. But the current version is stable and I can't find any blocking issues in it without wider testing.

I'm waiting on a resolution to gopherjs/vecty#92 to be able to experiment with Restorer interface for potential additional performance improvement.

There will be ongoing incremental cleanup and improvement done after this is merged (especially if there are issues reported).

I've added a screenshot of the final version to the PR description.