Skip to content

Releases: ruby2js/ruby2js

v5.1.2

11 May 17:25
Compare
Choose a tag to compare
  • Fix for super optional args, downcase / upcase string methods [#215]

v5.1.0

20 Feb 20:09
Compare
Choose a tag to compare
  • Many filters and other project features deprecated for future maintainability (see blog announcement).
  • The Vite and Rollup JS packages are looking for a new maintainer. Please let us know in the community GitHub Discussions if you'd like to contribute.
  • The Node version of Ruby2JS will require minimum version 14
  • Create a preset option to set sane default behavior [#178]
  • New configuration DSL and per-file magic comments [#182]
  • esbuild: change to use Ruby platform for Ruby2JS compilation [#183]
  • fix haml filter and update spec to include interpolation [#198]

v5.0.1

14 May 17:54
Compare
Choose a tag to compare

Fixed

  • Revert back to Opal 1.1.1 for compilation
    Any newer version of Opal results in compilation errors when emoji (and perhaps other unicode chars) are present in code
  • Ensure Nokogiri filter's create_element uses textContent instead of content

v5.0.0

14 May 16:32
Compare
Choose a tag to compare

Added

  • Support for Ruby 3.1's shorthand hash syntax: hash => {a:, b:} => let {a, b} = hash
  • functions filter: chars
  • functions filter: "string" * length => "string".repeat(length) for ES2015+

Changed

  • Improvements to the monorepo to ensure both the Ruby and the Node compiler versions always match
    and can get tested and released simultaneously. (Run bundle exec rake release_core.)
  • Ruby 2.7 is now the minimum supported version of Ruby.

v4.2.1

13 Nov 06:19
Compare
Choose a tag to compare

Changes since 4.2.1:

  • functions filter: index, rindex, and round
  • functions filter: obj.to_json => JSON.stringify(obj)
  • support numbered parameters (numblocks)
  • Array.new(size, default) => new Array(size).fill(default)

v4.2.0

11 Oct 23:59
Compare
Choose a tag to compare
  • Additional lit filter updates (PR #141)
    • Allow snake case custom_element in addition to customElement
    • Process the render function even when it contains multiple statements
    • Fix a properties vs styles typo for <es2022
    • Automatically add the html tagged literal return when necessary for any method, not just render
    • Ensure any ivars prefixed with _ will not turn into reactive properties (if you truly need to maintain private internal state).
  • ruby2js cli interface added
  • esm autoimports & defs: fix Opal-based parser to handle hash generated by Ruby
  • esm filter: convert top level requires into imports
  • lit filter: updates from polymer LitElement to Lit v2.
    added: customElements, es2022 syntax for properties,
    query, queryAll, queryAsync
    inherited methods: performUpdate, requestUpdate
    inherited properties: hasUpdated, renderRoot, shadowRoot, updateComplete

v4.1.7

01 Oct 05:17
Compare
Choose a tag to compare

Changes since v4.1.6:

  • take, drop, min, max, each_slice added to underscore filter
  • import stimulus => import @hotwired/stimulus
  • rails stimulus rake tasks and instructions were updated to match
    the latest hotwired/stimulus-rails changes

v4.1.4

08 May 15:43
Compare
Choose a tag to compare
  • Add camelCase support for keyword arguments (aka destructured object arg)

v4.1.3

15 Apr 03:55
Compare
Choose a tag to compare

Changes since 4.1.2:

  • Add camelCase support for => assignment operator
  • Fix bugs related to is_a? and instance_of?

See what else is new since 4.0.0 in the Changelog.

v4.0.0

11 Feb 21:21
Compare
Choose a tag to compare

Changes since v3.6.1

  • Support static method calls with blocks in es2015+
  • Auto-bind instance methods referenced as properties within a class
  • New defs option to add definitions for autoimported classes/methods
  • Open classes/modules, inheritance, and module include of props/methods
  • Handle begin, if, and case as expressions
  • Handle modules with exactly one method
  • Handle empty edge cases like `#{}` and ()
  • Live demo based on Opal (see here)
  • Demo: Hidden AST syntax enables copy/paste of syntactically correct AST
  • Anonymous classes via Class.new
  • Autoexport :default option
  • Support both default and named imports on same import statement
  • requires for modules containing exports statements generate import statements
  • require_recursive option