Skip to content

Comments

Introduce re_types_core#3878

Merged
teh-cmc merged 13 commits intomainfrom
cmc/re_type_traits
Oct 16, 2023
Merged

Introduce re_types_core#3878
teh-cmc merged 13 commits intomainfrom
cmc/re_type_traits

Conversation

@teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Oct 16, 2023

This PR introduces a new crate: re_types_core.

re_types_core only contains the fundamental traits and types that make up Rerun's data model.
It is split off from the existing re_types.

This makes it possible to work with our data model abstractions without having to depend on the re_types behemoth.
This is more than a DX improvement: since so many things depend directly or indirectly on re_types, it is very easy to end-up with unsolvable dependency cycles. This helps with that in some cases (though certainly not all).

In particular, re_tuid (and by extension re_format) are now completely free of re_types.

For convenience, re_types reexports all of re_types_core, so the public API looks unchanged.
In a handful of instances (re_arrow_store, re_data_store, re_log_types, re_query), I've went the extra mile and started porting these crates towards raw re_types_core rather than relying on the reexports.
The reason is that, upon closer inspection, these crates are very close to being able to live free of re_types. In the future, the custom crate and custom module attributes coming with #3741 might allow us to make these independent.

Similarly, the codegen now uses re_types_core directly, as that makes the life of the upcoming "serde-codegen" work much easier.

What

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested demo.rerun.io (if applicable)
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@teh-cmc teh-cmc added sdk-rust Rust logging API 🧑‍💻 dev experience developer experience (excluding CI) 🚜 refactor Change the code, not the functionality include in changelog 🔩 data model Sorbet labels Oct 16, 2023
@Wumpf Wumpf self-requested a review October 16, 2023 16:31
@Wumpf
Copy link
Member

Wumpf commented Oct 16, 2023

just because I was curious, here's the dependency graph for this branch
image

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

mostly only looked at toml and md files

I like where this is going: This should also make python and rerun_c a lot smaller once re_sdk is free of built-in types other than re_types_core 👍

@teh-cmc teh-cmc merged commit 11dee21 into main Oct 16, 2023
@teh-cmc teh-cmc deleted the cmc/re_type_traits branch October 16, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔩 data model Sorbet 🧑‍💻 dev experience developer experience (excluding CI) include in changelog 🚜 refactor Change the code, not the functionality sdk-rust Rust logging API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants