- Update sander to prevent graceful-fs-opocalypse (#193)
- Add a deprecation warning. (This project is deprecated – for one-to-one transformations you should use Babel, for bundling you should use Rollup.)
this
at the top-level is no longer treated as a syntax error (#151)
- Fix two bugs with renamed exports (#170)
- Fix
export { x as y }
namespace imports within a bundle (#169) - Lock magic-string version to 0.4.9 pending investigation of bug
- Where possible, default exports are not renamed (#166)
- Some internal tidying up
- Improve module sorting algorithm to handle tricky cyclical cases (#159)
- Fix a separate 0.6.31 regression with external modules (#158)
- Fix regression introduce in 0.6.31, whereby modules within a bundle are prevented from depending on the entry module
- Preserve trailing
.js
in external module names (e.g. highlight.js) (#155) - Fix naming bug with modules imported via both
resolvePath
and normal import (#156)
- Mutually dependent modules within a bundle are re-ordered based on whether one is referenced at the top level of the other (#152)
- Relative source URLs in sourcemaps are correct
src
directory included in npm package
resolvePath
option is not required to return a path (e.g.esperanto.toAmd({ code, ast })
) (#148)
- AST can be supplied when doing one-to-one transformations (e.g.
esperanto.toAmd({ code, ast })
) (#140) - Modules can be supplied directly when bundling, rather than reading from disk (docs here) (#140)
- 'use strict' pragma is omitted if
useStrict: false
option is supplied (#141)
- AST walker handles sparse arrays (#144)
- Reliable updating of exported expressions (#142)
- Renamed exports (
export { foo as bar }
) works - Internal tidy up/refactoring, resulting in smaller library
- Function arguments are considered when naming imports to avoid conflicts (#119)
- Bindings are always exported at the end of a module, regardless of re-assignments (#130)
- Generated import names cannot be shadowed by non-root-scope declarations (#133)
- Allow imports to be re-exported (#124)
- Fix npm versioning snafu
- Replaced estraverse with internal utility that doesn't depend on hardcoded node types to traverse AST (#129)
- Sourcemap comments are removed from bundles as well as one-to-one transformations (#120)
- Upgrade to acorn v1.x (#125)
- Sourcemap comments from prior transformations are removed (#120)
- Named function expressions are not erroneously renamed (#122)
- Sourcemap mappings are set explicitly - rather than mapping every single character, the locations from the acorn AST are used. As well as smaller sourcemaps, this results in modest performance improvements internally, and large performance improvements for external tools that work with the sourcemap
- Prevent import naming collisions (#116)
- Throw error on duplicate imports (#95)
- Prevent internal assigment exports clashing within a bundle (#117)
- Update chalk to 1.0.0
- Clashes with names for external dependencies are avoided (#114)
- The
sourceMapFile
requirement is waived whenoptions.sourceMap === 'inline'
(#105)
- Windows fixes
- Bundled external modules are deduplicated in the rare case that they import themselves (#103)
- Use robust
module.relativePath
internally rather thanmodule.file
- necessary for bundled external modules with dependencies of their own - Browser-flavoured version of Esperanto (
dist/esperanto.browser.js
) bundles ES6 dependencies (magic-string
and itsvlq
dependency), as both a convenience and a form of dogfooding
- The
resolvePath
option can be used withesperanto.bundle()
to locate modules, if they do not exist relative tobase
. It should return an absolute path as a string, or a promise that resolves to one (#68)
sourceMapFile
can be an absolute path, in which case it is left unchanged (#101)
- Module load order is guaranteed by import order - empty imports are represented by
__dep0__
etc within the module, orundefined
globally (#92) - Fix absolute path resolution in cases like
./../foo
(#97) - If
bundle.concat()
fails due to external dependencies, or exports from the entry module, the error message lists them
- Using the
_evilES3SafeReExports
will cause re-exported bindings to be done with direct property assignment rather thanObject.defineProperty()
. In most cases, the resulting behaviour will be no different, but it could result in undefined bindings in cases of cyclical dependencies, and values are fixed at the time of re-export rather than live.
- Conflicts between module names and unscoped (i.e. global) names and
exports
are prevented (#74), (#79) - Names in function expressions (as opposed to declarations) are disregarded (#73)
- Re-exports remain enumerable
- Continuous integration via Travis-CI
- Relative AMD dependency paths can be made absolute with
absolutePaths: true
- requiresamdName
to be specified (#58) - Within a bundle, built-in names like
Math
andPromise
are avoided (#70) - Bundle imports and exports are reported as
bundle.imports
andbundle.exports
(#59)
- Fixes duplicate import bug (#63)
- Module names are correctly escaped (#50)
- Accessing properties on top-level
this
throws error at parse time - CLI: if no
--output
option is given, bundle is written to stdout (if no separate sourcemap) (#60) - CLI: Better errors (#66)
- Test suite refactor
- Support for Windows file paths
bundle.concat()
can be called without an options argument- Options argument passed to
bundle.concat()
can includeintro
,outro
,indent
properties which will override defaults (indent: true
is equivalent to 'automatic', otherwise pass a string) - Bundle transform function can return an empty string
- Implement
bundle.concat()
for self-contained bundles (#48)
- UMD export detects CJS environment before AMD (#42)
this
at module top-level is replaced withundefined
, as per the spec (#43)- More compact CommonJS export
- Bundler transform function receives path as second argument
- One-to-one conversions get the same compact UMD form as bundles
- Default imports are not hedged unnecessarily (#40)
- More concise UMD output (#36)
- Functions are always exported early (#37)
- Modules can be transformed before bundling with
esperanto.bundle({ transform: someFunction })
, wheresomeFunction
returns either a string, or a promise that resolves to a string
- Classes are exported after declaration, not before (#33)
- Support for named AMD modules, via
amdName
option (works for both standalone and bundle conversions)
- No actual changes - just shuffling things about so we can separate demo page into separate repo
- Performance improvements and internal refactoring
- You can specify a
banner
and/orfooter
option when converting or bundling - An error will be thrown if a module attempts to import itself
- Imported objects (other than namespace imports) can be assigned properties (#29)
- Default imports can be exported as named exports from the entry module in a bundle
- Identifiers that match object prototype properties are not mistakenly exported (and garbled)
- Chained imports/exports are renamed correctly within a bundle (#17)
- Bundle exports are written at assignment time, rather than at the end of the bundle with an
Object.defineProperty
hack - Attempting to import a non-exported identifier within the same bundle throws an error
- External modules are imported correctly (#28)
- Identifiers are only rewritten as necessary (#25)
- Redundant assignments in a bundle (
mod__default = mod__foo
) are avoided (#14) - Shadowed imports are handled (#18)
- Modules are indented consistently within a bundle
- Update acorn (greater ES6 coverage) and estraverse dependencies - thanks @leebyron
- Adds
class
support - thanks @leebyron - Use
hasOwnProperty
check to prevent garbled output - thanks @leebyron
exports['default']
is used in favour ofexports.default
, for the benefit of IE8 - thanks @evs-chris
- In standalone conversions, import names are inferred from the source code where possible (batch/default imports), and will avoid naming collisions (#15)
- Fix missing closing parenthesis on strict mode UMD output
- Only print
defaultOnly
deprecation warning once, rather than flooding the console
- Parse errors (from acorn) are augmented with file info when bundling
- Added CLI files to npm package (oops!)
- Sourcemap support for bundles
- Command line interface
- Sourcemap support for one-to-one conversions
- Neater UMD exports
- Remove
addUseStrict
option (ES6 modules are always in strict mode)
- Started maintaining a changelog
- Complete rewrite!
- Spec-compliance - Esperanto now supports bindings and cycles (only in strict mode)
- The
defaultOnly
option has been deprecated - esperanto's standard behaviour is now to import and exports defaults. If you want to use named imports/exports, passstrict: true
(this basically means that your default export becomesexports.default
rather thanmodule.exports
). For more information see the wiki page on strict mode - UMD output: `esperanto.toUmd(es6source, {name:'myModule'});
- Bundling - see the wiki page on esperanto.bundle()