Skip to content

Releases: stealjs/transpile

2.8.0

09 Jun 16:34
Compare
Choose a tag to compare

ES2019 support with esprima-next: #155

2.7.2

13 Nov 12:21
Compare
Choose a tag to compare

Copy over sourcemap-to-ast helper code to avoid old estraverse package

This patch release fixes an issue where transpile throws an error with ES2015 features not supported by the version of estraverse used by the sourcemap-to-ast package if forceES5 is set to false.

See stealjs/steal-tools#1144

2.7.1

06 Mar 17:18
Compare
Choose a tag to compare

This patch release fixes two issues:

  1. There was an infinite loop in the AMD -> AMD transform for UMD modules #145
  2. The ES6->AMD transform didn't honor the sourceMaps option #144

🐛🐛🐦

2.5.9

05 Jan 19:54
Compare
Choose a tag to compare

This is a patch release, fixing an issue where transpile.to's 3rd argument (options) was required, when it should have been optional.

2.5.8

28 Dec 17:09
Compare
Choose a tag to compare

This is a patch release, adding support for steal's eval: 'script' metadata option.

A global module like:

function someFunction() {

}

That does not explicitly set its globals won't work in Steal 1.x without the eval: 'script' option, because Steal 1.x uses new Function for eval, and this creates a closure. This option causes script eval, which won't have the closure.

"steal": {
  "meta": {
    "someModule": {
      "format": "global",
      "eval": "script"
    }
  }
}

2.5.6

04 Oct 21:14
Compare
Choose a tag to compare

This patch release fixes an issue where UMD detected as AMD would fail on runtime because the AMD module depends on exports. E.g:

(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
	typeof define === 'function' && define.amd ? define(['exports'], factory) :  
	(factory((global.Kefir = global.Kefir || {})));
}(this, (function (exports) {
  exports.stuff = ...;
});

See #118

2.5.5

03 Oct 19:15
Compare
Choose a tag to compare

This patch release includes fixes for the following issues:

  • Remove redundant object.assign dependency (uses lodash's method instead)
  • Fix slim output for AMD modules using the special module dependency stealjs/steal-tools#853

2.5.4

03 Oct 19:12
Compare
Choose a tag to compare

This patch release fixes an issue with circular dependencies introduced in 2.5.0.

function _patchCircularDependency(obj) {
  var defaultExport;
  Object.defineProperty(obj.default, 'default', {
    set: function (value) {
      if (obj.default.__esModule) {
        obj.default = value;
      }
     defaultExport = value;
    },
    get: function () {
      return defaultExport;
    }
});

the helper above was making the .default.default property non-configurable hence any other module in the same bundle would throw an error when trying to set the already existing setter.

2.50

02 Aug 00:31
Compare
Choose a tag to compare

Circular dependencies in Babel's AMD output

StealJS will hand an empty module {} to a module with circular dependencies while the body of said module is executed.

Babel adds a little helper so non ES6 modules work when imported using the ES6 syntax

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : { default: obj };
}

When empty modules {} are passed to this function, they are wrapped with a default property which makes non-ES6 modules work fine, but it causes a nested default property in circular dependencies that are late bound.

This release of transpile adds a little helper to modules flagged as circular to make sure there are no nested default properties in the module. Each variable holding the module reference returned by _interopRequireDefault is given a setter to fix the default reference.

function _patchCircularDependency(obj) {
  var defaultExport;
  Object.defineProperty(obj.default, 'default', {
    set: function (value) {
      if (obj.default.__esModule) {
        obj.default = value;
      }
     defaultExport = value;
    },
    get: function () {
      return defaultExport;
    }
});

2.4.0

24 Jul 20:45
Compare
Choose a tag to compare

Slim format

The slim format transform was introduced in previous pre-releases and it's shipped now as part of this release.

Add CJS dependencies to the AMD define function

This release changes the transpile output when there is a CJS to AMD transform so dependencies are passed as the second argument to the define function.

E.g, before 2.4.0 the following code:

var foo = require("foo");
foo();

would be transpiled to the AMD simplified CommonJS wrapper format:

define(function(require, exports, module) {
  var foo = require("foo");
})

With 2.4.0, the same source file would be transpiled to:

define(["require", "exports", "module", "foo"], function(require, exports, module) {
  var foo = require("foo");
})

The "duplicated" dependency is added to make sure the loader can execute the module even if it can't detect the dependency correctly. See stealjs/steal-tools#792 (comment)