shunter
Version:
A Node.js application built to read JSON and translate it into HTML
50 lines (27 loc) • 1.66 kB
Markdown
Shunter Migration Guide, 1.0 to 2.0
===================================
This guide outlines how to migrate from Shunter 1.x to Shunter 2.x. It outlines breaking changes which might cause issues when you upgrade.
Template Testing
----------------
The DOM library used in [template testing](../usage/testing.md#testing-templates) has changed from jsdom to [Cheerio](https://github.com/cheeriojs/cheerio). This brings us closer to supporting Node.js 4.x.
The `dom` object that you access in template tests is now a Cheerio instance, and regualar DOM access is no longer available. You may need to update your tests.
One notable change is that the `:first` and `:last` pseudo-selectors are no longer available in `$()` and `.find()` calls. You're encouraged to use the `.first()` and `.last()` methods of a Cheerio instance instead.
PhantomJS
---------
PhantomJS installation has been removed from Shunter, which means that `shunter-test-client` will not run unless you have installed PhantomJS separately.
EJS Extension Changes
---------------------
EJS extensions now receive three parameters rather than two. The original parameter ordering was:
```js
function (environment, config) {}
```
Now it's:
```js
function (environment, manifest, config) {}
```
See [Writing EJS Extensions](../usage/resources.md#writing-ejs-extensions) for more information.
CSS Compilation Changes
-----------------------
CSS files built by Shunter no longer have automatic `rem` to `px` replacement for older browsers.
Also, small image assets are no longer inlined as Base64 URLs.
Both of these can be replaced using an EJS extension in your application.