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

Stop ignoring irb in RBI generation #1804

Closed
wants to merge 1 commit into from
Closed

Conversation

KaanOzkan
Copy link
Contributor

Motivation

Since sorbet/sorbet@2f9fbc2 superclass mismatch between IRB's tapioca generated RBIs and the sorbet payload can be resolved by using the new flag with the appropriate class name,
--suppress-payload-superclass-redefinition-for=Foo.

This flag can be added to sorbet/config.yml for convenience.

Implementation

Tests

Since
sorbet/sorbet@2f9fbc2
superclass mismatch between IRB's tapioca generated RBIs and the sorbet payload can be resolved by using the new
flag with the appropriate class name,
`--suppress-payload-superclass-redefinition-for=Foo`. This flag can be
added to sorbet/config.yml for convenience.
@KaanOzkan KaanOzkan requested a review from a team as a code owner February 27, 2024 20:07
@KaanOzkan KaanOzkan added the enhancement New feature or request label Feb 27, 2024
@st0012
Copy link
Member

st0012 commented Feb 28, 2024

While the flag is certainly a great improvement, I think devs will need to manually type something like --suppress-payload-superclass-redefinition-for=OldClassName for every single class that has a mismatch?
If that's the case, I fear it'll still be a huge pain for devs as we're going to do mass superclass renaming with PRs like ruby/irb#873 this year.

@KaanOzkan
Copy link
Contributor Author

@st0012 Most renamings should be fine but if there are plans to change superclasses then yes I'm happy to keep ignoring it until it's done. irb is not commonly referenced so dealing with superclass mismatches are probably not worth having the RBIs. If there are constants that may be common we could put them as annotations in rbi-central so that they don't have to be manually shimmed. Maybe something similar to what we have in our monolith?:

module IRB
  VERSION = T.let(T.unsafe(nil), String)

  class Statement
    class Command < Statement
    end

    class Expression < Statement
    end
  end
end

@st0012
Copy link
Member

st0012 commented Mar 5, 2024

Maybe something similar to what we have in our monolith?:

It's only needed in Core because of the debugging patches, which I imagine most apps wouldn't have. So I don't think it's worth adding those to rbi-central either.

IMO, before IRB's command/helper method extensions are released and adopted in Shopify apps like Core, we don't need to generate its RBIs through Tapioca nor have annotations in rbi-central.

@KaanOzkan KaanOzkan closed this Mar 5, 2024
@KaanOzkan KaanOzkan deleted the ko/stop-ignoring-irb branch March 5, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants