CHANGELOG
master
2.8.2 (2022-12-21)
Signature updates
YAML.load
(#1170)
Library changes
- Add the methods of the
prepend
ed module itself (#1182)
Miscellaneous
- Add
TestSkip
module to skip tests that fails in ruby CI (#1167)
2.8.1 (2022-11-28)
Signature updates
- Update documents based on ruby-3.1.3 (#1160)
Library changes
rbs collection
- Delay loading
Gemfile
for unbundled environments (#1161)
Miscellaneous
2.8.0 (2022-11-24)
Signature updates
- random (#1144)
Library changes
- Fix SEGV when give invalid object to
variables:
(#1153)
Miscellaneous
2.8.0.pre.1 (2022-11-17)
Signature updates
Library changes
- Make type/method-type parser more flexible about input position (#1140)
- Raise an error if a class definition inherits a module (#1152)
- Fix SEGV when parse with invalid content (#1146)
rbs collection
Miscellaneous
- Remove
rubygems
fromrbs
’s manifest (#1150) - Use
untyped
instead ofany
insyntax.md
(#1147) - Fix typo and grammatical mistakes in "Generics" section of
syntax.md
(#1127) - Add a doc that describes tools related to
RBS
(#1125) - Add self-type-bindings to
syntax.md
(#1123) - Add documentation for
...
insyntax.md
(#1120)
2.7.0 (2022-10-07)
Signature updates
2.7.0.pre.3 (2022-10-06)
Signature updates
2.7.0.pre.2 (2022-09-20)
Signature updates
Library changes
- Always skip CR explicitly (#1112)
Miscellaneous
- Use
append_cflags
for other than GCC (#1106)
2.7.0.pre.1 (2022-09-02)
See Release Note 2.7 for the highlights of this release.
Signature updates
- fiber (#1071)
BigDecimal
(#1053)ERB::Util
,ERB::DefMethod
(#1074)Float::Infinity
(#1095)Logger
(#1046)IO.pipe
,IO.foreach
(#1057)Module#refine
(#1064)Regexp.new
(#1059)StringIO#write
(#1065)Warning.#warn
,Kernel.#warn
(#1056)
Language updates
Library changes
- RDoc plugin (#1048)
- Dedupe method comments (#1103)
- Reduce object allocations for GC (#1102)
- Add
frozen_string_literal: true
(#1100) - Load dependencies on
-r
option also (#1013) - Fix DefinitionBuilder for methods aliased from module self constraints (#1099)
- Fix RBS type definitions (#1098)
- Give aliases of
.new
methods correct type (#1097) nil
versions are discouraged and will be deprecated in Rubygems 4 (#1091)- Fixes towards Rubygems 4.0 (#1090)
- Remove redundant
add
forRepository.default
(#1062) - Refactor: Use Repository in stdlib source (#1063)
- Move
bin/sort
implementation to underlib/
(#1051)
rbs prototype
Miscellaneous
2.6.0 (2022-06-22)
RBS
2.6 ships with rbs prototype
commands improvements and signature updates.
New minitest RBS
definitions will help you to type check your tests.
Signature updates
- etc (#1006)
- minitest (#1009)
- date (#1033)
ENV
.ARGF
,Random::Base
(#1041)Hash#dig
(#1011)Hash#reject
(#1016)Kernel?.fail
(#1026, #1028)Rational#*
(#1012)Regexp.new
(#1040)
Library changes
- Add
visibility
columns inAttrReader,AttrAccessor,AttrWriter
#to_json (#1014) - Add support for RSpec's verifying doubles in test setup helper (#1015)
- Fix lexer to analyze escape characters (#1043)
rbs prototype
- [rb] Support the case where the return value is
self
(#1003) - [rb] Lean to the optional side (#1021)
- [rb] Fix method commenting (#1027)
- [runtime] Fix decls of output from
Prototype::Runtime
(#1030) - [runtime] Fix class name resolution of prototype runtime (#1032)
- [rbi] Improve
Prototype::RBI
(#1018)
Miscellaneous
- Fix typo in
CONTRIBUTING.md
(#1004) - Use manifest.yaml instead of manually for validate task (#1010)
- Update re2c (#1017)
- Type check
Prototype::RB
(#1019) - Minor cleanup & fix (#1020)
- Fix type errors (#1023)
- Clarify GHA step name for rake annotate (#1024)
- Silence parser warning (#1039)
- Fix warnings (#1035)
2.5.1 (2022-06-19)
This is a maintenance release mainly to fix errors detected in CI of ruby/ruby
.
Nothing changed related to the users of RBS
gem.
Miscellaneous
- Skip failing tests on ruby/ruby CI (#1036)
- Fix warnings (#1035 except changes on
test/tools/sort_test.rb
that is not included in this release) - Fix
Regexp.new
argument (#1034) - Fix errors with OpenSSL 3 (#1029)
- Fix
OpenSSL::PKey::PKeyError: EVP_PKEY_keygen: bad ffc parameters
with OpenSSL 3 (#1005)
2.5.0 (2022-05-20)
This is a minor release with tuple type/record type syntax updates and rbs prototype
improvements.
- You can write empty tuple type as
[]
, instead of[ ]
- You can write empty record type as
{}
prototype-rb
command with--out-dir
option generates multipleRBS
files in the directory
Signature updates
Time
(#994)
Language updates
- Fix empty tuple type syntax and allow empty record type (#1001)
Library changes
- Add
name
attribute inMethodDefinition#to_json
(#997)
rbs prototype
- Fix (
ArgumentError
) invalid byte sequence in UTF-8 (#995) - Fix broken args after parsed
decls
from::RBS::Prototype::RB
(#998) - Add batch mode to
rbs prototype
(#1000)
2.4.0 (2022-05-08)
This is a minor release with some signature updates, prototype rb
improvement, and test fixes.
Signature updates
rbs prototype
- Omit unnecessary param name on keyword arg from
prototype rb
(#974)
Miscellaneous
- Fix git unsafe repository error on ci test (#985)
- Prefer
IO::Buffer.new
for mutable buffer tests (#989) - Update steep (#990)
2.3.2 (2022-04-06)
Library changes
- Let modules have constants under
::Object
(#972)
Miscellaneous
2.3.1 (2022-04-05)
Library changes
- Fix mswin build, use
append_cflags
, add Windows 'compile only' CI (#964) - Raise
RBS::SyntaxError
fromparse_record_attributes
(#966) - Toplevel constant must have the lowest precedence (#967)
rbs prototype
- Use default value also for
literal_to_type
(#962)
2.3.0 (2022-04-01)
Signature updates
Enumerator
(#931)FalseClass
(#931)Integer
(#914)Module
(#931)NilClass
(#931)Object
(#931)Prime
(#934)TracePoint
(#941)TrueClass
(#931)#to_d
(#936)IO#wait_writable
(#943)
Library changes
- Add
Resolver::ConstantResolver
andResolver::TypeNameResolver
(#938) - Fix RBS::Locator (#930)
- Trying to preserve more locations (#915)
- Add visibility modifier to method definition json (#923, #928)
- Add manifest.yaml for rbs gem (#921)
- Fix Environment type checking (#929)
- Fix memory violation in C extension (#952)
- Fix warnings in C extension (#954)
rbs prototype
rbs collection
- Fix error message to tell gem name when source is not found (#927)
Miscellaneous
- Fix
bin/sort
for constants (#919) - Use actions/checkout@v3 (#944)
- Added actions ecosystem for dependabot (#946)
- Confirm RDoc is up to date (#945)
2.2.2 (2022-02-22)
Signature updates
2.2.1 (2022-02-22)
Library changes
- Let
validate_type_alias
run without an error on unknown type (#912)
2.2.0 (2022-02-22)
RBS
2.2 ships with a new syntax to specify the visibility of a method per definition bases.
class Foo
private def hello: () -> void
private attr_accessor world: String
end
It also changes the semantics of self?
method.
It defines both public singleton method and private instance method, which is equivalent to module_function
.
Signature updates
Language updates
Library changes
- Add c99 flag for compiling on Ruby 2 (#895)
- Fix incorrect URI reference in
schema/typeParam.json
(#891) - Allow scaffolding below namespace (#894)
- Let
Writer
preserve format (#900) - Reduce memory usage of
::RBS::Buffer
(#907) - Do not call
#class
from#hash
to improve performance (#906) - Skip type variable validation if
unchcked
(#909)
Miscellaneous
- Add
Thread::Backtrace
andThread::Backtrace::Location
test (#896) - Test annotations (#902)
- Remove goodcheck rule for arglists section (#901)
- Remove
CharScanner
due to no longer used (#905)
2.1.0 (2022-02-02)
RBS 2.1 is a release to deliver the types and documents of the new and updated methods of Ruby 3.1.
Signature updates
- Documents imported from Ruby 3.1 (#881)
- Methods/classes updated in Ruby 3.1 (#886)
- io/wait (#865)
- json (#863)
- nkf (#873)
- openssl (#866)
Dir.exists?
,FileTest#exists?
(#884)FileTest
(#880)Gem::Version#<=>
(#869)Process.clock_gettime
(#858)
Library changes
- Introduce
rbs annotate
command (#881) - Make prototype rb to be aware of prepend (#861)
- Fixes incorrect "Invalid Variance" error when method type variable shadows outer type variable (#889)
2.0.0 (2021-12-24)
Bounded Generics
RBS 2.0 ships with bounded generics, which improves the expressiveness of the language by adding a new syntax to define constraints on type parameters.
class PrettyPrint[T < _Output]
interface _Output
def <<: (String) -> void
end
attr_reader output: T
def initialize: (T output) -> void
end
This is the motivating example I found in the prettyprint library.
The #initialize
receives a object of type T
and it must have #<<
method.
This is defined with < _Output
syntax in the example.
It means T
has to be compatible with _Output
interface.
PrettyPrint[String]
is okay, but PrettyPrint[Integer]
is a type error.
See the PR for details.
RBS Collection manager
RBS Collection feature is generally available on RBS 2.0. In short, it is Bundler for RBS. You can manage RBSs of standard libraries and third party gems with rbs collection
subcommand.
$ rbs collection init
created: rbs_collection.yaml
# The `install` command set up RBS files and creates `rbs_collection.lock.yaml` file
$ rbs collection install
Installing actionpack:6.0 (actionpack@ce6664cec73)
(...snip...)
Using tsort:0 (/path/to/rbs-2.0.0/stdlib/tsort/0)
It's done! 21 gems' RBSs now installed.
# Now you can use `rbs`, `typeprof` and `steep` commands with the dependencies out of the box!
$ rbs validate
$ typeprof app.rb
$ steep check
RBS 2.0 also introduces manifest.yaml
to declare the dependencies from your gems to standard libraries explicitly.
See [the documentation]) for more information.
Breaking changes
This version contains a bug fix, which potentially breaks the compatibility with older versions. The super class names in class definitions are now resolved in outer context. It was an incompatibility with Ruby and this PR fixed the problem.
Signature updates
Language updates
Library changes
- Add
manifest.yaml
for collection to specify stdlib dependencies (#808) - Remove experimental warning of
rbs collection
(#855) - Add the utility
#map_type
methods (#841)
1.8.1 (2021-12-13)
Library changes
1.8.0 (2021-12-02)
RBS 1.8.0 ships with a language feature enhancement, generic type alias. You can define a type alias with type parameters now.
type list[T] = [T, list[T]] | nil # Defines a list of type T
type int_list = list[Integer] # List of Integer
type string_list = list[String] # List of String
You can find the detail in the PR.
Signature updates
Language updates
- Generic type alias (#823)
1.7.1 (2021-11-18)
Signature updates
Thread#value
(#824)
Library changes
Miscellaneous
- Use
untyped
as an expectation of return value ofIO#ready?
in test (#828)
1.7.0 (2021-11-11)
This version replaces ::RBS::Parser
implementation from pure Ruby code based on Racc to C extension.
It improves the RBS file parsing performance up to 5 times faster. :rocket:
- There are some incompatibilities to drop obsolete syntax rules:
super
keyword andany
type are no longer supported. - re2c is used to generate lexical generator.
When you want to change the parser/lexer, change the files under ext/rbs_extension
directory and run rake compile
to compile the extension.
Signature updates
- io/console (#783)
ENV
-- Note that it introduces a dummy::ENVClass
class, which is not defined in Ruby. (#812)Net::HTTPRequest
(#784)#clone
(#811, #813)Kernel#BigDecimal
(#817)Tempfile.new
,Tempfile.create
(#792, #791)
Library changes
- Replace
::RBS::Parser
(#788, #789) - Fix unexpected
CollectionNotAvailable
withoutgems
from git source (#795) - Print deprecation warning (#801)
- Make
Parser::KEYWORDS
a hash (#804) - Use partial clone for
rbs collection
installer (#805) - Respect logger level for test/setup logger (#819, #822)
Miscellaneous
- Avoid a mixture of
Array#filter
andArray#select
(#820) - Remove leftover documentation about
super
(#807)
1.6.2 (2021-09-09)
Signature updates
Miscellaneous
- Set
$XDG_CACHE_HOME
during test (#781)
1.6.1 (2021-09-05)
This is a minor release including test fixes.
Miscellaneous
- Fix stdlib test for
Resolv::Hosts
by removing/etc/hosts
dependency (#779) - Fix bundler related test for test-bundled-gems (#778)
1.6.0 (2021-09-05)
This release includes a preview of rbs collection
commands, which is bundler for RBS.
The command helps you manage RBS files from gem_rbs_collection or other repositories.
This feature is a preview, and any feedback is welcome!
Signature updates
- objspace (#763, #776)
- tempfile (#767, #775)
IO#set_encoding_by_bom
(#106)OpenSSL::PKey::EC#dh_compute_key
(#775)
Library changes
Miscellaneous
- Let
bin/annotate-with-rdoc
process nested constants/classes (#766, #768) - Stop printing version mismatch message in CI (#777)
- Update Steep and fix type errors (#770, #774)
- Add dependabot configuration (#771)
1.5.1 (2021-08-22)
Miscellaneous
- Fix Net_HTTP_test (#759)
1.5.0 (2021-08-22)
This release includes stdlib signature updates.
Signature updates
- digest (#744, #757)
- io-wait (#756, #758)
Ractor
(#755)File::Stat#size?
(#754)$-i
,$0
,$PROGRAM_NAME
(#753)
1.4.0 (2021-08-19)
This release includes feature enhancements including recursive type
definition validation, improved compatibility of global variable names, and various method type updates.
Signature updates
- openssl (#743)
Array
,Enumerator
,Enumerable
,Hash
,FalseClass
,Float
,Hash
,Integer
,Object
,Range
,TrueClass
(#728)Array#[]
(#732)Exception#set_backtrace
(#738)Kernel#Array
(#733)Kernel#spawn
(#748)Kernel#String
(#745, #751)URI::Generic#fragment
(#752)URI::Generic#merge
(#746)
Language updates
- Add global variables signature (#749)
Library changes
- Add Recursive type alias definition validation (#719)
- Generate included modules with complete name (#731)
- Fix
rbs-prototype-rb
error when multi assign with const (#740)
1.3.3 (2021-07-28)
This release includes a minor update of resolv
library RBS and a fix of test for ruby/ruby
CI.
Signature updates
- resolv (#726)
1.3.2 (2021-07-23)
This release is to fix a bug introduced by parser update in 1.3.0.
- Fix parser to accept alias names starting with
_
(#723)
1.3.1 (2021-07-21)
This release is to fix a bug introduced by parser update in 1.3.0.
- Fix parser to accept param names starting with
_
(#721)
1.3.0 (2021-07-20)
Summary
RBS 1.3.0 includes bug fixes of the parser and class/module definition validations.
Signature updates
- dbm (#718)
- net-http (#686)
- optparse (#693)
- resolv (#697)
- socket (#699)
IO
(#698)Marshal
(#684)Mutex
(#683)Array#shift
(#707)BasicObject#method_missing
(#707, #710)Kernel#caller
(#705)
Library changes
- Interface names starting with lower case characters are now syntax error (#678, #720)
- Mixins of classes are rejected (#681)
- Generate prototype of
initialize
method with return typevoid
(#685) - Let
prototype runtime
generate class/module declarations in nested syntax (#700) - Fix race condition for multi-thread support (#702)
Miscellaneous
- Add new doc
docs/rbs_by_example.md
(#694)
1.2.1 (2021-05-27)
This release includes the following minor changes:
- Fix test to run the tests in ruby repository. (#679)
- Remove unnecessary files from the gem package. (#675)
- Suppress unused variable warning (#674)
- Update documents (#672)
1.2.0 (2021-04-21)
Summary
RBS 1.2 ships with better support for AST/token locations and Locator
utility class. The AST objects now keep the locations of tokens. The Locator
class is to translate the text position (line and column) to semantic object at the location. The class allows to find if a text position is on the class name of a class declaration.
Signature updates
- Hash (#631, #632, #637, #638, #639, )
- Module (#645)
- Enumerable (#647)
- Array (#648)
- Proc (#649)
- Struct (#650, #668)
- Thread (#651)
- Random (#669)
- Shellwords (#665)
- IO (#659)
Language updates
- Module self type syntax update (#653)
Library changes
Miscellaneous
1.1.1 (2021-03-12)
Signature updates
- rubygem (#630)
1.1.0 (2021-03-08)
Summary
Errors are now organized by ::RBS::BaseError
, ::RBS::ParsingError
, ::RBS::LoadingError
, and ::RBS::DefinitionError
.
The library users can rescue RBS related errors with ::RBS::BaseError
, parsing errors with ::RBS::ParsingError
, and other errors with ::RBS::LoadingError
and RBS::DefinitionErrors
.
Updating a part of environments are supported. Library users can remove declarations read from a set of files, adding new declarations, running name resolution related to the new decls, and deleting DefinitionBuilder
caches related to the changes.
See RBS::Environment#reject, RBS::Environment#resolve_type_names, ::RBS::AncestorGraph
, and RBS::DefinitionBuilder#update.
RBS::DefinitionBuilder#build_singleton now returns definitions containing instance
type, which had returned resolved class instance types. This is a breaking change, but we consider it a bug fix because RBS::DefinitionBuilder#build_instance has returned instance
types and #build_singleton
has returned class
type.
Signature updates
Language updates
- Allow trailing comma for Record and Tuple types (#606)
Library changes
- Allow partial update of RBS declarations (#608, #621)
- Let errors have
TypeName
(#611) - Add
Parser::LexerError
(#615) - Performance improvement (#617, #620)
- No substitute
instance
types on#build_singleton
(#619)
Miscellaneous
- Make racc name customizable by
RACC
environment variable (#602) - Suppress warnings (#624)
- Remove needless
Gem::Version
polyfill (#622)
1.0.6 (2021-02-17)
1.0.5 (2021-02-13)
- Signature Updates
- Rename generic class parameters on re-open (#594)
- Make
refute_send_type
check that method call doesn't match with types in RBS (#588)
1.0.4 (2021-01-31)
- Unbundle
rr
to run test inruby/ruby
repo (#585)
1.0.3 (2021-01-28)
- Set up
#ancestors
and#location
ofRecursiveAncestorError
(#583)
1.0.2 (2021-01-28)
- Signature Updates
- Kernel(#582)
1.0.1 (2021-01-27)
- Signature Updates
- Renew test sample code (#581)
- Add description to
generate:stdlib_test
Rake task (#578) - Declare supported ruby version >= 2.6 (#548)
- Fix module self-type override (#577)
- Fix parser to support all operator symbols (#550)
- Migrate from Minitest to Test::Unit (#556)
- Fix type alias parsing (#565)
- Support end-less method definition in
prototype rb
(#561) - Support method argument forwarding in
prototype rb
(#560)
1.0.0 (2020-12-24)
- Signature updates for
URI
,IO
,File
,Pathname
,Module
, andTime
(#529, #521, #520, #511, #517, #542, #546, #540, #538) rbs prototype runtime
generatesextend
s (#535)rbs prototype runtime
stability improvements (#533, #526)rbs prototype rb
compatibility improvements (#545)- Implement method names escape in
::RBS::Writer
(#537) - Improve runtime type checker compatibility (#532, #528, #547)
- Fix
ruby2_keywords
forProc
in Ruby <2.7 (#513) - Better compatibility for record type attribute names (#525, #524)
- Let module self-types be classes (#523)
- Delete
extension
syntax (#543) - Method resolution improvements about
alias
and.new
(#522, #519, #516) - Better message for
DuplicatedMethodDefinitionError
(#539)
0.20.1 (2020-12-06)
- Make the order of RBS load reproducible (#508)
0.20.0 (2020-12-06)
- Signature updates for
TSort
,DBM
,Time
, andHash
(#496, #497, #499, #507) - Add singleton attribute syntax (#502, #506, #505)
- Proc types with blocks (#503)
- Add support for escape sequences in string literal types (#501)
- Fix runtime type checking of blocks with keyword args (#500)
0.19.0 (2020-12-02)
0.18.1 (2020-12-01)
- Fix
EnvironmentWalker#each_type_name
(#494)
0.18.0 (2020-12-01)
- Signature updates for
YAML
,ObjectSpace
, andSingleton
(#408, #477, #482) prototype rb
improvements (#492, #487, #486, #481)- Runtime type checker improvements (#488, #489, #490)
- Update
DependencyWalker
API to receive Node objects instead ofTypeName
(#484) - Assume encoding of RBS files to be UTF-8 (#493)
0.17.0 (2020-11-14)
- Signature updates for
Enumerable
,Hash
, andTSort
(#462, #468, #471, #472, #473, #474) - Parser error handling improvement (#463, #475)
- Hash spread syntax handling improvement with
prototype rb
(#465)
0.16.0 (2020-11-05)
0.15.0 (2020-11-02)
- Signature updates for
Kernel
,PStore
,Enumerable
, andArray
(#450, #443, #438, #437, #433, #432) - Add helper interfaces (#434, #428)
- Change
bool
type semantics (#456) - Support alias in
rbs prototype rb
(#457) - Runtime testing improvements (#455, #447, #444, #431)
- Fix proc type parsing (#451)
- Fix type variable parsing (#442)
0.14.0 (2020-10-17)
0.13.1 (2020-10-09)
- Fix test for CI of ruby/ruby (#412)
0.13.0 (2020-10-09)
0.12.2 (2020-09-17)
- Minor signature update for
pty
- Fix
PTY
stdlib test
0.12.1 (2020-09-16)
This version is to improve Ruby 3 testing compatibility. Nothing changed for users.
0.12.0 (2020-09-15)
- Signature updates for
forwardable
,struct
,set
,URI::Generic
,URI::File
, andBigDecimal
. - Define
.new
methods frominitialize
included from modules #390
0.11.0 (2020-08-31)
- Signature update for
date/datetime
#367 - Add test double support for runtime type checker #380
- Add
rbs test
command for runtime type checking #366 - Fix runtime type checking for record types #365
- Improve EnvironmentLoader API #370
- Allow overloading from super methods #364
0.10.0 (2020-08-10)
- Signature update for
Zlib
- Make "no type checker installed" message a debug print #363
- Print
...
for overloading method definitions #362 - Allow missing method implementation in Ruby code #359
- Runtime testing improvements #356
0.9.1 (2020-08-04)
0.9.0 (2020-08-03)
0.8.0 (2020-08-01)
- Signature updates for
Enumerator
andPTY
- Fix prototype rb/rbi error handling #349
- Runtime test improvements #344, #343
- Add
...
syntax #342
0.7.0 (2020-07-20)
- Add
DefinitionBuilder#one_instance_ancestors
andDefinitionBuilder#one_singleton_ancestors
#341 - Bug fix in ConstantTable #340
- Make
rbs validate
faster #338 - Dedup methods generated by
rbs prototype rb
#334
0.6.0 (2020-07-12)
- Signature update for
Logger
. - Clean
Environment#inspect
. #331 - Module self type syntax update. #329
- Better validation. #328
- Parser performance improvement. #327
- Runtime type checking performance improvements with sampling #323
0.5.0 (2020-07-04)
- Signature updates for
Mutex_m
,IO
, andEnumerable
. - Syntax update. #307
- AST command prints absolute type names with file name filtering. #312
- Improve CLI message. #309
0.4.0 (2020-06-15)
- Signature update for
Fiber
,Encoding
, andEnumerator
. - Fix syntax error for underscore and
!
?
#304 - Improved return type inference in
rbs prototype rb
#303 - Skip anonymous modules/classes in
rbs prototype runtime
#302 - Fix
--require-relative
option inrbs prototype runtime
#299 - Add JSON schema for
rbs ast
#295
0.3.1 (2020-05-22)
- Fix constant resolution again #289
0.3.0 (2020-05-20)
- Fix constant resolution #288
0.2.0
- The first release of RBS gem.
0.1.0
- Version 0.1.0 is the original
rbs
gem and it is different software from RBS.