Following #167 I started a separate project, Rollup, which does a better job of bundling ES6 modules by only including the bits of code that are actually needed. Though it has a couple of known issues, I'm using it in a number of projects without problems.
Meanwhile Esperanto is continuing to rack up issues, and I don't have time to devote to maintaining two projects with basically the same goal. My intention here is to integrate Rollup into Esperanto (and remove all of Esperanto's bundling logic) so that we don't need to.
Before that can happen, Rollup needs a few features to be added and a few bugs (exposed by this process) to be fixed. That work is being tracked on https://github.com/rollup/rollup/pull/66.
Some changes that will fall out of this:
Better interoperability. Esperanto's 'strict/non-strict' dichotomy doesn't exist in Rollup – importing the default from an external module will work whether it's an ES6 module or not. Exports from a bundle can be default, named or (unless otherwise specified) auto, which makes it easy to author ES6 bundles that play well with existing environments
Self-executing bundles (Esperanto: bundle.concat(), Rollup: bundle.generate({ format: 'iife' })) can use external modules, if they're exposed to the global namespace. No need to generate UMD.
options.skip is no longer supported. I've come to view this option as a mistake anyway – better to use a custom loader instead.
Bundles will be smaller – in some cases, much smaller. Exposing Rollup to a wider audience through Esperanto may expose bugs in Rollup's bundling process, which is ultimately a good thing as long as it doesn't cause chaos in the meantime.
This doesn't affect one-to-one ES6 -> [AMD/CJS/UMD] conversions, only bundling. In future, it may make sense to remove bundling from Esperanto altogether, but this seemed like a more practical interim step.
not ready for merge
Following #167 I started a separate project, Rollup, which does a better job of bundling ES6 modules by only including the bits of code that are actually needed. Though it has a couple of known issues, I'm using it in a number of projects without problems.
Meanwhile Esperanto is continuing to rack up issues, and I don't have time to devote to maintaining two projects with basically the same goal. My intention here is to integrate Rollup into Esperanto (and remove all of Esperanto's bundling logic) so that we don't need to.
Before that can happen, Rollup needs a few features to be added and a few bugs (exposed by this process) to be fixed. That work is being tracked on https://github.com/rollup/rollup/pull/66.
Some changes that will fall out of this:
default
from an external module will work whether it's an ES6 module or not. Exports from a bundle can bedefault
,named
or (unless otherwise specified)auto
, which makes it easy to author ES6 bundles that play well with existing environmentsbundle.concat()
, Rollup:bundle.generate({ format: 'iife' })
) can use external modules, if they're exposed to the global namespace. No need to generate UMD.options.skip
is no longer supported. I've come to view this option as a mistake anyway – better to use a custom loader instead.This doesn't affect one-to-one ES6 -> [AMD/CJS/UMD] conversions, only bundling. In future, it may make sense to remove bundling from Esperanto altogether, but this seemed like a more practical interim step.