RBIs for different Rails gems are referencing each other even though there is no dependency
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the Rails activerecord.gemspec dependency declaration linked in the issue and the generated sorbet/rbi/gems/activerecord@8.0.1.rbi entries reported by bin/srb tc. Compare the generated references with the declared gem dependencies and determine whether generation should account for optional Rails components. Done means the dependency behavior is documented or corrected and bin/srb tc no longer reports these unresolved constants for a partial Rails installation.
Written by the indexing model from the issue text.
Description
I'm trying to build an app that doesn't require all of Rails but only specific parts, e.g. activerecord.
According to its gem spec it only depends on activesupport and activemodel (with no further transitive dependencies into Rails).
However, running bin/srb tc on the RBIs generated by tapioca I'm getting the following errors:
$ bin/srb tc
sorbet/rbi/gems/activerecord@8.0.1.rbi:8297: Unable to resolve constant ActionText https://srb.help/5002
8297 | include ::ActionText::Encryption
^^^^^^^^^^^^
sorbet/rbi/gems/activerecord@8.0.1.rbi:8297: Unable to resolve constant ActionText https://srb.help/5002
8297 | include ::ActionText::Encryption
^^^^^^^^^^^^
sorbet/rbi/gems/activerecord@8.0.1.rbi:8359: Unable to resolve constant ActiveStorage https://srb.help/5002
8359 | include ::ActiveStorage::Attached::Model
^^^^^^^^^^^^^^^
sorbet/rbi/gems/activerecord@8.0.1.rbi:8359: Unable to resolve constant ActiveStorage https://srb.help/5002
8359 | include ::ActiveStorage::Attached::Model
^^^^^^^^^^^^^^^
sorbet/rbi/gems/activerecord@8.0.1.rbi:8360: Unable to resolve constant ActiveStorage https://srb.help/5002
8360 | include ::ActiveStorage::Reflection::ActiveRecordExtensions
^^^^^^^^^^^^^^^
sorbet/rbi/gems/activerecord@8.0.1.rbi:8360: Unable to resolve constant ActiveStorage https://srb.help/5002
8360 | include ::ActiveStorage::Reflection::ActiveRecordExtensions
^^^^^^^^^^^^^^^
sorbet/rbi/gems/activerecord@8.0.1.rbi:8361: Unable to resolve constant ActionText https://srb.help/5002
8361 | include ::ActionText::Attribute
^^^^^^^^^^^^
[...]
Is this a known limitation that Rails can only be used as a whole with tapioca or something that can/should be fixed?
- Dominant language
- Ruby
- Stars
- 873
- Forks
- 164
- Avg merge
- 4d 27m
- Merged PRs (30d)
- 9
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Shopify/tapioca
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100