StealJS 1.0 Beta

We’ve just released the beta version of Steal and StealTools 1.0. You can install them with:

npm install steal@beta steal-tools@beta

We’re releasing this as beta now to garner feedback, find any critical bugs that may exist, before releasing the official 1.0.

Breaking changes

npm 3 is the new default

npm 2 created a breaking change to the way modules are installed in your local node_modules folder. Steal’s npm plugin can handle either npm 2 or npm 3 using the npmAlgorithm flag. In 1.0 npm 3 will be the default; if you are using 2 (which comes with Node <= 0.12 and Node 4) you can specify this by setting your config to:

{
  "system": {
    "npmAlgorithm": "nested"
  }
}

Babel is now the default transpiler

Previously traceur was the default transpiler, but we’ve found that most people switched to Babel. If you’d like to continue to use traceur you can set it in your package.json:

{
  "system": {
    "transpiler": "traceur"
  }
}

Grunt tasks moved to a separate project

The grunt tasks for production builds are now in their own project, grunt-steal, and were removed from steal-tools. You can install them with:

npm install grunt-steal@beta --save-dev

Otherwise they work exactly the same as before.

New features

script type=text/steal-module

If you want to add a module to your page that Steal will run after it has started up you can now add these script tags:

<script type="text/steal-module">
  import _ from 'lodash';

  ... 
</script>

Add as many to the page as you need, all will be run once the app is configured and started.

~ based lookup

Like how in the filesystem you can use ~/foo.txt to refer to a file in your Home directory, now you can do the same to refer to a module in your project’s root folder. Complicated relative lookups become much simplier:

Before

import foo from "../../../../foo";

Becomes:

import foo from "~/foo";

ES import {} syntax works on non-ES

Previously if you were importing a CommonJS module you would have to do something like:

import mod from "math";

const { add } = mod;

To get the exported add function. Now you can use the simpler destructor syntax:

import { add } from "math";

Upgraded to Babel 6

If you are using Babel as your transpiler, we’ve upgraded Steal’s version to 6. This means you can use all of the newest ES2015/ES2016 features that are included. Additionally JSX is turned on by default.

Node built-in modules are included

Some modules depend on Node builtin modules such as http or events, in 1.0 these can be used with no additional configuration needed on your part:

var Emitter = require("events").Emitter;
3 Likes

Great stuff guys! Well done)

1 Like

We’re now at the release candidate phase of 1.0, which you can install with:

npm install steal@rc steal-tools@rc --save-dev

There’s still a few things we want to get in before releasing 1.0, but none of which should be backwards incompatible. Please install and file any bugs you find.