Keystone-classic: Replace jade with pug

Created on 12 Apr 2016  路  13Comments  路  Source: keystonejs/keystone-classic

The jade project has now moved to pug.

bug

Most helpful comment

Speaking as a Pug team member, the deprecation is a warning anyway, so no need to worry about it; I get tons of these every time I install, for example, Express, which has optional dependencies I can't install due to a lack of C++ compilers on my server.

All 13 comments

The terminal error is:
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade

Actually looks like keystone core also includes some jade specific stuff. https://github.com/keystonejs/keystone/blob/811e6b3e0914562440f8866feb57fbd5a2211a04/lib/core/render.js#L17

https://github.com/keystonejs/keystone/search?utf8=%E2%9C%93&q=jade

@JedWatson shouldn't keystone-core be template agnostic?

There is a single one remaining with #2566, admin/server/templates/index.jade.

1.x will continue to be on npm as jade. 2.x will only be available as pug.

should this be held off until the pug 2.0.0 release?

renaming "jade": "1.11.0" to "pug": "1.11.0" in package.json will result in an npm error and it doesn't appear to be as simple as renaming files especially if there are major changes between 1.11.0 and 2.0.0

same to keystonejs/generator-keystone#169

I work a project on Google App Engine and it complains deprecated Jade every time when deploy, please fix it @JedWatson

@yao23 as you can see from @pll33's comment, this is nothing we can fix just yet. You'll have to live with the warnings for now!

Speaking as a Pug team member, the deprecation is a warning anyway, so no need to worry about it; I get tons of these every time I install, for example, Express, which has optional dependencies I can't install due to a lack of C++ compilers on my server.

You can use anyway for your keystone website, just install pug by npm install --save pug and set the "view engine" to "pug" in your keystone.init object.

We've removed jade as a dependency in the main keystone repo, so you don't get this anymore unless you also install the devDependencies (because one of those also depends on Jade)

This is a _potentially slightly_ breaking change for 4.0, as you'll need to ensure the dependency is included in your project if you're using jade as your template engine (previously this would have "accidentally" worked without the explicit dependency, most of the time). I've made a note in the upgrade guide.

I'm thinking we'll update the generator to Pug in either the next major release of it, or when Pug's also out of beta (currently 6), in the meantime the choice is in your hands :)

Nice! Does this mean that pug is the default "view engine"?

In case of this "potentially slightly breaking" thing to happen while upgrading, my guess is that it will work with installing jade as a dependency and setting "jade" as a "view engine" in the keystone.init object?

It actually means we don't ship a default "view engine" - that's all up to your app, but express will infer the engine from your template extension if you don't explicitly set it.

The only thing you'll need to do (if anything) is install jade as a dependency in your project directly, if it's not. If you used the generator you should be fine.

(fwiw - this is all of the top of my head)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Twansparant picture Twansparant  路  5Comments

christroutner picture christroutner  路  4Comments

schybo picture schybo  路  3Comments

zhdan88vadim picture zhdan88vadim  路  5Comments

ttsirkia picture ttsirkia  路  4Comments