Skip to content

Releases: opal/opal

v1.8.2

23 Nov 21:29
v1.8.2
0908976
Compare
Choose a tag to compare

Performance

  • Optimize Hash#rehash for the common case, avoid calling $slice when no hash collision is present (#2571)

Fixed

  • String#{r,l,}strip: Make them work like in MRI for non-breaking white-space (#2612)
  • Compat regression fix: Hash#to_n should return a JS object (#2613)

v1.8.1

09 Nov 09:54
v1.8.1
b13f318
Compare
Choose a tag to compare

Fixed

  • Array methods should handle elements inserted during the iteration (#2602)
  • Assign correct values to duplicated underscore parameters (#2606)

Added

  • Support an IO argument of Kernel.printf (#2605)

Performance

  • Fix a performance regression introduced by freezing support (#2609)

v1.8.0

26 Oct 09:22
v1.8.0
2430f2b
Compare
Choose a tag to compare

Highlights

Hash is now bridged to JavaScript Map

This change brings a lot of benefits, but also some incompatibilities. The main benefit is that Hash now is both more performant and relies on native JavaScript capabilities.
This improves interoperability with JavaScript. As a downside, applications reaching for internal Hash data structures will need to be updated.

Interacting with Hash from JavaScript is easier than ever:

hash = `new Map([['a', 1], ['b', 2]])`
hash # => {a: 1, b: 2}
`console.log(hash)` # => Map(2) {"a" => 1, "b" => 2}
`hash.get('a')` # => 1
`hash.set('c', 3)`
hash # => {a: 1, b: 2, c: 3}
hash.keys # => ["a", "b", "c"]
hash.values # => [1, 2, 3]

Performance improvements

This release brings a lot of performance improvements, our tests on Asciidoctor show a 25% improvement in performance, but we've seen up to 66% performance improvement on some applications.

Changelog

Deprecated

  • Deprecate using x-string to access JavaScript without an explicit magic-comment (#2543)

Compatibility

  • Add a magic-comment that will disable x-string compilation to JavaScript (#2543)
  • Pass value in PromiseV2#always just like PromiseV1#always does it (#2579)
  • #hash now returns integers (#2582)
  • Improve Range#include?/member?/cover?/=== (#2598)
  • Make Module#define_method more compatible with CRuby (#2593)
  • Hash#clone must freeze clone if original is frozen, but Hash#dup must not (#2603)

Fixed

  • Fix Kernel#Float with exception: option (#2532)
  • Fix Kernel#Integer with exception: option (#2531)
  • Fix String#split with limit and capturing regexp (#2544)
  • Fix switch with Object-wrapped values (#2542)
  • Fix non-direct subclasses of bridged classes not calling the original constructor (#2546)
  • Regexp.escape: Cast to String or drop exception (#2552)
  • Propagate removal of method from included/prepended modules (#2553)
  • Restore nodejs/yaml functionality (#2551)
  • Fix sine Range#size edge cases (#2541)
  • Use a Map instead of a POJO for the jsid_cache (#2584)
  • Fix String#object_id, String#__id__, String#hash to match CRuby's behavior (#2576)
  • Lowercase response headers in SimpleServer for rack 3.0 compatibility (#2578)
  • Fix Module#clone and Module#dup to properly copy methods (#2572)
  • Chrome runner fix: support code that contains </script> (#2581)
  • Do not skip $truthy when left hand side of a comparison is self (#2596)
  • Unexpected return/break should raise LocalJumpError (#2591)

Added

  • SourceMap support for Kernel#eval (#2534)
  • Add CGI::Util#escapeURIComponent and CGI::Util#unescapeURIComponent (#2566)
  • CGI::Util implement additional methods (#2601)

Changed

  • Change compilation of Regexp nodes that may contain advanced features, so if invalid that they would raise at runtime, not parse-time (#2548)
  • Hash is now bridged to JavaScript Map and support for non-symbol keys in keyword arguments (#2568)

Documentation

  • Bridging documentation (#2541)
  • Fix Typo in Running tests Section of README.md File (#2580)

Performance

  • Improve performance of Array#intersect? and #intersection (#2533)
  • Proc#call: Refactor for performance (#2541)
  • Opal.stub_for: optimize (#2541)
  • Hash: Optimize #to_a (#2541)
  • Array: Optimize #collect/#map (#2541)
  • Optimize argument slicing in runtime for performance (#2555)
  • Closure: Generate a JavaScript object, not an Error, gain up to 15% on Asciidoctor (#2556)
  • Optimize String#split and String#start_with (#2560)
  • Compute $@ dynamically (#2592)
  • Optimize the $prop helper (#2597)
  • Improve Array.push() performance when pushing many items (#2565)
  • Optimize Opal.instance_methods (#2600)

Internal

  • Update rubocop (#2535)
  • Match3Node Cleanup (#2541)
  • IFlipFlop/EFlipFlop: Refactor for readability (#2541)
  • ForRewriter: Refactor for readability (#2541)

v1.8.0.beta1

12 Oct 09:22
v1.8.0.beta1
6975ccd
Compare
Choose a tag to compare
v1.8.0.beta1 Pre-release
Pre-release

Highlights

Hash is now bridged to JavaScript Map

This change brings a lot of benefits, but also some incompatibilities. The main benefit is that Hash now is both more performant and relies on native JavaScript capabilities.
This improves interoperability with JavaScript. As a downside, applications reaching for internal Hash data structures will need to be updated.

Interacting with Hash from JavaScript is easier than ever:

hash = `new Map([['a', 1], ['b', 2]])`
hash # => {a: 1, b: 2}
`console.log(hash)` # => Map(2) {"a" => 1, "b" => 2}
`hash.get('a')` # => 1
`hash.set('c', 3)`
hash # => {a: 1, b: 2, c: 3}
hash.keys # => ["a", "b", "c"]
hash.values # => [1, 2, 3]

Performance improvements

This release brings a lot of performance improvements, our tests on Asciidoctor show a 25% improvement in performance, but we've seen up to 66% performance improvement on some applications.

Changelog

Deprecated

  • Deprecate using x-string to access JavaScript without an explicit magic-comment (#2543)

Compatibility

  • Add a magic-comment that will disable x-string compilation to JavaScript (#2543)
  • Pass value in PromiseV2#always just like PromiseV1#always does it (#2579)
  • #hash now returns integers #2582)

Fixed

  • Fix Kernel#Float with exception: option (#2532)
  • Fix Kernel#Integer with exception: option (#2531)
  • Fix String#split with limit and capturing regexp (#2544)
  • Fix switch with Object-wrapped values (#2542)
  • Fix non-direct subclasses of bridged classes not calling the original constructor (#2546)
  • Regexp.escape: Cast to String or drop exception (#2552)
  • Propagate removal of method from included/prepended modules (#2553)
  • Restore nodejs/yaml functionality (#2551)
  • Fix sine Range#size edge cases (#2541)
  • Use a Map instead of a POJO for the jsid_cache (#2584)
  • Fix String#object_id, String#__id__, String#hash to match CRuby's behavior (#2576)
  • Lowercase response headers in SimpleServer for rack 3.0 compatibility (#2578)
  • Fix Module#clone and Module#dup to properly copy methods (#2572)
  • Chrome runner fix: support code that contains </script> (#2581)
  • Do not skip $truthy when left hand side of a comparison is self (#2596)
  • Unexpected return/break should raise LocalJumpError (#2591)

Added

  • SourceMap support for Kernel#eval (#2534)
  • Add CGI::Util#escapeURIComponent and CGI::Util#unescapeURIComponent (#2566)

Changed

  • Change compilation of Regexp nodes that may contain advanced features, so if invalid that they would raise at runtime, not parse-time (#2548)
  • Hash is now bridged to JavaScript Map and support for non-symbol keys in keyword arguments (#2568)

Documentation

  • Bridging documentation (#2541)
  • Fix Typo in Running tests Section of README.md File (#2580)

Performance

  • Improve performance of Array#intersect? and #intersection (#2533)
  • Proc#call: Refactor for performance (#2541)
  • Opal.stub_for: optimize (#2541)
  • Hash: Optimize #to_a (#2541)
  • Array: Optimize #collect/#map (#2541)
  • Optimize argument slicing in runtime for performance (#2555)
  • Closure: Generate a JavaScript object, not an Error, gain up to 15% on Asciidoctor (#2556)
  • Optimize String#split and String#start_with (#2560)
  • Compute $@ dynamically (#2592)
  • Optimize the $prop helper (#2597)
  • Improve Array.push() performance when pushing many items (#2565)

Internal

  • Update rubocop (#2535)
  • Match3Node Cleanup (#2541)
  • IFlipFlop/EFlipFlop: Refactor for readability (#2541)
  • ForRewriter: Refactor for readability (#2541)

v1.7.4

14 Sep 08:29
v1.7.4
3c2076f
Compare
Choose a tag to compare

Fixed

  • Use a Map instead of a POJO for the jsid_cache (#2584)
  • Lowercase response headers in SimpleServer for rack 3.0 compatibility (#2578)
  • Fix switch with Object-wrapped values (#2542)
  • Regexp.escape: Cast to String or drop exception (#2552)
  • Chrome runner fix: support code that contains </script> (#2581)

v1.8.0.alpha1

04 Aug 08:49
v1.8.0.alpha1
c67eb7e
Compare
Choose a tag to compare
v1.8.0.alpha1 Pre-release
Pre-release

Highlights

Hash is now bridged to JavaScript Map

This change brings a lot of benefits, but also some incompatibilities. The main benefit is that Hash now is both more performant and relies on native JavaScript capabilities.
This improves interoperability with JavaScript. As a downside, applications reaching for internal Hash data structures will need to be updated.

Interacting with Hash from JavaScript is easier than ever:

hash = `new Map([['a', 1], ['b', 2]])`
hash # => {a: 1, b: 2}
`console.log(hash)` # => Map(2) {"a" => 1, "b" => 2}
`hash.get('a')` # => 1
`hash.set('c', 3)`
hash # => {a: 1, b: 2, c: 3}
hash.keys # => ["a", "b", "c"]
hash.values # => [1, 2, 3]

Performance improvements

This release brings a lot of performance improvements, our tests on Asciidoctor show a 25% improvement in performance, but we've seen up to 66% performance improvement on some applications.

Changelog

Deprecated

  • Deprecate using x-string to access JavaScript without an explicit magic-comment (#2543)

Compatibility

  • Add a magic-comment that will disable x-string compilation to JavaScript (#2543)

Fixed

  • Fix Kernel#Float with exception: option (#2532)
  • Fix Kernel#Integer with exception: option (#2531)
  • Fix String#split with limit and capturing regexp (#2544)
  • Fix switch with Object-wrapped values (#2542)
  • Fix non-direct subclasses of bridged classes not calling the original constructor (#2546)
  • Regexp.escape: Cast to String or drop exception (#2552)
  • Propagate removal of method from included/prepended modules (#2553)
  • Restore nodejs/yaml functionality (#2551)
  • Fix sine Range#size edge cases (#2541)

Added

  • SourceMap support for Kernel#eval (#2534)
  • Add CGI::Util#escapeURIComponent and CGI::Util#unescapeURIComponent (#2566)

Changed

  • Change compilation of Regexp nodes that may contain advanced features, so if invalid that they would raise at runtime, not parse-time (#2548)
  • Hash is now bridged to JavaScript Map and support for non-symbol keys in keyword arguments (#2568)

Documentation

  • Bridging documentation (#2541)

Performance

  • Improve performance of Array#intersect? and #intersection (#2533)
  • Proc#call: Refactor for performance (#2541)
  • Opal.stub_for: optimize (#2541)
  • Hash: Optimize #to_a (#2541)
  • Array: Optimize #collect/#map (#2541)
  • Optimize argument slicing in runtime for performance (#2555)
  • Closure: Generate a JavaScript object, not an Error, gain up to 15% on Asciidoctor (#2556)
  • Optimize String#split and String#start_with (#2560)

Internal

  • Update rubocop (#2535)
  • Match3Node Cleanup (#2541)
  • IFlipFlop/EFlipFlop: Refactor for readability (#2541)
  • ForRewriter: Refactor for readability (#2541)

v1.7.3

23 Mar 13:33
v1.7.3
a1a79a9
Compare
Choose a tag to compare

Fixed

  • Disallow to define a singleton class for Number (#2521)
  • Fix eval with parser gem v3.2.1 (#2526)
  • Fix certain encoding issues when using Prefork (#2527)
  • Fix Chrome CDP interface connection (#2528)
  • Fix for Opal::Cache::FileCache.dir_writable? (#2529)
  • Fix Array#sample randomness (#2530)

v1.7.2

20 Jan 19:03
v1.7.2
29ee7dd
Compare
Choose a tag to compare

Fixed

  • Fix the --debug-source-map CLI option (#2520)
  • Fix links in docs/compiler.md (#2519)

v1.7.1

05 Jan 23:07
v1.7.1
d2296fd
Compare
Choose a tag to compare

Added

  • Add safari runner (#2513)

Fixed

  • Fix CLI file reading for macOS (#2510)
  • Make Date/Time.parse on Firefox more compatible with Chrome and Ruby (#2506)
  • Safari/WebKit can now parse code compiled with lookbehind regexps, failing at runtime instead (#2511)
  • Fix --watch ignoring some directories (e.g. tmp) (#2509)
  • Fix rake dist not generating libraries correctly for the CDN (#2515)
  • Prefork: output processed files in a correct, deterministic order (#2516)
  • Fix the handling of ARGV for the opal executable (#2518)

Internal

  • Platform specific spec filters (#2508)
  • Run Firefox specs by default (#2507)
  • Run Safari specs by default (#2513)
  • [mspec_opal] Avoid lookbehind Regexp for compatibility with various javascript engines (#2512)

v1.7.0

26 Dec 23:51
v1.7.0
01d7da6
Compare
Choose a tag to compare

Added

  • Update benchmarking and CLI runners, added support for Deno and Firefox (#2490, #2492, #2494, #2495, #2497, #2491, #2496)
  • Ruby 3.2 support branch (#2500)
    • Set now part of the corelib
    • Anonymous rest keyword and block arguments can be passed to calls: call(**, &)
    • Refinement#refined_class has been added
    • Module#refinements has been added
    • Module#const_added has been added
    • Proc#parameters now accepts lambda keyword
    • Class#attached_object has been added, inverse of singleton_class
    • Hash#shift now returns nil instead of passing nil to the default_proc
  • Added --watch and --output options to the CLI for live compilation (#2485)

Performance

  • Replace all occurences of '$'+name with a cached helper, saving about 2% in performance (#2481)
  • Optimize argument passing and arity checks (#2499)
  • Targeted patches for Opal-Parser, saves up to 12% during compilation (#2482)

Internal

  • MSpec & Ruby Spec update (#2486)

Fixed

  • Remove throws from runtime (#2484)