Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
This is the second major release of steal, but has minimal number of breaking changes.
Check out the migration guide and upgrade today.
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
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 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.
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>