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

Use msgpack for API #908

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Use msgpack for API #908

wants to merge 12 commits into from

Conversation

nezuo
Copy link
Contributor

@nezuo nezuo commented May 4, 2024

Fixes #363.
Fixes #881.

Remaining Tasks

  • Test more extensively.
  • Use msgpack for write api request.
  • Handle NaN inside of patch compute.

@nezuo nezuo marked this pull request as draft May 4, 2024 23:29
@nezuo
Copy link
Contributor Author

nezuo commented May 5, 2024

patch_compute.rs will treat NaN properties as always changed. This means that you will see nan property changes in the rojo plugin UI (when nothing actually changed).

I'm not sure what's the best way to go about fixing this. Ideally we also account for it types that have multiple numbers like CFrame or NumberSequence.

@nezuo nezuo marked this pull request as ready for review May 10, 2024 02:47
@nezuo
Copy link
Contributor Author

nezuo commented May 10, 2024

I just pushed a commit to account for NaN values. It's a lot of complexity just to handle NaN (and hopefully we don't forget to update it with any new variants because Variant is non_exhaustive). I'm not really sold on the approach, but I'd like to hear anyone's thoughts on it.

@@ -224,6 +227,128 @@ fn compute_children_patches(
}
}

/// Trait where NaN values must not be treated as different.
trait Different {
Copy link
Member

Choose a reason for hiding this comment

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

This whole trait is... not ideal. I would strongly prefer we move the equality check for Variant to its own file, and make it a simple function instead of a trait.

I have a function already implemented in my syncback fork here if you want to steal it.

It does require us to pull in float_cmp as a crate, but I think that's fine.

@nezuo
Copy link
Contributor Author

nezuo commented May 14, 2024

I'm now using the variant_eq function from your fork. I did change the the Attributes comparison to simplify it if you want to check that out.

Copy link
Member

@Dekkonot Dekkonot left a comment

Choose a reason for hiding this comment

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

This still has the added Different trait despite it not being used for anything anymore. It should be removed.

@nezuo
Copy link
Contributor Author

nezuo commented May 15, 2024

That's my bad, I thought I removed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants