- Fix handling nested const patterns. (@palkan)
- Fix loading transpiled in TruffleRuby. (@palkan)
TruffleRuby doesn't support all Ruby 3.0 features yet, so we should treat as an older Ruby.
- Use
ruby2_keywords
when transpiling arguments forwarding. (@palkan)
That makes transpiled code forward compatible with the modern Ruby versions.
- Fix transpiling
rescue
within nested blocks. (@palkan)
This would prevent from auto-transpiling a library every time when no files should be transpiled.
-
Auto-transpile using the current Ruby version. (@palkan)
-
Support Pry. ([@baygeldin][])
-
Add
rescue/ensure/else
within block rewriter for Ruby < 2.5. ([@fargelus][])
- Fix nested find patterns transpiling. (@palkan)
-
Add
Integer.try_convert
. (@palkan) -
Add
Enumerable#compact
,Enumerator::Lazy#compact
. (@palkan) -
[Proposed] Add support for binding instance, class, global variables in pattern matching. (@palkan)
This brings back rightward assignment: 42 => @v
.
-
Add
MatchData#match
. (@palkan) -
Add support for command syntax in endless methods (
def foo() = puts "bar"
) -
Add
Refinement#import_methods
support. (@palkan)
This API only works in conjunction with transpiling, since it couldn't be backported purely as a method and requires passing an additional argument (Binding).
You can find the details in the PR.
-
Added support for instance, class and global variables and expressions for pin operator. (@palkan)
-
Support omitting parentheses in one-line pattern matching. (@palkan)
-
Anonymous blocks
def b(&); c(&); end
(@palkan).
- Revert 0.13.2 and freeze Parser version. (@skryukov)
Postpone upgrade 'till v0.14 due to breaking shorthand hash changes.
- Parser upgrade.
- Fix checking for realpath during $LOAD_PATH setup. (@palkan)
- Added required keyword arguments rewriter. (@palkan)
Required kwargs were introduced in 2.1. Now we make them possible in 2.0.
- Added numeric literals rewriter. (@palkan)
Now it's possible to generate Ruby 2.0 compatible code from 2i + 1/3r
.
- Fixed several safe navigation (
&.
) bugs. (@palkan)
- Use separate namespace for proposed features to avoid conflicts with new Ruby version. (@palkan)
Previously, we used the upcoming Ruby version number for proposed features (e.g., 3.0.0
), which broke
the load path setup, since transpiled files were not loaded anymore.
Now that's fixed by using a virtual version number for proposals (1995.next.0
).
- Extended proposed shorthand Hash syntax to support kwargs as well. (@palkan)
You can try it: x = 1; y = 2; foo(x:, y:) # => foo(x: x, y: y)
.
-
Rewrite mode is used by default in transpiler. (@palkan)
-
Move 3.0 features to stable features. (@palkan)
-
Refactor
a => x
anda in x
to comply with Ruby 3.0. (@palkan)
- Fix Unparser 0.5.0 compatibility. (@palkan)
- Restrict Unparser dependency. (@palkan)
Unparser 0.5.0 is currently not supported.
- Update RuboCop integration to handle the latest Parser changes. (@palkan)
Parser 2.7.1.5 unified endless and normal methods and rightward and leftward assignments, thus, making some cops report false negatives.
- Fix regression when
nextify
produces incorrect files for 2.7. (@palkan)
- Add proposed shorthand Hash syntax. (@palkan)
You can try it: x = 1; y = 2; data = {x, y}
.
- Add leading argument support to args forwarding. (@palkan)
def a(...) b(1, ...); end
.
- Add
Hash#except
. (@palkan)
{a: 1, b: 2}.except(:a) == {b: 2}
- Add find pattern support. (@palkan)
Now you can do: [0, 1, 2] in [*, 1 => a, *c]
.
- Add Ruby 2.2 support. (@palkan)
With support for safe navigation operator (&.
) and squiggly heredocs (<<~TXT
).
- Support passing rewriters to CLI. (@sl4vr)
Use nextify --list-rewriters
to view all available rewriters.
Use nextify
with --rewrite=REWRITERS...
option to specify which particular rewriters to use.
- Keep
ruby-next
version in sync withruby-next-core
. (@palkan)
Require ruby-next-core
of the same version as ruby-next
.
-
Add Ruby 2.3 support. (@palkan)
-
Remove stale transpiled files when running
ruby-next nextify
. (@palkan) -
Add Ruby 2.4 support. (@palkan)
APIs for <2.5 must be backported via backports gem. Refinements are not supported.
- Add right-hand assignment support. (@palkan)
It is real: 13.divmod(5) => a, b
.
- Add endless methods support. (@palkan)
Now you can write def foo() = :bar
.
- Try to auto-transpile the source code on load in
.setup_gem_load_path
if transpiled files are missing. (@palkan)
This would make it possible to install gems from source if transpiled files do not exist in the repository.
- Use
./.rbnextrc
to define CLI args. (@palkan)
You can define CLI options in the configuration file to re-use them between environments or simply avoid typing every time:
# .rbnextrc
nextify: |
--transpiler-mode=rewrite
--edge
Previously, we let Parser to raise its Parser::SyntaxError
but some exceptions
are not reported by Parser and should be handled by transpiler (and we raised SyntaxError
in that case, as MRI does).
This change unifies the exceptions raised during transpiling.
- Changed the way edge/proposed features are activated. (@palkan)
Use --edge
or --proposed
flags for ruby-next nextify
or
require "ruby-next/language/{edge,proposed}"
in your code.
See more in the Readme.
- Updated RuboCop integration. (@palkan)
Make sure you use TargetRubyVersion: next
in your RuboCop configuration.
- Upgraded to
ruby-next-parser
for edge features. (@palkan)
It's no longer needed to use Parser gem from Ruby Next package registry.
- Enhance logging. (@palkan)
Use RUBY_NEXT_WARN=false
to disable warnings.
Use RUBY_NEXT_DEBUG=path.rb
to display the transpiler output only for matching files
in the runtime mode.
- Add RuboCop integration. (@palkan)
Adds support for missing node types and fixes some bugs with 2.7.
- Add
rewrite
transpiler mode. (@palkan)
Add support for rewriting the source code instead of rebuilding it from scratch to preserve the original layout and improve the debugging experience.
- Optimize pattern matching transpiled code. (@palkan)
For array patterns, transpiled code is ~1.5-2x faster than native. For hash patterns it's about the same.
-
Pattern matching is 100% compatible with RubySpec. (@palkan)
-
Add
Symbol#start_with?/end_with?
. (@palkan)
-
Add
Time#floor
andTime#ceil
. (@palkan) -
Add
UnboundMethod#bind_call
. (@palkan) -
Add
String#split
with block. (@palkan) -
Check for native method implementation to activate a refinement. (@palkan)
Add a method refinement to using RubyNext
even if the backport is present. That
helps to avoid the conflicts with invalid monkey-patches.
- Add
ruby-next core_ext
command. (@palkan)
This command allows generating custom core extension files. Meant to be used in
alternative Ruby implementations (mruby, Opal, etc.) not compatible with the ruby-next-core
gem.
- Add
ruby-next/core_ext
. (@palkan)
Now you can use core extensions (monkey-patches) instead of the refinements.
-
Check whether pattern matching target respond to
#deconstruct
/#deconstruct_keys
. (@palkan) -
Fix
Struct#deconstruct_keys
to respect passed keys. (@palkan)
Add require "ruby-next/language/bootsnap"
after setting up Bootsnap
to transpile the files on load (and cache the resulted iseq via Bootsnap as usually).
- Do not patch
eval
and friends when using runtime mode. (@palkan)
Eval support should be enabled explicitly via the RubyNext::Language::Eval
refinement, 'cause we cannot handle all the edge cases easily (e.g., the usage caller's binding locals).
- Revoke method reference support. (@palkan)
You can still use this feature by enabling it explicitly (see Readme).
- Support in modifier. (@palkan)
{a: 1, b: 2} in {a:, **}
p a #=> 1
-
Add pattern matching. (@palkan)
-
Add numbered parameters. (@palkan)
-
Add arguments forwarding. (@palkan)
-
Add
Enumerable#filter_map
. (@palkan) -
Add
Enumerable#filter/filter!
. (@palkan) -
Add multiple arguments support to
Hash#merge
. (@palkan) -
Add
Array#intersection
,Array#union
,Array#difference
. (@palkan) -
Add
Enumerable#tally
. (@palkan) -
Implement gem integration flow. (@palkan)
- Transpile code via
ruby-next nextify
. - Setup load path via
RubyNext::Language.setup_gem_load_Path
.
- Transpile code via
-
Add
ruby-next nextify
command. (@palkan) -
Add endless Range support. (@palkan)
-
Add method reference syntax support. (@palkan)
-
Add
Proc#<<
andProc#>>
. (@palkan) -
Add
Kernel#then
. (@palkan)