metalsmith / layouts

A metalsmith plugin for layouts
MIT License
116 stars 49 forks source link

Migrate to jstransformer #96

Closed jmatsushita closed 8 years ago

jmatsushita commented 8 years ago

Hi there,

I had slow rendering times with a site using the jade/pug engine with metalsmith-layouts.

Using metalsmith-jstransformer-layouts helped speed up the rendering time of a jade metalsmith site previously using metalsmith-layouts from 9s to 2.9s.

I've done some early work that would allow to make metalsmith-jstransformer-layouts a drop in replacement for metalsmith-layouts.

I'm not sure that jstransformer covers all the rendering engines that consolidate.js does but it does cover a large amount of them and is fast.

Maybe it would be worth considering making the default metalsmith rendering engine migrate to jstransformer?

Cheers!

Jun

doodzik commented 8 years ago

do you have reproducible benchmarks?

jmatsushita commented 8 years ago

I'm afraid I don't! I only tested with one project. If there was a fixture to stress metalsmith-layouts then I'd be happy to run the fork of metalsmith-jstransformer-layouts in it!

doodzik commented 8 years ago

I think that the way to go here would be to make consolidate.js the default and that you can add your engine of choice as a dependency injection. if something even faster comes along we won't need to rewrite the whole library ;)

If you want you can open a PR with that change. I wouldn't be opposed to it.

ismay commented 8 years ago

Switching could also be an option if there are no breaking changes. If there are however, it would have to be significantly better than consolidate to justify breaking features.

doodzik commented 8 years ago

@jmatsushita are you still interested in helping on adding jstransformer to this metalsmith-layouts?

further discussion is going to take place on the issue #100

jmatsushita commented 8 years ago

Sorry @doodzik I don't have time to help on implementation. Very happy to test though.