Skip to content

Investigate showcase infrastructure revamp #6882

Open
@Josh-Cena

Description

@Josh-Cena

Have you read the Contributing Guidelines on issues?

Description

The current showcase UI is great, and we don't plan to change it! However, the infra behind it is quite constrained and doesn't scale well. The current workflow is like:

  • Users click on the "Please add your site" button on the showcase page, which takes them to edit the users.tsx file in the GitHub UI.
  • They first read the code comment to understand the instructions. Then they need to scroll through this and insert their site in the right place (usually alphabetic order). The users.tsx file, at the time of writing, is 1991 lines long!
  • When they write their site's data, they could make syntax mistakes, they could format the file inconsistently, they may not know what to write in each field and have to use other entries as reference.
  • After they're done editing the file, they fork, commit, PR. After that, they drag & drop the screenshot to the existing PR.
  • Maintainers step in, check out the branch, and optimize the image for them (only 5% of the showcase submissions properly optimized the image beforehand, and it's just economically more sensible for me to checkout every branch and double-check). Also have to change the PR title to docs: add X to showcase and add the "tag: documentation" label.

The problems in this workflow are apparent.

  • Users without knowledge of git/GitHub often struggle with all the operations and can mess up their branches. They often unnecessarily get intimidated by the CLA bot as well.
  • Maintainers need to manually apply changes to PRs because GitHub actions aren't really smart enough to get triggered only after the user has submitted an image (which is usually not the first commit).
  • Images are not collocated with each site, and maintenance of that users.tsx is a huge problem over time. It took me longer than expected for docs: update showcase data #6862 because I need to blame each line and correspond the username with GitHub handles.
  • We need to prettier-ignore the array, otherwise CI would fail 50% of the time.

So how do we solve this? Two things:

  • We need to split users.tsx into smaller, modular data files, and collocate each data entry with its image.
  • We need to use a web form to submit showcase data.

The first one is relatively simple: build a plugin. The second one is slightly harder, because we need to automate everything with GitHub REST APIs, including fork, create branch, commit, PR. If we want to optimize the image on-the-fly, we probably need a serverless service as well.

However, there's an ultimate solution™: get a server, including a DB! Submitting the form will directly insert the site into the DB, and the website can fetch data from the DB. This means:

  • We no longer track things on GitHub. No more confusions of branches and PRs.
  • Cleaner changelogs, commit history, and contributor graph. 25% of our contributors are showcase submissions—that's a lot of noise...
  • Easier data manipulation: we can query the DB in whichever way we want, allowing for richer navigation without bloating the JS bundle.

With 213 showcase entries, we should start planing for how to make it scale. This proposal is just some random ideas—more ideas welcome 👍

Self-service

  • I'd be willing to address this documentation request myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apprenticeIssues that are good candidates to be handled by a Docusaurus apprentice / traineehelp wantedAsking for outside help and/or contributions to this particular issue or PR.metaMeta-issue about the project itself. Either project maintenance or a list of other issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions