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

Remove Struct from Types #209

Merged
merged 10 commits into from
Jul 18, 2024
Merged

Remove Struct from Types #209

merged 10 commits into from
Jul 18, 2024

Conversation

mullermp
Copy link
Contributor

@mullermp mullermp commented Jul 13, 2024

Remove Struct from Types and use PORO instead. RBS caught issues now that struct isn't being used, including fixing documents and string maps which had symbolized keys

hearth/sig/lib/hearth/interfaces.rbs Outdated Show resolved Hide resolved
include Hearth::Structure

MEMBERS = %i[
Copy link
Contributor

Choose a reason for hiding this comment

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

What about having Hearth::Structure define a class method for members which would then setup the attr accessors (and set the MEMBERS). Eg:

class MyType
  include Hearth::Structure

  members %i(member1 member2)
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was avoiding adding new methods because then those have to be reserved. Class method may be ok too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't do this apparently because we require a constant and it ends up being dynamic.

hearth/lib/hearth/structure.rb Show resolved Hide resolved
codegen/projections/white_label/lib/white_label/params.rb Outdated Show resolved Hide resolved
// TODO: not sure if any of this belongs here
if (target.hasTrait(StreamingTrait.class)) {
// TODO: determine if input or output and set accordingly
// String is a hack because of protocol tests comparing blob? FIXME
Copy link
Contributor

Choose a reason for hiding this comment

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

Where do we compare the blob in the protocol tests?

I think on output we handle streaming correctly by reading.

But I guess on input when we create our param inputs we don't check for streaming... maybe we need to there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't find a better way around this.

@alextwoods alextwoods changed the title Remove Struct from Types and do not allow them as input either Remove Struct from Types Jul 18, 2024
Copy link
Contributor

@alextwoods alextwoods left a comment

Choose a reason for hiding this comment

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

This will require downstream (V4) fixes as well right since its breaking changes?

I'm not quite sure why the downstream tests are passing - something may not be working correctly with them....

@mullermp mullermp merged commit d1c9cbd into main Jul 18, 2024
21 of 22 checks passed
@mullermp mullermp deleted the ditch-struct-types branch July 18, 2024 22:16
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.

3 participants