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

Extract grapher and core table types #3056

Merged
merged 6 commits into from
Jan 12, 2024

Conversation

danyx23
Copy link
Contributor

@danyx23 danyx23 commented Dec 30, 2023

This PR extracts all types from the grapher and core-table packages and moves them into the types package. This will allow us to freely re-use types finally, e.g. so that the ChartsRow type defined in types can specify that the content field is a GrapherInterface.

Copy link
Contributor Author

danyx23 commented Jan 4, 2024

Copy link
Member

@ikesau ikesau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! app compiles & runs, DB migrations run fine 🙂👍

searching type \w+ = in ./packages/@ourworldindata/grapher/src shows a few places still where we have collections of type declarations in the grapher core library (e.g. StackedConstants.ts and MarimekkoChartConstants.ts)

Are those excepted because they're very specific to an internal usecase and closeness is more valuable? Not a blocker either way

@danyx23
Copy link
Contributor Author

danyx23 commented Jan 11, 2024

Ah yes, nice catch, I have missed some types. I'll merge these and then we can move the remaining ones over in a follow up

@danyx23 danyx23 force-pushed the extract-grapher-and-core-table-types branch from a5ba090 to f3522c9 Compare January 12, 2024 16:54
Copy link
Contributor Author

danyx23 commented Jan 12, 2024

Merge activity

  • Jan 12, 12:47 PM: @danyx23 started a stack merge that includes this pull request via Graphite.
  • Jan 12, 12:48 PM: Graphite rebased this pull request as part of a merge.
  • Jan 12, 12:49 PM: @danyx23 merged this pull request with Graphite.

Base automatically changed from types-package to master January 12, 2024 17:47
danyx23 added a commit that referenced this pull request Jan 12, 2024
This PR breaks the messy `owidTypes.ts` file up into around 20 files and moves them into the `types` package. This PR has some issues on the tests that were fixed in the next PR in the stack (#3056) - it is only supposed to be merged as part of the entire stack.
@danyx23 danyx23 force-pushed the extract-grapher-and-core-table-types branch from 0c64f41 to 0ee6c51 Compare January 12, 2024 17:48
@danyx23 danyx23 merged commit c2bbf4e into master Jan 12, 2024
12 of 13 checks passed
@danyx23 danyx23 deleted the extract-grapher-and-core-table-types branch January 12, 2024 17:49
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.

2 participants