rbs 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitattributes +1 -0
- data/.github/dependabot.yml +1 -1
- data/.github/workflows/bundle-update.yml +3 -3
- data/.github/workflows/c-check.yml +2 -2
- data/.github/workflows/changelog.yml +121 -0
- data/.github/workflows/comments.yml +2 -2
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/jruby.yml +4 -9
- data/.github/workflows/release-gems.yml +234 -0
- data/.github/workflows/ruby.yml +6 -6
- data/.github/workflows/rust.yml +12 -12
- data/.github/workflows/truffleruby.yml +2 -2
- data/.github/workflows/typecheck.yml +2 -2
- data/.github/workflows/wasm.yml +3 -3
- data/.github/workflows/windows.yml +2 -2
- data/.rubocop.yml +0 -1
- data/CHANGELOG.md +83 -0
- data/README.md +1 -1
- data/Rakefile +443 -86
- data/config.yml +7 -0
- data/core/io.rbs +2 -1
- data/docs/CONTRIBUTING.md +1 -1
- data/docs/release.md +265 -31
- data/docs/stdlib.md +8 -0
- data/docs/syntax.md +12 -0
- data/ext/rbs_extension/ast_translation.c +15 -0
- data/ext/rbs_extension/class_constants.c +2 -0
- data/ext/rbs_extension/class_constants.h +1 -0
- data/ext/rbs_extension/main.c +55 -19
- data/include/rbs/ast.h +25 -17
- data/include/rbs/defines.h +8 -3
- data/include/rbs/lexer.h +13 -12
- data/include/rbs/parser.h +37 -3
- data/lib/rbs/ast/declarations.rb +1 -1
- data/lib/rbs/ast/type_param.rb +1 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +8 -5
- data/lib/rbs/definition_builder/method_builder.rb +4 -4
- data/lib/rbs/definition_builder.rb +5 -2
- data/lib/rbs/environment/class_entry.rb +12 -0
- data/lib/rbs/environment/module_entry.rb +26 -1
- data/lib/rbs/parser_aux.rb +2 -2
- data/lib/rbs/prototype/helpers.rb +19 -52
- data/lib/rbs/prototype/runtime/value_object_generator.rb +0 -1
- data/lib/rbs/prototype/runtime.rb +1 -1
- data/lib/rbs/types.rb +44 -2
- data/lib/rbs/unit_test/type_assertions.rb +5 -5
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/wasm/parser.rb +62 -25
- data/lib/rbs/wasm/runtime.rb +19 -4
- data/lib/rbs/wasm/serialization_schema.rb +3 -2
- data/rbs.gemspec +1 -5
- data/schema/function.json +12 -1
- data/sig/environment/class_entry.rbs +6 -0
- data/sig/environment/module_entry.rbs +15 -0
- data/sig/parser.rbs +4 -4
- data/sig/types.rbs +11 -1
- data/sig/unit_test/type_assertions.rbs +2 -2
- data/src/ast.c +19 -3
- data/src/lexer.c +1562 -1560
- data/src/lexer.re +50 -18
- data/src/lexstate.c +2 -1
- data/src/parser.c +136 -73
- data/src/serialize.c +20 -13
- data/src/util/rbs_encoding.c +195 -49
- data/stdlib/erb/0/erb.rbs +4 -4
- data/stdlib/monitor/0/monitor.rbs +4 -4
- data/stdlib/singleton/0/singleton.rbs +3 -0
- data/stdlib/stringio/0/stringio.rbs +2 -1
- data/stdlib/zlib/0/gzip_file.rbs +1 -1
- data/stdlib/zlib/0/gzip_writer.rbs +2 -1
- data/wasm/README.md +53 -4
- data/wasm/rbs_wasm.c +93 -37
- metadata +6 -4
- data/.github/workflows/milestone.yml +0 -91
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 4.2.0 (2026-08-23)
|
|
4
|
+
|
|
5
|
+
RBS 4.2 accepts non-ASCII characters in identifiers. Method names, instance variable names and parameter names can be written in any script, and other names may contain non-ASCII characters as long as they start with an ASCII letter, which is what tells a constant from a method name.
|
|
6
|
+
|
|
7
|
+
```rbs
|
|
8
|
+
class Greeter
|
|
9
|
+
@挨拶: String
|
|
10
|
+
|
|
11
|
+
def こんにちは: () -> String
|
|
12
|
+
end
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The parser and the AST support Ruby-style `...` forwarding parameters in method types, but the layers built on top of the parser do not yet. The syntax is disabled by default in 4.2 and is not enabled by the public `RBS::Parser` API, so it cannot be used in regular RBS signatures yet.
|
|
16
|
+
|
|
17
|
+
Ruby 3.2 reached EOL on 2026-04-01, and this release requires Ruby 3.3 or later. Applications on 3.2 stay on the 4.1 line.
|
|
18
|
+
|
|
19
|
+
### Signature updates
|
|
20
|
+
|
|
21
|
+
**Updated classes/modules/methods:** `ERB`, `ERB::DefMethod`, `IO`, `Monitor`, `MonitorMixin::ConditionVariable`, `Singleton`, `StringIO`, `Zlib::GzipFile`, `Zlib::GzipWriter`
|
|
22
|
+
|
|
23
|
+
* Replace deterministic `untyped` return types with concrete types ([#2966](https://github.com/ruby/rbs/pull/2966))
|
|
24
|
+
* Declare Singleton::SingletonInstanceMethods ([#3037](https://github.com/ruby/rbs/pull/3037))
|
|
25
|
+
|
|
26
|
+
### Language updates
|
|
27
|
+
|
|
28
|
+
* Gate forwarding parameter syntax behind parser option ([#3087](https://github.com/ruby/rbs/pull/3087))
|
|
29
|
+
* Support non-ASCII identifiers ([#3082](https://github.com/ruby/rbs/pull/3082))
|
|
30
|
+
* Support forwarding parameters in method types ([#3042](https://github.com/ruby/rbs/pull/3042))
|
|
31
|
+
|
|
32
|
+
### Library changes
|
|
33
|
+
|
|
34
|
+
* Drop runtime support for Ruby 3.2 ([#3095](https://github.com/ruby/rbs/pull/3095))
|
|
35
|
+
* Stop the lexer reading past the end of a byte_range ([#3040](https://github.com/ruby/rbs/pull/3040))
|
|
36
|
+
* Exclude CR from comment tokens to fix an off-by-one Location#end_line on CRLF files ([#3069](https://github.com/ruby/rbs/pull/3069))
|
|
37
|
+
* Handle the NULL parser in the WebAssembly shim ([#3085](https://github.com/ruby/rbs/pull/3085))
|
|
38
|
+
* Reject a byte position the lexer cannot start on ([#3083](https://github.com/ruby/rbs/pull/3083))
|
|
39
|
+
* Don't use Clang nullability qualifiers in strict ISO C mode ([#3074](https://github.com/ruby/rbs/pull/3074))
|
|
40
|
+
* Avoid eagerly inspecting call traces in type assertions ([#3073](https://github.com/ruby/rbs/pull/3073))
|
|
41
|
+
* Fix TypeParam.rename to substitute variables in bounds and default types ([#3068](https://github.com/ruby/rbs/pull/3068))
|
|
42
|
+
* Extract per-declaration type param alignment into entry-level align_params ([#3070](https://github.com/ruby/rbs/pull/3070))
|
|
43
|
+
* Align type params across declarations in module-self types and superclass validation ([#3067](https://github.com/ruby/rbs/pull/3067))
|
|
44
|
+
* Build the wasm module with -DNDEBUG ([#3066](https://github.com/ruby/rbs/pull/3066))
|
|
45
|
+
* Rename NODISCARD macro to RBS_NODISCARD ([#3065](https://github.com/ruby/rbs/pull/3065))
|
|
46
|
+
|
|
47
|
+
### Miscellaneous
|
|
48
|
+
|
|
49
|
+
* Omit forwarding parameter tests on JRuby ([#3092](https://github.com/ruby/rbs/pull/3092))
|
|
50
|
+
* Skip JSON 2-only tests with JSON 3 ([#3084](https://github.com/ruby/rbs/pull/3084))
|
|
51
|
+
* Pin GitHub Actions to commit hashes ([#3020](https://github.com/ruby/rbs/pull/3020))
|
|
52
|
+
|
|
53
|
+
## 4.1.3 (2026-08-10)
|
|
54
|
+
|
|
55
|
+
### Miscellaneous
|
|
56
|
+
|
|
57
|
+
* Don't use Clang nullability qualifiers in strict ISO C mode ([#3074](https://github.com/ruby/rbs/pull/3074), Backported in [#3075](https://github.com/ruby/rbs/pull/3075))
|
|
58
|
+
* Avoid eagerly inspecting call traces in type assertions ([#3073](https://github.com/ruby/rbs/pull/3073), Backported in [#3076](https://github.com/ruby/rbs/pull/3076))
|
|
59
|
+
|
|
60
|
+
## 4.1.2 (2026-08-03)
|
|
61
|
+
|
|
62
|
+
### Miscellaneous
|
|
63
|
+
|
|
64
|
+
* Keep GC disabled during GC_test#test_stress_and_stress= ([#3061](https://github.com/ruby/rbs/pull/3061))
|
|
65
|
+
* Fix GC_test#test_enable leaving GC disabled for the rest of the suite ([#3059](https://github.com/ruby/rbs/pull/3059))
|
|
66
|
+
|
|
67
|
+
## 4.1.1 (2026-07-30)
|
|
68
|
+
|
|
69
|
+
### Library changes
|
|
70
|
+
|
|
71
|
+
* Include the trailing `?` in a keyword key's symbol location ([#3043](https://github.com/ruby/rbs/pull/3043))
|
|
72
|
+
* Mark `type_name` as optional on the alias annotations ([#3039](https://github.com/ruby/rbs/pull/3039))
|
|
73
|
+
|
|
74
|
+
### Miscellaneous
|
|
75
|
+
|
|
76
|
+
* Fix template drift for ext/rbs_extension/ast_translation.c ([#3038](https://github.com/ruby/rbs/pull/3038))
|
|
77
|
+
|
|
3
78
|
## 4.1.0 (2026-07-27)
|
|
4
79
|
|
|
5
80
|
RBS 4.1 ships with JRuby support. The RBS parser is written in plain C without depending on the Ruby C API, so it is compiled to WebAssembly and runs on a Wasm runtime, with the parsed AST serialized in a binary format and decoded into RBS objects. The full test suite runs on JRuby in CI.
|
|
@@ -88,6 +163,14 @@ This release also introduces `RBS::Rewriter`, an API to edit RBS source text whi
|
|
|
88
163
|
* ci: skip Gemfile.lock BUNDLED WITH on ruby-head ([#2952](https://github.com/ruby/rbs/pull/2952))
|
|
89
164
|
* Remove `logger` from sig dependencies ([#2904](https://github.com/ruby/rbs/pull/2904))
|
|
90
165
|
|
|
166
|
+
## 4.0.3 (2026-06-18)
|
|
167
|
+
|
|
168
|
+
### Miscellaneous
|
|
169
|
+
|
|
170
|
+
* Fix Ruby CI failure with compressed `Zlib::GzipReader` test fixtures. ([#3005](https://github.com/ruby/rbs/pull/3005))
|
|
171
|
+
* Fix flaky `DirSingletonTest#test_fchdir` and `DirSingletonTest#test_for_fd` under aggressive GC. ([#3005](https://github.com/ruby/rbs/pull/3005))
|
|
172
|
+
* Fix Ruby head CI failure caused by the lockfile-pinned Bundler version. ([#3005](https://github.com/ruby/rbs/pull/3005))
|
|
173
|
+
|
|
91
174
|
## 4.0.2 (2026-03-25)
|
|
92
175
|
|
|
93
176
|
### Library changes
|
data/README.md
CHANGED
|
@@ -196,7 +196,7 @@ Here is a list of some places you can talk with active maintainers.
|
|
|
196
196
|
|
|
197
197
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
198
198
|
|
|
199
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
199
|
+
To install this gem onto your local machine, run `bundle exec rake install`. Releases are cut by the `Release gems` workflow rather than from a working copy -- see [docs/release.md](docs/release.md).
|
|
200
200
|
|
|
201
201
|
### C Code Formatting
|
|
202
202
|
|