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

[🚀 Feature]: Add rbs files to Ruby #10943

Closed
titusfortner opened this issue Aug 12, 2022 · 17 comments
Closed

[🚀 Feature]: Add rbs files to Ruby #10943

titusfortner opened this issue Aug 12, 2022 · 17 comments
Labels
C-rb help wanted Issues looking for contributions I-enhancement I-stale Applied to issues that become stale, and eventually closed.

Comments

@titusfortner
Copy link
Member

Feature and motivation

We're adding Type hints to Python & looking at TypeScript for JS, the equivalent for Ruby is to add rbs files.

Ruby Selenium does a lot of meta-programming which makes it more difficult to use with an IDE like RubyMine. Adding rbs files, *should make this much easier.

Usage example

I think they'll look like this?

module Selenium
  module WebDriver
    module Edge
      class Options < Selenium::WebDriver::Chrome::Options
        KEY:String
        BROWSER:String

        def enable_logging: (browser_options: Hash) -> Hash

        def binary_path: () -> String
      end
    end
  end
end

and then RubyMine and other IDEs will be able to do type hints, etc

@github-actions
Copy link

@titusfortner, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@github-actions
Copy link

This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the I-stale Applied to issues that become stale, and eventually closed. label May 19, 2023
@titusfortner titusfortner added help wanted Issues looking for contributions and removed I-stale Applied to issues that become stale, and eventually closed. labels May 19, 2023
@github-actions
Copy link

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

@aguspe
Copy link
Contributor

aguspe commented Sep 25, 2023

Hi I would like to help out with this, I forked the repo and created a new PR to start adding RBS files

@titusfortner
Copy link
Member Author

That would be great, we'd appreciate the help with it.

Hah, Sparkling Watir, I like it! You didn't have to fork it, though, you could have just taken over Tap Watir. 😁
I wish I'd had the time to work on it back when people were asking for it.

@aguspe
Copy link
Contributor

aguspe commented Sep 26, 2023

Haha, it's good to know, I assumed people were really busy, so I thought the fork was the easiest way to have something working fast.

But if it's okay, I could take over, I have a couple of PRs open in Tap Watir, which is just the extra stuff I added for Sparkling Watir, so I can update and merge them.

And use Sparkling Watir for Desktop automation with Appium, which is something I have been playing with on another gem.

@titusfortner
Copy link
Member Author

Oh, I saw there were PRs at one point, and, well, life...
I added you as maintainer to the tap watir repo
There's a Watir channel on slack if you want to discuss things there - https://www.selenium.dev/support/#ChatRoom

@titusfortner
Copy link
Member Author

We're making some great progress on this. Thanks to @aguspe / @Pexpe
Do we need to track what we have and what we still need?

@aguspe
Copy link
Contributor

aguspe commented Dec 29, 2023

We're making some great progress on this. Thanks to @aguspe / @Pexpe Do we need to track what we have and still need?

Hi @titusfortner thank you so much, right now I'm working on this draft: #13234, I added all the generated RBS files for all classes and modules, and then I'm fixing all the steep issues that originated, I added two screenshots there but hopefully after the holidays I will be able to wrap this PR up and put it for review

@titusfortner
Copy link
Member Author

Awesome! Is that PR everything, or how much more will still need to be worked on?

@aguspe
Copy link
Contributor

aguspe commented Dec 31, 2023

Awesome! Is that PR everything, or how much more will still need to be worked on?

That PR is everything, except the Bazel implementation, so after that PR we should be able to add steep to Bazel and have the type check implementation

Also Happy new year!

@aguspe
Copy link
Contributor

aguspe commented Feb 15, 2024

Just an update on this issue @titusfortner - I'm still working on it, currently there are 125 errors on 43 files, compared to the stat of 1558 errors on 151 files

Several of the errors are related to other libraries we are using so I'm looking into which steep checks we can omit, and eventually making PRs for RBS on other libraries

My goal is to hopefully put the PR up for review #13234, at the end of this month after I solve the rest of the errors and update all the undefined types

I hope is not too much trouble for you and your team that the PR is so big

@titusfortner
Copy link
Member Author

I mean, if it passes whatever is the appropriate tests, I'm sure we'll get feedback and PRs for anything that isn't quite right. These are just a guide after all, right? 😄

Thanks for your work.

@aguspe
Copy link
Contributor

aguspe commented Feb 17, 2024

I mean, if it passes whatever is the appropriate tests, I'm sure we'll get feedback and PRs for anything that isn't quite right. These are just a guide after all, right? 😄

Thanks for your work.

Haha that's right, then I will drive this PR home by removing all the errors and starting making some PRs to get the right types and hopefully more people will jump in

Have a great weekend

@aguspe
Copy link
Contributor

aguspe commented Mar 6, 2024

Just duplicating the last comment on the PR for visibility here:

The latest update after updating the ignore list, I wrote in the steep file the 62 ignore errors across 28 files, I will keep investigating in the case of overloading issues or libraries such as URI and NET::HTTP that give unwanted RBS issues:

Screenshot 2024-03-06 at 22 31 20

Then of course we will need to keep updating the files to replace all the untype signatures where is fit

Copy link

This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the I-stale Applied to issues that become stale, and eventually closed. label Dec 12, 2024
Copy link

This issue was closed because it has been stalled for 14 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-rb help wanted Issues looking for contributions I-enhancement I-stale Applied to issues that become stale, and eventually closed.
Projects
None yet
Development

No branches or pull requests

2 participants