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

Dynamically generate database constants that we can reference in code. #3807

Open
ikesau opened this issue Jul 23, 2024 · 0 comments
Open

Dynamically generate database constants that we can reference in code. #3807

ikesau opened this issue Jul 23, 2024 · 0 comments

Comments

@ikesau
Copy link
Member

ikesau commented Jul 23, 2024

In the site/grapher, we have data that we hardcode to correspond with data in the DB (e.g. PUBLIC_TAG_PARENT_IDS, POPULATION_INDICATOR_ID_USED_IN_ADMIN, or the site navigation json)

We could create a script that automatically derives these constants and turns them into a TS file that we can import from

e.g. import { SiteNavTree } from '@ourworldindata/dynamic-constants'

Or we automatically generate the files during baking, validated with e.g. typebox.

So that the DB can be the primary source of information, without us having to asynchronously load the site nav.

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

1 participant