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

render some projects when browser does not support JS #1412

Merged

Conversation

shiftkey
Copy link
Member

@shiftkey shiftkey commented Oct 2, 2019

Resolves #511
Supersedes #1079

This PR improves the experience when a user visits the site without JS. This is what you currently see today:

I wanted to pick up #1079 and take it to it's logical conclusion but I had some issues with the approach chosen:

  • rendering every project in the list wasn't optimal now that we're at almost at 800 projects
  • the order of projects is not randomized in that way
  • we lacked any sorts of stats for the projects listed (now available due to caching stats in project output on build #1346)

So what does this PR give us now when JS is disabled?

  • render a randomized list of 50 projects
    • this is set at build time, so it'll regenerate each time the site publishes to GitHub Pages
  • embedded stats alongside each project
    • we couldn't do this before because we hit the GitHub API directly)
  • added a warning message to explain the behaviour
    • this is unstyled for now and would be great for someone else to polish

Here's a quick screenshot:

This feels like a better incremental change than what was initially proposed in #1079, and we can refine this over time based on how we feel about it.

  • update comment to link to this PR
  • measure overhead of including this static list of projects
  • confirm or give up on excluding projects with zero open issues
  • test deploy site with JS disabled
  • test deploy site with JS enabled
  • get tag links working or disable them for now

@shiftkey
Copy link
Member Author

shiftkey commented Oct 2, 2019

With this PR, we only increase the download size of the main HTML file (gzip compressed) by 5KB

Current site:

This PR:

Over in #1079 (comment) we were looking at an additional 70KB being served up to every visitor, so this feels like a great improvement.

@shiftkey shiftkey force-pushed the render-static-projects-if-no-js branch from 7d6a5bc to 7734cf3 Compare October 4, 2019 12:39
@shiftkey shiftkey force-pushed the render-static-projects-if-no-js branch from 7734cf3 to f3a8b78 Compare October 5, 2019 15:09
@shiftkey shiftkey marked this pull request as ready for review October 5, 2019 15:27
@shiftkey shiftkey changed the title [WIP] render some projects when browser does not support JS render some projects when browser does not support JS Oct 5, 2019
@shiftkey shiftkey merged commit e0f38c1 into up-for-grabs:gh-pages Oct 9, 2019
@shiftkey shiftkey deleted the render-static-projects-if-no-js branch October 9, 2019 14:09
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.

Visiting the site with javascript disabled does not display any projects
1 participant