Ruby ♥︎ JavaScript
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]
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.
PromiseV2#always
just like PromiseV1#always
does it (#2579)#hash
now returns integers (#2582)Range#include?
/member?
/cover?
/===
(#2598)Module#define_method
more compatible with CRuby (#2593)Hash#clone
must freeze clone if original is frozen, but Hash#dup
must not (#2603)Kernel#Float
with exception:
option (#2532)Kernel#Integer
with exception:
option (#2531)String#split
with limit and capturing regexp (#2544)switch
with Object-wrapped values (#2542)nodejs/yaml
functionality (#2551)Range#size
edge cases (#2541)String#object_id
, String#__id__
, String#hash
to match CRuby's behavior (#2576)SimpleServer
for rack 3.0 compatibility (#2578)Module#clone
and Module#dup
to properly copy methods (#2572)</script>
(#2581)$truthy
when left hand side of a comparison is self
(#2596)return
/break
should raise LocalJumpError
(#2591)Kernel#eval
(#2534)CGI::Util#escapeURIComponent
and CGI::Util#unescapeURIComponent
(#2566)CGI::Util
implement additional methods (#2601)Hash
is now bridged to JavaScript Map
and support for non-symbol keys in keyword arguments (#2568)Array#intersect?
and #intersection
(#2533)Proc#call
: Refactor for performance (#2541)#to_a
(#2541)#collect
/#map
(#2541)String#split
and String#start_with
(#2560)$@
dynamically (#2592)$prop
helper (#2597)Array.push()
performance when pushing many items (#2565)Opal.instance_methods
(#2600)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]
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.
PromiseV2#always
just like PromiseV1#always
does it (#2579)#hash
now returns integers #2582)Kernel#Float
with exception:
option (#2532)Kernel#Integer
with exception:
option (#2531)String#split
with limit and capturing regexp (#2544)switch
with Object-wrapped values (#2542)nodejs/yaml
functionality (#2551)Range#size
edge cases (#2541)String#object_id
, String#__id__
, String#hash
to match CRuby's behavior (#2576)SimpleServer
for rack 3.0 compatibility (#2578)Module#clone
and Module#dup
to properly copy methods (#2572)</script>
(#2581)$truthy
when left hand side of a comparison is self
(#2596)return
/break
should raise LocalJumpError
(#2591)Kernel#eval
(#2534)CGI::Util#escapeURIComponent
and CGI::Util#unescapeURIComponent
(#2566)Hash
is now bridged to JavaScript Map
and support for non-symbol keys in keyword arguments (#2568)Array#intersect?
and #intersection
(#2533)Proc#call
: Refactor for performance (#2541)#to_a
(#2541)#collect
/#map
(#2541)String#split
and String#start_with
(#2560)$@
dynamically (#2592)$prop
helper (#2597)Array.push()
performance when pushing many items (#2565)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]
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.
Kernel#Float
with exception:
option (#2532)Kernel#Integer
with exception:
option (#2531)String#split
with limit and capturing regexp (#2544)switch
with Object-wrapped values (#2542)nodejs/yaml
functionality (#2551)Range#size
edge cases (#2541)Kernel#eval
(#2534)CGI::Util#escapeURIComponent
and CGI::Util#unescapeURIComponent
(#2566)Hash
is now bridged to JavaScript Map
and support for non-symbol keys in keyword arguments (#2568)Array#intersect?
and #intersection
(#2533)Proc#call
: Refactor for performance (#2541)#to_a
(#2541)#collect
/#map
(#2541)String#split
and String#start_with
(#2560)--watch
ignoring some directories (e.g. tmp
) (#2509)Set
now part of the corelibcall(**, &)
Refinement#refined_class
has been addedModule#refinements
has been addedModule#const_added
has been addedProc#parameters
now accepts lambda keywordClass#attached_object
has been added, inverse of singleton_class
Hash#shift
now returns nil
instead of passing nil
to the default_proc
--watch
and --output
options to the CLI for live compilation (#2485)'$'+name
with a cached helper, saving about 2% in performance (#2481)