All Versions
75
Latest Version
Avg Release Cycle
70 days
Latest Release
977 days ago

Changelog History
Page 1

  • v1.5.1 Changes

    July 20, 2022

    ๐Ÿ›  Fixed

    • ๐Ÿ‘‰ Make Time.new not depend on Date.prototype.getTimezoneOffset() (#2426)
    • ๐Ÿ›  Fix exception during Hash#each_value if keys get deleted during loop (#2427)
    • Fix scan_until and check_until implementation of StringScanner (#2420)
  • v1.5.0 Changes

    April 13, 2022

    โž• Added

    ๐Ÿ”„ Changed

    ๐ŸŽ Performance

    • โš™ Runtime optimization by @hmdne in https://github.com/opal/opal/pull/2383
      • Improve performance of argument coertion, fast-track Integer, String, and calling the designed coertion method
      • Optimize Array#[]= by moving the implementation to JavaScript and inlining type checks
      • Optimize internal runtime passing of block-options
    • Compile case statements as switch whenever possible by @hmdne in https://github.com/opal/opal/pull/2411
    • ๐Ÿ‘Œ Improve performance with optimized common method/iter implementation shortcuts by @hmdne in https://github.com/opal/opal/pull/2401

    ๐Ÿ›  Fixed

    Internal

  • v1.4.1 Changes

    January 12, 2022

    ๐Ÿ”„ Changed

    • PromiseV2 is now declared a stable interface!

    ๐Ÿ›  Fixed

    • Args named with JS reserved words weren't always renamed when zsuper was involved (#2385)

    <!--

    โž• Added

    โœ‚ Removed

    ๐Ÿ—„ Deprecated

    Internal

    -->

  • v1.4.0 Changes

    December 24, 2021

    โž• Added

    • Implement chomp: option for String#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 and String#lstrip to also remove NUL bytes
      • Integer.try_convert
      • public, private, protected, module_function now return their arguments
      • Class#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 and String#unpack1 to support an offset: kwarg
      • MatchData#match, MatchData#match_length
      • Enumerable modernization
      • Enumerable#tally to support an optional hash accumulator
      • Enumerable#each_{cons,slice} to return self
      • Enumerable#compact
      • Refinement becomes its own class now
      • Struct#keyword_init?
      • (pre-3.1) Large Enumerator rework
      • Introduce Enumerator::ArithmeticSequence
      • Introduce Enumerator::Chain
      • Introduce Enumerator#+ to create Enumerator::Chains
      • 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 and Numeric#step return an ArithmeticSequence when Numeric 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 values
      • File.dirname supports a new level argument
    • ๐Ÿ“œ Vendor in optparse and shellwords (#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 of false, not Object(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 for String and Number, but on other classes they can now return nil and it will be handled correctly
      • The calls to ! changed their semantics slightly: it's impossible to monkey patch this call for Boolean or NilClass.
    • ๐Ÿ”จ 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

    โœ‚ Removed

    • โœ‚ Removed nodejs/irb from stdlib as it's been broken for some time (#2374)
    • โœ‚ Removed Kernel#node_require from nodejs/kernel as it's been deprecated for a long time (#2374)

    <!--

    ๐Ÿ—„ Deprecated

    Internal

    -->

  • v1.3.2 Changes

    November 10, 2021

    ๐Ÿ›  Fixed

    • ๐Ÿ“š Update documentation (#2350)
    • ๐Ÿ›  Fix IO#gets getting an extra char under some circumstances (#2349)
    • Raise a TypeError instead of UndefinedMethod if not a string is passed to __send__ (#2346)
    • Do not modify $~ when calling String#scan from internal methods (#2353)
    • Stop interpreting falsey values as a missing constant in Module#const_get (#2354)
  • v1.3.1 Changes

    November 03, 2021

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix REPL if bundler environment isn't set (#2338)
    • ๐Ÿ›  Fix Chrome runner if bundler environment isn't set and make it work on other Unixes (#2339)
    • Proc#binding to return a binding if Binding is defined (#2341, #2340)
    • Array#zip to correctly yield (#2342, #1611)
    • String#scan to correctly yield (#2342, #1660)
  • v1.3.0 Changes

    October 27, 2021

    โž• Added

    • โž• Add support for retry (#2264)
    • Modernize Exceptions (#2264)
      • Add #cause, #backtrace_locations, #full_message to Exception
      • Normalize backtraces across platforms
      • Add Thread::Backtrace::Location
      • Output Exception#full_message on uncaught exceptions (#2269)
    • ๐Ÿ‘ TracePoint :class support (#2049)
    • Implement the Flip-Flop operators (#2261)
    • โž• Add JS[] to access properties on the global object (#2259)
    • โž• Add ENV.fetch to the Nodejs implementation of ENV (#2259)
    • 0๏ธโƒฃ Opal::Cache, an optional compiler cache (enabled by default) (#2242, #2278, #2329)
    • Alias for gvars, alias on main (#2270)
    • ๐Ÿ‘Œ Support for GJS (GNOME's JavaScript runtime) runner (#2280)
    • ๐Ÿ‘ Scope variables support for eval() (#2256)
    • โž• Add support for Kernel#binding (#2256)
    • ๐Ÿ‘ A (mostly) correct support for refinements (#2256)
    • โž• Add support for ECMAScript modules with an --esm CLI option (#2286)
    • ๐Ÿ‘ Implement Regexp#names and add named captures support (#2272)
    • REPL improvements: (#2285)
      • Colored output & history support
      • ls to show available constants and variable
    • โž• Add Method#=== as an alias to Method#call, works the same as Proc#=== (#2305)
    • โž• Add IO#gets and IO#read_proc along with other supporting methods (#2309)
      • Support #gets on most platforms, including browsers (via prompt)
      • Move the REPL to a --repl CLI option of the main executable
      • Completely refactor IO, now supporting methods like #each_line throughout the entire IO chain
      • Add a runner for MiniRacer (as miniracer)
      • Support Windows on the Chrome runner
      • Support Windows on the REPL
      • Platforms an IO implementations should either set IO#read_proc or overwrite IO#sysread
    • ๐Ÿ‘ [experimental] Add support for JavaScript async/await (#2221)
      • Enable the feature by adding a magic comment: # await: true
      • The magic comment can be also used to mark specific method patterns to be awaited (e.g. # await: *_await, sleep will make any method ending in _await or named sleep to be awaited)
      • Add Kernel#__await__ as a bridge to the await keyword (inspired by CoffeeScript await support)
      • Require opal/await to get additional support
      • Read more on the newly added documentation page
    • ๐Ÿ‘ Better interoperability between legacy Promise (v1) and native Promise (v2) (#2221)
      • Add PromiseV1 as an alias to the original (legacy) Promise class
      • Add #to_v1 and #to_v2 to both classes
      • Promise#to_n will convert it to a native Promise (v2)
    • โž• Add Opal::Config.esm to enable/disable ES modules (#2316)
      • If Config.esm is enabled, SimpleServer does type="module"
      • Add new rack-esm example
    • โž• Add a QuickJS (https://bellard.org/quickjs/) runner (#2331)
    • โž• Add IO#fileno, Method#curry, Buffer#to_s, Pathname.pwd (#2332)
    • Add NodeJS support for ARGF, ENV.{inspect,to_h,to_hash,merge}, File.{delete,unlink}, Kernel#system, Kernel#`, Process::Status (#2332)
    • Introduce __dir__ support (#2323)
    • ๐Ÿ‘ Full autoload support (#2323)
      • Now compatible with opal-zeitwerk and isomorfeus
      • Allow toplevel autoloads
      • Allow dynamic autoloads (e.g. can be hooked to fetch a URL upon autoload with a custom loader)
      • Allow overwriting require (e.g. like rubygems does)
      • Allow autoloading trees with require_tree "./foo", autoload: true
      • Add Module#autoload?
    • Autoload parts of the corelib (#2323)

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fixed multiple line Regexp literal to not generate invalid syntax as JavaScript (#1616)
    • ๐Ÿ›  Fix Kernel#{throw,catch} along with UncaughtThrowError (#2264)
    • โšก๏ธ Update source-map-support to fix an off-by-one error (#2264)
    • Source map: lines should start from 1, not 0 (#2273)
    • ๐Ÿ‘ Allow for multiple underscored args with the same name in strict mode (#2292)
    • ๐Ÿ‘‰ Show instance variables in Kernel#inspect (#2285)
    • 0.digits was returning an empty array in strict mode (#2301)
    • Non Integer numbers were responding to #digits (#2301)
    • Correctly delete hash members when dealing with boxed strings (#2306)
    • Escape string components in interpolated strings (dstrs) correctly (#2308)
    • Don't try to return the JS debugger statement, just return nil (#2307)
    • Retain the - while stringifying -0.0 (#2304)
    • ๐Ÿ›  Fix super support for rest args and re-assignments with implicit arguments (#2315)
    • ๐Ÿ›  Fix calling Regexp#last_match when $~ is nil (#2328)
    • ๐Ÿ Windows support for chrome runner (#2324)
      • Use correct node separator for NODE_PATH on Windows
      • Pass dir and emulate exec a bit on Windows
      • Use Gem.win_platform?, match supported platform to ruby, simplify run
    • NodeJS: Drop the first -- argument in ARGV (#2332)
    • ๐Ÿ›  Fix Object#require not pointing to Kernel#require (#2323)

    ๐Ÿ”„ Changed

    • Fast-track bad constant names passed to Struct.new (#2259)
    • ๐Ÿ“‡ Renamed internal super related helpers, find_super_dispatcher is now find_super, find_iter_super_dispatcher is now find_block_super (#2090)
    • The opal-repl CLI now requires files to be passed with --require (or -r) instead of the bare filename (#2309)
    • Process is now a Module, not a Class - just like in MRI (#2332)
    • s = StringIO.new("a"); s << "b"; s.string now returns "b", like MRI, but Opal used to return "ab" (#2309)

    Internal

    • ๐Ÿ‘• Switch from jshint to ESLint (#2289)
    • Switch from UglifyJS to Terser (#2318)
    • ๐ŸŽ [CI] Performance regression check (#2276, #2282)
  • v1.2.0 Changes

    July 28, 2021

    โž• Added

    • ๐Ÿ‘Œ Support for multiple arguments in Hash#{merge, merge!, update} (#2187)
    • ๐Ÿ‘Œ Support for Ruby 3.0 forward arguments: def a(...) puts(...) end (#2153)
    • ๐Ÿ‘Œ Support for beginless and endless ranges: (1..), (..1) (#2150)
    • ๐Ÿ‘€ Preliminary support for **nil argument - see #2240 to note limitations (#2152)
    • Support for Random::Formatters which add methods #{hex,base64,urlsafe_base64,uuid,random_float,random_number,alphanumeric} to Random and SecureRandom (#2218)
    • ๐Ÿ‘ Basic support for ObjectSpace finalizers and ObjectSpace::WeakMap (#2247)
    • ๐Ÿ‘ A more robust support for encodings (especially binary strings) (#2235)
    • ๐Ÿ‘Œ Support for "\x80" syntax in String literals (#2235)
    • โž• Added String#+@, String#-@ (#2235)
    • ๐Ÿ‘Œ Support for begin <CODE> end while <CONDITION> (#2255)
    • โž• Added Hash#except and Hash#except! (#2243)
    • ๐Ÿ“œ Parser 3.0: Implement pattern matching (as part of this {Array,Hash,Struct}#{deconstruct,deconstruct_keys} methods were added) (#2243)
    • [experimental] Reimplement Promise to make it bridged with JS native Promise, this new implementation can be used by requiring promise/v2 (#2220)

    ๐Ÿ›  Fixed

    • Encoding lookup was working only with uppercase names, not giving any errors for wrong ones (#2181, #2183, #2190)
    • ๐Ÿ›  Fix Number#to_i with huge number (#2191)
    • โž• Add regexp support to String#start_with (#2198)
    • String#bytes now works in strict mode (#2194)
    • ๐Ÿ›  Fix nested module inclusion (#2053)
    • SecureRandom is now cryptographically secure on most platforms (#2218, #2170)
    • ๐Ÿ›  Fix performance regression for Array#unshift on v8 > 7.1 (#2116)
    • String subclasses now call #initialize with multiple arguments correctly (with a limitation caused by the String immutability issue, that a source string must be the first argument and #initialize can't change its value) (#2238, #2185)
    • ๐Ÿšš Number#step is moved to Numeric (#2100)
    • ๐Ÿ›  Fix class Class < superclass for invalid superclasses (#2123)
    • ๐Ÿ›  Fix String#unpack("U*") on binary strings with latin1 high characters, fix performance regression on that call (#2235, #2189, #2129, #2099, #2094, #2000, #2128)
    • ๐Ÿ›  Fix String#to_json output on some edge cases (#2235)
    • ๐Ÿ‘ Rework class variables to support inheritance correctly (#2251)
    • ISO-8859-1 and US-ASCII encodings are now separated as in MRI (#2235)
    • String#b no longer modifies object strings in-place (#2235)
    • Parser::Builder::Default.check_lvar_name patch (#2195)

    ๐Ÿ”„ Changed

    • String#unpack, Array#pack, String#chars, String#length, Number#chr, and (only partially) String#+ are now encoding aware (#2235)
    • String#inspect now uses \x for binary stirngs (#2235)
    • ๐Ÿ’Ž if RUBY_ENGINE == "opal" and friends are now outputing less JS code (#2159, #1965)
    • Array: to_a, slice/[], uniq, *, difference/-, intersection/&, union/|, flatten now return Array, not a subclass, as Ruby 3.0 does (#2237)
    • Array: difference, intersection, union now accept multiple arguments (#2237)

    ๐Ÿ—„ Deprecated

    • โœ… Stopped testing Opal on Ruby 2.5 since it reached EOL.

    โœ‚ Removed

    • โœ‚ Removed support for the outdated c_lexer, it was optional and didn't work for the last few releases of parser (#2235)
  • v1.1.1 Changes

    February 23, 2021

    ๐Ÿ›  Fixed

    • 0๏ธโƒฃ The default runner (nodejs) wasn't starting to a bad require in the improved stack-traces (#2182)
  • v1.1.0 Changes

    February 19, 2021

    โž• Added

    • ๐Ÿ‘ Basic support for uplevel: keyword argument in Kernel#warn (#2006)
    • Added a #respond_to_missing? implementation for BasicObject, Delegator, OpenStruct, that's meant for future support in the Opal runtime, which currently ignores it (#2007)
    • Opal::Compiler#magic_comments that allows to access magic-comments format and converts it to a hash (#2038)
    • ๐Ÿ‘‰ Use magic-comments to declare helpers required by the file (#2038)
    • Opal.$$ is now a shortcut for Opal.const_get_relative (#2038)
    • Opal.$$$ is now a shortcut for Opal.const_get_qualified (#2038)
    • โž• Added support for globalThis as the generic global object accessor (#2047)
    • Opal::Compiler#magic_comments that allows to access magic-comments format and converts it to a hash
    • ๐Ÿ‘‰ Use magic-comments to declare helpers required by the file
    • Opal.$$ is now a shortcut for Opal.const_get_relative
    • Opal.$$$ is now a shortcut for Opal.const_get_qualified
    • 0๏ธโƒฃ Source-map support for Node.js in the default runner (#2045)
    • SecureRandom#hex(n) (#2050)
    • โž• Added a generic implementation of Kernel#caller and #warn(uplevel:) that works with sourcemaps in Node.js and Chrome (#2065)
    • Added support for numblocks -> { _1 + _2 }.call(3, 4) # => 7 (#2149)
    • ๐Ÿ‘Œ Support <internal:โ€ฆ> and <js:โ€ฆ> in stacktraces, like MRI we now distinguish internal lines from lib/app lines (#2154)
    • Array#difference, Array#intersection, Array#union as aliases respectively to Array#{-,&,|} (#2151)
    • Aliases filter{,!} to select{,!} throughout the corelib classes (#2151)
    • Enumerable#filter_map, Enumerable#tally (#2151)
    • Alias Kernel#then for Kernel#yield_self (#2151)
    • Method chaining: {Proc,Method}#{<<,>>} (#2151)
    • โž• Added Integer#to_d (#2006)
    • Added a compiler option use_strict which can also be set by the use_strict magic comment (#1959)
    • โž• Add --rbrequire (-q) option to opal command line executable (#2120)

    ๐Ÿ›  Fixed

    • Array#delete_if (#2069)
    • Array#keep_if (#2069)
    • Array#reject! (#2069)
    • Array#select! (#2069)
    • Struct#dup (#1995)
    • Integer#gcdlcm (#1972)
    • Enumerable#to_h (#1979)
    • Enumerator#size (#1980)
    • Enumerable#min (#1982)
    • Enumerable#min_by (#1985)
    • Enumerable#max_by (#1985)
    • Set#intersect? (#1988)
    • Set#disjoint? (#1988)
    • Set#keep_if (#1987)
    • Set#select! (#1987)
    • Set#reject! (#1987)
    • String#unicode_normalize (#2175)
    • Module#alias_method (#1983)
    • Enumerable#minmax_by (#1981)
    • Enumerator#each_with_index (#1990)
    • Range#== (#1992)
    • Range#each (#1991)
    • Enumerable#zip (#1986)
    • String#getbyte (#2141)
    • Struct#dup not copying $$data (#1995)
    • ๐Ÿ›  Fixed usage of semicolon in single-line backticks (#2004)
    • Module#attr with multiple arguments (#2003)
    • PathReader used to try to read missing files instead of respecting the missing_require_severity configuration value (#2044)
    • โœ‚ Removed some unused variables from the runtime (#2052)
    • ๐Ÿ›  Fixed a typo in the runtime (#2054)
    • ๐Ÿ›  Fix Regexp interpolation, previously interpolating with other regexps was broken (#2062)
    • Set match on StringScanner#skip and StringScanner#scan_until (#2061)
    • ๐Ÿ›  Fix ruby 2.7 warnings (#2071)
    • ๐Ÿ‘Œ Improve the --help descriptions (#2146)
    • โœ‚ Remove BasicObject#class (#2166)
    • Time#strftime %j leading zeros (#2161)
    • ๐Ÿ›  Fix call { true or next } producing invalid code (#2160)
    • define_method can now be called on the main object (#2029)
    • ๐Ÿ›  Fix nested for-loops (#2033)
    • ๐Ÿ›  Fix Number#round for Integers (#2030)
    • ๐Ÿ›  Fix parsing Unicode characters from Opal (#2073)
    • Integer#===: improve Integer recognition (#2089)
    • Regexp: ensure ignoreCase is never undefined (#2098)
    • Hash#delete: ensure String keys are converted to values (#2106)
    • ๐ŸŽ Array#shift: improve performance on v8 >7.1 (#2115)
    • ๐ŸŽ Array#pop(1): improve performance (#2130)
    • Object#pretty_inspect (#2139)
    • ๐Ÿ›  Fix conversion from UTF-8 to bytes (#2138)
    • โช Restore compatibility with Chrome 38, used by Cordova and many mobile browsers (#2109)

    ๐Ÿ”„ Changed

    • โšก๏ธ Updated outdated parser version (#2013)
    • ๐Ÿ—„ Nashorn has been deprecated but GraalVM still supports it (#1997)
    • "opal/mini" now includes "opal/io" (#2002)
    • Regexps assigned to constants are now frozen (#2007)
    • Opal.$$ changed from being the constant cache of Object to being a shortcut for Opal.const_get_relative (#2038)
    • ๐Ÿšš Moved REPL implementation from bin/ to its own lib/ file as opal/repl.rb (#2048)
    • Encoding.default_external is now initialized with __ENCODING__ (#2072)
    • Keep the MersenneTwister implementation private (#2108)
    • ๐Ÿ”„ Change parser to 3.0 (#2148)
    • ๐Ÿ›  Fix forwarding a rescued error to a global var: rescue => $gvar (#2154)
    • ๐Ÿ“œ Now using Parser v3.0 and targeting Ruby 3.0 (#2156)
    • ๐Ÿ‘ Comparable#clamp to support a Range argument (#2151)
    • ๐Ÿ‘ #to_h method to support a block (shortform for .map(&block).to_h) (#2151)
    • BigDecimal is now a subclass of Numeric (#2006)
    • ๐Ÿ’Ž PP to be rebased on upstream Ruby version (#2083)
    • 0๏ธโƒฃ String to report UTF-8 encoding by default, as MRI does (#2117)
    • โš  Don't output "Failed to load WithCLexer, using pure Ruby lexer" warning unless in $DEBUG mode (#2174)

    ๐Ÿ—„ Deprecated

    โœ‚ Removed

    • โœ‚ Removed special compilation for the Opal.truthy? and Opal.falsy? helpers (#2076)
    • โœ‚ Removed the deprecated tainting compiler config option (#2072)