rbs
rbs copied to clipboard
stringio should be a stdlib, but it's in `core/`
In Ruby, stringio is a stdlib.
https://github.com/ruby/ruby/tree/50520cc1930331bccdb94730e17ddc01798f2be0/ext/stringio
But currently, RBS has string_io as a core library unexpectedly.
https://github.com/ruby/rbs/blob/abcc97d3c8b024856ba9603a7ef22d422652ff42/core/string_io.rbs
So we should do the two things:
- Move string_io.rbs from
core/tostdlib/. - Rename it to
stringio.rbs- because the library name is
stringio.
- because the library name is
BTW, this will introduce a breaking change. We should do it carefully. For example, we can provide a migration process.
I have a proposal.
Our goal
I believe stringio is already gemmed and the goal is to move to gem. https://github.com/ruby/stringio
Problem
One thing to be aware of regarding migration is older versions of rbs. The following are possible problems with older rbs.
- Moving to gem conflicts with core in old rbs
- Adding
stringioto manifest.yaml of gems in gem_rbs_collection crashes with error when loaded in old rbs.
Proposal
- Move to stdlib from core.
- Read RBS from gem if exists in rubygems
- Otherwise, always load RBS from stdlib.
- Add stringio to manifest.yaml for cgi, csv, and open-uri in stdlib
- Release
- Wait for penetration...
- If
StringIOis found in RBS withoutstringioin both manifest.yaml and gem dependencies, issue a warning.- Optional because I don't know if I can do it.
- Release
- Add stringio to the manifest.yaml of gem_rbs_collection.
- If executed too soon, errors will occur with old rbs.
- Move to gem from stdlib.