Skip to content

Conversation

@cretz
Copy link
Member

@cretz cretz commented Feb 26, 2025

What was changed

  • Start including Gemfile.lock files in this repo
  • Add sorbet_generic sample
    • Show how to use tapioca to auto generate RBI files
    • Show how to add shims for generics and better type safety
    • Show activity, workflow, signal, query, and update implementations and invocations with Sorbet signatures
    • Document some of the issues encountered when using Sorbet

When reviewing, can ignore everything in the sorbet_generic/sorbet folder.

Checklist

  1. Closes Sample request: Sorbet #3

@cretz cretz requested a review from a team February 26, 2025 20:02
@cretz cretz marked this pull request as ready for review February 26, 2025 20:03
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

Do we really want to check in all the generated code? That's a pretty huge amount of stuff to put in there generated.

As far as the actual approach, I guess it works if you're super, super motivated to use this but honestly it seems like it's more obnoxious than it's worth. I trust that there isn't some better way to use Sorbet than what you found, so I think this will mostly serve as documentation that it just isn't really a great option here.

@cretz
Copy link
Member Author

cretz commented Feb 27, 2025

Do we really want to check in all the generated code?

Yes, per https://sorbet.org/docs/adopting#step-6-source-control:

All files generated by tapioca init (including bin/tapioca) should be committed to source control, including the entire sorbet directory. [...] See also this explanation of why we commit RBIs.

This is the primary reason that, unlike other samples, I made this sample be its own project with its own Gemfile, so I wouldn't need all this mess at the top-level.

As far as the actual approach, I guess it works if you're super, super motivated to use this but honestly it seems like it's more obnoxious than it's worth

This is true. I should clarify in the README that this is only for people that want to experiment with advanced generics. For those wanting to use traditional not-really-typed auto-generated Sorbet stuff like any other non-Sorbet Ruby library, they can just do the auto generation and move on, they don't even need this sample. The goal if this sample was to show generics, so I may even rename it to sorbet_generics in addition to that README clarification.

@cretz cretz changed the title Sorbet sample Advanced Sorbet generic sample Feb 27, 2025
@cretz
Copy link
Member Author

cretz commented Feb 27, 2025

Changed sample name and clarified in README the advanced nature of this sample

@cretz cretz merged commit e31565d into temporalio:main Mar 7, 2025
8 checks passed
@cretz cretz deleted the sorbet branch March 7, 2025 14:59
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.

Sample request: Sorbet

2 participants