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

Autogenerate tagging-compliant descriptor methods for all archetypes #8643

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Jan 10, 2025

Generate methods for all archetypes that allow retrieving the fully-qualified descriptor for any of the archetype's field.
E.g. this method returns the descriptor for the radii field of Points3D:

impl Points3D {
    /// Returns the [`ComponentDescriptor`] for [`Self::radii`].
    #[inline]
    pub fn descriptor_radii() -> ComponentDescriptor {
        ComponentDescriptor {
            archetype_name: Some("rerun.archetypes.Points3D".into()),
            component_name: "rerun.components.Radius".into(),
            archetype_field_name: Some("radii".into()),
        }
    }
}

This becomes a must as we start require tags in more and more places (e.g. partial updates APIs).

Copy link

github-actions bot commented Jan 10, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
404b22f https://rerun.io/viewer/pr/8643 +nightly +main

Note: This comment is updated whenever you push a commit.

@teh-cmc teh-cmc added enhancement New feature or request 🦀 Rust API Rust logging API include in changelog 🔩 data model Sorbet do-not-merge Do not merge this PR labels Jan 10, 2025
@teh-cmc teh-cmc marked this pull request as ready for review January 10, 2025 16:05
@teh-cmc teh-cmc added codegen/idl and removed 🔩 data model Sorbet labels Jan 10, 2025
@emilk emilk self-requested a review January 10, 2025 17:46
Base automatically changed from cmc/eager_partial_0_new_traits to main January 13, 2025 08:18
@teh-cmc teh-cmc force-pushed the cmc/eager_partial_1_descriptor_methods branch from 404b22f to 1404c21 Compare January 13, 2025 08:19
@teh-cmc teh-cmc merged commit c80d847 into main Jan 13, 2025
9 of 15 checks passed
@teh-cmc teh-cmc deleted the cmc/eager_partial_1_descriptor_methods branch January 13, 2025 08:19
teh-cmc added a commit that referenced this pull request Jan 13, 2025
…8644)

These methods were still `ComponentName`-based, which just won't work as
we start introducing archetypes with multiple instances of the same
component.

Note that these methods are very seldom used (only for tests, IIRC), so
I went for the path of least resistance and took a few shortcuts.
We can build something sturdier later on if need be (I highly doubt
it... in fact I expect these methods don't have that much time left to
live).

* DNM: requires #8643
@teh-cmc teh-cmc removed the do-not-merge Do not merge this PR label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants