-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add support for --include-dependencies
flag
#1548
Conversation
Hey @LTe, could you elaborate on the reasoning behind only generating a handful of dependencies for the lifetime of the project? Is it performance related? We also have a large Gemfile but didn't reach for this feature so I'm trying to understand. |
I think there is a couple reasons why I want this kind of feature in tapioca. Currently my Gemfile.lock include about ~630 gems
As you can see there is significant difference in performance. Do I really need 560 generated RBIs? Most of the missing constants inside I want this feature just for flexibility, to have control what I will generate for my application. I can of course do similar thing with external script, but I think this feature should be included in tapioca. To be honest 560 files where So in summary, I want this feature in tapioca because of:
|
This is an interesting approach but I'm still not convinced that this is a good way of using Tapioca in the long term: Generating RBIs only for gem constants that are referenced in the application. What you want with this PR can be achieved with supplying arguments to Biggest issue I have with this setup is the need for manual tapioca config changes every time the application starts using a new gem or starts referencing new part of a gem, it's an extra manual step to be done by the user. Knowing which gem to load can also get complex if the gem's RBIs changes conditionally based on the existence of another gem. Users will need to inspect gem's code. Side note: why does this feature need to generate RBIs for sub-dependencies that aren't referenced by the application if you're using a We have a similar number of gems and in practice we rarely run |
We discussed this internally and while What do you think about switching the implementation to that? Biggest difference would be to iterate recursively over all dependencies and keeping track of them in a set instead of limiting to one level. We'll also have to ensure this can't be used alongside @paracycle I'm curious if you have opinions on this approach. |
@KaanOzkan I updated pull request and implemented |
--only
flag--include-dependencies
flag
@LTe We don't have squash and merge enabled in tapioca so the commit history will also need some cleaning up. Thank you! |
bef007b
to
2fa0bc7
Compare
@KaanOzkan I updated the code and documentation. Do you think that this PR can be related to #1576? |
Good shout! I think |
3640a3f
to
599ffeb
Compare
5e58ef4
to
6765648
Compare
This commit introduces a feature that allows users to generate (RBI) files for dependencies of specified gems. A new `--include-dependencies` option has been added to the `gem` command in the Tapioca CLI. When this option is used with specified gem names, RBI files will also be generated for their dependencies. Exception handling has been improved to display an error message if the `--include-dependencies` option is used without specifying any gems. Additionally, the default value of `include_dependencies` has been set to `false` to ensure compatibility with existing use cases. The README, CLI help documentation, and config file have been updated accordingly to reflect these changes. This feature provides more flexibility to users who want to generate RBIs for a gem along with its dependencies, enhancing the overall usability of Tapioca. Co-authored-by: Vinicius Stock <vinistock@users.noreply.github.com>
e881255
to
d897413
Compare
Motivation
In my project we have huge Gemfile with a lot of gems. We tried to type some of the files, but we do not need all of the gems to be generated. We tried to use
tapioca gems [name_of_the_gem]
but it was generating only this gem (without dependencies). We triedexclude
but list was huge.I think we should have
--include-dependencies
flag that generate RBIs for dependencies as wellImplementation
I added new flag for CLI that will pick gems and dependencies from the list.
Tests
I added integration tests