Shopify / Shopify/type_toolkit
Consider `implements MyInterface` syntax
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 3
- Forks
- 5
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 8
Description
Would we want this?
module Notifier
interface!
# ...
end
class SlackNotifier
implements Notifier # ✨
# ...
end
The implementation would literally just be Module.alias_method(:implements, :include)
Pros:
- Reads really nicely, feels native
- Tools can instantly know that
Notifieris an interface, without needing to resolve it first (it likely lives in another file)
Cons:
- Would need special support in Rubydex/RubyLSP. It wouldn't be understood by other tools by default.
- Most tools that handle Ruby understand module inclusion, so they'd know the interface's methods become available on the class. They wouldn't know that about this
implementskeyword without having bespoke support built for it.
- Most tools that handle Ruby understand module inclusion, so they'd know the interface's methods become available on the class. They wouldn't know that about this
Originally posted by @amomchilov in https://github.com/Shopify/type_toolkit/pull/2#discussion_r2850115519
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.
Research direction
Start with the proposed Notifier and SlackNotifier example and review the referenced Rubydex/RubyLSP compatibility concerns. Determine whether the project should adopt implements as an alias for include, what tool support would be required, and how completion would be validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100