@matthewp matthewp released this Jul 19, 2018 · 54 commits to master since this release

Assets 2

This is the second major release of steal, but has minimal number of breaking changes.

Check out the migration guide and upgrade today.

Major features

Native promises by default

In 1.0 the steal.js script included a polyfill for Promises. To use native promises you would need to use steal-sans-promises.js instead.

In 2.0 that relationship is flipped. steal.js does not contain a polyfill and using steal-with-promises.js will give you it.

Tree shaking

Tree shaking is available in steal 2.0. Any time steal encounters a module that only exports from other modules it will follow that modules dependants and remove any unused imports. This will help when consuming a module that just imports from a lot of children. For builds (discussed in the steal-tools 2.0.0 release notes) this will reduce the size of bundles.

Support for .mjs scripts

With native modules now available in browers, some people are starting to use the file extension .mjs for modules using the import/export statement. In 2.0 this modules can be consumed from a steal app.

Breaking changes

In addition to the polyfill change, there is one other breaking change.

The main is no longer automatically loaded.

Previously steal.js would always try to load the application's main. This was convenient when getting started but causes problems in larger apps with multiple pages, not all of them wanting the main to load.

So in 2.0, you have to add a main in your script tag. You can either be explicit about what to load:

<script src="node_modules/steal/steal.js" main="~/app"></script>

Or you can use the boolean attribute and steal.js will load your package.json main, as it would do in 1.x:

<script src="node_modules/steal/steal.js" main></script>