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

Maintenance 03-25 #50

Merged
merged 3 commits into from
Mar 19, 2025
Merged

Maintenance 03-25 #50

merged 3 commits into from
Mar 19, 2025

Conversation

ThetaSinner
Copy link
Member

@ThetaSinner ThetaSinner commented Mar 18, 2025

This is mostly version bumps, making clippy pass on tests and generally tidying up. There is a significant change that I came here to make though.

At the moment this works:

use hdk::prelude::*;

#[derive(SerializedBytes)]
struct Thing {
    field: u32,
}

Because both SerializedBytes and holochain_serial! get imported.

I find this thoroughly annoying because if you just try to write code where SerializedBytes is available, then you just import wherever::SerializedBytes and get a compile error about holochain_serial! not being available.

Like this, you get a clearer error message telling you that holochain_serialized_bytes is missing. It's the approach that serde is currently using. The downside is that, like serde, we have to have it as a direct dependency wherever we use it rather than re-exporting it. So the following would be valid only if holochain_serialized_bytes is a crate dependency:

use hdk::prelude::SerializedBytes;

#[derive(SerializedBytes)]
struct Thing {
    field: u32,
}

@ThetaSinner ThetaSinner requested a review from a team March 18, 2025 18:08
@jost-s
Copy link
Contributor

jost-s commented Mar 18, 2025

You must be joking. 2000 lines maintenance?

Anyhow, what you're saying is that if you use SerializedBytes outside of the hdk, you get the error about holochain_serial!?

@jost-s
Copy link
Contributor

jost-s commented Mar 18, 2025

I see the bulk is Cargo.lock. Phew!


fmt:
nix-shell --run "hn-rust-fmt && hn-rust-clippy"
Copy link
Contributor

Choose a reason for hiding this comment

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

Wave goodbye!

inputs = {
nixpkgs.follows = "holonix/nixpkgs";
holonix.url = "github:holochain/holonix?ref=main";
Copy link
Contributor

Choose a reason for hiding this comment

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

Booyakah!

@ThetaSinner
Copy link
Member Author

ThetaSinner commented Mar 18, 2025

Anyhow, what you're saying is that if you use SerializedBytes outside of the hdk, you get the error about holochain_serial!?

You can still use it, but every time you import SerializedBytes, you have to remember to import the macro that it calls into the same scope too:

use hdk::prelude::{SerializedBytes, holochain_serial};

#[derive(SerializedBytes)]
struct Thing {
    field: u32,
}

Even though you don't use the macro directly and the error message doesn't make it clear what you did wrong.

@jost-s
Copy link
Contributor

jost-s commented Mar 18, 2025

Got it, so making it explicit. That's great.

@ThetaSinner ThetaSinner merged commit f88bdec into main Mar 19, 2025
1 check passed
@ThetaSinner ThetaSinner deleted the maint-03-25 branch March 19, 2025 11:51
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.

4 participants