Opal v0.10.0 Release Notes
Release Date: 2016-07-04 // almost 8 years ago-
โ Added
- Pathname#relative_path_from
- Source maps now include method names
Module#included_modules
works- Internal runtime cleanup (#1241)
- ๐ Make it easier to add custom runners for the CLI (#1261)
- โ Add Rack v2 compatibility (#1260)
- ๐ Newly compliant with the Ruby Spec Suite:
Array#slice!
Array#repeated_combination
Array#repeated_permutation
Array#sort_by!
Enumerable#sort
Enumerable#max
Enumerable#each_entry
(#1303)Module#const_set
Module#module_eval
with a string
- โ Add
-L
/--library
option to compile only the code of the library (#1281) - Implement
Kernel.open
method (#1218) - ๐ Generate meaningful names for functions representing Ruby methods
- Implement
Pathname#join
andPathname#+
methods (#1301) - โ Added support for
begin;rescue;else;end
. - Implement
File.extname
method (#1219) - โ Added support for keyword arguments as lambda parameters.
- Super works with define_method blocks
- โ Added support for kwsplats.
- โ Added support for squiggly heredoc.
- Implement
Method#parameters
andProc#parameters
. - Implement
File.new("path").mtime
,File.mtime("path")
,File.stat("path").mtime
. - ๐ if-conditions now support
null
andundefined
as falsy values (#867) - Implement IO.read method for Node.js (#1332)
- Implement IO.each_line method for Node.js (#1221)
- ๐ Generate
opal-builder.js
to ease the compilation of Ruby library from JavaScript (#1290)
๐ Changed
- โ Remove deprecation of
Opal::Environment
after popular request - Setting
Opal::Config.dynamic_require_severity
will no longer affectOpal.dynamic_require_severity
which now needs to be explicitly set if it differs from the default value of"warning"
(See also theOpal.dynamic_require_severity
rename below). - The new default for
Opal::Config.dynamic_require_severity
is now:warning
Opal.dynamic_require_severity
andOPAL_CONFIG
are now merged intoOpal.config.missing_require_severity
(defaults toerror
, the expected ruby behavior) andOpal.config.unsupported_features_severity
(defaults towarning
, e.g. a one-time heads up that freezing isn't supported). Added variable__OPAL_COMPILER_CONFIG__
that contains compiler options that may be used in runtime.Hash
instances should now list the string map ($$smap
) as the first key, making debugging easier (most hashes will just have keys there).- ๐ Handle Pathname object in Pathname constructor
๐ Deprecated
Opal::Processor.stubbed_files
andOpal::Processor.stub_file
in favor ofOpal::Config.stubbed_files
โ Removed
- โ Removed the previously deprecated
Opal::Fragment#to_code
- Removed the previously deprecated
Opal::Processor.load_asset_code
- โ Removed the previously deprecated acceptance of a boolean as single argument to
Opal::Server.new
๐ Fixed
- ๐
Module#ancestors
and shared code like====
andis_a?
deal with singleton class modules better (#1449) Class#to_s
now shows correct names for singleton classesPathname#absolute?
andPathname#relative?
now work properly- ๐
File::dirname
andFile::basename
are now Rubyspec compliant SourceMap::VLQ
patch (#1075)Regexp::new
no longer throws error when the expression ends in \\super
works properly with overwritten alias methods (#1384)NoMethodError
does not need a name to be instantiatedmethod_added
fix for singleton class cases- Super now works properly with blocks (#1237)
- ๐ Fix using more than two
rescue
in sequence (#1269) - ๐ Fixed inheritance for
Array
subclasses. - Always populate all stub_subscribers with all method stubs, as a side effect of this now
method_missing
on bridged classes now works reliably (#1273) - 0๏ธโฃ Fix
Hash#instance_variables
to not return#default
and#default_proc
(#1258) - ๐ Fix
Module#name
when constant was created usingOpal.cdecl
(constant declare) likeChildClass = Class.new(BaseClass)
(#1259) - ๐ Fix issue with JavaScript
nil
return paths being treated as true (#1274) - Fix
Array#to_n
,Hash#to_n
,Struct#to_n
when the object contains native objects (#1249, #1256) break
semantics are now correct, except for the case in which a lambda containing abreak
is passed to ayield
(#1250)- Avoid double "/" when
Opal::Sprockets.javascript_include_tag
receives a prefix with a trailing slash. - ๐ Fixed context of evaluation for
Kernel#eval
andBasicObject#instance_eval
- ๐ Fix
Module#===
to use all ancestors of the passed object (#1284) - ๐ Fix
Struct.new
to be almost compatible with Rubyspec (#1251) - ๐ Fix
Enumerator#with_index
to return the result of the previously called method. - ๐ Improved
Date.parse
to cover most date formatting cases. - ๐ Fixed
Module#const_get
for dynamically created constants. - ๐ Fixed
File.dirname
to return joined String instead of Array. - ๐ Fixed multiple assignment for constants, i.e., allowing
A, B = 1, 2
. - ๐ Fixed
Number#[]
with negative number. Now(-1)[1]
returns 1. - ๐ Fixed parsing of pre-defined
$-?
global variables. - ๐ Fixed parsing of unicode constants.
- ๐ Fixed parsing of quoted heredoc identifier.
- ๐ Fixed parsing of mass assignment of method call without parentheses.
- ๐ Fixed parsing of
%I{}
lists. - ๐ Fixed parsing of
%{}
lists when list item contains same brackets. - ๐ Fixed an issue with
"-"
inside the second arg ofString#tr
- ๐ Fixed Base64 and enabled specs
- ๐ Fixed method definition in method body.
- Partially implemented
Marshal.load
/Marshal.dump
. In order to use it requireopal/full
. - ๐ Fixed docs for Compiled Ruby - Native section. Rename opal variable to win since window was causing error
- ๐ Fixed the
--map
option, now correclty outputs the sourcemap as json
โ Removed
- โ Remove support for configuring Opal via
Opal::Processor
, the correct place isOpal::Config
- โ Remove
Opal.process
which used to be an alias toSprockets::Environment#[]