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

Jeremie/protobufectomy c# #1466

Open
wants to merge 3 commits into
base: noa/protobufectomy
Choose a base branch
from

Conversation

lcodes
Copy link
Contributor

@lcodes lcodes commented Jun 28, 2024

Description of Changes

C# side of the rust protobufectomy. Updates the codegen to reflect matching changes to the C# client SDK.

API and ABI breaking changes

If this is an API or ABI breaking change, please apply the
corresponding GitHub label.

Expected complexity level and risk

How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.

This complexity rating applies not only to the complexity apparent in the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning ways.

Testing

Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!

  • Write a test you've completed here.
  • Write a test you want a reviewer to do here, so they can check it off when they're satisfied.

@jdetter jdetter changed the base branch from master to noa/protobufectomy June 28, 2024 15:01
Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

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

Small nit that needs to be addressed - I'm still testing right now

@@ -647,7 +652,7 @@ pub fn autogen_csharp_globals(items: &[GenItem], namespace: &str) -> Vec<(String
);
writeln!(
output,
"public ReducerEvent(ClientApi.Event dbEvent, IReducerArgs? args) : base(dbEvent) => Args = args;"
"public ReducerEvent(TransactionUpdate update, IReducerArgs? args) : base(update) => Args = args;"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Either we need to add using SpacetimeDB.ClientApi; to the top of this file or you need to fully qualify this path because it causes a compilation issue:

Assets/_Project/autogen/_Globals/SpacetimeDBClient.cs(515,23): error CS0246: The type or namespace name 'TransactionUpdate' could not be found (are you missing a using directive or an assembly reference?)

Copy link
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

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

Easy to fix whitespace nits

writeln!(output, "[DataContract]");
writeln!(output, "[SpacetimeDB.Type]");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please revert this transposition

@@ -343,11 +345,14 @@ fn autogen_csharp_product_table_common(
field_name.to_case(Case::Pascal),
default_init(ctx, &field.algebraic_type)
);
if i + 1 != num_fields {
writeln!(output);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is causing an additional space in between each field, do we need this change? This is causing the diff for the API upgrade to be pretty insane: https://github.com/clockworklabs/BitCraftClient/pull/3586/files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right, I added this to make the emitted fields more readable, as the lines can get long. It's not a needed change tho, purely style. Should we keep or remove it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

please remove it, if you feel strongly about the style change we can do it in a separate PR IMO - I just want the API upgrade to be as simple as possible.

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

Successfully merging this pull request may close these issues.

None yet

3 participants