Changelog History
Page 4
-
v0.9.4 Changes
June 20, 2016π Fixed
π Rebuilt the gem with Rubygems 2.4.8 as building with 2.5.1+ would make the gem un-installable
β Removed all symlinks from
node_module
directories to avoid further issues building the gem
-
v0.9.3 Changes
June 16, 2016π Fixed
Hash#initialize
now accepts JSnull
as well asundefined
, restoring its 0.8 behavior
-
v0.9.2 Changes
January 09, 2016π Fixed
- π Rebuilt the gem with Ruby 2.2 as building with 2.3 would make the gem un-installable
-
v0.9.1 Changes
January 09, 2016 -
v0.9.0 Changes
December 20, 2015β Added
- A
console
wrapper has been added to the stdlib, requiring it will make available the$console
global variable. - β
method_added
,method_removed
andmethod_undefined
reflection now works. singleton_method_added
,singleton_method_removed
andsingleton_method_undefined
reflection now works.- π Now you can bridge a native class to a Ruby class that inherits from another Ruby class
- π
Numeric
semantics are now compliant with Ruby. Complex
has been fully implemented.Rational
has been fully implemented.- π»
Kernel#raise
now properly re-raises exceptions (regardless of how many levels deep you are) and works properly if supplied a class that has an exception method. - π»
Exception#exception
,Exception::exception
,Exception#message
, andException#to_s
are fully implemented - π You can make direct JavaScript method calls on using the
recv.JS.method
syntax. Has support for method calls, final callback (as a block), property getter and setter (via#[]
and#[]=
), splats, JavaScript keywords (via the::JS
module) and global functions (afterrequire "js"
). Set#superset?
,Set#subset?
, and the respectiveproper_
variant of each are now implementedNameError
andNoMethodError
- add#name
and#args
attributesRegExp#match
now works correctly in multiline mode with white space- π
BasicObject#instance_eval
now can accept a string argument (afterrequire "opal-parser"
) β Adds Nashorn (Java 8+ Javascript engine) runner
bundle exec bin/opal -R nashorn -r nashorn hello.rb
π Newly compliant with the Ruby Spec Suite:
Enumerable#chunk
Enumerable#each_cons
Enumerable#minmax
Range#to_a
(#1246)Module
comparison methods:#<
#<=
#<=>
#>
#>=
OpenStruct#method_missing
OpenStruct#inspect
OpenStruct#to_s
OpenStruct#delete_field
π Changed
- π Renamed:
Hash.keys
=>Hash.$$keys
Hash.map
=>Hash.$$map
Hash.smap
=>Hash.$$smap
- π
Kernel#pp
no longer forwards arguments directly toconsole.log
, this behavior has been replaced by stdlib's ownconsole.rb
(see above). Opal::Sprockets.javascript_include_tag
has been added to allow easy debug mode (i.e. with source maps) when including a sprockets asset into an HTML page.
π Deprecated
Opal::Processor.load_asset_code(sprockets, name)
has been deprecated in favor ofOpal::Sprockets.load_asset(name, sprockets)
.
π Fixed
- π Fixed usage of JavaScript keywords as instance variable names for:
Kernel#instance_variable_set
Kernel#instance_variable_get
Kernel#instance_variables
Struct#hash
now works properly based on struct contents- No longer crashes when calling a method with an opt arg followed by an optional kwarg when called without the kwarg
- Operator methods (e.g.
+
,<
, etc.) can be handled bymethod_missing
- π Fix issue where passing a block after a parameter and a hash was causing block to not be passed (e.g.
method1 some_param, 'a' => 1, &block
) - Method defs issued inside
Module#instance_eval
andClass#instance_eval
, and the respectiveexec
now create class methods - π Now with enabled arity checks calling a method with more arguments than those supported by its signature raises an
ArgumentError
as well. - Previously arity checks would raise an error without clearing the block for a method, that could lead to strange bugs in case the error was rescued.
Regexp#===
returns false when the right hand side of the expression cannot be coereced to a string (instead of throwing aTypeError
)- β‘οΈ
Regexp#options
has been optimized and correctly returns 0 when called on a Regexp literal without any options (e.g.//
) - π Fix
Kernel#exit
to allow exit inside#at_exit
- π Fixed a number of syntax errors (e.g. #1224 #1225 #1227 #1231 #1233 #1226)
- π Fixed
Native()
when used withArray
instances containing native objects (which weren't wrapped properly) β #1212 - Fix
Array#to_n
,Hash#to_n
,Struct#to_n
when the object contains native objects (#1249) - Internal cleanup and lots of bugs!
- A
-
v0.8.1 Changes
October 12, 2015β Removed
- π Use official Sprockets processor cache keys API:
The old cache key hack has been removed.
Add
Opal::Processor.cache_key
andOpal::Processor.reset_cache_key!
to reset it as itβs cached but should change wheneverOpal::Config
changes.
π Fixed
- π Fix an issue for which a Pathname was passed instead of a String to Sprockets.
- π Use official Sprockets processor cache keys API:
The old cache key hack has been removed.
Add
-
v0.8.0 Changes
July 16, 2015β Added
π
Hash[]
implementation fully compliant with rubyspecπ Newly compliant with the Ruby Spec Suite:
Array#bsearch
Array#combination
Array#permutation
Array#product
Array#rotate!
Array#rotate
Array#sample
Array#to_h
Array#values_at
Array#zip
Enumerator#with_index
Kernel#===
Kernel#Array
Kernel#Float
Kernel#Hash
Kernel#Integer
Kernel#String
Kernel#format
Kernel#sprintf
MatchData#==
MatchData#eql?
MatchData#values_at
Module#instance_methods
Regexp#match
String#%
String#===
String#==
String#[]
String#each_line
String#eql?
String#index
String#inspect
String#lines
String#match
String#next
String#oct
String#scan
String#slice
String#split
String#succ
String#to_i
String#try_convert
π Changed
- β‘οΈ Updated to Sprockets v3.0.
- 0οΈβ£ Enable operator inlining by default in the compiler.
β Removed
- β Removed
minitest
from stdlib. It's not part of MRI and it never belonged there, checkout theopal-minitest
gem instead.
π Fixed
- Delegate dependency management directly to Sprockets (when used) making sourcemaps swift again.
This means code generated by sprockets will always need to be bootstrapped via
Opal.load
orOpal.require
. LuckilyOpal::Processor.load_asset_code(sprockets, name)
does just that in the right way. - π Fix
Promise#always
. - π Fix
String#split
when no match is found and a limit is provided - π Fix
require_tree(".")
when used from file at the root of the assets paths - π Parser: Allow trailing comma in paren arglists, after normal args as well as assoc args.
- π Parser: Fix parsing of parens following divide operator without a space.
- π Parser: Fix bug where keyword arguments could not be parsed if method definition did not have parens around arguments.
-
Module#const_get
now accepts a scoped constant name -
Regexp#===
sets global match data vars
-
v0.7.2 Changes
April 23, 2015- β Remove Sprockets 3.0 support (focus moved to upcoming 0.8)
- π Fix version number consistency.
-
v0.7.1 Changes
February 13, 2015- CLI options
-d
and-v
now set respectively$DEBUG
and$VERBOSE
- π Fixed a bug that would make the
-v
CLI option wait for STDIN input - β Add the
-E
/--no-exit
CLI option to skip implicitKernel#exit
call - Now the CLI implicitly calls
Kernel#exit
at the end of the script, thus makingat_exit
blocks be respected.
- CLI options
-
v0.7.0 Changes
February 01, 2015Stop keyword-arg variable names leaking to global javascript scope
π
Class#native_class
now also exposesMyClass.new
(Ruby) asOpal.global.MyClass.new()
(JS)β Add CRuby (MRI) tests harness to start checking Opal against them too.
β Add Minitest to the stdlib.
β Add
Date#<=>
with specs.π Show extended info and context upon parsing, compiling and building errors.
π Support keyword arguments in method calls and definitions.
π Fix
begin
/rescue
blocks to evaluate to last expression.π Add support for
RUBY_ENGINE/RUBY_PLATFORM != "opal"
pre-processor directives.if RUBY_ENGINE != "opal" # this code never compiles end
π Fix donating methods defined in modules. This ensures that if a class includes more than one module, then the methods defined on the class respect the order in which the modules are included.
π Improved support for recursive
Hash
for both#inspect
and#hash
.β‘οΈ Optimized
Hash
implementation forString
andSymbol
, they have a separate hash-table in which they're used as both keys and hashes.β Added real
#hash
/eql?
support, previously was relying on.toString()
.String#to_proc
now uses__send__
instead ofsend
for calling methods on receivers.π Deprecated
Opal::Sprockets::Environment
. It can easily be replaced byOpal::Server
or by appendingOpal.paths
to aSprockets::Environment
:Sprockets::Environment.new.tap { |e| Opal.paths.each {|p| e.append_path(p)} }
β Add
Set
methods#classify
,#collect!
,#map!
,#subtract
#replace
,#difference
and#eql?
π Support
module_function
without args to toggle module functions.π Fix bug where command calls with no space and sym arg were incorrectly parsed.
β Add some
StringScanner
methods.β Add
Date#<<
andDate#>>
implementations.π Support nested directories using
require_tree
directive.π Fix bug where Exception subclasses could not have methods defined on them.
π Fix symbols with interpolations
:"#{foo}"
π Implement $1..N matchers and rewrite support for $~, $', $& and $`.
Implement
Regexp.last_match
.π Fixed
-@
unary op. precedence with a numeric and followed by a method call (e.g.-1.foo
was parsed as-(1.foo)
)require_relative
(with strings) is now preprocessed, expanded and added toCompiler#requires
Rewritten the require system to respect requires position (previously all the requires were stacked up at the top of the file)
Implement for-loop syntax
β Add Array#|
π Fix Range.new to raise
ArgumentError
on contructor values that cannot be comparedπ Fix compiler bug where Contiguous strings were not getting concatenated.
Cleanup generated code for constant access. All constant lookups now go through
$scope.get('CONST_NAME')
to produce cleaner code and a unified place for const missing dispatch.β Remove
const_missing
option from compiler. All constant lookups are now strict.β Add initial support for Module#autoload.
π Fix
Enumerator#with_index
,Numeric#round
.