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 and Pathname#+ 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 and Proc#parameters.
    • Implement File.new("path").mtime, File.mtime("path"), File.stat("path").mtime.
    • ๐Ÿ‘ if-conditions now support null and undefined 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 affect Opal.dynamic_require_severity which now needs to be explicitly set if it differs from the default value of "warning" (See also the Opal.dynamic_require_severity rename below).
    • The new default for Opal::Config.dynamic_require_severity is now :warning
    • Opal.dynamic_require_severity and OPAL_CONFIG are now merged into Opal.config.missing_require_severity (defaults to error, the expected ruby behavior) and Opal.config.unsupported_features_severity (defaults to warning, 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 and Opal::Processor.stub_file in favor of Opal::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 ==== and is_a? deal with singleton class modules better (#1449)
    • Class#to_s now shows correct names for singleton classes
    • Pathname#absolute? and Pathname#relative? now work properly
    • ๐Ÿ’Ž File::dirname and File::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 instantiated
    • method_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 using Opal.cdecl (constant declare) like ChildClass = 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 a break is passed to a yield (#1250)
    • Avoid double "/" when Opal::Sprockets.javascript_include_tag receives a prefix with a trailing slash.
    • ๐Ÿ›  Fixed context of evaluation for Kernel#eval and BasicObject#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 of String#tr
    • ๐Ÿ›  Fixed Base64 and enabled specs
    • ๐Ÿ›  Fixed method definition in method body.
    • Partially implemented Marshal.load/Marshal.dump. In order to use it require opal/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 is Opal::Config
    • โœ‚ Remove Opal.process which used to be an alias to Sprockets::Environment#[]