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

Project: make grapher and site standalone projects within repo #1082

Closed
1 of 8 tasks
larsyencken opened this issue Jan 24, 2022 · 3 comments
Closed
1 of 8 tasks

Project: make grapher and site standalone projects within repo #1082

larsyencken opened this issue Jan 24, 2022 · 3 comments

Comments

@larsyencken
Copy link
Contributor

larsyencken commented Jan 24, 2022

Make grapher a standalone project within the existing repo.

Scope

Why / why now

Currently people can’t try out or use grapher without spinning up our entire site. This project would allow others to use grapher, find problems with it and contribute fixes back.

This year we would like to start to seek external contributions for data and for grapher.

Risks

  • Could lose the git history for one project or the other (solved via monorepo)
  • Could end up with a development flow that is way tricker/harder/more expensive when we make grapher changes as part of a combined change (solved via monorepo)
  • Other people creating grapher charts could dilute our brand, if they look too similar (solved via styling)
  • Risk to have to maintain backwards compatibility for other people 😱 which could slow our development
    Set low expectations for the general public to begin with in our README
  • If our module boundaries aren’t currently a good match, it could blow out in time because of refactors that are needed
@marcelgerber
Copy link
Member

There are two way we can go about this:

  1. Go with a clean split, i.e. split the project up into as many modules as we can
  2. Go with the cheapest possible split, i.e. only split the grapher off from the rest (since the grapher is certainly the most-requested reusable component)

I made an effort to identify some possible modules and their interdependences:

  • grapher (reusable)
  • db / api (?)
  • admin-backend
  • admin-frontend
  • baker (static site generator)
  • site (other frontend code for site, e.g. styles, cookie banner, footnotes, ...)
  • wordpress (?)
  • utils (?)
  • types

In the below diagram, dashed lines indicate a "consumes API" relationship.
image

graph TD;
    grapher;
    db/api;
    admin-backend;
    admin-frontend;
    baker;
    site;
    wordpress;
    utils;

    utils --> grapher;
    utils --> admin-frontend;
    utils --> admin-backend;
    grapher --> admin-frontend;
    grapher --> site;
    grapher --> baker;
    admin-backend -.-> admin-frontend;
    db/api -.-> admin-backend;
    wordpress -.-> baker;
Loading

Plan

Try structuring out utils first, to see how well that works and which problems we hit.
Try to do the "nice" solution first (structuring out into ~8 packages), if that doesn't work out then go with the minimal solution (utils, grapher, everything else).

We will also want to rework our current tsc + webpack setup, by instead using a TS plugin for Webpack (or ts-node for node scripts) so TS compilation happens transparently.

Default styling of a reused grapher should include:

  • No logo
  • Different fonts
  • Different default color scheme (?)
  • Replace "CC BY" by "Powered by ourworldindata"

@larsyencken
Copy link
Contributor Author

larsyencken commented Feb 9, 2022

Solid plan!

So, in the ideal scenario, the owid-grapher repo would end up as a monorepo containing README + 8 folders, each of which is an independent project with its own README, versioning and packaging?

I could see the versioning being annoying, if for everything other than grapher and utils we only care about latest. I had imagined that maybe the grapher admin might become standalone, but in practice I think it will be quite coupled to our MySQL backend, especially with bulk FASTT being part of the admin.

After the move, we could consider whether we want to in time break more things out, or whether we want to do the opposite (e.g. move owid-content into the monorepo rather than keeping it separate).

@larsyencken
Copy link
Contributor Author

Closing this, we don't have the appetite to address it for now.

@larsyencken larsyencken closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants