Opal v1.4.0 Release Notes
Release Date: 2021-12-24 // over 2 years ago-
โ Added
- Implement
chomp:
option forString#each_line
and#lines
(#2355) - ๐ Ruby 3.1 support and some older Ruby features we missed (#2347)
- Use parser in 3.1 mode to support new language-level features like hashes/kwargs value omission, the pin operator for pattern matching
Array#intersect?
String#strip
andString#lstrip
to also remove NUL bytesInteger.try_convert
public
,private
,protected
,module_function
now return their argumentsClass#descendants
,Class#subclasses
- (<=1.8)
Kernel#local_variables
- (<=2.3) Set local variables for regexp named captures (
/(?<b>a)/ =~ 'a'
=>b = 'a'
) - Remove deprecated
NIL
,TRUE
,FALSE
constants String#unpack
andString#unpack1
to support anoffset:
kwargMatchData#match
,MatchData#match_length
- Enumerable modernization
Enumerable#tally
to support an optional hash accumulatorEnumerable#each_{cons,slice}
to return selfEnumerable#compact
Refinement
becomes its own class nowStruct#keyword_init?
- (pre-3.1) Large Enumerator rework
- Introduce
Enumerator::ArithmeticSequence
- Introduce
Enumerator::Chain
- Introduce
Enumerator#+
to createEnumerator::Chain
s Enumerator#{rewind,peek,peek_values,next,next_values}
- Improve corelib support for beginless/endless ranges and
ArithmeticSequences
String#[]
,Array#[]
,Array#[]=
,Array#fill
,Array#values_at
Range#step
andNumeric#step
return anArithmeticSequence
whenNumeric
values are in play- Introduce
Range#%
Enumerator::Yielder#to_proc
- Fix #2367
- (2.7)
UnboundMethod#bind_call
- (Opal)
{Kernel,BasicObject}#{inspect,p,pp,method_missing}
may work with JS native values now, also they now correctly report cycles Enumerable#sum
uses Kahan's summation algorithm to reduce error with floating point valuesFile.dirname
supports a newlevel
argument
- ๐ Vendor in
optparse
andshellwords
(#2326) - ๐ Preliminary support for compiling the whole
bin/opal
with Opal (#2326)
๐ Fixed
- ๐ Fix coertion for
Array#drop
(#2371) - ๐ Fix coertion for
File.absolute_path
(#2372) - ๐ Fix some
IO#puts
edge cases (no args, empty array, nested array, โฆ) (#2372) - Preserve UNC path prefix on File.join (#2366)
- Methods on
Kernel
,BasicObject
,Boolean
will never return boxed values anymore (#2293)false.tap{}
will now correctly return a JS value offalse
, notObject(false)
- ๐ opal-parser doesn't break on
<<~END
strings anymore (#2364) - ๐ Fix error reporting at the early stage of loading (#2326)
๐ Changed
- โก๏ธ Various outputted code size optimizations - 19% improvement for minified unmangled AsciiDoctor bundle - see: https://opalrb.com/blog/2021/11/24/optimizing-opal-output-for-size/ (#2356)
- ๐ Second round of code size optimizations - 3% improvement for AsciiDoctor bundle on top of the first round - 23% total - see: https://github.com/opal/opal/pull/2365/commits (#2365)
- The calls to
==
,!=
and===
changed their semantics slightly: it's impossible to monkey patch those calls forString
andNumber
, but on other classes they can now returnnil
and it will be handled correctly - The calls to
!
changed their semantics slightly: it's impossible to monkey patch this call forBoolean
orNilClass
.
- The calls to
- ๐จ Refactored the structure of the internal
stdlib/nodejs
folder (#2374)- Added
nodejs/base
with just I/O, exit, and ARGV management - Moved
Process::Status
to corelib - Fixed requires to be more robust
- Added
โ Removed
- โ Removed
nodejs/irb
from stdlib as it's been broken for some time (#2374) - โ Removed
Kernel#node_require
fromnodejs/kernel
as it's been deprecated for a long time (#2374)
<!--
๐ Deprecated
Internal
-->
- Implement