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

refactor!: Rename NodeBuilder to Node and the old Node to FrozenNode #476

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

mwcampbell
Copy link
Contributor

By doing this, passing the new Node (former NodeBuilder) in TreeUpdate, and having the consumer convert to the slightly smaller FrozenNode, we make the API more convenient for all users while not giving up the node size optimization. And it's probably slightly better for binary size to do the conversion to FrozenNode in just one place.

option_properties_debug_method! { debug_option_properties, [transform, bounds, text_selection,] }
}

vec_property_methods! {
(CustomActions, CustomAction, custom_actions, get_custom_action_vec, set_custom_actions, set_custom_action_vec, push_custom_action, push_to_custom_action_vec, clear_custom_actions)
}

impl fmt::Debug for Node {
impl fmt::Debug for FrozenNode {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut fmt = f.debug_struct("Node");
Copy link
Member

Choose a reason for hiding this comment

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

Did you not change the name of the struct on purpose? I think we still want the debug representation to show if it's a frozen node or not, right?

Copy link
Member

@DataTriny DataTriny left a comment

Choose a reason for hiding this comment

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

I think this will even make our Python bindings less awkward.

@DataTriny DataTriny merged commit 7d8910e into main Oct 29, 2024
9 checks passed
@DataTriny DataTriny deleted the refactor-node-builder branch October 29, 2024 19:27
@github-actions github-actions bot mentioned this pull request Oct 27, 2024
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