Releases: stealjs/transpile
2.8.0
2.7.2
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.
2.7.1
2.5.9
2.5.8
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
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
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
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
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
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)